From 8ddda8bf93d99f1835683fb8f03a17341642af25 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Wed, 26 Mar 2025 12:18:41 +0530 Subject: [PATCH] GWM : user requirement --- app/Controllers/Payslip.php | 4 +- app/Models/Ipinvoice_model.php | 6 +- app/Views/attendance.php | 54 +++++----- app/Views/monthlypayinputs.php | 187 ++++++++++++++++++++++++++------- app/Views/sales_invoice.php | 4 + 5 files changed, 190 insertions(+), 65 deletions(-) diff --git a/app/Controllers/Payslip.php b/app/Controllers/Payslip.php index e62a8164..50d81424 100755 --- a/app/Controllers/Payslip.php +++ b/app/Controllers/Payslip.php @@ -515,7 +515,7 @@ class Payslip extends BaseController // $Incentives = $j['Incentives in ₹']; $Festival_Bonus = $j['Festival Bonus in ₹']; $Other_Deductions = $j['TDS Deductions in ₹']; - $Estimate = $j['Estimate in ₹']; + $Estimate = $j['Net Salary ₹']; $Created_By = $this->session->get('userId'); if (!is_numeric($DaysWorked) || ($DaysWorked > 31) || (strlen((string)$DaysWorked)) > 5) { @@ -618,7 +618,7 @@ class Payslip extends BaseController $Festival_Bonus = isset($j['Festival Bonus in ₹']) ? $j['Festival Bonus in ₹'] : 0.00; $tds_Deductions = isset($j['TDS Deductions in ₹']) ? $j['TDS Deductions in ₹'] : 0.00; - $Estimate = isset($j['Estimate in ₹']) ? $j['Estimate in ₹'] : 0.00; + $Estimate = isset($j['Net Salary ₹']) ? $j['Net Salary ₹'] : 0.00; $Created_By = $this->session->get('userId'); if($is_driver == 0){ diff --git a/app/Models/Ipinvoice_model.php b/app/Models/Ipinvoice_model.php index 8d087f7e..0e7e645c 100755 --- a/app/Models/Ipinvoice_model.php +++ b/app/Models/Ipinvoice_model.php @@ -26,14 +26,16 @@ class Ipinvoice_model extends Model ip_products.product_name, ip_invoice_items.item_price, ip_products.cgst, ip_products.sgst, ip_invoice_items.item_quantity, ip_invoice_items.item_price, ip_invoice_items.item_name, ip_invoice_items.item_quantity,ip_invoice_items.hsn_or_sac, ip_invoice_amounts.invoice_total, ip_invoice_amounts.invoice_item_subtotal, ip_invoice_amounts.invoice_item_tax_total - ,ip_invoice_attachment.file_name , ip_invoices.received_qty') + ,ip_invoice_attachment.file_name , ip_invoices.received_qty , VN.invoice_custom_fieldvalue as vehicle_no , DN.invoice_custom_fieldvalue as deiver_name') ->join('ip_payment_methods', 'ip_invoices.payment_method = ip_payment_methods.payment_method_id', 'left') ->join('ip_clients', 'ip_invoices.client_id = ip_clients.client_id', 'left') ->join('ip_users', 'ip_invoices.user_id = ip_users.user_id', 'left') ->join('ip_invoice_items', 'ip_invoices.invoice_id = ip_invoice_items.invoice_id', 'left') ->join('ip_products', 'ip_invoice_items.item_product_id = ip_products.product_id', 'left') ->join('ip_invoice_amounts', 'ip_invoices.invoice_id = ip_invoice_amounts.invoice_id', 'left') - ->join('ip_invoice_attachment', 'ip_invoices.invoice_id = ip_invoice_attachment.invoice_id and ip_invoice_attachment.is_active = 1' , 'left'); + ->join('ip_invoice_attachment', 'ip_invoices.invoice_id = ip_invoice_attachment.invoice_id and ip_invoice_attachment.is_active = 1' , 'left') + ->join('ip_invoice_custom VN', 'ip_invoices.invoice_id = VN.invoice_id and VN.invoice_custom_fieldid = 8' , 'left') + ->join('ip_invoice_custom DN', 'ip_invoices.invoice_id = DN.invoice_id and DN.invoice_custom_fieldid = 58' , 'left'); $builder->where('ip_invoices.invoice_date_created >=', $fromDate ); $builder->where('ip_invoices.invoice_date_created <=', $toDate ); $builder->orderBy('ip_invoices.invoice_number', 'DESC'); diff --git a/app/Views/attendance.php b/app/Views/attendance.php index 01592c6a..087d0abb 100755 --- a/app/Views/attendance.php +++ b/app/Views/attendance.php @@ -366,12 +366,13 @@ $currentday = date('d'); $flag2 = 0; $todayflag = 0; } ?> - Total Hrs - OT Hrs - Paid Leave + Days Worked Absent - Total Sunday + Paid Leave + Sunday + Worked Hrs + OT Hrs @@ -460,27 +461,8 @@ $currentday = date('d'); $flag2 = 0; $todayflag = 0; } ?> - - Total_WHrs)) { - echo $a->Total_WHrs; - } else { - echo "0.00"; - } ?> - - - Total_OTHrs)) { - echo $a->Total_OTHrs; - } else { - echo "0.00"; - } ?> - - - - + + Days_Worked)) { echo $a->Days_Worked; @@ -495,6 +477,13 @@ $currentday = date('d'); echo "0.00"; } ?> + + + + + Total_WHrs)) { + echo $a->Total_WHrs; + } else { + echo "0.00"; + } ?> + + + Total_OTHrs)) { + echo $a->Total_OTHrs; + } else { + echo "0.00"; + } ?> + + diff --git a/app/Views/monthlypayinputs.php b/app/Views/monthlypayinputs.php index 41702239..b97620a9 100755 --- a/app/Views/monthlypayinputs.php +++ b/app/Views/monthlypayinputs.php @@ -123,10 +123,11 @@ -
+
-
-
+
+
+
@@ -215,13 +216,20 @@
- -
+
+ +
+
+ + +
-
+
@@ -233,7 +241,7 @@ - + @@ -252,7 +260,7 @@ - + @@ -295,7 +303,7 @@ - + - + - + - + - + - + - - - + - + - - - + + + + + + + + + + + + @@ -722,7 +775,7 @@ - + @@ -898,7 +951,8 @@ $(document).ready(function () { if (data) { $('#loader').hide(); - alert(data); + // alert(data); + showMessage(data); } } @@ -1274,6 +1328,67 @@ $(document).ready(function () { +function openDriverLoad(element) { + var empId = $(element).data("empid"); // Get the empid from clicked element + var monthYear = $('#monthyear').val(); + // Convert "03-2025" to "Mar-2025" + var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + var parts = monthYear.split('-'); + var monthIndex = parseInt(parts[0], 10) - 1; // Convert "03" to index 2 (March) + var formattedMonthYear = monthNames[monthIndex] + '-' + parts[1]; + + var baseUrl = ""; // Ensure this echoes the correct base URL + var requestUrl = baseUrl + "loadDriverAttendance?month_year=" + encodeURIComponent(formattedMonthYear) + "&drv_id=" + encodeURIComponent(empId); + + // Open the URL in a new tab + window.open(requestUrl, "_blank"); +} + + + + +function toggleDivFullscreen() { + let div = document.getElementById("fullscreenDiv"); + let tableResponsive = document.getElementById("table-responsive"); // Select the table container inside div + + + + if (!document.fullscreenElement) { + div.requestFullscreen().then(() => { + div.style.width = "100vw"; // Full viewport width + div.style.height = "100vh"; // Full viewport height + + // If .table-responsive exists, set its height to 90vh + if (tableResponsive) { + tableResponsive.style.maxHeight = "90vh"; + tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed + } + }).catch(err => console.log("Error enabling fullscreen:", err)); + } else { + document.exitFullscreen().then(() => { + div.style.width = "100%"; + div.style.height = "100%"; + + // Reset .table-responsive height when exiting fullscreen + if (tableResponsive) { + tableResponsive.style.height = "auto"; + } + }).catch(err => console.log("Error exiting fullscreen:", err)); + } +} + + +function showMessage(msg) { + let msgBox = document.getElementById("successMessage"); + msgBox.innerText = msg; // Set API message + msgBox.style.display = "block"; + + // Hide message after 3 seconds + setTimeout(() => { + msgBox.style.display = "none"; + }, 3000); +} + diff --git a/app/Views/sales_invoice.php b/app/Views/sales_invoice.php index 85469efa..f6fc61ac 100755 --- a/app/Views/sales_invoice.php +++ b/app/Views/sales_invoice.php @@ -240,6 +240,8 @@ + + @@ -283,6 +285,8 @@ + +
DOJ Designation Total DaysNumber Of Trips Days Worked LOP Days Paid LeaveAuto Loan Due ₹ TDS Deductions in ₹ Festival Bonus in ₹Estimate in ₹Net Salary ₹
NoofDays; ?> Key)) { echo "contenteditable='false';"; @@ -352,11 +360,13 @@ } ?> TotalSalary; ?> + TotalSalary; $totalsalary[] = $record->TotalSalary; ?> + TotalSalary / $record->NoofDays; - echo number_format($perDaySalary, 2, '.', ''); ?> + echo number_format($perDaySalary, 2, '.', ''); $totalperdaySalary[] = $perDaySalary; ?> @@ -366,30 +376,38 @@ + echo number_format($perHrSalary, 2); $totalperhrSalary[] = $perHrSalary; ?> + + + echo number_format($basicWorked, 2, '.', ''); $totalbasic[] = $basicWorked; ?> + echo number_format($hraWorked, 2, '.', ''); $totalhra[] = $hraWorked; ?> - + + + + + + + is_payslip_generated == 0) { echo "contenteditable='true';"; } ?> @@ -539,9 +557,9 @@ total_cal_days; ?> + unique_days, 2, '.', ''); ?> @@ -559,14 +577,14 @@ - + + total_cal_days ; - echo number_format($worked_amt, 2, '.', ''); ?> + echo number_format($worked_amt, 2, '.', ''); $totalperdaySalary[] = $worked_amt; ?> @@ -575,31 +593,35 @@ + echo number_format($hr_amt, 2, '.', ''); $totalperhrSalary[] = $hr_amt; ?> - + + echo number_format($basic_worked, 2, '.', ''); $totalbasic[] = $basic_worked; ?> + echo number_format($hra_worked, 2, '.', ''); $totalhra[] = $hra_worked; ?> - + esi_amount; ?> + esi_amount; $totalesi[] = $record->esi_amount; ?> + pf_amount; ?> + pf_amount; $totalpf[] = $record->pf_amount; ?> + @@ -683,9 +705,40 @@
Total + + + + + + + + + + + + + + + + + + + + + + Client Name Product HSNDriverVehicle Quantity Rec Qty Rateclient_name ?> item_name ?> hsn_or_sac ?>deiver_name ?>vehicle_no ?> item_quantity, 2, '.', ',') ?>