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)) {
?>
-
+
'Otherpayment', 'Otherpayment' => set_value('Otherpayment'), 'id' => 'Otherpayment', 'class' => 'form-control', 'required' => 'true');
@@ -2740,6 +2752,11 @@ if (!empty($INRSYMBOL)) {
RequistQuantity = obj.Quantity;
$('#RateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')');
$('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/Ton)');
+ if(obj.material_rate != 0){
+ Ratechange();
+ calculateFreight(3);
+ calculateFreightlocaddper();
+ }
}
@@ -4581,6 +4598,7 @@ if (!empty($INRSYMBOL)) {
window.location = "purchaseorderListing";
// setTimeout(function() { enableButtons(); }, 2000);
} else {
+ $('#loader').hide();
// $('#content').loader('hide');
alert("Error");
// setTimeout(function() { enableButtons(); }, 2000);
@@ -4588,6 +4606,7 @@ if (!empty($INRSYMBOL)) {
},
error: function(jqXHR, textStatus, errorThrown) {
+ $('#loader').hide();
console.error("AJAX Error: " + textStatus + ": " + errorThrown);
alert("Error: " + textStatus);
// setTimeout(function() { enableButtons(); }, 2000);
@@ -5398,17 +5417,6 @@ if (!empty($INRSYMBOL)) {
return TAXval; // $('#AfterServiceTax').val(TAXval);
}
- //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('');
- }
- });
function clearTotalItemValues() {
$('#txtTotCgst').val('');
diff --git a/app/Views/importpo.php b/app/Views/importpo.php
index 1cf5ae16..f5f1a0b4 100755
--- a/app/Views/importpo.php
+++ b/app/Views/importpo.php
@@ -2274,6 +2274,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
});
}
+ $("#PaymentTerms").trigger('change');
});
@@ -2393,10 +2394,16 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
$("#ItemName").val(obj.MaterialName);
$("#UOM").val(obj.UOM);
$("#Quantity").val(obj.Quantity);
+ $("#Rate").val(obj.material_rate);
RequistQuantity = obj.Quantity;
unit = obj.UOM;
// document.getElementById("labelPurchaseRate").innerHTML ='purchase rate [Basic]/'+unit;
// document.getElementById("labelEditPurchaseRate").innerHTML ='purchase rate [Basic]/'+unit;
+ if(obj.material_rate != 0){
+ Ratechange();
+ validateExceedLimit();
+ calculateFreight(0);
+ }
}
});
@@ -4198,7 +4205,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
formData.append('txtDeletedRow', txtDeletedRow);
formData.append('textStatus', stat);
// disableButtons();
-
+ $('#loader').show();
$.ajax({
// data:$('.ImportPO').serialize()+"&txtRowCount="+txtRowCount+"&txtDeletedRow="+txtDeletedRow+"&textStatus="+stat,
//data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeQletedRowCount="+TextDeletedRowCount+"&TextTotalOrderValueSummaryService="+TextTotalOrderValueSummaryService+"&TextSpcialInstruction="+TextSpcialInstruction+"&TextExchangerate"+ExcLandingCharge="+hangerate+"Status="+TextStatus,
@@ -4208,6 +4215,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
processData: false,
contentType: false,
success: function(data) {
+ $('#loader').hide();
if (data) {
// $('#content').loader('hide');
alert(data);
@@ -4219,6 +4227,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
// setTimeout(function() { enableButtons(); }, 2000);
} else {
+ $('#loader').hide();
alert("Error");
// setTimeout(function() { enableButtons(); }, 2000);
}
diff --git a/app/Views/purchaseorder.php b/app/Views/purchaseorder.php
index c7e71882..d4859d4e 100755
--- a/app/Views/purchaseorder.php
+++ b/app/Views/purchaseorder.php
@@ -293,7 +293,7 @@ if (!empty($INRSYMBOL)) {
}
$("#PaymentTerms").trigger('change');
});
-
+
$('#drpSupplier').change(function() {
var id = $('#drpSupplier').val();
@@ -434,6 +434,9 @@ if (!empty($INRSYMBOL)) {
$("#Quantity").val(obj.Quantity);
$("#Rate").val(obj.material_rate);
RequistQuantity = obj.Quantity;
+ if(obj.material_rate != 0){
+ change();
+ }
}
});
}
@@ -2103,7 +2106,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);
}