diff --git a/app/Views/alterpurchaseorder.php b/app/Views/alterpurchaseorder.php index 8effcdeb..92943fb1 100755 --- a/app/Views/alterpurchaseorder.php +++ b/app/Views/alterpurchaseorder.php @@ -1838,8 +1838,16 @@ if (!empty($INRSYMBOL)) { function showsubmit() { var isChecked = $('#IsOpenOrder').is(':checked'); - // alert("isChecked: " + isChecked); + console.log("Step 1 = SS"); var PO = $('#POType').val(); + + if (PO == 'SERVICE') { + if ($('#emergdescofpo').val().trim() == '') { + alert('Please Enter Description Of Service'); + $('#emergdescofpo').focus(); + return false; + } + } if (isChecked) { if (PO == 'REVENUE') { @@ -6335,6 +6343,7 @@ if (!empty($INRSYMBOL)) { }); } + $("#PaymentMethod").trigger('change'); }); $(document).ready(function () { @@ -6406,6 +6415,18 @@ if (!empty($INRSYMBOL)) { } }); + + //If others is the payment terms to display mandatory field + $("#PaymentMethod").change(function () { + + if ($('#PaymentMethod').val().trim() == 'PT08') { + $('#otheroptiondiv').show(); + } else { + $('#otheroptiondiv').hide(); + $('#Otherpayment').val(''); + } + }); + /*get cost center name using department*/ var CostArray = ''; $('#DepartmentName').change(function () { @@ -8018,17 +8039,6 @@ if (!empty($INRSYMBOL)) { } - //If others is the payment terms to display mandatory field - $("#PaymentMethod").change(function () { - - if ($('#PaymentMethod').val().trim() == 'PT08') { - $('#otheroptiondiv').show(); - } else { - $('#otheroptiondiv').hide(); - $('#Otherpayment').val(''); - } - }); - // set default null value function clearTotalItemValues() { diff --git a/app/Views/capitalpurchaseorder.php b/app/Views/capitalpurchaseorder.php index 3022c0dd..d0624eb6 100755 --- a/app/Views/capitalpurchaseorder.php +++ b/app/Views/capitalpurchaseorder.php @@ -123,6 +123,18 @@ $('#editpackagingcalmodel').on('hidden.bs.modal', function() { $('#editpackagingcalmodel').css('z-index', ''); // Reset to default }); + + //If others is the payment terms to display mandatory field + $("#PaymentMethod").change(function() { + if ($('#PaymentMethod').val().trim() == 'PT08') { + $('#otheroptiondiv').show(); + $('#Otherpayment').prop('required', true); + } else { + $('#otheroptiondiv').hide(); + $('#Otherpayment').prop('required', false); + $('#Otherpayment').val(''); + } + }); });
- + 'Select Payment method'); @@ -722,7 +734,7 @@ if (!empty($INRSYMBOL)) { ?>
- + 'Select Payment Terms '); @@ -3946,7 +3949,7 @@ if (!empty($INRSYMBOL)) { // else { var formData = new FormData($('.CreatePO')[0]); - // disableButtons(); + $('#loader').show(); $.ajax({ type: "POST", @@ -3955,6 +3958,7 @@ if (!empty($INRSYMBOL)) { processData: false, contentType: false, success: function(data) { + $('#loader').hide(); if (data) { alert(data); @@ -3973,6 +3977,7 @@ if (!empty($INRSYMBOL)) { }, error: function(jqXHR, textStatus, errorThrown) { + $('#loader').hide(); console.error("AJAX Error: " + textStatus + ": " + errorThrown); alert("Error: " + textStatus); // setTimeout(function() { enableButtons(); }, 2000); diff --git a/app/Views/servicePurchaseorder.php b/app/Views/servicePurchaseorder.php index 74a51a19..88d6e852 100755 --- a/app/Views/servicePurchaseorder.php +++ b/app/Views/servicePurchaseorder.php @@ -208,6 +208,7 @@ if (!empty($INRSYMBOL)) { }); } + $("#PaymentTerms").trigger('change'); }); document.getElementById("Date").checked = true; @@ -369,6 +370,10 @@ if (!empty($INRSYMBOL)) { $('#otherdescription').show(); $('#OtheritemDescription').val(obj.MaterialDescription); } + + if(obj.material_rate != 0){ + Ratechange(); + } } }); } @@ -2402,7 +2407,7 @@ if (!empty($INRSYMBOL)) { // return false; // } else { var formData = new FormData($('.ServicePO')[0]); - // disableButtons(); + $('#loader').show(); console.log("inside add service purchase order view page"); console.log(formData); @@ -2415,6 +2420,7 @@ if (!empty($INRSYMBOL)) { processData: false, contentType: false, success: function(data) { + $('#loader').hide(); if (data) { alert(data); $('#txtRowCount').val(''); @@ -2424,6 +2430,7 @@ if (!empty($INRSYMBOL)) { window.location = "purchaseorderListing"; // setTimeout(function() { enableButtons(); }, 2000); } else { + $('#loader').hide(); alert("Error"); // setTimeout(function() { enableButtons(); }, 2000); }