Subversion Repositories SmartDukaan

Rev

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

Rev 6418 Rev 6422
Line 483... Line 483...
483
            html_tr += "<td align='center'>" + ("%.0f" % lineitem.quantity) + "</td>"
483
            html_tr += "<td align='center'>" + ("%.0f" % lineitem.quantity) + "</td>"
484
            html_tr += "<td align='center'> Rs. " + ("%.2f" % lineitem.unit_price) + "</td>"
484
            html_tr += "<td align='center'> Rs. " + ("%.2f" % lineitem.unit_price) + "</td>"
485
            html_tr += "<td align='center'> Rs. " + ("%.2f" % lineitem_total_price) + "</td></tr>"
485
            html_tr += "<td align='center'> Rs. " + ("%.2f" % lineitem_total_price) + "</td></tr>"
486
            total_amount += lineitem_total_price
486
            total_amount += lineitem_total_price
487
            html_table += html_tr
487
            html_table += html_tr
-
 
488
            
-
 
489
    emi_amount = 0
-
 
490
    miscCharges = get_misc_charges(transaction_id)
-
 
491
    if miscCharges.get(1):
-
 
492
        emi_amount = miscCharges.get(1)
488
    
493
        
489
    html_footer = """
494
    html_footer = """
490
        <tr><td colspan=6>&nbsp;</td></tr>
495
        <tr><td colspan=6>&nbsp;</td></tr>
491
        <tr><td colspan=6><hr /></td></tr>
496
        <tr><td colspan=6><hr /></td></tr>
492
        <tr>
497
        """
-
 
498
    if emi_amount > 0:
-
 
499
        html_footer = html_footer + "<tr>\
-
 
500
                        <td colspan=5>EMI Processing Charges</td>\
-
 
501
                        <td> Rs. $emi_amount</td>\
-
 
502
                    </tr>"
-
 
503
                
-
 
504
    html_footer = html_footer + "<tr>\
493
            <td colspan=5>Total Amount</td>
505
                <td colspan=5>Total Amount</td>\
494
            <td> Rs. $total_amount</td>
506
                <td> Rs. $total_amount</td>\
495
        </tr>
507
                </tr>\
496
        </table>
508
            </table>\
497
    </div>
509
        </div>"
498
    """
510
    
499
    
511
    
500
    store_address = ""
512
    store_address = ""
501
    if orders[0].pickupStoreId:
513
    if orders[0].pickupStoreId:
502
        store = LogisticsClient().get_client().getPickupStore(orders[0].pickupStoreId)
514
        store = LogisticsClient().get_client().getPickupStore(orders[0].pickupStoreId)
503
        store_address = __get_store_address_html(store)
515
        store_address = __get_store_address_html(store)
Line 540... Line 552...
540
 
552
 
541
    sdt = datetime.datetime.strptime(str(orders[0].expected_delivery_time), "%Y-%m-%d %H:%M:%S")
553
    sdt = datetime.datetime.strptime(str(orders[0].expected_delivery_time), "%Y-%m-%d %H:%M:%S")
542
    store_delivery_date = sdt.strftime("%A, %d %B %Y")
554
    store_delivery_date = sdt.strftime("%A, %d %B %Y")
543
 
555
 
544
    email_header = Template(html_header).substitute(dict(order_date = formated_order_date, customer_name = customer_name, source_url = source_url))
556
    email_header = Template(html_header).substitute(dict(order_date = formated_order_date, customer_name = customer_name, source_url = source_url))
545
    email_footer = Template(html_footer).substitute(dict(total_amount = "%.2f" % total_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))
557
    email_footer = Template(html_footer).substitute(dict(total_amount = "%.2f" % total_amount, emi_amount = "%.2f" % emi_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))
546
    
558
    
547
    try:
559
    try:
548
        helper_client = HelperClient().get_client()
560
        helper_client = HelperClient().get_client()
549
        helper_client.saveUserEmailForSending([user_email], "", source_name + " - Order Details", email_header + html_table + email_footer, str(transaction_id), "TransactionInfo", [], [])
561
        helper_client.saveUserEmailForSending([user_email], "", source_name + " - Order Details", email_header + html_table + email_footer, str(transaction_id), "TransactionInfo", [], [])
550
         
562