| Line 429... |
Line 429... |
| 429 |
transaction_requiring_extra_processing = TransactionRequiringExtraProcessing()
|
429 |
transaction_requiring_extra_processing = TransactionRequiringExtraProcessing()
|
| 430 |
transaction_requiring_extra_processing.category = 'PAYMENT_FLAGGED'
|
430 |
transaction_requiring_extra_processing.category = 'PAYMENT_FLAGGED'
|
| 431 |
transaction_requiring_extra_processing.transaction_id = transaction_id
|
431 |
transaction_requiring_extra_processing.transaction_id = transaction_id
|
| 432 |
session.commit()
|
432 |
session.commit()
|
| 433 |
elif order.source == OrderSource.STORE:
|
433 |
elif order.source == OrderSource.STORE:
|
| - |
|
434 |
order.otg = False
|
| 434 |
|
435 |
session.commit()
|
| 435 |
catalog_client = CatalogClient().get_client()
|
436 |
catalog_client = CatalogClient().get_client()
|
| 436 |
sourcePricing = catalog_client.getStorePricing(order.lineitems[0].item_id)
|
437 |
sourcePricing = catalog_client.getStorePricing(order.lineitems[0].item_id)
|
| 437 |
if order.total_amount >= sourcePricing.minPrice:
|
438 |
if order.total_amount >= sourcePricing.minPrice:
|
| 438 |
order.status = OrderStatus.SUBMITTED_FOR_PROCESSING
|
439 |
order.status = OrderStatus.SUBMITTED_FOR_PROCESSING
|
| 439 |
order.statusDescription = "Order Accepted"
|
440 |
order.statusDescription = "Order Accepted"
|
| Line 634... |
Line 635... |
| 634 |
html_footer = html_footer + "<tr>\
|
635 |
html_footer = html_footer + "<tr>\
|
| 635 |
<td colspan=5>EMI Processing Charges</td>\
|
636 |
<td colspan=5>EMI Processing Charges</td>\
|
| 636 |
<td> Rs. $emi_amount</td>\
|
637 |
<td> Rs. $emi_amount</td>\
|
| 637 |
</tr>"
|
638 |
</tr>"
|
| 638 |
|
639 |
|
| - |
|
640 |
amount_string = "Total Amount"
|
| 639 |
if advance_amount > 0:
|
641 |
if advance_amount > 0:
|
| - |
|
642 |
amount_string = "Balance Amount"
|
| 640 |
total_amount -= advance_amount
|
643 |
total_amount -= advance_amount
|
| 641 |
html_footer = html_footer + "<tr>\
|
644 |
html_footer = html_footer + "<tr>\
|
| 642 |
<td colspan=5>Advance Paid</td>\
|
645 |
<td colspan=5>Advance Paid</td>\
|
| 643 |
<td> Rs. $advance_amount</td>\
|
646 |
<td> Rs. $advance_amount</td>\
|
| 644 |
</tr>"
|
647 |
</tr>"
|
| 645 |
|
648 |
|
| 646 |
html_footer = html_footer + "<tr>\
|
649 |
html_footer = html_footer + "<tr>\
|
| 647 |
<td colspan=5>Total Amount</td>\
|
650 |
<td colspan=5>$amount_string</td>\
|
| 648 |
<td> Rs. $total_amount</td>\
|
651 |
<td> Rs. $total_amount</td>\
|
| 649 |
</tr>\
|
652 |
</tr>\
|
| 650 |
</table>\
|
653 |
</table>\
|
| 651 |
</div>"
|
654 |
</div>"
|
| 652 |
|
655 |
|
| Line 697... |
Line 700... |
| 697 |
|
700 |
|
| 698 |
sdt = datetime.datetime.strptime(str(orders[0].expected_delivery_time), "%Y-%m-%d %H:%M:%S")
|
701 |
sdt = datetime.datetime.strptime(str(orders[0].expected_delivery_time), "%Y-%m-%d %H:%M:%S")
|
| 699 |
store_delivery_date = sdt.strftime("%A, %d %B %Y")
|
702 |
store_delivery_date = sdt.strftime("%A, %d %B %Y")
|
| 700 |
|
703 |
|
| 701 |
email_header = Template(html_header).substitute(dict(order_date = formated_order_date, customer_name = customer_name, source_url = source_url, otgLink = otgLink, saddress = saddress))
|
704 |
email_header = Template(html_header).substitute(dict(order_date = formated_order_date, customer_name = customer_name, source_url = source_url, otgLink = otgLink, saddress = saddress))
|
| 702 |
email_footer = Template(html_footer).substitute(dict(total_amount = "%.2f" % total_amount, emi_amount = "%.2f" % emi_amount, advance_amount = "%.2f" % advance_amount, net_amount = "%.2f" % (total_amount-order.gvAmount), secret_code = random_text, store_address = store_address, store_delivery_date = store_delivery_date, source_url = source_url, source_name = source_name))
|
705 |
email_footer = Template(html_footer).substitute(dict(total_amount = "%.2f" % total_amount, emi_amount = "%.2f" % emi_amount, advance_amount = "%.2f" % advance_amount, net_amount = "%.2f" % (total_amount-order.gvAmount), secret_code = random_text, store_address = store_address, store_delivery_date = store_delivery_date, source_url = source_url, source_name = source_name, amount_string = amount_string))
|
| 703 |
|
706 |
|
| 704 |
try:
|
707 |
try:
|
| 705 |
helper_client = HelperClient().get_client()
|
708 |
helper_client = HelperClient().get_client()
|
| 706 |
helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(transaction_id), "TransactionInfo", [], bcc)
|
709 |
helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(transaction_id), "TransactionInfo", [], bcc)
|
| 707 |
|
710 |
|