# Path: my.py
# def curdate2my():
#     t=time.localtime()
#     return str(t.tm_year)+'-'+str(t.tm_mon).rjust(2,"0")+'-'+str(t.tm_mday).rjust(2,"0")


import httplib, urllib,time
import requests
import xml.etree.ElementTree as etree
import re
import dbIceCash as db
from icelog import *
from my import curdate2my
from datetime import datetime
        self.url=self._get_ticket()

        if self.url=="" or self.sign=="":
            return False
        return r

    def _send_move(self,id):
        if not self._connect():
            return False
        xml=self._make_move(id)
        if xml=="":
            return False
        r=self._sendxml("move.xml","/opt/in/WayBill_v2",xml)

        reply_id=self._get_ticket()

        if reply_id!="":
            self.db.egais_docs_hd_upd(id,{'status':3,'reply_id':reply_id})
        return r

    def _create_return(self,id,idd):
        if self.db.egais_get_mydoc(id):
            struct={\
            "type":1,\
            "status":1,\
            "ns_FSRAR_ID"       :self.db.egais_doc_hd['recv_RegId'],\
            "wb_Identity"       :"0",\
            "ns_typedoc"        :"WayBill_v2",\
            
            "wb_Date"           :curdate2my(),\

# Path: my.py
# def curdate2my():
#     t=time.localtime()
#     return str(t.tm_year)+'-'+str(t.tm_mon).rjust(2,"0")+'-'+str(t.tm_mday).rjust(2,"0")


# Path: clientEgais.py
import httplib, urllib,time
import requests
import xml.etree.ElementTree as etree
import re
import dbIceCash as db
from icelog import *
from my import curdate2my
from datetime import datetime

        self.url=self._get_ticket()

        if self.url=="" or self.sign=="":
            return False
        return r

    def _send_move(self,id):
        if not self._connect():
            return False
        xml=self._make_move(id)
        if xml=="":
            return False
        r=self._sendxml("move.xml","/opt/in/WayBill_v2",xml)

        reply_id=self._get_ticket()

        if reply_id!="":
            self.db.egais_docs_hd_upd(id,{'status':3,'reply_id':reply_id})
        return r

    def _create_return(self,id,idd):
        if self.db.egais_get_mydoc(id):
            struct={\
            "type":1,\
            "status":1,\
            "ns_FSRAR_ID"       :self.db.egais_doc_hd['recv_RegId'],\
            "wb_Identity"       :"0",\
            "ns_typedoc"        :"WayBill_v2",\
            
            "wb_Date"           :curdate2my(),\

            "wb_ShippingDate"   :curdate2my(),\