コード例 #1
0
def save_2():
    sender = CounterpartyContact()
    sender.setCity('8d5a980d-391c-11dd-90d9-001a92567626')\
        .setRef('f867c762-e66a-11e3-8c4a-0050568002cf')\
        .setAddress('1ec09d88-e1c2-11e3-8c4a-0050568002cf')\
        .setContact('e23f313c-e67a-11e3-8c4a-0050568002cf')\
        .setPhone('+380660000000')

    recipient = CounterpartyContact()
    recipient.setCity('db5c88de-391c-11dd-90d9-001a92567626')\
        .setRef('7da56a9c-f205-11e3-8c4a-0050568002cf')\
        .setAddress('daec7561-b457-11e4-a77a-005056887b8d')\
        .setContact('57065334-f211-11e3-8c4a-0050568002cf')\
        .setPhone('+380660000001')

    backwardDeliveryData1 = BackwardDeliveryData()
    backwardDeliveryData1.setPayerType('Sender')\
        .setCargoType('Other')\
        .setRedeliveryString('Чемодан')

    trayCargoA = Cargo()
    trayCargoA.setAmount(3)\
        .setCargoDescription('d5c36c5d-a29d-11de-a2ca-000c294065a1')

    trayCargoE = Cargo()
    trayCargoE.setAmount(1)\
        .setCargoDescription('d5c36c5c-a29d-11de-a2ca-000c294065a1')

    backwardDeliveryData2 = BackwardDeliveryData()
    backwardDeliveryData2.setPayerType('Sender')\
        .setCargoType('Trays')\
        .setRedeliveryString('Поддони( тара )')\
        .addTray(trayCargoA)\
        .addTray(trayCargoE)

    internetDocument = InternetDocument()
    internetDocument.setSender(sender)\
        .setRecipient(recipient)\
        .setServiceType('WarehouseDoors')\
        .setPayerType('Recipient')\
        .setPaymentMethod('Cash')\
        .setCargoType('Documents')\
        .setWeight('0.5')\
        .setSeatsAmount('1')\
        .setCost('200')\
        .setDescription('ТЦ')\
        .addBackwardDeliveryData(backwardDeliveryData2)\
        .addBackwardDeliveryData(backwardDeliveryData1)

    return internetDocument.save()
コード例 #2
0
def save_5():
    sender = CounterpartyContact()
    sender.setCity('8d5a980d-391c-11dd-90d9-001a92567626')\
        .setRef('f867c762-e66a-11e3-8c4a-0050568002cf')\
        .setAddress('1ec09d88-e1c2-11e3-8c4a-0050568002cf')\
        .setContact('e23f313c-e67a-11e3-8c4a-0050568002cf')\
        .setPhone('+380660000000')

    recipient = CounterpartyContact()
    recipient.setCity('db5c88de-391c-11dd-90d9-001a92567626')\
        .setRef('7da56a9c-f205-11e3-8c4a-0050568002cf')\
        .setAddress('daec7561-b457-11e4-a77a-005056887b8d')\
        .setContact('57065334-f211-11e3-8c4a-0050568002cf')\
        .setPhone('+380660000001')

    tiresWheels1 = Cargo()
    tiresWheels1.setAmount(2)\
        .setCargoDescription('20f7b625-9add-11e3-b441-0050568002cf')

    tiresWheels2 = Cargo()
    tiresWheels2.setAmount(2)\
        .setCargoDescription('20f7b627-9add-11e3-b441-0050568002cf')

    tiresWheels3 = Cargo()
    tiresWheels3.setAmount(5)\
        .setCargoDescription('d7c456c6-aa8b-11e3-9fa0-0050568002cf')

    tiresWheels4 = Cargo()
    tiresWheels4.setAmount(1)\
        .setCargoDescription('d7c456ca-aa8b-11e3-9fa0-0050568002cf')

    internetDocument = InternetDocument()
    internetDocument.setSender(sender)\
        .setRecipient(recipient)\
        .setServiceType('WarehouseDoors')\
        .setPayerType('Recipient')\
        .setPaymentMethod('Cash')\
        .setCargoType('TiresWheels')\
        .setCost('200')\
        .setDescription('ТЦ')\
        .addCargoDetail(tiresWheels1)\
        .addCargoDetail(tiresWheels2)\
        .addCargoDetail(tiresWheels3)\
        .addCargoDetail(tiresWheels4)

    return internetDocument.save()