Subversion Repositories SmartDukaan

Rev

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

Rev 37701 Rev 37704
Line 442... Line 442...
442
 
442
 
443
 
443
 
444
        editPurchase(true, purchaseOrderId);
444
        editPurchase(true, purchaseOrderId);
445
    });
445
    });
446
 
446
 
-
 
447
    // A movement closed before its stock arrived can be reopened, which restarts its auto-close window.
-
 
448
    $(document).on('click', '.reopenPurchaseOrder', function () {
-
 
449
        var $button = $(this);
-
 
450
        var poId = $button.data('poid');
-
 
451
        if (!confirm('Reopen this purchase order so the delayed stock can still be received?')) {
-
 
452
            return;
-
 
453
        }
-
 
454
        doPostAjaxRequestHandler(context + '/reopenPurchaseOrder?purchaseId=' + poId, function (response) {
-
 
455
            if (response == 'true') {
-
 
456
                alert('Purchase order reopened. It can receive stock again.');
-
 
457
                $button.closest('tr').find('td').eq(7).text('READY');
-
 
458
                $button.remove();
-
 
459
            }
-
 
460
        });
-
 
461
    });
-
 
462
 
447
    $(document).on('click', '.closePurchaseOrder', function () {
463
    $(document).on('click', '.closePurchaseOrder', function () {
448
        var purchaseOrderId = $(this).data('poid');
464
        var purchaseOrderId = $(this).data('poid');
449
        if (confirm("Are you sure you want to close the PO") == true) {
465
        if (confirm("Are you sure you want to close the PO") == true) {
450
            doPostAjaxRequestHandler(context + "/closePuchaseOrder?purchaseId=" + purchaseOrderId,
466
            doPostAjaxRequestHandler(context + "/closePuchaseOrder?purchaseId=" + purchaseOrderId,
451
                function (response) {
467
                function (response) {