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() {
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() {

View File

@ -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('');
}
});
});
</script>
<?php
@ -703,7 +715,7 @@ if (!empty($INRSYMBOL)) {
</div>
</div>
<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
$options1 = array("0" => 'Select Payment method');
@ -722,7 +734,7 @@ if (!empty($INRSYMBOL)) {
?>
</div>
<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>
<?php
$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;
$('#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('');

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);
$("#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);
}

View File

@ -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)) {
</div>
</div>
<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
if (!empty($Payment)) {
$options6 = array("0" => '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);

View File

@ -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);
}