Subversion Repositories SmartDukaan

Rev

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

Rev 18805 Rev 19004
Line 112... Line 112...
112
    create_homeshop_order, get_homeshop_order, split_bulk_order, move_orders_to_correct_warehouse, \
112
    create_homeshop_order, get_homeshop_order, split_bulk_order, move_orders_to_correct_warehouse, \
113
    verify_orders_for_transaction, get_creditor_info, update_creditor_info, get_user_sanction_details, \
113
    verify_orders_for_transaction, get_creditor_info, update_creditor_info, get_user_sanction_details, \
114
    update_user_sanction, get_credit_history_records, process_credit_transaction, \
114
    update_user_sanction, get_credit_history_records, process_credit_transaction, \
115
    get_loan_payable_for_user_to_creditor, get_loan_history_records, \
115
    get_loan_payable_for_user_to_creditor, get_loan_history_records, \
116
    process_loan_transaction, get_credit_history_records_paginated, get_loan_history_records_paginated, \
116
    process_loan_transaction, get_credit_history_records_paginated, get_loan_history_records_paginated, \
117
    get_user_sanction_details_paginated
117
    get_user_sanction_details_paginated, get_orders_in_batch_as_promised_shipping
118
from shop2020.model.v1.order.impl.DataService import DtrBatchCreditTracker
118
from shop2020.model.v1.order.impl.DataService import DtrBatchCreditTracker
119
from shop2020.model.v1.order.impl.model.DTHRechargeOrder import DTHRechargeOrder
119
from shop2020.model.v1.order.impl.model.DTHRechargeOrder import DTHRechargeOrder
120
from shop2020.model.v1.order.impl.model.DigitalTransaction import \
120
from shop2020.model.v1.order.impl.model.DigitalTransaction import \
121
    DigitalTransaction
121
    DigitalTransaction
122
from shop2020.model.v1.order.impl.model.MobileRechargeOrder import \
122
from shop2020.model.v1.order.impl.model.MobileRechargeOrder import \
Line 2765... Line 2765...
2765
                for sanction in creditorMap.get('Sanctions'):
2765
                for sanction in creditorMap.get('Sanctions'):
2766
                    sanctionsList.append(to_t_UserSanction(sanction, creditorMap.get('TicketSize')))
2766
                    sanctionsList.append(to_t_UserSanction(sanction, creditorMap.get('TicketSize')))
2767
            return to_t_PaginatedUserSanction(hasMore, totalCount, sanctionsList)
2767
            return to_t_PaginatedUserSanction(hasMore, totalCount, sanctionsList)
2768
        finally:
2768
        finally:
2769
            close_session()
2769
            close_session()
-
 
2770
    
-
 
2771
    def getOrdersInBatchAsPromisedShipping(self, statuses, offset, limit, warehouse_id, source):
-
 
2772
        """
-
 
2773
        Returns at most 'limit' orders with the given statuses for the given warehouse starting from the given offset.
-
 
2774
        These orders should be in order of promised shipping time. 
-
 
2775
        Pass the status as null and the limit as 0 to ignore them.
-
 
2776
    
-
 
2777
        Parameters:
-
 
2778
         - statuses
-
 
2779
         - offset
-
 
2780
         - limit
-
 
2781
         - warehouse_id
-
 
2782
        """
-
 
2783
        try:
-
 
2784
            orders = get_orders_in_batch_as_promised_shipping(statuses, offset, limit, warehouse_id, source)
-
 
2785
            return [to_t_order(order) for order in orders]
-
 
2786
        finally:
-
 
2787
            close_session()
2770
            
2788
            
2771
def main():
2789
def main():
2772
    OrderServiceHandler().creditBatch(2, '{"483649":100.0, "8021773":23, "123213":10}')
2790
    OrderServiceHandler().creditBatch(2, '{"483649":100.0, "8021773":23, "123213":10}')
2773
            
2791
            
2774
if __name__ == '__main__':
2792
if __name__ == '__main__':