bug fixes
This commit is contained in:
parent
9ef36dca9b
commit
0e41548e2d
@ -4488,6 +4488,7 @@ class Purchaseorder extends BaseController
|
|||||||
$supplierid = $this->request->getPost('supplierid');
|
$supplierid = $this->request->getPost('supplierid');
|
||||||
$materialcode = $this->request->getPost('materialcode');
|
$materialcode = $this->request->getPost('materialcode');
|
||||||
$result = $this->purchaseorder_model->VerifyWithSupplierForPendingPO($supplierid, $materialcode);
|
$result = $this->purchaseorder_model->VerifyWithSupplierForPendingPO($supplierid, $materialcode);
|
||||||
|
$materialrate = $this->purchaseorder_model->materialRate($materialcode);
|
||||||
|
|
||||||
$response = "";
|
$response = "";
|
||||||
if (!empty($result)) {
|
if (!empty($result)) {
|
||||||
|
|||||||
@ -2558,6 +2558,17 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
|
|||||||
|
|
||||||
return $query->getResultArray();
|
return $query->getResultArray();
|
||||||
}
|
}
|
||||||
|
function materialRate($materialcode){
|
||||||
|
$builder = $this->db->table('t_materialmaster')
|
||||||
|
->select('t_materialmaster.material_rate')
|
||||||
|
->where('t_materialmaster.MaterialCode', $materialcode);
|
||||||
|
|
||||||
|
$query = $builder->get()->getRow();
|
||||||
|
|
||||||
|
$material_rate = $query ? $query->material_rate : null;
|
||||||
|
return $material_rate;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function lastPONO()
|
function lastPONO()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -175,7 +175,7 @@ class Requistion_model extends Model
|
|||||||
function GetMaterialCode($ReqType,$NotArray='')
|
function GetMaterialCode($ReqType,$NotArray='')
|
||||||
{
|
{
|
||||||
$builder = $this->db->table('t_materialmaster')
|
$builder = $this->db->table('t_materialmaster')
|
||||||
->select('MaterialCode, MaterialName,UOM')
|
->select('MaterialCode, MaterialName,UOM,material_rate')
|
||||||
|
|
||||||
->where('IsActive',1);
|
->where('IsActive',1);
|
||||||
//->where('MaterialType',$ReqType );
|
//->where('MaterialType',$ReqType );
|
||||||
|
|||||||
@ -14,8 +14,12 @@
|
|||||||
dateFormat: 'dd-mm-yy',
|
dateFormat: 'dd-mm-yy',
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
changeYear: true,
|
changeYear: true,
|
||||||
yearRange: '-100:+1'
|
yearRange: '-100:+1',
|
||||||
|
orientation: 'bottom',
|
||||||
|
autoclose: true,
|
||||||
|
autocomplete:'off'
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<!-- <script type="text/javascript" src="<?php echo base_url(); ?>public/assets/Autocomplete/jquery.autocomplete.js"></script> -->
|
<!-- <script type="text/javascript" src="<?php echo base_url(); ?>public/assets/Autocomplete/jquery.autocomplete.js"></script> -->
|
||||||
@ -120,7 +124,7 @@
|
|||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label for="OpenStockDate">Open Stock Date</label>
|
<label for="OpenStockDate">Open Stock Date</label>
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'Date', 'value' => set_value('Date'), 'id' => 'Date', 'class' => 'form-control', 'onkeypress' => 'return false;');
|
$data = array('name' => 'Date', 'value' => set_value('Date'), 'id' => 'Date', 'class' => 'form-control', 'onkeypress' => 'return false;', 'autocomplete'=>'"off"');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1955,12 +1955,14 @@ if (!empty($INRSYMBOL)) {
|
|||||||
if (selectedMaterialCode == value.MaterialCode) {
|
if (selectedMaterialCode == value.MaterialCode) {
|
||||||
$("#ServiceDescription").val(value.MaterialName);
|
$("#ServiceDescription").val(value.MaterialName);
|
||||||
$("#ServiceUOM").val(value.UOM);
|
$("#ServiceUOM").val(value.UOM);
|
||||||
|
$("#ServiceRate").val(value.material_rate);
|
||||||
if ($('#ScheduleType').val().trim() != 'Recurring') {
|
if ($('#ScheduleType').val().trim() != 'Recurring') {
|
||||||
$('#FrequencyChange').val('One Time');
|
$('#FrequencyChange').val('One Time');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#ServiceNo').val(1);
|
$('#ServiceNo').val(1);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$('#FrequencyChange').val($('#ScheduleType').val());
|
$('#FrequencyChange').val($('#ScheduleType').val());
|
||||||
|
|
||||||
@ -2167,7 +2169,7 @@ if (!empty($INRSYMBOL)) {
|
|||||||
if (selectedRevenueMaterialCode == value.MaterialCode) {
|
if (selectedRevenueMaterialCode == value.MaterialCode) {
|
||||||
$("#ItemName").val(value.MaterialName);
|
$("#ItemName").val(value.MaterialName);
|
||||||
$("#UOM").val(value.UOM);
|
$("#UOM").val(value.UOM);
|
||||||
|
$("#Rate").val(value.material_rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -3577,7 +3579,7 @@ if (!empty($INRSYMBOL)) {
|
|||||||
class="badge mandatory">*</span></label>
|
class="badge mandatory">*</span></label>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'ServiceRate', 'value' => set_value('ServiceRate'), 'id' => 'ServiceRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange()');
|
$data = array('name' => 'ServiceRate', 'value' => set_value('ServiceRate'), 'id' => 'ServiceRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();UpdateTheRateMaster();');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
@ -6555,7 +6557,19 @@ if (!empty($INRSYMBOL)) {
|
|||||||
$('#ServiceMaterialCode').focus();
|
$('#ServiceMaterialCode').focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
function UpdateTheRateMaster(){
|
||||||
|
if ($('#ServiceMaterialCode').val() != "0" && $('#ServiceRate').val() != "0" ) {
|
||||||
|
var MaterialCode = $('#ServiceMaterialCode').val();
|
||||||
|
var Rate = $('#ServiceRate').val();
|
||||||
|
}
|
||||||
|
if ($('#ServiceMaterialCode').val() != "0" && $('#ServiceRate').val() != "0" ) {
|
||||||
|
var MaterialCode = $('#MaterialCode').val();
|
||||||
|
var Rate = $('#Rate').val();
|
||||||
|
}
|
||||||
|
if (MaterialCode != "0" && Rate != "0" ) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($('#ServiceQuantity').val() != '' && $('#ServiceRate').val() != '') {
|
if ($('#ServiceQuantity').val() != '' && $('#ServiceRate').val() != '') {
|
||||||
|
|||||||
@ -1199,7 +1199,7 @@ if (!empty($RequistionDetails)) {
|
|||||||
<br />
|
<br />
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table id="ImportTax" class="table table-striped table-hover mb-0" style="font-size:12px;">
|
<table id="ImportTax" class="table table-bordered table-hover mb-0" style="font-size:12px;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
|
|||||||
@ -399,14 +399,19 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function vaildateBeforeOpenModal() {
|
function vaildateBeforeOpenModal() {
|
||||||
if ($('#PODate').val() == '') {
|
|
||||||
alert('Please Enter the Purchase Order date');
|
if ($('#drpSupplier').val() == "0") {
|
||||||
$('#PODate').focus();
|
|
||||||
return false;
|
|
||||||
} else if ($('#drpSupplier').val() == "0") {
|
|
||||||
alert('Please Select the Supplier details');
|
alert('Please Select the Supplier details');
|
||||||
$('#drpSupplier').focus();
|
$('#drpSupplier').focus();
|
||||||
return false;
|
return false;
|
||||||
|
} else if ($('#currencytype').val() == '0') {
|
||||||
|
alert('Please Select the Currency Type');
|
||||||
|
$('#currencytype').focus();
|
||||||
|
return false;
|
||||||
|
} else if ($('#PODate').val() == '') {
|
||||||
|
alert('Please Enter the Purchase Order date');
|
||||||
|
$('#PODate').focus();
|
||||||
|
return false;
|
||||||
} else if ($('#DeliveryAddr').val() == '') {
|
} else if ($('#DeliveryAddr').val() == '') {
|
||||||
alert('Please Enter the Delivery Address');
|
alert('Please Enter the Delivery Address');
|
||||||
$('#DeliveryAddr').focus();
|
$('#DeliveryAddr').focus();
|
||||||
@ -4185,15 +4190,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
|
|||||||
//alert(JSON.stringify(txtStatus));
|
//alert(JSON.stringify(txtStatus));
|
||||||
//exit();
|
//exit();
|
||||||
if (validate() && Budgetcheck()) {
|
if (validate() && Budgetcheck()) {
|
||||||
if (document.getElementById('ImportTax').rows.length <= 0) {
|
else if ($('#Importoption').val() == "0") {
|
||||||
|
|
||||||
alert('Please Select Line item to Create PO');
|
|
||||||
$('#Deliverydt').focus();
|
|
||||||
return false;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else if ($('#Importoption').val() == "0") {
|
|
||||||
alert('Please Select Import Type');
|
alert('Please Select Import Type');
|
||||||
$('#Importoption').focus();
|
$('#Importoption').focus();
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -203,31 +203,39 @@ if (!empty($INRSYMBOL)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function vaildateBeforeOpenModal() {
|
function vaildateBeforeOpenModal() {
|
||||||
var radioValue = $("input[name='DateRange']:checked").val();
|
var radioValue = parseInt($("input[name='DateRange']:checked").val());
|
||||||
|
|
||||||
if ($('#drpSupplier').val() == "0") {
|
if ($('#drpSupplier').val() == "0") {
|
||||||
alert('Please Select the Supplier details');
|
alert('Please Select the Supplier details');
|
||||||
$('#drpSupplier').focus();
|
$('#drpSupplier').focus();
|
||||||
return false;
|
return false;
|
||||||
} else if ($('#PODate').val() == '') {
|
}else if ($('#PODate').val().trim() == '') {
|
||||||
alert('Please Enter the Purchase Order date');
|
alert('Please Enter the Purchase Order date');
|
||||||
$('#PODate').focus();
|
$('#PODate').focus();
|
||||||
return false;
|
return false;
|
||||||
} else if ($('#DeliveryAddr').val() == '') {
|
}else if ($('#DeliveryAddr').val().trim() == '') {
|
||||||
alert('Please Enter the Delivery Address');
|
alert('Please Enter the Delivery Address');
|
||||||
$('#DeliveryAddr').focus();
|
$('#DeliveryAddr').focus();
|
||||||
return false;
|
return false;
|
||||||
} else if (radioValue == 0 && $('#Deliverydate').val() == '') {
|
}else if (radioValue === 0 && $('#Deliverydt').val() == '') {
|
||||||
alert('Please Select the Delivery Date');
|
alert('Please Select the Delivery Date');
|
||||||
$('#Deliverydate').focus();
|
$('#Deliverydt').focus();
|
||||||
return false;
|
return false;
|
||||||
} else if (radioValue == 1 && $('#Scheduleby').val().trim() == '') {
|
}else if (radioValue == 1) {
|
||||||
|
var scheduleBy = $('#Scheduleby').val(); // Get the value
|
||||||
|
if (!scheduleBy || scheduleBy.trim() == '') { // Check if it's empty or undefined
|
||||||
alert('Please Enter the Schedule By');
|
alert('Please Enter the Schedule By');
|
||||||
$('#Deliverydate').focus();
|
$('#Scheduleby').focus();
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}else if ($('#PoTypeOptions').val() == "0") {
|
}else if ($('#PoTypeOptions').val() == "0") {
|
||||||
alert('Please Select Revenue Type');
|
alert('Please Select Revenue Type');
|
||||||
$('#PoTypeOptions').focus();
|
$('#PoTypeOptions').focus();
|
||||||
return false;
|
return false;
|
||||||
|
}else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
|
||||||
|
alert('Please Enter Payable Terms Description');
|
||||||
|
$('#Otherpayment').focus();
|
||||||
|
return false;
|
||||||
}else if ($('#BudgetType').val() == "0") {
|
}else if ($('#BudgetType').val() == "0") {
|
||||||
alert('Please Select Budget Type');
|
alert('Please Select Budget Type');
|
||||||
$('#BudgetType').focus();
|
$('#BudgetType').focus();
|
||||||
@ -235,6 +243,7 @@ if (!empty($INRSYMBOL)) {
|
|||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var NilType = '<?php echo NILTYPE; ?>';
|
var NilType = '<?php echo NILTYPE; ?>';
|
||||||
@ -2157,7 +2166,7 @@ if (!empty($INRSYMBOL)) {
|
|||||||
<!-- Table -->
|
<!-- Table -->
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="table-responsive" style="padding-bottom: 30px;">
|
<div class="table-responsive" style="padding-bottom: 30px;">
|
||||||
<table id="revenueTax" class="table table-striped table-hover mb-0" style="font-size:12px;">
|
<table id="revenueTax" class="table table-bordered table-hover mb-0" style="font-size:12px;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>SNo</th>
|
<th>SNo</th>
|
||||||
@ -3909,36 +3918,33 @@ if (!empty($INRSYMBOL)) {
|
|||||||
var txtTotalDiscount = $('#txtTotalDiscount').val();
|
var txtTotalDiscount = $('#txtTotalDiscount').val();
|
||||||
var finalBasicAmount = txtTotBasicAmount - txtTotalDiscount;
|
var finalBasicAmount = txtTotBasicAmount - txtTotalDiscount;
|
||||||
//alert(txtTotBasicAmount+"--"+txtTotalDiscount+"--"+finalBasicAmount+"--"+AvlBudAmt);
|
//alert(txtTotBasicAmount+"--"+txtTotalDiscount+"--"+finalBasicAmount+"--"+AvlBudAmt);
|
||||||
if (validate()) {
|
if (revenueValidate()) {
|
||||||
if (document.getElementById('revenueTax').rows.length < 1) {
|
// if (document.getElementById('revenueTax').rows.length < 1) {
|
||||||
alert('Please Select Line item to Create PO');
|
// alert('Please Select Line item to Create PO');
|
||||||
$('#Deliverydt').focus();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// else if(parseInt(AvlBudAmt) < parseInt(finalBasicAmount)) {
|
|
||||||
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
|
|
||||||
|
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
|
// else if(parseInt(AvlBudAmt) < parseInt(finalBasicAmount)) {
|
||||||
alert('Please Enter Payable Terms Description');
|
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
|
||||||
$('#Otherpayment').focus();
|
// return false;
|
||||||
return false;
|
// }
|
||||||
} else if ($('#insurance').val() == 1 && $('#InsuranceNumber').val() == '') {
|
// else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
|
||||||
alert('Please Enter Insurance No / Insurance Details..!');
|
// alert('Please Enter Payable Terms Description');
|
||||||
$('#insurance').focus();
|
// $('#Otherpayment').focus();
|
||||||
return false;
|
// return false;
|
||||||
} else if ($('#PoTypeOptions').val() == "0") {
|
// } else if ($('#insurance').val() == 1 && $('#InsuranceNumber').val() == '') {
|
||||||
alert('Please Select Revenue Type');
|
// alert('Please Enter Insurance No / Insurance Details..!');
|
||||||
$('#PoTypeOptions').focus();
|
// $('#insurance').focus();
|
||||||
return false;
|
// return false;
|
||||||
|
// } else if ($('#PoTypeOptions').val() == "0") {
|
||||||
} else {
|
// alert('Please Select Revenue Type');
|
||||||
|
// $('#PoTypeOptions').focus();
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
|
||||||
var formData = new FormData($('.CreatePO')[0]);
|
var formData = new FormData($('.CreatePO')[0]);
|
||||||
disableButtons();
|
disableButtons();
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<?php echo base_url() ?>purchaseorder/addNewPurchaseOrder",
|
url: "<?php echo base_url() ?>purchaseorder/addNewPurchaseOrder",
|
||||||
@ -3970,7 +3976,7 @@ if (!empty($INRSYMBOL)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -239,20 +239,21 @@ if (!empty($INRSYMBOL)) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Conditional logic for PaymentID
|
// Conditional logic for PaymentID
|
||||||
if (PaymentID === 'PT08') {
|
if (PaymentID != 'PT08') {
|
||||||
$('#otheroptiondiv').show();
|
|
||||||
$('#Otherpayment').val('');
|
|
||||||
} else {
|
|
||||||
$('#otheroptiondiv').hide();
|
$('#otheroptiondiv').hide();
|
||||||
|
$('#Otherpayment').prop('required', false);
|
||||||
$('#Otherpayment').val('');
|
$('#Otherpayment').val('');
|
||||||
|
} else if (PaymentID == 'PT08') {
|
||||||
|
$('#otheroptiondiv').show();
|
||||||
|
$('#Otherpayment').prop('required', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Populate Payment Terms
|
var Payment = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
|
||||||
$('#PaymentTerms').empty();
|
$('#PaymentTerms').empty();
|
||||||
$.each(payments, function(pay, payobj) {
|
$.each(Payment, function(idx, obj) {
|
||||||
$("#PaymentTerms").append($('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
|
$("#PaymentTerms").append($('<option></option>').val(obj.PaymentID).html(obj.PaymentTerms));
|
||||||
});
|
});
|
||||||
|
$("#PaymentTerms").val(PaymentID);
|
||||||
} else {
|
} else {
|
||||||
alert('Please select a Supplier.');
|
alert('Please select a Supplier.');
|
||||||
return false;
|
return false;
|
||||||
@ -1044,7 +1045,7 @@ if (!empty($INRSYMBOL)) {
|
|||||||
</div><!-- 6. form-row div closed here -->
|
</div><!-- 6. form-row div closed here -->
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="table-responsive" style="padding-bottom: 30px;">
|
<div class="table-responsive" style="padding-bottom: 30px;">
|
||||||
<table id="serviceTax" class="table table-striped table-hover mb-0" style="font-size:12px;">
|
<table id="serviceTax" class="table table-bordered table-hover mb-0" style="font-size:12px;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>SNo</th>
|
<th>SNo</th>
|
||||||
@ -2376,33 +2377,30 @@ if (!empty($INRSYMBOL)) {
|
|||||||
$('#txtStatus').val(stat);
|
$('#txtStatus').val(stat);
|
||||||
var AvlBudAmt = '<?php echo $AvlAmount ?>';
|
var AvlBudAmt = '<?php echo $AvlAmount ?>';
|
||||||
var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val();
|
var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val();
|
||||||
if (validate()) {
|
if (serviceValidate()) {
|
||||||
if (document.getElementById('serviceTax').rows.length < 2) {
|
// if (document.getElementById('serviceTax').rows.length < 2) {
|
||||||
alert('Please Select Line item to Create PO');
|
// alert('Please Select Line item to Create PO');
|
||||||
$('#Deliverydt').focus();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) {
|
|
||||||
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
|
|
||||||
|
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
|
// else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) {
|
||||||
alert('Please Enter Other Payable Terms Description');
|
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
|
||||||
$('#Otherpayment').focus();
|
// return false;
|
||||||
return false;
|
// }
|
||||||
} else if ($('#descofpo').val().trim() == '') {
|
// else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
|
||||||
alert('Please Enter Description Of Service');
|
// alert('Please Enter Other Payable Terms Description');
|
||||||
$('#descofpo').focus();
|
// $('#Otherpayment').focus();
|
||||||
return false;
|
// return false;
|
||||||
} else if ($('#PoTypeOptions').val() == "0") {
|
// } else if ($('#descofpo').val().trim() == '') {
|
||||||
alert('Please Select POType');
|
// alert('Please Enter Description Of Service');
|
||||||
$('#PoTypeOptions').focus();
|
// $('#descofpo').focus();
|
||||||
return false;
|
// return false;
|
||||||
|
// } else if ($('#PoTypeOptions').val() == "0") {
|
||||||
} else {
|
// alert('Please Select POType');
|
||||||
|
// $('#PoTypeOptions').focus();
|
||||||
|
// return false;
|
||||||
|
// } else {
|
||||||
var formData = new FormData($('.ServicePO')[0]);
|
var formData = new FormData($('.ServicePO')[0]);
|
||||||
|
disableButtons();
|
||||||
console.log("inside add service purchase order view page");
|
console.log("inside add service purchase order view page");
|
||||||
|
|
||||||
console.log(formData);
|
console.log(formData);
|
||||||
@ -2422,15 +2420,21 @@ if (!empty($INRSYMBOL)) {
|
|||||||
$('#SpcialInstruction').val('');
|
$('#SpcialInstruction').val('');
|
||||||
$('#txtDeliveryAddress').val('');
|
$('#txtDeliveryAddress').val('');
|
||||||
window.location = "purchaseorderListing";
|
window.location = "purchaseorderListing";
|
||||||
|
setTimeout(function() { enableButtons(); }, 2000);
|
||||||
} else {
|
} else {
|
||||||
alert("Error");
|
alert("Error");
|
||||||
|
setTimeout(function() { enableButtons(); }, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function(jqXHR, textStatus, errorThrown) {
|
||||||
|
console.error("AJAX Error: " + textStatus + ": " + errorThrown);
|
||||||
|
alert("Error: " + textStatus);
|
||||||
|
setTimeout(function() { enableButtons(); }, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2454,45 +2458,58 @@ if (!empty($INRSYMBOL)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function vaildateBeforeOpenModal() {
|
function vaildateBeforeOpenModal() {
|
||||||
var radioValue = $("input[name='DateRange']:checked").val();
|
var radioValue = parseInt($("input[name='DateRange']:checked").val());
|
||||||
if ($('#PODate').val() == '') {
|
if ($('#drpSupplier').val() == "0") {
|
||||||
alert('Please Enter the Purchase Order date');
|
|
||||||
$('#PODate').focus();
|
|
||||||
return false;
|
|
||||||
} else if ($('#drpSupplier').val() == "0") {
|
|
||||||
alert('Please Select the Supplier details');
|
alert('Please Select the Supplier details');
|
||||||
$('#drpSupplier').focus();
|
$('#drpSupplier').focus();
|
||||||
return false;
|
return false;
|
||||||
} else if ($('#DeliveryAddr').val() == '') {
|
}else if ($('#workstatus').val() == "0") {
|
||||||
|
alert('Please Select the Work Status');
|
||||||
|
$('#drpSupplier').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#PODate').val().trim() == '') {
|
||||||
|
alert('Please Enter the Purchase Order date');
|
||||||
|
$('#PODate').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#DeliveryAddr').val().trim() == '') {
|
||||||
alert('Please Enter the Delivery Address');
|
alert('Please Enter the Delivery Address');
|
||||||
$('#DeliveryAddr').focus();
|
$('#DeliveryAddr').focus();
|
||||||
return false;
|
return false;
|
||||||
} else if (radioValue == 0 && $('#Deliverydate').val() == '') {
|
}else if (radioValue === 0 && $('#Deliverydt').val() == '') {
|
||||||
alert('Please Select the Delivery Date');
|
alert('Please Select the Delivery Date');
|
||||||
$('#Deliverydate').focus();
|
$('#Deliverydt').focus();
|
||||||
return false;
|
return false;
|
||||||
} else if (radioValue == 1 && $('#Scheduleby').val().trim() == '') {
|
}else if (radioValue == 1) {
|
||||||
|
var scheduleBy = $('#Scheduleby').val(); // Get the value
|
||||||
|
if (!scheduleBy || scheduleBy.trim() == '') { // Check if it's empty or undefined
|
||||||
alert('Please Enter the Schedule By');
|
alert('Please Enter the Schedule By');
|
||||||
$('#Deliverydate').focus();
|
$('#Scheduleby').focus();
|
||||||
return false;
|
return false;
|
||||||
} else if ($('#workstatus').val() == "0") {
|
}
|
||||||
alert('Please Enter WorkStatus');
|
}else if($('#PODate').val() == ''){
|
||||||
$('#workstatus').focus();
|
alert('Please Enter the Purchase Order date');
|
||||||
|
$('#PODate').focus();
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}else if ($('#PoTypeOptions').val() == "0") {
|
}else if ($('#PoTypeOptions').val() == "0") {
|
||||||
alert('Please Select POType');
|
alert('Please Select Service Type');
|
||||||
$('#PoTypeOptions').focus();
|
$('#PoTypeOptions').focus();
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
|
}else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
|
||||||
alert('Please Enter Other Payable Terms Description');
|
alert('Please Enter Payable Terms Description');
|
||||||
$('#Otherpayment').focus();
|
$('#Otherpayment').focus();
|
||||||
return false;
|
return false;
|
||||||
|
}else if($('#insuranceStatus').val() == "1" && $('#InsuranceNumber').val().trim() == ''){
|
||||||
|
alert('Please Enter the Insurance No / Insurance Details');
|
||||||
|
$('#InsuranceNumber').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#BudgetType').val() == "0") {
|
||||||
|
alert('Please Select Budget Type');
|
||||||
|
$('#BudgetType').focus();
|
||||||
|
return false;
|
||||||
}else {
|
}else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function calculateCgstTax(varBasicValue, Cgst) {
|
function calculateCgstTax(varBasicValue, Cgst) {
|
||||||
@ -2565,9 +2582,14 @@ if (!empty($INRSYMBOL)) {
|
|||||||
|
|
||||||
|
|
||||||
function Reset() {
|
function Reset() {
|
||||||
|
disableButtons();
|
||||||
location.reload();
|
location.reload();
|
||||||
|
setTimeout(function() {
|
||||||
|
enableButtons();
|
||||||
|
}, 2000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#insuranceTxtDiv').hide();
|
$('#insuranceTxtDiv').hide();
|
||||||
$("#insuranceStatus").change(function() {
|
$("#insuranceStatus").change(function() {
|
||||||
|
|
||||||
|
|||||||
@ -1257,7 +1257,10 @@
|
|||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
|
||||||
alert(data);
|
alert(data);
|
||||||
// location.reload();
|
// setTimeout(function () {
|
||||||
|
// $("#Igrshow").modal('hide');
|
||||||
|
// }, 2000);
|
||||||
|
location.reload();
|
||||||
},
|
},
|
||||||
error: function(xhr, status, error) { // Error callback
|
error: function(xhr, status, error) { // Error callback
|
||||||
console.error('AJAX Error:', status, error);
|
console.error('AJAX Error:', status, error);
|
||||||
|
|||||||
@ -26,6 +26,285 @@ function myFunction() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function disableButtons() {
|
||||||
|
document.querySelectorAll('.Save, .Submit').forEach(function(button) {
|
||||||
|
button.classList.add('disabled');
|
||||||
|
button.setAttribute('disabled', 'disabled');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function enableButtons() {
|
||||||
|
document.querySelectorAll('.Save, .Submit').forEach(function(button) {
|
||||||
|
button.classList.remove('disabled');
|
||||||
|
button.removeAttribute('disabled');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function revenueValidate(){
|
||||||
|
var radioValue = parseInt($("input[name='DateRange']:checked").val());
|
||||||
|
|
||||||
|
if ($('#drpSupplier').val() == "0") {
|
||||||
|
alert('Please Select the Supplier details');
|
||||||
|
$('#drpSupplier').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#PODate').val().trim() == '') {
|
||||||
|
alert('Please Enter the Purchase Order date');
|
||||||
|
$('#PODate').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#DeliveryAddr').val().trim() == '') {
|
||||||
|
alert('Please Enter the Delivery Address');
|
||||||
|
$('#DeliveryAddr').focus();
|
||||||
|
return false;
|
||||||
|
}else if (radioValue === 0 && $('#Deliverydt').val() == '') {
|
||||||
|
alert('Please Select the Delivery Date');
|
||||||
|
$('#Deliverydt').focus();
|
||||||
|
return false;
|
||||||
|
}else if (radioValue == 1) {
|
||||||
|
var scheduleBy = $('#Scheduleby').val(); // Get the value
|
||||||
|
if (!scheduleBy || scheduleBy.trim() == '') { // Check if it's empty or undefined
|
||||||
|
alert('Please Enter the Schedule By');
|
||||||
|
$('#Scheduleby').focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}else if($('#PODate').val() == ''){
|
||||||
|
alert('Please Enter the Purchase Order date');
|
||||||
|
$('#PODate').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#PoTypeOptions').val() == "0") {
|
||||||
|
alert('Please Select Revenue Type');
|
||||||
|
$('#PoTypeOptions').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
|
||||||
|
alert('Please Enter Payable Terms Description');
|
||||||
|
$('#Otherpayment').focus();
|
||||||
|
return false;
|
||||||
|
}else if($('#insuranceStatus').val() == "1" && $('#InsuranceNumber').val().trim() == ''){
|
||||||
|
alert('Please Enter the Insurance No / Insurance Details');
|
||||||
|
$('#InsuranceNumber').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#BudgetType').val() == "0") {
|
||||||
|
alert('Please Select Budget Type');
|
||||||
|
$('#BudgetType').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#revenueTax tbody tr').length < 1) {
|
||||||
|
alert('Please Select Line item to Create PO');
|
||||||
|
return false;
|
||||||
|
}else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function serviceValidate(){
|
||||||
|
var radioValue = parseInt($("input[name='DateRange']:checked").val());
|
||||||
|
|
||||||
|
if ($('#drpSupplier').val() == "0") {
|
||||||
|
alert('Please Select the Supplier details');
|
||||||
|
$('#drpSupplier').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#workstatus').val() == "0") {
|
||||||
|
alert('Please Select the Work Status');
|
||||||
|
$('#workstatus').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#PODate').val().trim() == '') {
|
||||||
|
alert('Please Enter the Purchase Order date');
|
||||||
|
$('#PODate').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#DeliveryAddr').val().trim() == '') {
|
||||||
|
alert('Please Enter the Delivery Address');
|
||||||
|
$('#DeliveryAddr').focus();
|
||||||
|
return false;
|
||||||
|
}else if (radioValue === 0 && $('#Deliverydt').val() == '') {
|
||||||
|
alert('Please Select the Delivery Date');
|
||||||
|
$('#Deliverydt').focus();
|
||||||
|
return false;
|
||||||
|
}else if (radioValue == 1) {
|
||||||
|
var scheduleBy = $('#Scheduleby').val(); // Get the value
|
||||||
|
if (!scheduleBy || scheduleBy.trim() == '') { // Check if it's empty or undefined
|
||||||
|
alert('Please Enter the Schedule By');
|
||||||
|
$('#Scheduleby').focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}else if($('#PODate').val() == ''){
|
||||||
|
alert('Please Enter the Purchase Order date');
|
||||||
|
$('#PODate').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#PoTypeOptions').val() == "0") {
|
||||||
|
alert('Please Select Service Type');
|
||||||
|
$('#PoTypeOptions').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
|
||||||
|
alert('Please Enter Payable Terms Description');
|
||||||
|
$('#Otherpayment').focus();
|
||||||
|
return false;
|
||||||
|
}else if($('#insuranceStatus').val() == "1" && $('#InsuranceNumber').val().trim() == ''){
|
||||||
|
alert('Please Enter the Insurance No / Insurance Details');
|
||||||
|
$('#InsuranceNumber').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#BudgetType').val() == "0") {
|
||||||
|
alert('Please Select Budget Type');
|
||||||
|
$('#BudgetType').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#serviceTax tbody tr').length < 1) {
|
||||||
|
alert('Please Select Line item to Create PO');
|
||||||
|
return false;
|
||||||
|
} else if ($('#descofpo').val().trim() == '') {
|
||||||
|
alert('Please Enter Description Of Service');
|
||||||
|
$('#descofpo').focus();
|
||||||
|
return false;
|
||||||
|
}else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function capitalValidate(){
|
||||||
|
var radioValue = parseInt($("input[name='DateRange']:checked").val());
|
||||||
|
var PoType = $('#POType').val();
|
||||||
|
if(PoType=='CAPITAL' && capitalType=='International'){
|
||||||
|
if ($('#drpSupplier').val() == "0") {
|
||||||
|
alert('Please Select the Supplier details');
|
||||||
|
$('#drpSupplier').focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if ($('#drpSupplier').val() == "0") {
|
||||||
|
alert('Please Select the Supplier details');
|
||||||
|
$('#drpSupplier').focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if ($('#PODate').val().trim() == '') {
|
||||||
|
alert('Please Enter the Purchase Order date');
|
||||||
|
$('#PODate').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#DeliveryAddr').val().trim() == '') {
|
||||||
|
alert('Please Enter the Delivery Address');
|
||||||
|
$('#DeliveryAddr').focus();
|
||||||
|
return false;
|
||||||
|
}else if (radioValue === 0 && $('#Deliverydt').val() == '') {
|
||||||
|
alert('Please Select the Delivery Date');
|
||||||
|
$('#Deliverydt').focus();
|
||||||
|
return false;
|
||||||
|
}else if (radioValue == 1) {
|
||||||
|
var scheduleBy = $('#Scheduleby').val(); // Get the value
|
||||||
|
if (!scheduleBy || scheduleBy.trim() == '') { // Check if it's empty or undefined
|
||||||
|
alert('Please Enter the Schedule By');
|
||||||
|
$('#Scheduleby').focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}else if($('#PODate').val() == ''){
|
||||||
|
alert('Please Enter the Purchase Order date');
|
||||||
|
$('#PODate').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#PoTypeOptions').val() == "0") {
|
||||||
|
alert('Please Select Service Type');
|
||||||
|
$('#PoTypeOptions').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
|
||||||
|
alert('Please Enter Payable Terms Description');
|
||||||
|
$('#Otherpayment').focus();
|
||||||
|
return false;
|
||||||
|
}else if($('#insuranceStatus').val() == "1" && $('#InsuranceNumber').val().trim() == ''){
|
||||||
|
alert('Please Enter the Insurance No / Insurance Details');
|
||||||
|
$('#InsuranceNumber').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#BudgetType').val() == "0") {
|
||||||
|
alert('Please Select Budget Type');
|
||||||
|
$('#BudgetType').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#serviceTax tbody tr').length < 1) {
|
||||||
|
alert('Please Select Line item to Create PO');
|
||||||
|
return false;
|
||||||
|
} else if ($('#descofpo').val().trim() == '') {
|
||||||
|
alert('Please Enter Description Of Service');
|
||||||
|
$('#descofpo').focus();
|
||||||
|
return false;
|
||||||
|
}else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function importValidate(){
|
||||||
|
var radioValue = parseInt($("input[name='DateRange']:checked").val());
|
||||||
|
|
||||||
|
if ($('#drpSupplier').val() == "0") {
|
||||||
|
alert('Please Select the Supplier details');
|
||||||
|
$('#drpSupplier').focus();
|
||||||
|
return false;
|
||||||
|
} else if ($('#currencytype').val() == '0') {
|
||||||
|
alert('Please Select the Currency Type');
|
||||||
|
$('#currencytype').focus();
|
||||||
|
return false;
|
||||||
|
} else if ($('#DeliveryAddr').val().trim() == '') {
|
||||||
|
alert('Please Enter the Delivery Address');
|
||||||
|
$('#DeliveryAddr').focus();
|
||||||
|
return false;
|
||||||
|
} else if (radioValue === 0 && $('#Deliverydt').val() == '') {
|
||||||
|
alert('Please Select the Delivery Date');
|
||||||
|
$('#Deliverydt').focus();
|
||||||
|
return false;
|
||||||
|
} else if (radioValue == 1) {
|
||||||
|
var scheduleBy = $('#Scheduleby').val(); // Get the value
|
||||||
|
if (!scheduleBy || scheduleBy.trim() == '') { // Check if it's empty or undefined
|
||||||
|
alert('Please Enter the Schedule By');
|
||||||
|
$('#Scheduleby').focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if ($('#Dispatch').val() == '' && $('#Scheduleby').val() == '') {
|
||||||
|
if (document.getElementById("Schedule").checked) {
|
||||||
|
alert('Please Enter Schedule By');
|
||||||
|
return false;
|
||||||
|
} else if (document.getElementById("Date").checked) {
|
||||||
|
alert('Please Enter Dispatch Instruction');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if ($('#ExchangeRate').val() == '') {
|
||||||
|
alert('Please Enter the Exchange Rate');
|
||||||
|
$('#ExchangeRate').focus();
|
||||||
|
return false;
|
||||||
|
} else if ($('#ExchangeRate').val() == 0) {
|
||||||
|
alert('Please Enter the Exchange Rate');
|
||||||
|
$('#ExchangeRate').focus();
|
||||||
|
return false;
|
||||||
|
} else if ($('#PlaceOforigin').val() == '') {
|
||||||
|
alert('Please Enter Place Of Origin');
|
||||||
|
$('#PlaceOforigin').focus();
|
||||||
|
return false;
|
||||||
|
} else if ($('#PoTypeOptions').val() == "0") {
|
||||||
|
alert('Please Select Service Type');
|
||||||
|
$('#PoTypeOptions').focus();
|
||||||
|
return false;
|
||||||
|
} else if($('#PODate').val() == ''){
|
||||||
|
alert('Please Enter the Purchase Order date');
|
||||||
|
$('#PODate').focus();
|
||||||
|
return false;
|
||||||
|
} else if ($('#PaymentTerms').val() == '') {
|
||||||
|
alert('Please Select Payment Terms');
|
||||||
|
$('#PaymentTerms').focus();
|
||||||
|
return false;
|
||||||
|
|
||||||
|
} else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
|
||||||
|
alert('Please Enter Payable Terms Description');
|
||||||
|
$('#Otherpayment').focus();
|
||||||
|
return false;
|
||||||
|
} else if($('#insuranceStatus').val() == "1" && $('#InsuranceNumber').val().trim() == ''){
|
||||||
|
alert('Please Enter the Insurance No / Insurance Details');
|
||||||
|
$('#InsuranceNumber').focus();
|
||||||
|
return false;
|
||||||
|
} else if ($('#BudgetType').val() == "0") {
|
||||||
|
alert('Please Select Budget Type');
|
||||||
|
$('#BudgetType').focus();
|
||||||
|
return false;
|
||||||
|
}else if ($('#ImportTax tbody tr').length < 1) {
|
||||||
|
alert('Please Select Line item to Create PO');
|
||||||
|
return false;
|
||||||
|
}else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function validate()
|
function validate()
|
||||||
{
|
{
|
||||||
var radioValue = $("input[name='DateRange']:checked").val();
|
var radioValue = $("input[name='DateRange']:checked").val();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user