Subversion Repositories SmartDukaan

Rev

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

Rev 7385 Rev 7386
Line 36... Line 36...
36
    OrderInventory, Alert, PaymentSettlement, EBSSettlementSummary, \
36
    OrderInventory, Alert, PaymentSettlement, EBSSettlementSummary, \
37
    CodVerificationAgent, Attribute, RechargeVoucherTracker, EmiScheme, MiscCharges, \
37
    CodVerificationAgent, Attribute, RechargeVoucherTracker, EmiScheme, MiscCharges, \
38
    BlockedIpRange, DeniedIpAddress, InsuranceDetailForOrder, DocumentStore, \
38
    BlockedIpRange, DeniedIpAddress, InsuranceDetailForOrder, DocumentStore, \
39
    RechargeTransaction, HotspotStore, WalletForCompany, WalletHistoryForCompany, \
39
    RechargeTransaction, HotspotStore, WalletForCompany, WalletHistoryForCompany, \
40
    FRC, OperatorSeries, SourceDetail, Company, \
40
    FRC, OperatorSeries, SourceDetail, Company, \
41
    AmazonOrder
41
    AmazonOrder, StoreOrderDetail, EdcBank
42
from shop2020.model.v1.order.impl.model.BaseOrder import BaseOrder
42
from shop2020.model.v1.order.impl.model.BaseOrder import BaseOrder
43
from shop2020.model.v1.order.impl.model.DTHRechargeOrder import DTHRechargeOrder
43
from shop2020.model.v1.order.impl.model.DTHRechargeOrder import DTHRechargeOrder
44
from shop2020.model.v1.order.impl.model.MobileRechargeOrder import \
44
from shop2020.model.v1.order.impl.model.MobileRechargeOrder import \
45
    MobileRechargeOrder
45
    MobileRechargeOrder
46
from shop2020.model.v1.order.impl.model.RechargeDenomination import \
46
from shop2020.model.v1.order.impl.model.RechargeDenomination import \
Line 427... Line 427...
427
                transaction_requiring_extra_processing = TransactionRequiringExtraProcessing()
427
                transaction_requiring_extra_processing = TransactionRequiringExtraProcessing()
428
                transaction_requiring_extra_processing.category = 'PAYMENT_FLAGGED'
428
                transaction_requiring_extra_processing.category = 'PAYMENT_FLAGGED'
429
                transaction_requiring_extra_processing.transaction_id = transaction_id
429
                transaction_requiring_extra_processing.transaction_id = transaction_id
430
                session.commit()
430
                session.commit()
431
        elif order.source == OrderSource.STORE:
431
        elif order.source == OrderSource.STORE:
432
                attribute = Attribute()
-
 
433
                attribute.orderId = order.id
-
 
434
                attribute.name = "PAYMENT_MODE"
-
 
435
                attribute.value = "Cash"
-
 
436
                session.commit()
-
 
437
                            
432
            
438
                catalog_client = CatalogClient().get_client() 
433
                catalog_client = CatalogClient().get_client() 
439
                sourcePricing = catalog_client.getStorePricing(order.lineitems[0].item_id)
434
                sourcePricing = catalog_client.getStorePricing(order.lineitems[0].item_id)
440
                if order.total_amount >= sourcePricing.minPrice:
435
                if order.total_amount >= sourcePricing.minPrice:
441
                    order.status = OrderStatus.SUBMITTED_FOR_PROCESSING
436
                    order.status = OrderStatus.SUBMITTED_FOR_PROCESSING
-
 
437
                    order.statusDescription = "Order Accepted"
442
                    session.commit()
438
                    session.commit()
443
                    __push_store_collection_to_hotspot(order, "advance")
439
                    __push_store_collection_to_hotspot(order, "advance", order.advanceAmount)
444
                    
440
                    
445
                else: 
441
                else: 
446
                    order.status = OrderStatus.COD_VERIFICATION_PENDING
442
                    order.status = OrderStatus.COD_VERIFICATION_PENDING
-
 
443
                    order.statusDescription = "Approval Pending"
447
                    content = "<html><body>"
444
                    content = "<html><body>"
448
                    content += "<h4>Order Id:  " + str(order.id) + "</h4>"
445
                    content += "<h4>Order Id:  " + str(order.id) + "</h4>"
449
                    content += "<h4>Product:  " + str(order.lineitems[0]) + "</h4>"
446
                    content += "<h4>Product:  " + str(order.lineitems[0]) + "</h4>"
450
                    content += "<h4>Min Price: " +  str(sourcePricing.minPrice) + "</h4>"
447
                    content += "<h4>Min Price: " +  str(sourcePricing.minPrice) + "</h4>"
451
                    content += "<h4>Recommended Price: " +  str(sourcePricing.recommendedPrice) + "</h4>"
448
                    content += "<h4>Recommended Price: " +  str(sourcePricing.recommendedPrice) + "</h4>"
Line 2479... Line 2476...
2479
                     OrderStatus.BILLED : OrderStatus.CANCELLED_DUE_TO_LOW_INVENTORY,
2476
                     OrderStatus.BILLED : OrderStatus.CANCELLED_DUE_TO_LOW_INVENTORY,
2480
                     OrderStatus.CANCEL_REQUEST_CONFIRMED : OrderStatus.CANCELLED_ON_CUSTOMER_REQUEST
2477
                     OrderStatus.CANCEL_REQUEST_CONFIRMED : OrderStatus.CANCELLED_ON_CUSTOMER_REQUEST
2481
                     }
2478
                     }
2482
        if order.status not in status_transition.keys():
2479
        if order.status not in status_transition.keys():
2483
            raise TransactionServiceException(114, "This order can't be refunded")
2480
            raise TransactionServiceException(114, "This order can't be refunded")
2484
    
2481
        
2485
        if order.status in [OrderStatus.COD_VERIFICATION_PENDING, OrderStatus.SUBMITTED_FOR_PROCESSING, OrderStatus.INVENTORY_LOW, OrderStatus.LOW_INV_PO_RAISED, OrderStatus.LOW_INV_REVERSAL_IN_PROCESS, OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT, OrderStatus.ACCEPTED]:
2482
        if order.status in [OrderStatus.COD_VERIFICATION_PENDING, OrderStatus.SUBMITTED_FOR_PROCESSING, OrderStatus.INVENTORY_LOW, OrderStatus.LOW_INV_PO_RAISED, OrderStatus.LOW_INV_REVERSAL_IN_PROCESS, OrderStatus.LOW_INV_NOT_AVAILABLE_AT_HOTSPOT, OrderStatus.ACCEPTED]:
2486
            __update_inventory_reservation(order)
2483
            __update_inventory_reservation(order)
2487
            order.statusDescription = "Order Cancelled"
2484
            order.statusDescription = "Order Cancelled"
2488
        elif order.status == OrderStatus.BILLED:
2485
        elif order.status == OrderStatus.BILLED:
2489
            __create_return_order(order)
2486
            __create_return_order(order)
Line 2592... Line 2589...
2592
                else:
2589
                else:
2593
                    warehouseClient.scanForOrder(None, ScanType.SALE_RET, lineitem.quantity, order.id, order.fulfilmentWarehouseId, order.warehouse_id)
2590
                    warehouseClient.scanForOrder(None, ScanType.SALE_RET, lineitem.quantity, order.id, order.fulfilmentWarehouseId, order.warehouse_id)
2594
            if warehouse.billingType == BillingType.OURS_EXTERNAL:
2591
            if warehouse.billingType == BillingType.OURS_EXTERNAL:
2595
                warehouseClient.scanForOursExternalSaleReturn(order.id, lineitem.transfer_price)            
2592
                warehouseClient.scanForOursExternalSaleReturn(order.id, lineitem.transfer_price)            
2596
 
2593
 
-
 
2594
    if order.source == 2 and order.status in (OrderStatus.SUBMITTED_FOR_PROCESSING, OrderStatus.ACCEPTED, OrderStatus.INVENTORY_LOW):
-
 
2595
        __push_store_collection_to_hotspot(order, "advanceRefund", -order.advanceAmount)
-
 
2596
        
2597
    order.status = status_transition[order.status]
2597
    order.status = status_transition[order.status]
2598
    order.refund_timestamp = datetime.datetime.now()
2598
    order.refund_timestamp = datetime.datetime.now()
2599
    order.refunded_by = refunded_by
2599
    order.refunded_by = refunded_by
2600
    order.refund_reason = reason
2600
    order.refund_reason = reason
-
 
2601
    
2601
 
2602
    
2602
    session.commit()
2603
    session.commit()
2603
    return True
2604
    return True
2604
 
2605
 
2605
def __update_inventory_reservation(order):
2606
def __update_inventory_reservation(order):
2606
    '''
2607
    '''
Line 2776... Line 2777...
2776
    pdf.drawText(order_text)
2777
    pdf.drawText(order_text)
2777
    pdf.showPage()
2778
    pdf.showPage()
2778
    pdf.save()
2779
    pdf.save()
2779
    return filename
2780
    return filename
2780
 
2781
 
2781
def __push_store_collection_to_hotspot(order, type):
2782
def __push_store_collection_to_hotspot(order, ctype, amount):
2782
    try:
2783
    try:
2783
        ts = order.created_timestamp
2784
        ts = order.created_timestamp
2784
        store =  get_hotspot_store(order.storeId, "")
2785
        store =  get_hotspot_store(order.storeId, "")
2785
        storeName = store.hotspotId
2786
        storeName = store.hotspotId
2786
        store_string = "<Store>" + storeName + "</Store>"
2787
        store_string = "<Store>" + storeName + "</Store>"
2787
        order_string = "<OrderID>" + str(order.id) + "</OrderID>"
2788
        order_string = "<OrderID>" + str(order.id) + "</OrderID>"
2788
        product_string = "<Product>" + str(order.lineitems[0]) + "</Product>"
2789
        product_string = "<Product>" + str(order.lineitems[0]) + "</Product>"
2789
        collection_type = "<CollectionType>" + type + "</CollectionType>"
2790
        collection_type = "<CollectionType>" + ctype + "</CollectionType>"
2790
        if type == 'advance':
-
 
2791
            amount_string = "<AdvanceAmount>" + order.advanceAmount + "</AdvanceAmount>"
2791
        amount_string = "<AdvanceAmount>" + amount + "</AdvanceAmount>"
2792
        date_string = "<TimeStamp>" + ts.strftime("%Y%m%d%H%M%S") + "</TimeStamp>"
2792
        date_string = "<TimeStamp>" + ts.strftime("%Y%m%d%H%M%S") + "</TimeStamp>"
2793
        cash_string = "<CashAmount>" + order.advanceAmount + "</CashAmount>"
2793
        cash_string = "<CashAmount>" + order.advanceAmount + "</CashAmount>"
2794
        card_string = "<CardAmount>" + "0" + "</CardAmount>"
2794
        card_string = "<CardAmount>" + "0" + "</CardAmount>"
2795
          
2795
          
2796
        #advance, saleClosure, advanceRefund, saleRefund
2796
        #advance, saleClosure, advanceRefund, saleRefund
Line 5246... Line 5246...
5246
            query = query.filter(Order.status.in_(statuses))
5246
            query = query.filter(Order.status.in_(statuses))
5247
                
5247
                
5248
    orders = query.filter(Order.storeId == storeId).all()
5248
    orders = query.filter(Order.storeId == storeId).all()
5249
    return orders
5249
    return orders
5250
 
5250
 
5251
def get_store_order_advance_invoice(orderId):
5251
def get_store_order_advance_invoice(orderId, storeId):
5252
    order = Order.get_by(id = orderId)
5252
    order = Order.get_by(id = orderId)
-
 
5253
    storeOrderDetail = StoreOrderDetail.query.filter(StoreOrderDetail.orderId == orderId).filter(StoreOrderDetail.storeId == storeId).first()
5253
    filename = "/tmp/recharge" + str(order.id) + ".pdf"
5254
    filename = "/tmp/recharge" + str(order.id) + ".pdf"
5254
    modelName = "&nbsp;"
5255
    modelName = "&nbsp;"
5255
    modelNumber = "&nbsp;"
5256
    modelNumber = "&nbsp;"
5256
    color = "&nbsp;"
5257
    color = "&nbsp;"
5257
    if order.lineitems[0].model_name:
5258
    if order.lineitems[0].model_name:
Line 5260... Line 5261...
5260
        modelNumber = modelNumber + order.lineitems[0].model_number
5261
        modelNumber = modelNumber + order.lineitems[0].model_number
5261
    if order.lineitems[0].color:
5262
    if order.lineitems[0].color:
5262
        color = color + order.lineitems[0].color
5263
        color = color + order.lineitems[0].color
5263
    
5264
    
5264
    product = order.lineitems[0].brand +  modelName + modelNumber + color
5265
    product = order.lineitems[0].brand +  modelName + modelNumber + color
5265
    amount = order.advanceAmount
5266
    advanceAmount = order.advanceAmount
5266
    totalAmount = order.total_amount
5267
    totalAmount = order.total_amount
5267
    delivery = order.expected_delivery_time
5268
    delivery = order.expected_delivery_time
-
 
5269
    
5268
    customerName = order.customer_name
5270
    customerName = order.customer_name
-
 
5271
    customerAdd1 = order.customer_address1
-
 
5272
    customerAdd2 = order.customer_address2
-
 
5273
    customerCity = order.customer_city
-
 
5274
    customerState = order.customer_state
-
 
5275
    customerMobile = order.customer_mobilenumber
-
 
5276
    customerPin = order.customer_pincode
-
 
5277
    
-
 
5278
    mode = ""
-
 
5279
    if storeOrderDetail.cashAmount > 0 and storeOrderDetail.cardAmount > 0:
-
 
5280
        mode = "CASH + CARD"
-
 
5281
    elif storeOrderDetail.cashAmount > 0:
-
 
5282
        mode = "CASH"
-
 
5283
    elif storeOrderDetail.cardAmount > 0:
-
 
5284
        mode = "CARD"
-
 
5285
        
5269
    #payMethod = recharge.payMethod
5286
    #payMethod = recharge.payMethod
-
 
5287
#    if order.status == 15 or order.status == 34:
-
 
5288
#        return __printStoreOrderAdvanceInvoice(filename, product, advanceAmount, totalAmount, customerName, delivery, mode, customerAdd1, customerAdd2, customerCity, customerState, customerMobile, customerPin)
5270
    return __printStoreOrderAdvanceInvoice(filename, product, amount, totalAmount, customerName, delivery)
5289
    return __printStoreOrderAdvanceInvoice(filename, product, advanceAmount, totalAmount, customerName, delivery, mode, customerAdd1, customerAdd2, customerCity, customerState, customerMobile, customerPin)
5271
 
5290
 
5272
 
5291
 
5273
def __printStoreOrderAdvanceInvoice(filename, product, amount, totalAmount, customerName, delivery): 
5292
def __printStoreOrderAdvanceInvoice(filename, product, advanceAmount, totalAmount, customerName, delivery, mode, customerAdd1, customerAdd2, customerCity, customerState, customerMobile, customerPin): 
5274
    PAGE_HEIGHT=defaultPageSize[1];
5293
    PAGE_HEIGHT=defaultPageSize[1];
5275
    styles = getSampleStyleSheet()
5294
    styles = getSampleStyleSheet()
5276
    styles.add(ParagraphStyle(name='prologue', alignment=TA_CENTER, fontName="Courier", rightIndent = 5, fontSize=10), alias='sH')
5295
    styles.add(ParagraphStyle(name='prologue', alignment=TA_CENTER, fontName="Courier", rightIndent = 5, fontSize=10), alias='sH')
5277
    styles.add(ParagraphStyle(name='text', alignment=TA_JUSTIFY, fontName="Courier", fontSize=10), alias='text')
5296
    styles.add(ParagraphStyle(name='text', alignment=TA_JUSTIFY, fontName="Courier", fontSize=10), alias='text')
5278
    styles.add(ParagraphStyle(name='line', alignment=TA_CENTER, fontName="Courier", fontSize=10), alias='line')
5297
    styles.add(ParagraphStyle(name='line', alignment=TA_CENTER, fontName="Courier", fontSize=10), alias='line')
Line 5288... Line 5307...
5288
 
5307
 
5289
    #Two Columns
5308
    #Two Columns
5290
    frame1 = Frame(58, doc.bottomMargin, doc.width/2 + 25, doc.height + 7, id='col1')
5309
    frame1 = Frame(58, doc.bottomMargin, doc.width/2 + 25, doc.height + 7, id='col1')
5291
    
5310
    
5292
    
5311
    
5293
 
-
 
-
 
5312
    ############### TODO ###############################################################
5294
    Story.append(Paragraph("""Spice Retail Limited<br></br>
5313
    Story.append(Paragraph("""Spice Retail Limited<br></br>
5295
        C/O,PIBCO LIMITED,Basement,Punjsons<br></br>
5314
        C/O,PIBCO LIMITED,Basement,Punjsons<br></br>
5296
        2,Kalkaji Industrial Area,New Delhi<br></br>
5315
        2,Kalkaji Industrial Area,New Delhi<br></br>
5297
          .<br></br>
5316
          .<br></br>
5298
        TIN NO. 07430284979<br></br>
5317
        TIN NO. 07430284979<br></br>
5299
        Service Tax No:AAACM0294PST001<br></br><br></br><br></br>""", prologueStyle))
5318
        Service Tax No:AAACM0294PST001<br></br><br></br><br></br>""", prologueStyle))
-
 
5319
    ############### ADDRESS TO BE DYNAMIC ##############################################
-
 
5320
    
5300
    drawLine(Story, lineStyle)
5321
    drawLine(Story, lineStyle)
5301
    
5322
    
-
 
5323
    Story.append(Paragraph("{0:^39s}".format("DELIVERY ADDRESS").replace(" ", "&nbsp;"), textStyle))
-
 
5324
    drawLine(Story, lineStyle)
-
 
5325
    Story.append(Paragraph(customerAdd1, textStyle))
-
 
5326
    if len(customerAdd2) > 0:
-
 
5327
        Story.append(Paragraph(customerAdd2, textStyle))
-
 
5328
        
-
 
5329
    Story.append(Paragraph(customerCity, textStyle))
-
 
5330
    Story.append(Paragraph(customerState + " - " + customerPin, textStyle))
-
 
5331
    drawLine(Story, lineStyle)
5302
    
5332
    
5303
    Story.append(Paragraph("{0:<6s}{1:<34s}".format("NAME:", customerName).replace(" ", "&nbsp;"), textStyle))
5333
    Story.append(Paragraph("{0:<6s}{1:<34s}".format("NAME:", customerName).replace(" ", "&nbsp;"), textStyle))
-
 
5334
    Story.append(Paragraph("{0:<10s}{1:<29s}".format("MOBILE:", customerMobile).replace(" ", "&nbsp;"), textStyle))
5304
    Story.append(Paragraph("{0:<15s}{1:  %d/%m/%Y}".format("EXP DELIVERY:", delivery).replace(" ", "&nbsp;"), textStyle))
5335
    Story.append(Paragraph("{0:<15s}{1:  %d/%m/%Y}".format("EXP DELIVERY:", delivery).replace(" ", "&nbsp;"), textStyle))
5305
    Story.append(Paragraph("{0:<15s}{1:<25s}".format("PAYMENT MODE:", "CARD").replace(" ", "&nbsp;"), textStyle))
5336
    Story.append(Paragraph("{0:<15s}{1:<25s}".format("PAYMENT MODE:", mode).replace(" ", "&nbsp;"), textStyle))
5306
    
5337
    
5307
    drawLine(Story, lineStyle)
5338
    drawLine(Story, lineStyle)
5308
    Story.append(Paragraph("{0:^39s}".format("PRODUCT NAME").replace(" ", "&nbsp;"), textStyle))
5339
    Story.append(Paragraph("{0:^39s}".format("PRODUCT NAME").replace(" ", "&nbsp;"), textStyle))
5309
    drawLine(Story, lineStyle)
5340
    drawLine(Story, lineStyle)
5310
    Story.append(Paragraph("{0:<39s}".format(product).replace(" ", "&nbsp;"), textStyle))
5341
    Story.append(Paragraph("{0:<39s}".format(product).replace(" ", "&nbsp;"), textStyle))
5311
    drawLine(Story, lineStyle)
5342
    drawLine(Story, lineStyle)
5312
    
5343
    
5313
    Story.append(Paragraph(('{0:<20s}{1:>19.2f}').format("TOTAL PRICE: ", totalAmount).replace(' ', '&nbsp;'),textStyle))
5344
    Story.append(Paragraph(('{0:<20s}{1:>19.2f}').format("TOTAL PRICE: ", totalAmount).replace(' ', '&nbsp;'),textStyle))
5314
    Story.append(Paragraph(('{0:<20s}{1:>19.2f}').format("ADVANCE PAID: ", amount).replace(' ', '&nbsp;'),textStyle))
5345
    Story.append(Paragraph(('{0:<20s}{1:>19.2f}').format("ADVANCE AMOUNT: ", advanceAmount).replace(' ', '&nbsp;'),textStyle))
-
 
5346
    Story.append(Paragraph(('{0:<20s}{1:>19.2f}').format("BALANCE TO BE PAID: ", (totalAmount - advanceAmount)).replace(' ', '&nbsp;'),textStyle))
5315
    
5347
    
5316
    drawLine(Story, lineStyle)
5348
    drawLine(Story, lineStyle)
5317
    drawLine(Story, lineStyle)
-
 
5318
    Story.append(Paragraph(('{0:<20s}{1:>19s}').format("Customer care : ", "0120-6744700").replace(' ', '&nbsp;'),textStyle))
5349
    Story.append(Paragraph(('{0:<20s}{1:>19s}').format("Customer care : ", "0120-6744700").replace(' ', '&nbsp;'),textStyle))
-
 
5350
    drawLine(Story, lineStyle)
-
 
5351
    drawLine(Story, lineStyle)
-
 
5352
    
-
 
5353
    Story.append(Paragraph("Note:", textStyle))                                        
-
 
5354
    Story.append(Paragraph("* In case of cancellation of order on customer request, 10% of product amount subject to minimum Rs 500/- shall be deducted by Spice Retail Limited as cancellation charges. Customer shall provide original copy of 'Advance Receipt' to get the balance amount as refund",textStyle))                                        
-
 
5355
    Story.append(Paragraph("* In case of cancellation of order other than customer request, original copy of 'Advance Receipt' shall be provided by customer to get the refund",textStyle))                                        
-
 
5356
    Story.append(Paragraph("* Balance amount as mentioned above to be paid at the time of delivery of product to courier agency. Refusal to accept the product delivered through courier shall be deemed as cancellation of order and cancellation charges shall become applicable.",textStyle))                                         
-
 
5357
    Story.append(Paragraph("* The product as mentioned above shall be made available to the customer, subject to its availability from the manufacturer",textStyle))                                        
-
 
5358
 
5319
    
5359
    
5320
    doc.addPageTemplates([PageTemplate(id='TwoCol',frames=[frame1]), ])
5360
    doc.addPageTemplates([PageTemplate(id='TwoCol',frames=[frame1]), ])
5321
 
5361
 
5322
    #start the construction of the pdf
5362
    #start the construction of the pdf
5323
    doc.build(Story)
5363
    doc.build(Story)
Line 5354... Line 5394...
5354
        operatorSeriesObject.series = series
5394
        operatorSeriesObject.series = series
5355
        operatorSeriesObject.circleId = circle
5395
        operatorSeriesObject.circleId = circle
5356
        operatorSeriesObject.operatorId = operatorId
5396
        operatorSeriesObject.operatorId = operatorId
5357
        session.commit()
5397
        session.commit()
5358
        return "Successfully saved"
5398
        return "Successfully saved"
5359
 
5399
    
-
 
5400
         
-
 
5401
def save_store_order_detail(thrift_storeOrderDetail):
-
 
5402
    txnId = thrift_storeOrderDetail.orderId
-
 
5403
    txn = Transaction.get_by(id=txnId)
-
 
5404
    oid = txn.orders[0].id
-
 
5405
    ds_storeOrderDetail = StoreOrderDetail()
-
 
5406
    ds_storeOrderDetail.orderId = oid
-
 
5407
    ds_storeOrderDetail.advanceAmount = thrift_storeOrderDetail.advanceAmount
-
 
5408
    ds_storeOrderDetail.cardAmount = thrift_storeOrderDetail.cardAmount
-
 
5409
    ds_storeOrderDetail.cashAmount = thrift_storeOrderDetail.cashAmount
-
 
5410
    ds_storeOrderDetail.storeId = thrift_storeOrderDetail.storeId
-
 
5411
    ds_storeOrderDetail.payStatus = thrift_storeOrderDetail.payStatus
-
 
5412
    session.commit()
-
 
5413
    return True
-
 
5414
    
-
 
5415
def get_store_order_detail(orderId, storeId):
-
 
5416
    storeOrderDetail = StoreOrderDetail.query.filter(StoreOrderDetail.orderId == orderId).filter(StoreOrderDetail.storeId == storeId).first()
-
 
5417
    if storeOrderDetail:
-
 
5418
        return storeOrderDetail
-
 
5419
    else:
-
 
5420
        return StoreOrderDetail()
-
 
5421
    
-
 
5422
def get_all_edc_banks():
-
 
5423
    allBankNames = []
-
 
5424
    edcBanks = EdcBank.query.all();
-
 
5425
    for bank in edcBanks:
-
 
5426
        allBankNames.append(bank.name)
-
 
5427
    return allBankNames
-
 
5428
    
5360
if __name__ == '__main__':
5429
if __name__ == '__main__':
5361
    print 'helllo'
5430
    print 'helllo'
5362
5431