diff --git a/app/Controllers/Monthlypay.php b/app/Controllers/Monthlypay.php index 976093fc..623fed57 100755 --- a/app/Controllers/Monthlypay.php +++ b/app/Controllers/Monthlypay.php @@ -144,14 +144,14 @@ class Monthlypay extends BaseController $publicholidaysarray = $this->monthlypay_model->getPublicHoldays($current); $string = "attendance"; $data['noofsundays'] = $noofsundays; - $data['noofpublicholidays'] = count($publicholidaysarray); + $data['noofpublicholidays'] = count($publicholidaysarray) ? count($publicholidaysarray) : 0; $data['publicholidaysarray'] = $publicholidaysarray; $data['sundayarray'] = $sundayarray; $data['monthdays'] = $monthdays; $data['datefordropdown'] = $current; $data['attendance'] = $this->monthlypay_model->monthlyAttendance($current); $data['emppay'] = $this->monthlypay_model->getEmpPayDetails($current, $string); - + // dd($data); $this->global['pageTitle'] = 'Monthly Attendance'; $this->loadViews("attendance", $this->global, $data, NULL); } diff --git a/app/Models/Ipinvoice_model.php b/app/Models/Ipinvoice_model.php index ede1b0bb..ac7fa743 100755 --- a/app/Models/Ipinvoice_model.php +++ b/app/Models/Ipinvoice_model.php @@ -24,16 +24,18 @@ class Ipinvoice_model extends Model ip_payment_methods.payment_method_name, ip_users.user_name, 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_amounts.invoice_total, ip_invoice_amounts.invoice_item_subtotal, ip_invoice_amounts.invoice_item_tax_total') + ip_invoice_amounts.invoice_total, ip_invoice_amounts.invoice_item_subtotal, ip_invoice_amounts.invoice_item_tax_total + ,ip_invoice_attachment.file_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_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'); $builder->where('ip_invoices.invoice_date_created >=', $fromDate ); $builder->where('ip_invoices.invoice_date_created <=', $toDate ); - $builder->orderBy('ip_invoices.invoice_date_created', 'DESC'); + $builder->orderBy('ip_invoices.invoice_number', 'DESC'); $query = $builder->get(); $result = $query->getResult(); diff --git a/app/Views/addEmployeenew.php b/app/Views/addEmployeenew.php index ab9917d9..197eeecf 100755 --- a/app/Views/addEmployeenew.php +++ b/app/Views/addEmployeenew.php @@ -1143,8 +1143,51 @@ document.getElementById('Basic_Pay').value = basic; document.getElementById('HRA_Amount').value = temp; } + + + deductionCalculation(); } + function deductionCalculation() + { + const salaryField = document.getElementById("Total_salary"); + const esiCheckbox = document.getElementsByName("esi_applicable")[0]; + const pfCheckbox = document.getElementsByName("pf_applicable")[0]; + const tdsCheckbox = document.getElementsByName("tds_applicable")[0]; + + const salary = parseFloat(salaryField.value); + + if (!isNaN(salary)) { + // ESI Checkbox: Check and set value + if (salary < 21000) { + esiCheckbox.checked = true; + esiCheckbox.value = "1"; + } else { + esiCheckbox.checked = false; + esiCheckbox.value = "0"; + } + + // PF Checkbox: Check and set value + if (salary > 15000) { + pfCheckbox.checked = true; + pfCheckbox.value = "1"; + } else { + pfCheckbox.checked = false; + pfCheckbox.value = "0"; + } + + // TDS Checkbox: Check and set value + if (salary * 12 > 730000) { + tdsCheckbox.checked = true; + tdsCheckbox.value = "1"; + } else { + tdsCheckbox.checked = false; + tdsCheckbox.value = "0"; + } + } + } + + function removeContact(button) { $(button).closest('.pad').remove(); $('#filesContainer .a1').hide(); diff --git a/app/Views/attendance.php b/app/Views/attendance.php index 0cc50e7e..df2d39e5 100755 --- a/app/Views/attendance.php +++ b/app/Views/attendance.php @@ -177,30 +177,30 @@ $currentday = date('d'); padding-right: 30% ! important; } -.fht-table th:nth-child(1), -.fht-table th:nth-child(2), -.fht-table th:nth-child(3) -{ - position: sticky; - left: 0; - background-color: #00a65a; - z-index: 2; - border-right: 2px solid #ddd; - color: #ffffff; -} + .fht-table th:nth-child(1), + .fht-table th:nth-child(2), + .fht-table th:nth-child(3) + { + position: sticky; + left: 0; + background-color: #00a65a; + z-index: 2; + border-right: 2px solid #ddd; + color: #ffffff; + } -.fht-table td:nth-child(1), -.fht-table td:nth-child(2), -.fht-table td:nth-child(3) -{ - position: sticky; - left: 0; - background-color: #ffffff; - z-index: 2; - border-right: 2px solid #ddd; - color: #0e0b0b; -} + .fht-table td:nth-child(1), + .fht-table td:nth-child(2), + .fht-table td:nth-child(3) + { + position: sticky; + left: 0; + background-color: #ffffff; + z-index: 2; + border-right: 2px solid #ddd; + color: #0e0b0b; + }