Subversion Repositories SmartDukaan

Rev

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

Rev 19691 Rev 19693
Line 9293... Line 9293...
9293
        raise TransactionServiceException(115, "Order not allowed to be split")
9293
        raise TransactionServiceException(115, "Order not allowed to be split")
9294
    
9294
    
9295
    new_order = __clone_order(order, False, order.cod, False)
9295
    new_order = __clone_order(order, False, order.cod, False)
9296
    
9296
    
9297
    new_order.lineitems[0].quantity = split_order_quantity
9297
    new_order.lineitems[0].quantity = split_order_quantity
-
 
9298
    new_order.logistics_provider_id = order.logistics_provider_id
-
 
9299
    new_order.lineitems[0].logisticsCost = round((order.lineitems[0].logisticsCost/order.lineitems[0].quantity)*split_order_quantity,2)
-
 
9300
    order.lineitems[0].logisticsCost = order.lineitems[0].logisticsCost - new_order.lineitems[0].logisticsCost
-
 
9301
    if order.cod:
-
 
9302
        new_order.lineitems[0].codCollectionCharges = round((order.lineitems[0].codCollectionCharges/order.lineitems[0].quantity)*split_order_quantity,2)
-
 
9303
        order.lineitems[0].codCollectionCharges = order.lineitems[0].codCollectionCharges - new_order.lineitems[0].codCollectionCharges
-
 
9304
 
9298
    new_order.lineitems[0].total_price = new_order.lineitems[0].unit_price*split_order_quantity
9305
    new_order.lineitems[0].total_price = new_order.lineitems[0].unit_price*split_order_quantity
9299
    new_order.lineitems[0].total_weight = new_order.lineitems[0].unit_weight*split_order_quantity
9306
    new_order.lineitems[0].total_weight = new_order.lineitems[0].unit_weight*split_order_quantity
9300
    new_order.total_amount = new_order.lineitems[0].total_price
9307
    new_order.total_amount = new_order.lineitems[0].total_price
9301
    new_order.total_weight = new_order.lineitems[0].total_weight
9308
    new_order.total_weight = new_order.lineitems[0].total_weight
9302
    new_order.shippingCost = round((order.shippingCost/order.lineitems[0].quantity)*split_order_quantity,0)
9309
    new_order.shippingCost = round((order.shippingCost/order.lineitems[0].quantity)*split_order_quantity,0)
Line 9305... Line 9312...
9305
    order.lineitems[0].total_price = order.lineitems[0].unit_price * order.lineitems[0].quantity
9312
    order.lineitems[0].total_price = order.lineitems[0].unit_price * order.lineitems[0].quantity
9306
    order.lineitems[0].total_weight = order.lineitems[0].unit_weight*order.lineitems[0].quantity
9313
    order.lineitems[0].total_weight = order.lineitems[0].unit_weight*order.lineitems[0].quantity
9307
    order.total_amount = order.lineitems[0].total_price
9314
    order.total_amount = order.lineitems[0].total_price
9308
    order.total_weight = order.lineitems[0].total_weight
9315
    order.total_weight = order.lineitems[0].total_weight
9309
    order.shippingCost = order.shippingCost - new_order.shippingCost
9316
    order.shippingCost = order.shippingCost - new_order.shippingCost
9310
    
9317
        
9311
    new_order.logistics_provider_id = order.logistics_provider_id
-
 
9312
    new_order.lineitems[0].logisticsCost = round((order.lineitems[0].logisticsCost/order.lineitems[0].quantity)*split_order_quantity,2)
-
 
9313
    order.lineitems[0].logisticsCost = order.lineitems[0].logisticsCost - new_order.lineitems[0].logisticsCost
-
 
9314
    if order.cod:
-
 
9315
        new_order.lineitems[0].codCollectionCharges = round((order.lineitems[0].codCollectionCharges/order.lineitems[0].quantity)*split_order_quantity,2)
-
 
9316
        order.lineitems[0].codCollectionCharges = order.lineitems[0].codCollectionCharges - new_order.lineitems[0].codCollectionCharges
-
 
9317
    
-
 
9318
    if order.status == OrderStatus.ACCEPTED:
9318
    if order.status == OrderStatus.ACCEPTED:
9319
        new_order.status = order.status
9319
        new_order.status = order.status
9320
        new_order.statusDescription = order.statusDescription
9320
        new_order.statusDescription = order.statusDescription
9321
        new_order.accepted_timestamp = order.accepted_timestamp
9321
        new_order.accepted_timestamp = order.accepted_timestamp
9322
        new_order.logisticsTransactionId = order.logisticsTransactionId
9322
        new_order.logisticsTransactionId = order.logisticsTransactionId