Subversion Repositories SmartDukaan

Rev

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

Rev 21153 Rev 21154
Line 9630... Line 9630...
9630
        
9630
        
9631
        first_order.wallet_amount = min(first_order.total_amount + first_order.shippingCost, wallet_amount)
9631
        first_order.wallet_amount = min(first_order.total_amount + first_order.shippingCost, wallet_amount)
9632
        first_order.net_payable_amount = first_order.total_amount + first_order.shippingCost - first_order.wallet_amount
9632
        first_order.net_payable_amount = first_order.total_amount + first_order.shippingCost - first_order.wallet_amount
9633
        second_order.wallet_amount = wallet_amount - first_order.wallet_amount
9633
        second_order.wallet_amount = wallet_amount - first_order.wallet_amount
9634
        second_order.net_payable_amount = second_order.total_amount + second_order.shippingCost - second_order.wallet_amount
9634
        second_order.net_payable_amount = second_order.total_amount + second_order.shippingCost - second_order.wallet_amount
-
 
9635
    #Add attributes during split    
-
 
9636
    attributes = Attribute.query.filter(Attribute.orderId == order.id).all()
9635
     
9637
    if attributes:
9636
        
9638
        for attribute in attributes:
-
 
9639
            newattribute = Attribute()
-
 
9640
            newattribute.orderId = new_order.id
-
 
9641
            newattribute.name = attribute.name 
-
 
9642
            newattribute.value = attribute.value
9637
        
9643
        
9638
    session.commit()
9644
    session.commit()
9639
    inventoryClient = InventoryClient().get_client()
9645
    inventoryClient = InventoryClient().get_client()
9640
    inventoryClient.reserveItemInWarehouse(new_order.lineitems[0].item_id, new_order.fulfilmentWarehouseId, sourceId, new_order.id, to_java_date(new_order.created_timestamp), to_java_date(new_order.promised_shipping_time), new_order.lineitems[0].quantity)
9646
    inventoryClient.reserveItemInWarehouse(new_order.lineitems[0].item_id, new_order.fulfilmentWarehouseId, sourceId, new_order.id, to_java_date(new_order.created_timestamp), to_java_date(new_order.promised_shipping_time), new_order.lineitems[0].quantity)
9641
    inventoryClient.reduceReservationCount(order.lineitems[0].item_id, order.fulfilmentWarehouseId, sourceId, order.id, new_order.lineitems[0].quantity)
9647
    inventoryClient.reduceReservationCount(order.lineitems[0].item_id, order.fulfilmentWarehouseId, sourceId, order.id, new_order.lineitems[0].quantity)