Alter , Payment terms , rate po bug

This commit is contained in:
VE10-Sanjeev 2025-03-05 13:28:53 +00:00
parent 70ad27c36c
commit 765600c4c6
5 changed files with 69 additions and 30 deletions

View File

@ -1838,8 +1838,16 @@ if (!empty($INRSYMBOL)) {
function showsubmit() { function showsubmit() {
var isChecked = $('#IsOpenOrder').is(':checked'); var isChecked = $('#IsOpenOrder').is(':checked');
// alert("isChecked: " + isChecked); console.log("Step 1 = SS");
var PO = $('#POType').val(); var PO = $('#POType').val();
if (PO == 'SERVICE') {
if ($('#emergdescofpo').val().trim() == '') {
alert('Please Enter Description Of Service');
$('#emergdescofpo').focus();
return false;
}
}
if (isChecked) { if (isChecked) {
if (PO == 'REVENUE') { if (PO == 'REVENUE') {
@ -6335,6 +6343,7 @@ if (!empty($INRSYMBOL)) {
}); });
} }
$("#PaymentMethod").trigger('change');
}); });
$(document).ready(function () { $(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*/ /*get cost center name using department*/
var CostArray = ''; var CostArray = '';
$('#DepartmentName').change(function () { $('#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 // set default null value
function clearTotalItemValues() { function clearTotalItemValues() {

View File

@ -123,6 +123,18 @@
$('#editpackagingcalmodel').on('hidden.bs.modal', function() { $('#editpackagingcalmodel').on('hidden.bs.modal', function() {
$('#editpackagingcalmodel').css('z-index', ''); // Reset to default $('#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('');
}
});
}); });
</script> </script>
<?php <?php
@ -703,7 +715,7 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="payablefrom">Payable Terms </label> <label for="payablefrom">Payable Terms<span class="text-danger">*</span> </label>
<?php <?php
$options1 = array("0" => 'Select Payment method'); $options1 = array("0" => 'Select Payment method');
@ -722,7 +734,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
<div class="form-group col-md-3" id="otheroptiondiv" style="display:none;"> <div class="form-group col-md-3" id="otheroptiondiv" style="display:none;">
<label>Description of Payable Terms</label> <label>Description of Payable Terms<span class="text-danger">*</span></label>
<div> <div>
<?php <?php
$data = array('name' => 'Otherpayment', 'Otherpayment' => set_value('Otherpayment'), 'id' => 'Otherpayment', 'class' => 'form-control', 'required' => 'true'); $data = array('name' => 'Otherpayment', 'Otherpayment' => set_value('Otherpayment'), 'id' => 'Otherpayment', 'class' => 'form-control', 'required' => 'true');
@ -2740,6 +2752,11 @@ if (!empty($INRSYMBOL)) {
RequistQuantity = obj.Quantity; RequistQuantity = obj.Quantity;
$('#RateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')'); $('#RateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')');
$('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/Ton)'); $('#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"; window.location = "purchaseorderListing";
// setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} else { } else {
$('#loader').hide();
// $('#content').loader('hide'); // $('#content').loader('hide');
alert("Error"); alert("Error");
// setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
@ -4588,6 +4606,7 @@ if (!empty($INRSYMBOL)) {
}, },
error: function(jqXHR, textStatus, errorThrown) { error: function(jqXHR, textStatus, errorThrown) {
$('#loader').hide();
console.error("AJAX Error: " + textStatus + ": " + errorThrown); console.error("AJAX Error: " + textStatus + ": " + errorThrown);
alert("Error: " + textStatus); alert("Error: " + textStatus);
// setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
@ -5398,17 +5417,6 @@ if (!empty($INRSYMBOL)) {
return TAXval; // $('#AfterServiceTax').val(TAXval); 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() { function clearTotalItemValues() {
$('#txtTotCgst').val(''); $('#txtTotCgst').val('');

View File

@ -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); $("#ItemName").val(obj.MaterialName);
$("#UOM").val(obj.UOM); $("#UOM").val(obj.UOM);
$("#Quantity").val(obj.Quantity); $("#Quantity").val(obj.Quantity);
$("#Rate").val(obj.material_rate);
RequistQuantity = obj.Quantity; RequistQuantity = obj.Quantity;
unit = obj.UOM; unit = obj.UOM;
// document.getElementById("labelPurchaseRate").innerHTML ='purchase rate [Basic]/'+unit; // document.getElementById("labelPurchaseRate").innerHTML ='purchase rate [Basic]/'+unit;
// document.getElementById("labelEditPurchaseRate").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('txtDeletedRow', txtDeletedRow);
formData.append('textStatus', stat); formData.append('textStatus', stat);
// disableButtons(); // disableButtons();
$('#loader').show();
$.ajax({ $.ajax({
// data:$('.ImportPO').serialize()+"&txtRowCount="+txtRowCount+"&txtDeletedRow="+txtDeletedRow+"&textStatus="+stat, // 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, //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, processData: false,
contentType: false, contentType: false,
success: function(data) { success: function(data) {
$('#loader').hide();
if (data) { if (data) {
// $('#content').loader('hide'); // $('#content').loader('hide');
alert(data); alert(data);
@ -4219,6 +4227,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
// setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} else { } else {
$('#loader').hide();
alert("Error"); alert("Error");
// setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }

View File

@ -293,7 +293,7 @@ if (!empty($INRSYMBOL)) {
} }
$("#PaymentTerms").trigger('change'); $("#PaymentTerms").trigger('change');
}); });
$('#drpSupplier').change(function() { $('#drpSupplier').change(function() {
var id = $('#drpSupplier').val(); var id = $('#drpSupplier').val();
@ -434,6 +434,9 @@ if (!empty($INRSYMBOL)) {
$("#Quantity").val(obj.Quantity); $("#Quantity").val(obj.Quantity);
$("#Rate").val(obj.material_rate); $("#Rate").val(obj.material_rate);
RequistQuantity = obj.Quantity; RequistQuantity = obj.Quantity;
if(obj.material_rate != 0){
change();
}
} }
}); });
} }
@ -2103,7 +2106,7 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="payablefrom">Payable Terms</label> <label for="payablefrom">Payable Terms<span class="text-danger">*</span></label>
<?php <?php
if (!empty($Payment)) { if (!empty($Payment)) {
$options6 = array("0" => 'Select Payment Terms '); $options6 = array("0" => 'Select Payment Terms ');
@ -3946,7 +3949,7 @@ if (!empty($INRSYMBOL)) {
// else { // else {
var formData = new FormData($('.CreatePO')[0]); var formData = new FormData($('.CreatePO')[0]);
// disableButtons(); $('#loader').show();
$.ajax({ $.ajax({
type: "POST", type: "POST",
@ -3955,6 +3958,7 @@ if (!empty($INRSYMBOL)) {
processData: false, processData: false,
contentType: false, contentType: false,
success: function(data) { success: function(data) {
$('#loader').hide();
if (data) { if (data) {
alert(data); alert(data);
@ -3973,6 +3977,7 @@ if (!empty($INRSYMBOL)) {
}, },
error: function(jqXHR, textStatus, errorThrown) { error: function(jqXHR, textStatus, errorThrown) {
$('#loader').hide();
console.error("AJAX Error: " + textStatus + ": " + errorThrown); console.error("AJAX Error: " + textStatus + ": " + errorThrown);
alert("Error: " + textStatus); alert("Error: " + textStatus);
// setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);

View File

@ -208,6 +208,7 @@ if (!empty($INRSYMBOL)) {
}); });
} }
$("#PaymentTerms").trigger('change');
}); });
document.getElementById("Date").checked = true; document.getElementById("Date").checked = true;
@ -369,6 +370,10 @@ if (!empty($INRSYMBOL)) {
$('#otherdescription').show(); $('#otherdescription').show();
$('#OtheritemDescription').val(obj.MaterialDescription); $('#OtheritemDescription').val(obj.MaterialDescription);
} }
if(obj.material_rate != 0){
Ratechange();
}
} }
}); });
} }
@ -2402,7 +2407,7 @@ if (!empty($INRSYMBOL)) {
// return false; // return false;
// } else { // } else {
var formData = new FormData($('.ServicePO')[0]); var formData = new FormData($('.ServicePO')[0]);
// disableButtons(); $('#loader').show();
console.log("inside add service purchase order view page"); console.log("inside add service purchase order view page");
console.log(formData); console.log(formData);
@ -2415,6 +2420,7 @@ if (!empty($INRSYMBOL)) {
processData: false, processData: false,
contentType: false, contentType: false,
success: function(data) { success: function(data) {
$('#loader').hide();
if (data) { if (data) {
alert(data); alert(data);
$('#txtRowCount').val(''); $('#txtRowCount').val('');
@ -2424,6 +2430,7 @@ if (!empty($INRSYMBOL)) {
window.location = "purchaseorderListing"; window.location = "purchaseorderListing";
// setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} else { } else {
$('#loader').hide();
alert("Error"); alert("Error");
// setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }