Subversion Repositories SmartDukaan

Rev

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

Rev 20959 Rev 20963
Line 9588... Line 9588...
9588
                            OrderStatus.LOW_INV_REVERSAL_IN_PROCESS, 
9588
                            OrderStatus.LOW_INV_REVERSAL_IN_PROCESS, 
9589
                            OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT, 
9589
                            OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT, 
9590
                            OrderStatus.CAPTURE_IN_PROCESS, OrderStatus.REJECTED]:
9590
                            OrderStatus.CAPTURE_IN_PROCESS, OrderStatus.REJECTED]:
9591
        raise TransactionServiceException(115, "Order not allowed to be split")
9591
        raise TransactionServiceException(115, "Order not allowed to be split")
9592
    
9592
    
9593
    new_order = __clone_order(order, False, order.cod, False)
9593
    new_order = __copy_row(Order, order, [id])
9594
    
9594
    
9595
    new_order.lineitems[0].quantity = split_order_quantity
9595
    new_order.lineitems[0].quantity = split_order_quantity
9596
    new_order.logistics_provider_id = order.logistics_provider_id
9596
    new_order.logistics_provider_id = order.logistics_provider_id
9597
    new_order.lineitems[0].logisticsCost = round((order.lineitems[0].logisticsCost/order.lineitems[0].quantity)*split_order_quantity,2)
9597
    new_order.lineitems[0].logisticsCost = round((order.lineitems[0].logisticsCost/order.lineitems[0].quantity)*split_order_quantity,2)
9598
    order.lineitems[0].logisticsCost = order.lineitems[0].logisticsCost - new_order.lineitems[0].logisticsCost
9598
    order.lineitems[0].logisticsCost = order.lineitems[0].logisticsCost - new_order.lineitems[0].logisticsCost
Line 11398... Line 11398...
11398
    if cod:
11398
    if cod:
11399
        return c_returnMap.values()
11399
        return c_returnMap.values()
11400
    else:
11400
    else:
11401
        return p_returnMap.values()
11401
        return p_returnMap.values()
11402
 
11402
 
-
 
11403
def __copy_row(model, row, ignored_columns=[]):
-
 
11404
    copy = model()
-
 
11405
 
-
 
11406
    for col in row.__table__.columns:
-
 
11407
        if col.name not in ignored_columns:
-
 
11408
            try:
-
 
11409
                copy.__setattr__(col.name, getattr(row, col.name))
-
 
11410
            except Exception as e:
-
 
11411
                print e
-
 
11412
                continue
-
 
11413
 
-
 
11414
    return copy
-
 
11415
 
11403
 
11416
 
11404
 
11417
 
11405
if __name__ == '__main__':
11418
if __name__ == '__main__':
11406
    #DataService.initialize()
11419
    #DataService.initialize()
11407
    get_billed_orders_for_manifest_gen(7441, 2, True)
11420
    get_billed_orders_for_manifest_gen(7441, 2, True)