Subversion Repositories SmartDukaan

Rev

Rev 12339 | Rev 12776 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
104 ashish 1
'''
2
Created on 29-Mar-2010
3
 
4
@author: ashish
5
'''
6
 
7
from shop2020.thriftpy.model.v1.order.ttypes import Transaction as T_Transaction,\
4600 varun.gupt 8
    LineItem as T_LineItem, Order as T_Order, Alert as T_Alert, OrderStatus, DelayReason, \
5527 anupam.sin 9
    PaymentSettlement as T_PaymentSettlement, CODVerificationAgent as T_CODVerificationAgent, \
7080 anupam.sin 10
    Attribute as T_Attribute, EmiScheme as T_EmiScheme, RechargeTransaction as T_rechargeTransaction, \
7311 kshitij.so 11
    FRC as T_FRC, HotspotStore as T_HotSpotStore, SourceDetail as T_SourceDetail , \
7967 anupam.sin 12
    AmazonOrder as T_AmazonOrder, StoreOrderDetail as T_StoreOrderDetail, StoreOrderCollection as T_StoreOrderCollection, \
8488 amar.kumar 13
    HotspotServiceMatrix as T_HotspotServiceMatrix, EbayOrder as T_EbayOrder, \
8990 vikram.rag 14
    AmazonFbaSalesSnapshot as T_AmazonFbaSalesSnapshot, SnapdealOrder as T_SnapdealOrder, \
12772 manish.sha 15
    FlipkartOrder as flipkartOrder, AmazonFbaOrderReturns as amazonFbaOrderReturn, \
16
    FlipkartAdvantageOrder as flipkartAdvantageOrder
8990 vikram.rag 17
 
18
 
104 ashish 19
from shop2020.utils.Utils import to_java_date
4394 rajveer 20
from shop2020.model.v1.order.impl.DataService import Alert, Transaction
8282 kshitij.so 21
import datetime
104 ashish 22
 
23
def to_t_transaction(transaction):
24
    t_transaction = T_Transaction()
25
    t_transaction.id = transaction.id
483 rajveer 26
    t_transaction.createdOn = to_java_date(transaction.createdOn)
699 chandransh 27
    t_transaction.transactionStatus = transaction.status
483 rajveer 28
    t_transaction.statusDescription = transaction.status_message
29
    t_transaction.customer_id = transaction.customer_id
30
    t_transaction.shoppingCartid = transaction.shopping_cart_id
2219 varun.gupt 31
    t_transaction.coupon_code = transaction.coupon_code
2815 vikas 32
    t_transaction.sessionSource = transaction.session_source
33
    t_transaction.sessionStartTime = to_java_date(transaction.session_start_time)
3858 vikas 34
    t_transaction.firstSource = transaction.first_source
35
    t_transaction.firstSourceTime = to_java_date(transaction.first_source_start_time)
483 rajveer 36
    t_transaction.orders = []
37
    #populate orders
38
    for order in transaction.orders:
39
        t_order = to_t_order(order)
40
        t_transaction.orders.append(t_order)
41
    return t_transaction
42
 
43
def to_t_order(order):
44
    t_order = T_Order()
45
    t_order.id = order.id
46
    t_order.warehouse_id = order.warehouse_id
47
    t_order.logistics_provider_id = order.logistics_provider_id
4815 phani.kuma 48
    if order.doa_logistics_provider_id is not None:
49
        t_order.doa_logistics_provider_id = order.doa_logistics_provider_id
483 rajveer 50
    t_order.airwaybill_no = order.airwaybill_no
51
    t_order.tracking_id = order.tracking_id
52
    t_order.expected_delivery_time = to_java_date(order.expected_delivery_time)
3986 chandransh 53
    t_order.promised_delivery_time = to_java_date(order.promised_delivery_time)
4004 chandransh 54
    t_order.expected_shipping_time = to_java_date(order.expected_shipping_time)
4102 chandransh 55
    t_order.promised_shipping_time = to_java_date(order.promised_shipping_time)
6726 rajveer 56
    t_order.courier_delivery_time = to_java_date(order.courier_delivery_time)
483 rajveer 57
    t_order.customer_id = order.customer_id
58
    t_order.customer_name = order.customer_name
59
    t_order.customer_mobilenumber = order.customer_mobilenumber
60
    t_order.customer_pincode = order.customer_pincode
738 chandransh 61
    t_order.customer_address1 = order.customer_address1
62
    t_order.customer_address2 = order.customer_address2
669 chandransh 63
    t_order.customer_city = order.customer_city
64
    t_order.customer_state = order.customer_state
483 rajveer 65
    t_order.customer_email = order.customer_email    
699 chandransh 66
    t_order.status = order.status 
483 rajveer 67
    t_order.statusDescription = order.statusDescription
68
    t_order.total_amount = order.total_amount
6318 rajveer 69
    t_order.gvAmount = order.gvAmount
483 rajveer 70
    t_order.total_weight = order.total_weight
71
    t_order.created_timestamp = to_java_date(order.created_timestamp)
72
    t_order.invoice_number = order.invoice_number
12772 manish.sha 73
    t_order.invoicePrefix = order.invoicePrefix
483 rajveer 74
    t_order.billed_by = order.billed_by
986 chandransh 75
    t_order.accepted_timestamp = to_java_date(order.accepted_timestamp)
76
    t_order.billing_timestamp = to_java_date(order.billing_timestamp)
77
    t_order.shipping_timestamp = to_java_date(order.shipping_timestamp)
78
    t_order.delivery_timestamp = to_java_date(order.delivery_timestamp)
1208 chandransh 79
    t_order.outofstock_timestamp = to_java_date(order.outofstock_timestamp)
4004 chandransh 80
    t_order.verification_timestamp = to_java_date(order.verification_timestamp)
642 chandransh 81
    t_order.jacket_number = order.jacket_number
1220 chandransh 82
    t_order.receiver = order.receiver
83
    t_order.batchNo = order.batchNo
84
    t_order.serialNo = order.serialNo
2536 chandransh 85
    t_order.doaFlag = order.doaFlag
86
    t_order.pickupRequestNo = order.pickupRequestNo
3064 chandransh 87
    t_order.cod = order.cod
5062 varun.gupt 88
    t_order.originalOrderId = order.originalOrderId
3581 chandransh 89
    if order.delay_reason:
90
        t_order.delayReason = DelayReason._NAMES_TO_VALUES[order.delay_reason]
4647 rajveer 91
    t_order.delayReasonText = order.delayReasonText
2676 vikas 92
    t_order.transactionId = order.transaction_id
483 rajveer 93
    t_order.lineitems = []
94
    for lineitem in order.lineitems:
95
        t_lineitem = to_t_lineitem(lineitem)
96
        t_order.lineitems.append(t_lineitem)
4192 anupam.sin 97
    if order.reship_timestamp:
98
        t_order.reship_timestamp = to_java_date(order.reship_timestamp)
99
    if order.refund_timestamp:
100
        t_order.refund_timestamp = to_java_date(order.refund_timestamp)
4506 phani.kuma 101
    if order.doa_auth_timestamp:
102
        t_order.doa_auth_timestamp = to_java_date(order.doa_auth_timestamp)
4192 anupam.sin 103
    if order.new_order_id:
104
        t_order.new_order_id = order.new_order_id
4581 phani.kuma 105
    t_order.pickup_timestamp = to_java_date(order.pickup_timestamp)
4269 anupam.sin 106
    t_order.previousStatus = order.previousStatus
107
    t_order.vendorId = order.vendorId
4709 rajveer 108
    t_order.refundReason = order.refund_reason
5110 mandeep.dh 109
    t_order.fulfilmentWarehouseId = order.fulfilmentWarehouseId
5189 varun.gupt 110
    t_order.vendorPaid = order.vendor_paid
4758 mandeep.dh 111
    if order.purchase_order_id:
112
        t_order.purchaseOrderId = order.purchase_order_id
5354 anupam.sin 113
    if order.received_return_timestamp:
114
        t_order.received_return_timestamp = to_java_date(order.received_return_timestamp)
115
    if order.first_dlvyatmp_timestamp:
116
        t_order.first_attempt_timestamp = to_java_date(order.first_dlvyatmp_timestamp)
5527 anupam.sin 117
    t_order.orderType = order.orderType
5555 rajveer 118
    t_order.pickupStoreId = order.pickupStoreId
119
    t_order.logisticsCod = not order.pickupStoreId and order.cod
6525 rajveer 120
    t_order.otg = order.otg
6903 anupam.sin 121
    t_order.insurer = order.insurer
122
    t_order.insuranceAmount = order.insuranceAmount
7190 amar.kumar 123
    t_order.freebieItemId = order.freebieItemId
7293 anupam.sin 124
    t_order.source = order.source
125
    t_order.storeId = order.storeId
126
    t_order.advanceAmount = order.advanceAmount
8717 amar.kumar 127
    t_order.productCondition = order.productCondition
9299 kshitij.so 128
    t_order.dataProtectionInsurer = order.dataProtectionInsurer
129
    t_order.dataProtectionAmount = order.dataProtectionAmount
9494 amit.gupta 130
    t_order.taxType = order.taxType
483 rajveer 131
    return t_order
132
 
133
def to_t_lineitem(lineitem):
134
    t_lineitem = T_LineItem()
135
    t_lineitem.id = lineitem.id
699 chandransh 136
    t_lineitem.item_id = lineitem.item_id
970 chandransh 137
    t_lineitem.productGroup = lineitem.productGroup
138
    t_lineitem.brand = lineitem.brand
139
    t_lineitem.model_number = lineitem.model_number
140
    t_lineitem.color = lineitem.color
141
    t_lineitem.model_name = lineitem.model_name
142
    t_lineitem.extra_info = lineitem.extra_info
483 rajveer 143
    t_lineitem.unit_weight = lineitem.unit_weight
144
    t_lineitem.unit_price = lineitem.unit_price
145
    t_lineitem.total_price = lineitem.total_price
996 varun.gupt 146
    t_lineitem.transfer_price = lineitem.transfer_price
7672 rajveer 147
    t_lineitem.nlc = lineitem.nlc
483 rajveer 148
    t_lineitem.total_weight = lineitem.total_weight 
669 chandransh 149
    t_lineitem.quantity = lineitem.quantity
2783 chandransh 150
    t_lineitem.item_number = lineitem.item_number
4658 mandeep.dh 151
    t_lineitem.serial_number = lineitem.serial_number
4172 rajveer 152
    t_lineitem.dealText = lineitem.dealText
4295 varun.gupt 153
    t_lineitem.warrantry_expiry_timestamp = to_java_date(lineitem.warranty_expiry_timestamp)
6039 amit.gupta 154
    t_lineitem.vatRate = lineitem.vatRate
12339 amit.gupta 155
    t_lineitem.mrp = lineitem.mrp
4295 varun.gupt 156
 
483 rajveer 157
    return t_lineitem
158
 
159
def to_t_alert(alert):
160
    t_alert = T_Alert()
161
    t_alert.id = alert.id
4394 rajveer 162
    t_alert.description = alert.description
483 rajveer 163
    try:
4394 rajveer 164
        t_alert.timestamp = to_java_date(alert.timestamp)
483 rajveer 165
    except:
166
        pass
167
    t_alert.type = alert.type
4394 rajveer 168
    t_alert.status = alert.status
2783 chandransh 169
    return t_alert
4600 varun.gupt 170
 
171
def to_t_payment_settlement(payment_settlement):
172
    t_payment_settlement = T_PaymentSettlement()
173
 
174
    if payment_settlement:
4905 varun.gupt 175
        t_payment_settlement.referenceId = payment_settlement.referenceId
4600 varun.gupt 176
        t_payment_settlement.paymentGatewayId = payment_settlement.paymentGatewayId
177
        t_payment_settlement.settlementDate = to_java_date(payment_settlement.settlementDate)
178
        t_payment_settlement.serviceTax = payment_settlement.serviceTax
179
        t_payment_settlement.otherCharges = payment_settlement.otherCharges
180
        t_payment_settlement.netCollection = payment_settlement.netCollection
5447 anupam.sin 181
    return t_payment_settlement
182
 
183
def to_t_verification_agent(codVerificationAgent):
184
    t_verification_agent = T_CODVerificationAgent()
185
 
186
    if codVerificationAgent:
187
        t_verification_agent.orderId = codVerificationAgent.orderId
188
        t_verification_agent.agentEmailId = codVerificationAgent.verificationAgent
5527 anupam.sin 189
    return t_verification_agent    
190
 
191
def to_t_attribute(attribute):
6396 amit.gupta 192
    t_attribute = T_Attribute() 
5527 anupam.sin 193
    if attribute:
194
        t_attribute.name = attribute.name
195
        t_attribute.value = attribute.value
6396 amit.gupta 196
    return t_attribute
197
 
198
def to_t_emi_scheme(emi_scheme):
199
    t_emi_scheme = T_EmiScheme()
200
    if emi_scheme:
201
        t_emi_scheme.id = emi_scheme.id
202
        t_emi_scheme.bankId = emi_scheme.bankId
203
        t_emi_scheme.bankName = emi_scheme.bankName
204
        t_emi_scheme.gatewayId = emi_scheme.gatewayId
205
        t_emi_scheme.tenure = emi_scheme.tenure
206
        t_emi_scheme.tenureDescription = emi_scheme.tenureDescription
207
        t_emi_scheme.minAmount = emi_scheme.minAmount
208
        t_emi_scheme.chargeType = emi_scheme.chargeType
209
        t_emi_scheme.chargeValue = emi_scheme.chargeValue
8942 rajveer 210
        t_emi_scheme.interestRate = emi_scheme.interestRate
7073 anupam.sin 211
    return t_emi_scheme
212
 
213
def to_t_rechargeTransaction(rechargeTransaction):
214
    t_recharge = T_rechargeTransaction()
215
    if rechargeTransaction:
7080 anupam.sin 216
        t_recharge.id = rechargeTransaction.id
217
        t_recharge.amount = rechargeTransaction.amount 
7075 rajveer 218
        t_recharge.circleId = rechargeTransaction.circleId
219
        t_recharge.operatorId = rechargeTransaction.operatorId
220
        t_recharge.plan = rechargeTransaction.plan 
7073 anupam.sin 221
        t_recharge.deviceNum = rechargeTransaction.deviceNum
222
        t_recharge.deviceType = rechargeTransaction.deviceType
223
        t_recharge.discount = rechargeTransaction.discount 
224
        t_recharge.email = rechargeTransaction.email
225
        t_recharge.name = rechargeTransaction.name
226
        t_recharge.cafNum = rechargeTransaction.cafNum
227
        t_recharge.simNum = rechargeTransaction.simNum
228
        t_recharge.isFrc = rechargeTransaction.isFrc
229
        t_recharge.status = rechargeTransaction.status
230
        t_recharge.storeId = rechargeTransaction.storeId
7080 anupam.sin 231
        t_recharge.alternateNum = rechargeTransaction.alternateNumber
232
        t_recharge.transactionTime = to_java_date(rechargeTransaction.transactionTime)
7096 anupam.sin 233
        t_recharge.description = rechargeTransaction.description
7139 amit.gupta 234
        t_recharge.payMethod = rechargeTransaction.payMethod
7169 anupam.sin 235
        t_recharge.paymentAmount = rechargeTransaction.paymentAmount
7369 rajveer 236
        t_recharge.spiceTID = rechargeTransaction.spiceTID
237
        t_recharge.providerTID = rechargeTransaction.providerTID
238
        t_recharge.aggTID = rechargeTransaction.aggTID
7080 anupam.sin 239
    return t_recharge
240
 
241
def to_t_frc(frc):
242
    t_frc = T_FRC()
243
    if frc:
244
        t_frc.id = frc.id
245
        t_frc.operatorId =frc.operatorId
246
        t_frc.circleId = frc.circleId
247
        t_frc.denomination = frc.denomination
248
        t_frc.maxDiscount = frc.maxDiscount
7096 anupam.sin 249
    return t_frc
250
 
251
def to_t_hotspot(hotspot):
252
    t_hotspot = T_HotSpotStore();
253
    if hotspot:
254
        t_hotspot.id = hotspot.id 
255
        t_hotspot.hotspotId = hotspot.hotspotId
256
        t_hotspot.companyId = hotspot.companyId
257
        t_hotspot.name = hotspot.name
258
        t_hotspot.city = hotspot.city
259
        t_hotspot.collectedAmount = hotspot.collectedAmount
260
        t_hotspot.availableLimit = hotspot.availableLimit
261
        t_hotspot.creditLimit = hotspot.creditLimit
262
        t_hotspot.salt = hotspot.salt
263
        t_hotspot.password = hotspot.password
264
        t_hotspot.isActive = hotspot.isActive
265
        t_hotspot.circleId = hotspot.circleId
7169 anupam.sin 266
        t_hotspot.email = hotspot.email
7308 rajveer 267
        t_hotspot.line1 = hotspot.line1
268
        t_hotspot.line2 = hotspot.line2
269
        t_hotspot.state = hotspot.state
270
        t_hotspot.pin = hotspot.pin
271
        t_hotspot.phone = hotspot.phone
272
        t_hotspot.approvalEmail = hotspot.approvalEmail
273
 
274
 
7263 anupam.sin 275
    return t_hotspot
276
 
277
def to_t_sourcedetail(detail):
278
    t_sourcedetail = T_SourceDetail()
279
    if detail:
280
        t_sourcedetail.id = detail.id
281
        t_sourcedetail.name = detail.name
282
        t_sourcedetail.email = detail.email
7410 amar.kumar 283
        t_sourcedetail.tinNumber = detail.tinNumber
7530 kshitij.so 284
        t_sourcedetail.lastUpdatedOn = to_java_date(detail.lastUpdatedOn)
7311 kshitij.so 285
    return t_sourcedetail
286
 
287
def to_t_amazonorder(AmazonOrder):
288
    t_amazonorder = T_AmazonOrder()
289
    t_amazonorder.orderId=AmazonOrder.orderId
290
    t_amazonorder.amazonOrderCode=AmazonOrder.amazonOrderCode
291
    t_amazonorder.amazonOrderItemCode=AmazonOrder.amazonOrderItemCode
292
    t_amazonorder.transactionId=AmazonOrder.transactionId
293
    t_amazonorder.item_id=AmazonOrder.item_id
294
    t_amazonorder.status=AmazonOrder.status
7386 anupam.sin 295
    return t_amazonorder
296
 
297
def to_t_storeOrderDetail(storeOrderDetail):
298
    t_storeOrderDetail = T_StoreOrderDetail()
299
    if storeOrderDetail:
300
        t_storeOrderDetail.orderId = storeOrderDetail.orderId
301
        t_storeOrderDetail.storeId = storeOrderDetail.storeId
302
        t_storeOrderDetail.advanceAmount = storeOrderDetail.advanceAmount
303
        t_storeOrderDetail.cashAmount = storeOrderDetail.cashAmount
304
        t_storeOrderDetail.cardAmount = storeOrderDetail.cardAmount
305
        t_storeOrderDetail.payStatus = storeOrderDetail.payStatus
7393 anupam.sin 306
        t_storeOrderDetail.edcBank = storeOrderDetail.edcBank
307
        t_storeOrderDetail.cashRefundAmount = storeOrderDetail.cashRefundAmount
308
        t_storeOrderDetail.cardRefundAmount = storeOrderDetail.cardRefundAmount
7423 anupam.sin 309
        t_storeOrderDetail.approvalCode = storeOrderDetail.approvalCode
7611 anupam.sin 310
        t_storeOrderDetail.cardType = storeOrderDetail.cardType
7426 anupam.sin 311
    return t_storeOrderDetail
312
 
313
def to_t_storeOrderCollection(storeOrderCollection):
314
    t_storeOrderCollection = T_StoreOrderCollection()
315
    if storeOrderCollection:
316
        t_storeOrderCollection.hotspotId = storeOrderCollection.hotspotId
317
        t_storeOrderCollection.orderId = storeOrderCollection.orderId
318
        t_storeOrderCollection.collectionType = storeOrderCollection.collectionType
319
        t_storeOrderCollection.productName = storeOrderCollection.productName
320
        t_storeOrderCollection.advanceAmount = storeOrderCollection.advanceAmount
321
        t_storeOrderCollection.cash = storeOrderCollection.cash
322
        t_storeOrderCollection.card = storeOrderCollection.card
7427 anupam.sin 323
        t_storeOrderCollection.addedAt = to_java_date(storeOrderCollection.addedAt)
324
        t_storeOrderCollection.pushedAt = to_java_date(storeOrderCollection.pushedAt)
7426 anupam.sin 325
        t_storeOrderCollection.pushedToOcr = storeOrderCollection.pushedToOcr
7967 anupam.sin 326
    return t_storeOrderCollection
327
 
328
def to_t_hotspotServiceMatrix(hotspotServiceMatrix):
329
    t_hotspotServiceMatrix = T_HotspotServiceMatrix()
330
    if hotspotServiceMatrix:
331
        t_hotspotServiceMatrix.storeId = hotspotServiceMatrix.storeId
332
        t_hotspotServiceMatrix.hotspotId = hotspotServiceMatrix.hotspotId
333
        t_hotspotServiceMatrix.rechargeService = hotspotServiceMatrix.rechargeService
334
        t_hotspotServiceMatrix.storeWebsiteService = hotspotServiceMatrix.storeWebsiteService
335
        t_hotspotServiceMatrix.pickupFromStoreService = hotspotServiceMatrix.pickupFromStoreService
336
    return t_hotspotServiceMatrix
8182 amar.kumar 337
 
338
def to_t_ebayOrder(ebayOrder):
339
    t_ebayOrder = T_EbayOrder()
340
    t_ebayOrder.orderId = ebayOrder.orderId
341
    t_ebayOrder.salesRecordNumber = ebayOrder.salesRecordNumber
342
    t_ebayOrder.paisaPayId = ebayOrder.paisaPayId
343
    t_ebayOrder.ebayListingId = ebayOrder.ebayListingId
344
    t_ebayOrder.subsidyAmount = ebayOrder.subsidyAmount
345
    t_ebayOrder.ebayTxnDate = to_java_date(ebayOrder.ebayTxnDate)
346
    t_ebayOrder.transactionId = ebayOrder.transactionId
347
    t_ebayOrder.listingName = ebayOrder.listingName
348
    t_ebayOrder.listingPrice = ebayOrder.listingPrice
8247 amar.kumar 349
    t_ebayOrder.bluedartPaisaPayRef = ebayOrder.bluedartPaisaPayRef
8182 amar.kumar 350
    return t_ebayOrder 
8488 amar.kumar 351
 
352
def to_t_snapdealOrder(snapdealOrder):
353
    t_snapdealOrder = T_SnapdealOrder()
354
    t_snapdealOrder.orderId = snapdealOrder.orderId
355
    t_snapdealOrder.subOrderId = snapdealOrder.subOrderId
356
    t_snapdealOrder.referenceCode = snapdealOrder.referenceCode
357
    t_snapdealOrder.snapdealTxnDate = to_java_date(snapdealOrder.referenceCode)
358
    t_snapdealOrder.productName = snapdealOrder.productName
359
    t_snapdealOrder.listingPrice = snapdealOrder.listingPrice
9456 vikram.rag 360
    t_snapdealOrder.maxNlc = snapdealOrder.maxNlc
8488 amar.kumar 361
    return t_snapdealOrder 
8282 kshitij.so 362
 
363
def to_t_amazonFbaSalesSnapshot(amazonFbaSalesSnapshot):
364
    t_amazonFbaSalesSnapshot = T_AmazonFbaSalesSnapshot()
365
    if amazonFbaSalesSnapshot:
366
        t_amazonFbaSalesSnapshot.dateOfSale = to_java_date(datetime.datetime.combine(amazonFbaSalesSnapshot.dateOfSale,datetime.time(0,0)))
367
        t_amazonFbaSalesSnapshot.item_id    = amazonFbaSalesSnapshot.item_id 
8363 vikram.rag 368
        t_amazonFbaSalesSnapshot.totalOrderCount = amazonFbaSalesSnapshot.totalOrderCount 
8282 kshitij.so 369
        t_amazonFbaSalesSnapshot.amazonFbaInventory = amazonFbaSalesSnapshot.amazonFbaInventory
370
        t_amazonFbaSalesSnapshot.isOutOfStock = amazonFbaSalesSnapshot.isOutOfStock
371
        t_amazonFbaSalesSnapshot.salePrice = amazonFbaSalesSnapshot.salePrice
8445 vikram.rag 372
        t_amazonFbaSalesSnapshot.ourPrice = amazonFbaSalesSnapshot.ourPrice
8282 kshitij.so 373
        if amazonFbaSalesSnapshot.minFbaPrice is not None:
374
            t_amazonFbaSalesSnapshot.minFbaPrice = amazonFbaSalesSnapshot.minFbaPrice
375
        if amazonFbaSalesSnapshot.minMfnPrice is not None:    
376
            t_amazonFbaSalesSnapshot.minMfnPrice = amazonFbaSalesSnapshot.minMfnPrice
8363 vikram.rag 377
        t_amazonFbaSalesSnapshot.totalSale = amazonFbaSalesSnapshot.totalSale
378
        t_amazonFbaSalesSnapshot.promotionSale = amazonFbaSalesSnapshot.promotionSale    
379
        t_amazonFbaSalesSnapshot.promotionOrderCount = amazonFbaSalesSnapshot.promotionOrderCount
8532 vikram.rag 380
        t_amazonFbaSalesSnapshot.ourPriceSnapshotDate = to_java_date(amazonFbaSalesSnapshot.ourPriceSnapshotDate)
381
        t_amazonFbaSalesSnapshot.salePriceSnapshotDate = to_java_date(amazonFbaSalesSnapshot.salePriceSnapshotDate)
382
        t_amazonFbaSalesSnapshot.minFbaPriceSnapshotDate = to_java_date(amazonFbaSalesSnapshot.minFbaPriceSnapshotDate)
383
        t_amazonFbaSalesSnapshot.minMfnPriceSnapshotDate = to_java_date(amazonFbaSalesSnapshot.minMfnPriceSnapshotDate)
11173 vikram.rag 384
        t_amazonFbaSalesSnapshot.fcLocation = amazonFbaSalesSnapshot.fcLocation
8282 kshitij.so 385
    return t_amazonFbaSalesSnapshot
8990 vikram.rag 386
 
387
def to_t_flipkartOrder(flipkartorder):
9000 vikram.rag 388
    order = flipkartOrder()
8990 vikram.rag 389
    if flipkartorder:
9000 vikram.rag 390
        order.emiFee = flipkartorder.emiFee
391
        order.orderId = flipkartorder.orderId
392
        order.octroiFee = flipkartorder.octroiFee
393
        order.flipkartOrderId = flipkartorder.flipkartOrderId
394
        order.flipkartSubOrderId = flipkartorder.flipkartSubOrderId
395
        order.flipkartTxnDate = to_java_date(flipkartorder.flipkartTxnDate)
396
        order.shippingPrice = flipkartorder.shippingPrice
9456 vikram.rag 397
        order.maxNlc = flipkartorder.maxNlc
12103 manish.sha 398
    return order
399
 
400
def to_t_amazonFbaOrderReturn(amazonfbaOrderReturn):
401
    orderReturn = amazonFbaOrderReturn()
402
    if amazonfbaOrderReturn:
403
        orderReturn.amazonOrderId = amazonfbaOrderReturn.amazonOrderId
404
        orderReturn.insertionTimestamp = to_java_date(amazonfbaOrderReturn.insertionTimestamp)
405
        orderReturn.sku = amazonfbaOrderReturn.sku
406
        orderReturn.creationTimestamp = to_java_date(amazonfbaOrderReturn.creationTimestamp)
407
        orderReturn.shippedQuantity = amazonfbaOrderReturn.shippedQuantity
408
        orderReturn.sellableReturnQuantity = amazonfbaOrderReturn.sellableReturnQuantity
409
        orderReturn.nonSellableReturnQuantity = amazonfbaOrderReturn.nonSellableReturnQuantity
410
    return orderReturn
8990 vikram.rag 411
 
12772 manish.sha 412
def to_t_flipkartAdvantageOrder(faOrder):
413
    fa_Order = flipkartAdvantageOrder()
414
    if faOrder:
415
        fa_Order.fkOrderId = faOrder.fkOrderId
416
        fa_Order.fkOrderItemId = faOrder.fkOrderItemId
417
        fa_Order.sku = faOrder.sku
418
        fa_Order.creationTimestamp = to_java_date(faOrder.creationTimestamp)
419
        fa_Order.customerName = faOrder.customerName
420
        fa_Order.customerAddress = faOrder.customerAddress
421
        fa_Order.pincode = faOrder.pincode
422
        fa_Order.customerCity = faOrder.customerCity
423
        fa_Order.customerState = faOrder.customerState
424
        fa_Order.customerPhone = faOrder.customerPhone
425
        fa_Order.status = faOrder.status
426
        fa_Order.quantity = faOrder.quantity
427
        fa_Order.totalPrice = faOrder.totalPrice
428
        fa_Order.listPrice = faOrder.listPrice
429
        fa_Order.modifiedDate = to_java_date(faOrder.modifiedDate)
430
        fa_Order.listingId = faOrder.listingId
431
        fa_Order.cancelReason = faOrder.cancelReason
432
        fa_Order.returnReason = faOrder.returnReason
433
        fa_Order.freebieItemId = faOrder.freebieItemId
434
        fa_Order.productTitle = faOrder.productTitle
7967 anupam.sin 435