Subversion Repositories SmartDukaan

Rev

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

Rev 37750 Rev 37770
Line 456... Line 456...
456
 
456
 
457
 
457
 
458
        editPurchase(true, purchaseOrderId);
458
        editPurchase(true, purchaseOrderId);
459
    });
459
    });
460
 
460
 
461
    // A movement closed before its stock arrived can be reopened, which restarts its auto-close window.
-
 
462
    $(document).on('click', '.reopenPurchaseOrder', function () {
-
 
463
        var $button = $(this);
-
 
464
        var poId = $button.data('poid');
-
 
465
        if (!confirm('Reopen this purchase order so the delayed stock can still be received?')) {
-
 
466
            return;
-
 
467
        }
-
 
468
        doPostAjaxRequestHandler(context + '/reopenPurchaseOrder?purchaseId=' + poId, function (response) {
-
 
469
            if (response == 'true') {
-
 
470
                alert('Purchase order reopened. It can receive stock again.');
-
 
471
                $button.closest('tr').find('td').eq(7).text('READY');
-
 
472
                $button.remove();
-
 
473
            }
-
 
474
        });
-
 
475
    });
-
 
476
 
-
 
477
    $(document).on('click', '.closePurchaseOrder', function () {
461
    $(document).on('click', '.closePurchaseOrder', function () {
478
        var purchaseOrderId = $(this).data('poid');
462
        var purchaseOrderId = $(this).data('poid');
479
        if (confirm("Are you sure you want to close the PO") == true) {
463
        if (confirm("Are you sure you want to close the PO") == true) {
480
            doPostAjaxRequestHandler(context + "/closePuchaseOrder?purchaseId=" + purchaseOrderId,
464
            doPostAjaxRequestHandler(context + "/closePuchaseOrder?purchaseId=" + purchaseOrderId,
481
                function (response) {
465
                function (response) {
Line 798... Line 782...
798
        } else if (mismatch == "PoMismatch") {
782
        } else if (mismatch == "PoMismatch") {
799
            // Say what the replacement PO is for and what to do if it closes before the stock lands, rather than
783
            // Say what the replacement PO is for and what to do if it closes before the stock lands, rather than
800
            // leaving someone to discover that a GRN has quietly stopped matching.
784
            // leaving someone to discover that a GRN has quietly stopped matching.
801
            if (confirm("Resolve this price mismatch?\n\nThe current PO line is discarded and a replacement "
785
            if (confirm("Resolve this price mismatch?\n\nThe current PO line is discarded and a replacement "
802
                    + "purchase order is raised on the invoice date at the corrected price. This invoice is then "
786
                    + "purchase order is raised on the invoice date at the corrected price. This invoice is then "
803
                    + "received against that PO.\n\nIt closes automatically after 4 days for a warehouse movement, "
787
                    + "received against that PO.\n\nIt closes automatically after 6 days; if the stock arrives "
804
                    + "6 for a vendor order. A movement that closes before its stock arrives can be reopened from "
-
 
805
                    + "Purchase Orders; a vendor order cannot, and needs a fresh PO.") == true) {
788
                    + "later, it needs a fresh PO.") == true) {
806
 
789
 
807
                doGetAjaxRequestHandler(context + "/resolvedMismatchRequest?id=" + id, function (response) {
790
                doGetAjaxRequestHandler(context + "/resolvedMismatchRequest?id=" + id, function (response) {
808
                    if (response == 'true') {
791
                    if (response == 'true') {
809
                        getGrnRequestItems(requestId, invoiceId)
792
                        getGrnRequestItems(requestId, invoiceId)
810
                    }
793
                    }