Subversion Repositories SmartDukaan

Rev

Rev 33661 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33661 Rev 33715
Line 58... Line 58...
58
        $('#' + detailContainer).html(response);
58
        $('#' + detailContainer).html(response);
59
        $("#selected-po").text(poId);
59
        $("#selected-po").text(poId);
60
    });
60
    });
61
}
61
}
62
 
62
 
-
 
63
function getPoDetailOrder(poId, detailContainer) {
-
 
64
    var url = context + "/monthlyPo/orderByPoId?poId=" + poId;
-
 
65
    doGetAjaxRequestHandler(url, function (response) {
-
 
66
 
-
 
67
        $('#' + detailContainer).html(response);
-
 
68
 
-
 
69
        $("#selected-po").text(poId);
-
 
70
 
-
 
71
        calculateAndDisplayTotalPrice();
-
 
72
    });
-
 
73
}
-
 
74
 
-
 
75
function calculateAndDisplayTotalPrice() {
-
 
76
    var totalPrice = 0;
-
 
77
 
-
 
78
    $('#suggested-monthly-po-detail tbody tr').each(function () {
-
 
79
        var itemPrice = parseFloat($(this).find('td:eq(3)').text());
-
 
80
        var quantity = parseFloat($(this).find('td:eq(2)').text());
-
 
81
 
-
 
82
        totalPrice += itemPrice * quantity;
-
 
83
    });
-
 
84
 
-
 
85
    $('.totalPoPrice').text('Total PO Price: ' + totalPrice.toFixed(2));
-
 
86
}
-
 
87
 
-
 
88
 
63
$(function () {
89
$(function () {
64
    $(document).on('click', "#approveOrderBtn", function () {
90
    $(document).on('click', "#approveOrderBtn", function () {
65
        // Show confirmation alert
91
        // Show confirmation alert
66
        var userConfirmed = confirm("Are you sure you want to approve this order?");
92
        var userConfirmed = confirm("Are you sure you want to approve this order?");
67
 
93