Subversion Repositories SmartDukaan

Rev

Rev 20823 | Rev 21099 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20823 Rev 20824
Line 53... Line 53...
53
        tc = TransactionClient().get_client()
53
        tc = TransactionClient().get_client()
54
        info = tc.getBuyerByWarehouse(warehouse_id)
54
        info = tc.getBuyerByWarehouse(warehouse_id)
55
        if info is None:
55
        if info is None:
56
            raise RuntimeError("Buyer address mapping is None")
56
            raise RuntimeError("Buyer address mapping is None")
57
        ship = get_client().factory.create('ns2:Shipper')
57
        ship = get_client().factory.create('ns2:Shipper')
58
        ship.CustomerName = info.organisationName 
-
 
59
        ship.CustomerAddress1 = info.buyerAddress.address[:30]
58
        ship.CustomerAddress1 = info.buyerAddress.address[:30]
60
        ship.CustomerAddress2 = info.buyerAddress.address[30:60]
59
        ship.CustomerAddress2 = info.buyerAddress.address[30:60]
61
        ship.CustomerAddress3 = info.buyerAddress.address[60:90]
60
        ship.CustomerAddress3 = info.buyerAddress.address[60:90]
62
        ship.CustomerCode = "316326"
61
        ship.CustomerCode = "316326"
63
        ship.CustomerMobile = info.buyerAddress.contact_number
62
        ship.CustomerMobile = info.buyerAddress.contact_number
Line 65... Line 64...
65
        ship.OriginArea = "FAR"
64
        ship.OriginArea = "FAR"
66
        ship.CustomerPincode = info.buyerAddress.pin
65
        ship.CustomerPincode = info.buyerAddress.pin
67
        info.organisationName = info.organisationName+" "
66
        info.organisationName = info.organisationName+" "
68
        temp_org = info.organisationName.split(" ")
67
        temp_org = info.organisationName.split(" ")
69
        ship.Sender = (xstr(temp_org[0])+" "+xstr(temp_org[1])).strip()
68
        ship.Sender = (xstr(temp_org[0])+" "+xstr(temp_org[1])).strip()
-
 
69
        ship.CustomerName = ship.Sender
70
        ship.CustomerTelephone= info.buyerAddress.contact_number 
70
        ship.CustomerTelephone= info.buyerAddress.contact_number 
71
        shipperMap[warehouse_id] = ship
71
        shipperMap[warehouse_id] = ship
72
    return shipperMap.get(warehouse_id)
72
    return shipperMap.get(warehouse_id)
73
 
73
 
74
def create_commodity_obj(orders_list, cd, ser):
74
def create_commodity_obj(orders_list, cd, ser):