Subversion Repositories SmartDukaan

Rev

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

Rev 21151 Rev 21153
Line 9591... Line 9591...
9591
                            OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT, 
9591
                            OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT, 
9592
                            OrderStatus.CAPTURE_IN_PROCESS, OrderStatus.REJECTED]:
9592
                            OrderStatus.CAPTURE_IN_PROCESS, OrderStatus.REJECTED]:
9593
        raise TransactionServiceException(115, "Order not allowed to be split")
9593
        raise TransactionServiceException(115, "Order not allowed to be split")
9594
    
9594
    
9595
    new_order = __copy_order(order)
9595
    new_order = __copy_order(order)
-
 
9596
    new_order.originalOrderId=order.id
9596
    
9597
    
9597
    new_order.lineitems[0].quantity = split_order_quantity
9598
    new_order.lineitems[0].quantity = split_order_quantity
9598
    new_order.logistics_provider_id = order.logistics_provider_id
9599
    new_order.logistics_provider_id = order.logistics_provider_id
9599
    new_order.lineitems[0].logisticsCost = round((order.lineitems[0].logisticsCost/order.lineitems[0].quantity)*split_order_quantity,2)
9600
    new_order.lineitems[0].logisticsCost = round((order.lineitems[0].logisticsCost/order.lineitems[0].quantity)*split_order_quantity,2)
9600
    order.lineitems[0].logisticsCost = order.lineitems[0].logisticsCost - new_order.lineitems[0].logisticsCost
9601
    order.lineitems[0].logisticsCost = order.lineitems[0].logisticsCost - new_order.lineitems[0].logisticsCost
Line 11610... Line 11611...
11610
            order.net_payable_amount -= order.shippingCost
11611
            order.net_payable_amount -= order.shippingCost
11611
            order.shippingCost = 0 
11612
            order.shippingCost = 0 
11612
            #Self Pickup
11613
            #Self Pickup
11613
            order.logistics_provider_id = 4 
11614
            order.logistics_provider_id = 4 
11614
            #__refund_shipping(list(transaction.orders), False)
11615
            #__refund_shipping(list(transaction.orders), False)
11615
            order.shippi    
11616
            #order.shippi    
11616
        session.commit()
11617
        session.commit()
11617
        session.close()    
11618
        session.close()    
11618
if __name__ == '__main__':
11619
if __name__ == '__main__':
11619
    DataService.initialize()
11620
    DataService.initialize()
11620
    #transaction_ids=[1030084,1030087,1030090,1030093,1030096,1030099,1030102,1030105,1030108,1030111,1030114,1030117,1030120,1030123,1030144,1030147,1030153]
11621
    #transaction_ids=[1030084,1030087,1030090,1030093,1030096,1030099,1030102,1030105,1030108,1030111,1030114,1030117,1030120,1030123,1030144,1030147,1030153]