Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
10245a8c21
@ -463,13 +463,13 @@ class Driver extends BaseController
|
||||
{
|
||||
$loan_id = $result->Loan_ID;
|
||||
|
||||
if($result->Remaining_Due - 1 == 0){ $is_Active = 0; }else{ $is_Active = 1; }
|
||||
|
||||
|
||||
$loan = [
|
||||
'Paid_Due' => $result->Paid_Due + 1,
|
||||
'Remaining_Due' => $result->Remaining_Due - 1,
|
||||
'Paid_Amount' => $result->Paid_Amount + $result->Loan_Recovered,
|
||||
'is_Active' => $is_Active
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -346,7 +346,8 @@ class StockController extends BaseController
|
||||
'clayOrLossOfIgnition' => $postData['clayOrLossOfIgnition'],
|
||||
'reportComments' => $postData['reportComments'],
|
||||
'gradeRange' => $postData['gradeRange'],
|
||||
'reportTime' => $postData['reportTime']
|
||||
'reportTime' => $postData['reportTime'],
|
||||
'remark' => $postData['remark']
|
||||
|
||||
];
|
||||
|
||||
@ -1189,7 +1190,7 @@ class StockController extends BaseController
|
||||
|
||||
|
||||
//diesel stock details
|
||||
|
||||
|
||||
public function dieselMachineStockDetails(){
|
||||
|
||||
|
||||
@ -1244,9 +1245,17 @@ class StockController extends BaseController
|
||||
->where('machine_category','diesel')
|
||||
->findAll();
|
||||
|
||||
$filterUpdateNeeded = true ;
|
||||
|
||||
if( empty($customisedMachineCodes) && !empty($existingCustomMachineCodes)){
|
||||
$customisedMachineCodes = array_column($existingCustomMachineCodes, 'materialCode') ;
|
||||
$filterUpdateNeeded = false ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//check user applies for filter currently
|
||||
if(!empty($customisedMachineCodes)){
|
||||
if(!empty($customisedMachineCodes) && $filterUpdateNeeded){
|
||||
|
||||
//user applied filter,
|
||||
|
||||
@ -1407,11 +1416,62 @@ class StockController extends BaseController
|
||||
$groupedByDate[$date][] = $detail;
|
||||
}
|
||||
|
||||
// Sort each date's machines based on the custom order to set table body td
|
||||
if (!empty($customisedMachineCodes)) {
|
||||
|
||||
foreach ($groupedByDate as $date => &$machines) {
|
||||
|
||||
usort($machines, function ($a, $b) use ($customisedMachineCodes) {
|
||||
|
||||
$indexA = array_search($a['machine_id'], $customisedMachineCodes);
|
||||
$indexB = array_search($b['machine_id'], $customisedMachineCodes);
|
||||
|
||||
if ($indexA === false && $indexB === false) {
|
||||
return 0;
|
||||
}
|
||||
if ($indexA === false) {
|
||||
return 1;
|
||||
}
|
||||
if ($indexB === false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $indexA - $indexB;
|
||||
});
|
||||
}
|
||||
unset($machines);
|
||||
}
|
||||
|
||||
// Reset the structure to have indexed arrays without the date keys
|
||||
$data['groupedDieselMachineStockDetails'] = array_values($groupedByDate);
|
||||
|
||||
|
||||
|
||||
// Sort each date's machines based on the custom order to set table header th
|
||||
|
||||
if (!empty($customisedMachineCodes)) {
|
||||
|
||||
|
||||
|
||||
usort($dieselMachines, function ($a, $b) use ($customisedMachineCodes) {
|
||||
|
||||
$indexA = array_search($a['id'], $customisedMachineCodes);
|
||||
$indexB = array_search($b['id'], $customisedMachineCodes);
|
||||
|
||||
if ($indexA === false && $indexB === false) {
|
||||
return 0;
|
||||
}
|
||||
if ($indexA === false) {
|
||||
return 1;
|
||||
}
|
||||
if ($indexB === false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $indexA - $indexB;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$dieselMachinesCount = count($dieselMachines);
|
||||
|
||||
@ -1602,9 +1662,17 @@ class StockController extends BaseController
|
||||
->where('machine_category','electric')
|
||||
->findAll();
|
||||
|
||||
$filterUpdateNeeded = true ;
|
||||
|
||||
if( empty($customisedMachineCodes) && !empty($existingCustomMachineCodes)){
|
||||
$customisedMachineCodes = array_column($existingCustomMachineCodes, 'materialCode') ;
|
||||
$filterUpdateNeeded = false ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//check user applies for filter currently
|
||||
if(!empty($customisedMachineCodes)){
|
||||
if(!empty($customisedMachineCodes) && $filterUpdateNeeded){
|
||||
|
||||
//user applied filter,
|
||||
|
||||
@ -1769,10 +1837,63 @@ class StockController extends BaseController
|
||||
$groupedByDate[$date][] = $detail;
|
||||
}
|
||||
|
||||
|
||||
// Sort each date's machines based on the custom order to set table body td
|
||||
if (!empty($customisedMachineCodes)) {
|
||||
|
||||
foreach ($groupedByDate as $date => &$machines) {
|
||||
|
||||
usort($machines, function ($a, $b) use ($customisedMachineCodes) {
|
||||
|
||||
$indexA = array_search($a['machine_id'], $customisedMachineCodes);
|
||||
$indexB = array_search($b['machine_id'], $customisedMachineCodes);
|
||||
|
||||
if ($indexA === false && $indexB === false) {
|
||||
return 0;
|
||||
}
|
||||
if ($indexA === false) {
|
||||
return 1;
|
||||
}
|
||||
if ($indexB === false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $indexA - $indexB;
|
||||
});
|
||||
}
|
||||
unset($machines);
|
||||
}
|
||||
|
||||
// Reset the structure to have indexed arrays without the date keys
|
||||
$data['groupedPowerConsumptionStockDetails'] = array_values($groupedByDate);
|
||||
|
||||
|
||||
// Sort each date's machines based on the custom order to set table header th
|
||||
|
||||
if (!empty($customisedMachineCodes)) {
|
||||
|
||||
|
||||
|
||||
usort($electricMachines, function ($a, $b) use ($customisedMachineCodes) {
|
||||
|
||||
$indexA = array_search($a['id'], $customisedMachineCodes);
|
||||
$indexB = array_search($b['id'], $customisedMachineCodes);
|
||||
|
||||
if ($indexA === false && $indexB === false) {
|
||||
return 0;
|
||||
}
|
||||
if ($indexA === false) {
|
||||
return 1;
|
||||
}
|
||||
if ($indexB === false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $indexA - $indexB;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$electricMachinesCount = count($electricMachines);
|
||||
|
||||
$data['electricMachinesCount'] = $electricMachinesCount;
|
||||
@ -2064,11 +2185,19 @@ class StockController extends BaseController
|
||||
->where('stock_category','resin')
|
||||
->findAll();
|
||||
|
||||
$filterUpdateNeeded = true ;
|
||||
|
||||
if( empty($customisedMaterialCodes) && !empty($existingCustomMaterialCodes)){
|
||||
$customisedMaterialCodes = array_column($existingCustomMaterialCodes, 'materialCode') ;
|
||||
$filterUpdateNeeded = false ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//check user applies for filter currently
|
||||
if(!empty($customisedMaterialCodes)){
|
||||
if(!empty($customisedMaterialCodes) && $filterUpdateNeeded){
|
||||
|
||||
//user applied filter,
|
||||
//user applied new filter,
|
||||
|
||||
//check already filter existing , if exists remove that ,
|
||||
if(!empty($existingCustomMaterialCodes)){
|
||||
@ -2129,7 +2258,7 @@ class StockController extends BaseController
|
||||
//no filter applied at all just present all active material codes
|
||||
$existingCustomMaterialCodes = $this->rawmaterialdetails_model->getAllResinMaterialCode();
|
||||
}else{
|
||||
//if filter present,get that material codes
|
||||
//if filter present , Reuse the filter and get that material codes
|
||||
$existingCustomMaterialCodes = $this->rawmaterialdetails_model
|
||||
->getSelectedResinMaterialCode(array_column($existingCustomMaterialCodes, 'materialCode'));
|
||||
}
|
||||
@ -2201,7 +2330,35 @@ class StockController extends BaseController
|
||||
$groupedByDate[$date][] = $detail;
|
||||
}
|
||||
|
||||
// Sort each date's materials based on the custom order to set table body td
|
||||
if (!empty($customisedMaterialCodes)) {
|
||||
|
||||
foreach ($groupedByDate as $date => &$materials) {
|
||||
|
||||
usort($materials, function ($a, $b) use ($customisedMaterialCodes) {
|
||||
|
||||
$indexA = array_search($a['materialCode'], $customisedMaterialCodes);
|
||||
$indexB = array_search($b['materialCode'], $customisedMaterialCodes);
|
||||
|
||||
if ($indexA === false && $indexB === false) {
|
||||
return 0;
|
||||
}
|
||||
if ($indexA === false) {
|
||||
return 1;
|
||||
}
|
||||
if ($indexB === false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $indexA - $indexB;
|
||||
});
|
||||
}
|
||||
unset($materials);
|
||||
}
|
||||
|
||||
// Reset the structure to have indexed arrays without the date keys
|
||||
|
||||
//this is for tbody table data td
|
||||
$data['groupedResinStockDetails'] = array_values($groupedByDate);
|
||||
|
||||
|
||||
@ -2219,6 +2376,30 @@ class StockController extends BaseController
|
||||
->first()['customer'] ?? '';
|
||||
}
|
||||
|
||||
// Sort each date's materials based on the custom order to set table header th
|
||||
if (!empty($customisedMaterialCodes)) {
|
||||
|
||||
usort($resinMaterials, function ($a, $b) use ($customisedMaterialCodes) {
|
||||
|
||||
$indexA = array_search($a['MaterialCode'], $customisedMaterialCodes);
|
||||
$indexB = array_search($b['MaterialCode'], $customisedMaterialCodes);
|
||||
|
||||
if ($indexA === false && $indexB === false) {
|
||||
return 0;
|
||||
}
|
||||
if ($indexA === false) {
|
||||
return 1;
|
||||
}
|
||||
if ($indexB === false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $indexA - $indexB;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
$resinMaterialCount = count($resinMaterials);
|
||||
|
||||
$data['resinMaterialCount'] = $resinMaterialCount;
|
||||
@ -2381,9 +2562,17 @@ class StockController extends BaseController
|
||||
->where('stock_category','packing_material')
|
||||
->findAll();
|
||||
|
||||
$filterUpdateNeeded = true ;
|
||||
|
||||
if( empty($customisedMaterialCodes) && !empty($existingCustomMaterialCodes)){
|
||||
$customisedMaterialCodes = array_column($existingCustomMaterialCodes, 'materialCode') ;
|
||||
$filterUpdateNeeded = false ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//check user applies for filter currently
|
||||
if(!empty($customisedMaterialCodes)){
|
||||
if(!empty($customisedMaterialCodes) && $filterUpdateNeeded){
|
||||
|
||||
//user applied filter,
|
||||
|
||||
@ -2522,6 +2711,34 @@ class StockController extends BaseController
|
||||
$groupedByDate[$date][] = $detail;
|
||||
}
|
||||
|
||||
// Sort each date's materials based on the custom order to set table body td
|
||||
if (!empty($customisedMaterialCodes)) {
|
||||
|
||||
foreach ($groupedByDate as $date => &$materials) {
|
||||
|
||||
usort($materials, function ($a, $b) use ($customisedMaterialCodes) {
|
||||
|
||||
$indexA = array_search($a['materialCode'], $customisedMaterialCodes);
|
||||
$indexB = array_search($b['materialCode'], $customisedMaterialCodes);
|
||||
|
||||
if ($indexA === false && $indexB === false) {
|
||||
return 0;
|
||||
}
|
||||
if ($indexA === false) {
|
||||
return 1;
|
||||
}
|
||||
if ($indexB === false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $indexA - $indexB;
|
||||
});
|
||||
}
|
||||
unset($materials);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Reset the structure to have indexed arrays without the date keys
|
||||
$data['groupedBagStockDetails'] = array_values($groupedByDate);
|
||||
|
||||
@ -2540,6 +2757,31 @@ class StockController extends BaseController
|
||||
->first()['customer'] ?? '';
|
||||
}
|
||||
|
||||
|
||||
// Sort each date's materials based on the custom order to set table header th
|
||||
if (!empty($customisedMaterialCodes)) {
|
||||
|
||||
usort($bagMaterials, function ($a, $b) use ($customisedMaterialCodes) {
|
||||
|
||||
$indexA = array_search($a['MaterialCode'], $customisedMaterialCodes);
|
||||
$indexB = array_search($b['MaterialCode'], $customisedMaterialCodes);
|
||||
|
||||
if ($indexA === false && $indexB === false) {
|
||||
return 0;
|
||||
}
|
||||
if ($indexA === false) {
|
||||
return 1;
|
||||
}
|
||||
if ($indexB === false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $indexA - $indexB;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
$bagMaterialcount = count($bagMaterials);
|
||||
|
||||
$data['bagMaterialcount'] = $bagMaterialcount;
|
||||
@ -2793,7 +3035,7 @@ class StockController extends BaseController
|
||||
|
||||
$trpAbstract = $this->trpAbstract_model->where('date', $startDate)->findAll();
|
||||
|
||||
// dd( $trpAbstract );
|
||||
|
||||
|
||||
$groupedTrpAbstract = [] ;
|
||||
|
||||
|
||||
@ -2188,12 +2188,20 @@ category = '" . $cat . "' ";
|
||||
function pending_purchase($cname, $prod, $fa, $aa, $m, $frm, $t, $purchaseorder_number)
|
||||
{
|
||||
|
||||
$sql = "select po.PONO as po,date_format(po.PODate,'%d-%m-%Y') as pdate,sup.SupplierName as supplier,mm.MaterialName as material,mm.Category as category,pl.Quantity as quantity,pl.ReceivedQuantity as received, (pl.Quantity - pl.ReceivedQuantity) as pending
|
||||
$sql = "select po.PONO as po,
|
||||
date_format(po.PODate,'%d-%m-%Y') as pdate,
|
||||
sup.SupplierName as supplier,
|
||||
mm.MaterialName as material,
|
||||
cd.ConfigValue as category,
|
||||
pl.Quantity as quantity,
|
||||
pl.ReceivedQuantity as received,
|
||||
(pl.Quantity - pl.ReceivedQuantity) as pending
|
||||
from t_purchaseorder_lineitem pl
|
||||
join t_purchaseorder_master po on po.PONO = pl.PONO
|
||||
join t_supplierdetailsn sup on sup.SupplierID=po.SupplierID
|
||||
join t_materialmaster mm on mm.MaterialCode=pl.MaterialCode
|
||||
where po.Status != 'ST030' and po.Status = 'ST026'
|
||||
join t_configdetails cd on cd.key = mm.Category
|
||||
where po.Status != 'ST030' and po.Status = 'ST026'
|
||||
";
|
||||
if ($cname != '') {
|
||||
|
||||
@ -2231,7 +2239,7 @@ where po.Status != 'ST030' and po.Status = 'ST026'
|
||||
if($purchaseorder_number != ''){
|
||||
$sql .= " and po.PONO = '" . $purchaseorder_number . "' ";
|
||||
}
|
||||
$sql .= "order by po.PONO";
|
||||
$sql .= "order by date(po.PODate) desc";
|
||||
$query = $this->db->query($sql);
|
||||
//echo $sql;
|
||||
return $query->getResult();
|
||||
|
||||
@ -111,7 +111,7 @@ class Driver_model extends Model
|
||||
->select('t_loan_master.Loan_ID,Loan_Amount,Loan_Issued_Date,Monthly_Due,Due_Start_Date as DueDate,No_of_Dues,Paid_Due,Remaining_Due,Paid_Amount,t_loan_history.Balance_Amount, t_driver_monthly_pay_inputs.Loan_Recovered')
|
||||
->join('t_employee_details as driver_details', 'driver_details.EmpID = t_driver_attendance.driver_id', 'left')
|
||||
->join('t_emp_pay_data','t_emp_pay_data.EmpID=driver_details.EmpID','Left')
|
||||
->join('t_loan_master','t_loan_master.EmpID = driver_details.EmpID','Left')
|
||||
->join('t_loan_master','t_loan_master.EmpID = driver_details.EmpID and t_loan_master.Remaining_Due != 0','Left')
|
||||
->join('t_loan_history','t_loan_history.Loan_ID = t_loan_master.Loan_ID','Left')
|
||||
->join('t_driver_monthly_pay_inputs','t_driver_monthly_pay_inputs.driver_id = driver_details.EmpID','Left')
|
||||
->where('t_driver_attendance.date BETWEEN "'.$from.'" AND "'.$to.'"')
|
||||
@ -231,7 +231,7 @@ class Driver_model extends Model
|
||||
->select('CONCAT_WS(" ", driver.FirstName, driver.LastName) AS FullName')
|
||||
->select('MonthlyPay.*,driver.BankAccountNo , driver.PFNO , driver.ESI as ESINO , L.Loan_ID, L.Loan_Amount, L.Loan_Issued_Date, L.Monthly_Due, L.Due_Start_Date, L.No_of_Dues, L.Paid_Due, L.Remaining_Due, L.Paid_Amount')
|
||||
->join('t_employee_details as driver', 'driver.EmpID = MonthlyPay.driver_id and driver.is_driver = 1', 'left')
|
||||
->join('t_loan_master as L', 'MonthlyPay.driver_id = L.EmpID and L.is_Active = 1', 'left')
|
||||
->join('t_loan_master as L', 'MonthlyPay.driver_id = L.EmpID and L.is_Active = 1 and L.Remaining_Due != 0', 'left')
|
||||
->where('MonthlyPay.driver_id', $driver_id)
|
||||
->where('MonthlyPay.month_year', $PayOn);
|
||||
|
||||
|
||||
@ -101,13 +101,13 @@ 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.*,t_employee_details.FirstName,t_employee_details.DateofJoining,t_employee_details.Designation,t_employee_details.esi_applicable,t_employee_details.pf_applicable,t_employee_details.is_management_team,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.Id,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,t_employee_details.is_driver
|
||||
$sql = "select t_emp_pay_data.EmpID,t_emp_pay_data.*,t_employee_details.FirstName,t_employee_details.DateofJoining,t_employee_details.Designation,t_employee_details.esi_applicable,t_employee_details.pf_applicable,t_employee_details.is_management_team,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.Id,t_monthly_pay_inputs.Loan_Recovered,t_monthly_pay_inputs.Estimate,t_monthly_pay_inputs.Festival_Bonus,t_monthly_pay_inputs.Other_Deductions,t_monthly_pay_inputs.is_payslip_generated,t_loan_history .Balance_Amount,t_employee_details.is_driver
|
||||
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 = ?
|
||||
left join t_attendance on t_emp_pay_data.EmpID = t_attendance.EmpID
|
||||
left join t_monthly_pay_inputs on t_monthly_pay_inputs.EmpID = t_emp_pay_data.EmpID and t_monthly_pay_inputs.Month_Year = ?
|
||||
left join t_loan_master on t_emp_pay_data.EmpID = t_loan_master.EmpID and t_loan_master.is_Active = 1
|
||||
left join t_loan_master on t_emp_pay_data.EmpID = t_loan_master.EmpID and t_loan_master.Remaining_Due != 0
|
||||
left join t_loan_history on t_loan_history .Loan_ID = t_loan_master.Loan_ID
|
||||
where t_employee_details.DateofJoining <= ?
|
||||
and month(t_attendance.Month_Year) = month(?) and year(t_attendance.Month_Year) = year(?)
|
||||
@ -180,13 +180,13 @@ class Monthlypay_model extends Model
|
||||
|
||||
$builder = $this->db->table('t_attendance')
|
||||
->select('t_attendance.*,t_employee_details.FirstName,t_employee_details.LastName')
|
||||
->join('t_employee_details', 't_attendance.EmpID=t_employee_details.EmpID')
|
||||
->join('t_employee_details', 't_attendance.EmpID=t_employee_details.EmpID' , 'left')
|
||||
// ->where('year(t_employee_details.DateofJoining) <= ',$year_val)
|
||||
// ->where('month(t_employee_details.DateofJoining) <= ',$month_val)
|
||||
->where('t_employee_details.DateofJoining <= ', $lastdate)
|
||||
->where('Month_Year', $current)
|
||||
->where('t_attendance.Month_Year', $current)
|
||||
->where('t_employee_details.is_driver', 0)
|
||||
// ->where('t_employee_details.IsActive',1)
|
||||
->where('t_employee_details.IsActive',1)
|
||||
->orderBy('t_attendance.EmpID', 'asc');
|
||||
$query = $builder->get();
|
||||
|
||||
|
||||
@ -513,7 +513,7 @@ class Payroll_model extends Model
|
||||
$builder = $this->db->table('t_monthly_pay_inputs MonthlyPay ')
|
||||
->select('MonthlyPay.*, E.BankAccountNo , E.PFNO , E.ESI as ESINO , L.Loan_ID, L.Loan_Amount, L.Loan_Issued_Date, L.Monthly_Due, L.Due_Start_Date, L.No_of_Dues, L.Paid_Due, L.Remaining_Due, L.Paid_Amount')
|
||||
->join('t_employee_details as E', 'MonthlyPay.EmpID = E.EmpID', 'left')
|
||||
->join('t_loan_master as L', 'MonthlyPay.EmpID = L.EmpID and L.is_Active = 1', 'left')
|
||||
->join('t_loan_master as L', 'MonthlyPay.EmpID = L.EmpID and L.is_Active = 1 and L.Remaining_Due != 0', 'left')
|
||||
->where('MonthlyPay.EmpID', $EmpId)
|
||||
->where('MonthlyPay.Month_Year', $PayOn);
|
||||
|
||||
@ -521,6 +521,19 @@ class Payroll_model extends Model
|
||||
return $query->getResult();
|
||||
}
|
||||
|
||||
function updatePaySlipGeneration($EmpId, $PayOn)
|
||||
{
|
||||
$builder = $this->db->table('t_monthly_pay_inputs'); // Define the table
|
||||
$builder->where('EmpID', $EmpId)
|
||||
->where('Month_Year', $PayOn)
|
||||
->set(['is_payslip_generated' => 1])
|
||||
->update();
|
||||
|
||||
return $this->db->affectedRows(); // Return number of affected rows
|
||||
}
|
||||
|
||||
|
||||
|
||||
function insertPayroll($data)
|
||||
{
|
||||
$builder = $this->db->table('t_payroll');
|
||||
|
||||
@ -220,11 +220,12 @@
|
||||
$yqt = 0.00;
|
||||
$yvt = 0.00;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
foreach ($ppurchse as $rel) {
|
||||
$cat = $rel->category;
|
||||
//dd($rel);
|
||||
?>
|
||||
<tr>
|
||||
|
||||
@ -363,140 +364,21 @@
|
||||
// Bootstrap datepicker
|
||||
// Set up your table
|
||||
$(document).ready(function() {
|
||||
// $.fn.dataTable.moment('DD-MM-YYYY');
|
||||
// table = $('#cc').DataTable({
|
||||
// "language": {
|
||||
// "emptyTable": "<center> Data Not Found ! </center>"
|
||||
// },
|
||||
// "aaSorting": [
|
||||
// [0, "desc"]
|
||||
// ],
|
||||
// "pageLength": 10,
|
||||
// "lengthMenu": [10, 25, 50, 100],
|
||||
// "autoWidth": false,
|
||||
// orderCellsTop: true,
|
||||
// "dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
||||
// "<'row'<'col-md-6'><'col-md-6'>>" +
|
||||
// "<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||
// buttons: [
|
||||
|
||||
// // {
|
||||
// // extend: 'excelHtml5',
|
||||
// // footer: 'true',
|
||||
// // //messageTop: $('h3').text(),
|
||||
// // title: $('h3').text(),
|
||||
// // exportOptions: {
|
||||
// // columns: ':visible'
|
||||
// // }
|
||||
// // },
|
||||
|
||||
// 'colvis'
|
||||
// ],
|
||||
// "footerCallback": function(row, data, start, end, display) {
|
||||
// var api = this.api(),
|
||||
// data;
|
||||
|
||||
// // Remove the formatting to get integer data for summation
|
||||
// var intVal = function(i) {
|
||||
// return typeof i === 'string' ?
|
||||
// parseFloat(i.replace(/[^0-9]+/g, "") * 1) :
|
||||
// typeof i === 'number' ?
|
||||
// parseFloat(i) : 0;
|
||||
// };
|
||||
|
||||
// TotalOrderedQTY = api
|
||||
// .column(5, {
|
||||
// search: 'applied'
|
||||
// })
|
||||
// .data()
|
||||
// .reduce(function(a, b) {
|
||||
// return intVal(a) + intVal(b);
|
||||
// }, 0);
|
||||
|
||||
// $(api.column(5).footer()).html(TotalOrderedQTY.toFixed().bold());
|
||||
|
||||
// TotalRcvdQTY = api
|
||||
// .column(6, {
|
||||
// search: 'applied'
|
||||
// })
|
||||
// .data()
|
||||
// .reduce(function(a, b) {
|
||||
// return intVal(a) + intVal(b);
|
||||
// }, 0);
|
||||
|
||||
// $(api.column(6).footer()).html(TotalRcvdQTY.toFixed().bold());
|
||||
|
||||
// TotalPendingQTY = api
|
||||
// .column(7, {
|
||||
// search: 'applied'
|
||||
// })
|
||||
// .data()
|
||||
// .reduce(function(a, b) {
|
||||
// return intVal(a) + intVal(b);
|
||||
// }, 0);
|
||||
|
||||
// $(api.column(7).footer()).html(TotalPendingQTY.toFixed().bold());
|
||||
// }
|
||||
// });
|
||||
|
||||
// Initialize the DataTable
|
||||
var table = $('#cc').DataTable({
|
||||
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
||||
buttons: [
|
||||
'copy', 'csv' // Export buttons
|
||||
],
|
||||
pageLength: 10, // Default rows per page
|
||||
lengthMenu: [
|
||||
[10, 20, 30, 50, -1],
|
||||
[10, 20, 30, 50, "All"]
|
||||
], // Rows per page options
|
||||
responsive: true, // Responsive table
|
||||
order: [
|
||||
[0, 'desc']
|
||||
], // Default ordering (column index 0, descending)
|
||||
language: {
|
||||
paginate: {
|
||||
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#mySelect').on('change', function() {
|
||||
|
||||
table
|
||||
.column(4)
|
||||
.search(this.value)
|
||||
.draw();
|
||||
});
|
||||
|
||||
$(function() {
|
||||
var dateFormat = 'dd-mm-yyyy';
|
||||
|
||||
// Initialize min-date (Start Date)
|
||||
var from = $("#min-date").datepicker({
|
||||
format: dateFormat,
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
clearBtn: true,
|
||||
orientation: 'bottom'
|
||||
}).on('changeDate', function(e) {
|
||||
// When a date is selected in #min-date, update the minDate option for #max-date
|
||||
// to.datepicker('setStartDate', e.date);
|
||||
});
|
||||
|
||||
// Initialize max-date (End Date)
|
||||
var to = $("#max-date").datepicker({
|
||||
format: dateFormat,
|
||||
// startDate: new Date(), // Start date cannot be in the past
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
clearBtn: true,
|
||||
orientation: 'bottom'
|
||||
}).on('changeDate', function(e) {
|
||||
// When a date is selected in #max-date, update the endDate option for #min-date
|
||||
from.datepicker('setStartDate', e.date);
|
||||
// Initialize the DataTable with only pagination enabled
|
||||
var table = $('#cc').DataTable({
|
||||
paging: true, // Enable pagination
|
||||
searching: true, // Disable search
|
||||
ordering: false, // Disable column sorting
|
||||
info: false, // Disable table information
|
||||
lengthChange: false, // Disable page length options
|
||||
pageLength: 10, // Default rows per page
|
||||
responsive: true, // Keep responsive design
|
||||
language: {
|
||||
paginate: {
|
||||
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
@ -392,8 +392,8 @@
|
||||
<td style="max-width:80px;text-align:right;"> <?php echo $over_time[$i]; ?> </td>
|
||||
|
||||
<td id="monthDue<?php echo $index ?>" onkeypress="return isNumber(event);" onkeyup="changeInput(event);"
|
||||
<?php if (empty($record->Key)) { echo "contenteditable='true';"; } ?>
|
||||
<?php if (!empty($record->Key)) { ?> title="Payslip Calculated"
|
||||
<?php if ($record->is_payslip_generated == 0) { echo "contenteditable='true';"; } ?>
|
||||
<?php if ($record->is_payslip_generated == 1) { ?> title="Payslip Calculated"
|
||||
style="text-align:right;color:blue;"
|
||||
<?php } else { ?>style="text-align:right;" <?php } ?>>
|
||||
|
||||
@ -407,10 +407,10 @@
|
||||
|
||||
|
||||
<td id="otherDet<?php echo $index ?>" onkeypress="return isNumber(event);" onkeyup="changeInput(event);"
|
||||
<?php if (empty($record->Key)) {
|
||||
<?php if ($record->is_payslip_generated == 0) {
|
||||
echo "contenteditable='true';";
|
||||
} ?>
|
||||
<?php if (!empty($record->Key)) { ?> title="Payslip Calculated"
|
||||
<?php if ($record->is_payslip_generated == 1) { ?> title="Payslip Calculated"
|
||||
style="text-align:right;color:blue;"
|
||||
<?php } else { ?>style="text-align:right;" <?php } ?>>
|
||||
|
||||
@ -426,10 +426,10 @@
|
||||
|
||||
<td id="Festival<?php echo $index ?>" onkeypress="return isNumber(event);"
|
||||
onkeyup="changeInput(event);"
|
||||
<?php if (empty($record->Key)) {
|
||||
<?php if ($record->is_payslip_generated == 0) {
|
||||
echo "contenteditable='true';";
|
||||
} ?>
|
||||
<?php if (!empty($record->Key)) { ?> title="Payslip Calculated"
|
||||
<?php if ($record->is_payslip_generated == 1) { ?> title="Payslip Calculated"
|
||||
style="text-align:right;color:blue;"
|
||||
<?php } else { ?>style="text-align:right;" <?php } ?>>
|
||||
<?php if (!empty($record->Festival_Bonus)) {
|
||||
@ -443,10 +443,10 @@
|
||||
<?php $totalfestival[] = isset($Festival_Bonus) ? $Festival_Bonus : []; ?>
|
||||
|
||||
<td id="empsal<?php echo $index ?>"
|
||||
<?php if (empty($record->Key)) {
|
||||
<?php if ($record->is_payslip_generated == 1) {
|
||||
echo "contenteditable='false';";
|
||||
} ?>
|
||||
<?php if (!empty($record->Key)) { ?> title="Payslip Calculated"
|
||||
<?php if ($record->is_payslip_generated == 1) { ?> title="Payslip Calculated"
|
||||
style="text-align:right;color:blue;" <?php }else{ ?>style="text-align:right;" <?php } ?>>
|
||||
<?php if (!empty($record->Estimate)) {
|
||||
echo $record->Estimate;
|
||||
|
||||
@ -112,6 +112,7 @@ $monthsoptions = array("01" => "Jan", "02" => "Feb", "03" => "Mar", "04" => "Apr
|
||||
type: "POST",
|
||||
url: "<?php echo base_url(); ?>"+result['path'],
|
||||
success: function(result) {
|
||||
console.log(result);
|
||||
$('form#PayslipGenerator').submit();
|
||||
$('#loader').hide();
|
||||
alert("Salary Calculated Successfully..!");
|
||||
|
||||
@ -338,16 +338,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body" style="margin-top: 23px;">
|
||||
<div class="col-md-4">
|
||||
<button type="button" class="btn btn-primary btn-sm a1" onclick="appendFilesFileds()" id="day">
|
||||
Add New File
|
||||
</button>
|
||||
</div>
|
||||
<div id="filesContainer">
|
||||
<!-- Rows will be dynamically appended here -->
|
||||
</div>
|
||||
|
||||
<?php if (isset($invoice_data)) {
|
||||
<?php if (isset($invoice_data)) {
|
||||
foreach ($invoice_data as $key => $value) { ?>
|
||||
|
||||
<div class="row pad ">
|
||||
@ -372,6 +363,16 @@
|
||||
|
||||
<?php }
|
||||
} ?>
|
||||
<div class="col-md-4">
|
||||
<button type="button" class="btn btn-primary btn-sm a1" onclick="appendFilesFileds()" id="day">
|
||||
Add New File
|
||||
</button>
|
||||
</div>
|
||||
<div id="filesContainer">
|
||||
<!-- Rows will be dynamically appended here -->
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
@ -631,19 +632,36 @@ $(document).ready(function () {
|
||||
var invoiceId = $('#invoice_id_set').val();
|
||||
formData.append('invoice_id', invoiceId);
|
||||
|
||||
var hasFiles = false;
|
||||
// Append files
|
||||
$('input[name="emp_file[]"]').each(function(index, input) {
|
||||
var files = $(input)[0].files;
|
||||
if (files.length > 0) {
|
||||
formData.append('emp_file[]', files[0]);
|
||||
hasFiles = true; // At least one file is selected
|
||||
}
|
||||
});
|
||||
if (!hasFiles) {
|
||||
alert('Please select file.');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var hasFileName = true;
|
||||
// Append other fields
|
||||
$('input[name="file_name[]"]').each(function(index, input) {
|
||||
var fileName = $(input).val().trim();
|
||||
if (!fileName) {
|
||||
hasFileName = false;
|
||||
}
|
||||
formData.append('file_name[]', $(input).val());
|
||||
});
|
||||
|
||||
if (!hasFileName) {
|
||||
alert('Please enter a file name for selected files.');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1186,7 +1186,7 @@ $('#drierTable tbody').on('click', '.edit-btn', function() {
|
||||
console.log('working here', 'totalHours', totalHours);
|
||||
|
||||
if (totalHours != NaN && totalHours != Infinity) {
|
||||
$('#additionalEntryRunningHrsId').val(totalHours);
|
||||
$('#editEntryRunningHrsId').val(totalHours);
|
||||
editEntryGasPerTon();
|
||||
editEntryMoistureLossQty();
|
||||
editEntryQtyPerHrs();
|
||||
|
||||
@ -598,6 +598,7 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
//one of the type in empty space character list is 10
|
||||
if (typeof input === 'string' && input.split('').map(char => char.charCodeAt(0))[0] == 10) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -366,7 +366,7 @@
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Moisture loss Qty</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Sieve Loss Qty</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Salable Qty</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px; min-width : 200px; max-width:200px;">Remark</th>
|
||||
<th class="celda_encabezado_general" style="display:none; ">Remark</th>
|
||||
<th class="celda_encabezado_general" style="display:none;">MaterialCode</th>
|
||||
<th class="celda_encabezado_general" style="display:none">id</th>
|
||||
<th class="celda_encabezado_general" style="display:none">testedBy</th>
|
||||
@ -595,20 +595,19 @@
|
||||
<!-- need to check the status and select values before hand -->
|
||||
|
||||
<!-- 'td:eq(33)' -->
|
||||
<td class="celda_normal" style="color:#02d0eb; background:white; min-width : 200px; max-width:200px;" contenteditable="true">
|
||||
<select class="status sand-status select2" style=" min-width : 180px; max-width:180px;">
|
||||
<option value="noRemark">Select</option>
|
||||
<option value="accepted"
|
||||
<?php echo ($record['remark'] == 'accepted') ? "selected":''; ?>
|
||||
>Accepted</option>
|
||||
<option value="conditionallyAccepted"
|
||||
<?php echo ($record['remark'] == 'conditionallyAccepted') ? "selected":''; ?>
|
||||
>Conditionally Accepted</option>
|
||||
<option value="rejected"
|
||||
<?php echo ($record['remark'] == 'rejected') ? "selected":''; ?>
|
||||
>Rejected</option>
|
||||
</select>
|
||||
|
||||
<td class="celda_normal" style="display:none;" >
|
||||
<select class="status sand-status select2" style=" min-width : 180px; max-width:180px;">
|
||||
<option value="noRemark">Select</option>
|
||||
<option value="accepted"
|
||||
<?php echo ($record['remark'] == 'accepted') ? "selected":''; ?>
|
||||
>Accepted</option>
|
||||
<option value="conditionallyAccepted"
|
||||
<?php echo ($record['remark'] == 'conditionallyAccepted') ? "selected":''; ?>
|
||||
>Conditionally Accepted</option>
|
||||
<option value="rejected"
|
||||
<?php echo ($record['remark'] == 'rejected') ? "selected":''; ?>
|
||||
>Rejected</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(34)' -->
|
||||
@ -1053,7 +1052,9 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<b><small> * This is a system generated </small></b>
|
||||
<b><small> * This is a system generated </small></b>
|
||||
<br>
|
||||
<b><small id="reportNotice"> </small></b>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@ -1091,6 +1092,16 @@
|
||||
<input type="hidden" name="reportTime" id="reportTime" value="">
|
||||
|
||||
<div class="modal-footer">
|
||||
|
||||
<span style="min-width: 150px; max-width: 150px;">
|
||||
<select class="form-control select2" name="remark" id="remarkInFormId" required>
|
||||
<option value="">select</option>
|
||||
<option value="noRemark">No Remark</option>
|
||||
<option value="accepted" >Accepted</option>
|
||||
<option value="conditionallyAccepted" >Conditionally Accepted</option>
|
||||
<option value="rejected" >Rejected</option>
|
||||
</select>
|
||||
</span>
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" id="labReportSubmitId" class="btn btn-success" >Save</button>
|
||||
<button type="button" id="pdfGenerateId" class="btn btn-primary">Download</button>
|
||||
@ -1274,11 +1285,11 @@
|
||||
|
||||
|
||||
if(remark == "accepted"){
|
||||
$('#dwnldAcceptedId').text("Ok");
|
||||
$('#dwnldAcceptedId').text("Yes");
|
||||
}else if(remark == "conditionallyAccepted"){
|
||||
$('#dwnldAcceptedUnderDeviationId').text("Ok");
|
||||
$('#dwnldAcceptedUnderDeviationId').text("Yes");
|
||||
}else if(remark == "rejected"){
|
||||
$('#dwnldRejectedId').text("Ok");
|
||||
$('#dwnldRejectedId').text("Yes");
|
||||
}
|
||||
|
||||
|
||||
@ -1314,6 +1325,7 @@
|
||||
$('#reportComments').val(reportComments);
|
||||
$('#gradeRange').val(gradeRange);
|
||||
$('#reportTime').val(reportTime);
|
||||
$('#remarkInFormId').val(remark);
|
||||
|
||||
|
||||
|
||||
@ -1395,14 +1407,10 @@
|
||||
|
||||
|
||||
|
||||
<!-- Save All Data in Incoming Silica Sand Details -->
|
||||
<!-- Save All Data in Incoming Silica Sand Details from table -->
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
|
||||
|
||||
$('#save').click(function() {
|
||||
|
||||
var incomingSilicaSandDetailsData = $("#incomingSilicaSandDetailsTable").tableToJSON();
|
||||
@ -1563,19 +1571,22 @@
|
||||
|
||||
<!-- adding select 2 -->
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
$('#remarkSelectId').select2({
|
||||
placeholder: "Select",
|
||||
data: [
|
||||
{ id: 'accepted', text: 'Accepted' },
|
||||
{ id: 'conditionallyAccepted', text: 'Accepted Under Deviation' },
|
||||
{ id: 'rejected', text: 'Rejected' }
|
||||
]
|
||||
});
|
||||
|
||||
$('.test-or-approve' ).select2({
|
||||
placeholder: "Select",
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@ -1612,7 +1623,7 @@ $(document).ready(function() {
|
||||
plus30Loss : $('#plus30Loss').val(),
|
||||
sieveLossQty : $('#sieveLossQty').val(),
|
||||
salableQty : $('#salableQty').val(),
|
||||
remark : $('#dwnldAcceptedId').text(),
|
||||
remark : $('#remarkInFormId').val(),
|
||||
gradeCondition : $('#dwnldGradeId').text(),
|
||||
testedBy : $('#testedById').val(),
|
||||
approvedBy : $('#approvedById').val(),
|
||||
@ -1668,9 +1679,8 @@ $(document).ready(function() {
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<!-- excel export option -->
|
||||
<script>
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
function exportTableToExcel(tableID, filename = '') {
|
||||
@ -1731,11 +1741,9 @@ $(document).ready(function() {
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!-- on enter key press allowing user to go next line instead of submitting any form here -->
|
||||
<script>
|
||||
document.addEventListener("keydown", function (event) {
|
||||
|
||||
@ -1774,6 +1782,7 @@ $(document).ready(function() {
|
||||
|
||||
</script>
|
||||
|
||||
<!-- fixing pasting of xcel values inside the table to prevent table element breakage -->
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("resultTableId td ,#basicDetailsTableId td, #meshTableId td, #incomingSilicaSandDetailsTable td").on("paste", function (e) {
|
||||
@ -1798,4 +1807,29 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<!-- remark onchange -->
|
||||
<script>
|
||||
$('#remarkInFormId').change(function(){
|
||||
|
||||
let remark = $(this).val();
|
||||
|
||||
$('#dwnldAcceptedId').text("");
|
||||
$('#dwnldAcceptedUnderDeviationId').text("");
|
||||
$('#dwnldRejectedId').text("");
|
||||
|
||||
if(remark == "accepted"){
|
||||
$('#dwnldAcceptedId').text("Yes");
|
||||
}else if(remark == "conditionallyAccepted"){
|
||||
$('#dwnldAcceptedUnderDeviationId').text("Yes");
|
||||
}else if(remark == "rejected"){
|
||||
$('#dwnldRejectedId').text("Yes");
|
||||
}
|
||||
|
||||
//without saving current change , cannot download the pdf
|
||||
$('#pdfGenerateId').css('display', 'none');
|
||||
$('#reportNotice').text("* Please save the changes to download");
|
||||
|
||||
})
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user