From 765600c4c6a3727e9c6fc31aab952b9f82d0651c Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Wed, 5 Mar 2025 13:28:53 +0000 Subject: [PATCH 1/3] Alter , Payment terms , rate po bug --- app/Views/alterpurchaseorder.php | 34 +++++++++++++++++++----------- app/Views/capitalpurchaseorder.php | 34 ++++++++++++++++++------------ app/Views/importpo.php | 11 +++++++++- app/Views/purchaseorder.php | 11 +++++++--- app/Views/servicePurchaseorder.php | 9 +++++++- 5 files changed, 69 insertions(+), 30 deletions(-) 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)) { ?>
- + '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); } From ebb6265626f9bd320d1f6243f2e559e0b634f653 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Wed, 5 Mar 2025 14:03:25 +0000 Subject: [PATCH 2/3] Edit PO - Rate : ps --- app/Views/EditservicePurchaseorder.php | 5 +++++ app/Views/editCapitalPo.php | 5 +++++ app/Views/editRevenuepurchaseorder.php | 4 ++++ app/Views/editimportpo.php | 6 ++++++ app/Views/servicePurchaseorder.php | 6 +++--- public/assets/js/CreatePOValidation.js | 2 +- 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php index df5aafb0..8b4676d5 100755 --- a/app/Views/EditservicePurchaseorder.php +++ b/app/Views/EditservicePurchaseorder.php @@ -500,6 +500,7 @@ if (!empty($getlogpodtl)) { $("#ItemName").val(obj.MaterialName); $("#UOM").val(obj.UOM); $("#Quantity").val(obj.Quantity); + $("#Rate").val(obj.material_rate); RequistQuantity = obj.Quantity; var materialn = obj.MaterialName; @@ -510,6 +511,10 @@ if (!empty($getlogpodtl)) { $('#OtheritemDescription').val(obj.MaterialDescription); } + if(obj.material_rate != 0){ + Ratechange(); + } + } }); diff --git a/app/Views/editCapitalPo.php b/app/Views/editCapitalPo.php index 9991086e..cd22d284 100755 --- a/app/Views/editCapitalPo.php +++ b/app/Views/editCapitalPo.php @@ -3935,6 +3935,7 @@ if (!empty($getlogpodtl)) { $("#CPUOM").val(''); $("#CPQuantity").val(''); $("#CPTotalAmount").val(''); + $("#CPRate").val(''); RequistQuantity = ''; clearTaxField(); if (id != '0') { @@ -3946,12 +3947,16 @@ if (!empty($getlogpodtl)) { $("#CapitalItemName").val(obj.MaterialName); $("#CPUOM").val(obj.UOM); $("#CPQuantity").val(obj.Quantity); + $("#CPRate").val(obj.material_rate); RequistQuantity = obj.Quantity; var CPUOMDisplay = obj.UOM; $('#RateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')'); $('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')'); + if(obj.material_rate != 0){ + Ratechange();calculateFreight(3);calculateFreightlocaddper(); + } diff --git a/app/Views/editRevenuepurchaseorder.php b/app/Views/editRevenuepurchaseorder.php index 2bcfd617..c68ab4c3 100755 --- a/app/Views/editRevenuepurchaseorder.php +++ b/app/Views/editRevenuepurchaseorder.php @@ -541,6 +541,10 @@ if (!empty($getlogpodtl)) { $("#ItemName").val(obj.MaterialName); $("#UOM").val(obj.UOM); $("#Quantity").val(obj.Quantity); + $("#Rate").val(obj.material_rate); + if(obj.material_rate != 0){ + change(); + } RequistQuantity = obj.Quantity; } }); diff --git a/app/Views/editimportpo.php b/app/Views/editimportpo.php index 4856b6e6..08252d8c 100755 --- a/app/Views/editimportpo.php +++ b/app/Views/editimportpo.php @@ -3375,6 +3375,12 @@ if (!empty($getlogpodtl)) { $("#ItemName").val(obj.MaterialName); $("#UOM").val(obj.UOM); $("#Quantity").val(obj.Quantity).trigger('change'); + $("#Rate").val(obj.material_rate); + if(obj.material_rate != 0){ + Ratechange(); + validateExceedLimit(); + calculateFreight(0); + } RequistQuantity = obj.Quantity; reqq = RequistQuantity; //RequistQuantity=parseFloat($('#Quantity').val()); diff --git a/app/Views/servicePurchaseorder.php b/app/Views/servicePurchaseorder.php index 88d6e852..c4ee6fde 100755 --- a/app/Views/servicePurchaseorder.php +++ b/app/Views/servicePurchaseorder.php @@ -1052,7 +1052,7 @@ if (!empty($INRSYMBOL)) {
- +
@@ -1071,7 +1071,7 @@ if (!empty($INRSYMBOL)) { -
SNo
+
@@ -2101,7 +2101,7 @@ if (!empty($INRSYMBOL)) { function populateValueMainFormForEditServiceTax() { - var rows = $('#serviceTax tbody tr').length; + var rows = $('#ServiceTable tbody tr').length; var TotCgst = 0; var TotSgst = 0; diff --git a/public/assets/js/CreatePOValidation.js b/public/assets/js/CreatePOValidation.js index 92e8ab86..559e8828 100755 --- a/public/assets/js/CreatePOValidation.js +++ b/public/assets/js/CreatePOValidation.js @@ -145,7 +145,7 @@ function serviceValidate(){ alert('Please Select Budget Type'); $('#BudgetType').focus(); return false; - }else if ($('#serviceTax tbody tr').length < 1) { + }else if ($('#ServiceTable tbody tr').length < 1) { alert('Atleast One Line needed'); return false; } else if ($('#descofpo').val().trim() == '') { From bdcfe0c01e61990891c3a3ea1751804f9d35e9e7 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Thu, 6 Mar 2025 07:14:45 +0000 Subject: [PATCH 3/3] Fixes : ps --- app/Controllers/Payslip.php | 17 +- app/Controllers/Purchaseorder.php | 1 - app/Models/Driver_model.php | 2 +- app/Views/EditservicePurchaseorder.php | 2362 +++++++++++----------- app/Views/driverPayslipGeneratePrint.php | 40 +- app/Views/editCapitalPo.php | 4 +- app/Views/editimportpo.php | 1052 +++++----- app/Views/monthlypayinputs.php | 47 +- app/Views/servicePurchaseorder.php | 18 +- public/assets/js/CreatePOValidation.js | 18 +- 10 files changed, 1777 insertions(+), 1784 deletions(-) diff --git a/app/Controllers/Payslip.php b/app/Controllers/Payslip.php index 977045c3..2adae210 100755 --- a/app/Controllers/Payslip.php +++ b/app/Controllers/Payslip.php @@ -801,10 +801,10 @@ class Payslip extends BaseController $loan = $Balance_Amount; } - $empSalaryAdd = $final_salary_amount+$shed+$diesel; + $empSalaryAdd = $final_salary_amount; $empSalarySub = $loan; - $salaryInCurrentday = $empSalaryAdd - $empSalarySub; - $load_driver_data[$i]->driver_final_payment = $salaryInCurrentday; + // $salaryInCurrentday = $empSalaryAdd - $empSalarySub; + // $load_driver_data[$i]->driver_final_payment = $salaryInCurrentday; $load_driver_data[$i]->payroll_id = $monthly_pay_array[$driver_id]->payroll_id; $load_driver_data[$i]->Festival_Bonus = $monthly_pay_array[$driver_id]->Festival_Bonus; @@ -871,8 +871,8 @@ class Payslip extends BaseController $empSalaryAdd = $final_salary_amount; $empSalarySub = $loan; - $salaryInCurrentday = $empSalaryAdd - $empSalarySub; - $load_driver_data[$i]->driver_final_payment = $salaryInCurrentday+$shed+$diesel; + // $salaryInCurrentday = $empSalaryAdd - $empSalarySub; + // $load_driver_data[$i]->driver_final_payment = $salaryInCurrentday+$shed+$diesel; $load_driver_data[$i]->total_cal_days = $get_last_date_of_the_month; } @@ -1236,6 +1236,7 @@ class Payslip extends BaseController 'total_shed_amount'=>$Shed, 'monthly_salary_amount'=>($Basic+$Food), 'final_payment'=>$Estimate, + 'BASIC'=>$Basic, 'HRA'=>$HRA, 'ESI'=>$ESI, 'PF'=>$PF, @@ -1421,8 +1422,10 @@ class Payslip extends BaseController $currentDayBasic = isset($Data['PayDetails'][0]->monthly_salary_amount) ? $Data['PayDetails'][0]->monthly_salary_amount : 0; $PF_Rate = $Data['PayDetails'][0]->PF_Rate; $ESI_Rate = $Data['PayDetails'][0]->ESI_Rate; - $Data['esi_amount'] = ($Data['PayDetails'][0]->esi_applicable == 1) ? $currentDayBasic * $ESI_Rate / 100 : 0; - $Data['pf_amount'] = ($Data['PayDetails'][0]->pf_applicable == 1) ? $currentDayBasic * $PF_Rate / 100 : 0; + // $Data['esi_amount'] = ($Data['PayDetails'][0]->esi_applicable == 1) ? $currentDayBasic * $ESI_Rate / 100 : 0; + // $Data['pf_amount'] = ($Data['PayDetails'][0]->pf_applicable == 1) ? $currentDayBasic * $PF_Rate / 100 : 0; + $Data['esi_amount'] = ($Data['PayDetails'][0]->esi_applicable == 1) ? $Data['PayDetails'][0]->ESI : 0; + $Data['pf_amount'] = ($Data['PayDetails'][0]->pf_applicable == 1) ? $Data['PayDetails'][0]->PF : 0; $html = view("driverPayslipGeneratePrint", $Data); }else{ //echo "EmpID" . $EmpID; diff --git a/app/Controllers/Purchaseorder.php b/app/Controllers/Purchaseorder.php index ee194634..dc0be372 100755 --- a/app/Controllers/Purchaseorder.php +++ b/app/Controllers/Purchaseorder.php @@ -3068,7 +3068,6 @@ class Purchaseorder extends BaseController $this->purchaseorder_model->insertlogpo($logpo); } } - // print_r($this->request->getPost());die; for ($i = 1; $i <= $RowCount; $i++) { $MaterialCode = $this->request->getPost('materialCode' . $i); diff --git a/app/Models/Driver_model.php b/app/Models/Driver_model.php index d0b5e716..97fecf21 100755 --- a/app/Models/Driver_model.php +++ b/app/Models/Driver_model.php @@ -285,7 +285,7 @@ class Driver_model extends Model $builder = $this->db->table('t_driver_payroll Pay')->select('Pay.*') ->select('Emp.EmpID,CONCAT_WS(" ", Emp.FirstName, Emp.LastName) as driver_name,Emp.DateofBirth as Dob,Emp.PANNo as Pan,Emp.BankBranchName as BankName,Emp.BankAccountNo as BankAccountNumber,Emp.IFSCCode as IFSCCode,Emp.DateofJoining as DOJ,Emp.AadharNo,Emp.Designation as Designation,Dep.DepartmentName as DeptName,Emp.esi_applicable,Emp.pf_applicable') ->select('t_emp_pay_data.PF_Rate,t_emp_pay_data.ESI_Rate') - ->select('month.Festival_Bonus,month.HRA,month.Loan_Recovered,month.total_diesel_amount,month.total_shed_amount') + ->select('month.Festival_Bonus,month.BASIC,month.HRA,month.Loan_Recovered,month.total_diesel_amount,month.total_shed_amount') // ->select('month.monthly_salary_amount,month.monthly_food_amount,month.Festival_Bonus,month.final_payment,month.HRA,month.ESI,month.PF,month.Loan_Recovered,month.total_diesel_amount,month.total_shed_amount') ->join('t_employee_details Emp', 'Pay.driver_id = Emp.EmpID') ->join('t_departmentdetails Dep', 'Emp.Departmentcode = Dep.DEPCode') diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php index 8b4676d5..ae89c7d9 100755 --- a/app/Views/EditservicePurchaseorder.php +++ b/app/Views/EditservicePurchaseorder.php @@ -1,60 +1,61 @@ + }); + }); + "NO", "value" => "0"), @@ -148,6 +151,7 @@ if (!empty($MaxPODate)) { $MaxPoDate = $date->PODate; } } + if (!empty($POMaster)) { foreach ($POMaster as $Req) { @@ -279,8 +283,6 @@ if (!empty($getlogpodtl)) { }); - - + + + // Hide the edit container and show the tag + $editContainer.hide(); + $link.show(); + }); + }); + + + + +
- - 'form-label-left ImportPO ', 'name' => 'ImportPO', 'id' => 'ImportPO', 'enctype' => 'multipart/form-data'); - echo form_open(base_url() . '/purchaseorder/addPO/', $attributes); ?> - - -
@@ -550,7 +548,6 @@ if (!empty($getlogpodtl)) {
-
@@ -615,7 +612,6 @@ if (!empty($getlogpodtl)) {
-
Check Today's Foreign Exchange value (Click here) @@ -809,6 +805,7 @@ if (!empty($getlogpodtl)) {
+
@@ -825,10 +822,10 @@ if (!empty($getlogpodtl)) {




-
-
- - +
+
+
+ @@ -841,10 +838,10 @@ if (!empty($getlogpodtl)) { - + + + + --> @@ -863,40 +860,37 @@ if (!empty($getlogpodtl)) { + echo $shortName; ?> + + + LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; + } ?> + - - - - + - + " /> @@ -936,8 +930,8 @@ if (!empty($getlogpodtl)) { - - + + @@ -947,7 +941,7 @@ if (!empty($getlogpodtl)) { - + @@ -955,10 +949,10 @@ if (!empty($getlogpodtl)) { - + - + @@ -973,7 +967,7 @@ if (!empty($getlogpodtl)) { - + @@ -992,7 +986,7 @@ if (!empty($getlogpodtl)) { - + -
SNoRate Basic Amount Rejected QtyPending QtyTax AmountTotal Order AmountAction
ReqNo ?> MaterialCode ?> MaterialName, 0, 13, "..."); - echo $shortName; ?> - - + + LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; ?> - - - LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; } ?> - Quantity ?> UOM ?> Rate ?> BasicValue ?>
-
-
-
-
+ +
+
-

- - +

@@ -1196,8 +1186,8 @@ if (!empty($getlogpodtl)) { > - - + +
@@ -1269,44 +1259,41 @@ if (!empty($getlogpodtl)) {
- - +
-
- - 'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction', strip_tags($ServiceDescription)), 'id' => 'txtSpcialInstruction', 'class' => 'form-control', 'rows' => '10', 'cols' => '40'); - echo form_textarea($data); - ?> -
+
+ + 'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction', strip_tags($ServiceDescription)), 'id' => 'txtSpcialInstruction', 'class' => 'form-control', 'rows' => '10', 'cols' => '40'); + echo form_textarea($data); + ?>
-
- +
- -
- - - -
- + +
+ + + +
+
@@ -1315,71 +1302,71 @@ if (!empty($getlogpodtl)) {
-
- - - - - - - - +
- + + + + + + + -   Cancel - -   Save as Draft - -   Submit -   Approve - - + - - - OK - - - -   Submit -   Approve - OK - +   Cancel + +   Save as Draft +   Submit +   Approve + + -
+ + OK + + + +   Submit +   Approve + OK + + + + +
-
- -
-
- 'AWAITING APPROVE', - 'AWAITING RELEASE' => 'AWAITING APPROVE', - 'RELEASER ONHOLD' => 'APPROVER ONHOLD', - 'PO RELEASED' => 'PO APPROVED', - ]; +
- if (isset($StatusName) && !empty($StatusName)) { - if (isset($statusMappings[$StatusName])) { - echo $statusMappings[$StatusName]; - } else { - echo $StatusName; - } +
+
+ 'AWAITING APPROVE', + 'AWAITING RELEASE' => 'AWAITING APPROVE', + 'RELEASER ONHOLD' => 'APPROVER ONHOLD', + 'PO RELEASED' => 'PO APPROVED', + ]; + + if (isset($StatusName) && !empty($StatusName)) { + if (isset($statusMappings[$StatusName])) { + echo $statusMappings[$StatusName]; } else { - echo "Status not provided"; + echo $StatusName; } - ?> - + } else { + echo "Status not provided"; + } + ?> +
@@ -1388,19 +1375,19 @@ if (!empty($getlogpodtl)) { -
-
-
-
- - - + + + + + + +