diff --git a/app/Models/Payroll_model.php b/app/Models/Payroll_model.php index 3b71a779..48b7e907 100755 --- a/app/Models/Payroll_model.php +++ b/app/Models/Payroll_model.php @@ -172,11 +172,27 @@ class Payroll_model extends Model function getPayOn() { + // For Employee - old $builder = $this->db->table('t_monthly_pay_inputs') ->select('DISTINCT(Month_Year)') ->orderBy("Month_Year", "desc"); $query = $builder->get(); - return $query->getResult(); + $result1 = $query->getResult(); + + // For Driver - new + $builder = $this->db->table('t_driver_monthly_pay_inputs') + ->select('DISTINCT(month_year) as Month_Year') + ->orderBy("month_year", "desc"); + $query = $builder->get(); + $result2 = $query->getResult(); + + $result = array_merge($result1, $result2); + // removed duplicates - refer gpt - gpt solved + $unique = array_map("unserialize", array_unique(array_map("serialize", $result))); + return $unique; + + + } function getBankInfo($bank = "") diff --git a/app/Models/Requistion_model.php b/app/Models/Requistion_model.php index 47a68809..28af2c0d 100755 --- a/app/Models/Requistion_model.php +++ b/app/Models/Requistion_model.php @@ -387,9 +387,7 @@ class Requistion_model extends Model $this->db->transComplete(); // Complete transaction try { - $result = ($result) ? $result : false; - if ($result && $affected_rows > 0) { - + if ($affected_rows > 0) { $subQuery = 'SELECT ReqNo FROM t_requestion_master ORDER BY CreatedDate DESC LIMIT 1'; $query = $this->db->query($subQuery); diff --git a/app/Views/alterpurchaseorder.php b/app/Views/alterpurchaseorder.php index 02eac8c8..8effcdeb 100755 --- a/app/Views/alterpurchaseorder.php +++ b/app/Views/alterpurchaseorder.php @@ -7240,24 +7240,24 @@ if (!empty($INRSYMBOL)) { // Perform form validation - if (serviceValidate()) { - // if (document.getElementById('serviceTax').rows.length < 2) { - // alert('Please Select Line item to Create PO'); - // $('#Deliverydt').focus(); - // return false; - // } else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') { - // alert('Please Enter Other Payable Terms Description'); - // $('#Otherpayment').focus(); - // return false; - // } else if ($('#emergdescofpo').val().trim() == '') { - // alert('Please Enter Description Of Service'); - // $('#emergdescofpo').focus(); - // return false; - // } else if ($('#PoTypeOptions').val() == "0") { - // alert('Please Select POType'); - // $('#PoTypeOptions').focus(); - // return false; - // } else { + if (validate()) { + if (document.getElementById('serviceTax').rows.length < 2) { + alert('Please Select Line item to Create PO'); + $('#Deliverydt').focus(); + return false; + } else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') { + alert('Please Enter Other Payable Terms Description'); + $('#Otherpayment').focus(); + return false; + } else if ($('#emergdescofpo').val().trim() == '') { + alert('Please Enter Description Of Service'); + $('#emergdescofpo').focus(); + return false; + } else if ($('#PoTypeOptions').val() == "0") { + alert('Please Select POType'); + $('#PoTypeOptions').focus(); + return false; + } else { // Submit the form using AJAX $('#loader').show(); // disableButtons(); @@ -7288,7 +7288,7 @@ if (!empty($INRSYMBOL)) { // setTimeout(function() { enableButtons(); }, 2000); } }); - // } + } } } @@ -7354,20 +7354,20 @@ if (!empty($INRSYMBOL)) { // Perform form validation - if (revenueValidate()) { - // if (document.getElementById('serviceTax').rows.length < 2) { - // alert('Please Select Line item to Create PO'); - // $('#Deliverydt').focus(); - // return false; - // } else if ($('#insuranceStatus').val() == 'YES' && $('#InsuranceNumber').val() == '') { - // alert('Please Enter Insurance Number..!'); + if (validate()) { + if (document.getElementById('serviceTax').rows.length < 2) { + alert('Please Select Line item to Create PO'); + $('#Deliverydt').focus(); + return false; + } else if ($('#insuranceStatus').val() == 'YES' && $('#InsuranceNumber').val() == '') { + alert('Please Enter Insurance Number..!'); - // return false; - // } else if ($('#PaymentMethod').val() == 'PT08' && $('#Otherpayment').val() == '') { - // alert('Please Enter Other Payment Description..!'); + return false; + } else if ($('#PaymentMethod').val() == 'PT08' && $('#Otherpayment').val() == '') { + alert('Please Enter Other Payment Description..!'); - // return false; - // } else { + return false; + } else { // Submit the form using AJAX $('#loader').show(); // disableButtons(); @@ -7393,7 +7393,7 @@ if (!empty($INRSYMBOL)) { // setTimeout(function() { enableButtons(); }, 2000); } }); - // } + } } } diff --git a/app/Views/capitalpurchaseorder.php b/app/Views/capitalpurchaseorder.php index fffe84d9..3022c0dd 100755 --- a/app/Views/capitalpurchaseorder.php +++ b/app/Views/capitalpurchaseorder.php @@ -2547,6 +2547,7 @@ if (!empty($INRSYMBOL)) { }); } + $("#PaymentMethod").trigger('change'); }); @@ -5401,9 +5402,11 @@ if (!empty($INRSYMBOL)) { $("#PaymentMethod").change(function() { if ($('#PaymentMethod').val().trim() == 'PT08') { $('#otheroptiondiv').show(); + $('#Otherpayment').prop('required', true); } else { $('#otheroptiondiv').hide(); - $('#Otherpayment').val(''); + $('#Otherpayment').prop('required', false); + $('#Otherpayment').val(''); } }); diff --git a/app/Views/purchaseorder.php b/app/Views/purchaseorder.php index e5210f26..c7e71882 100755 --- a/app/Views/purchaseorder.php +++ b/app/Views/purchaseorder.php @@ -291,9 +291,9 @@ if (!empty($INRSYMBOL)) { }); } + $("#PaymentTerms").trigger('change'); }); - - + $('#drpSupplier').change(function() { var id = $('#drpSupplier').val();