Subversion Repositories SmartDukaan

Rev

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

Rev 19973 Rev 19980
Line 5... Line 5...
5
'''
5
'''
6
 
6
 
7
import datetime
7
import datetime
8
 
8
 
9
from shop2020.config.client.ConfigClient import ConfigClient
9
from shop2020.config.client.ConfigClient import ConfigClient
10
from shop2020.model.v1.order.impl.DataService import Alert, Transaction
-
 
-
 
10
 
11
from shop2020.thriftpy.model.v1.order.ttypes import Transaction as T_Transaction, \
11
from shop2020.thriftpy.model.v1.order.ttypes import Transaction as T_Transaction, \
12
    LineItem as T_LineItem, Order as T_Order, Alert as T_Alert, OrderStatus, \
12
    LineItem as T_LineItem, Order as T_Order, Alert as T_Alert, OrderStatus, \
13
    DelayReason, PaymentSettlement as T_PaymentSettlement, \
13
    DelayReason, PaymentSettlement as T_PaymentSettlement, \
14
    CODVerificationAgent as T_CODVerificationAgent, Attribute as T_Attribute, \
14
    CODVerificationAgent as T_CODVerificationAgent, Attribute as T_Attribute, \
15
    EmiScheme as T_EmiScheme, RechargeTransaction as T_rechargeTransaction, \
15
    EmiScheme as T_EmiScheme, RechargeTransaction as T_rechargeTransaction, \
Line 28... Line 28...
28
    UserSanction as TUserSanction, CreditTxnType, LoanHistory as TLoanHistory, \
28
    UserSanction as TUserSanction, CreditTxnType, LoanHistory as TLoanHistory, \
29
    PaginatedCreditHistory as TPaginatedCreditHistory, \
29
    PaginatedCreditHistory as TPaginatedCreditHistory, \
30
    PaginatedLoanHistory as TPaginatedLoanHistory, \
30
    PaginatedLoanHistory as TPaginatedLoanHistory, \
31
    PaginatedUserSanction as TPaginatedUserSanction, \
31
    PaginatedUserSanction as TPaginatedUserSanction, \
32
    ShipmentLogisticsCostDetail as TShipmentLogisticsCostDetail, \
32
    ShipmentLogisticsCostDetail as TShipmentLogisticsCostDetail, \
33
    OutstandingPayments as TOutstandingPayments
33
    OutstandingPayments as TOutstandingPayments, WarehouseAddress
34
from shop2020.utils.Utils import to_java_date
34
from shop2020.utils.Utils import to_java_date
35
 
35
 
36
 
36
 
37
cutoff_date = ConfigClient().get_property("warehouse_company_cutoff_date")
37
cutoff_date = ConfigClient().get_property("warehouse_company_cutoff_date")
38
cutoff_date = datetime.datetime.strptime(cutoff_date,'%Y-%m-%d')
38
cutoff_date = datetime.datetime.strptime(cutoff_date,'%Y-%m-%d')
Line 88... Line 88...
88
    t_order.gvAmount = order.gvAmount
88
    t_order.gvAmount = order.gvAmount
89
    t_order.total_weight = order.total_weight
89
    t_order.total_weight = order.total_weight
90
    t_order.created_timestamp = to_java_date(order.created_timestamp)
90
    t_order.created_timestamp = to_java_date(order.created_timestamp)
91
    t_order.invoice_number = order.invoice_number
91
    t_order.invoice_number = order.invoice_number
92
    t_order.seller_id = order.seller_id
92
    t_order.seller_id = order.seller_id
-
 
93
    t_order.warehouse_address_id = order.warehouse_address_id
93
    t_order.billed_by = order.billed_by
94
    t_order.billed_by = order.billed_by
94
    t_order.accepted_timestamp = to_java_date(order.accepted_timestamp)
95
    t_order.accepted_timestamp = to_java_date(order.accepted_timestamp)
95
    t_order.billing_timestamp = to_java_date(order.billing_timestamp)
96
    t_order.billing_timestamp = to_java_date(order.billing_timestamp)
96
    t_order.shipping_timestamp = to_java_date(order.shipping_timestamp)
97
    t_order.shipping_timestamp = to_java_date(order.shipping_timestamp)
97
    t_order.delivery_timestamp = to_java_date(order.delivery_timestamp)
98
    t_order.delivery_timestamp = to_java_date(order.delivery_timestamp)
Line 219... Line 220...
219
    if attribute:
220
    if attribute:
220
        t_attribute.name = attribute.name
221
        t_attribute.name = attribute.name
221
        t_attribute.value = attribute.value
222
        t_attribute.value = attribute.value
222
    return t_attribute
223
    return t_attribute
223
 
224
 
-
 
225
def to_t_warehouse_address(warehouse_address_master):
-
 
226
    if warehouse_address_master:
-
 
227
        wha = WarehouseAddress() 
-
 
228
        wha.address = warehouse_address_master.address
-
 
229
        wha.id = warehouse_address_master.id
-
 
230
        wha.pin = warehouse_address_master.pin
-
 
231
        wha.state_id = warehouse_address_master.state_id
-
 
232
        return wha
-
 
233
    return None
224
def to_t_emi_scheme(emi_scheme):
234
def to_t_emi_scheme(emi_scheme):
225
    t_emi_scheme = T_EmiScheme()
235
    t_emi_scheme = T_EmiScheme()
226
    if emi_scheme:
236
    if emi_scheme:
227
        t_emi_scheme.id = emi_scheme.id
237
        t_emi_scheme.id = emi_scheme.id
228
        t_emi_scheme.bankId = emi_scheme.bankId
238
        t_emi_scheme.bankId = emi_scheme.bankId