From 065f49cbcd7dbf240c7c9a016691bdf9dc27911b Mon Sep 17 00:00:00 2001 From: aadhavan valli Date: Mon, 19 Aug 2024 11:15:32 +0530 Subject: [PATCH 1/2] CHANGE_SALES_DASHBOARD_DATA --- app/Config/Routes.php | 14 +-- app/Controllers/Sales.php | 127 ++++++++++++++++++++ app/Controllers/User.php | 95 --------------- app/Models/Ipinvoice_model.php | 213 +++++++++++++++++++++++++++++++++ app/Views/addEmployee.php | 4 +- app/Views/editEmployee.php | 4 +- app/Views/includes/header.php | 3 +- app/Views/sales_dashboard.php | 23 ++++ 8 files changed, 376 insertions(+), 107 deletions(-) create mode 100644 app/Controllers/Sales.php create mode 100644 app/Views/sales_dashboard.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 1b2f2176..310a4c2b 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -27,7 +27,6 @@ $routes->post('user/Deleteuserdepartment', 'User::Deleteuserdepartment'); // $routes->match(['GET', 'POST', 'PUT', 'DELETE'],'resetPasswordConfirmUser/(:any)/(:any)', 'Login::resetPasswordConfirmUser/$1/$2'); // $routes->match(['GET', 'POST', 'PUT', 'DELETE'],'createPasswordUser', 'Login::createPasswordUser'); $routes->get('dashboard', 'User::index'); -$routes->get('sales_invoice', 'User::sales_invoice'); $routes->get('reports', 'Report::index'); // User Routes @@ -360,9 +359,10 @@ $routes->get('shortagematerialListing', 'Rawmaterialdetails::shortagematerialLis $routes->get('inprocess', 'Inprocess::index'); -// Sales Invoice routes -$routes->get('invoicedetails/ViewInvoice', 'User::ViewInvoice'); -$routes->get('getInvoiceAttachments', 'User::getInvoiceAttachments'); -$routes->get('deleteAttachment', 'User::deleteAttachment'); -$routes->post('saveAttachment', 'User::saveAttachment'); - +// Sales Controller +$routes->get('sales_dashboard', 'Sales::sales_dashboard'); +$routes->get('invoicedetails/ViewInvoice', 'Sales::ViewInvoice'); +$routes->get('getInvoiceAttachments', 'Sales::getInvoiceAttachments'); +$routes->get('deleteAttachment', 'Sales::deleteAttachment'); +$routes->post('saveAttachment', 'Sales::saveAttachment'); +$routes->get('sales_invoice', 'Sales::sales_invoice'); diff --git a/app/Controllers/Sales.php b/app/Controllers/Sales.php new file mode 100644 index 00000000..f35fea79 --- /dev/null +++ b/app/Controllers/Sales.php @@ -0,0 +1,127 @@ +ipinvoice_model = new Ipinvoice_model(); + $this->session = session(); + $this->isLoggedIn(); + } + + public function sales_dashboard() + { + $this->global['pageTitle'] = 'Sales Dashboard'; + $data = []; + $data['today_sales'] = $this->ipinvoice_model->todaySales(); + $data['this_month_sales'] = $this->ipinvoice_model->thisMonthSales(); + $data['this_year_sales'] = $this->ipinvoice_model->thisYearSales(); + $data['this_year_sales_trend'] = $this->ipinvoice_model->thisYearSalesTrend(); + $data['get_today_invoices'] = $this->ipinvoice_model->getTodayInvoices(); + echo "
";
+        print_r($data);die;
+        $this->loadViews("sales_dashboard", $this->global, $data, NULL);
+    }
+
+    //  Sales Invoice List 
+    function sales_invoice(){
+        $this->global['pageTitle'] = 'Sales Invoice';
+        $data['sales_invoice'] = $this->ipinvoice_model->saleInvoiceListing();
+        // echo "
";
+        // print_r($data);die;
+        $this->loadViews("sales_invoice", $this->global, $data, NULL);
+    }
+    
+    // View Invoice 
+    function ViewInvoice($InvoiceNO = '')
+    {
+        if ($InvoiceNO == '') {
+            $InvoiceID =  $_GET['InvoiceID'];
+        } else {
+                    $InvoiceID  = $InvoiceNO;
+        }
+        
+        $data['invoiceDetails'] = $this->ipinvoice_model->getInvoice($InvoiceID);
+
+        $data['invoiceAttachment'] = $this->ipinvoice_model->getinvoiceAttachment($InvoiceID);
+        
+        //   echo "
";
+        //   print_r($data);die;
+        $this->global['pageTitle'] = 'View Invoice';
+        
+        $this->loadViews("editInvoice", $this->global,  $data, NULL);
+    }
+    
+    
+    // Invoice Attachments 
+    function getInvoiceAttachments(){
+            $data['invoiceAttachment'] = $this->ipinvoice_model->getinvoiceAttachment($this->request->getGet('invoice_id'));
+
+            return json_encode($data);
+    }
+    
+    
+    // Delete Attachment
+    function deleteAttachment() 
+    {
+        $invoice_attachment_id = $this->request->getGet('invoice_attachment_id'); // Get the attachment ID from the request
+        // Ensure ID is not empty
+        if ($invoice_attachment_id) {
+            // Load the model
+
+            // Call the model method to delete the attachment
+            $result = $this->ipinvoice_model->deleteAttachment($invoice_attachment_id);
+
+            if ($result) {
+                echo json_encode(['status' => 'success', 'message' => 'Attachment deleted successfully.']);
+            } else {
+                echo json_encode(['status' => 'error', 'message' => 'Failed to delete attachment.']);
+            }
+        } else {
+            echo json_encode(['status' => 'error', 'message' => 'Invalid attachment ID.']);
+        }
+    }
+    
+    // Save Attachment
+    function saveAttachment() {
+        $invoiceId = $this->request->getPost('invoice_id');
+        $fileNames = $this->request->getPost('file_name[]');
+        $files = $this->request->getFiles();
+        if ($files && isset($files['emp_file']) && is_array($files['emp_file'])) {
+            foreach ($files['emp_file'] as $key => $file) {
+                if ($file->isValid() && !$file->hasMoved()) {
+                    // Generate a unique name for the file
+                    $newFileName = $file->getRandomName();
+    
+                    // Move the file to the target directory
+                    $file->move('./public/uploads/images/invoice_files/', $newFileName);
+    
+                    // Insert the file info into the database
+                    $data = [
+                        'invoice_id' => $invoiceId,
+                        'file_name' => $newFileName,
+                        'attachment_name' => $fileNames[$key]
+                    ];
+    
+                    $this->ipattachment_model->addNewAttachment($data);
+                }
+            }
+        } else {
+            return $this->response->setJSON(['success' => false, 'message' => 'No files uploaded or incorrect input name.']);
+        }
+    
+        return $this->response->setJSON(['success' => true]);
+    }
+}
\ No newline at end of file
diff --git a/app/Controllers/User.php b/app/Controllers/User.php
index ee8c926a..ee4a5d8d 100644
--- a/app/Controllers/User.php
+++ b/app/Controllers/User.php
@@ -1637,99 +1637,4 @@ class User extends BaseController
     }
     // END zoho API 
 
-    //  Sales Invoice List 
-
-    function sales_invoice(){
-        $this->global['pageTitle'] = 'Sales Invoice';
-        $data['sales_invoice'] = $this->ipinvoice_model->saleInvoiceListing();
-        // echo "
";
-        // print_r($data);die;
-        $this->loadViews("sales_invoice", $this->global, $data, NULL);
-    }
-    //  Sales Invoice List 
-
-    // Sales Invoice 
-    function ViewInvoice($InvoiceNO = ''){
-        if ($InvoiceNO == '') {
-            $InvoiceID =  $_GET['InvoiceID'];
-          } else {
-                 $InvoiceID  = $InvoiceNO;
-          }
-      
-          $data['invoiceDetails'] = $this->ipinvoice_model->getInvoice($InvoiceID);
-
-          $data['invoiceAttachment'] = $this->ipinvoice_model->getinvoiceAttachment($InvoiceID);
-      
-        //   echo "
";
-        //   print_r($data);die;
-          $this->global['pageTitle'] = 'View Invoice';
-      
-          $this->loadViews("editInvoice", $this->global,  $data, NULL);
-    }
-    // Sales Invoice 
-
-
-    // Sales Invoice 
-    function getInvoiceAttachments(){
-          $data['invoiceAttachment'] = $this->ipinvoice_model->getinvoiceAttachment($this->request->getGet('invoice_id'));
-
-          return json_encode($data);
-    }
-    // Sales Invoice 
-
-
-    // User Controller
-     function deleteAttachment() {
-        $invoice_attachment_id = $this->request->getGet('invoice_attachment_id'); // Get the attachment ID from the request
-        // Ensure ID is not empty
-        if ($invoice_attachment_id) {
-            // Load the model
-
-            // Call the model method to delete the attachment
-            $result = $this->ipinvoice_model->deleteAttachment($invoice_attachment_id);
-
-            if ($result) {
-                echo json_encode(['status' => 'success', 'message' => 'Attachment deleted successfully.']);
-            } else {
-                echo json_encode(['status' => 'error', 'message' => 'Failed to delete attachment.']);
-            }
-        } else {
-            echo json_encode(['status' => 'error', 'message' => 'Invalid attachment ID.']);
-        }
-    }
-
-
-    function saveAttachment() {
-        $invoiceId = $this->request->getPost('invoice_id');
-        $fileNames = $this->request->getPost('file_name[]');
-        $files = $this->request->getFiles();
-        if ($files && isset($files['emp_file']) && is_array($files['emp_file'])) {
-            foreach ($files['emp_file'] as $key => $file) {
-                if ($file->isValid() && !$file->hasMoved()) {
-                    // Generate a unique name for the file
-                    $newFileName = $file->getRandomName();
-    
-                    // Move the file to the target directory
-                    $file->move('./public/uploads/images/invoice_files/', $newFileName);
-    
-                    // Insert the file info into the database
-                    $data = [
-                        'invoice_id' => $invoiceId,
-                        'file_name' => $newFileName,
-                        'attachment_name' => $fileNames[$key]
-                    ];
-    
-                    $this->ipattachment_model->addNewAttachment($data);
-                }
-            }
-        } else {
-            return $this->response->setJSON(['success' => false, 'message' => 'No files uploaded or incorrect input name.']);
-        }
-    
-        return $this->response->setJSON(['success' => true]);
-    }
-    
-    
-
-
 } 
\ No newline at end of file
diff --git a/app/Models/Ipinvoice_model.php b/app/Models/Ipinvoice_model.php
index c625f901..5cda73e9 100644
--- a/app/Models/Ipinvoice_model.php
+++ b/app/Models/Ipinvoice_model.php
@@ -225,4 +225,217 @@ class Ipinvoice_model extends Model
     }
 
 
+    /**
+     * This function is used to get the Today Sales
+     * @return array $result : This is result of the query
+     */
+    function todaySales()
+    {
+        $builder = $this->db->table('ip_invoices a')
+            ->select('COUNT(DISTINCT(a.invoice_number)) as Invoices, IFNULL(SUM(b.item_quantity), 0) as Qty, IFNULL(SUM(c.item_subtotal), 0) as Sales')
+            ->join('ip_invoice_items b', 'a.invoice_id = b.invoice_id', 'left')
+            ->join('ip_invoice_item_amounts c', 'b.item_id = c.item_id', 'left')
+            ->where('a.invoice_date_created', date('Y-m-d'))
+            ->where('a.invoice_status_id', 2);
+        
+        $query = $builder->get();
+        return $query->getRow(); // Assuming you want a single row of aggregated results
+    }
+
+
+    /**
+     * This function is used to get the This Month Sales
+     * @return array $result : This is result of the query
+     */
+    function thisMonthSales()
+    {
+        // Calculate the start date for the current fiscal month
+        $fiscalMonthStart = date('Y') . '-04-01'; // Assuming the fiscal year starts in April
+        $currentYear = date('Y');
+        $currentMonth = date('m');
+
+        // If the current month is before April, subtract one year for the fiscal year start
+        if ($currentMonth < 4) {
+            $fiscalMonthStart = ($currentYear - 1) . '-' . $currentMonth . '-01';
+        } else {
+            $fiscalMonthStart = $currentYear . '-' . $currentMonth . '-01';
+        }
+
+        // Build the query
+        $builder = $this->db->table('ip_invoices a')
+            ->select('COUNT(DISTINCT(a.invoice_number)) as Invoices, 
+                    IFNULL(SUM(b.item_quantity), 0) as Qty, 
+                    IFNULL(SUM(c.item_subtotal), 0) as Sales')
+            ->join('ip_invoice_items b', 'a.invoice_id = b.invoice_id', 'left')
+            ->join('ip_invoice_item_amounts c', 'b.item_id = c.item_id', 'left')
+            ->where('a.invoice_date_created >=', $fiscalMonthStart)
+            ->where('a.invoice_status_id', 2);
+
+        // Execute the query
+        $query = $builder->get();
+        
+        // Log the SQL query for debugging
+        log_message('debug', $builder->getCompiledSelect());
+
+        // Return the aggregated results
+        return $query->getRow();
+    }
+
+    /**
+     * This function is used to get the This Year Sales
+     * @return array $result : This is result of the query
+     */
+    function thisYearSales()
+    {
+        // Calculate the start date for the current fiscal year
+        $fiscalYearStart = date('Y') . '-04-01'; 
+        $currentYear = date('Y');
+        $currentMonth = date('m');
+
+        // If the current month is before April, subtract one year for the fiscal year start
+        if ($currentMonth < 4) {
+            $fiscalYearStart = ($currentYear - 1) . '-04-01';
+        } else {
+            $fiscalYearStart = $currentYear . '-04-01';
+        }
+
+        // Build the query
+        $builder = $this->db->table('ip_invoices a')
+            ->select('COUNT(DISTINCT(a.invoice_number)) as Invoices, 
+                    IFNULL(SUM(b.item_quantity), 0) as Qty, 
+                    IFNULL(SUM(c.item_subtotal), 0) as Sales')
+            ->join('ip_invoice_items b', 'a.invoice_id = b.invoice_id', 'left')
+            ->join('ip_invoice_item_amounts c', 'b.item_id = c.item_id', 'left')
+            ->where('a.invoice_date_created >=', $fiscalYearStart)
+            ->where('a.invoice_status_id', 2);
+
+        // Execute the query
+        $query = $builder->get();
+        
+        // Log the SQL query for debugging
+        log_message('debug', $builder->getCompiledSelect());
+
+        // Return the aggregated results
+        return $query->getRow();
+    }
+
+    /**
+     * This function is used to get the This Year Sales Trend
+     * @return array $result : This is result of the query
+     */
+    function thisYearSalesTrend()
+    {
+        $currentYear = date('Y');
+        $currentMonth = date('m');
+
+        // Calculate the start date for the current and last fiscal years
+        if ($currentMonth < 4) {
+            $fiscalYearStartCurrent = ($currentYear - 1) . '-04-01';
+            $fiscalYearStartLast = ($currentYear - 2) . '-04-01';
+            $fiscalYearEndLast = ($currentYear - 1) . '-03-31';
+        } else {
+            $fiscalYearStartCurrent = $currentYear . '-04-01';
+            $fiscalYearStartLast = ($currentYear - 1) . '-04-01';
+            $fiscalYearEndLast = $currentYear . '-03-31';
+        }
+
+        // Build query for the current fiscal year
+        $builderCurrent = $this->db->table('ip_invoices a')
+            ->select("DATE_FORMAT(a.invoice_date_created, '%b') as Month, 
+                    IFNULL(SUM(c.item_total), 0) as Sales")
+            ->join('ip_invoice_items b', 'a.invoice_id = b.invoice_id', 'left')
+            ->join('ip_invoice_item_amounts c', 'b.item_id = c.item_id', 'left')
+            ->where('a.invoice_date_created >=', $fiscalYearStartCurrent)
+            ->where('a.invoice_status_id', 2)
+            ->groupBy("DATE_FORMAT(a.invoice_date_created, '%b')")
+            ->orderBy('MONTH(a.invoice_date_created)');
+
+        // Build query for the last fiscal year
+        $builderLast = $this->db->table('ip_invoices a')
+            ->select("DATE_FORMAT(a.invoice_date_created, '%b') as Month, 
+                    IFNULL(SUM(c.item_total), 0) as Sales")
+            ->join('ip_invoice_items b', 'a.invoice_id = b.invoice_id', 'left')
+            ->join('ip_invoice_item_amounts c', 'b.item_id = c.item_id', 'left')
+            ->where('a.invoice_date_created >=', $fiscalYearStartLast)
+            ->where('a.invoice_date_created <', $fiscalYearStartCurrent)
+            ->where('a.invoice_status_id', 2)
+            ->groupBy("DATE_FORMAT(a.invoice_date_created, '%b')")
+            ->orderBy('MONTH(a.invoice_date_created)');
+
+        // Execute the queries
+        $currentYearData = $builderCurrent->get()->getResultArray();
+        $lastYearData = $builderLast->get()->getResultArray();
+
+        // Combine the data
+        $salesComparison = [];
+        foreach ($lastYearData as $lastYearRow) {
+            $month = $lastYearRow['Month'];
+            $salesComparison[$month]['Last Year'] = $lastYearRow['Sales'];
+        }
+
+        foreach ($currentYearData as $currentYearRow) {
+            $month = $currentYearRow['Month'];
+            $salesComparison[$month]['Current Year'] = $currentYearRow['Sales'];
+        }
+
+        // Log the SQL queries for debugging
+        log_message('debug', $builderCurrent->getCompiledSelect());
+        log_message('debug', $builderLast->getCompiledSelect());
+
+        // Return the comparison results
+        return $salesComparison;
+    }
+
+    /**
+     * This function is used to get the Today invoices
+     * @return array $result : This is result of the query
+     */
+    function getTodayInvoices()
+    {
+        // Define the custom field ID for the vehicle number
+        $vehicleCustomFieldId = 8; // Adjust this ID if necessary
+
+        // Build the query to get today's invoices with detailed information
+        $builder = $this->db->table('ip_invoices ii')
+            ->select("
+                ii.invoice_number AS 'Invoice No.',
+                DATE_FORMAT(ii.invoice_date_created, '%d-%m-%Y') AS 'Invoice Date',
+                TIME_FORMAT(ii.invoice_time_created, '%l:%i %p') AS 'Invoice Time',
+                icf.invoice_custom_fieldvalue AS 'Vehicle No.',
+                IF(iit.item_description = '', iit.item_name, iit.item_description) AS 'Product',
+                ic.client_name AS 'Client',
+                SUM(iit.item_quantity) AS 'Quantity',
+                SUM(iit.item_price) AS 'Rate',
+                SUM(iia.item_subtotal) AS 'Value',
+                SUM(iia.item_cgst_amt) AS 'CGST',
+                SUM(iia.item_sgst_amt) AS 'SGST',
+                SUM(iia.item_igst_amt) AS 'IGST',
+                SUM(IFNULL(tcs.tax_rate_percent * iia.item_total / 100, 0)) AS 'TCS',
+                SUM(IFNULL(tcs.tax_rate_percent * iia.item_total / 100, 0)) + SUM(iia.item_total) AS 'Total'
+            ")
+            ->join('ip_invoice_custom icf', 'icf.invoice_id = ii.invoice_id', 'left')
+            ->join('ip_invoice_tax_rates tc', 'tc.invoice_id = ii.invoice_id', 'left')
+            ->join('ip_invoice_items iit', 'iit.invoice_id = ii.invoice_id', 'left')
+            ->join('ip_invoice_item_amounts iia', 'iia.item_id = iit.item_id', 'left')
+            ->join('ip_clients ic', 'ic.client_id = ii.client_id', 'left')
+            ->join('ip_tax_rates sgst', 'sgst.tax_rate_id = iit.sgst_item_tax_rate_id', 'left')
+            ->join('ip_tax_rates cgst', 'cgst.tax_rate_id = iit.cgst_item_tax_rate_id', 'left')
+            ->join('ip_tax_rates igst', 'igst.tax_rate_id = iit.igst_item_tax_rate_id', 'left')
+            ->join('ip_tax_rates tcs', 'tcs.tax_rate_id = tc.tax_rate_id', 'left')
+            ->where('icf.invoice_custom_fieldid', $vehicleCustomFieldId)
+            ->where('ii.invoice_status_id', 2)
+            ->where('ii.invoice_date_created', date('Y-m-d'))
+            ->groupBy('ii.invoice_number, iit.item_description')
+            ->orderBy('ii.invoice_number');
+
+        // Execute the query
+        $query = $builder->get();
+
+        // Log the SQL query for debugging
+        log_message('debug', $builder->getCompiledSelect());
+
+        // Return the detailed invoice data
+        return $query->getResultArray();
+    }
+
 }
\ No newline at end of file
diff --git a/app/Views/addEmployee.php b/app/Views/addEmployee.php
index 9a4d5e51..50ae509a 100644
--- a/app/Views/addEmployee.php
+++ b/app/Views/addEmployee.php
@@ -401,7 +401,7 @@ function validatePF() {
 
     if (PF != '') {
         if (regpf.test(PF) == false) {
-            alert('Please Enter Valid PF Number');
+            alert('Please Enter Valid UAN');
             return (false);
         } else {
             return true;
@@ -1001,7 +1001,7 @@ legend {
 
 
                                                 
-
PF Number +
UAN -
PF Number +
UAN
  • - + + Sales Dashboard
  • diff --git a/app/Views/sales_dashboard.php b/app/Views/sales_dashboard.php new file mode 100644 index 00000000..769b578f --- /dev/null +++ b/app/Views/sales_dashboard.php @@ -0,0 +1,23 @@ + + +
    + +
    +

    Sales Dashboard

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    From 3c1fd63aa9da4a063a6ffbfd2ed2bc226d056f94 Mon Sep 17 00:00:00 2001 From: bitbucket Date: Mon, 19 Aug 2024 15:13:14 +0530 Subject: [PATCH 2/2] CHANGE in pay roll : GWM --- app/Controllers/Monthlypay.php | 5 +- app/Controllers/Payslip.php | 190 +++++++++++++------------------- app/Controllers/User.php | 2 +- app/Models/Monthlypay_model.php | 2 +- app/Views/attendance.php | 74 ++++++++----- app/Views/monthlypayinputs.php | 109 +++++++++++------- 6 files changed, 203 insertions(+), 179 deletions(-) diff --git a/app/Controllers/Monthlypay.php b/app/Controllers/Monthlypay.php index 74deebd1..b7ed6d18 100644 --- a/app/Controllers/Monthlypay.php +++ b/app/Controllers/Monthlypay.php @@ -138,6 +138,7 @@ class Monthlypay extends BaseController } $begin->modify('+1 day'); } + // dd( $sundayarray); $noofsundays = count($sundayarray); $publicholidaysarray = $this->monthlypay_model->getPublicHoldays($current); @@ -150,6 +151,7 @@ class Monthlypay extends BaseController $data['datefordropdown'] = $current; $data['attendance'] = $this->monthlypay_model->monthlyAttendance($current); $data['emppay'] = $this->monthlypay_model->getEmpPayDetails($current, $string); + $this->global['pageTitle'] = 'Monthly Attendance'; $this->loadViews("attendance", $this->global, $data, NULL); } @@ -264,6 +266,7 @@ class Monthlypay extends BaseController $paidleave = $data['Paid Leave']; $daysworked = $data['Days Worked']; $absent = $data['Absent']; + $sundayCount = $data['Total Sunday']; $monthattendance = array( 'Month_Year' => $Month_Year, 'NoofDays' => $NoofDays, 'EmpID' => $EmpID, 'WH1' => $W1H, 'OT1' => $W1OT, 'WH2' => $W2H, 'OT2' => $W2OT, 'WH3' => $W3H, 'OT3' => $W3OT, @@ -272,7 +275,7 @@ class Monthlypay extends BaseController 'WH17' => $W17H, 'OT17' => $W17OT, 'WH18' => $W18H, 'OT18' => $W18OT, 'WH19' => $W19H, 'OT19' => $W19OT, 'WH20' => $W20H, 'OT20' => $W20OT, 'WH21' => $W21H, 'OT21' => $W21OT, 'WH22' => $W22H, 'OT22' => $W22OT, 'WH23' => $W23H, 'OT23' => $W23OT, 'WH24' => $W24H, 'OT24' => $W24OT, 'WH25' => $W25H, 'OT25' => $W25OT, 'WH26' => $W26H, 'OT26' => $W26OT, 'WH27' => $W27H, 'OT27' => $W27OT, 'WH28' => $W28H, 'OT28' => $W28OT, 'WH29' => $W29H, 'OT29' => $W29OT, 'WH30' => $W30H, 'OT30' => $W30OT, 'WH31' => $W31H, 'OT31' => $W31OT, 'Total_WHrs' => $totalworkinghrs, 'Total_OTHrs' => $totalothrs, 'Paid_Leave' => $paidleave, - 'Days_Worked' => $daysworked, 'Absent' => $absent, 'Created_by' => $CreateBy + 'Days_Worked' => $daysworked, 'Absent' => $absent, 'sunday_count' => $sundayCount , 'Created_by' => $CreateBy ); diff --git a/app/Controllers/Payslip.php b/app/Controllers/Payslip.php index 2ed1cc87..69f3aa98 100644 --- a/app/Controllers/Payslip.php +++ b/app/Controllers/Payslip.php @@ -504,15 +504,16 @@ class Payslip extends BaseController public function monthlyInputs() { $current = date("m-Y"); - // echo $current; + + $data['month'] = $this->monthlypay_model->monthlyListing($current); - // $data['fresh'] = $this-> monthlypay_model->getEmpPayDetails($current); $data['dropdownvalue'] = $current; $data['fresh'] = $this->monthlypay_model->getEmpPayDetailsforMonthInputs($current); - // dd($data['fresh']); + $employeeSalary = []; - - + $esi = []; + $pf = []; + $ot = []; foreach ($data['fresh'] as $value) { @@ -526,28 +527,21 @@ class Payslip extends BaseController $Paid_leave = $value->Paid_leave; // leave day $OT_Hrs_Worked = $value->OT_Hrs_Worked; //OT hours $Monthly_Due = $value->Monthly_Due; // AUTO LOAN DUE - + $Sunday = $value->sunday_count; // Sunday count $Loan_Recovered = $value->Loan_Recovered; //MANUAL LOAN DUE - $MasterIncentives = $value->MasterIncentives; //Master values get - // echo 'master'.$MasterIncentives; - - $due_start_date = $value->DueDate; $paydate = $current; //From POST parm + $pmonth = substr($paydate, 0, 2); $pyear = substr($paydate, -4); - $pday = cal_days_in_month(CAL_GREGORIAN, $pmonth, $pyear); $paymonth = $pyear . '-' . $pmonth . '-' . $pday; + $Loan_amount = $value->Loan_Amount; $Paid_Amount = $value->Paid_Amount; - - $Balance_Amount = $Loan_amount - $Paid_Amount; - - $loan = 0; if ($Loan_Recovered == 'NA') { $loan = 0.00; @@ -563,87 +557,77 @@ class Payslip extends BaseController if ($Monthly_Due > $Balance_Amount) { - - // current= Balance_Amount - autoLoan; - //alert('hi'); $loan = $Balance_Amount; } - - - - $Allowances = $value->Allowances; $HRA_Rate = $value->HRA_Rate; $PF_Rate = $value->PF_Rate; $ESI_Rate = $value->ESI_Rate; $MonthIncentive = $value->MonthlyIncentives; //t_monthly_pay_inputs,for change month - $Incentive = 0; - if (empty($MonthIncentive)) { - $Incentive = $MasterIncentives; } else { $Incentive = $MonthIncentive; } - // echo $Incentive; + + $dayFood_Allowance = $Food_Allowances * ($Days_worked + $Sunday); + $totalDaysWorked = ($Days_worked + $Sunday) + $Paid_leave; - $daySalarys = $Days_worked + $Paid_leave; - - //echo "hra amount";print_r(array($HRA_Amount,$Basic_Pay,$totalsalary)); - //$Allowances = $allowances * $values; - $dayFood_Allowance = $Food_Allowances * $Days_worked; - - $daySalary = $Basic_Pay / $NoofDays; - /**per day salary working hour**/ - //echo $daySalary.'
    '; - + $dayBasic = $Basic_Pay / $NoofDays; $dayHra = $HRA_Amount / $NoofDays; - /** per day hra amount **/ - //echo $dayHra.'
    '; + $onehoursSalary = ($dayBasic + $dayHra) / 8; - $onehoursSalary = ($daySalary + $dayHra) / 8; /**one hour salay ot calculation**/ if ($OT_Hrs_Worked != 0) { $totSalayOT = $OT_Hrs_Worked * $onehoursSalary; } else { $totSalayOT = 0; } - $currentDaySalary = $daySalary * $daySalarys; - /** current day salary working days calculation**/ + + + //current day basic and hra salary + $currentDayBasic = $dayBasic * $totalDaysWorked; + $currentDayHra = $dayHra * $totalDaysWorked; + + //$totalSalary = $currentDayBasic + $currentDayHra + $totSalayOT; - $currentDayHra = $dayHra * $daySalarys; - /** total working days hra calculations**/ - // echo $currentDayHra.'
    '; - $currentDatePF = $currentDaySalary + $currentDayHra + $totSalayOT; - /** current date pf calculation**/ - if ($TotalSalary <= 20000) { - - $esiAmount = $currentDatePF * $ESI_Rate / 100; - /** esiamount not elgiable for 20000 **/ - } else { - $esiAmount = 0; - } - $pfAmount = $currentDaySalary * $PF_Rate / 100; + + if ($TotalSalary <= 20000) { $esiAmount = $currentDayBasic * $ESI_Rate / 100; } else { $esiAmount = 0;} + $pfAmount = $currentDayBasic * $PF_Rate / 100; /** pf amount per day**/ //echo $totalothour;die; - $empSalaryAdd = $currentDaySalary + $totSalayOT + $currentDayHra + $dayFood_Allowance + $Allowances + $Incentive; + $empSalaryAdd = $currentDayBasic + $currentDayHra + $totSalayOT + $dayFood_Allowance + $Allowances + $Incentive; + // echo $totalDaysWorked .'
    '; + // echo $currentDayBasic .'
    '; + // echo $currentDayHra .'
    '; + // echo $totSalayOT .'
    '; + // echo $dayFood_Allowance .'
    '; + // echo $Allowances .'
    '; + // echo $Incentive .'
    '; + // die; $empSalarySub = $esiAmount + $pfAmount + $loan; $salaryInCurrentday = $empSalaryAdd - $empSalarySub; $employeeSalary[] = round($salaryInCurrentday); + $esi[] = number_format($esiAmount,2); + $pf[] = number_format($pfAmount,2); + $ot[] = number_format($totSalayOT,2); } $data['empSalary'] = $employeeSalary; - + $data['esi'] = $esi; + $data['pf'] = $pf; + $data['over_time'] = $ot; + //echo sizeof($data['fresh'])."-".sizeof($data['empSalary']);die; $this->global['pageTitle'] = 'Payroll Monthly Inputs'; @@ -657,19 +641,17 @@ class Payslip extends BaseController $current = $this->request->getPost('monthyear'); $data['month'] = $this->monthlypay_model->monthlyListing($current); - //print_r($data['month']); $data['dropdownvalue'] = $current; $data['fresh'] = $this->monthlypay_model->getEmpPayDetailsforMonthInputs($current); - // dd($data['fresh']); - $employeeSalary = []; - - + + $employeeSalary = []; + $esi = []; + $pf = []; + $ot = []; foreach ($data['fresh'] as $value) { - //print_r($value); - //die(); $NoofDays = $value->NoofDays; //Month day 30,31,28 $HRA_Amount = $value->HRA_Amount; @@ -681,6 +663,9 @@ class Payslip extends BaseController $Paid_leave = $value->Paid_leave; // leave day $OT_Hrs_Worked = $value->OT_Hrs_Worked; //OT hours $Monthly_Due = $value->Monthly_Due; // AUTO LOAN DUE + $Sunday = $value->sunday_count; // Sunday count + $Loan_Recovered = $value->Loan_Recovered; //MANUAL LOAN DUE + $MasterIncentives = $value->MasterIncentives; //Master values get $due_start_date = $value->DueDate; $paydate = $current; //From POST parm @@ -693,18 +678,10 @@ class Payslip extends BaseController $pday = cal_days_in_month(CAL_GREGORIAN, $pmonth, $pyear); $paymonth = $pyear . '-' . $pmonth . '-' . $pday; - $Loan_Recovered = $value->Loan_Recovered; //MANUAL LOAN DUE - - $MasterIncentives = $value->MasterIncentives; //Master values get - // echo 'master'.$MasterIncentives; $Loan_amount = $value->Loan_Amount; $Paid_Amount = $value->Paid_Amount; - - $Balance_Amount = $Loan_amount - $Paid_Amount; - - $loan = 0; if ($Loan_Recovered == 'NA') { $loan = 0.00; @@ -713,7 +690,6 @@ class Payslip extends BaseController $loan = $Monthly_Due; } } else if ($Loan_Recovered >= 0.00) { - if (strtotime($due_start_date) <= strtotime($paymonth)) { $loan = $Loan_Recovered; } @@ -721,86 +697,76 @@ class Payslip extends BaseController if ($Monthly_Due > $Balance_Amount) { - - // current= Balance_Amount - autoLoan; - //alert('hi'); $loan = $Balance_Amount; } - - - - $Allowances = $value->Allowances; $HRA_Rate = $value->HRA_Rate; $PF_Rate = $value->PF_Rate; $ESI_Rate = $value->ESI_Rate; $MonthIncentive = $value->MonthlyIncentives; //t_monthly_pay_inputs,for change month - $Incentive = 0; - if (empty($MonthIncentive)) { - $Incentive = $MasterIncentives; } else { $Incentive = $MonthIncentive; } - // echo $Incentive; + + $dayFood_Allowance = $Food_Allowances * ($Days_worked + $Sunday); + $totalDaysWorked = ($Days_worked + $Sunday) + $Paid_leave; - $daySalarys = $Days_worked + $Paid_leave; - - //echo "hra amount";print_r(array($HRA_Amount,$Basic_Pay,$totalsalary)); - //$Allowances = $allowances * $values; - $dayFood_Allowance = $Food_Allowances * $Days_worked; - - $daySalary = $Basic_Pay / $NoofDays; - /**per day salary working hour**/ - //echo $daySalary.'
    '; - + $dayBasic = $Basic_Pay / $NoofDays; $dayHra = $HRA_Amount / $NoofDays; - /** per day hra amount **/ - //echo $dayHra.'
    '; + $onehoursSalary = ($dayBasic + $dayHra) / 8; - $onehoursSalary = ($daySalary + $dayHra) / 8; /**one hour salay ot calculation**/ if ($OT_Hrs_Worked != 0) { $totSalayOT = $OT_Hrs_Worked * $onehoursSalary; } else { $totSalayOT = 0; } - $currentDaySalary = $daySalary * $daySalarys; - /** current day salary working days calculation**/ + + + //current day basic and hra salary + $currentDayBasic = $dayBasic * $totalDaysWorked; + $currentDayHra = $dayHra * $totalDaysWorked; + + //$totalSalary = $currentDayBasic + $currentDayHra + $totSalayOT; - $currentDayHra = $dayHra * $daySalarys; - /** total working days hra calculations**/ - // echo $currentDayHra.'
    '; - $currentDatePF = $currentDaySalary + $currentDayHra + $totSalayOT; - /** current date pf calculation**/ - if ($TotalSalary <= 20000) { - - $esiAmount = $currentDatePF * $ESI_Rate / 100; - /** esiamount not elgiable for 20000 **/ - } else { - $esiAmount = 0; - } - $pfAmount = $currentDaySalary * $PF_Rate / 100; + + if ($TotalSalary <= 20000) { $esiAmount = $currentDayBasic * $ESI_Rate / 100; } else { $esiAmount = 0;} + $pfAmount = $currentDayBasic * $PF_Rate / 100; /** pf amount per day**/ //echo $totalothour;die; - $empSalaryAdd = $currentDaySalary + $totSalayOT + $currentDayHra + $dayFood_Allowance + $Allowances + $Incentive; + $empSalaryAdd = $currentDayBasic + $currentDayHra + $totSalayOT + $dayFood_Allowance + $Allowances + $Incentive; + // echo $totalDaysWorked .'
    '; + // echo $currentDayBasic .'
    '; + // echo $currentDayHra .'
    '; + // echo $totSalayOT .'
    '; + // echo $dayFood_Allowance .'
    '; + // echo $Allowances .'
    '; + // echo $Incentive .'
    '; + // die; $empSalarySub = $esiAmount + $pfAmount + $loan; $salaryInCurrentday = $empSalaryAdd - $empSalarySub; $employeeSalary[] = round($salaryInCurrentday); + $esi[] = number_format($esiAmount,2); + $pf[] = number_format($pfAmount,2); + $ot[] = number_format($totSalayOT,2); } $data['empSalary'] = $employeeSalary; + $data['esi'] = $esi; + $data['pf'] = $pf; + $data['over_time'] = $ot; //echo sizeof($data['fresh'])."-".sizeof($data['empSalary']);die; $this->global['pageTitle'] = 'Payroll Monthly Inputs'; diff --git a/app/Controllers/User.php b/app/Controllers/User.php index f47e477f..7e2e694b 100644 --- a/app/Controllers/User.php +++ b/app/Controllers/User.php @@ -915,7 +915,7 @@ class User extends BaseController $data['roles'] = $this->user_model->getUserRoles(); - $data['Department'] = $this->costcenter_model->getDepartment(); + // $data['Department'] = $this->costcenter_model->getDepartment(); $this->global['pageTitle'] = 'Add New User'; diff --git a/app/Models/Monthlypay_model.php b/app/Models/Monthlypay_model.php index eb6c48b7..53f9d3aa 100644 --- a/app/Models/Monthlypay_model.php +++ b/app/Models/Monthlypay_model.php @@ -100,7 +100,7 @@ class Monthlypay_model extends Model //echo $lastdate; //left join t_payroll on t_employee_details.EmpID = t_payroll.EmpID and month(t_payroll.PayOn) = month(?) and year(t_payroll.PayOn) = year(?) - $sql = "select t_emp_pay_data.EmpID, t_emp_pay_data.Incentives as MasterIncentives,t_emp_pay_data.*,t_employee_details.FirstName,t_employee_details.LastName,t_employee_details.DateofJoining,t_employee_details.Designation,t_attendance.Days_Worked as Days_worked,t_attendance.Absent as LOP_Days,t_attendance.Paid_Leave as Paid_leave,t_attendance.Total_OTHrs as OT_Hrs_Worked,t_attendance.NoofDays,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_loan_master.Due_Start_Date as DueDate,t_loan_master.Loan_Amount,t_loan_master.Paid_Amount,t_payroll.Key,t_monthly_pay_inputs.Incentives as MonthlyIncentives,t_monthly_pay_inputs.Loan_Recovered,t_monthly_pay_inputs.Estimate,t_monthly_pay_inputs.Festival_Bonus,t_monthly_pay_inputs.Other_Deductions,t_loan_history .Balance_Amount + $sql = "select t_emp_pay_data.EmpID, t_emp_pay_data.Incentives as MasterIncentives,t_emp_pay_data.*,t_employee_details.FirstName,t_employee_details.LastName,t_employee_details.DateofJoining,t_employee_details.Designation,t_attendance.Days_Worked as Days_worked,t_attendance.Absent as LOP_Days,t_attendance.Paid_Leave as Paid_leave,t_attendance.Total_OTHrs as OT_Hrs_Worked,t_attendance.NoofDays,t_attendance.sunday_count,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_loan_master.Due_Start_Date as DueDate,t_loan_master.Loan_Amount,t_loan_master.Paid_Amount,t_payroll.Key,t_monthly_pay_inputs.Incentives as MonthlyIncentives,t_monthly_pay_inputs.Loan_Recovered,t_monthly_pay_inputs.Estimate,t_monthly_pay_inputs.Festival_Bonus,t_monthly_pay_inputs.Other_Deductions,t_loan_history .Balance_Amount from t_emp_pay_data left join t_employee_details on t_employee_details.EmpID = t_emp_pay_data.EmpID left join t_payroll on t_employee_details.EmpID = t_payroll.EmpID and t_payroll.PayOn = ? diff --git a/app/Views/attendance.php b/app/Views/attendance.php index 768ef067..7d56a4da 100644 --- a/app/Views/attendance.php +++ b/app/Views/attendance.php @@ -329,6 +329,7 @@ $currentday = date('d'); Paid Leave Days Worked Absent + Total Sunday @@ -391,6 +392,7 @@ $currentday = date('d'); Paid_Leave)){echo number_format($a->Paid_Leave,2,'.','.');}else{echo "0.00";}?> Days_Worked)){echo $a->Days_Worked;}else{echo "0.00";}?> Absent)){echo $a->Absent;}else{echo "0.00";}?> + @@ -428,29 +430,28 @@ $currentday = date('d'); //alert(s); if(s == 0){ - resetFinalValues(); + + resetFinalValues(); var Totalnoofdays = ; var alldata = $("#attendance").tableToJSON(); - // alert(JSON.stringify(alldata)); alldata=JSON.stringify(alldata); - // alert(alldata); var month = $('#month').val(); var currentmonth = month.substr(0,3); var currentyear = month.substr(4,4); - // alert(currentyear); + var montharray = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]; - var currentmonth = jQuery.inArray(currentmonth,montharray);//!== -1 - currentmonth++; + var currentmonth = jQuery.inArray(currentmonth,montharray);//!== -1 + currentmonth++; - //alert(currentmonth); - var currentdate = '01-'+currentmonth+'-'+currentyear; + + var currentdate = '01-'+currentmonth+'-'+currentyear; var totaldata = 0; $('.content').loader('show'); $.ajax({ - data:{param1:alldata,param2:currentdate,param3:Totalnoofdays}, + data:{param1:alldata,param2:currentdate,param3:Totalnoofdays}, //dataType:"json", type:"POST", url:"monthlypay/saveAttendance", @@ -643,11 +644,13 @@ function myFunction(p,i,v) var totalworkingHrs=0; + var sundayWorkingHr=0; var totalOTHrs = 0; var paidleave = 0; var totalDaysWorked=0; var absent = 0; var sundays = ; + var sundaysArray = ; var publicholidays = ; var totaldays = ; @@ -681,12 +684,30 @@ function myFunction(p,i,v) var str1 = str.substr(-1); var str2 = str.substr(-2); var str3 = str.substr(-3); + + + if(str1 == 'W') { - var current = value.textContent == '' ? 0:parseFloat(value.textContent); - totalworkingHrs += current; + sundayValidation = false; + let dateInt = +str3.replace(/\D/g, ''); + sundaysArray.forEach(element => { + if(+element == dateInt){ + sundayValidation = true; + var current = value.textContent == '' ? 0:parseFloat(value.textContent); + sundayWorkingHr += current; + + } + }); + + if(sundayValidation == false){ + var current = value.textContent == '' ? 0:parseFloat(value.textContent); + totalworkingHrs += current; + } + if(current == 0){absent++;} + } else { @@ -702,28 +723,29 @@ function myFunction(p,i,v) // break; }); - + // if(paidleave == 1 ) // { // absent = 0; // alert('if'); // } - // if(paidleave == 0) - // { - // absent = 0; - // alert('else if'); - // } - // else - // { - // // absent = paidleave-0; - // // paidleave = 0; - // absent = paidleave; - // paidleave = 0; - // alert('else'); - // } + // if(paidleave == 0) + // { + // absent = 0; + // alert('else if'); + // } + // else + // { + // // absent = paidleave-0; + // // paidleave = 0; + // absent = paidleave; + // paidleave = 0; + // alert('else'); + // } + TotalOT = totalOTHrs + sundayWorkingHr; document.getElementById(totalhrsid).textContent = parseFloat(totalworkingHrs).toFixed(2);// == ''?0:parseFloat(totalworkingHrs)); - document.getElementById(totalothrsid).textContent = parseFloat(totalOTHrs).toFixed(2);// == ''?0:parseFloat(totalOTHrs)); + document.getElementById(totalothrsid).textContent = parseFloat(TotalOT).toFixed(2);// == ''?0:parseFloat(totalOTHrs)); document.getElementById(paidleaveid).textContent = parseFloat(paidleave).toFixed(2); document.getElementById(daysworkedid).textContent = parseFloat((totalworkingHrs/8)).toFixed(2); document.getElementById(absentid).textContent = parseFloat(absent).toFixed(2); diff --git a/app/Views/monthlypayinputs.php b/app/Views/monthlypayinputs.php index 15dad917..cd65dc2c 100644 --- a/app/Views/monthlypayinputs.php +++ b/app/Views/monthlypayinputs.php @@ -157,18 +157,37 @@ $('html').bind('keypress', function(e)
    + +
    - + + - + + + - + + + + + + + + + + + + + + + @@ -185,56 +204,63 @@ $('html').bind('keypress', function(e) $record) { - //echo 'PAY'.$record->Key; $index++; - if(in_array($record->EmpID,$testarray)) - { - $index--; - - - } - else{ + if(in_array($record->EmpID,$testarray)) + { + $index--; + }else{ array_push($testarray,$record->EmpID); - - - ?> - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - + + @@ -272,8 +298,13 @@ $('html').bind('keypress', function(e) - + @@ -282,7 +313,7 @@ $('html').bind('keypress', function(e) - @@ -334,7 +365,7 @@ $('html').bind('keypress', function(e)
    S.NoEmp ID Employee DOJDesignationTotal Days Days Worked LOP DaysPaid LeavePaid Leave OT HrsBasic SalaryPre Day SalaryWorked SalaryPre hr SalaryEarned SalaryBasic Salary(0.7)HRA Salary(0.3)Gross SalaryESIPFOver TimeAuto Loan Due ₹ Manual Loan Due ₹
    EmpID ."-".$record->FirstName ."". $record->LastName ?>Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >Days_worked)){echo $record->Days_worked;}else{echo "0.00";}?>Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >LOP_Days)){echo $record->LOP_Days;}else{echo "0.00";}?>EmpID ; ?>FirstName; ?> + DateofJoining); + $newDateFormat = $date->format('d-m-Y'); + echo $newDateFormat; + ?> + Designation; ?>NoofDays; ?>Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >Days_worked)){echo $record->Days_worked+$record->sunday_count;}else{echo "0.00";}?>Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >LOP_Days)){echo $record->LOP_Days;}else{echo "0.00";}?> Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >Paid_leave)){echo number_format($record->Paid_leave,2,'.','');}else { echo number_format(0.00,2,'.','');} ?>Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >OT_Hrs_Worked)){echo $record->OT_Hrs_Worked;}else { echo number_format(0.00,2,'.','');} ?>TotalSalary; ?>TotalSalary / $record->NoofDays; echo number_format($perDaySalary, 2); ?>Days_worked+$record->sunday_count); echo number_format($workedSalary, 2); ?> Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >OT_Hrs_Worked)){echo $record->OT_Hrs_Worked;}else { echo number_format(0.00,2,'.','');} ?>Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >Monthly_Due)){echo $record->Monthly_Due; $totalmonthloan []=$record->Monthly_Due;}else { echo number_format(0.00,2,'.','');} ?>Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >Monthly_Due)){echo $record->Monthly_Due; $totalmonthloan []=$record->Monthly_Due;}else { echo number_format(0.00,2,'.','');} ?>Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"> Estimate)){echo $record->Estimate; $estTotal [] = $record->Estimate; }else { echo $empSalary[$i]; $estTotal [] = $empSalary[$i]; -}?>Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"> + Estimate)){ + echo $record->Estimate; $estTotal [] = $record->Estimate; + }else { + echo $empSalary[$i]; $estTotal [] = $empSalary[$i]; + }?> +
    - +

     

    @@ -428,7 +459,9 @@ $('html').bind('keypress', function(e) "info": true, "paging": false, "autoWidth": true, - "order": [[ 1, 'asc' ]] + + // "scrollX": true, + "order": [[ 1, 'asc' ]], } ); t.on( 'order.dt search.dt', function () { @@ -477,7 +510,7 @@ function isCheckKeyCode(event){ data:{param1:alldata,param2:month}, //dataType:"json", type:"POST", - url:"payslip/saveMonthlyData", + url:"payslip/saveMonthlyData", success:function(data) { if(data) {