Subversion Repositories SmartDukaan

Rev

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

Rev 18647 Rev 18658
Line 1668... Line 1668...
1668
                order.cod = False                
1668
                order.cod = False                
1669
            session.commit()
1669
            session.commit()
1670
            return "True"
1670
            return "True"
1671
        __amend_fulfilment_warehouse(order)
1671
        __amend_fulfilment_warehouse(order)
1672
        __update_transfer_price(order, order.fulfilmentWarehouseId)
1672
        __update_transfer_price(order, order.fulfilmentWarehouseId)
-
 
1673
        
-
 
1674
        if order.orderType == OrderType.B2B:
-
 
1675
            user_client = UserClient().get_client()
-
 
1676
            if user_client.isPrivateDealUser(order.customer_id):
-
 
1677
                billing_address = user_client.getBillingAddressForUser(order.customer_id)
-
 
1678
                if billing_address is not None:
-
 
1679
                    if billing_address.state.strip()!=order.customer_state.strip():
-
 
1680
                        order.orderType=OrderType.B2C
1673
                
1681
               
1674
        session.commit()
1682
        session.commit()
1675
            
1683
            
1676
        '''
1684
        '''
1677
        if order.logistics_provider_id != 7 and order.airwaybill_no is None or order.airwaybill_no == "null":
1685
        if order.logistics_provider_id != 7 and order.airwaybill_no is None or order.airwaybill_no == "null":
1678
            logistics_client = LogisticsClient().get_client()
1686
            logistics_client = LogisticsClient().get_client()
Line 8195... Line 8203...
8195
    for order in ordersList:
8203
    for order in ordersList:
8196
        update_order_AWB(order.id, awbNumber)
8204
        update_order_AWB(order.id, awbNumber)
8197
        order.logisticsTransactionId = str(order.transaction_id)+"-"+str(txnSeqRequired)
8205
        order.logisticsTransactionId = str(order.transaction_id)+"-"+str(txnSeqRequired)
8198
                
8206
                
8199
    session.commit()
8207
    session.commit()
-
 
8208
    
-
 
8209
    singleOrder = ordersList[0]
-
 
8210
    if singleOrder.orderType == OrderType.B2B:
-
 
8211
        user_client = UserClient().get_client()
-
 
8212
        if user_client.isPrivateDealUser(singleOrder.customer_id):
-
 
8213
            billing_address = user_client.getBillingAddressForUser(singleOrder.customer_id)
-
 
8214
            if billing_address is not None:
-
 
8215
                if billing_address.state.strip()!=singleOrder.customer_state.strip():
-
 
8216
                    totalOrders = get_orders_for_transaction(singleOrder.transaction.id, singleOrder.customer_id)
-
 
8217
                    for order in totalOrders:
-
 
8218
                        order.orderType=OrderType.B2C
-
 
8219
    session.commit()   
8200
         
8220
         
8201
    return True
8221
    return True
8202
 
8222
 
8203
def get_group_orders_by_logistics_txn_id(logisticsTxnId):
8223
def get_group_orders_by_logistics_txn_id(logisticsTxnId):
8204
    orders = Order.query.filter(Order.logisticsTransactionId==logisticsTxnId).all()
8224
    orders = Order.query.filter(Order.logisticsTransactionId==logisticsTxnId).all()