Subversion Repositories SmartDukaan

Rev

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

Rev 7551 Rev 7557
Line 442... Line 442...
442
                    transaction_requiring_extra_processing = TransactionRequiringExtraProcessing()
442
                    transaction_requiring_extra_processing = TransactionRequiringExtraProcessing()
443
                    transaction_requiring_extra_processing.category = 'PAYMENT_FLAGGED'
443
                    transaction_requiring_extra_processing.category = 'PAYMENT_FLAGGED'
444
                    transaction_requiring_extra_processing.transaction_id = transaction_id
444
                    transaction_requiring_extra_processing.transaction_id = transaction_id
445
                    session.commit()
445
                    session.commit()
446
            elif order.source == OrderSource.STORE:
446
            elif order.source == OrderSource.STORE:
447
                    order.otg = False
447
                order.otg = False
-
 
448
                session.commit()
-
 
449
                catalog_client = CatalogClient().get_client() 
-
 
450
                sourcePricing = catalog_client.getStorePricing(order.lineitems[0].item_id)
-
 
451
                if order.total_amount >= sourcePricing.minPrice:
-
 
452
                    order.status = OrderStatus.SUBMITTED_FOR_PROCESSING
-
 
453
                    order.statusDescription = "Order Accepted"
448
                    session.commit()
454
                    session.commit()
449
                    catalog_client = CatalogClient().get_client() 
-
 
450
                    sourcePricing = catalog_client.getStorePricing(order.lineitems[0].item_id)
-
 
451
                    if order.total_amount >= sourcePricing.minPrice:
-
 
452
                        order.status = OrderStatus.SUBMITTED_FOR_PROCESSING
-
 
453
                        order.statusDescription = "Order Accepted"
-
 
454
                        session.commit()
-
 
455
                        sod = StoreOrderDetail.get_by(orderId = order.id)
455
                    sod = StoreOrderDetail.get_by(orderId = order.id)
456
                        __push_store_collection_to_hotspot(order, "advance", sod.cashAmount, sod.cardAmount)
456
                    __push_store_collection_to_hotspot(order, "advance", sod.cashAmount, sod.cardAmount)
457
                        
457
                    
458
                    else: 
458
                else: 
459
                        order.status = OrderStatus.COD_VERIFICATION_PENDING
459
                    order.status = OrderStatus.COD_VERIFICATION_PENDING
460
                        order.statusDescription = "Approval Pending"
460
                    order.statusDescription = "Approval Pending"
461
                        content = "<html><body>"
461
                    content = "<html><body>"
462
                        content += "<h4>Order Id:  " + str(order.id) + "</h4>"
462
                    content += "<h4>Order Id:  " + str(order.id) + "</h4>"
463
                        content += "<h4>Product:  " + str(order.lineitems[0]) + "</h4>"
463
                    content += "<h4>Product:  " + str(order.lineitems[0]) + "</h4>"
464
                        content += "<h4>Min Price: " +  str(sourcePricing.minPrice) + "</h4>"
464
                    content += "<h4>Min Price: " +  str(sourcePricing.minPrice) + "</h4>"
465
                        content += "<h4>Recommended Price: " +  str(sourcePricing.recommendedPrice) + "</h4>"
465
                    content += "<h4>Recommended Price: " +  str(sourcePricing.recommendedPrice) + "</h4>"
466
                        content += "<h2>Approval Requested for Price: " +  str(order.total_amount) + "</h2>"
466
                    content += "<h2>Approval Requested for Price: " +  str(order.total_amount) + "</h2>"
467
                        content += "<h2>Note 1: If this discount price is approved then reply 'Approved' otherwise 'Not Approved' without changing anythig in the Mail.</h2>"  
467
                    content += "<h2>Note 1: If this discount price is approved then reply 'Approved' otherwise 'Not Approved' without changing anythig in the Mail.</h2>"  
468
                        content += "<h2>Note 2: For Quick approval using browser <a href='http://support.shop2020.in:8080/Support/price-approval?xszbg=" + base64.b64encode(str(order.id))  + "'>Click Here</a></h2>"
468
                    content += "<h2>Note 2: For Quick approval using browser <a href='http://support.shop2020.in:8080/Support/price-approval?xszbg=" + base64.b64encode(str(order.id))  + "'>Click Here</a></h2>"
469
                        content += "<br><br></body></html>"
469
                    content += "<br><br></body></html>"
470
                        store = get_hotspot_store(order.storeId, "")
470
                    store = get_hotspot_store(order.storeId, "")
471
                        helper_client = HelperClient().get_client()
471
                    helper_client = HelperClient().get_client()
472
                        helper_client.saveUserEmailForSending(store.approvalEmail.split(';'), "", "Price approval requested for " + str(order.lineitems[0]) + " order Id " + str(order.id) + " in store " + store.hotspotId , content, str(transaction_id), "PriceApproval", [], [])
472
                    helper_client.saveUserEmailForSending(store.approvalEmail.split(';'), "", "Price approval requested for " + str(order.lineitems[0]) + " order Id " + str(order.id) + " in store " + store.hotspotId , content, str(transaction_id), "PriceApproval", [], [])
473
                        session.commit()
473
                    session.commit()
-
 
474
            else:
-
 
475
                order.otg = False
474
        except Exception as e:
476
        except Exception as e:
475
            print "Error inserting transaction Id: " + str(transaction_id) + " due to " + str(e)
477
            print "Error inserting transaction Id: " + str(transaction_id) + " due to " + str(e)
476
 
478
 
477
    return True
479
    return True
478
 
480