From 229ac1b4a2e57e6b0a7bc497f47ea92618889851 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Mon, 24 Feb 2025 12:55:07 +0000 Subject: [PATCH 01/15] Bug Fixes : ps --- app/Controllers/Driver.php | 23 ++-- app/Controllers/Emergencypurchaseorder.php | 4 +- app/Controllers/Purchaseorder.php | 2 +- app/Controllers/Servicepurchaseorder.php | 2 +- app/Models/Driver_model.php | 11 +- app/Views/EditservicePurchaseorder.php | 11 +- app/Views/addEmployeenew.php | 7 + app/Views/capitalpurchaseorder.php | 151 +++++++++++++-------- app/Views/driverAttendance.php | 42 +++--- app/Views/editCapitalPo.php | 11 +- app/Views/editEmployeenew.php | 7 + app/Views/editRevenuepurchaseorder.php | 13 +- app/Views/editServiceAmendPO.php | 10 +- app/Views/editimportpo.php | 9 +- app/Views/employeeListing.php | 10 +- app/Views/publicholidays.php | 2 +- app/Views/purchaseorder.php | 48 ++++--- app/Views/requisitionform.php | 22 +-- app/Views/requisitionlisting.php | 6 +- 19 files changed, 227 insertions(+), 164 deletions(-) diff --git a/app/Controllers/Driver.php b/app/Controllers/Driver.php index f1f46924..2fd070a2 100755 --- a/app/Controllers/Driver.php +++ b/app/Controllers/Driver.php @@ -136,19 +136,24 @@ class Driver extends BaseController public function loadDriverAttendance() { - $input_driver_id = $this->request->getPost('gobal_driver_id') ? $this->request->getPost('gobal_driver_id') : $this->request->getGet('gobal_driver_id'); - $input_month_year = $this->request->getPost('month_year') ? $this->request->getPost('month_year') : $this->request->getGet('month_year'); - list($month, $year) = explode('-', $input_month_year); + $input_driver_id = $this->request->getGet('gobal_driver_id'); + // $input_month_year = $this->request->getPost('month_year') ? $this->request->getPost('month_year') : get_date_time_dynamical_format('d-M-Y','d-m-',"01-"+$this->request->getGet('month_year')) ; + $input_date = $this->request->getGet('date') + ? $this->request->getGet('date') + : get_date_time_dynamical_format('d-M-Y','d-m-Y',"01-".$this->request->getGet('month_year')); - $month_in_number = get_date_time_dynamical_format('M','m',"$month");// refer helper - $get_last_date_of_the_month = cal_days_in_month(CAL_GREGORIAN, $month_in_number, $year); - $from_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m-d',"01-$month_in_number-$year"); - $to_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m-d',"$get_last_date_of_the_month-$month_in_number-$year"); - $indian_date = get_date_time_dynamical_format('d-m-Y','d-m-Y',"$get_last_date_of_the_month-$month_in_number-$year"); + + list($date,$month,$year) = explode('-', $input_date); + + $get_last_date_of_the_month = cal_days_in_month(CAL_GREGORIAN, $month, $year); + $from_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m-d',"01-$month-$year"); + $to_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m-d',"$get_last_date_of_the_month-$month-$year"); + $indian_date = get_date_time_dynamical_format('d-m-Y','d-m-Y',"$get_last_date_of_the_month-$month-$year"); + $data['driver_attendance_list'] = $this->driver_model->useDriverAttendanceTable()->getDriverAttendanceList($input_driver_id,$from_mysql_date,$to_mysql_date); $data['page_driver_name'] = $this->driver_model->getDriverName($input_driver_id); $data['invoice_info'] = $this->driver_model->getInvoiceInfo(); - $data['datefordropdown'] = $input_month_year; + $data['datefordropdown'] = $input_date; $data['gobal_driver_id'] = $input_driver_id; $this->global['pageTitle'] = 'Driver Attendance List'; diff --git a/app/Controllers/Emergencypurchaseorder.php b/app/Controllers/Emergencypurchaseorder.php index c18be944..f2c64289 100755 --- a/app/Controllers/Emergencypurchaseorder.php +++ b/app/Controllers/Emergencypurchaseorder.php @@ -632,7 +632,7 @@ class Emergencypurchaseorder extends BaseController if (count($mrirmaster) > 0) { foreach ($mrirmaster as $key) { - $MRIRNO = $key->MRIRNo; + $MRIRNO = $key->MRIRNO; } } @@ -1525,6 +1525,6 @@ class Emergencypurchaseorder extends BaseController $this->purchaseorder_model->DeletePOServiceTax($LineItemNo); } $this->purchaseorder_model->DeletePOLineItem($LineItemNo, $ReqNo, $MaterialCode); - echo "Successfully Deleted the Line item" . $LineItemNo; + echo "Successfully Deleted the Line item " . $LineItemNo; } } diff --git a/app/Controllers/Purchaseorder.php b/app/Controllers/Purchaseorder.php index e96f797a..057a65c1 100755 --- a/app/Controllers/Purchaseorder.php +++ b/app/Controllers/Purchaseorder.php @@ -1962,7 +1962,7 @@ class Purchaseorder extends BaseController $this->purchaseorder_model->DeletePOServiceTax($LineItemNo); } $this->purchaseorder_model->DeletePOLineItem($LineItemNo, $ReqNo, $MaterialCode); - echo "Successfully Deleted the Line item" . $LineItemNo; + echo "Successfully Deleted the Line item " . $LineItemNo; } diff --git a/app/Controllers/Servicepurchaseorder.php b/app/Controllers/Servicepurchaseorder.php index 6f810d46..9207e172 100755 --- a/app/Controllers/Servicepurchaseorder.php +++ b/app/Controllers/Servicepurchaseorder.php @@ -341,7 +341,7 @@ class Servicepurchaseorder extends BaseController } } } - echo 'Service Purchase Order Created Successfully!The PO NO Is: ' . $PONO; + echo 'Service Purchase Order Created Successfully! PO Number Is: ' . $PONO; } //update service po function UpdateServicePurchaseOrder() diff --git a/app/Models/Driver_model.php b/app/Models/Driver_model.php index 843cd5e8..bc60b32d 100755 --- a/app/Models/Driver_model.php +++ b/app/Models/Driver_model.php @@ -47,11 +47,11 @@ class Driver_model extends Model return $this->table . '.' . $field; }, $this->allowedFields)); - $selectFields = "CONCAT_WS(' ', t_employee_details.FirstName, t_employee_details.LastName) AS FullName, t_employee_details.IsActive as employee_isactive, t_driver.driver_name,ip_clients.client_name as customer,ip_invoices.received_qty as quantity,t_driver_payroll.id as payroll_id,t_driver_payroll.PayOn," . $fields; + $selectFields = "CONCAT_WS(' ', t_employee_details.FirstName, t_employee_details.LastName) AS FullName, t_employee_details.IsActive as employee_isactive, CONCAT_WS(' ', driver.FirstName, driver.LastName) AS driver_name,ip_clients.client_name as customer,ip_invoices.received_qty as quantity,t_driver_payroll.id as payroll_id,t_driver_payroll.PayOn," . $fields; $month_year = get_date_time_dynamical_format('Y-m-d','m-Y',"$from"); return $this->select($selectFields) - ->join('t_driver', 't_driver.driver_id = ' . $this->table . '.driver_id', 'left') + ->join('t_employee_details as driver', 'driver.EmpID = ' . $this->table . '.driver_id', 'left') ->join('tbl_users', 'tbl_users.userId = ' . $this->table . '.created_by', 'left') ->join('t_employee_details', 'tbl_users.EmpID = t_employee_details.EmpID', 'left') ->join('ip_invoices', 'ip_invoices.invoice_number = ' . $this->table . '.invoice_number', 'left') @@ -60,6 +60,7 @@ class Driver_model extends Model ->where($this->table.'.date BETWEEN "'.$from.'" AND "'.$to.'"') ->where($this->table . '.driver_id', $driver_id) ->where($this->table . '.isactive', 1) + ->where('driver.is_driver', 1) ->findAll(); } @@ -73,9 +74,9 @@ class Driver_model extends Model function getDriverName($id) { - $builder = $this->db->table('t_driver') - ->select('driver_name') - ->where('driver_id', $id); + $builder = $this->db->table('t_employee_details') + ->select('CONCAT_WS(" ", t_employee_details.FirstName, t_employee_details.LastName) as driver_name') + ->where('EmpID', $id); $query = $builder->get()->getRow(); diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php index 85a67ac0..77c02c3c 100755 --- a/app/Views/EditservicePurchaseorder.php +++ b/app/Views/EditservicePurchaseorder.php @@ -2991,15 +2991,8 @@ if (!empty($getlogpodtl)) { type: "POST", url: "purchaseorder/DeletePODetails", success: function(data) { - if (data) { - $('#loader').hide(); - alert(data); - } else { - $('#loader').hide(); - - alert("Error"); - } - + $('#loader').hide(); + (data) ? alert(response) : alert("Error"); } }); } diff --git a/app/Views/addEmployeenew.php b/app/Views/addEmployeenew.php index c45f93b7..4032c8ad 100755 --- a/app/Views/addEmployeenew.php +++ b/app/Views/addEmployeenew.php @@ -6,6 +6,13 @@ label { font-style: bold; } + + input[type="file"] { + white-space: normal; + word-wrap: break-word; + overflow-wrap: break-word; + width: 100%; + }
diff --git a/app/Views/driverAttendance.php b/app/Views/driverAttendance.php index b7fc4bda..48425ef5 100755 --- a/app/Views/driverAttendance.php +++ b/app/Views/driverAttendance.php @@ -221,7 +221,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
- @@ -234,11 +234,11 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
- +
- +
@@ -463,25 +463,29 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); if (result) { return result; } else { event.preventDefault(); } } - function salary() { - - var type = $('#load_type').val(); - - if(type == 'Load'){ - var value = parseFloat(1300); - $('#salary_amount').val(value); - }else if(type == 'Waste Core'){ - var value = parseFloat(1050); - $('#salary_amount').val(value); - } - var sa = parseFloat($('#salary_amount').val()) || 0; - var fa = parseFloat($('#food_amount').val()) || 0; - var ttl = sa + fa; - - $('#total_amount').val(ttl.toFixed(2)); + $(document).ready(function() { + updateSalaryBasedOnType(); + fetchSalary(); + }); + function updateSalaryBasedOnType() { + var type = $('#load_type').val(); + if (type == 'Load') { + $('#salary_amount').val(1300); + } else if (type == 'Waste Core') { + $('#salary_amount').val(1050); + } + fetchSalary(); } + function fetchSalary() { + var sa = parseFloat($('#salary_amount').val()) || 0; + var fa = parseFloat($('#food_amount').val()) || 0; + var ttl = sa + fa; + + $('#total_amount').val(ttl.toFixed(2)); + } + function customerandquantity(){ if ($('#invoice_number').val() === '') { alert('Please Enter the Valid Invoice Number'); diff --git a/app/Views/editCapitalPo.php b/app/Views/editCapitalPo.php index 556e9f2f..0d0226ac 100755 --- a/app/Views/editCapitalPo.php +++ b/app/Views/editCapitalPo.php @@ -5358,15 +5358,8 @@ if (!empty($getlogpodtl)) { type: "POST", url: "purchaseorder/DeletePODetails", success: function (data) { - $('#loader').show(); - - if (data) { - // $('#content').loader('hide'); - alert(data); - } else { - alert("Error"); - } - + $('#loader').hide(); + (data) ? alert(response) : alert("Error"); } }); } diff --git a/app/Views/editEmployeenew.php b/app/Views/editEmployeenew.php index e8d6482b..a30ea8c9 100755 --- a/app/Views/editEmployeenew.php +++ b/app/Views/editEmployeenew.php @@ -6,6 +6,13 @@ label { font-style: bold; } + + input[type="file"] { + white-space: normal; + word-wrap: break-word; + overflow-wrap: break-word; + width: 100%; + } ParentPO; @@ -218,6 +218,7 @@ if (!empty($POMaster)) { $DeliveryAddress = $Req->DeliveryAddress; $PONOStatus = $Req->StatusCode; + // dd($PONOStatus); $PONO = $Req->PONO; $ServiceDescription = $Req->ServiceDescription; $CapitalRange = $Req->CapitalRange; @@ -4477,7 +4478,8 @@ if (!empty($getlogpodtl)) { }); index = parseInt(index) + 1; // $PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED - PONOStatus = + var PONOStatus = + console.log("PONOStatus",PONOStatus); // var template = jQuery("#RevenueList").html(); @@ -5087,12 +5089,7 @@ if (!empty($getlogpodtl)) { url: "purchaseorder/DeletePODetails", success: function (data) { $('#loader').hide(); - if (data) { - alert(data); - - } else { - alert("Error"); - } + (data) ? alert(response) : alert("Error"); } }); diff --git a/app/Views/editServiceAmendPO.php b/app/Views/editServiceAmendPO.php index a9b852ce..66945d3b 100755 --- a/app/Views/editServiceAmendPO.php +++ b/app/Views/editServiceAmendPO.php @@ -2044,14 +2044,8 @@ foreach ($PaymentTerms as $TER) { type: "POST", url: "purchaseorder/DeletePODetails", success: function(data) { - if (data) { - $('#loader').hide(); - alert(data); - } else { - $('#loader').hide(); - alert("Error"); - } - + $('#loader').hide(); + (data) ? alert(response) : alert("Error"); } }); } diff --git a/app/Views/editimportpo.php b/app/Views/editimportpo.php index 9a7732dd..82bf24cc 100755 --- a/app/Views/editimportpo.php +++ b/app/Views/editimportpo.php @@ -5334,14 +5334,7 @@ if (!empty($getlogpodtl)) { url: "purchaseorder/DeletePODetails", success: function(data) { $('#loader').hide(); - - if (data) { - // $('#content').loader('hide'); - alert(data); - } else { - alert("Error"); - } - + (data) ? alert(response) : alert("Error"); } }); } diff --git a/app/Views/employeeListing.php b/app/Views/employeeListing.php index c1d033e1..7c160032 100755 --- a/app/Views/employeeListing.php +++ b/app/Views/employeeListing.php @@ -135,7 +135,15 @@ } else { $cdate = date('d-m-Y', strtotime($record->Created_date)); } ?> - EmpID ?> + EmpID ?> + is_driver){ ?> +     + +     + + + + FirstName; ?> ContactNumber ?> Designation ?> diff --git a/app/Views/publicholidays.php b/app/Views/publicholidays.php index 7d001121..0ddb9ca5 100755 --- a/app/Views/publicholidays.php +++ b/app/Views/publicholidays.php @@ -29,7 +29,7 @@
-
+
Holiday Name : diff --git a/app/Views/purchaseorder.php b/app/Views/purchaseorder.php index a62b00a0..71630efa 100755 --- a/app/Views/purchaseorder.php +++ b/app/Views/purchaseorder.php @@ -204,15 +204,15 @@ if (!empty($INRSYMBOL)) { function vaildateBeforeOpenModal() { var radioValue = $("input[name='DateRange']:checked").val(); - if ($('#PODate').val() == '') { - alert('Please Enter the Purchase Order date'); - $('#PODate').focus(); - return false; - } else if ($('#drpSupplier').val() == "0") { + if ($('#drpSupplier').val() == "0") { alert('Please Select the Supplier details'); $('#drpSupplier').focus(); return false; - } else if ($('#DeliveryAddr').val() == '') { + } else if ($('#PODate').val() == '') { + alert('Please Enter the Purchase Order date'); + $('#PODate').focus(); + return false; + } else if ($('#DeliveryAddr').val() == '') { alert('Please Enter the Delivery Address'); $('#DeliveryAddr').focus(); return false; @@ -224,15 +224,7 @@ if (!empty($INRSYMBOL)) { alert('Please Enter the Schedule By'); $('#Deliverydate').focus(); return false; - } else if (radioValue == 0 && $('#Deliverydate').val() == '') { - alert('Please Select the Delivery Date'); - $('#Deliverydate').focus(); - return false; - } else if (radioValue == 1 && $('#Scheduleby').val().trim() == '') { - alert('Please Enter the Schedule By'); - $('#Deliverydate').focus(); - return false; - } else if ($('#PoTypeOptions').val() == "0") { + } else if ($('#PoTypeOptions').val() == "0") { alert('Please Select Revenue Type'); $('#PoTypeOptions').focus(); return false; @@ -3944,7 +3936,7 @@ if (!empty($INRSYMBOL)) { } else { var formData = new FormData($('.CreatePO')[0]); - + disableButtons(); $.ajax({ @@ -3962,15 +3954,19 @@ if (!empty($INRSYMBOL)) { //$('#SpcialInstruction').val(''); //$('#txtDeliveryAddress').val(''); window.location = "purchaseorderListing"; + setTimeout(function() { enableButtons(); }, 2000); + } else { alert("Error"); + setTimeout(function() { enableButtons(); }, 2000); } }, error: function(jqXHR, textStatus, errorThrown) { console.error("AJAX Error: " + textStatus + ": " + errorThrown); alert("Error: " + textStatus); + setTimeout(function() { enableButtons(); }, 2000); } }); @@ -4214,9 +4210,29 @@ if (!empty($INRSYMBOL)) { } function Reset() { + disableButtons(); location.reload(); + setTimeout(function() { + enableButtons(); + }, 2000); } + 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'); + }); + } + + \ No newline at end of file diff --git a/app/Views/requisitionform.php b/app/Views/requisitionform.php index 24af8fb9..5b9be76d 100755 --- a/app/Views/requisitionform.php +++ b/app/Views/requisitionform.php @@ -407,11 +407,14 @@ if (!empty($Emp)) { $("#UOM").val(''); // Get the ID of the first option var firstOptionId = $('#CostCenter option:first').val(); - // Reset the Select2 dropdown to the first option - $('#CostCenter').val(firstOptionId).select2('data', { - id: firstOptionId, - text: $('#CostCenter option:selected').text() - }); + $('#CostCenter').val("-1"); + + + // // Reset the Select2 dropdown to the first option + // $('#CostCenter').val(firstOptionId).select2('data', { + // id: firstOptionId, + // text: $('#CostCenter option:selected').text() + // }); removeHiddenRows($('#Items').find('tr').length); @@ -605,12 +608,13 @@ if (!empty($Emp)) { diff --git a/app/Views/driverListing.php b/app/Views/driverListing.php index f6cb32c8..184ad120 100755 --- a/app/Views/driverListing.php +++ b/app/Views/driverListing.php @@ -63,9 +63,7 @@     - -     - + diff --git a/app/Views/driverPayslipGeneratePrint (Copy).php b/app/Views/driverPayslipGeneratePrint (Copy).php new file mode 100755 index 00000000..0650169c --- /dev/null +++ b/app/Views/driverPayslipGeneratePrint (Copy).php @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + +
+
+ +
+ +
+
Resico (India) Pvt Ltd
196/4 B, 126, Mettupalayam Village, Sriperumbudur(Taluk), +
kancheepuram (Dist), Tamil Nadu, India - 631604.
PaySlip for the Month of PayOn ?>
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
Name name; ?>
Designation
No Of Loads no_of_loads ?>
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EarningsAmount
 Driver Monthly Salary Amount driver_monthly_salary_amount; ?> 
 Driver Monthly Food Amountdriver_monthly_food_amount; ?> 
 Diesel diesel ?> 
 Shed Duty Amount shed_duty_amount ?> 
Net Pay(Rounded)  driver_final_payment),2,'.','') ?> 
Total Amount In Words  
This is a computer generated document. This document does not require signature.
+ + \ No newline at end of file diff --git a/app/Views/driverPayslipGeneratePrint.php b/app/Views/driverPayslipGeneratePrint.php index 0650169c..a9cc7576 100755 --- a/app/Views/driverPayslipGeneratePrint.php +++ b/app/Views/driverPayslipGeneratePrint.php @@ -11,7 +11,7 @@ - +
Resico (India) Pvt Ltd
196/4 B, 126, Mettupalayam Village, Sriperumbudur(Taluk),
kancheepuram (Dist), Tamil Nadu, India - 631604.
PaySlip for the Month of PayOn ?>
@@ -23,24 +23,45 @@ Name -name; ?> +driver_name; ?> - - +Employee ID +EmpID ?> Designation - + Designation ?> - - +Department +DeptName ?> -No Of Loads - no_of_loads ?> +Date Of Joining + DOJ)) ?> - - +No Of Loads + no_of_loads ?> + + +Bank Name +BankName ?> + +PAN Number +Pan;?> + + +Bank Acc No + BankAccountNumber ?> + + Aadhar Number +AadharNo);?> + + +Bank IFSC +IFSCCode ?> + + + @@ -48,35 +69,61 @@ - + - - + + + + - - + + + + - - + + + + + + - - + + + + + + + + + + + + + + - - + + - - - + + + -
EarningsAmount
EarningsAmount DeductionsAmount
 Driver Monthly Salary Amount driver_monthly_salary_amount; ?>  Monthly Salarydriver_monthly_salary_amount; ?>  PF 
 Driver Monthly Food Amountdriver_monthly_food_amount; ?>  Dieseldiesel_amount; ?>  ESI  
 Diesel diesel ?>  Shed Duty Amountshed_amount; ?>   
 Shed Duty Amount shed_duty_amount ?>  BonusFestival_Bonus; ?>   
 Total Earning (Rounded) + driver_monthly_salary_amount + $PayDetails[0]->Festival_Bonus + $PayDetails[0]->diesel_amount + $PayDetails[0]->shed_amount; + echo number_format(round($totEarning),2) + ?> +  Total Deduction (Rounded) +
Net Pay(Rounded)  driver_final_payment),2,'.','') ?> 
Net Pay(Rounded)  driver_final_payment),2,'.','') ?> 
Total Amount In Words  
Total Amount In Words  
This is a computer generated document. This document does not require signature.
- - \ No newline at end of file + \ No newline at end of file diff --git a/app/Views/editrequisitionform.php b/app/Views/editrequisitionform.php index 0af694b4..1762c5ee 100755 --- a/app/Views/editrequisitionform.php +++ b/app/Views/editrequisitionform.php @@ -70,12 +70,12 @@ td { .th-requestedQuantity{ - text-align:center !important; + text-align:right !important; width:15%; } .th-PoQuantity{ - text-align:center !important; + text-align:right !important; width:15%; } @@ -85,7 +85,7 @@ td { } .th-uom{ - text-align:center !important; + text-align:left !important; width:10%; } @@ -226,9 +226,9 @@ td { MaterialCode; ?> MaterialName; ?> - UOM; ?> - Quantity; ?> - POQTY; ?> + UOM; ?> + Quantity; ?> + POQTY; ?> StatusName; ?> @@ -818,9 +818,9 @@ td { ${temp} ${materialCode} ${materialName} - ${uom} - ${quantity} - 0.00 + ${uom} + ${quantity} + 0.00 NEW diff --git a/app/Views/includes/new_header.php b/app/Views/includes/new_header.php index 2f08bd30..620cbf87 100755 --- a/app/Views/includes/new_header.php +++ b/app/Views/includes/new_header.php @@ -764,13 +764,13 @@