Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme

This commit is contained in:
Gowtham M 2025-03-06 17:36:10 +05:30
commit dd3a61beb3
83 changed files with 7715 additions and 5003 deletions

View File

@ -43,9 +43,9 @@ $routes->get('user/deleteUser', 'User::deleteUser');
$routes->get('user/reActivateUser', 'User::reActivateUser'); $routes->get('user/reActivateUser', 'User::reActivateUser');
// Supplier Routes // Supplier Routes
$routes->get('supplierlisting', 'Supplier::index'); // list supplier $routes->match(["GET","POST"],'supplierlisting', 'Supplier::index'); // list supplier
$routes->add('addsupplier', 'Supplier::addsupplier');//load add supplier page $routes->add('addsupplier', 'Supplier::addsupplier');//load add supplier page
$routes->get('viewsupplier', 'Supplier::viewsupplier');// load edit supplier page $routes->get('viewsupplier', 'Supplier::viewsupplier');
$routes->post('editsupplier', 'Supplier::updatesupplierdetails'); //save supplier details $routes->post('editsupplier', 'Supplier::updatesupplierdetails'); //save supplier details
$routes->post('addNewsupplier', 'Supplier::savesupplierdetails'); // update supplier details $routes->post('addNewsupplier', 'Supplier::savesupplierdetails'); // update supplier details
$routes->post('supplierExist', 'Supplier::checksupplier'); $routes->post('supplierExist', 'Supplier::checksupplier');
@ -68,7 +68,7 @@ $routes->post('deleteMaterial', 'Rawmaterialdetails::deleteMaterial');
$routes->post('reActivateMaterial', 'Rawmaterialdetails::reActivateMaterial'); $routes->post('reActivateMaterial', 'Rawmaterialdetails::reActivateMaterial');
// Cost Center Routes // Cost Center Routes
$routes->get('costListing', 'CostCenter::index'); $routes->match(['GET','POST'],'costListing', 'CostCenter::index');
$routes->post('fetchCostCenterDetails', 'CostCenter::fetchCostCenterDetails');// for Ajax both add and edit.... $routes->post('fetchCostCenterDetails', 'CostCenter::fetchCostCenterDetails');// for Ajax both add and edit....
$routes->get('reActivateCostCenter', 'CostCenter::reActivateCostCenter'); $routes->get('reActivateCostCenter', 'CostCenter::reActivateCostCenter');
$routes->get('deleteCostCenter', 'CostCenter::deleteCostCenter'); $routes->get('deleteCostCenter', 'CostCenter::deleteCostCenter');
@ -98,7 +98,7 @@ $routes->post('getDriver', 'Driver::getDriver');
$routes->match(['GET', 'POST', 'PUT', 'DELETE'], 'driverPrintPdf', 'Driver::driverPrintPdf'); $routes->match(['GET', 'POST', 'PUT', 'DELETE'], 'driverPrintPdf', 'Driver::driverPrintPdf');
// Asset Detail Routes // Asset Detail Routes
$routes->get('assetListing', 'Assetdetails::assetListing'); $routes->match(['GET','POST'],'assetListing', 'Assetdetails::assetListing');
$routes->get('addasset', 'Assetdetails::addasset'); $routes->get('addasset', 'Assetdetails::addasset');
$routes->post('assetdetails/getpodetails', 'Assetdetails::getpodetails'); $routes->post('assetdetails/getpodetails', 'Assetdetails::getpodetails');
$routes->post('assetdetails/getline', 'Assetdetails::getline'); $routes->post('assetdetails/getline', 'Assetdetails::getline');
@ -153,7 +153,7 @@ $routes->get('configurationctrl/deleteConfig', 'Configurationctrl::deleteConfig'
$routes->get('configurationctrl/reActivateConfig', 'Configurationctrl::reActivateConfig'); $routes->get('configurationctrl/reActivateConfig', 'Configurationctrl::reActivateConfig');
// Department Master Routes // Department Master Routes
$routes->get('departmentListing', 'Department::index'); $routes->match(["GET","POST"],'departmentListing', 'Department::index');
$routes->get('adddepartment', 'Department::adddepartment'); $routes->get('adddepartment', 'Department::adddepartment');
$routes->post('savedepartment', 'Department::savedepartment'); $routes->post('savedepartment', 'Department::savedepartment');
$routes->get('editOlddepartment', 'Department::viewdepartment'); $routes->get('editOlddepartment', 'Department::viewdepartment');
@ -297,10 +297,10 @@ $routes->match(['GET', 'POST', 'PUT', 'DELETE'], 'storerequisitionlisting', 'Sto
$routes->match(['GET', 'POST', 'PUT', 'DELETE'], 'EditStoreRequisition', 'Storerequisitioncontroller::EditStoreRequistion'); $routes->match(['GET', 'POST', 'PUT', 'DELETE'], 'EditStoreRequisition', 'Storerequisitioncontroller::EditStoreRequistion');
// Application IGR Routes // Application IGR Routes
$routes->get('AddIGR', 'Inwardgateregister::addIGR'); // ADD IGR page - working $routes->get( 'AddIGR', 'Inwardgateregister::addIGR'); // ADD IGR page - working
$routes->get('ViewIGR', 'Inwardgateregister::viewIGR'); // View IGR PAGE - Working $routes->get( 'ViewIGR', 'Inwardgateregister::viewIGR'); // View IGR PAGE - Working
$routes->post('ViewIGR', 'Inwardgateregister::viewIGR');//for filter purpose $routes->post('ViewIGR', 'Inwardgateregister::viewIGR');//for filter purpose
$routes->get('accountsDashboard', 'Inwardgateregister::accountsDashboard'); // View IGR PAGE - Working $routes->get( 'accountsDashboard', 'Inwardgateregister::accountsDashboard'); // View IGR PAGE - Working
$routes->post('ViewIGRDetails', 'Inwardgateregister::viewIGRDetails'); $routes->post('ViewIGRDetails', 'Inwardgateregister::viewIGRDetails');
$routes->post('GetIGRLineItemDetails', 'Inwardgateregister::getIGRLineItemDetails'); $routes->post('GetIGRLineItemDetails', 'Inwardgateregister::getIGRLineItemDetails');
$routes->post('SaveIGR', 'Inwardgateregister::SaveIGR');// Save IGR PAGE - Working $routes->post('SaveIGR', 'Inwardgateregister::SaveIGR');// Save IGR PAGE - Working
@ -311,10 +311,13 @@ $routes->post('getCostCenterData', 'Inwardgateregister::getCostCenterData');
$routes->post('ViewIGRfile', 'Inwardgateregister::ViewIGRfile'); $routes->post('ViewIGRfile', 'Inwardgateregister::ViewIGRfile');
$routes->post('getAdditionalIGRFile', 'Inwardgateregister::getAdditionalIGRFile'); $routes->post('getAdditionalIGRFile', 'Inwardgateregister::getAdditionalIGRFile');
$routes->post('deleteAdditionalIGRFile', 'Inwardgateregister::deleteAdditionalIGRFile'); $routes->post('deleteAdditionalIGRFile', 'Inwardgateregister::deleteAdditionalIGRFile');
$routes->get('download-files/(:segment)', 'Inwardgateregister::downloadFilesAsZip/$1'); $routes->get( 'download-files/(:segment)', 'Inwardgateregister::downloadFilesAsZip/$1');
$routes->post('inwardgateregister/edituploadfile', 'Inwardgateregister::edituploadfile'); $routes->post('inwardgateregister/edituploadfile', 'Inwardgateregister::edituploadfile');
$routes->post('getIGRRemarks', 'Inwardgateregister::getIGRRemarks'); $routes->post('getIGRRemarks', 'Inwardgateregister::getIGRRemarks');
$routes->post('saveIGRRemarks', 'Inwardgateregister::saveIGRRemarks'); $routes->post('saveIGRRemarks', 'Inwardgateregister::saveIGRRemarks');
$routes->post('updateGasShortage','Inwardgateregister::updateGasShortage');
$routes->post('gasShortageList','Inwardgateregister::gasShortageList');
$routes->post('getGasShortageDetail',"Inwardgateregister::getGasShortageDetail");
// Non IGR / Expense // Non IGR / Expense
@ -442,7 +445,7 @@ $routes->match(['GET', 'POST'], 'sales_report', 'Sales::sales_report');
$routes->match(['GET', 'POST'],'credit_notes', 'Sales::credit_notes'); $routes->match(['GET', 'POST'],'credit_notes', 'Sales::credit_notes');
// transporter Routes // transporter Routes
$routes->get('transporterListing', 'Supplier::transporterListing'); $routes->match(['GET', 'POST'],'transporterListing', 'Supplier::transporterListing');
$routes->post('fetchTransporterDetails', 'Supplier::fetchTransporterDetails');// for Ajax both add and edit.... $routes->post('fetchTransporterDetails', 'Supplier::fetchTransporterDetails');// for Ajax both add and edit....
$routes->get('deleteTransporter', 'Supplier::deleteTransporter'); $routes->get('deleteTransporter', 'Supplier::deleteTransporter');
$routes->get('reActivateTransporter', 'Supplier::reActivateTransporter'); $routes->get('reActivateTransporter', 'Supplier::reActivateTransporter');
@ -452,6 +455,7 @@ $routes->post('checkTransporter', 'Supplier::checkTransporter');
$routes->post('createFactoryMachineMasterDetails', 'FactoryMachineController::createFactoryMachineMasterDetails'); $routes->post('createFactoryMachineMasterDetails', 'FactoryMachineController::createFactoryMachineMasterDetails');
$routes->get('readFactoryMachineMasterDetails', 'FactoryMachineController::readFactoryMachineMasterDetails'); $routes->get('readFactoryMachineMasterDetails', 'FactoryMachineController::readFactoryMachineMasterDetails');
$routes->post('readFactoryMachineMasterDetails', 'FactoryMachineController::readFactoryMachineMasterDetails');
$routes->get('readFactoryMachineMasterDetailsById', 'FactoryMachineController::readFactoryMachineMasterDetailsById'); $routes->get('readFactoryMachineMasterDetailsById', 'FactoryMachineController::readFactoryMachineMasterDetailsById');
$routes->post('updateFactoryMachineMasterDetails', 'FactoryMachineController::updateFactoryMachineMasterDetails'); $routes->post('updateFactoryMachineMasterDetails', 'FactoryMachineController::updateFactoryMachineMasterDetails');
$routes->get('deleteFactoryMachineMasterDetails', 'FactoryMachineController::deleteFactoryMachineMasterDetails'); $routes->get('deleteFactoryMachineMasterDetails', 'FactoryMachineController::deleteFactoryMachineMasterDetails');
@ -517,5 +521,7 @@ $routes->post('updateTrpSandUseStockDetails', 'StockController::updateTrpSandUse
//trp production stock details //trp production stock details
$routes->match(['GET', 'POST'], 'trpProductionDetails', 'StockController::trpProductionDetails'); $routes->match(['GET', 'POST'], 'trpProductionDetails', 'StockController::trpProductionDetails');
$routes->post('updateTrpProductionDetails', 'StockController::updateTrpProductionDetails'); $routes->post('updateTrpProductionDetails', 'StockController::updateTrpProductionDetails');
//trp abstract
$routes->post('updateAbstractDetails','StockController::updateAbstractDetails');

View File

@ -50,9 +50,22 @@ class Assetdetails extends BaseController
*/ */
function assetListing() function assetListing()
{ {
$isActiveFilter = 1 ; // default showing active data
$showArchive = 0 ; //
if ($this->request->getMethod() === 'POST') {
$showArchive = $this->request->getPost('showArchive');
//reversing condition that when user wants deleted data to be shown then we are making active filter 0
if($showArchive){
$isActiveFilter = 0;
}
}
$data['showArchive'] = $showArchive;
$data['userRecords'] = $this->assetdetails_model->assetListing(); $data['userRecords'] = $this->assetdetails_model->assetListing($isActiveFilter);
$this->global['pageTitle'] = 'Asset List'; $this->global['pageTitle'] = 'Asset List';
//print_r($data);die(); //print_r($data);die();

View File

@ -45,7 +45,21 @@ class CostCenter extends BaseController
*/ */
public function index() public function index()
{ {
$data['userRecords'] = $this->costcenter_model->CostListing();
$isActiveFilter = 1 ; // default showing active data
$showArchive = 0 ; //
if ($this->request->getMethod() === 'POST') {
$showArchive = $this->request->getPost('showArchive');
//reversing condition that when user wants deleted data to be shown we are making active filter
if($showArchive){
$isActiveFilter = 0;
}
}
$data['showArchive'] = $showArchive;
$data['userRecords'] = $this->costcenter_model->CostListing($isActiveFilter);
$this->global['pageTitle'] = 'Cost List'; $this->global['pageTitle'] = 'Cost List';
$this->loadViews("costListing", $this->global, $data, NULL); $this->loadViews("costListing", $this->global, $data, NULL);

View File

@ -48,20 +48,25 @@ class Department extends BaseController
public function index() public function index()
{ {
// if($this->isAdmin() == TRUE)
// { $isActiveFilter = 1 ; // default showing active data
// $this->loadThis(); $showArchive = 0 ; //
// }
// else if ($this->request->getMethod() === 'POST') {
// {
$showArchive = $this->request->getPost('showArchive');
//reversing condition that when user wants deleted data to be shown then we are making active filter 0
if($showArchive){
$isActiveFilter = 0;
}
}
$data['showArchive'] = $showArchive;
$this->department_model = new department_model(); $this->department_model = new department_model();
//$searchText = $this->request->getPost('searchText'); $data['userRecords'] = $this->department_model->departmentListing($isActiveFilter); //$searchText, $returns["page"], $returns["segment"]);
//$data['searchText'] = $searchText;
//$count = $this->department_model->departmentListing($searchText);
//$returns = $this->paginationCompress ( "departmentListing/", $count, 20 );
$data['userRecords'] = $this->department_model->departmentListing(); //$searchText, $returns["page"], $returns["segment"]);
$this->global['pageTitle'] = 'Department Listing'; $this->global['pageTitle'] = 'Department Listing';

View File

@ -125,7 +125,7 @@ class Emergencypurchaseorder extends BaseController
// print_r($this->request->getPost());die; // print_r($this->request->getPost());die;
$txtRowCount = $this->request->getPost('txtRowCount'); $txtRowCount = $this->request->getPost('txtRowCount');
$POdt = $this->request->getPost('PODate'); $POdt = $this->request->getPost('PODate');
$PODate = get_date_time_format($POdt); $PODate = get_date_time_dynamical_format('d-m-Y','Y-m-d',"$POdt");
$SupplierID = $this->request->getPost('drpSupplier'); $SupplierID = $this->request->getPost('drpSupplier');
$DeliveryAddr = $this->request->getPost('DeliveryAddr'); $DeliveryAddr = $this->request->getPost('DeliveryAddr');
$CostCenterName = $this->request->getPost('CostCenterName'); $CostCenterName = $this->request->getPost('CostCenterName');
@ -369,7 +369,7 @@ class Emergencypurchaseorder extends BaseController
$POdt = $this->request->getPost('PODate'); $POdt = $this->request->getPost('PODate');
$PODate = get_date_time_format($POdt); $PODate = get_date_time_dynamical_format('d-m-Y','Y-m-d',"$POdt");
$SupplierID = $this->request->getPost('drpSupplier'); $SupplierID = $this->request->getPost('drpSupplier');
$DeliveryAddr = $this->request->getPost('DeliveryAddr'); $DeliveryAddr = $this->request->getPost('DeliveryAddr');
$dt = $this->request->getPost('Deliverydt'); $dt = $this->request->getPost('Deliverydt');

View File

@ -26,6 +26,8 @@ class Expense extends BaseController
public function index() public function index()
{ {
$isActiveFilter = 1 ;
if ($this->request->getMethod() === 'GET') if ($this->request->getMethod() === 'GET')
{ {
$toDate = date('Y-m-d'); $toDate = date('Y-m-d');
@ -38,7 +40,7 @@ class Expense extends BaseController
} }
$data['expense_list'] = $this->expense_model->getAllExpense($fromDate,$toDate); $data['expense_list'] = $this->expense_model->getAllExpense($fromDate,$toDate);
$data['supplier_list'] = json_encode($this->supplier_model->supplierlisting()); $data['supplier_list'] = json_encode($this->supplier_model->supplierlisting($isActiveFilter));
$this->global['pageTitle'] = 'Non IGR / Expense List'; $this->global['pageTitle'] = 'Non IGR / Expense List';
$data['fromDate'] = date('d-m-Y', strtotime($fromDate)); $data['fromDate'] = date('d-m-Y', strtotime($fromDate));
$data['toDate'] = date('d-m-Y', strtotime($toDate)); $data['toDate'] = date('d-m-Y', strtotime($toDate));

View File

@ -80,9 +80,25 @@ class FactoryMachineController extends BaseController
public function readFactoryMachineMasterDetails(){ public function readFactoryMachineMasterDetails(){
$isActiveFilter = 1 ; // default showing active data
$showArchive = 0 ; //
if ($this->request->getMethod() === 'POST') {
$showArchive = $this->request->getPost('showArchive');
//reversing condition that when user wants deleted data to be shown then we are making active filter 0
if($showArchive){
$isActiveFilter = 0;
}
}
$data['showArchive'] = $showArchive;
$this->global['pageTitle'] = 'Factory Machine Master Details'; $this->global['pageTitle'] = 'Factory Machine Master Details';
$data['masterData'] = $this->factoryMachineMaster_model $data['masterData'] = $this->factoryMachineMaster_model
->where('is_active',$isActiveFilter)
->orderBy('created_at','DESC') ->orderBy('created_at','DESC')
->findAll(); ->findAll();

View File

@ -8,6 +8,7 @@ use CodeIgniter\Validation\Exceptions\ValidationException;
use App\Models\Inwardgateregister_model; use App\Models\Inwardgateregister_model;
use App\Models\IGRRemarks_model; use App\Models\IGRRemarks_model;
use App\Models\GasShortageModel;
use App\Helpers\Notification; use App\Helpers\Notification;
use DateTime; use DateTime;
@ -25,6 +26,7 @@ class Inwardgateregister extends BaseController
{ {
protected $inwardgateregister_model; protected $inwardgateregister_model;
protected $IGRRemarks_model; protected $IGRRemarks_model;
protected $gasShortage_model;
protected $session; protected $session;
protected $logger; protected $logger;
@ -37,6 +39,7 @@ class Inwardgateregister extends BaseController
parent::__construct(); parent::__construct();
$this->inwardgateregister_model = new Inwardgateregister_model(); $this->inwardgateregister_model = new Inwardgateregister_model();
$this->IGRRemarks_model = new IGRRemarks_model(); $this->IGRRemarks_model = new IGRRemarks_model();
$this->gasShortage_model = new GasShortageModel();
$this->session = session(); $this->session = session();
helper('form'); //$this->load->library('form_validation'); helper('form'); //$this->load->library('form_validation');
@ -688,6 +691,7 @@ function viewIGRDetails()
$IGRNO = $this->request->getPost('id'); $IGRNO = $this->request->getPost('id');
$data['details'] = $this->inwardgateregister_model->viewigr($IGRNO); $data['details'] = $this->inwardgateregister_model->viewigr($IGRNO);
$TaxInPercentage = 0; $TaxInPercentage = 0;
for ($i = 0; $i < count($data['details']); $i++) { for ($i = 0; $i < count($data['details']); $i++) {
$details = $data['details'][$i]; $details = $data['details'][$i];
@ -1474,4 +1478,62 @@ function updateIGRWeight(){
} }
} }
public function gasShortageList(){
$postData = $this->request->getPost();
$allShortages = $this->gasShortage_model->where('invoiceNo',$postData['invoiceNo'])->findAll();
return $this->response->setJSON(['status' => 'success', 'data' => $allShortages]);
}
public function getGasShortageDetail(){
$postData = $this->request->getPost();
$shortage = $this->gasShortage_model->where('id',$postData['id'])->find();
return $this->response->setJSON(['status' => 'success', 'data' => $shortage]);
}
public function updateGasShortage()
{
$postData = $this->request->getPost();
// Validate required data
if (!$postData) {
return $this->response->setJSON(['status' => 'error', 'message' => 'Invalid request. No data received.']);
}
// Validate required fields for adding
if ( !isset($postData['invoiceNo']) ) {
return $this->response->setJSON(['status' => 'error', 'message' => 'Missing required fields: invoice No.']);
}
// Handle update (edit)
if (isset($postData["id"])) {
return $this->gasShortage_model->update($postData["id"], $postData)
? $this->response->setJSON(['status' => 'success', 'message' => 'Gas shortage details updated successfully.'])
: $this->response->setJSON(['status' => 'error', 'message' => 'Failed to update gas shortage details.']);
}
// Insert new shortage (add)
return ($insertId = $this->gasShortage_model->insert($postData))
? $this->response->setJSON(['status' => 'success', 'message' => 'Gas shortage details added successfully.', 'data' => ['id' => $insertId]])
: $this->response->setJSON(['status' => 'error', 'message' => 'Failed to save gas shortage details.']);
}
} }

View File

@ -801,10 +801,10 @@ class Payslip extends BaseController
$loan = $Balance_Amount; $loan = $Balance_Amount;
} }
$empSalaryAdd = $final_salary_amount+$shed+$diesel; $empSalaryAdd = $final_salary_amount;
$empSalarySub = $loan; $empSalarySub = $loan;
$salaryInCurrentday = $empSalaryAdd - $empSalarySub; // $salaryInCurrentday = $empSalaryAdd - $empSalarySub;
$load_driver_data[$i]->driver_final_payment = $salaryInCurrentday; // $load_driver_data[$i]->driver_final_payment = $salaryInCurrentday;
$load_driver_data[$i]->payroll_id = $monthly_pay_array[$driver_id]->payroll_id; $load_driver_data[$i]->payroll_id = $monthly_pay_array[$driver_id]->payroll_id;
$load_driver_data[$i]->Festival_Bonus = $monthly_pay_array[$driver_id]->Festival_Bonus; $load_driver_data[$i]->Festival_Bonus = $monthly_pay_array[$driver_id]->Festival_Bonus;
@ -871,8 +871,8 @@ class Payslip extends BaseController
$empSalaryAdd = $final_salary_amount; $empSalaryAdd = $final_salary_amount;
$empSalarySub = $loan; $empSalarySub = $loan;
$salaryInCurrentday = $empSalaryAdd - $empSalarySub; // $salaryInCurrentday = $empSalaryAdd - $empSalarySub;
$load_driver_data[$i]->driver_final_payment = $salaryInCurrentday+$shed+$diesel; // $load_driver_data[$i]->driver_final_payment = $salaryInCurrentday+$shed+$diesel;
$load_driver_data[$i]->total_cal_days = $get_last_date_of_the_month; $load_driver_data[$i]->total_cal_days = $get_last_date_of_the_month;
} }
@ -1168,6 +1168,7 @@ class Payslip extends BaseController
$EmpID = $j['Emp ID']; $EmpID = $j['Emp ID'];
$is_driver = $this->driver_model->getDriverName($EmpID,1); $is_driver = $this->driver_model->getDriverName($EmpID,1);
$DaysWorked = $j['Days Worked']; $DaysWorked = $j['Days Worked'];
$NoTrips = isset($j['Number Of Trips']) ? $j['Number Of Trips'] : 0.00 ;
$TotalCalDays = isset($j['Total Days']) ? $j['Total Days'] : 0.00 ; $TotalCalDays = isset($j['Total Days']) ? $j['Total Days'] : 0.00 ;
$ActualSalary = isset($j['Basic Salary']) ? $j['Basic Salary'] : 0.00 ; $ActualSalary = isset($j['Basic Salary']) ? $j['Basic Salary'] : 0.00 ;
$WorkedSalary = isset($j['Worked Salary']) ? $j['Worked Salary'] : 0.00 ; $WorkedSalary = isset($j['Worked Salary']) ? $j['Worked Salary'] : 0.00 ;
@ -1228,12 +1229,14 @@ class Payslip extends BaseController
$drivermonthlypaydata = array( $drivermonthlypaydata = array(
'month_year'=>$month, 'month_year'=>$month,
'driver_id'=>$EmpID, 'driver_id'=>$EmpID,
'no_of_loads'=>(strpos($TotalCalDays, "(trip)") !== false) ? explode(" ", $TotalCalDays)[0] : 0, 'TotalCalDays' => $TotalCalDays,
'no_of_loads'=>(strpos($NoTrips, "(trip)") !== false) ? explode(" ", $NoTrips)[0] : 0,
'monthly_food_amount'=>$Food, 'monthly_food_amount'=>$Food,
'total_diesel_amount'=>$Diesel, 'total_diesel_amount'=>$Diesel,
'total_shed_amount'=>$Shed, 'total_shed_amount'=>$Shed,
'monthly_salary_amount'=>($Basic+$Food), 'monthly_salary_amount'=>($Basic+$Food),
'final_payment'=>$Estimate, 'final_payment'=>$Estimate,
'BASIC'=>$Basic,
'HRA'=>$HRA, 'HRA'=>$HRA,
'ESI'=>$ESI, 'ESI'=>$ESI,
'PF'=>$PF, 'PF'=>$PF,
@ -1419,8 +1422,10 @@ class Payslip extends BaseController
$currentDayBasic = isset($Data['PayDetails'][0]->monthly_salary_amount) ? $Data['PayDetails'][0]->monthly_salary_amount : 0; $currentDayBasic = isset($Data['PayDetails'][0]->monthly_salary_amount) ? $Data['PayDetails'][0]->monthly_salary_amount : 0;
$PF_Rate = $Data['PayDetails'][0]->PF_Rate; $PF_Rate = $Data['PayDetails'][0]->PF_Rate;
$ESI_Rate = $Data['PayDetails'][0]->ESI_Rate; $ESI_Rate = $Data['PayDetails'][0]->ESI_Rate;
$Data['esi_amount'] = ($Data['PayDetails'][0]->esi_applicable == 1) ? $currentDayBasic * $ESI_Rate / 100 : 0; // $Data['esi_amount'] = ($Data['PayDetails'][0]->esi_applicable == 1) ? $currentDayBasic * $ESI_Rate / 100 : 0;
$Data['pf_amount'] = ($Data['PayDetails'][0]->pf_applicable == 1) ? $currentDayBasic * $PF_Rate / 100 : 0; // $Data['pf_amount'] = ($Data['PayDetails'][0]->pf_applicable == 1) ? $currentDayBasic * $PF_Rate / 100 : 0;
$Data['esi_amount'] = ($Data['PayDetails'][0]->esi_applicable == 1) ? $Data['PayDetails'][0]->ESI : 0;
$Data['pf_amount'] = ($Data['PayDetails'][0]->pf_applicable == 1) ? $Data['PayDetails'][0]->PF : 0;
$html = view("driverPayslipGeneratePrint", $Data); $html = view("driverPayslipGeneratePrint", $Data);
}else{ }else{
//echo "EmpID" . $EmpID; //echo "EmpID" . $EmpID;

View File

@ -3068,7 +3068,6 @@ class Purchaseorder extends BaseController
$this->purchaseorder_model->insertlogpo($logpo); $this->purchaseorder_model->insertlogpo($logpo);
} }
} }
// print_r($this->request->getPost());die;
for ($i = 1; $i <= $RowCount; $i++) { for ($i = 1; $i <= $RowCount; $i++) {
$MaterialCode = $this->request->getPost('materialCode' . $i); $MaterialCode = $this->request->getPost('materialCode' . $i);

View File

@ -66,9 +66,22 @@ class Rawmaterialdetails extends BaseController
function rawmaterialListing() function rawmaterialListing()
{ {
$this->rawmaterialdetails_model = new rawmaterialdetails_model();; $isActiveFilter = 1 ; // default showing active data
$showArchive = 0 ; //
$data['userRecords'] = $this->rawmaterialdetails_model->rawmaterialListing(); if ($this->request->getMethod() === 'POST') {
$showArchive = $this->request->getPost('showArchive');
//reversing condition that when user wants deleted data to be shown we are making active filter
if($showArchive){
$isActiveFilter = 0;
}
}
$this->rawmaterialdetails_model = new rawmaterialdetails_model();
$data['userRecords'] = $this->rawmaterialdetails_model->rawmaterialListing($isActiveFilter);
$data['showArchive'] = $showArchive ;
$data['materialCategoryList']= $this->materialCategories_model->where('is_active',1)->findAll(); $data['materialCategoryList']= $this->materialCategories_model->where('is_active',1)->findAll();
$this->global['pageTitle'] = 'RawMaterial Listing'; $this->global['pageTitle'] = 'RawMaterial Listing';

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,22 @@ class Supplier extends BaseController
*/ */
public function index() public function index()
{ {
$data['userRecords'] = $this->supplier_model->supplierlisting();
$isActiveFilter = 1 ; // default showing active transporters data
$showArchive = 0 ; //
if ($this->request->getMethod() === 'POST') {
$showArchive = $this->request->getPost('showArchive');
//reversing condition that when user wants deleted data to be shown we are making active filter
if($showArchive){
$isActiveFilter = 0;
}
}
$data['userRecords'] = $this->supplier_model->supplierlisting($isActiveFilter);
$data['showArchive'] = $showArchive ;
$this->global['pageTitle'] = 'Supplier Listing'; $this->global['pageTitle'] = 'Supplier Listing';
$this->loadViews("supplierListing", $this->global, $data, NULL); $this->loadViews("supplierListing", $this->global, $data, NULL);
} }
@ -473,7 +488,20 @@ class Supplier extends BaseController
*/ */
public function transporterListing() public function transporterListing()
{ {
$data['userRecords'] = $this->supplier_model->transporterListing(); $isActiveFilter = 1 ; // default showing active transporters data
$showArchive = 0 ; //
if ($this->request->getMethod() === 'POST') {
$showArchive = $this->request->getPost('showArchive');
//reversing condition that when user wants deleted data to be shown we are making active filter
if($showArchive){
$isActiveFilter = 0;
}
}
$data['userRecords'] = $this->supplier_model->transporterListing($isActiveFilter);
$data['showArchive'] = $showArchive ;
$this->global['pageTitle'] = 'Transporter List'; $this->global['pageTitle'] = 'Transporter List';
$this->loadViews("transporterListing", $this->global, $data, NULL); $this->loadViews("transporterListing", $this->global, $data, NULL);
} }

View File

@ -894,14 +894,26 @@ class User extends BaseController
*/ */
function userListing() function userListing()
{ {
// if($this->isAdmin() == TRUE)
// {
// $this->loadThis();
// }
// else
// {
$data['userRecords'] = $this->user_model->userListing(); $isDeleted = 0 ; // default showing active data
$showArchive = 0 ; //
if ($this->request->getMethod() === 'POST') {
$showArchive = $this->request->getPost('showArchive');
//reversing condition that when user wants deleted data to be shown then we are making active filter 0
if($showArchive){
$isDeleted = 1;
}
}
$data['showArchive'] = $showArchive;
// dd($data);
$data['userRecords'] = $this->user_model->userListing($isDeleted);
$this->global['pageTitle'] = 'User Listing'; $this->global['pageTitle'] = 'User Listing';
// dd($data); // dd($data);

View File

@ -14,12 +14,13 @@ class Assetdetails_model extends Model
* @param number $segment : This is pagination limit * @param number $segment : This is pagination limit
* @return array $result : This is result * @return array $result : This is result
*/ */
function assetListing() function assetListing($isActiveFilter)
{ {
$builder = $this->db->table('t_asset_details asd') $builder = $this->db->table('t_asset_details asd')
->select('asd.*,dep.DepartmentName,sup.SupplierName') ->select('asd.*,dep.DepartmentName,sup.SupplierName')
->join('t_departmentdetails dep', ' dep.DEPCode = asd.DEPCode', 'left') ->join('t_departmentdetails dep', ' dep.DEPCode = asd.DEPCode', 'left')
->join('t_supplierdetailsn sup', 'sup.SupplierID = asd.SupplierCode', 'left') ->join('t_supplierdetailsn sup', 'sup.SupplierID = asd.SupplierCode', 'left')
->where('asd.IsActive',$isActiveFilter)
->orderBy('asd.CreatedDt', 'desc'); ->orderBy('asd.CreatedDt', 'desc');
$query = $builder->get(); $query = $builder->get();

View File

@ -6,7 +6,7 @@ use CodeIgniter\Model;
class CoatingMachineDetailsModel extends Model class CoatingMachineDetailsModel extends Model
{ {
protected $table = 't_coatingMachineDetails'; protected $table = 't_coatingmachinedetails';
protected $primaryKey = 'id'; protected $primaryKey = 'id';
protected $useAutoIncrement = true; protected $useAutoIncrement = true;
protected $returnType = 'array'; protected $returnType = 'array';

View File

@ -13,12 +13,13 @@ class Costcenter_model extends Model
* @param number $segment : This is pagination limit * @param number $segment : This is pagination limit
* @return array $result : This is result * @return array $result : This is result
*/ */
function CostListing() function CostListing($isActiveFilter)
{ {
$builder = $this->db->table('t_costcenter_master as Cost') $builder = $this->db->table('t_costcenter_master as Cost')
->select('Cost.id as id, Cost.CostCenterCode as code,Cost.CostCenterName as CostCenterName , Cost.ApprovedBy as ApprovedBy,Emp.FirstName as FirstName,Emp.Designation as Designation ,Cost.CreatedDate,Cost.IsActive,Cost.DeletedBy,Cost.DeletedBy') ->select('Cost.id as id, Cost.CostCenterCode as code,Cost.CostCenterName as CostCenterName , Cost.ApprovedBy as ApprovedBy,Emp.FirstName as FirstName,Emp.Designation as Designation ,Cost.CreatedDate,Cost.IsActive,Cost.DeletedBy,Cost.DeletedBy')
->join('t_employee_details as Emp', 'Emp.EmpID=Cost.ApprovedBy') ->join('t_employee_details as Emp', 'Emp.EmpID=Cost.ApprovedBy')
->where('Cost.IsActive',$isActiveFilter)
->orderBy('Cost.CreatedDate', 'desc'); ->orderBy('Cost.CreatedDate', 'desc');
$query =$builder->get(); $query =$builder->get();

View File

@ -49,11 +49,13 @@ class Department_model extends Model
* @param number $segment : This is pagination limit * @param number $segment : This is pagination limit
* @return array $result : This is result * @return array $result : This is result
*/ */
function departmentListing() function departmentListing($isActiveFilter)
{ {
$builder = $this->db->table('t_departmentdetails as BaseT') $builder = $this->db->table('t_departmentdetails as BaseT')
->select('BaseT.CreatedDt,BaseT.DepartmentName, BaseT.DEPCode, BaseT.HeadDept, BaseT.IsActive , ->select('BaseT.CreatedDt,BaseT.DepartmentName, BaseT.DEPCode, BaseT.HeadDept, BaseT.IsActive ,
BaseT.HeadDept') BaseT.HeadDept,HeadDept.DepartmentName as headDepartmentName')
->join('t_departmentdetails as HeadDept', 'BaseT.HeadDept = HeadDept.DEPCode' ,'left')
->where('BaseT.IsActive',$isActiveFilter)
->orderBy("BaseT.DEPCode", "desc"); ->orderBy("BaseT.DEPCode", "desc");
$query = $builder->get(); $query = $builder->get();
$result = $query->getResult(); $result = $query->getResult();

View File

@ -6,7 +6,7 @@ use CodeIgniter\Model;
class DrierMachineDetailsModel extends Model class DrierMachineDetailsModel extends Model
{ {
protected $table = 't_drierMachineDetails'; protected $table = 't_driermachinedetails';
protected $primaryKey = 'id'; protected $primaryKey = 'id';
protected $useAutoIncrement = true; protected $useAutoIncrement = true;
protected $returnType = 'array'; protected $returnType = 'array';

View File

@ -285,7 +285,7 @@ class Driver_model extends Model
$builder = $this->db->table('t_driver_payroll Pay')->select('Pay.*') $builder = $this->db->table('t_driver_payroll Pay')->select('Pay.*')
->select('Emp.EmpID,CONCAT_WS(" ", Emp.FirstName, Emp.LastName) as driver_name,Emp.DateofBirth as Dob,Emp.PANNo as Pan,Emp.BankBranchName as BankName,Emp.BankAccountNo as BankAccountNumber,Emp.IFSCCode as IFSCCode,Emp.DateofJoining as DOJ,Emp.AadharNo,Emp.Designation as Designation,Dep.DepartmentName as DeptName,Emp.esi_applicable,Emp.pf_applicable') ->select('Emp.EmpID,CONCAT_WS(" ", Emp.FirstName, Emp.LastName) as driver_name,Emp.DateofBirth as Dob,Emp.PANNo as Pan,Emp.BankBranchName as BankName,Emp.BankAccountNo as BankAccountNumber,Emp.IFSCCode as IFSCCode,Emp.DateofJoining as DOJ,Emp.AadharNo,Emp.Designation as Designation,Dep.DepartmentName as DeptName,Emp.esi_applicable,Emp.pf_applicable')
->select('t_emp_pay_data.PF_Rate,t_emp_pay_data.ESI_Rate') ->select('t_emp_pay_data.PF_Rate,t_emp_pay_data.ESI_Rate')
->select('month.Festival_Bonus,month.HRA,month.Loan_Recovered,month.total_diesel_amount,month.total_shed_amount') ->select('month.Festival_Bonus,month.BASIC,month.HRA,month.Loan_Recovered,month.total_diesel_amount,month.total_shed_amount')
// ->select('month.monthly_salary_amount,month.monthly_food_amount,month.Festival_Bonus,month.final_payment,month.HRA,month.ESI,month.PF,month.Loan_Recovered,month.total_diesel_amount,month.total_shed_amount') // ->select('month.monthly_salary_amount,month.monthly_food_amount,month.Festival_Bonus,month.final_payment,month.HRA,month.ESI,month.PF,month.Loan_Recovered,month.total_diesel_amount,month.total_shed_amount')
->join('t_employee_details Emp', 'Pay.driver_id = Emp.EmpID') ->join('t_employee_details Emp', 'Pay.driver_id = Emp.EmpID')
->join('t_departmentdetails Dep', 'Emp.Departmentcode = Dep.DEPCode') ->join('t_departmentdetails Dep', 'Emp.Departmentcode = Dep.DEPCode')

View File

@ -52,7 +52,7 @@ class Employeedetails_model extends Model
return $query->getResult(); return $query->getResult();
} }
function incomingSilicaSandTestedBy($ConfigID){ function incomingSilicaSandTestedBy(){
$builder = $this->db->table('t_employee_details Emp') $builder = $this->db->table('t_employee_details Emp')
@ -67,7 +67,7 @@ class Employeedetails_model extends Model
} }
function incomingSilicaSandApprovedBy($ConfigID){ function incomingSilicaSandApprovedBy(){
$builder = $this->db->table('t_employee_details Emp') $builder = $this->db->table('t_employee_details Emp')
->select(' Emp.*') ->select(' Emp.*')

View File

@ -7,7 +7,7 @@ use CodeIgniter\Model;
class FactoryMachineModel extends Model class FactoryMachineModel extends Model
{ {
// The table associated with this model // The table associated with this model
protected $table = 't_factoryMachineMaster'; protected $table = 't_factorymachinemaster';
// Primary key of the table // Primary key of the table
protected $primaryKey = 'id'; protected $primaryKey = 'id';
@ -41,7 +41,7 @@ class FactoryMachineModel extends Model
public function checkMachineName($machineId,$machineName){ public function checkMachineName($machineId,$machineName){
$builder = $this->db->table('t_factoryMachineMaster'); $builder = $this->db->table('t_factorymachinemaster');
if(!empty($machineId)){ if(!empty($machineId)){
$builder = $builder->where('id !=' , $machineId); $builder = $builder->where('id !=' , $machineId);
@ -62,6 +62,57 @@ class FactoryMachineModel extends Model
} }
public function getAllActiveElectricMachines(){
$result = $this->db->table('t_factorymachinemaster')
->where('is_active', 1)
->where('energy_type', 'electric')
->orderBy('id', 'asc')
->get()
->getResultArray();
return $result ;
}
public function getSelectedElectricMachines($distinctMachineId){
$result = $this->db->table('t_factorymachinemaster')
->whereIn('id', $distinctMachineId)
->orderBy('id', 'asc')
->get()
->getResultArray();
return $result;
}
public function getAllActiveDieselMachines(){
$result = $this->db->table('t_factorymachinemaster')
->where('is_active', 1)
->where('energy_type', 'diesel')
->orderBy('id', 'desc')
->get()
->getResultArray();
return $result ;
}
public function getSelectedDieselMachines($distinctMachineId){
$result = $this->db->table('t_factorymachinemaster')
->whereIn('id', $distinctMachineId)
->orderBy('id', 'asc')
->get()
->getResultArray();
return $result;
}
} }

View File

@ -6,7 +6,7 @@ use CodeIgniter\Model;
class FactoryVehicleDieselDetailsModel extends Model class FactoryVehicleDieselDetailsModel extends Model
{ {
protected $table = 't_factoryVehicleDieselDetails'; protected $table = 't_factoryvehicledieseldetails';
protected $primaryKey = 'id'; protected $primaryKey = 'id';
protected $allowedFields = [ protected $allowedFields = [

View File

@ -6,7 +6,7 @@ use CodeIgniter\Model;
class FactoryVehicleDieselStockSummaryModel extends Model class FactoryVehicleDieselStockSummaryModel extends Model
{ {
protected $table = 't_factoryVehicleDieselStockSummary'; protected $table = 't_factoryvehicledieselstocksummary';
protected $primaryKey = 'id'; protected $primaryKey = 'id';
protected $allowedFields = [ protected $allowedFields = [

View File

@ -0,0 +1,49 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class GasShortageModel extends Model
{
protected $table = 't_gasShortageDetails';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'array';
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields =
['fullCylinderDate','emptyCylinderDate','invoiceNo',
'cylinderNo','grossWeight','tareWeight','netWeight','actualWeight','shortage'
];
protected bool $allowEmptyInserts = false;
protected bool $updateOnlyChanged = true;
protected array $casts = [];
protected array $castHandlers = [];
// Dates
protected $useTimestamps = false;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
// Validation
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
protected $cleanValidationRules = true;
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = [];
protected $afterInsert = [];
protected $beforeUpdate = [];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
}

View File

@ -6,7 +6,7 @@ use CodeIgniter\Model;
class GasStockModel extends Model class GasStockModel extends Model
{ {
protected $table = 't_gasStockDetails'; protected $table = 't_gasstockdetails';
protected $primaryKey = 'id'; protected $primaryKey = 'id';
protected $useAutoIncrement = true; protected $useAutoIncrement = true;
protected $returnType = 'array'; protected $returnType = 'array';

View File

@ -6,7 +6,7 @@ use CodeIgniter\Model;
class IncomingSilicaSandDetailsModel extends Model class IncomingSilicaSandDetailsModel extends Model
{ {
protected $table = 't_incomingSilicaSandDetails'; protected $table = 't_incomingsilicasanddetails';
protected $primaryKey = 'id'; protected $primaryKey = 'id';
protected $useAutoIncrement = true; protected $useAutoIncrement = true;
protected $returnType = 'array'; protected $returnType = 'array';

View File

@ -554,8 +554,18 @@ class Inwardgateregister_model extends Model
$builder = $this->db->table('t_igr_master igr') $builder = $this->db->table('t_igr_master igr')
->distinct() ->distinct()
->select("igr.IGRNO,igr.*,igrd.*,MM.MaterialName,MM.UOM,sup.Address,sup.SupplierName,POM.ServiceDescription,POL.Quantity,POL.Rate,POM.POType,POM.IsOpenOrder, ->select("
POM.CapitalRange,POM.CapitalRange,st.CGST as service_cgst,st.SGST as service_sgst,st.IGST as service_igst,it.IGST as import_igst,rt.CGST as revenue_cgst,rt.SGST as revenue_sgst,rt.IGST as revenue_igst") igr.IGRNO,igr.*,igrd.*,
MM.MaterialName,MM.UOM,
sup.Address,sup.SupplierName,
POL.Rate,
POM.ServiceDescription,POL.Quantity,POM.POType,POM.IsOpenOrder,
POM.CapitalRange,POM.CapitalRange,
st.CGST as service_cgst,st.SGST as service_sgst,st.IGST as service_igst,
it.IGST as import_igst,
rt.CGST as revenue_cgst,rt.SGST as revenue_sgst,rt.IGST as revenue_igst,
cd.ConfigValue As MaterialCategory")
->join('t_igr_details igrd', 'igrd.IGRNO = igr.IGRNO') ->join('t_igr_details igrd', 'igrd.IGRNO = igr.IGRNO')
->join('t_purchaseorder_master POM', 'igr.PONO = POM.PONO') ->join('t_purchaseorder_master POM', 'igr.PONO = POM.PONO')
->join('t_purchaseorder_lineitem POL', 'igr.PONO = POL.PONO and POL.MaterialCode=igrd.MaterialCode ') ->join('t_purchaseorder_lineitem POL', 'igr.PONO = POL.PONO and POL.MaterialCode=igrd.MaterialCode ')
@ -564,6 +574,7 @@ class Inwardgateregister_model extends Model
->join('t_service_tax st', 'st.LineItemNo = POL.LineItemNo' , 'left') ->join('t_service_tax st', 'st.LineItemNo = POL.LineItemNo' , 'left')
->join('t_revenue_tax rt', 'rt.LineItemNo = POL.LineItemNo' , 'left') ->join('t_revenue_tax rt', 'rt.LineItemNo = POL.LineItemNo' , 'left')
->join('t_import_tax it', 'it.LineItemNo = POL.LineItemNo' , 'left') ->join('t_import_tax it', 'it.LineItemNo = POL.LineItemNo' , 'left')
->join('t_configdetails cd','cd.key = MM.Category','left')
->where('igr.IGRNO', $IGRNO); ->where('igr.IGRNO', $IGRNO);
$query = $builder->get(); $query = $builder->get();
@ -1191,7 +1202,7 @@ class Inwardgateregister_model extends Model
igrMast.MaterialRcvdDate as materialRecievedDate, igrMast.MaterialRcvdDate as materialRecievedDate,
igrMast.VehicleNo, igrMast.VehicleNo,
supplierDetails.SupplierName, supplierDetails.SupplierName,
materialMaster.Category as sandType , cd.ConfigValue as sandType ,
t_igr_details.QuantityAsPerInvoice as Qty, t_igr_details.QuantityAsPerInvoice as Qty,
issd.*') issd.*')
->whereIn('t_igr_details.MaterialCode', $materialCodes) ->whereIn('t_igr_details.MaterialCode', $materialCodes)
@ -1205,8 +1216,9 @@ class Inwardgateregister_model extends Model
$builder->groupBy('t_igr_details.IGRNO, t_igr_details.MaterialCode') $builder->groupBy('t_igr_details.IGRNO, t_igr_details.MaterialCode')
->join('t_igr_master igrMast', 'igrMast.IGRNO = t_igr_details.IGRNO') ->join('t_igr_master igrMast', 'igrMast.IGRNO = t_igr_details.IGRNO')
->join('t_incomingSilicaSandDetails issd','issd.igrNo_fk = t_igr_details.IGRNO AND issd.materialCode = t_igr_details.MaterialCode','left') ->join('t_incomingsilicasanddetails issd','issd.igrNo_fk = t_igr_details.IGRNO AND issd.materialCode = t_igr_details.MaterialCode','left')
->join('t_materialmaster materialMaster', 'materialMaster.MaterialCode = t_igr_details.MaterialCode') ->join('t_materialmaster materialMaster', 'materialMaster.MaterialCode = t_igr_details.MaterialCode')
->join('t_configdetails cd','cd.key = materialMaster.Category','left')
->join('t_purchaseorder_master poMaster', 'poMaster.PONO = igrMast.PONO', 'left') ->join('t_purchaseorder_master poMaster', 'poMaster.PONO = igrMast.PONO', 'left')
->join('t_supplierdetailsn supplierDetails', 'supplierDetails.SupplierID = poMaster.SupplierID', 'left') ->join('t_supplierdetailsn supplierDetails', 'supplierDetails.SupplierID = poMaster.SupplierID', 'left')
->orderBy('t_igr_details.CreatedDate', 'asc '); ->orderBy('t_igr_details.CreatedDate', 'asc ');

View File

@ -4,15 +4,15 @@ namespace App\Models;
use CodeIgniter\Model; use CodeIgniter\Model;
class TrpAbstractParticulars extends Model class MonthWiseMachinesInStockModel extends Model
{ {
protected $table = 't_trp_abstract_particulars'; protected $table = 't_monthwisemachinesinstock';
protected $primaryKey = 'id'; protected $primaryKey = 'id';
protected $useAutoIncrement = true; protected $useAutoIncrement = true;
protected $returnType = 'array'; protected $returnType = 'array';
protected $useSoftDeletes = false; protected $useSoftDeletes = false;
protected $protectFields = true; protected $protectFields = true;
protected $allowedFields = ['particular']; protected $allowedFields = ['date','machine_id','machine_category'];
protected bool $allowEmptyInserts = false; protected bool $allowEmptyInserts = false;
protected bool $updateOnlyChanged = true; protected bool $updateOnlyChanged = true;

View File

@ -4,15 +4,15 @@ namespace App\Models;
use CodeIgniter\Model; use CodeIgniter\Model;
class TrpAbstract extends Model class MonthWiseMaterialInStockModel extends Model
{ {
protected $table = 't_trp_abstract'; protected $table = 't_monthwisematerialinstock';
protected $primaryKey = 'id'; protected $primaryKey = 'id';
protected $useAutoIncrement = true; protected $useAutoIncrement = true;
protected $returnType = 'array'; protected $returnType = 'array';
protected $useSoftDeletes = false; protected $useSoftDeletes = false;
protected $protectFields = true; protected $protectFields = true;
protected $allowedFields = ['abs_opening_stock','abs_physical_stock','abs_remarks','abs_particular_id']; protected $allowedFields = ['date','materialCode','stock_category'];
protected bool $allowEmptyInserts = false; protected bool $allowEmptyInserts = false;
protected bool $updateOnlyChanged = true; protected bool $updateOnlyChanged = true;

View File

@ -172,11 +172,27 @@ class Payroll_model extends Model
function getPayOn() function getPayOn()
{ {
// For Employee - old
$builder = $this->db->table('t_monthly_pay_inputs') $builder = $this->db->table('t_monthly_pay_inputs')
->select('DISTINCT(Month_Year)') ->select('DISTINCT(Month_Year)')
->orderBy("Month_Year", "desc"); ->orderBy("Month_Year", "desc");
$query = $builder->get(); $query = $builder->get();
return $query->getResult(); $result1 = $query->getResult();
// For Driver - new
$builder = $this->db->table('t_driver_monthly_pay_inputs')
->select('DISTINCT(month_year) as Month_Year')
->orderBy("month_year", "desc");
$query = $builder->get();
$result2 = $query->getResult();
$result = array_merge($result1, $result2);
// removed duplicates - refer gpt - gpt solved
$unique = array_map("unserialize", array_unique(array_map("serialize", $result)));
return $unique;
} }
function getBankInfo($bank = "") function getBankInfo($bank = "")

View File

@ -6,7 +6,7 @@ use CodeIgniter\Model;
class PowerConsumptionDetails extends Model class PowerConsumptionDetails extends Model
{ {
protected $table = 't_powerConsumptionDetails'; protected $table = 't_powerconsumptiondetails';
protected $primaryKey = 'id'; protected $primaryKey = 'id';
protected $allowedFields = [ protected $allowedFields = [

View File

@ -14,7 +14,7 @@ class Rawmaterialdetails_model extends Model
* @param number $segment : This is pagination limit * @param number $segment : This is pagination limit
* @return array $result : This is result * @return array $result : This is result
*/ */
function rawmaterialListing() function rawmaterialListing($isActiveFilter)
{ {
$builder = $this->db->table('t_materialmaster') $builder = $this->db->table('t_materialmaster')
@ -22,6 +22,7 @@ class Rawmaterialdetails_model extends Model
->join('tbl_users as user', 'user.UserId = t_materialmaster.createdby', 'left') ->join('tbl_users as user', 'user.UserId = t_materialmaster.createdby', 'left')
->join('t_employee_details as emp', 'emp.EmpID = user.EmpID', 'left') ->join('t_employee_details as emp', 'emp.EmpID = user.EmpID', 'left')
->join('t_configdetails as cd', 'cd.Key = t_materialmaster.Category', 'left') ->join('t_configdetails as cd', 'cd.Key = t_materialmaster.Category', 'left')
->where('t_materialmaster.IsActive',$isActiveFilter)
->orderBy('CreatedDate','desc'); ->orderBy('CreatedDate','desc');
$query = $builder->get(); $query = $builder->get();
$result = $query->getResult(); $result = $query->getResult();
@ -146,6 +147,10 @@ class Rawmaterialdetails_model extends Model
$builder = $this->db->table('t_materialmaster') $builder = $this->db->table('t_materialmaster')
->select('MaterialCode') ->select('MaterialCode')
/** Caution changing config key is posing risk to entire stock module * */
// 248 is the config detail key for silica sand
->where('Category', '248') ->where('Category', '248')
->orderBy('CreatedDate', 'desc'); ->orderBy('CreatedDate', 'desc');
$query = $builder->get(); $query = $builder->get();
@ -158,6 +163,10 @@ class Rawmaterialdetails_model extends Model
$builder = $this->db->table('t_materialmaster') $builder = $this->db->table('t_materialmaster')
->select('MaterialCode') ->select('MaterialCode')
/** Caution changing config key is posing risk to entire stock module * */
// 328 is the config detail key for silica sand
->where('Category', '328') ->where('Category', '328')
->orderBy('CreatedDate', 'desc'); ->orderBy('CreatedDate', 'desc');
$query = $builder->get(); $query = $builder->get();

View File

@ -387,9 +387,7 @@ class Requistion_model extends Model
$this->db->transComplete(); // Complete transaction $this->db->transComplete(); // Complete transaction
try { try {
$result = ($result) ? $result : false; if ($affected_rows > 0) {
if ($result && $affected_rows > 0) {
$subQuery = 'SELECT ReqNo FROM t_requestion_master ORDER BY CreatedDate DESC LIMIT 1'; $subQuery = 'SELECT ReqNo FROM t_requestion_master ORDER BY CreatedDate DESC LIMIT 1';
$query = $this->db->query($subQuery); $query = $this->db->query($subQuery);

View File

@ -14,7 +14,7 @@ class Supplier_model extends Model
* @param number $segment : This is pagination limit * @param number $segment : This is pagination limit
* @return array $result : This is result * @return array $result : This is result
*/ */
function supplierlisting() function supplierlisting($isActiveFilter)
{ {
$builder = $this->db->table('t_supplierdetailsn as BaseT') $builder = $this->db->table('t_supplierdetailsn as BaseT')
@ -22,6 +22,7 @@ class Supplier_model extends Model
->join('t_paymentterms as pmt', 'pmt.PaymentID = BaseT.PaymentID', 'left') ->join('t_paymentterms as pmt', 'pmt.PaymentID = BaseT.PaymentID', 'left')
->join('tbl_users as user', 'user.UserId = BaseT.createdby', 'left') ->join('tbl_users as user', 'user.UserId = BaseT.createdby', 'left')
->join('t_employee_details as emp', 'emp.EmpID = user.EmpID', 'left') ->join('t_employee_details as emp', 'emp.EmpID = user.EmpID', 'left')
->where('BaseT.IsActive',$isActiveFilter)
->orderBy('BaseT.CreatedOn', 'desc'); ->orderBy('BaseT.CreatedOn', 'desc');
$query = $builder->get(); $query = $builder->get();
@ -224,17 +225,19 @@ class Supplier_model extends Model
} }
/*SUPPLIER */ /*SUPPLIER */
/** for transporter listing */ /** for transporter listing */
function transporterListing() function transporterListing($isActiveFilter)
{ {
$builder = $this->db->table('t_transporter as t') $builder = $this->db->table('t_transporter as t')
->select('t.id,t.name,t_employee_details.FirstName as FirstName,t.created_on,t.isactive') ->select('t.id,t.name,t_employee_details.FirstName as FirstName,t.created_on,t.isactive')
->join('tbl_users', 'tbl_users.userId = t.created_by') ->join('tbl_users', 'tbl_users.userId = t.created_by')
->join('t_employee_details', 't_employee_details.EmpID=tbl_users.EmpID') ->join('t_employee_details', 't_employee_details.EmpID=tbl_users.EmpID')
->orderBy('t.created_on', 'desc'); ->where('t.isactive',$isActiveFilter);
$builder->orderBy('t.created_on', 'desc');
$query =$builder->get(); $query =$builder->get();
$result = $query->getResult(); $result = $query->getResult();
// echo $this->db->getLastQuery()->getQuery();die; // echo $this->db->getLastQuery()->getQuery();die;
return $result; return $result;
} }

View File

@ -0,0 +1,73 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class TrpAbstractModel extends Model
{
protected $table = 't_trp_abstract';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'array';
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = [
'date','particulars','opening_stock','physical_stock','remarks'
];
protected bool $allowEmptyInserts = false;
protected bool $updateOnlyChanged = true;
protected array $casts = [];
protected array $castHandlers = [];
// Dates
protected $useTimestamps = false;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
// Validation
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
protected $cleanValidationRules = true;
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = [];
protected $afterInsert = [];
protected $beforeUpdate = [];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function currentMonthTrpAbstract($startDate,$endDate){
$currentMonthTrpAbstract = $this->db->table('t_trp_abstract')
->where('date',$startDate)
->where('date',$endDate)
->get()
->getResultArray();
return $currentMonthTrpAbstract;
}
}

View File

@ -60,12 +60,14 @@ class TrpProductionModel extends Model
// Subquery definition // Subquery definition
$subquery = $this->db->table('t_materialmaster') $subquery = $this->db->table('t_materialmaster')
->select('materialCode') ->select('materialCode')
->where('Category' ,'waste core') //328 - is for waste core in config master ->where('Category' ,'328')
->get() ->get()
->getResultArray(); ->getResultArray();
$materialCodes = array_column($subquery, 'materialCode'); // Extracts 'materialCode' values $materialCodes = array_column($subquery, 'materialCode'); // Extracts 'materialCode' values
// dd($this->db->getLastQuery()); // dd($this->db->getLastQuery());
// Convert the array of material codes to a comma-separated string // Convert the array of material codes to a comma-separated string

View File

@ -15,14 +15,16 @@ class User_model extends Model
* @param number $segment : This is pagination limit * @param number $segment : This is pagination limit
* @return array $result : This is result * @return array $result : This is result
*/ */
function userListing() function userListing($isDeleted)
{ {
$builder = $this->db->table('t_employee_details EMP') $builder = $this->db->table('t_employee_details EMP')
->select('user.isDeleted,user.createdDtm,EMP.EmpID,EMP.FirstName,EMP.LastName,EMP.Designation,user.email as EmailId,EMP.ContactNumber, ->select('user.isDeleted,user.createdDtm,EMP.EmpID,EMP.FirstName,
EMP.LastName,EMP.Designation,user.email as EmailId,EMP.ContactNumber,
DEPT.DEPCode,DEPT.DepartmentName,role.role,user.userId') DEPT.DEPCode,DEPT.DepartmentName,role.role,user.userId')
->join('t_departmentdetails DEPT', 'EMP.Departmentcode = DEPT.DEPCode') ->join('t_departmentdetails DEPT', 'EMP.Departmentcode = DEPT.DEPCode','left')
->join('tbl_users user', 'user.EmpID = EMP.EmpID') ->join('tbl_users user', 'user.EmpID = EMP.EmpID','left')
->join('tbl_roles role', 'user.roleId = role.roleId') ->join('tbl_roles role', 'user.roleId = role.roleId','left')
->where('user.isDeleted',$isDeleted)
->orderBy('user.createdDtm', 'desc'); ->orderBy('user.createdDtm', 'desc');
$query = $builder->get(); $query = $builder->get();

File diff suppressed because it is too large Load Diff

View File

@ -102,7 +102,7 @@
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label for="Quantity">Purchase Date<span style="color:red">*</span></label> <label for="Quantity">Purchase Date<span style="color:red">*</span></label>
<input id="DateOfPurchase" name="DateOfPurchase" onkeypress="return false;" maxlength="10" class="form-control" value="<?php echo isset($_POST['DateOfPurchase']) ? $_POST['DateOfPurchase'] : '' ?>"> <input id="DateOfPurchase" name="DateOfPurchase" onkeypress="return false;" maxlength="10" class="form-control" value="<?php echo isset($_POST['DateOfPurchase']) ? $_POST['DateOfPurchase'] : '' ?>" required>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label for="SupplierName">Supplier Name</label> <label for="SupplierName">Supplier Name</label>
@ -355,6 +355,13 @@
$("#User").focus(); $("#User").focus();
return false; return false;
} }
if ($('#DateOfPurchase').val().length < 1) {
alert('Please Enter the purchase date');
$("#DateOfPurchase").focus();
return false;
}
if ($('#Location').val().length < 1) { if ($('#Location').val().length < 1) {
alert('Please Enter the Asset Location'); alert('Please Enter the Asset Location');
$("#Location").focus(); $("#Location").focus();

View File

@ -244,8 +244,7 @@
$('#ConfigValue').show(); $('#ConfigValue').show();
var temp = index; var temp = index;
var ConfigValue = $("#ConfigValue").val(); var ConfigValue = $.trim($("#ConfigValue").val());
$('#ConfigValue').val(''); $('#ConfigValue').val('');

View File

@ -115,6 +115,12 @@
let departmentName = $("#DepartmentName").val().trim(); let departmentName = $("#DepartmentName").val().trim();
let headDepCode =$("#HeadDept").val()??''; let headDepCode =$("#HeadDept").val()??'';
let depCode =$("#DEPCode").val() ?? ''; let depCode =$("#DEPCode").val() ?? '';
if(departmentName.length<1){
alert(`Department Name cannot be empty..!!`);
return;
}
$('#loader').show(); $('#loader').show();
$.ajax({ $.ajax({
type:"POST", type:"POST",

View File

@ -1838,9 +1838,17 @@ if (!empty($INRSYMBOL)) {
function showsubmit() { function showsubmit() {
var isChecked = $('#IsOpenOrder').is(':checked'); var isChecked = $('#IsOpenOrder').is(':checked');
// alert("isChecked: " + isChecked); console.log("Step 1 = SS");
var PO = $('#POType').val(); var PO = $('#POType').val();
if (PO == 'SERVICE') {
if ($('#emergdescofpo').val().trim() == '') {
alert('Please Enter Description Of Service');
$('#emergdescofpo').focus();
return false;
}
}
if (isChecked) { if (isChecked) {
if (PO == 'REVENUE') { if (PO == 'REVENUE') {
//alert('normalemergency'); //alert('normalemergency');
@ -1876,6 +1884,28 @@ if (!empty($INRSYMBOL)) {
alert('Please Select the Supplier details'); alert('Please Select the Supplier details');
$('#drpSupplier').focus(); $('#drpSupplier').focus();
return false; return false;
} else if (input == 'REVENUE' && $('#Deliverydate').val() == '' && radioValue == 0) {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (input == 'REVENUE' && $('#Scheduleby').val().trim() == '' && radioValue == 1) {
alert('Please Enter the Schedule By');
$('#Scheduleby').focus();
return false;
} else if (input == 'SERVICE' && $('#Deliverydate').val() == '' && radioValue == 0) {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (input == 'SERVICE' && $('#Scheduleby').val().trim() == '' && radioValue == 1) {
alert('Please Enter the Schedule By');
$('#Scheduleby').focus();
return false;
} else if ($('#DepartmentName').val() == "0") {
alert('Please Select Department Name ')
return false;
} else if ($('#CostCenterName').val() == "0") {
alert('Please Select Cost Center Name ')
return false;
} else if ($('#PoTypeOptions').val() == "0") { } else if ($('#PoTypeOptions').val() == "0") {
if ($('#purpose').val() == "REVENUE") { if ($('#purpose').val() == "REVENUE") {
@ -1891,40 +1921,19 @@ if (!empty($INRSYMBOL)) {
return false; return false;
} }
}else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms Description');
} else if ($('#DepartmentName').val() == "0") { $('#Otherpayment').focus();
alert('Please Select Department Name ') return false;
}else if($('#insuranceStatus').val() == "1" && $('#InsuranceNumber').val().trim() == ''){
alert('Please Enter the Insurance No / Insurance Details');
$('#InsuranceNumber').focus();
return false; return false;
} }else if ($('#BudgetType').val() == "0") {
else if ($('#CostCenterName').val() == "0") {
alert('Please Select Cost Center Name ')
}
else if ($('#BudgetType').val() == "0") {
alert('Please Select Budget Type'); alert('Please Select Budget Type');
$('#BudgetType').focus(); $('#BudgetType').focus();
return false; return false;
} else {
} else if (input == 'REVENUE' && $('#Deliverydate').val() == '' && radioValue == 0) {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (input == 'REVENUE' && $('#Scheduleby').val().trim() == '' && radioValue == 1) {
alert('Please Enter the Schedule By');
$('#Scheduleby').focus();
return false;
}
else if ($('#Otherpayment').length > 0 && $('#Otherpayment').is(':visible') && $('#Otherpayment').val() == '') {
alert('Please Enter the Description of payable terms');
$('#Otherpayment').focus();
return false;
}
else {
$("#" + input).modal('show'); $("#" + input).modal('show');
$('#isEdit').val(0); $('#isEdit').val(0);
if (StateTaxCheck == "0") { if (StateTaxCheck == "0") {
@ -2634,21 +2643,21 @@ if (!empty($INRSYMBOL)) {
<label>Purchase Order Date</label> <label>Purchase Order Date</label>
<div class="form-group"> <div class="form-group">
<?php <?php
// $poDt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$poDt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); // $formattedDate = $poDt->format('d-m-Y');
$formattedDate = $poDt->format('Y-m-d'); // $data = array(
$data = array( // 'type' => 'text',
'type' => 'date', // 'name' => 'PODate',
'name' => 'PODate', // 'value' => set_value('PODate', $formattedDate),
'value' => set_value('PODate', $formattedDate), // 'min' => $formattedDate,
'min' => $formattedDate, // 'id' => 'PODate',
'id' => 'PODate', // 'class' => 'form-control num',
'class' => 'form-control', // 'required' => 'true',
'required' => 'true', // 'onkeypress' => 'return false;'
'onkeypress' => 'return false;' // );
); // echo form_input($data);
echo form_input($data);
?> ?>
<input class="form-control num" data-provide="datepicker" data-date-format="dd-mm-yyyy" data-date-autoclose="true" id="PODate" name="PODate" data-date-start-date="<?= date('d-m-Y'); ?>" required autocomplete="off" value="<?= date('d-m-Y'); ?>">
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
@ -6334,6 +6343,7 @@ if (!empty($INRSYMBOL)) {
}); });
} }
$("#PaymentMethod").trigger('change');
}); });
$(document).ready(function () { $(document).ready(function () {
@ -6405,6 +6415,18 @@ if (!empty($INRSYMBOL)) {
} }
}); });
//If others is the payment terms to display mandatory field
$("#PaymentMethod").change(function () {
if ($('#PaymentMethod').val().trim() == 'PT08') {
$('#otheroptiondiv').show();
} else {
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
});
/*get cost center name using department*/ /*get cost center name using department*/
var CostArray = ''; var CostArray = '';
$('#DepartmentName').change(function () { $('#DepartmentName').change(function () {
@ -7239,27 +7261,27 @@ if (!empty($INRSYMBOL)) {
// Perform form validation // Perform form validation
if (serviceValidate()) { if (validate()) {
// if (document.getElementById('serviceTax').rows.length < 2) { if (document.getElementById('serviceTax').rows.length < 2) {
// alert('Please Select Line item to Create PO'); alert('Please Select Line item to Create PO');
// $('#Deliverydt').focus(); $('#Deliverydt').focus();
// return false; return false;
// } else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') { } else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') {
// alert('Please Enter Other Payable Terms Description'); alert('Please Enter Other Payable Terms Description');
// $('#Otherpayment').focus(); $('#Otherpayment').focus();
// return false; return false;
// } else if ($('#emergdescofpo').val().trim() == '') { } else if ($('#emergdescofpo').val().trim() == '') {
// alert('Please Enter Description Of Service'); alert('Please Enter Description Of Service');
// $('#emergdescofpo').focus(); $('#emergdescofpo').focus();
// return false; return false;
// } else if ($('#PoTypeOptions').val() == "0") { } else if ($('#PoTypeOptions').val() == "0") {
// alert('Please Select POType'); alert('Please Select POType');
// $('#PoTypeOptions').focus(); $('#PoTypeOptions').focus();
// return false; return false;
// } else { } else {
// Submit the form using AJAX // Submit the form using AJAX
$('#loader').show(); $('#loader').show();
disableButtons(); // disableButtons();
$.ajax({ $.ajax({
url: "<?php echo base_url() ?>emergencypurchaseorder/addNewServicePurchaseOrder", url: "<?php echo base_url() ?>emergencypurchaseorder/addNewServicePurchaseOrder",
type: "POST", type: "POST",
@ -7278,16 +7300,16 @@ if (!empty($INRSYMBOL)) {
$('#SpcialInstruction').val(''); $('#SpcialInstruction').val('');
$('#txtDeliveryAddress').val(''); $('#txtDeliveryAddress').val('');
window.location = "purchaseorderListing"; window.location = "purchaseorderListing";
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {
// Handle errors // Handle errors
$('#loader').hide(); $('#loader').hide();
alert("Error: " + error); alert("Error: " + error);
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }
}); });
// } }
} }
} }
@ -7353,23 +7375,23 @@ if (!empty($INRSYMBOL)) {
// Perform form validation // Perform form validation
if (revenueValidate()) { if (validate()) {
// if (document.getElementById('serviceTax').rows.length < 2) { if (document.getElementById('serviceTax').rows.length < 2) {
// alert('Please Select Line item to Create PO'); alert('Please Select Line item to Create PO');
// $('#Deliverydt').focus(); $('#Deliverydt').focus();
// return false; return false;
// } else if ($('#insuranceStatus').val() == 'YES' && $('#InsuranceNumber').val() == '') { } else if ($('#insuranceStatus').val() == 'YES' && $('#InsuranceNumber').val() == '') {
// alert('Please Enter Insurance Number..!'); alert('Please Enter Insurance Number..!');
// return false; return false;
// } else if ($('#PaymentMethod').val() == 'PT08' && $('#Otherpayment').val() == '') { } else if ($('#PaymentMethod').val() == 'PT08' && $('#Otherpayment').val() == '') {
// alert('Please Enter Other Payment Description..!'); alert('Please Enter Other Payment Description..!');
// return false; return false;
// } else { } else {
// Submit the form using AJAX // Submit the form using AJAX
$('#loader').show(); $('#loader').show();
disableButtons(); // disableButtons();
$.ajax({ $.ajax({
url: "<?php echo base_url() ?>emergencypurchaseorder/addNewRevenuePurchaseOrder", url: "<?php echo base_url() ?>emergencypurchaseorder/addNewRevenuePurchaseOrder",
type: "POST", type: "POST",
@ -7384,15 +7406,15 @@ if (!empty($INRSYMBOL)) {
$('#SpcialInstruction').val(''); $('#SpcialInstruction').val('');
$('#txtDeliveryAddress').val(''); $('#txtDeliveryAddress').val('');
window.location = "purchaseorderListing"; window.location = "purchaseorderListing";
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {
// Handle errors // Handle errors
alert("Error: " + error); alert("Error: " + error);
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }
}); });
// } }
} }
} }
@ -8017,17 +8039,6 @@ if (!empty($INRSYMBOL)) {
} }
//If others is the payment terms to display mandatory field
$("#PaymentMethod").change(function () {
if ($('#PaymentMethod').val().trim() == 'PT08') {
$('#otheroptiondiv').show();
} else {
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
});
// set default null value // set default null value
function clearTotalItemValues() { function clearTotalItemValues() {

View File

@ -79,22 +79,30 @@
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" <i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button"
id="resetButton" title="Reset"></i> id="resetButton" title="Reset"></i>
<div style="margin-left:auto">
<div class="error" id="error"></div>
</form>
<div style="margin-left:auto">
<div class="form-check" style="margin-right: 25px;"> <div class="form-check" style="margin-right: 25px;">
<input class="form-check-input" type="checkbox" id="showArchiveId" <form id="archiveFormId" action="<?php echo base_url()?>/assetListing" method="post">
name="showArchive" value="1" onchange="showArchiveList()" <input class="form-check-input" type="checkbox" id="showArchiveId"
style="width: 18px; height: 18px;"> name="showArchive" value="1" <?php echo $showArchive ? "checked" : " " ?>
<label class="form-check-label" for="showArchiveId" style="width: 18px; height: 18px;">
style="font-size: 1rem; margin-left: 8px;"> <label class="form-check-label" for="showArchiveId"
Show Archive style="font-size: 1rem; margin-left: 8px;">
</label> Show Archive
</label>
</form>
</div> </div>
</div> </div>
<div class="error" id="error"></div>
</form>
<div class="card-body" style="overflow-x:scroll;"> <div class="card-body" style="overflow-x:scroll;">
<table class="table dt-responsive nowrap w-100" id="asset_list_table"> <table class="table dt-responsive nowrap w-100" id="asset_list_table">
@ -121,12 +129,7 @@
if (!empty($userRecords)) { if (!empty($userRecords)) {
foreach ($userRecords as $record) { foreach ($userRecords as $record) {
?> ?>
<tr class="<?php if ($record->IsActive == 0) { <tr>
echo "deactivatedRow";
} ?>"
style="<?php if ($record->IsActive == 0) {
echo "display:none";
} ?>">
<?php if (date('d-m-Y', strtotime($record->CreatedDt)) == "30-11--0001") { <?php if (date('d-m-Y', strtotime($record->CreatedDt)) == "30-11--0001") {
$cdate = '00-00-0000'; $cdate = '00-00-0000';
@ -150,7 +153,7 @@
<td> <td>
<?php if ($record->IsActive == 0) { ?> <?php if ($record->IsActive == 0) { ?>
<a onclick="confirmReActivatingAsset()" <a onclick="confirmReActivatingAsset(event)"
href="<?php echo base_url() . 'assetdetails/reActivateAsset/?AssetID=' . $record->AssetCode ?>" href="<?php echo base_url() . 'assetdetails/reActivateAsset/?AssetID=' . $record->AssetCode ?>"
data-toggle="tooltip" data-toggle="tooltip"
title="<?php echo $record->AssetCode; ?> - Click here to Re-Activate Asset Details"> title="<?php echo $record->AssetCode; ?> - Click here to Re-Activate Asset Details">
@ -288,29 +291,6 @@
</script> </script>
<script> <script>
function showArchiveList() {
let isChecked = $("#showArchiveId").prop('checked');
// Show or hide the rows based on checkbox status
$(".deactivatedRow").each(function () {
if (isChecked) {
$(this).show();
} else {
$(this).hide();
}
});
}
$(document).ready(function () {
let table = $('#asset_list_table').DataTable();
showArchiveList();
table.on('draw', function () {
showArchiveList();
});
});
function confirmReActivatingAsset(event) { function confirmReActivatingAsset(event) {
let result = confirm("Do You Want to Re-Activate Asset details ?"); let result = confirm("Do You Want to Re-Activate Asset details ?");
@ -318,10 +298,21 @@
if (result) { return; } else { event.preventDefault(); } if (result) { return; } else { event.preventDefault(); }
} }
function confirmDeleteAsset() { function confirmDeleteAsset(event) {
let result = confirm("Do You Want to Delete Asset details ?"); let result = confirm("Do You Want to Delete Asset details ?");
if (result) { return; } else { event.preventDefault(); } if (result) { return; } else { event.preventDefault(); }
} }
</script> </script>
<script>
$(document).on("change", "#showArchiveId", function () {
console.log("Checkbox changed, submitting form...");
$("#archiveFormId").submit();
});
</script>

View File

@ -123,6 +123,18 @@
$('#editpackagingcalmodel').on('hidden.bs.modal', function() { $('#editpackagingcalmodel').on('hidden.bs.modal', function() {
$('#editpackagingcalmodel').css('z-index', ''); // Reset to default $('#editpackagingcalmodel').css('z-index', ''); // Reset to default
}); });
//If others is the payment terms to display mandatory field
$("#PaymentMethod").change(function() {
if ($('#PaymentMethod').val().trim() == 'PT08') {
$('#otheroptiondiv').show();
$('#Otherpayment').prop('required', true);
} else {
$('#otheroptiondiv').hide();
$('#Otherpayment').prop('required', false);
$('#Otherpayment').val('');
}
});
}); });
</script> </script>
<?php <?php
@ -703,7 +715,7 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="payablefrom">Payable Terms </label> <label for="payablefrom">Payable Terms<span class="text-danger">*</span> </label>
<?php <?php
$options1 = array("0" => 'Select Payment method'); $options1 = array("0" => 'Select Payment method');
@ -722,7 +734,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
<div class="form-group col-md-3" id="otheroptiondiv" style="display:none;"> <div class="form-group col-md-3" id="otheroptiondiv" style="display:none;">
<label>Description of Payable Terms</label> <label>Description of Payable Terms<span class="text-danger">*</span></label>
<div> <div>
<?php <?php
$data = array('name' => 'Otherpayment', 'Otherpayment' => set_value('Otherpayment'), 'id' => 'Otherpayment', 'class' => 'form-control', 'required' => 'true'); $data = array('name' => 'Otherpayment', 'Otherpayment' => set_value('Otherpayment'), 'id' => 'Otherpayment', 'class' => 'form-control', 'required' => 'true');
@ -783,7 +795,8 @@ if (!empty($INRSYMBOL)) {
<br> <br>
</div> </div>
<div class="form-row"> <div class="form-row">
<table id="serviceTax" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;"> <div class="table-responsive" style="padding-bottom: 30px;">
<table id="serviceTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<thead> <thead>
<tr> <tr>
<th style="white-space: nowrap !important;">SNo</th> <th style="white-space: nowrap !important;">SNo</th>
@ -806,6 +819,7 @@ if (!empty($INRSYMBOL)) {
</tbody> </tbody>
</table> </table>
</div> </div>
</div>
<div class="form-row" id="DOMdiv"> <div class="form-row" id="DOMdiv">
<div class="form-group col-md-3"> <div class="form-group col-md-3">
@ -2545,6 +2559,7 @@ if (!empty($INRSYMBOL)) {
}); });
} }
$("#PaymentMethod").trigger('change');
}); });
@ -2737,6 +2752,11 @@ if (!empty($INRSYMBOL)) {
RequistQuantity = obj.Quantity; RequistQuantity = obj.Quantity;
$('#RateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')'); $('#RateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')');
$('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/Ton)'); $('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/Ton)');
if(obj.material_rate != 0){
Ratechange();
calculateFreight(3);
calculateFreightlocaddper();
}
} }
@ -4068,7 +4088,7 @@ if (!empty($INRSYMBOL)) {
*/ */
function populateValueMainFormForDeleteServiceTax(deletedRow) { function populateValueMainFormForDeleteServiceTax(deletedRow) {
var rows = document.getElementById('serviceTax').rows.length; var rows = $('#serviceTax tbody tr').length;
var TotalOrderValueSummary = 0; var TotalOrderValueSummary = 0;
@ -4554,7 +4574,7 @@ if (!empty($INRSYMBOL)) {
formData.append('ExchangeRateOn', ExchangeRateOn); formData.append('ExchangeRateOn', ExchangeRateOn);
formData.append('PaymentMethod', PaymentMethod); formData.append('PaymentMethod', PaymentMethod);
$('#loader').show(); $('#loader').show();
disableButtons(); // disableButtons();
$.ajax({ $.ajax({
data: formData, data: formData,
processData: false, processData: false,
@ -4576,18 +4596,20 @@ if (!empty($INRSYMBOL)) {
clearAfterAddLineItemAdd(); clearAfterAddLineItemAdd();
window.location = "purchaseorderListing"; window.location = "purchaseorderListing";
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} else { } else {
$('#loader').hide();
// $('#content').loader('hide'); // $('#content').loader('hide');
alert("Error"); alert("Error");
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }
}, },
error: function(jqXHR, textStatus, errorThrown) { error: function(jqXHR, textStatus, errorThrown) {
$('#loader').hide();
console.error("AJAX Error: " + textStatus + ": " + errorThrown); console.error("AJAX Error: " + textStatus + ": " + errorThrown);
alert("Error: " + textStatus); alert("Error: " + textStatus);
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }
}); });
@ -5395,15 +5417,6 @@ if (!empty($INRSYMBOL)) {
return TAXval; // $('#AfterServiceTax').val(TAXval); return TAXval; // $('#AfterServiceTax').val(TAXval);
} }
//If others is the payment terms to display mandatory field
$("#PaymentMethod").change(function() {
if ($('#PaymentMethod').val().trim() == 'PT08') {
$('#otheroptiondiv').show();
} else {
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
});
function clearTotalItemValues() { function clearTotalItemValues() {
$('#txtTotCgst').val(''); $('#txtTotCgst').val('');
@ -5434,11 +5447,11 @@ if (!empty($INRSYMBOL)) {
function Reset() { function Reset() {
disableButtons(); // disableButtons();
location.reload(); location.reload();
setTimeout(function() { // setTimeout(function() {
enableButtons(); // enableButtons();
}, 2000); // }, 2000);
} }
$('#insuranceTxtDiv').hide(); $('#insuranceTxtDiv').hide();

View File

@ -78,21 +78,26 @@
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" <i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button"
id="resetButton" title="Reset"></i> id="resetButton" title="Reset"></i>
<div style="margin-left:auto">
<div class="form-check" style="margin-right: 25px;">
<input class="form-check-input" type="checkbox" id="showArchiveId"
name="showArchive" value="1" onchange="showArchiveList()"
style="width: 18px; height: 18px;">
<label class="form-check-label" for="showArchiveId"
style="font-size: 1rem; margin-left: 8px;">
Show Archive
</label>
</div>
</div>
<div class="error" id="error"></div> <div class="error" id="error"></div>
</form> </form>
<div style="margin-left:auto">
<div class="form-check" style="margin-right: 25px;">
<form id="archiveFormId" action="<?php echo base_url()?>/costListing" method="post">
<input class="form-check-input" type="checkbox" id="showArchiveId"
name="showArchive" value="1" <?php echo $showArchive ? "checked" : " " ?>
style="width: 18px; height: 18px;">
<label class="form-check-label" for="showArchiveId"
style="font-size: 1rem; margin-left: 8px;">
Show Archive
</label>
</form>
</div>
</div>
<div class="card-body" style="overflow-x:scroll;"> <div class="card-body" style="overflow-x:scroll;">
<table id="cost_listing" class="table dt-responsive nowrap w-100"> <table id="cost_listing" class="table dt-responsive nowrap w-100">
@ -114,11 +119,7 @@
$date = $createdat->format('d-m-Y'); $date = $createdat->format('d-m-Y');
$time = $createdat->format('h:i A'); $time = $createdat->format('h:i A');
?> ?>
<tr class="<?php if ($record->IsActive == 0) { <tr>
echo "deactivatedRow";
} ?>" style="<?php if ($record->IsActive == 0) {
echo "display:none";
} ?>">
<td><?php echo $date; ?></td> <td><?php echo $date; ?></td>
<td><?php echo $record->code ?></td> <td><?php echo $record->code ?></td>
<td><?php echo $record->CostCenterName ?></td> <td><?php echo $record->CostCenterName ?></td>
@ -406,29 +407,6 @@
function showArchiveList() {
let isChecked = $("#showArchiveId").prop('checked');
// Show or hide the rows based on checkbox status
$(".deactivatedRow").each(function () {
if (isChecked) {
$(this).show();
} else {
$(this).hide();
}
});
}
$(document).ready(function () {
let table = $('#cost_listing').DataTable();
showArchiveList();
table.on('draw', function () {
showArchiveList();
});
});
</script> </script>
@ -441,3 +419,11 @@ $(document).on('keydown', function(event) {
}); });
</script> </script>
<script>
$(document).on("change", "#showArchiveId", function () {
console.log("Checkbox changed, submitting form...");
$("#archiveFormId").submit();
});
</script>

View File

@ -107,20 +107,23 @@
title="Reset"></i> title="Reset"></i>
<div style="margin-left:auto">
<div class="form-check" style="margin-right: 25px;">
<input class="form-check-input" type="checkbox" id="showArchiveId" name="showArchive" value="1"
onchange="showArchiveList()" style="width: 18px; height: 18px;">
<label class="form-check-label" for="showArchiveId" style="font-size: 1rem; margin-left: 8px;">
Show Archive
</label>
</div>
</div>
<div class="error" id="error"></div> <div class="error" id="error"></div>
</form> </form>
<div style="margin-left:auto">
<div class="form-check" style="margin-right: 25px;">
<form id="archiveFormId" action="<?php echo base_url()?>/departmentListing" method="post">
<input class="form-check-input" type="checkbox" id="showArchiveId"
name="showArchive" value="1" <?php echo $showArchive ? "checked" : " " ?>
style="width: 18px; height: 18px;">
<label class="form-check-label" for="showArchiveId"
style="font-size: 1rem; margin-left: 8px;">
Show Archive
</label>
</form>
</div>
</div>
<div class="card-body" style="overflow-x:scroll;"> <div class="card-body" style="overflow-x:scroll;">
<table id="department_list_table" class="table dt-responsive nowrap w-100"> <table id="department_list_table" class="table dt-responsive nowrap w-100">
<thead> <thead>
@ -139,13 +142,7 @@
if (!empty($userRecords)) { if (!empty($userRecords)) {
foreach ($userRecords as $record) { foreach ($userRecords as $record) {
?> ?>
<tr <tr>
class="<?php if ($record->IsActive == 0) {
echo "deactivatedRow";
} ?>"
style="<?php if ($record->IsActive == 0) {
echo "display:none";
} ?>">
<!-- <td title=" - Click here to view department details"> </td> --> <!-- <td title=" - Click here to view department details"> </td> -->
<?php if (date('d-m-Y', strtotime($record->CreatedDt)) == "30-11--0001") { <?php if (date('d-m-Y', strtotime($record->CreatedDt)) == "30-11--0001") {
$cdate = '00-00-0000'; $cdate = '00-00-0000';
@ -155,7 +152,7 @@
<td><?php echo $cdate; ?> </td> <td><?php echo $cdate; ?> </td>
<td><?php echo $record->DEPCode; ?></td> <td><?php echo $record->DEPCode; ?></td>
<td><?php echo $record->DepartmentName ?></td> <td><?php echo $record->DepartmentName ?></td>
<td><?php echo $record->HeadDept ?></td> <td><?php echo empty($record->headDepartmentName)?$record->DepartmentName:$record->headDepartmentName ?></td>
<td><?php if ($record->IsActive == 1) {echo"Active";}else{echo "InActive";}?></td> <td><?php if ($record->IsActive == 1) {echo"Active";}else{echo "InActive";}?></td>
<td> <td>
<?php if ($record->IsActive == 0) { ?> <?php if ($record->IsActive == 0) { ?>
@ -340,3 +337,13 @@
} }
</script> </script>
<script>
$(document).on("change", "#showArchiveId", function () {
console.log("Checkbox changed, submitting form...");
$("#archiveFormId").submit();
});
</script>

View File

@ -63,6 +63,20 @@
<td style="border-left: 0px ;border-bottom: 0px; border-right: 0px ;border-top: 0px ; white-space: nowrap;">Loan Balance </td> <td style="border-left: 0px ;border-bottom: 0px; border-right: 0px ;border-top: 0px ; white-space: nowrap;">Loan Balance </td>
<td style="border-left: 0px ;border-bottom: 0px; border-right: 0px ;border-top: 0px ; white-space: nowrap;" ><?php echo ':&nbsp;Rs&nbsp;'.$PayDetails[0]->BalanceAdvance ?></td> <td style="border-left: 0px ;border-bottom: 0px; border-right: 0px ;border-top: 0px ; white-space: nowrap;" ><?php echo ':&nbsp;Rs&nbsp;'.$PayDetails[0]->BalanceAdvance ?></td>
</tr> </tr>
<tr>
<td style="border-left: 0px ;border-bottom: 0px; border-right: 0px ;border-top: 0px ; white-space: nowrap;"> </td>
<td style="border-left: 0px ;border-bottom: 0px; border-right: 0px ;border-top: 0px ; white-space: nowrap;"><?php echo '&nbsp;' ?></td>
<td><?= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' ?></td>
<td style="border-left: 0px ;border-bottom: 0px; border-right: 0px ;border-top: 0px ; white-space: nowrap;">Diesel </td>
<td style="border-left: 0px ;border-bottom: 0px; border-right: 0px ;border-top: 0px ; white-space: nowrap;" ><?php echo ':&nbsp;Rs&nbsp;'.$PayDetails[0]->diesel_amount; ?></td>
</tr>
<tr>
<td style="border-left: 0px ;border-bottom: 0px; border-right: 0px ;border-top: 0px ; white-space: nowrap;"> </td>
<td style="border-left: 0px ;border-bottom: 0px; border-right: 0px ;border-top: 0px ; white-space: nowrap;"><?php echo '&nbsp;'; ?></td>
<td><?= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' ?></td>
<td style="border-left: 0px ;border-bottom: 0px; border-right: 0px ;border-top: 0px ; white-space: nowrap;">Shed Duty Amount </td>
<td style="border-left: 0px ;border-bottom: 0px; border-right: 0px ;border-top: 0px ; white-space: nowrap;" ><?php echo ':&nbsp;Rs&nbsp;'.$PayDetails[0]->shed_amount; ?></td>
</tr>
</tbody> </tbody>
</table> </table>
</td> </td>
@ -71,39 +85,27 @@
<table style="border-collapse: collapse;border-top:#fff;" cellpadding="0" cellspacing="0" border="1" width="100%" > <table style="border-collapse: collapse;border-top:#fff;" cellpadding="0" cellspacing="0" border="1" width="100%" >
<tr><th>Earnings</th><th>Amount <span style="font-family: DejaVu Sans; sans-serif;">&#8377;</span></th><th>Deductions</th><th>Amount <span style="font-family: DejaVu Sans; sans-serif;">&#8377;</span></th></tr> <tr><th>Earnings</th><th>Amount <span style="font-family: DejaVu Sans; sans-serif;">&#8377;</span></th><th>Deductions</th><th>Amount <span style="font-family: DejaVu Sans; sans-serif;">&#8377;</span></th></tr>
<tr> <tr>
<td width="25%;">&nbsp;Basic</td> <td width="25%;">&nbsp;BASIC</td>
<td width="20%;" style="text-align: right;" ><?php echo $PayDetails[0]->monthly_salary_amount; ?>&nbsp;</td> <td width="20%;" style="text-align: right;" ><?php echo $PayDetails[0]->BASIC; ?>&nbsp;</td>
<td width="25%;">&nbsp;PF</td> <td width="25%;">&nbsp;PF</td>
<td width="30%;" style="text-align: right;" ><?php echo $pf_amount; ?>&nbsp;</td> <td width="30%;" style="text-align: right;" ><?php echo $pf_amount; ?>&nbsp;</td>
</tr> </tr>
<tr> <tr>
<td width="25%;">&nbsp;Diesel</td> <td width="25%;">&nbsp;HRA</td>
<td width="20%;" style="text-align: right;" ><?php echo $PayDetails[0]->diesel_amount; ?>&nbsp;</td> <td width="20%;" style="text-align: right;" ><?php echo $PayDetails[0]->HRA; ?>&nbsp;</td>
<td>&nbsp;ESI</td> <td>&nbsp;ESI</td>
<td style="text-align: right;"> <?php echo $esi_amount ?>&nbsp;</td> <td style="text-align: right;"> <?php echo $esi_amount ?>&nbsp;</td>
</tr> </tr>
<tr> <tr>
<td width="25%;">&nbsp;Shed Duty Amount</td> <td width="25%;">&nbsp;Bonus</td>
<td width="20%;" style="text-align: right;" ><?php echo $PayDetails[0]->shed_amount; ?>&nbsp;</td> <td width="20%;" style="text-align: right;" ><?php echo $PayDetails[0]->Festival_Bonus; ?>&nbsp;</td>
<td>&nbsp;Salary Advance</td> <td>&nbsp;Salary Advance</td>
<td style="text-align: right;"> <?php echo $PayDetails[0]->Advance ?>&nbsp;</td> <td style="text-align: right;"> <?php echo $PayDetails[0]->Advance ?>&nbsp;</td>
</tr> </tr>
<tr>
<td width="25%;">&nbsp;Bonus</td>
<td width="20%;" style="text-align: right;" ><?php echo $PayDetails[0]->Festival_Bonus; ?>&nbsp;</td>
<td width="25%;">&nbsp;</td>
<td width="30%;" style="text-align: right;" >&nbsp;</td>
</tr>
<tr><th nowrap>&nbsp;Total Earning (Rounded)</th> <tr><th nowrap>&nbsp;Total Earning (Rounded)</th>
<td style="text-align: right;"> <td style="text-align: right;">
<?php <?php
$totEarning = $PayDetails[0]->monthly_salary_amount + $PayDetails[0]->Festival_Bonus + $PayDetails[0]->diesel_amount + $PayDetails[0]->shed_amount; $totEarning = $PayDetails[0]->BASIC + $PayDetails[0]->Festival_Bonus + $PayDetails[0]->HRA ;
echo number_format(round($totEarning),2) echo number_format(round($totEarning),2)
?> ?>
&nbsp;</td> &nbsp;</td>

View File

@ -796,9 +796,8 @@ if (!empty($POItem) && $CapitalRange == '1') {
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="table-responsive"> <div class="table-responsive" style="padding-bottom: 30px;">
<table id="serviceTax" class="table table-bordered table-hover mb-0" <table id="serviceTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
style="font-size:12px;">
<thead> <thead>
<tr> <tr>
<th style="white-space: nowrap !important; text-align:left !important">SNo</th> <th style="white-space: nowrap !important; text-align:left !important">SNo</th>
@ -3497,7 +3496,7 @@ Calculate Landing charge
$('#loader').show(); $('#loader').show();
disableButtons(); // disableButtons();
$.ajax({ $.ajax({
// data:$('.CapitalPO').serialize()+"&ExchangeRateOn="+ExchangeRateOn+"&PaymentMethod="+PaymentMethod+"&PayableAT="+PayableAT+"&PaymentDate="+PaymentDate, // data:$('.CapitalPO').serialize()+"&ExchangeRateOn="+ExchangeRateOn+"&PaymentMethod="+PaymentMethod+"&PayableAT="+PayableAT+"&PaymentDate="+PaymentDate,
type: "POST", type: "POST",
@ -3516,11 +3515,11 @@ Calculate Landing charge
$('#SpcialInstruction').val(''); $('#SpcialInstruction').val('');
$('#txtDeliveryAddress').val(''); $('#txtDeliveryAddress').val('');
window.location = status == 1 ? "amendmentpurchaseorder" : "purchaseorderListing"; window.location = status == 1 ? "amendmentpurchaseorder" : "purchaseorderListing";
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} else { } else {
$('#loader').hide(); $('#loader').hide();
alert("Error"); alert("Error");
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }
} }
@ -4056,7 +4055,7 @@ Calculate Landing charge
*/ */
function populateValueMainFormForEditCapitalTax() { function populateValueMainFormForEditCapitalTax() {
var rows = document.getElementById('serviceTax').rows.length; var rows = $('#serviceTax tbody tr').length;
var TotalOrderValueSummary = 0; var TotalOrderValueSummary = 0;
var basicfordometic = 0; var basicfordometic = 0;
var qty = 0; var qty = 0;

View File

@ -883,8 +883,9 @@ if (!empty($getlogpodtl)) {
</div> </div>
<div class="box-body"> <div class="box-body">
<table id="serviceTax" class="table table-bordered table-hover" <div class="form-row">
style="background-color:#fff;font-size:12px;"> <div class="table-responsive" style="padding-bottom: 30px;">
<table id="serviceTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<thead> <thead>
<tr> <tr>
<th>SNo</th> <th>SNo</th>
@ -1288,6 +1289,8 @@ if (!empty($getlogpodtl)) {
?> ?>
</tbody> </tbody>
</table> </table>
</div>
</div>
</div> </div>
@ -3932,6 +3935,7 @@ if (!empty($getlogpodtl)) {
$("#CPUOM").val(''); $("#CPUOM").val('');
$("#CPQuantity").val(''); $("#CPQuantity").val('');
$("#CPTotalAmount").val(''); $("#CPTotalAmount").val('');
$("#CPRate").val('');
RequistQuantity = ''; RequistQuantity = '';
clearTaxField(); clearTaxField();
if (id != '0') { if (id != '0') {
@ -3943,12 +3947,16 @@ if (!empty($getlogpodtl)) {
$("#CapitalItemName").val(obj.MaterialName); $("#CapitalItemName").val(obj.MaterialName);
$("#CPUOM").val(obj.UOM); $("#CPUOM").val(obj.UOM);
$("#CPQuantity").val(obj.Quantity); $("#CPQuantity").val(obj.Quantity);
$("#CPRate").val(obj.material_rate);
RequistQuantity = obj.Quantity; RequistQuantity = obj.Quantity;
var CPUOMDisplay = obj.UOM; var CPUOMDisplay = obj.UOM;
$('#RateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')'); $('#RateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')');
$('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')'); $('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')');
if(obj.material_rate != 0){
Ratechange();calculateFreight(3);calculateFreightlocaddper();
}
@ -4776,12 +4784,12 @@ if (!empty($getlogpodtl)) {
// ReceivedQuantity: 0, // ReceivedQuantity: 0,
// PendingQuantity: quantity // PendingQuantity: quantity
// })); // }));
PONOStatus = <?php echo $PONOStatus; ?> var PONOStatus = "<?php echo $PONOStatus; ?>";
var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName; var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
var rowHtml = ` var rowHtml = `
<tr id="${temp}"> <tr id="${temp}">
<td align="left">${temp}</td> <td align="left">${temp}</td>
<td align="left">${Reqnumber}</td> <td align="center">${Reqnumber}</td>
<td align="left">${materialCode}</td> <td align="left">${materialCode}</td>
<td align="left">${shorten}</td>`; <td align="left">${shorten}</td>`;
if (PONOStatus === "PO_DRAFT" || PONOStatus === "PO_CREATED") { if (PONOStatus === "PO_DRAFT" || PONOStatus === "PO_CREATED") {
@ -5377,7 +5385,7 @@ if (!empty($getlogpodtl)) {
*/ */
function populateValueMainFormForDeleteServiceTax(deletedRow) { function populateValueMainFormForDeleteServiceTax(deletedRow) {
var rows = document.getElementById('serviceTax').rows.length; var rows = $('#serviceTax tbody tr').length;
var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>; var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>;
var TotalOrderValueSummary = 0; var TotalOrderValueSummary = 0;
@ -6009,7 +6017,7 @@ if (!empty($getlogpodtl)) {
//alert('else'); //alert('else');
$('#loader').show(); $('#loader').show();
disableButtons(); // disableButtons();
//alert('ss'); //alert('ss');
var formData = new FormData($('.CapitalPO')[0]); var formData = new FormData($('.CapitalPO')[0]);
formData.append('ExchangeRateOn', ExchangeRateOn); formData.append('ExchangeRateOn', ExchangeRateOn);
@ -6060,11 +6068,11 @@ if (!empty($getlogpodtl)) {
clearAfterAddLineItemAdd(); clearAfterAddLineItemAdd();
window.location = "purchaseorderListing"; window.location = "purchaseorderListing";
setTimeout(function() { enableButtons(); }, 2000); // <!-- setTimeout(function() { enableButtons(); }, 2000); -->
} else { } else {
// $('#content').loader('hide'); // $('#content').loader('hide');
alert("Error"); alert("Error");
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }
} }
@ -6764,7 +6772,7 @@ if (!empty($getlogpodtl)) {
*/ */
function populateValueMainFormForEditCapitalTax() { function populateValueMainFormForEditCapitalTax() {
var rows = document.getElementById('serviceTax').rows.length; var rows = $('#serviceTax tbody tr').length;
var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>; var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>;
var TotalOrderValueSummary = 0; var TotalOrderValueSummary = 0;
@ -6914,7 +6922,7 @@ if (!empty($getlogpodtl)) {
function populateValueMainFormForViewCapitalTax() { function populateValueMainFormForViewCapitalTax() {
var rows = document.getElementById('serviceTax').rows.length; var rows = $('#serviceTax tbody tr').length;
var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>; var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>;
var TotalOrderValueSummary = 0; var TotalOrderValueSummary = 0;
@ -8105,7 +8113,7 @@ if (!empty($getlogpodtl)) {
function populateValueMainFormForupdateCapitalTax() { function populateValueMainFormForupdateCapitalTax() {
var rows = document.getElementById('serviceTax').rows.length; var rows = $('#serviceTax tbody tr').length;
var TotalFreight = 0; var TotalFreight = 0;
var i = 0; var i = 0;
do { do {

View File

@ -1198,8 +1198,8 @@ if (!empty($RequistionDetails)) {
<br /> <br />
<div class="form-row"> <div class="form-row">
<div class="table-responsive"> <div class="table-responsive" style="padding-bottom: 30px;">
<table id="ImportTax" class="table table-bordered table-hover mb-0" style="font-size:12px;"> <table id="ImportTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<thead> <thead>
<tr> <tr>
@ -2786,7 +2786,7 @@ if (!empty($RequistionDetails)) {
function populateValueMainFormForEditImportTax() { function populateValueMainFormForEditImportTax() {
var rows = document.getElementById('ImportTax').rows.length; var rows = $('#ImportTax tbody tr').length;
var TotalLanding = 0; var TotalLanding = 0;
var TotalCustom = 0; var TotalCustom = 0;
var TotalCustomED = 0; var TotalCustomED = 0;
@ -2933,7 +2933,7 @@ if (!empty($RequistionDetails)) {
// return false; // return false;
// } else { // } else {
$('#loader').show(); $('#loader').show();
disableButtons(); // disableButtons();
var formData = new FormData($('.ImportPO')[0]); var formData = new FormData($('.ImportPO')[0]);
if (status == 0) { // for draft if (status == 0) { // for draft
@ -2964,23 +2964,23 @@ if (!empty($RequistionDetails)) {
//$('#txtDeliveryAddress').val(''); //$('#txtDeliveryAddress').val('');
window.location = status == 1 ? "amendmentpurchaseorder" : "purchaseorderListing"; window.location = status == 1 ? "amendmentpurchaseorder" : "purchaseorderListing";
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} else { } else {
alert("Error"); alert("Error");
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }
}, },
error : function (){ error : function (){
console.error(error); console.error(error);
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
}, },
complete : function (){ complete : function (){
console.log("ajax call is completed "); console.log("ajax call is completed ");
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }

View File

@ -16,9 +16,6 @@
autoclose: true autoclose: true
}); });
}); });
</script> </script>
<?php <?php
@ -161,8 +158,8 @@ if (!empty($emppay)) {
<input type="hidden" class="form-control required" id="Created_Time" name="Created_Time" value="<?php echo $Created_Time; ?>"> <input type="hidden" class="form-control required" id="Created_Time" name="Created_Time" value="<?php echo $Created_Time; ?>">
<input type="hidden" class="form-control required" id="CreatedBy" name="CreatedBy" value="<?php echo $Created_By; ?>"> <input type="hidden" class="form-control required" id="CreatedBy" name="CreatedBy" value="<?php echo $Created_By; ?>">
<input type="hidden" readonly id="Pay_Data_ID" name="Pay_Data_ID" value="<?php echo $Pay_Data_ID; ?>"> <input type="hidden" readonly id="Pay_Data_ID" name="Pay_Data_ID" value="<?php echo $Pay_Data_ID; ?>">
<input type="hidden" class="form-control num" id="Old_Loan_Amount" value="<?php echo $Loan_Amount; ?>" > <input type="hidden" class="form-control num" id="Old_Loan_Amount" value="<?php echo $Loan_Amount; ?>">
<input type="hidden" class="form-control num" id="Old_monthly_due" value="<?php echo $Monthly_due; ?>" > <input type="hidden" class="form-control num" id="Old_monthly_due" value="<?php echo $Monthly_due; ?>">
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
@ -207,7 +204,7 @@ if (!empty($emppay)) {
<div class="form-group"> <div class="form-group">
<div class="form-group"> <div class="form-group">
<span for="EmpID">Loan Issue(d) Date</span> <span for="EmpID">Loan Issue(d) Date</span>
<input type="text" class="form-control num" id="loan_issued_date" name="loan_issued_date" value="<?php echo $Loan_issued_date; ?>" > <input type="text" class="form-control num" id="loan_issued_date" name="loan_issued_date" value="<?php echo $Loan_issued_date; ?>">
</div> </div>
</div> </div>
</div> </div>
@ -216,7 +213,7 @@ if (!empty($emppay)) {
<div class="form-group"> <div class="form-group">
<div class="form-group"> <div class="form-group">
<span for="Basic_Pay">Due Started</span> <span for="Basic_Pay">Due Started</span>
<input type="text" class="form-control requried num" id="due_started" name="due_started" value="<?php echo $Due_start_date; ?>" > <input type="text" class="form-control requried num" id="due_started" name="due_started" value="<?php echo $Due_start_date; ?>">
</div> </div>
</div> </div>
</div> </div>
@ -225,100 +222,101 @@ if (!empty($emppay)) {
<div class="form-group"> <div class="form-group">
<div class="form-group"> <div class="form-group">
<span for="Basic_Pay">Paid Amount</span> <span for="Basic_Pay">Paid Amount</span>
<input type="text" class="form-control requried num" id="Paid_Amount" name="Paid_Amount" value="<?php echo $Paid_Amount; ?>" readonly> <input type="text" class="form-control requried num" id="Paid_Amount" name="Paid_Amount" value="<?php echo $Paid_Amount; ?>" readonly>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<span for="">Paid Due</span> <span for="">Paid Due</span>
<input type="text" class="form-control requried num" id="paid_due" name="paid_due" value="<?php echo $Paid_Due; ?>" readonly> <input type="text" class="form-control requried num" id="paid_due" name="paid_due" value="<?php echo $Paid_Due; ?>" readonly>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<span for="">Remaining Due</span> <span for="">Remaining Due</span>
<input type="text" class="form-control requried num" id="remaining_due" name="remaining_due" value="<?php echo $Remaining_Due; ?>" readonly> <input type="text" class="form-control requried num" id="remaining_due" name="remaining_due" value="<?php echo $Remaining_Due; ?>" readonly>
</div> </div>
</div> </div>
</div> </div>
<!-- File --> <!-- File -->
<h4 class="header-title">Loan Documents</h4> <h4 class="header-title">Loan Documents</h4>
<!-- Text input--> <!-- Text input-->
<div class="row"> <div class="row">
<div class="form-group" > <div class="form-group">
<div class="col-md-4"> <div class="col-md-4">
<span class="col-form-label" for="request_letter">Request letter</span> <span class="col-form-label" for="request_letter">Request letter</span>
<input style="margin-top: 5px;" type="file" size="20" accept=".docx,.pdf,.doc,.jpg,.png" id="request_letter" name="request_letter" /> <input style="margin-top: 5px;" type="file" size="20" accept=".docx,.pdf,.doc,.jpg,.png" id="request_letter" name="request_letter" />
<input type="hidden" id="hidden_request_letter" name="hidden_request_letter" value="<?php echo $request_letter; ?>" /> <input type="hidden" id="hidden_request_letter" name="hidden_request_letter" value="<?php echo $request_letter; ?>" />
</div> </div>
</div> </div>
<?php if ($request_letter) { ?> <?php if ($request_letter) { ?>
<div class="form-group" > <div class="form-group">
<div class="col-md-8"> <div class="col-md-8">
<u> <u>
<a href="<?php echo base_url() . 'public/uploads/images/' . $request_letter ?>"> <a href="<?php echo base_url() . 'public/uploads/images/' . $request_letter ?>">
<span>Previously Uploaded Document - </span><small><?= $request_letter; ?></small> <span>Previously Uploaded Document - </span><small><?= $request_letter; ?></small>
</a> </a>
</u> </u>
</div> </div>
</div> </div>
<?php } ?> <?php } ?>
</div> </div>
<div class="row"> <div class="row">
<div class="form-group" > <div class="form-group">
<div class=" col-md-4"> <div class=" col-md-4">
<span class="col-form-label" for="payment_statement">Payment Receipt</span> <span class="col-form-label" for="payment_statement">Payment Receipt</span>
<input style="margin-top: 5px;" type="file" size="20" accept=".docx,.pdf,.doc,.jpg,.png" id="payment_statement" name="payment_statement" /> <input style="margin-top: 5px;" type="file" size="20" accept=".docx,.pdf,.doc,.jpg,.png" id="payment_statement" name="payment_statement" />
<input type="hidden" id="hidden_payment_statement" name="hidden_payment_statement" value="<?php echo $payment_statement; ?>" /> <input type="hidden" id="hidden_payment_statement" name="hidden_payment_statement" value="<?php echo $payment_statement; ?>" />
</div> </div>
</div> </div>
<?php if ($payment_statement) { ?> <?php if ($payment_statement) { ?>
<div class="form-group" > <div class="form-group">
<div class="col-md-8"> <div class="col-md-8">
<u> <u>
<a href="<?php echo base_url() . 'public/uploads/images/' . $payment_statement ?>"> <a href="<?php echo base_url() . 'public/uploads/images/' . $payment_statement ?>">
<span>Previously Uploaded Document - </span><small><?= $payment_statement; ?></small> <span>Previously Uploaded Document - </span><small><?= $payment_statement; ?></small>
</a> </a>
</u> </u>
</div> </div>
</div> </div>
<?php } ?> <?php } ?>
</div> </div>
<div class="container"> <div class="container">
<h3>Loan History</h3> <h3>Loan History</h3>
<table class="table table-bordered table-striped"> <table class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th>Due Amount</th> <th>Due Amount</th>
<th>Balance Amount </th> <th>Balance Amount </th>
<th>Debit Date</th> <th>Debit Date</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php if (!empty($loan_histoty)): ?> <?php if (!empty($loan_histoty)): ?>
<?php foreach ($loan_histoty as $history): ?> <?php foreach ($loan_histoty as $history): ?>
<tr> <tr>
<td><?php echo number_format($history->Due_Amount, 2); ?></td> <td><?php echo number_format($history->Due_Amount, 2); ?></td>
<td><?php echo number_format($history->Balance_Amount, 2); ?></td> <td><?php echo number_format($history->Balance_Amount, 2); ?></td>
<td><?php $entryDate = new DateTime($history->Entry_Date); echo $entryDate->format('F j, Y, g:i A'); ?></td> <td><?php $entryDate = new DateTime($history->Entry_Date);
</tr> echo $entryDate->format('F j, Y, g:i A'); ?></td>
<?php endforeach; ?> </tr>
<?php else: ?> <?php endforeach; ?>
<tr> <?php else: ?>
<td colspan="6" class="text-center">No Loan History Found</td> <tr>
</tr> <td colspan="6" class="text-center">No Loan History Found</td>
<?php endif; ?> </tr>
</tbody> <?php endif; ?>
</table> </tbody>
</div> </table>
</div>
@ -383,10 +381,6 @@ if (!empty($emppay)) {
</div> <!-- content --> </div> <!-- content -->
<script> <script>
// function duecalculation() { // function duecalculation() {
// var totaldue = 0; // var totaldue = 0;
// var loan = document.getElementById('Loan_Amount').value; // var loan = document.getElementById('Loan_Amount').value;

View File

@ -1219,8 +1219,7 @@ if (!empty($INRSYMBOL)) {
<br> <br>
<div class="form-row"> <div class="form-row">
<div class="table-responsive" style="padding-bottom: 30px;"> <div class="table-responsive" style="padding-bottom: 30px;">
<table id="ServiceTable" class="table table-bordered table-hover mb-0" <table id="ServiceTable" class="table table-bordered table-hover" style="font-size:12px;">
style="font-size:12px;">
<thead> <thead>
<tr> <tr>
@ -1555,7 +1554,7 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-12" align="right"><br /> <div class="form-group col-md-12"><br />
<div> <div>
<input type="file" name="POFile" id="POFile"> <input type="file" name="POFile" id="POFile">
<?php if ($PrePOFile) { ?> <?php if ($PrePOFile) { ?>
@ -2271,6 +2270,7 @@ if (!empty($INRSYMBOL)) {
$('#BudgetType').attr("style", "pointer-events: none;"); $('#BudgetType').attr("style", "pointer-events: none;");
$('#EditRevenue').click(function () { $('#EditRevenue').click(function () {
console.log("####");
tinyMCE.triggerSave(); tinyMCE.triggerSave();
if (validateEditRevenueTax() && validateEditExceedLimit()) { if (validateEditRevenueTax() && validateEditExceedLimit()) {
var CostCode = $("#EditCostCenter").val(); var CostCode = $("#EditCostCenter").val();
@ -2408,7 +2408,7 @@ if (!empty($INRSYMBOL)) {
} }
function populateValueMainFormForEditRevenueTax() { function populateValueMainFormForEditRevenueTax() {
var rows = document.getElementById('revenueTax').rows.length; var rows = $('#revenueTax tbody tr').length;
var totBasicAmt = 0; var totBasicAmt = 0;
var totDiscountAmt = 0; var totDiscountAmt = 0;
var totPackagingAmt = 0; var totPackagingAmt = 0;
@ -2484,7 +2484,8 @@ if (!empty($INRSYMBOL)) {
<script> <script>
function validateBudgetExceedLimit() { function validateBudgetExceedLimit() {
//alert('inside validateBudgetExceedLimit function'); //alert('inside validateBudgetExceedLimit function');
var rows = document.getElementById('revenueTax').rows.length; // var rows = document.getElementById('revenueTax').rows.length;
var rows = $('#revenueTax tbody tr').length;
var ReqType = '<?php echo REVENUE ?>'; var ReqType = '<?php echo REVENUE ?>';
for (i = 1; i < rows; i++) { for (i = 1; i < rows; i++) {
var costcode = $('#costCode' + i).val(); var costcode = $('#costCode' + i).val();
@ -2575,7 +2576,7 @@ if (!empty($INRSYMBOL)) {
}; };
$('#loader').show(); $('#loader').show();
disableButtons(); // disableButtons();
$.ajax({ $.ajax({
// data:$('.CreatePO').serialize(), // data:$('.CreatePO').serialize(),
type: "POST", type: "POST",
@ -2594,21 +2595,21 @@ if (!empty($INRSYMBOL)) {
$('#txtDeliveryAddress').val('') $('#txtDeliveryAddress').val('')
window.location = (status == 1) ? "amendmentpurchaseorder" : "purchaseorderListing"; window.location = (status == 1) ? "amendmentpurchaseorder" : "purchaseorderListing";
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} else { } else {
$('#loader').hide(); $('#loader').hide();
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }
}, },
error : function(error){ error : function(error){
console.error("error occured" + error); console.error("error occured" + error);
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
}, },
complete : function (){ complete : function (){
$('#loader').hide(); $('#loader').hide();
console.log("ajax call is completed ..!!") console.log("ajax call is completed ..!!")
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }
}); });

View File

@ -541,6 +541,10 @@ if (!empty($getlogpodtl)) {
$("#ItemName").val(obj.MaterialName); $("#ItemName").val(obj.MaterialName);
$("#UOM").val(obj.UOM); $("#UOM").val(obj.UOM);
$("#Quantity").val(obj.Quantity); $("#Quantity").val(obj.Quantity);
$("#Rate").val(obj.material_rate);
if(obj.material_rate != 0){
change();
}
RequistQuantity = obj.Quantity; RequistQuantity = obj.Quantity;
} }
}); });
@ -2132,9 +2136,10 @@ if (!empty($getlogpodtl)) {
<div class="form-group col-md-3" id="Deliverydtdiv"> <div class="form-group col-md-3" id="Deliverydtdiv">
<label>Delivery Date<span class="text-danger">*</span></label> <label>Delivery Date<span class="text-danger">*</span></label>
<div class="form-group"> <div class="form-group">
<input class="form-control num" data-provide="datepicker" data-date-format="dd-mm-yyyy" data-date-autoclose="true" id="Deliverydt" name="Deliverydt" data-date-start-date="<?= date('d-m-Y'); ?>" required autocomplete="off" value="<?= $Deliverydt; ?>">
<?php <?php
$data = array('name' => 'Deliverydt', 'value' => set_value('Deliverydt', $Deliverydt), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;'); // $data = array('name' => 'Deliverydt', 'value' => set_value('Deliverydt', $Deliverydt), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data); // echo form_input($data);
?> ?>
</div> </div>
@ -2161,9 +2166,10 @@ if (!empty($getlogpodtl)) {
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label>Purchase Order Date</label> <label>Purchase Order Date</label>
<div class="form-group"> <div class="form-group">
<input class="form-control num" data-provide="datepicker" data-date-format="dd-mm-yyyy" data-date-autoclose="true" id="PODate" name="PODate" data-date-start-date="<?= date('d-m-Y'); ?>" required autocomplete="off" value="<?= $PODate; ?>">
<?php <?php
$data = array('name' => 'PODate', 'value' => set_value('PODate', $PODate), 'id' => 'PODate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;'); // $data = array('name' => 'PODate', 'value' => set_value('PODate', $PODate), 'id' => 'PODate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data); // echo form_input($data);
?> <input type="hidden" name="b4podate" id="b4podate" value="<?php echo $PODate; ?>"> ?> <input type="hidden" name="b4podate" id="b4podate" value="<?php echo $PODate; ?>">
</div> </div>
</div> </div>
@ -2326,9 +2332,8 @@ if (!empty($getlogpodtl)) {
</div> </div>
<br> <br>
<div class="form-row"> <div class="form-row">
<div class="table-responsive" style="padding-bottom:30px;"> <div class="table-responsive" style="padding-bottom: 30px;">
<table id="revenueTax" class="table table-bordered table-hover" <table id="revenueTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
style="font-size:12px;">
<thead> <thead>
<tr> <tr>
@ -4791,7 +4796,7 @@ if (!empty($getlogpodtl)) {
function populateValueMainFormForEditRevenueTax() { function populateValueMainFormForEditRevenueTax() {
var rows = document.getElementById('revenueTax').rows.length; var rows = $('#revenueTax tbody tr').length;
//alert(rows); //alert(rows);
var editrow = parseFloat(rows) - 1; var editrow = parseFloat(rows) - 1;
//alert(editrow); //alert(editrow);
@ -4978,7 +4983,7 @@ if (!empty($getlogpodtl)) {
} }
function validateBudgetExceedLimit() { function validateBudgetExceedLimit() {
var rows = document.getElementById('revenueTax').rows.length; var rows = $('#revenueTax tbody tr').length;
var ReqType = '<?php echo REVENUE ?>'; var ReqType = '<?php echo REVENUE ?>';
for (i = 1; i < rows; i++) { for (i = 1; i < rows; i++) {
@ -5403,7 +5408,7 @@ if (!empty($getlogpodtl)) {
// } else { // } else {
var formData = new FormData($('.CreatePO')[0]); var formData = new FormData($('.CreatePO')[0]);
$('#loader').show(); $('#loader').show();
disableButtons(); // disableButtons();
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "<?php echo base_url() ?>purchaseorder/EditRevenuePurchaseOrder", url: "<?php echo base_url() ?>purchaseorder/EditRevenuePurchaseOrder",
@ -5421,11 +5426,11 @@ if (!empty($getlogpodtl)) {
$('#SpcialInstruction').val(''); $('#SpcialInstruction').val('');
$('#txtDeliveryAddress').val('') $('#txtDeliveryAddress').val('')
window.location = "purchaseorderListing"; window.location = "purchaseorderListing";
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} else { } else {
alert("Something went wrong"); alert("Something went wrong");
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }
}, },
@ -5434,7 +5439,7 @@ if (!empty($getlogpodtl)) {
$('#loader').hide(); $('#loader').hide();
console.error("AJAX Error: ", textStatus, errorThrown); console.error("AJAX Error: ", textStatus, errorThrown);
alert("An error occurred: " + textStatus + " - " + errorThrown); alert("An error occurred: " + textStatus + " - " + errorThrown);
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
}, },

View File

@ -293,7 +293,7 @@ foreach ($PaymentTerms as $TER) {
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>; var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
var AvlBudAmt = '<?php echo $AvlAmount ?>'; var AvlBudAmt = '<?php echo $AvlAmount ?>';
//ServiceTable //ServiceTable
var rows = document.getElementById('ServiceTable').rows.length; var rows = $('#ServiceTable tbody tr').length;
if (DeletedMaterialCode != undefined && DeletedMaterialCode != '') { if (DeletedMaterialCode != undefined && DeletedMaterialCode != '') {
@ -1012,166 +1012,170 @@ foreach ($PaymentTerms as $TER) {
<br /> <br />
<table id="ServiceTable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;"> <div class="form-row">
<thead> <div class="table-responsive" style="padding-bottom: 30px;">
<tr> <table id="ServiceTable" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<th>SNo</th> <thead>
<th style="white-space: nowrap !important; text-align:center !important">Requisition No</th> <tr>
<th style="white-space: nowrap !important;">Item Code</th> <th>SNo</th>
<th style="white-space: nowrap !important;">Item Description</th> <th style="white-space: nowrap !important; text-align:center !important">Requisition No</th>
<th style="white-space: nowrap !important; text-align:right !important">Quantity</th> <th style="white-space: nowrap !important;">Item Code</th>
<th style="white-space: nowrap !important;">UOM</th> <th style="white-space: nowrap !important;">Item Description</th>
<th style="white-space: nowrap !important; text-align:right !important">Rate<?php echo "($INRSYM)" ?></th> <th style="white-space: nowrap !important; text-align:right !important">Quantity</th>
<th style="white-space: nowrap !important; text-align:right !important">Basic Amount<?php echo "($INRSYM)" ?></th> <th style="white-space: nowrap !important;">UOM</th>
<th style="white-space: nowrap !important; text-align:right !important">Tax Amount<?php echo "($INRSYM)" ?></th> <th style="white-space: nowrap !important; text-align:right !important">Rate<?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Total Order Amount<?php echo "($INRSYM)" ?></th> <th style="white-space: nowrap !important; text-align:right !important">Basic Amount<?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Actual Quantity</th> <th style="white-space: nowrap !important; text-align:right !important">Tax Amount<?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Received Quantity</th> <th style="white-space: nowrap !important; text-align:right !important">Total Order Amount<?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Pending Quantity</th> <th style="white-space: nowrap !important; text-align:right !important">Actual Quantity</th>
<th>Action</th> <th style="white-space: nowrap !important; text-align:right !important">Received Quantity</th>
</tr> <th style="white-space: nowrap !important; text-align:right !important">Pending Quantity</th>
</thead> <th>Action</th>
<tbody id='ServiceAppend'>
<?php
if (!empty($POItem)) {
//print_r($POItem);
$index = 0;
foreach ($POItem as $record) {
$index = $index + 1;
if ($record->Schedule_Type != 'Recurring') {
$FrequencyNo = intval(1);
$Frequency = 'One Time';
} else {
$FrequencyNo = $record->NumberOfService;
$Frequency = $record->Service_Period;
}
?>
<tr id="<?php echo $index; ?>">
<td><?php echo $index; ?></td>
<td style="text-align:center !important"><?php echo $record->ReqNo ?> </td>
<td><?php echo $record->MaterialCode ?></td>
<td><?php $shortName = mb_strimwidth($record->MaterialName, 0, 13, "...");
echo $shortName; ?></td>
<td style="text-align:right !important"><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td>
<td style="text-align:right !important"><?php echo $record->Rate ?></td>
<td style="text-align:right !important"><?php echo number_format($record->BasicValue * $FrequencyNo, 2, '.', ''); ?></td>
<td style="text-align:right !important"><?php echo $record->Taxamount ?></td>
<td style="text-align:right !important"><?php echo $record->TotalValue ?></td>
<td style="text-align:right !important"><?php echo $record->Quantity ?></td>
<td style="text-align:right !important"><?php echo $record->ReceivedQuantity ?></td>
<td style="text-align:right !important"><?php echo number_format($record->Quantity - $record->ReceivedQuantity, 2, '.', ''); ?></td>
<input type="hidden" name="<?php echo 'Reqnumber' . $index ?>" id="<?php echo 'Reqnumber' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
<input type="hidden" name="<?php echo 'departmentName' . $index ?>" id="<?php echo 'departmentName' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
<input type="hidden" name="<?php echo 'AvilBudget' . $index ?>" id="<?php echo 'AvilBudget' . $index ?>" value="<?php echo $AvlAmount; ?>" />
<input type="hidden" name="<?php echo 'LineItemNo' . $index ?>" id="<?php echo 'LineItemNo' . $index ?>" value="<?php echo $record->LineItemNo; ?>" />
<input type="hidden" name="<?php echo 'costCode' . $index ?>" id="<?php echo 'costCode' . $index ?>" value="<?php echo $record->CostCenterCode; ?>" />
<input type="hidden" name="<?php echo 'materialCode' . $index ?>" id="<?php echo 'materialCode' . $index ?>" value="<?php echo $record->MaterialCode; ?>" />
<input type="hidden" name="<?php echo 'materialName' . $index ?>" id="<?php echo 'materialName' . $index ?>" value="<?php echo $record->MaterialName; ?>" />
<input type="hidden" name="<?php echo 'uom' . $index ?>" id="<?php echo 'uom' . $index ?>" value="<?php echo $record->UOM; ?>" />
<input type="hidden" name="<?php echo 'per' . $index ?>" id="<?php echo 'per' . $index ?>" value="<?php echo $record->Per; ?>" />
<input type="hidden" name="<?php echo 'quantity' . $index ?>" id="<?php echo 'quantity' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input type="hidden" name="<?php echo 'beforequantity' . $index ?>" id="<?php echo 'beforequantity' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input type="hidden" name="<?php echo 'itemRate' . $index ?>" id="<?php echo 'itemRate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input type="hidden" name="<?php echo 'beforeitemRate' . $index ?>" id="<?php echo 'beforeitemRate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input type="hidden" name="<?php echo 'Cgst' . $index ?>" id="<?php echo 'Cgst' . $index ?>" value="<?php echo $record->CGST; ?>" />
<input type="hidden" name="<?php echo 'beforeCgst' . $index ?>" id="<?php echo 'beforeCgst' . $index ?>" value="<?php echo $record->CGST; ?>" />
<input type="hidden" name="<?php echo 'AfterCgst' . $index ?>" id="<?php echo 'AfterCgst' . $index ?>" value="<?php echo $record->After_CGST; ?>" />
<input type="hidden" name="<?php echo 'beforeCgstvalue' . $index ?>" id="<?php echo 'beforeCgstvalue' . $index ?>" value="<?php echo $record->After_CGST; ?>" />
<input type="hidden" name="<?php echo 'Sgst' . $index ?>" id="<?php echo 'Sgst' . $index ?>" value="<?php echo $record->SGST; ?>" />
<input type="hidden" name="<?php echo 'beforeSgst' . $index ?>" id="<?php echo 'beforeSgst' . $index ?>" value="<?php echo $record->SGST; ?>" />
<input type="hidden" name="<?php echo 'AfterSgst' . $index ?>" id="<?php echo 'AfterSgst' . $index ?>" value="<?php echo $record->After_SGST; ?>" />
<input type="hidden" name="<?php echo 'beforeSgstvalue' . $index ?>" id="<?php echo 'beforeSgstvalue' . $index ?>" value="<?php echo $record->After_SGST; ?>" />
<input type="hidden" name="<?php echo 'Igst' . $index ?>" id="<?php echo 'Igst' . $index ?>" value="<?php echo $record->IGST; ?>" />
<input type="hidden" name="<?php echo 'beforeIgst' . $index ?>" id="<?php echo 'beforeIgst' . $index ?>" value="<?php echo $record->IGST; ?>" />
<input type="hidden" name="<?php echo 'AfterIgst' . $index ?>" id="<?php echo 'AfterIgst' . $index ?>" value="<?php echo $record->After_IGST; ?>" />
<input type="hidden" name="<?php echo 'beforeIgstvalue' . $index ?>" id="<?php echo 'beforeIgstvalue' . $index ?>" value="<?php echo $record->After_IGST; ?>" />
<input type="hidden" name="<?php echo 'otherallowance' . $index ?>" id="<?php echo 'otherallowance' . $index ?>" value="<?php echo $record->otherallowance; ?>" />
<input type="hidden" name="<?php echo 'beforeotherallowance' . $index ?>" id="<?php echo 'beforeotherallowance' . $index ?>" value="<?php echo $record->otherallowance; ?>" />
<input type="hidden" name="<?php echo 'TotalOrderValue' . $index ?>" id="<?php echo 'TotalOrderValue' . $index ?>" value="<?php echo $record->TotalValue; ?>" />
<input type="hidden" name="<?php echo 'servicematerialdescription' . $index ?>" id="<?php echo 'servicematerialdescription' . $index ?>" value="<?php echo $record->ServiceMaterialDescription; ?>" />
<input type="hidden" name="<?php echo 'Frequency' . $index ?>" id="<?php echo 'Frequency' . $index ?>" value="<?php echo $Frequency; ?>" />
<input type="hidden" name="<?php echo 'FrequencyNo' . $index ?>" id="<?php echo 'FrequencyNo' . $index ?>" value="<?php echo $FrequencyNo; ?>" />
<input type="hidden" name="<?php echo 'FrequencyValue' . $index ?>" id="<?php echo 'FrequencyValue' . $index ?>" value="<?php echo $FrequencyNo; ?>" />
<input type="hidden" name="<?php echo 'OtherServiceDescription' . $index ?>" id="<?php echo 'OtherServiceDescription' . $index ?>" value="<?php echo $record->MaterialDescription; ?>" />
<?php
//if($PONOStatus == PO_DRAFT)
//{
?>
<td> <a data-target='#EDITSERVICE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>"
data-toggle="modal" href="#EDITSERVICE"><i class="ri-pencil-fill" data-toggle="tooltip"
title="Click here to view/Edit the <?php echo $record->ReqNo; ?>
Requisition details"></i>&nbsp;&nbsp;&nbsp;
<!-- </a> <a href='#' onclick = "DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del" ><span class="ri-delete-bin-7-fill"></span></a>-->
<?php
//} else {
?>
<!-- <td> <a data-toggle="tooltip" href="#"><i class="fa fa-eye" data-toggle="tooltip" title="<?php echo $record->ReqNo; ?> - Click here to view Requistion details"></i>&nbsp;&nbsp;&nbsp;</a> </td> -->
<?php
//}
?>
</tr> </tr>
<?php </thead>
$TotalCgst = $TotalCgst + $record->After_CGST;
$TotalSgst = $TotalSgst + $record->After_SGST; <tbody id='ServiceAppend'>
$TotalIgst = $TotalIgst + $record->After_IGST; <?php
$Totalotherallowance = $Totalotherallowance + $record->otherallowance;
$TotalSummary = $TotalSummary + $record->TotalValue; if (!empty($POItem)) {
//print_r($POItem);
$TotalBasicAmount = $TotalBasicAmount + ($record->BasicValue * $FrequencyNo); $index = 0;
}
?> <input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $index; ?>">
<?php
} foreach ($POItem as $record) {
?> $index = $index + 1;
</tbody> if ($record->Schedule_Type != 'Recurring') {
</table> $FrequencyNo = intval(1);
$Frequency = 'One Time';
} else {
$FrequencyNo = $record->NumberOfService;
$Frequency = $record->Service_Period;
}
?>
<tr id="<?php echo $index; ?>">
<td><?php echo $index; ?></td>
<td style="text-align:center !important"><?php echo $record->ReqNo ?> </td>
<td><?php echo $record->MaterialCode ?></td>
<td><?php $shortName = mb_strimwidth($record->MaterialName, 0, 13, "...");
echo $shortName; ?></td>
<td style="text-align:right !important"><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td>
<td style="text-align:right !important"><?php echo $record->Rate ?></td>
<td style="text-align:right !important"><?php echo number_format($record->BasicValue * $FrequencyNo, 2, '.', ''); ?></td>
<td style="text-align:right !important"><?php echo $record->Taxamount ?></td>
<td style="text-align:right !important"><?php echo $record->TotalValue ?></td>
<td style="text-align:right !important"><?php echo $record->Quantity ?></td>
<td style="text-align:right !important"><?php echo $record->ReceivedQuantity ?></td>
<td style="text-align:right !important"><?php echo number_format($record->Quantity - $record->ReceivedQuantity, 2, '.', ''); ?></td>
<input type="hidden" name="<?php echo 'Reqnumber' . $index ?>" id="<?php echo 'Reqnumber' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
<input type="hidden" name="<?php echo 'departmentName' . $index ?>" id="<?php echo 'departmentName' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
<input type="hidden" name="<?php echo 'AvilBudget' . $index ?>" id="<?php echo 'AvilBudget' . $index ?>" value="<?php echo $AvlAmount; ?>" />
<input type="hidden" name="<?php echo 'LineItemNo' . $index ?>" id="<?php echo 'LineItemNo' . $index ?>" value="<?php echo $record->LineItemNo; ?>" />
<input type="hidden" name="<?php echo 'costCode' . $index ?>" id="<?php echo 'costCode' . $index ?>" value="<?php echo $record->CostCenterCode; ?>" />
<input type="hidden" name="<?php echo 'materialCode' . $index ?>" id="<?php echo 'materialCode' . $index ?>" value="<?php echo $record->MaterialCode; ?>" />
<input type="hidden" name="<?php echo 'materialName' . $index ?>" id="<?php echo 'materialName' . $index ?>" value="<?php echo $record->MaterialName; ?>" />
<input type="hidden" name="<?php echo 'uom' . $index ?>" id="<?php echo 'uom' . $index ?>" value="<?php echo $record->UOM; ?>" />
<input type="hidden" name="<?php echo 'per' . $index ?>" id="<?php echo 'per' . $index ?>" value="<?php echo $record->Per; ?>" />
<input type="hidden" name="<?php echo 'quantity' . $index ?>" id="<?php echo 'quantity' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input type="hidden" name="<?php echo 'beforequantity' . $index ?>" id="<?php echo 'beforequantity' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input type="hidden" name="<?php echo 'itemRate' . $index ?>" id="<?php echo 'itemRate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input type="hidden" name="<?php echo 'beforeitemRate' . $index ?>" id="<?php echo 'beforeitemRate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input type="hidden" name="<?php echo 'Cgst' . $index ?>" id="<?php echo 'Cgst' . $index ?>" value="<?php echo $record->CGST; ?>" />
<input type="hidden" name="<?php echo 'beforeCgst' . $index ?>" id="<?php echo 'beforeCgst' . $index ?>" value="<?php echo $record->CGST; ?>" />
<input type="hidden" name="<?php echo 'AfterCgst' . $index ?>" id="<?php echo 'AfterCgst' . $index ?>" value="<?php echo $record->After_CGST; ?>" />
<input type="hidden" name="<?php echo 'beforeCgstvalue' . $index ?>" id="<?php echo 'beforeCgstvalue' . $index ?>" value="<?php echo $record->After_CGST; ?>" />
<input type="hidden" name="<?php echo 'Sgst' . $index ?>" id="<?php echo 'Sgst' . $index ?>" value="<?php echo $record->SGST; ?>" />
<input type="hidden" name="<?php echo 'beforeSgst' . $index ?>" id="<?php echo 'beforeSgst' . $index ?>" value="<?php echo $record->SGST; ?>" />
<input type="hidden" name="<?php echo 'AfterSgst' . $index ?>" id="<?php echo 'AfterSgst' . $index ?>" value="<?php echo $record->After_SGST; ?>" />
<input type="hidden" name="<?php echo 'beforeSgstvalue' . $index ?>" id="<?php echo 'beforeSgstvalue' . $index ?>" value="<?php echo $record->After_SGST; ?>" />
<input type="hidden" name="<?php echo 'Igst' . $index ?>" id="<?php echo 'Igst' . $index ?>" value="<?php echo $record->IGST; ?>" />
<input type="hidden" name="<?php echo 'beforeIgst' . $index ?>" id="<?php echo 'beforeIgst' . $index ?>" value="<?php echo $record->IGST; ?>" />
<input type="hidden" name="<?php echo 'AfterIgst' . $index ?>" id="<?php echo 'AfterIgst' . $index ?>" value="<?php echo $record->After_IGST; ?>" />
<input type="hidden" name="<?php echo 'beforeIgstvalue' . $index ?>" id="<?php echo 'beforeIgstvalue' . $index ?>" value="<?php echo $record->After_IGST; ?>" />
<input type="hidden" name="<?php echo 'otherallowance' . $index ?>" id="<?php echo 'otherallowance' . $index ?>" value="<?php echo $record->otherallowance; ?>" />
<input type="hidden" name="<?php echo 'beforeotherallowance' . $index ?>" id="<?php echo 'beforeotherallowance' . $index ?>" value="<?php echo $record->otherallowance; ?>" />
<input type="hidden" name="<?php echo 'TotalOrderValue' . $index ?>" id="<?php echo 'TotalOrderValue' . $index ?>" value="<?php echo $record->TotalValue; ?>" />
<input type="hidden" name="<?php echo 'servicematerialdescription' . $index ?>" id="<?php echo 'servicematerialdescription' . $index ?>" value="<?php echo $record->ServiceMaterialDescription; ?>" />
<input type="hidden" name="<?php echo 'Frequency' . $index ?>" id="<?php echo 'Frequency' . $index ?>" value="<?php echo $Frequency; ?>" />
<input type="hidden" name="<?php echo 'FrequencyNo' . $index ?>" id="<?php echo 'FrequencyNo' . $index ?>" value="<?php echo $FrequencyNo; ?>" />
<input type="hidden" name="<?php echo 'FrequencyValue' . $index ?>" id="<?php echo 'FrequencyValue' . $index ?>" value="<?php echo $FrequencyNo; ?>" />
<input type="hidden" name="<?php echo 'OtherServiceDescription' . $index ?>" id="<?php echo 'OtherServiceDescription' . $index ?>" value="<?php echo $record->MaterialDescription; ?>" />
<?php
//if($PONOStatus == PO_DRAFT)
//{
?>
<td> <a data-target='#EDITSERVICE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>"
data-toggle="modal" href="#EDITSERVICE"><i class="ri-pencil-fill" data-toggle="tooltip"
title="Click here to view/Edit the <?php echo $record->ReqNo; ?>
Requisition details"></i>&nbsp;&nbsp;&nbsp;
<!-- </a> <a href='#' onclick = "DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del" ><span class="ri-delete-bin-7-fill"></span></a>-->
<?php
//} else {
?>
<!-- <td> <a data-toggle="tooltip" href="#"><i class="fa fa-eye" data-toggle="tooltip" title="<?php echo $record->ReqNo; ?> - Click here to view Requistion details"></i>&nbsp;&nbsp;&nbsp;</a> </td> -->
<?php
//}
?>
</tr>
<?php
$TotalCgst = $TotalCgst + $record->After_CGST;
$TotalSgst = $TotalSgst + $record->After_SGST;
$TotalIgst = $TotalIgst + $record->After_IGST;
$Totalotherallowance = $Totalotherallowance + $record->otherallowance;
$TotalSummary = $TotalSummary + $record->TotalValue;
$TotalBasicAmount = $TotalBasicAmount + ($record->BasicValue * $FrequencyNo);
}
?> <input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $index; ?>">
<?php
}
?>
</tbody>
</table>
</div>
</div>
<div class="form-row"> <div class="form-row">
@ -1872,7 +1876,7 @@ foreach ($PaymentTerms as $TER) {
function populateValueMainFormForEditServiceTax() { function populateValueMainFormForEditServiceTax() {
var rows = document.getElementById('ServiceTable').rows.length; var rows = $('#ServiceTable tbody tr').length;
var TotCgst = 0; var TotCgst = 0;
var TotSgst = 0; var TotSgst = 0;
@ -2236,19 +2240,19 @@ foreach ($PaymentTerms as $TER) {
$('#txtDeliveryAddress').val('') $('#txtDeliveryAddress').val('')
window.location = status == 1 ? "amendmentpurchaseorder" : "purchaseorderListing"; window.location = status == 1 ? "amendmentpurchaseorder" : "purchaseorderListing";
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} else { } else {
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
$('#loader').hide(); $('#loader').hide();
console.error("Error"); console.error("Error");
} }
}, },
error : function (error){ error : function (error){
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
console.log("error occurred" , error); console.log("error occurred" , error);
}, },
complete : function (){ complete : function (){
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
console.log("Ajax call is completed ..!!"); console.log("Ajax call is completed ..!!");
} }
}); });

View File

@ -176,7 +176,7 @@ if (!empty($assetList)) {
<div class="form-row" style="margin-top:20px"> <div class="form-row" style="margin-top:20px">
<div class="col-md-3"> <div class="col-md-3">
<label class="col-form-label" for="PDate">Purchase Date<span class="badge">*</span></label> <label class="col-form-label" for="PDate">Purchase Date<span class="badge">*</span></label>
<input type="text" class="form-control" id="PDate" name="PDate" value="<?php echo $PDate; ?>"> <input type="text" class="form-control" id="PDate" name="PDate" value="<?php echo $PDate; ?>" required>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label class="col-form-label" for="Vendor">Vendor<span class="badge">*</span></label> <label class="col-form-label" for="Vendor">Vendor<span class="badge">*</span></label>

View File

@ -664,7 +664,8 @@ if (!empty($master)) {
<script> <script>
$('#AddConfigValue, #configValue').change(function() { $('#AddConfigValue, #configValue').change(function() {
let configValue = $(this).val(); let configValue = $(this).val().trim();
console.log(configValue,configValue.length);
let configTable = customTableToJson(); let configTable = customTableToJson();
let configValueExisting = configTable.filter(element => element['Configuration Value'] == configValue); let configValueExisting = configTable.filter(element => element['Configuration Value'] == configValue);

View File

@ -186,6 +186,12 @@ $("#deptBtnId").on('click',function(){
let depCode =$("#DEPCode").val(); let depCode =$("#DEPCode").val();
let headDepCode = $("#HeadDept").val(); let headDepCode = $("#HeadDept").val();
if(departmentName.length<1){
alert(`Department Name cannot be empty..!!`);
return;
}
$('#loader').show(); $('#loader').show();
$.ajax({ $.ajax({
type:"POST", type:"POST",

File diff suppressed because it is too large Load Diff

View File

@ -315,6 +315,7 @@
<select name="status" id="non_igr_status" class="form-control"> <select name="status" id="non_igr_status" class="form-control">
<option value="Draft">Draft</option> <option value="Draft">Draft</option>
<option value="Completed">Completed</option> <option value="Completed">Completed</option>
<option value="Canceled">Canceled</option>
</select> </select>
</div> </div>
</div> </div>

View File

@ -111,18 +111,20 @@
<div class="card"> <div class="card">
<br> <br>
<div style="margin-left:auto"> <div style="margin-left:auto">
<div class="form-check" style="margin-right: 25px;"> <div class="form-check" style="margin-right: 25px;">
<input class="form-check-input" type="checkbox" id="showArchiveId" <form id="archiveFormId" action="<?php echo base_url()?>/readFactoryMachineMasterDetails" method="post">
name="showArchive" value="1" onchange="showArchiveList()" <input class="form-check-input" type="checkbox" id="showArchiveId"
style="width: 18px; height: 18px;"> name="showArchive" value="1" <?php echo $showArchive ? "checked" : " " ?>
<label class="form-check-label" for="showArchiveId" style="width: 18px; height: 18px;">
style="font-size: 1rem; margin-left: 8px;"> <label class="form-check-label" for="showArchiveId"
Show Archive style="font-size: 1rem; margin-left: 8px;">
</label> Show Archive
</label>
</form>
</div>
</div> </div>
</div>
<div class="card-body" style="overflow-x:scroll;"> <div class="card-body" style="overflow-x:scroll;">
@ -147,11 +149,7 @@
foreach ($masterData as $record) { foreach ($masterData as $record) {
?> ?>
<tr class="<?php if ($record['is_active'] == 0) { <tr>
echo "deactivatedRow";
} ?>" style="<?php if ($record['is_active'] == 0) {
echo "display:none";
} ?>">
<td><?php echo $record['machine_name']; ?></td> <td><?php echo $record['machine_name']; ?></td>
<td><?php echo $record['machine_type'] ?></td> <td><?php echo $record['machine_type'] ?></td>
@ -260,30 +258,11 @@
function showArchiveList() { </script>
let isChecked = $("#showArchiveId").prop('checked');
<script>
// Show or hide the rows based on checkbox status $(document).on("change", "#showArchiveId", function () {
$(".deactivatedRow").each(function () { console.log("Checkbox changed, submitting form...");
if (isChecked) { $("#archiveFormId").submit();
$(this).show(); });
} else {
$(this).hide();
}
});
}
$(document).ready(function () {
let table = $('#datatable').DataTable();
showArchiveList();
table.on('draw', function () {
showArchiveList();
});
});
</script> </script>

View File

@ -370,7 +370,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
$("#PODate").datepicker({ $("#PODate").datepicker({
minDate: d, minDate: d,
maxDate: 'now', maxDate: 'now',
dateFormat: 'dd-mm-yy', format: 'dd-mm-yy',
changeMonth: true, changeMonth: true,
changeYear: true, changeYear: true,
yearRange: '-100:+0' yearRange: '-100:+0'
@ -380,7 +380,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
$("#Exchangerateon").datepicker({ $("#Exchangerateon").datepicker({
minDate: m, minDate: m,
//maxDate : 'now', //maxDate : 'now',
dateFormat: 'dd-mm-yy', format: 'dd-mm-yy',
changeMonth: true, changeMonth: true,
changeYear: true, changeYear: true,
yearRange: '-100:+0' yearRange: '-100:+0'
@ -820,9 +820,10 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
</div> </div>
</div> </div>
<br /> <br />
<div class="form-row table-responsive" style="padding-bottom: 30px;"> <div class="form-row">
<table id="ImportTax" class="table table-bordered table-hover mb-0" <div class="table-responsive" style="padding-bottom: 30px;">
style="font-size:12px;"> <table id="ImportTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<thead> <thead>
<tr> <tr>
<th style="white-space: nowrap !important;">SNo</th> <th style="white-space: nowrap !important;">SNo</th>
@ -847,6 +848,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
@ -2272,6 +2274,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
}); });
} }
$("#PaymentTerms").trigger('change');
}); });
@ -2391,10 +2394,16 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
$("#ItemName").val(obj.MaterialName); $("#ItemName").val(obj.MaterialName);
$("#UOM").val(obj.UOM); $("#UOM").val(obj.UOM);
$("#Quantity").val(obj.Quantity); $("#Quantity").val(obj.Quantity);
$("#Rate").val(obj.material_rate);
RequistQuantity = obj.Quantity; RequistQuantity = obj.Quantity;
unit = obj.UOM; unit = obj.UOM;
// document.getElementById("labelPurchaseRate").innerHTML ='purchase rate [Basic]/'+unit; // document.getElementById("labelPurchaseRate").innerHTML ='purchase rate [Basic]/'+unit;
// document.getElementById("labelEditPurchaseRate").innerHTML ='purchase rate [Basic]/'+unit; // document.getElementById("labelEditPurchaseRate").innerHTML ='purchase rate [Basic]/'+unit;
if(obj.material_rate != 0){
Ratechange();
validateExceedLimit();
calculateFreight(0);
}
} }
}); });
@ -3921,7 +3930,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
}); });
function populateValueMainFormForEditImportTax() { function populateValueMainFormForEditImportTax() {
var rows = document.getElementById('ImportTax').rows.length; var rows = $('#ImportTax tbody tr').length;
var TotalLanding = 0; var TotalLanding = 0;
var TotalHighseas = 0; var TotalHighseas = 0;
var TotalCustom = 0; var TotalCustom = 0;
@ -4195,8 +4204,8 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
formData.append('txtRowCount', txtRowCount); formData.append('txtRowCount', txtRowCount);
formData.append('txtDeletedRow', txtDeletedRow); formData.append('txtDeletedRow', txtDeletedRow);
formData.append('textStatus', stat); formData.append('textStatus', stat);
disableButtons(); // disableButtons();
$('#loader').show();
$.ajax({ $.ajax({
// data:$('.ImportPO').serialize()+"&txtRowCount="+txtRowCount+"&txtDeletedRow="+txtDeletedRow+"&textStatus="+stat, // data:$('.ImportPO').serialize()+"&txtRowCount="+txtRowCount+"&txtDeletedRow="+txtDeletedRow+"&textStatus="+stat,
//data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeQletedRowCount="+TextDeletedRowCount+"&TextTotalOrderValueSummaryService="+TextTotalOrderValueSummaryService+"&TextSpcialInstruction="+TextSpcialInstruction+"&TextExchangerate"+ExcLandingCharge="+hangerate+"Status="+TextStatus, //data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeQletedRowCount="+TextDeletedRowCount+"&TextTotalOrderValueSummaryService="+TextTotalOrderValueSummaryService+"&TextSpcialInstruction="+TextSpcialInstruction+"&TextExchangerate"+ExcLandingCharge="+hangerate+"Status="+TextStatus,
@ -4206,6 +4215,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
processData: false, processData: false,
contentType: false, contentType: false,
success: function(data) { success: function(data) {
$('#loader').hide();
if (data) { if (data) {
// $('#content').loader('hide'); // $('#content').loader('hide');
alert(data); alert(data);
@ -4214,18 +4224,19 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
//$('#SpcialInstruction').val(''); //$('#SpcialInstruction').val('');
//$('#txtDeliveryAddress').val(''); //$('#txtDeliveryAddress').val('');
window.location = "purchaseorderListing"; window.location = "purchaseorderListing";
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} else { } else {
$('#loader').hide();
alert("Error"); alert("Error");
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }
}, },
error: function(jqXHR, textStatus, errorThrown) { error: function(jqXHR, textStatus, errorThrown) {
console.error("AJAX Error: " + textStatus + ": " + errorThrown); console.error("AJAX Error: " + textStatus + ": " + errorThrown);
alert("Error: " + textStatus); alert("Error: " + textStatus);
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }
}); });
@ -4333,11 +4344,11 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
}); });
function Reset() { function Reset() {
disableButtons(); // disableButtons();
location.reload(); location.reload();
setTimeout(function() { // setTimeout(function() {
enableButtons(); // enableButtons();
}, 2000); // }, 2000);
} }
</script> </script>

View File

@ -371,17 +371,17 @@
<td style="max-width:80px;text-align:right;"><?php echo number_format($workedSalary, 2, '.', ''); ?></td> <td style="max-width:80px;text-align:right;"><?php echo number_format($workedSalary, 2, '.', ''); ?></td>
<td style="max-width:80px;text-align:right;"> <td id="bassalary<?php echo $index ?>" style="max-width:80px;text-align:right;">
<?php $basicWorked = $workedSalary * 70 / 100; <?php $basicWorked = $workedSalary * 70 / 100;
echo number_format($basicWorked, 2, '.', ''); ?> echo number_format($basicWorked, 2, '.', ''); ?>
</td> </td>
<td style="max-width:80px;text-align:right;"> <td id="hrasalary<?php echo $index ?>" style="max-width:80px;text-align:right;">
<?php $hraWorked = $workedSalary * 30 / 100; <?php $hraWorked = $workedSalary * 30 / 100;
echo number_format($hraWorked, 2, '.', ''); ?> echo number_format($hraWorked, 2, '.', ''); ?>
</td> </td>
<td style="max-width:80px;text-align:right;"> <td id="grosalary<?php echo $index ?>" style="max-width:80px;text-align:right;">
<?php echo number_format($basicWorked + $hraWorked, 2, '.', ''); ?> <?php echo number_format($basicWorked + $hraWorked, 2, '.', ''); ?>
</td> </td>
@ -583,17 +583,17 @@
<?php echo number_format($sum_of_amount, 2, '.', ''); ?> <?php echo number_format($sum_of_amount, 2, '.', ''); ?>
</td> </td>
<td style="max-width:80px;text-align:right;"> <td id="bassalary<?php echo $inx ?>" style="max-width:80px;text-align:right;">
<?php <?php
echo number_format($basic_worked, 2, '.', ''); ?> echo number_format($basic_worked, 2, '.', ''); ?>
</td> </td>
<td style="max-width:80px;text-align:right;"> <td id="hrasalary<?php echo $inx ?>" style="max-width:80px;text-align:right;">
<?php <?php
echo number_format($hra_worked, 2, '.', ''); ?> echo number_format($hra_worked, 2, '.', ''); ?>
</td> </td>
<td style="max-width:80px;text-align:right;"> <td id="grosalary<?php echo $inx ?>" style="max-width:80px;text-align:right;">
<?php echo number_format($basic_worked + $hra_worked, 2, '.', ''); ?> <?php echo number_format($basic_worked + $hra_worked, 2, '.', ''); ?>
</td> </td>
@ -653,11 +653,11 @@
<?php if (!empty($record->payroll_id)) { ?> title="Payslip Calculated" <?php if (!empty($record->payroll_id)) { ?> title="Payslip Calculated"
style="text-align:right;color:blue;" <?php }else{ ?>style="text-align:right;" <?php } ?>> style="text-align:right;color:blue;" <?php }else{ ?>style="text-align:right;" <?php } ?>>
<?php if (!empty($record->driver_final_payment)) { <?php if (!empty($record->driver_final_payment)) {
echo $record->driver_final_payment; echo ($basic_worked + $hra_worked + $record->Festival_Bonus)-($record->Monthly_Due+$record->esi_amount+$record->pf_amount);
$estTotal[] = $record->driver_final_payment; $estTotal[] = ($basic_worked + $hra_worked + $record->Festival_Bonus)-($record->Monthly_Due+$record->esi_amount+$record->pf_amount);
} else { } else {
echo $empSalary[$i]; echo ($basic_worked + $hra_worked + $record->Festival_Bonus)-($record->Monthly_Due+$record->esi_amount+$record->pf_amount);
$estTotal[] = $empSalary[$i]; $estTotal[] = ($basic_worked + $hra_worked + $record->Festival_Bonus)-($record->Monthly_Due+$record->esi_amount+$record->pf_amount);
} }
?> ?>
</td> </td>
@ -898,8 +898,7 @@ $(document).ready(function () {
if (data) { if (data) {
$('#loader').hide(); $('#loader').hide();
// alert(data); alert(data);
} }
} }
@ -1145,10 +1144,16 @@ $(document).ready(function () {
// console.log(sno);return true; // console.log(sno);return true;
var driverEarn = parseFloat(document.getElementById('ttlsalary' + sno).textContent); var driverEarn = parseFloat(document.getElementById('ttlsalary' + sno).textContent);
var grosssalary = parseFloat(document.getElementById('grosalary' + sno).textContent);
var basicsalary = parseFloat(document.getElementById('bassalary' + sno).textContent);
var hrasalary = parseFloat(document.getElementById('hrasalary' + sno).textContent);
var Festivals = parseFloat(document.getElementById('Festival' + sno).textContent); var Festivals = parseFloat(document.getElementById('Festival' + sno).textContent);
totalfestival[sno] = Festivals; totalfestival[sno] = Festivals;
var ESI = parseFloat(document.getElementById('esiAmt' + sno).textContent);
var PF = parseFloat(document.getElementById('pfAmt' + sno).textContent);
var element = document.getElementById('loanatm' + sno); var element = document.getElementById('loanatm' + sno);
var loanamt = parseFloat(element.value); var loanamt = parseFloat(element.value);
@ -1172,6 +1177,7 @@ $(document).ready(function () {
var current_loan_amt = 0; var current_loan_amt = 0;
var autoLoan = parseFloat(monthDue); var autoLoan = parseFloat(monthDue);
console.log(autoLoan,"autoLoan");
var Balance_Amount = loanamt - paidamt; var Balance_Amount = loanamt - paidamt;
if (autoLoan > Balance_Amount) { if (autoLoan > Balance_Amount) {
@ -1182,28 +1188,28 @@ $(document).ready(function () {
current_loan_amt = autoLoan; current_loan_amt = autoLoan;
} }
if (isNaN(driverEarn)) { driverEarn = 0; } if (isNaN(basicsalary)) { basicsalary = 0; }
if (isNaN(hrasalary)) { hrasalary = 0; }
var driverSalaryAdd = basicsalary + hrasalary + Festivals;
console.log('bas + hra + bon ',driverSalaryAdd);
var driverSalarySub = current_loan_amt+ESI + PF ;
console.log("L + E + P ",current_loan_amt);
var driverSalaryAdd = driverEarn + Festivals;
var driverSalarySub = current_loan_amt;
console.log(current_loan_amt);
var driverMonthSalary = driverSalaryAdd - driverSalarySub var driverMonthSalary = driverSalaryAdd - driverSalarySub
var driverSalary = Math.round(driverMonthSalary); var driverSalary = Math.round(driverMonthSalary);
console.log("Sal ",driverSalary);
var cals = (driverSalary).toFixed(0); var cals = (driverSalary).toFixed(0);
document.getElementById("empsal" + sno).innerHTML = cals; document.getElementById("empsal" + sno).innerHTML = cals;
// copied from calculategrandtotal() because we need those two only thats why // copied from calculategrandtotal() because we need those two only thats why
var AutoLoanDueIndex = 21; var AutoLoanDueIndex = 22;
var AutoLoanDue = 0; var AutoLoanDue = 0;
$('#monthlylistings tbody tr').each(function() { $('#monthlylistings tbody tr').each(function() {
var value = $(this).find('td').eq(AutoLoanDueIndex).text(); var value = $(this).find('td').eq(AutoLoanDueIndex).text();
@ -1211,7 +1217,7 @@ $(document).ready(function () {
}); });
$('#monthloan').text(AutoLoanDue); $('#monthloan').text(AutoLoanDue);
var FestivalBonusIndex = 23; var FestivalBonusIndex = 24;
var FestivalBonus = 0; var FestivalBonus = 0;
$('#monthlylistings tbody tr').each(function() { $('#monthlylistings tbody tr').each(function() {
var value = $(this).find('td').eq(FestivalBonusIndex).text(); var value = $(this).find('td').eq(FestivalBonusIndex).text();
@ -1219,7 +1225,7 @@ $(document).ready(function () {
}); });
$('#fest').text(FestivalBonus); $('#fest').text(FestivalBonus);
var EstimateIndex = 24; var EstimateIndex = 25;
var Estimate = 0; var Estimate = 0;
$('#monthlylistings tbody tr').each(function() { $('#monthlylistings tbody tr').each(function() {
var value = $(this).find('td').eq(EstimateIndex).text(); var value = $(this).find('td').eq(EstimateIndex).text();
@ -1231,7 +1237,7 @@ $(document).ready(function () {
function calculategrandtotal() function calculategrandtotal()
{ {
var AutoLoanDueIndex = 21; var AutoLoanDueIndex = 22;
var AutoLoanDue = 0; var AutoLoanDue = 0;
$('#monthlylistings tbody tr').each(function() { $('#monthlylistings tbody tr').each(function() {
var value = $(this).find('td').eq(AutoLoanDueIndex).text(); var value = $(this).find('td').eq(AutoLoanDueIndex).text();
@ -1239,7 +1245,7 @@ $(document).ready(function () {
}); });
$('#monthloan').text(AutoLoanDue); $('#monthloan').text(AutoLoanDue);
var TDSDeductionsIndex = 22; var TDSDeductionsIndex = 23;
var TDSDeductions = 0; var TDSDeductions = 0;
$('#monthlylistings tbody tr').each(function() { $('#monthlylistings tbody tr').each(function() {
var value = $(this).find('td').eq(TDSDeductionsIndex).text(); var value = $(this).find('td').eq(TDSDeductionsIndex).text();
@ -1247,7 +1253,7 @@ $(document).ready(function () {
}); });
$('#other').text(TDSDeductions); $('#other').text(TDSDeductions);
var FestivalBonusIndex = 23; var FestivalBonusIndex = 24;
var FestivalBonus = 0; var FestivalBonus = 0;
$('#monthlylistings tbody tr').each(function() { $('#monthlylistings tbody tr').each(function() {
var value = $(this).find('td').eq(FestivalBonusIndex).text(); var value = $(this).find('td').eq(FestivalBonusIndex).text();
@ -1255,7 +1261,7 @@ $(document).ready(function () {
}); });
$('#fest').text(FestivalBonus); $('#fest').text(FestivalBonus);
var EstimateIndex = 24; var EstimateIndex = 25;
var Estimate = 0; var Estimate = 0;
$('#monthlylistings tbody tr').each(function() { $('#monthlylistings tbody tr').each(function() {
var value = $(this).find('td').eq(EstimateIndex).text(); var value = $(this).find('td').eq(EstimateIndex).text();

View File

@ -291,9 +291,9 @@ if (!empty($INRSYMBOL)) {
}); });
} }
$("#PaymentTerms").trigger('change');
}); });
$('#drpSupplier').change(function() { $('#drpSupplier').change(function() {
var id = $('#drpSupplier').val(); var id = $('#drpSupplier').val();
@ -434,6 +434,9 @@ if (!empty($INRSYMBOL)) {
$("#Quantity").val(obj.Quantity); $("#Quantity").val(obj.Quantity);
$("#Rate").val(obj.material_rate); $("#Rate").val(obj.material_rate);
RequistQuantity = obj.Quantity; RequistQuantity = obj.Quantity;
if(obj.material_rate != 0){
change();
}
} }
}); });
} }
@ -2029,8 +2032,8 @@ if (!empty($INRSYMBOL)) {
<!-- <div> <!-- <div>
<?php <?php
$data = array('name' => 'PODate', 'value' => set_value('PODate', $CurrentDate), 'id' => 'PODate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;'); // $data = array('name' => 'PODate', 'value' => set_value('PODate', $CurrentDate), 'id' => 'PODate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data); // echo form_input($data);
?> ?>
</div> --> </div> -->
</div> </div>
@ -2103,7 +2106,7 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="payablefrom">Payable Terms</label> <label for="payablefrom">Payable Terms<span class="text-danger">*</span></label>
<?php <?php
if (!empty($Payment)) { if (!empty($Payment)) {
$options6 = array("0" => 'Select Payment Terms '); $options6 = array("0" => 'Select Payment Terms ');
@ -3683,7 +3686,7 @@ if (!empty($INRSYMBOL)) {
function populateValueMainFormForEditRevenueTax() { function populateValueMainFormForEditRevenueTax() {
var rows = document.getElementById('revenueTax').rows.length; var rows = $('#revenueTax tbody tr').length;
//alert(rows); //alert(rows);
var totBasicAmt = 0; var totBasicAmt = 0;
var totDiscountAmt = 0; var totDiscountAmt = 0;
@ -3946,7 +3949,7 @@ if (!empty($INRSYMBOL)) {
// else { // else {
var formData = new FormData($('.CreatePO')[0]); var formData = new FormData($('.CreatePO')[0]);
disableButtons(); $('#loader').show();
$.ajax({ $.ajax({
type: "POST", type: "POST",
@ -3955,6 +3958,7 @@ if (!empty($INRSYMBOL)) {
processData: false, processData: false,
contentType: false, contentType: false,
success: function(data) { success: function(data) {
$('#loader').hide();
if (data) { if (data) {
alert(data); alert(data);
@ -3963,19 +3967,20 @@ if (!empty($INRSYMBOL)) {
//$('#SpcialInstruction').val(''); //$('#SpcialInstruction').val('');
//$('#txtDeliveryAddress').val(''); //$('#txtDeliveryAddress').val('');
window.location = "purchaseorderListing"; window.location = "purchaseorderListing";
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} else { } else {
alert("Error"); alert("Error");
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }
}, },
error: function(jqXHR, textStatus, errorThrown) { error: function(jqXHR, textStatus, errorThrown) {
$('#loader').hide();
console.error("AJAX Error: " + textStatus + ": " + errorThrown); console.error("AJAX Error: " + textStatus + ": " + errorThrown);
alert("Error: " + textStatus); alert("Error: " + textStatus);
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }
}); });
@ -4219,11 +4224,11 @@ if (!empty($INRSYMBOL)) {
} }
function Reset() { function Reset() {
disableButtons(); // disableButtons();
location.reload(); location.reload();
setTimeout(function() { // setTimeout(function() {
enableButtons(); // enableButtons();
}, 2000); // }, 2000);
} }

View File

@ -97,19 +97,27 @@
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" <i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton"
title="Reset"></i> title="Reset"></i>
<div style="margin-left:auto">
<div class="form-check" style="margin-right: 25px;">
<input class="form-check-input" type="checkbox" id="showArchiveId" name="showArchive" value="1"
onchange="showArchiveList()" style="width: 18px; height: 18px;">
<label class="form-check-label" for="showArchiveId" style="font-size: 1rem; margin-left: 8px;">
Show Archive
</label>
</div>
</div>
<div class="error" id="error"></div> <div class="error" id="error"></div>
</form> </form>
<div style="margin-left:auto">
<div class="form-check" style="margin-right: 25px;">
<form id="archiveFormId" action="<?php echo base_url()?>/rawmaterialListing" method="post">
<input class="form-check-input" type="checkbox" id="showArchiveId"
name="showArchive" value="1" <?php echo $showArchive ? "checked" : " " ?>
style="width: 18px; height: 18px;">
<label class="form-check-label" for="showArchiveId"
style="font-size: 1rem; margin-left: 8px;">
Show Archive
</label>
</form>
</div>
</div>
<div class="card-body" style="overflow-x:scroll;"> <div class="card-body" style="overflow-x:scroll;">
<table id="raw_material_list_table" class="table dt-responsive nowrap w-100"> <table id="raw_material_list_table" class="table dt-responsive nowrap w-100">
<thead> <thead>
@ -134,12 +142,7 @@
foreach ($userRecords as $record) { foreach ($userRecords as $record) {
$date = date("Y-m-d"); $date = date("Y-m-d");
?> ?>
<tr class="<?php if ($record->IsActive == 0) { <tr>
echo "deactivatedRow";
} ?>"
style="<?php if ($record->IsActive == 0) {
echo "display:none";
} ?>">
<?php if (date('d-m-Y', strtotime($record->CreatedDate)) == "30-11--0001") { <?php if (date('d-m-Y', strtotime($record->CreatedDate)) == "30-11--0001") {
$cdate = '00-00-0000'; $cdate = '00-00-0000';
@ -501,32 +504,6 @@ $(document).ready(function () {
</script> </script>
<script> <script>
function showArchiveList() {
let isChecked = $("#showArchiveId").prop('checked');
console.log($(".deactivatedRow").length);
// Show or hide the rows based on checkbox status
$(".deactivatedRow").each(function () {
if (isChecked) {
$(this).show();
} else {
$(this).hide();
}
});
}
$(document).ready(function () {
let table = $('#raw_material_list_table').DataTable();
showArchiveList();
table.on('draw', function () {
showArchiveList();
});
});
function deleteMaterial(mid) { function deleteMaterial(mid) {
@ -596,3 +573,10 @@ $(document).ready(function () {
} }
</script> </script>
<script>
$(document).on("change", "#showArchiveId", function () {
console.log("Checkbox changed, submitting form...");
$("#archiveFormId").submit();
});
</script>

View File

@ -208,6 +208,7 @@ if (!empty($INRSYMBOL)) {
}); });
} }
$("#PaymentTerms").trigger('change');
}); });
document.getElementById("Date").checked = true; document.getElementById("Date").checked = true;
@ -369,6 +370,10 @@ if (!empty($INRSYMBOL)) {
$('#otherdescription').show(); $('#otherdescription').show();
$('#OtheritemDescription').val(obj.MaterialDescription); $('#OtheritemDescription').val(obj.MaterialDescription);
} }
if(obj.material_rate != 0){
Ratechange();
}
} }
}); });
} }
@ -1047,7 +1052,7 @@ if (!empty($INRSYMBOL)) {
</div><!-- 6. form-row div closed here --> </div><!-- 6. form-row div closed here -->
<div class="form-row"> <div class="form-row">
<div class="table-responsive" style="padding-bottom: 30px;"> <div class="table-responsive" style="padding-bottom: 30px;">
<table id="serviceTax" class="table table-bordered table-hover mb-0" style="font-size:12px;"> <table id="ServiceTable" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<thead> <thead>
<tr> <tr>
<th style="white-space: nowrap !important;">SNo</th> <th style="white-space: nowrap !important;">SNo</th>
@ -1066,7 +1071,7 @@ if (!empty($INRSYMBOL)) {
</thead> </thead>
<tbody id='ServiceAppend'> <tbody id='ServiceAppend'>
</tbody> </tbody>
</table><!-- serviceTax table closed here --> </table><!-- ServiceTable table closed here -->
</div> </div>
</div><!-- 7. form-row div closed here --> </div><!-- 7. form-row div closed here -->
@ -2096,7 +2101,7 @@ if (!empty($INRSYMBOL)) {
function populateValueMainFormForEditServiceTax() { function populateValueMainFormForEditServiceTax() {
var rows = document.getElementById('serviceTax').rows.length; var rows = $('#ServiceTable tbody tr').length;
var TotCgst = 0; var TotCgst = 0;
var TotSgst = 0; var TotSgst = 0;
@ -2380,10 +2385,10 @@ if (!empty($INRSYMBOL)) {
var AvlBudAmt = '<?php echo $AvlAmount ?>'; var AvlBudAmt = '<?php echo $AvlAmount ?>';
var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val(); var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val();
if (serviceValidate()) { if (serviceValidate()) {
// if (document.getElementById('serviceTax').rows.length < 2) { if (document.getElementById('ServiceTable').rows.length < 1) {
// alert('Please Select Line item to Create PO'); alert('Atleast One Line needed');
// return false; return false;
// } }
// else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) { // else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) {
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
// return false; // return false;
@ -2392,17 +2397,17 @@ if (!empty($INRSYMBOL)) {
// alert('Please Enter Other Payable Terms Description'); // alert('Please Enter Other Payable Terms Description');
// $('#Otherpayment').focus(); // $('#Otherpayment').focus();
// return false; // return false;
// } else if ($('#descofpo').val().trim() == '') { } else if ($('#descofpo').val().trim() == '') {
// alert('Please Enter Description Of Service'); alert('Please Enter Description Of Service');
// $('#descofpo').focus(); $('#descofpo').focus();
// return false; return false;
// } else if ($('#PoTypeOptions').val() == "0") { // } else if ($('#PoTypeOptions').val() == "0") {
// alert('Please Select POType'); // alert('Please Select POType');
// $('#PoTypeOptions').focus(); // $('#PoTypeOptions').focus();
// return false; // return false;
// } else { } else {
var formData = new FormData($('.ServicePO')[0]); var formData = new FormData($('.ServicePO')[0]);
disableButtons(); $('#loader').show();
console.log("inside add service purchase order view page"); console.log("inside add service purchase order view page");
console.log(formData); console.log(formData);
@ -2415,6 +2420,7 @@ if (!empty($INRSYMBOL)) {
processData: false, processData: false,
contentType: false, contentType: false,
success: function(data) { success: function(data) {
$('#loader').hide();
if (data) { if (data) {
alert(data); alert(data);
$('#txtRowCount').val(''); $('#txtRowCount').val('');
@ -2422,17 +2428,18 @@ if (!empty($INRSYMBOL)) {
$('#SpcialInstruction').val(''); $('#SpcialInstruction').val('');
$('#txtDeliveryAddress').val(''); $('#txtDeliveryAddress').val('');
window.location = "purchaseorderListing"; window.location = "purchaseorderListing";
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} else { } else {
$('#loader').hide();
alert("Error"); alert("Error");
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }
}, },
error: function(jqXHR, textStatus, errorThrown) { error: function(jqXHR, textStatus, errorThrown) {
console.error("AJAX Error: " + textStatus + ": " + errorThrown); console.error("AJAX Error: " + textStatus + ": " + errorThrown);
alert("Error: " + textStatus); alert("Error: " + textStatus);
setTimeout(function() { enableButtons(); }, 2000); // setTimeout(function() { enableButtons(); }, 2000);
} }
}); });
@ -2584,11 +2591,11 @@ if (!empty($INRSYMBOL)) {
function Reset() { function Reset() {
disableButtons(); // disableButtons();
location.reload(); location.reload();
setTimeout(function() { // setTimeout(function() {
enableButtons(); // enableButtons();
}, 2000); // }, 2000);
} }

View File

@ -296,7 +296,7 @@
<input type="text" <input type="text"
value="<?= $month; ?>" name="month" value="<?= $month; ?>" name="month"
class="form-control monthpicker" id="monthpicker"> class="form-control monthpicker" id="monthpicker" readonly>
@ -666,7 +666,7 @@
<!-- grade --> <!-- grade -->
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="gradeId">grade</label> <label for="gradeId">Grade</label>
<span class="badge mandatory">*</span> <span class="badge mandatory">*</span>
<input type="text" class="form-control" id="gradeId" name="grade" value="" <input type="text" class="form-control" id="gradeId" name="grade" value=""
required> required>
@ -728,15 +728,13 @@
<div class="form-row" id="batchCardRowId"> <div class="form-row" id="batchCardRowId">
<!-- batch card file upload --> <!-- batch card file upload -->
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="">Upload Batch Card</label> <label for="">Upload Batch Card</label>
<div> <br>
<input type="file" class="batchfile" name="batchCard[]">
</div>
<button type="button" class="btn btn-success btn-sm mt-2" id="batchCardAddBtnId">Add More</button> <button type="button" class="btn btn-success btn-sm mt-2" id="batchCardAddBtnId">Add File</button>
</div> </div>
@ -888,7 +886,7 @@
<!-- grade --> <!-- grade -->
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="editGradeId">grade</label> <label for="editGradeId">Grade</label>
<span class="badge mandatory">*</span> <span class="badge mandatory">*</span>
<input type="text" class="form-control" id="editGradeId" name="grade" value="" <input type="text" class="form-control" id="editGradeId" name="grade" value=""
required> required>
@ -950,15 +948,12 @@
<div class="form-row" id="editBatchCardRowId"> <div class="form-row" id="editBatchCardRowId">
<!-- batch card file upload --> <!-- batch card file upload -->
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label for="editBatchCardId">Upload Batch Card</label> <label for="editBatchCardId">Upload Batch Card</label>
<br>
<div> <button type="button" class="btn btn-success btn-sm mt-2" id="editBatchCardAddBtnId">Add File</button>
<input type="file" class="editBatchFile " name="batchCard[]">
</div>
<button type="button" class="btn btn-success btn-sm mt-2" id="editBatchCardAddBtnId">Add More</button>
</div> </div>
@ -1284,7 +1279,7 @@
} }
let string = `<div class="form-group col-md-3 batch-container"> let string = `<div class="form-group col-md-4 batch-container">
<label for="">Change Batch Card</label> <label for="">Change Batch Card</label>
<input type="file" class="editBatchFile additionalBatchFile" name="batchCard[]" > <input type="file" class="editBatchFile additionalBatchFile" name="batchCard[]" >
<p>( Previously Uploaded File ${element.client_given_name} )</p> <p>( Previously Uploaded File ${element.client_given_name} )</p>
@ -1680,7 +1675,7 @@
return; return;
} }
let string = `<div class="form-group col-md-3 batch-container"> let string = `<div class="form-group col-md-4 batch-container">
<label for="">Upload Batch Card</label> <label for="">Upload Batch Card</label>
<input type="file" class="batchfile" name="batchCard[]" > <input type="file" class="batchfile" name="batchCard[]" >
<button type="button" class="btn btn-danger btn-sm mt-2 removeBatch">Remove</button> <button type="button" class="btn btn-danger btn-sm mt-2 removeBatch">Remove</button>
@ -1705,7 +1700,7 @@
return; return;
} }
let string = `<div class="form-group col-md-3 batch-container"> let string = `<div class="form-group col-md-4 batch-container">
<label for="">Upload Batch Card</label> <label for="">Upload Batch Card</label>
<input type="file" class="editBatchFile" name="batchCard[]" > <input type="file" class="editBatchFile" name="batchCard[]" >
<button type="button" class="btn btn-danger btn-sm mt-2 removeBatch">Remove</button> <button type="button" class="btn btn-danger btn-sm mt-2 removeBatch">Remove</button>

View File

@ -13,6 +13,14 @@
margin: 0; margin: 0;
} }
.grab {
cursor: grab; /* Default open-hand cursor */
}
.grab:active {
cursor: grabbing; /* Closed-hand cursor when dragging */
}
.fht-table td { .fht-table td {
text-align: center; text-align: center;
} }
@ -297,12 +305,26 @@
<div class="col-3"> <div class="col-3">
<input type="text" name="month" id="month" value="<?php echo "$month" ?>" <input type="text" name="month" id="month" value="<?php echo "$month" ?>"
class="form-control mt-2" data-provide="datepicker" class="form-control mt-2" data-provide="datepicker"
data-date-format="M-yyyy" data-date-min-view-mode="1"> data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
</div> </div>
<div class="form-group col-md-2"> <div class="form-group col-md-3">
<button type="submit" class="btn btn-success"> Change Month </button> <button type="submit" class="btn btn-success"> Change Month </button>
<?php
//check it is current month , then only show the custom option
if($month == date('M-Y') ){
?>
<button type="button" class="btn" style="background-color:maroon;color:white" data-target="#customizeModalId"
data-toggle="modal">
Customize
</button>
<?php
}
?>
</div> </div>
<div class="col-md-1"></div>
<div class="col-6"> <div class="col-6">
<div class="dropdown float-right"> <div class="dropdown float-right">
<a href="#" class="dropdown-toggle arrow-none" data-toggle="dropdown" <a href="#" class="dropdown-toggle arrow-none" data-toggle="dropdown"
@ -318,6 +340,91 @@
</div> </div>
</form> </form>
<form action="<?= base_url('bagStockDetails'); ?>" method="post">
<!-- modal placed here for submission of form -->
<!---------------------------------------
this modal is used to customize table header
1)list table header order
2)choose which material/machines you want
------------------------------------------------------------>
<div>
<div class="modal fade" id="customizeModalId" tabindex="-1" role="dialog" aria-labelledby="customizeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="customizeModalLabel">Customize</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<!-- Dropdown to add back removed items -->
<div class="col">
<div class="form-group">
<label for="customizeHeader"> Add For This Month </label>
<select id="customizeHeader" class="form-control" onchange="addBackToList()">
<option value="">Select</option>
<?php
foreach($activeBagMaterials as $index => $activeBagMaterial){ ?>
<option value="<?=$activeBagMaterial['MaterialCode']?>">
<?=$activeBagMaterial['MaterialCode']?> - <?=$activeBagMaterial['MaterialName']?>
</option>
<?php
}
?>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col">
<h5>List of Selected Items</h5>
<div id="selectedItemsContainer">
<ul id="sortableList">
<?php foreach ($bagMaterials as $bagMaterial): ?>
<div class="sortable-item" draggable="true" id="<?=$bagMaterial['MaterialCode']?>_container">
<input type = "checkbox"
id = "<?=$bagMaterial['MaterialCode']?>_checkboxId"
name = "customisedMaterialCodes[]"
value = "<?= $bagMaterial['MaterialCode'] ?>"
onclick = "removeSelectedMaterial(this)"
checked>
<label class="grab" for="<?= $bagMaterial['MaterialCode'] ?>_checkboxId">
<?= $bagMaterial['MaterialCode'] ?> - <?= $bagMaterial['MaterialName']; ?>
</label>
<br>
</div>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary float-right"> Apply </button>
</div>
</div>
</div>
</div>
</div>
<!-- hidden fields -->
<input type="hidden" name="month" id="month" value="<?php echo "$month" ?>"
class="form-control mt-2" data-provide="datepicker"
data-date-format="M-yyyy" data-date-min-view-mode="1">
</form>
<div class="table-responsive"> <div class="table-responsive">
@ -327,7 +434,7 @@
<tr> <tr>
<th class="celda_encabezado_general" colspan="1">material </th> <th class="celda_encabezado_general" colspan="1">Material </th>
<?php foreach($bagMaterials as $bagMaterial){ ?> <?php foreach($bagMaterials as $bagMaterial){ ?>
<!-- this will loop till materials present --> <!-- this will loop till materials present -->
@ -1081,3 +1188,88 @@
}); });
</script> </script>
<script>
document.addEventListener("DOMContentLoaded", function () {
const list = document.getElementById("sortableList");
let draggedItem = null;
function attachDragEvents(item) {
item.setAttribute("draggable", "true");
item.addEventListener("dragstart", (event) => {
draggedItem = event.target;
event.target.classList.add("dragging");
});
item.addEventListener("dragend", (event) => {
event.target.classList.remove("dragging");
});
}
list.addEventListener("dragover", (event) => {
event.preventDefault(); // Allow dropping
const dragging = document.querySelector(".dragging");
const closestItem = getClosestItem(list, event.clientY);
if (closestItem) {
list.insertBefore(dragging, closestItem);
} else {
list.appendChild(dragging);
}
});
function getClosestItem(container, y) {
const items = [...container.querySelectorAll(".sortable-item:not(.dragging)")];
return items.reduce((closest, child) => {
const box = child.getBoundingClientRect();
const offset = y - box.top - box.height / 2;
return offset < 0 && offset > closest.offset
? { offset, element: child }
: closest;
}, { offset: Number.NEGATIVE_INFINITY }).element;
}
// Attach drag events to existing items
document.querySelectorAll(".sortable-item").forEach(attachDragEvents);
window.removeSelectedMaterial = function (checkbox) {
let container = checkbox.closest(".sortable-item");
let materialCode = checkbox.value;
let materialName = container.querySelector("label").innerText;
container.remove();
};
window.addBackToList = function () {
let dropdown = document.getElementById("customizeHeader");
let selectedOption = dropdown.options[dropdown.selectedIndex];
if (selectedOption.value !== "") {
let materialCode = selectedOption.value;
let materialName = selectedOption.text;
let container = document.createElement("div");
container.classList.add("sortable-item");
container.id = materialCode + "_container";
container.innerHTML = `
<input type="checkbox" id="${materialCode}_checkboxId"
name="customisedMaterialCodes[]" value="${materialCode}"
onclick="removeSelectedMaterial(this)" checked>
<label class="grab" for="${materialCode}_checkboxId"> ${materialName} </label>
<br>
`;
attachDragEvents(container);
document.getElementById("sortableList").appendChild(container);
}
};
});
</script>

View File

@ -3,6 +3,15 @@
text-align: right; text-align: right;
} }
.grab {
cursor: grab; /* Default open-hand cursor */
}
.grab:active {
cursor: grabbing; /* Closed-hand cursor when dragging */
}
.fht-table, .fht-table,
.fht-table thead, .fht-table thead,
.fht-table tfoot, .fht-table tfoot,
@ -291,12 +300,27 @@ foreach ($period as $day) {
<input type="text" name="month" id="month" value="<?php echo "$month" ?>" <input type="text" name="month" id="month" value="<?php echo "$month" ?>"
class="form-control mt-2" data-provide="datepicker" class="form-control mt-2" data-provide="datepicker"
style="z-index:30;" style="z-index:30;"
data-date-format="M-yyyy" data-date-min-view-mode="1"> data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
</div> </div>
<div class="form-group col-md-2"> <div class="form-group col-md-3">
<button type="submit" class="btn btn-success"> Change Month </button> <button type="submit" class="btn btn-success"> Change Month </button>
<?php
//check it is current month , then only show the custom option
if($month == date('M-Y') ){
?>
<button type="button" class="btn" style="background-color:maroon;color:white" data-target="#customizeModalId"
data-toggle="modal">
Customize
</button>
<?php
}
?>
</div> </div>
<div class="col-md-1"></div>
<div class="col-6"> <div class="col-6">
<div class="dropdown float-right"> <div class="dropdown float-right">
<a href="#" class="dropdown-toggle arrow-none" data-toggle="dropdown" <a href="#" class="dropdown-toggle arrow-none" data-toggle="dropdown"
@ -312,6 +336,91 @@ foreach ($period as $day) {
</div> </div>
</form> </form>
<form action="<?= base_url('dieselMachineDetails'); ?>" method="post">
<!-- modal placed here for submission of form -->
<!---------------------------------------
this modal is used to customize table header
1)list table header order
2)choose which material/machines you want
------------------------------------------------------------>
<div>
<div class="modal fade" id="customizeModalId" tabindex="-1" role="dialog" aria-labelledby="customizeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="customizeModalLabel">Customize</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<!-- Dropdown to add back removed items -->
<div class="col">
<div class="form-group">
<label for="customizeHeader"> Add For This Month </label>
<select id="customizeHeader" class="form-control" onchange="addBackToList()">
<option value="">Select</option>
<?php
foreach($activeDieselMachines as $index => $activeDieselMachine){ ?>
<option value="<?=$activeDieselMachine['id']?>">
<?=$activeDieselMachine['id']?> - <?=$activeDieselMachine['machine_name']?>
</option>
<?php
}
?>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col">
<h5>List of Selected Items</h5>
<div id="selectedItemsContainer">
<ul id="sortableList">
<?php foreach ($dieselMachines as $dieselMachine): ?>
<div class="sortable-item" draggable="true" id="<?= $dieselMachine['id'] ?>_container">
<input type = "checkbox"
id = "<?= $dieselMachine['id'] ?>_checkboxId"
name = "customisedMachineCodes[]"
value = "<?= $dieselMachine['id'] ?>"
onclick = "removeSelectedMaterial(this)"
checked>
<label class="grab" for="<?= $dieselMachine['id'] ?>_checkboxId">
<?= $dieselMachine['id'] ?> - <?= $dieselMachine['machine_name']; ?>
</label>
<br>
</div>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary float-right"> Apply </button>
</div>
</div>
</div>
</div>
</div>
<!-- hidden fields -->
<input type="hidden" name="month" id="month" value="<?php echo "$month" ?>"
class="form-control mt-2" data-provide="datepicker"
data-date-format="M-yyyy" data-date-min-view-mode="1">
</form>
<div class="table-responsive"> <div class="table-responsive">
@ -364,14 +473,12 @@ foreach ($period as $day) {
<tbody style="background-color: #fff;"> <tbody style="background-color: #fff;">
<?php if (!empty($groupedDieselMachineStockDetails)) { <?php if (!empty($totalDiesel)) {
$summary = []; $summary = [];
foreach ($groupedDieselMachineStockDetails as $groupedDieselMachineStockDetailsIndex => $dieselStockDetails) { foreach ($groupedDieselMachineStockDetails as $groupedDieselMachineStockDetailsIndex => $dieselStockDetails) {
?> ?>
<tr <tr
@ -1402,3 +1509,88 @@ foreach ($period as $day) {
}); });
</script> </script>
<script>
document.addEventListener("DOMContentLoaded", function () {
const list = document.getElementById("sortableList");
let draggedItem = null;
function attachDragEvents(item) {
item.setAttribute("draggable", "true");
item.addEventListener("dragstart", (event) => {
draggedItem = event.target;
event.target.classList.add("dragging");
});
item.addEventListener("dragend", (event) => {
event.target.classList.remove("dragging");
});
}
list.addEventListener("dragover", (event) => {
event.preventDefault(); // Allow dropping
const dragging = document.querySelector(".dragging");
const closestItem = getClosestItem(list, event.clientY);
if (closestItem) {
list.insertBefore(dragging, closestItem);
} else {
list.appendChild(dragging);
}
});
function getClosestItem(container, y) {
const items = [...container.querySelectorAll(".sortable-item:not(.dragging)")];
return items.reduce((closest, child) => {
const box = child.getBoundingClientRect();
const offset = y - box.top - box.height / 2;
return offset < 0 && offset > closest.offset
? { offset, element: child }
: closest;
}, { offset: Number.NEGATIVE_INFINITY }).element;
}
// Attach drag events to existing items
document.querySelectorAll(".sortable-item").forEach(attachDragEvents);
window.removeSelectedMaterial = function (checkbox) {
let container = checkbox.closest(".sortable-item");
let materialCode = checkbox.value;
let materialName = container.querySelector("label").innerText;
container.remove();
};
window.addBackToList = function () {
let dropdown = document.getElementById("customizeHeader");
let selectedOption = dropdown.options[dropdown.selectedIndex];
if (selectedOption.value !== "") {
let materialCode = selectedOption.value;
let materialName = selectedOption.text;
let container = document.createElement("div");
container.classList.add("sortable-item");
container.id = materialCode + "_container";
container.innerHTML = `
<input type="checkbox" id="${materialCode}_checkboxId"
name="customisedMachineCodes[]" value="${materialCode}"
onclick="removeSelectedMaterial(this)" checked>
<label class="grab" for="${materialCode}_checkboxId"> ${materialName} </label>
<br>
`;
attachDragEvents(container);
document.getElementById("sortableList").appendChild(container);
}
};
});
</script>

View File

@ -294,7 +294,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<div class="col-3"> <div class="col-3">
<?php $today = date('M-Y'); ?> <?php $today = date('M-Y'); ?>
<input type="text" name="month" id="month" value="<?php echo $datefordropdown; ?>" class="form-control" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1"> <input type="text" name="month" id="month" value="<?php echo $datefordropdown; ?>" class="form-control" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
</div> </div>
<div class="col-3"> <div class="col-3">
@ -343,7 +343,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<th class="celda_encabezado_general" >Moisture Loss Qty (Metric Ton)</th> <th class="celda_encabezado_general" >Moisture Loss Qty (Metric Ton)</th>
<th class="celda_encabezado_general" >Dust Qty (Metric Ton)</th> <th class="celda_encabezado_general" >Dust Qty (Metric Ton)</th>
<th class="celda_encabezado_general" >Customer Name</th> <th class="celda_encabezado_general" align="left" >Customer Name</th>
<th class="celda_encabezado_general" style="display:none;">id</th> <th class="celda_encabezado_general" style="display:none;">id</th>
<th class="celda_encabezado_general" > Action</th> <th class="celda_encabezado_general" > Action</th>
@ -452,7 +452,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
</td> </td>
<!-- td:eq(13) customer_name --> <!-- td:eq(13) customer_name -->
<td class="celda_normal" > <td class="celda_normal" style="text-align: left !important;">
<?php echo $a['customer_name']; ?> <?php echo $a['customer_name']; ?>
</td> </td>
@ -682,7 +682,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<div class="col-md-3"> <div class="col-md-3">
<label class="form" for="additionalEntryDrierOnTimeId">Drier On Time</label> <label class="form" for="additionalEntryDrierOnTimeId">Drier On Time</label>
<select onchange="calculateMachineRunningHrs()" <select onchange="calculateMachineRunningHrs()" required
class="timeDropdown" style="width: 100px;" class="timeDropdown" style="width: 100px;"
id="additionalEntryDrierOnTimeId" name="drier_on_time"> id="additionalEntryDrierOnTimeId" name="drier_on_time">
<option value="">Select</option> <option value="">Select</option>
@ -694,7 +694,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<div class="col-md-3"> <div class="col-md-3">
<label class="form" for="additionalEntryDrierOffTimeId">Drier Off Time</label> <label class="form" for="additionalEntryDrierOffTimeId">Drier Off Time</label>
<select onchange="calculateMachineRunningHrs()" <select onchange="calculateMachineRunningHrs()" required
class="timeDropdown " style="width: 100px;" class="timeDropdown " style="width: 100px;"
id="additionalEntryDrierOffTimeId" name="drier_off_time"> id="additionalEntryDrierOffTimeId" name="drier_off_time">
<option value="">Select</option> <option value="">Select</option>
@ -717,7 +717,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- supplier name --> <!-- supplier name -->
<div class="col-md-3"> <div class="col-md-3">
<label class="form" for="additionalEntrySupplierNameId">Supplier Name</label> <label class="form" for="additionalEntrySupplierNameId">Supplier Name</label>
<select class="timeDropdown supplier_name" style="width: 300px;" <select class="timeDropdown supplier_name" style="width: 300px;" required
id="additionalEntrySupplierNameId" name="supplier_name"> id="additionalEntrySupplierNameId" name="supplier_name">
<option value="">Select</option> <option value="">Select</option>
<?php foreach ($supplierData as $key => $value) { ?> <?php foreach ($supplierData as $key => $value) { ?>
@ -730,13 +730,13 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<div class="col-md-3"> <div class="col-md-3">
<label class="form" for="additionalEntryInputSandQtyId">Input sand Quantity (Metric Ton)</label> <label class="form" for="additionalEntryInputSandQtyId">Input sand Quantity (Metric Ton)</label>
<input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); " <input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); "
type="text" class="form-control" id="additionalEntryInputSandQtyId" name="input_sand_qty" value=""> type="text" class="form-control" id="additionalEntryInputSandQtyId" name="input_sand_qty" value="" required>
</div> </div>
<!-- input sand moisture --> <!-- input sand moisture -->
<div class="col-md-3"> <div class="col-md-3">
<label class="form" for="additionalEntryInputSandMoistureId">Input Sand Moisture (%)</label> <label class="form" for="additionalEntryInputSandMoistureId">Input Sand Moisture (%)</label>
<input type="text" class="form-control" id="additionalEntryInputSandMoistureId" name="input_sand_moisture" value=""> <input type="text" class="form-control" id="additionalEntryInputSandMoistureId" name="input_sand_moisture" value="" required>
</div> </div>
@ -745,7 +745,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<div class="col-md-3"> <div class="col-md-3">
<label class="form" for="additionalEntrySandDriedQtyId">Sand Dried Qty (Metric Ton)</label> <label class="form" for="additionalEntrySandDriedQtyId">Sand Dried Qty (Metric Ton)</label>
<input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); " <input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); "
type="text" class="form-control" id="additionalEntrySandDriedQtyId" name="sand_dried_qty" value=""> type="text" class="form-control" id="additionalEntrySandDriedQtyId" name="sand_dried_qty" value="" required>
</div> </div>
@ -758,13 +758,13 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<div class="col-md-3"> <div class="col-md-3">
<label class="form" for="additionalEntryTotalGasConsumptionId">Total Gas Consumption</label> <label class="form" for="additionalEntryTotalGasConsumptionId">Total Gas Consumption</label>
<input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); " <input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); "
type="text" class="form-control" id="additionalEntryTotalGasConsumptionId" name="total_gas_consumption" value=""> type="text" class="form-control" id="additionalEntryTotalGasConsumptionId" name="total_gas_consumption" value="" required>
</div> </div>
<!-- gas per ton --> <!-- gas per ton -->
<div class="col-md-3"> <div class="col-md-3">
<label class="form" for="additionalEntryGasPerTonId">Gas per Ton</label> <label class="form" for="additionalEntryGasPerTonId">Gas per Ton</label>
<input type="text" class="form-control" id="additionalEntryGasPerTonId" name="gas_per_ton" value="" <input type="text" class="form-control" id="additionalEntryGasPerTonId" name="gas_per_ton" value="" required
readonly> readonly>
</div> </div>
@ -772,7 +772,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- qty per hours --> <!-- qty per hours -->
<div class="col-md-3"> <div class="col-md-3">
<label class="form" for="additionalEntryQtyPerHoursId">Qty per Hours</label> <label class="form" for="additionalEntryQtyPerHoursId">Qty per Hours</label>
<input type="text" class="form-control" id="additionalEntryQtyPerHoursId" name="qty_per_hours" value="" <input type="text" class="form-control" id="additionalEntryQtyPerHoursId" name="qty_per_hours" value="" required
readonly> readonly>
</div> </div>
@ -780,7 +780,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- moisture loss qty --> <!-- moisture loss qty -->
<div class="col-md-3"> <div class="col-md-3">
<label class="form" for="additionalEntryMoistureLossQtyId">Moisture Loss Qty (Metric Ton)</label> <label class="form" for="additionalEntryMoistureLossQtyId">Moisture Loss Qty (Metric Ton)</label>
<input type="text" class="form-control" id="additionalEntryMoistureLossQtyId" name="moisture_loss_qty" value="" <input type="text" class="form-control" id="additionalEntryMoistureLossQtyId" name="moisture_loss_qty" value="" required
readonly> readonly>
</div> </div>
</div> </div>
@ -792,14 +792,14 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- dust qty --> <!-- dust qty -->
<div class="col-md-3"> <div class="col-md-3">
<label class="form" for="additionalEntryDustQtyId">Dust Qty (Metric Ton)</label> <label class="form" for="additionalEntryDustQtyId">Dust Qty (Metric Ton)</label>
<input type="text" class="form-control" id="additionalEntryDustQtyId" name="dust_qty" value=""> <input type="text" class="form-control" id="additionalEntryDustQtyId" name="dust_qty" value="" required>
</div> </div>
<!-- customer name --> <!-- customer name -->
<div class="col-md-3"> <div class="col-md-3">
<label class="form" for="additionalEntryCustomerNameId">Customer Name</label> <label class="form" for="additionalEntryCustomerNameId">Customer Name</label>
<input type="text" class="form-control" id="additionalEntryCustomerNameId" name="customer_name" value=""> <input type="text" class="form-control" id="additionalEntryCustomerNameId" name="customer_name" value="" required>
</div> </div>
</div> </div>

View File

@ -172,12 +172,14 @@
.fht-table thead { .fht-table thead {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 20; /* Ensure the entire header stays above table rows */ z-index: 20;
background-color: #50bbd9; /* Header background color */ /* Ensure the entire header stays above table rows */
background-color: #50bbd9;
/* Header background color */
} }
.dropdown-menu { .dropdown-menu {
z-index :25 ; z-index: 25;
} }
@ -186,8 +188,10 @@
.fht-table thead th { .fht-table thead th {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 11; /* Higher than table rows but lower than first column */ z-index: 11;
background-color: #50bbd9; /* Green background */ /* Higher than table rows but lower than first column */
background-color: #50bbd9;
/* Green background */
color: #ffffff; color: #ffffff;
border: 1px solid #ddd; border: 1px solid #ddd;
padding: 10px; padding: 10px;
@ -199,7 +203,8 @@
position: sticky; position: sticky;
left: 0; left: 0;
background-color: #50bbd9; background-color: #50bbd9;
z-index: 15; /* Ensures it stays above other cells */ z-index: 15;
/* Ensures it stays above other cells */
border-right: 2px solid #ddd; border-right: 2px solid #ddd;
color: #ffffff; color: #ffffff;
} }
@ -208,22 +213,24 @@
.table-responsive { .table-responsive {
overflow-x: auto; overflow-x: auto;
overflow-y: auto; overflow-y: auto;
max-height: 500px; /* Adjust as needed */ max-height: 500px;
/* Adjust as needed */
position: relative; position: relative;
} }
td{ td {
min-width: 100px; min-width: 150px;
max-width: 100px; max-width: 150px;
} }
th {
min-width: 150px;
max-width: 150px;
}
</style> </style>
<div class="content-page"> <div class="content-page">
<div class="content"> <div class="content">
<!-- Start Content--> <!-- Start Content-->
@ -262,9 +269,10 @@
<div class="col-3"> <div class="col-3">
<input type="text" name="month" id="month" value="<?php echo "$month" ?>" <input type="text" name="month" id="month" value="<?php echo "$month" ?>"
class="form-control mt-2" data-provide="datepicker" class="form-control datepicker mt-2 " data-provide="datepicker"
data-date-format="M-yyyy" data-date-min-view-mode="1"> data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
</div> </div>
<div class="form-group col-md-2"> <div class="form-group col-md-2">
<button type="submit" class="btn btn-success"> Change Month </button> <button type="submit" class="btn btn-success"> Change Month </button>
</div> </div>
@ -285,6 +293,8 @@
<div class="table-responsive"> <div class="table-responsive">
<table style="width: 700px;" id="dustAndRoughStockDetailsTableId" class="fht-table table-striped"> <table style="width: 700px;" id="dustAndRoughStockDetailsTableId" class="fht-table table-striped">
@ -347,19 +357,14 @@
><?= $dustAndRoughStockDetail['total'] ?? ' ' ?></td> ><?= $dustAndRoughStockDetail['total'] ?? ' ' ?></td>
</tr> </tr>
<div class="table-responsive" style="width: 700px;"> <?php
//before closing inner loop
if (!isset($summary['finalRough'])) {
$summary['finalRough'] = 0 ;
<?php $summary['dust'] = 0 ;
$summary['total'] = 0 ;
//before closing inner loop
if (!isset($summary['finalRough'])) {
$summary['finalRough'] = 0 ;
$summary['dust'] = 0 ;
$summary['total'] = 0 ;
} }
@ -367,33 +372,19 @@
$summary['dust'] += $dustAndRoughStockDetail['dust'] == "-" ? 0 : (float) $dustAndRoughStockDetail['dust'] ; $summary['dust'] += $dustAndRoughStockDetail['dust'] == "-" ? 0 : (float) $dustAndRoughStockDetail['dust'] ;
$summary['total'] += $dustAndRoughStockDetail['total'] == "-" ? 0 : (float) $dustAndRoughStockDetail['total'] ; $summary['total'] += $dustAndRoughStockDetail['total'] == "-" ? 0 : (float) $dustAndRoughStockDetail['total'] ;
} ?> } ?>
<table id="dustAndRoughStockDetailsTableSummaryId" class="fht-table table-striped">
<thead > <tfoot>
<th class="celda_encabezado_total" style="width: 100px;">Total </th> <tr>
<th class="celda_encabezado_total" style="width: 230px;">Final Rough </th> <td style="background-color:rgb(189, 9, 6); color:#ffff;"> Total </td>
<th class="celda_encabezado_total" style="width: 240px;">Dust </th> <td class="celda_normal "><?=$summary['finalRough']?></td>
<th class="celda_encabezado_total" style="width: 130px;">Total </th> <td class="celda_normal "><?=$summary['dust']?></td>
</thead> <td class="celda_normal "><?=$summary['total']?></td>
</tr>
</tfoot>
<tbody>
<tr>
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
<b> Total </b>
</td>
<td class="celda_normal "><?=$summary['finalRough']?></td>
<td class="celda_normal "><?=$summary['dust']?></td>
<td class="celda_normal "><?=$summary['total']?></td>
</tr>
</tbody>
</table>
</div>
<?php }else{ <?php }else{
@ -509,6 +500,7 @@
$('#loader').hide(); $('#loader').hide();
console.log(data); console.log(data);
alert(data); alert(data);
window.location.reload();
} }
}, },

View File

@ -262,7 +262,7 @@
<div class="col-md-3"> <div class="col-md-3">
<input type="text" name="month" id="month" value="<?php echo "$month" ?>" <input type="text" name="month" id="month" value="<?php echo "$month" ?>"
class="form-control mt-2" data-provide="datepicker" class="form-control mt-2" data-provide="datepicker"
data-date-format="M-yyyy" data-date-min-view-mode="1"> data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<button type="submit" class="btn btn-success"> Change Month </button> <button type="submit" class="btn btn-success"> Change Month </button>
@ -478,14 +478,14 @@
// Sum values for the material // Sum values for the material
$summary["opening"] = 0 ; $summary["opening"] = 0 ;
$summary["purchaseBharath"] = is_numeric($gasStockDetail['purchaseBharath']) ? $gasStockDetail['purchaseBharath'] : 0 ; $summary["purchaseBharath"] += is_numeric($gasStockDetail['purchaseBharath']) ? $gasStockDetail['purchaseBharath'] : 0 ;
$summary["purchaseIndian"] += is_numeric($gasStockDetail['purchaseIndian']) ? $gasStockDetail['purchaseIndian'] : 0 ; $summary["purchaseIndian"] += is_numeric($gasStockDetail['purchaseIndian']) ? $gasStockDetail['purchaseIndian'] : 0 ;
$summary["total"] += is_numeric($gasStockDetail['total']) ? $gasStockDetail['total'] : 0 ; $summary["total"] += is_numeric($gasStockDetail['total']) ? $gasStockDetail['total'] : 0 ;
$summary["consumption"] += is_numeric($gasStockDetail['consumption']) ? $gasStockDetail['consumption'] : 0 ; $summary["consumption"] += is_numeric($gasStockDetail['consumption']) ? $gasStockDetail['consumption'] : 0 ;
$summary["balanceStock"] += is_numeric($gasStockDetail['balanceStock']) ? $gasStockDetail['balanceStock'] : 0 ; $summary["balanceStock"] += is_numeric($gasStockDetail['balanceStock']) ? $gasStockDetail['balanceStock'] : 0 ;
$summary["drierMachineGasConsumption"] = is_numeric( $gasStockDetail['drierMachineGasConsumption']) ? $gasStockDetail['drierMachineGasConsumption'] : 0 ; $summary["drierMachineGasConsumption"] += is_numeric( $gasStockDetail['drierMachineGasConsumption']) ? $gasStockDetail['drierMachineGasConsumption'] : 0 ;
$summary["sandDried"] = is_numeric( $gasStockDetail['sandDried']) ? $gasStockDetail['sandDried'] : 0 ; $summary["sandDried"] += is_numeric( $gasStockDetail['sandDried']) ? $gasStockDetail['sandDried'] : 0 ;
$summary["coatingMachineGasconsumption"] += is_numeric($gasStockDetail['coatingMachineGasconsumption']) ? $gasStockDetail['coatingMachineGasconsumption'] : 0 ; $summary["coatingMachineGasconsumption"] += is_numeric($gasStockDetail['coatingMachineGasconsumption']) ? $gasStockDetail['coatingMachineGasconsumption'] : 0 ;
$summary["coatedSand"] += is_numeric($gasStockDetail['coatedSand']) ? $gasStockDetail['coatedSand'] : 0 ; $summary["coatedSand"] += is_numeric($gasStockDetail['coatedSand']) ? $gasStockDetail['coatedSand'] : 0 ;
$summary["trp_panel_gas_consumption"] += is_numeric($gasStockDetail['trp_panel_gas_consumption']) ? $gasStockDetail['trp_panel_gas_consumption'] : 0 ; $summary["trp_panel_gas_consumption"] += is_numeric($gasStockDetail['trp_panel_gas_consumption']) ? $gasStockDetail['trp_panel_gas_consumption'] : 0 ;

View File

@ -4,6 +4,10 @@
text-align: right; text-align: right;
} }
.side-table tbody td{
padding:3px !important ;
}
.fht-table, .fht-table,
.fht-table thead, .fht-table thead,
.fht-table tfoot, .fht-table tfoot,
@ -292,7 +296,7 @@
<div class="col-3"> <div class="col-3">
<?php $today = date('M-Y'); ?> <?php $today = date('M-Y'); ?>
<input type="text" name="month" id="month" value="<?php echo "$month" ?>" class="form-control mt-2" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1"> <input type="text" name="month" id="month" value="<?php echo "$month" ?>" class="form-control mt-2" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
<input type="hidden" name="remark" id="remark" value="<?php echo $remark ?>"> <input type="hidden" name="remark" id="remark" value="<?php echo $remark ?>">
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
@ -704,7 +708,7 @@
<tr> <tr>
<td class="celda_normal" > -</td> <td class="celda_normal" > -</td>
<td class="celda_normal" style="background-color:rgb(189, 9, 6); color:#fff ;"> <h5 style="color:#fff;"> total </h5> </td> <td class="celda_normal" style="background-color:rgb(189, 9, 6); color:#fff ;"> <h5 style="color:#fff;"> Total </h5> </td>
<td class="celda_normal" > -</td> <td class="celda_normal" > -</td>
@ -813,7 +817,7 @@
</thead> </thead>
<tbody > <tbody >
<tr> <tr>
<td style="text-align: left !important; width:25%;"><b>Supplier Name</b></td> <td style="text-align: left !important; width:25%; "><b>Supplier Name</b></td>
<td id="dwnldSupplierNameId"></td> <td id="dwnldSupplierNameId"></td>
</tr> </tr>
<tr> <tr>
@ -1018,7 +1022,7 @@
<br> <br>
<table class="side-table " border="1" width="100%"> <table class="side-table" id="resultTableId" border="1" width="100%">
<tbody > <tbody >
<tr> <tr>
<td style="text-align: left !important; width:25%;"><b>Accepted</b></td> <td style="text-align: left !important; width:25%;"><b>Accepted</b></td>
@ -1800,4 +1804,30 @@ $(document).ready(function() {
} }
}); });
</script>
<script>
$(document).ready(function () {
$("resultTableId td ,#basicDetailsTableId td, #meshTableId td, #incomingSilicaSandDetailsTable td").on("paste", function (e) {
console.log("Inside paste event");
let clipboardData = e.originalEvent.clipboardData || window.clipboardData;
let pastedText = clipboardData.getData("text/plain"); // Get plain text
let pastedHtml = clipboardData.getData("text/html"); // Get HTML (Excel pastes as <table>)
console.log("Plain Text:", pastedText);
console.log("HTML Data:", pastedHtml);
// Excel typically pastes tab-separated values or HTML tables
if (pastedText.includes("\t") || (pastedHtml && pastedHtml.includes("<table"))) {
console.log("Preventing Excel paste!");
e.preventDefault(); // Block Excel paste
alert("Pasting from Excel is disabled. Please enter data manually.");
}
});
});
</script> </script>

View File

@ -17,6 +17,14 @@
text-align: center; text-align: center;
} }
.grab {
cursor: grab; /* Default open-hand cursor */
}
.grab:active {
cursor: grabbing; /* Closed-hand cursor when dragging */
}
/* .fht-table td[contenteditable="true"] { /* .fht-table td[contenteditable="true"] {
background-color: lightyellow; background-color: lightyellow;
color:rgb(13, 7, 7); color:rgb(13, 7, 7);
@ -295,12 +303,26 @@ foreach ($period as $day) {
<input type="text" name="month" id="month" value="<?php echo "$month" ?>" <input type="text" name="month" id="month" value="<?php echo "$month" ?>"
class="form-control mt-2" data-provide="datepicker" class="form-control mt-2" data-provide="datepicker"
style="z-index:30;" style="z-index:30;"
data-date-format="M-yyyy" data-date-min-view-mode="1"> data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
</div> </div>
<div class="form-group col-md-2"> <div class="form-group col-md-3">
<button type="submit" class="btn btn-success"> Change Month </button> <button type="submit" class="btn btn-success"> Change Month </button>
<?php
//check it is current month , then only show the custom option
if($month == date('M-Y') ){
?>
<button type="button" class="btn" style="background-color:maroon;color:white" data-target="#customizeModalId"
data-toggle="modal">
Customize
</button>
<?php
}
?>
</div> </div>
<div class="col-md-1"></div>
<div class="col-6"> <div class="col-6">
<div class="dropdown float-right"> <div class="dropdown float-right">
<a href="#" class="dropdown-toggle arrow-none" data-toggle="dropdown" <a href="#" class="dropdown-toggle arrow-none" data-toggle="dropdown"
@ -316,6 +338,91 @@ foreach ($period as $day) {
</div> </div>
</form> </form>
<form action="<?= base_url('powerConsumptionDetails'); ?>" method="post">
<!-- modal placed here for submission of form -->
<!---------------------------------------
this modal is used to customize table header
1)list table header order
2)choose which material/machines you want
------------------------------------------------------------>
<div>
<div class="modal fade" id="customizeModalId" tabindex="-1" role="dialog" aria-labelledby="customizeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="customizeModalLabel">Customize</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<!-- Dropdown to add back removed items -->
<div class="col">
<div class="form-group">
<label for="customizeHeader"> Add For This Month </label>
<select id="customizeHeader" class="form-control" onchange="addBackToList()">
<option value="">Select</option>
<?php
foreach($activeElectricMachines as $index => $activeElectricMachine){ ?>
<option value="<?=$activeElectricMachine['id']?>">
<?=$activeElectricMachine['id']?> - <?=$activeElectricMachine['machine_name']?>
</option>
<?php
}
?>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col">
<h5>List of Selected Items</h5>
<div id="selectedItemsContainer">
<ul id="sortableList">
<?php foreach ($electricMachines as $electricMachine): ?>
<div class="sortable-item" draggable="true" id="<?= $electricMachine['id'] ?>_container">
<input type = "checkbox"
id = "<?= $electricMachine['id'] ?>_checkboxId"
name = "customisedMachineCodes[]"
value = "<?= $electricMachine['id'] ?>"
onclick = "removeSelectedMaterial(this)"
checked>
<label class="grab" for="<?= $electricMachine['id'] ?>_checkboxId">
<?= $electricMachine['id'] ?> - <?= $electricMachine['machine_name']; ?>
</label>
<br>
</div>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary float-right"> Apply </button>
</div>
</div>
</div>
</div>
</div>
<!-- hidden fields -->
<input type="hidden" name="month" id="month" value="<?php echo "$month" ?>"
class="form-control mt-2" data-provide="datepicker"
data-date-format="M-yyyy" data-date-min-view-mode="1">
</form>
<div class="table-responsive"> <div class="table-responsive">
@ -372,7 +479,7 @@ foreach ($period as $day) {
<tbody style="background-color: #fff;"> <tbody style="background-color: #fff;">
<?php if (!empty($groupedPowerConsumptionStockDetails)) { <?php if (!empty($totalPower)){
$summary = []; $summary = [];
@ -1335,3 +1442,87 @@ foreach ($period as $day) {
} }
}); });
</script> </script>
<script>
document.addEventListener("DOMContentLoaded", function () {
const list = document.getElementById("sortableList");
let draggedItem = null;
function attachDragEvents(item) {
item.setAttribute("draggable", "true");
item.addEventListener("dragstart", (event) => {
draggedItem = event.target;
event.target.classList.add("dragging");
});
item.addEventListener("dragend", (event) => {
event.target.classList.remove("dragging");
});
}
list.addEventListener("dragover", (event) => {
event.preventDefault(); // Allow dropping
const dragging = document.querySelector(".dragging");
const closestItem = getClosestItem(list, event.clientY);
if (closestItem) {
list.insertBefore(dragging, closestItem);
} else {
list.appendChild(dragging);
}
});
function getClosestItem(container, y) {
const items = [...container.querySelectorAll(".sortable-item:not(.dragging)")];
return items.reduce((closest, child) => {
const box = child.getBoundingClientRect();
const offset = y - box.top - box.height / 2;
return offset < 0 && offset > closest.offset
? { offset, element: child }
: closest;
}, { offset: Number.NEGATIVE_INFINITY }).element;
}
// Attach drag events to existing items
document.querySelectorAll(".sortable-item").forEach(attachDragEvents);
window.removeSelectedMaterial = function (checkbox) {
let container = checkbox.closest(".sortable-item");
let materialCode = checkbox.value;
let materialName = container.querySelector("label").innerText;
container.remove();
};
window.addBackToList = function () {
let dropdown = document.getElementById("customizeHeader");
let selectedOption = dropdown.options[dropdown.selectedIndex];
if (selectedOption.value !== "") {
let materialCode = selectedOption.value;
let materialName = selectedOption.text;
let container = document.createElement("div");
container.classList.add("sortable-item");
container.id = materialCode + "_container";
container.innerHTML = `
<input type="checkbox" id="${materialCode}_checkboxId"
name="customisedMachineCodes[]" value="${materialCode}"
onclick="removeSelectedMaterial(this)" checked>
<label class="grab" for="${materialCode}_checkboxId"> ${materialName} </label>
<br>
`;
attachDragEvents(container);
document.getElementById("sortableList").appendChild(container);
}
};
});
</script>

View File

@ -302,15 +302,23 @@ foreach ($period as $day) {
<div class="col-3"> <div class="col-3">
<input type="text" name="month" id="month" value="<?php echo "$month" ?>" <input type="text" name="month" id="month" value="<?php echo "$month" ?>"
class="form-control mt-2" data-provide="datepicker" class="form-control mt-2" data-provide="datepicker"
data-date-format="M-yyyy" data-date-min-view-mode="1"> data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<button type="submit" class="btn btn-success"> Change Month </button> <button type="submit" class="btn btn-success"> Change Month </button>
<?php
//check it is current month , then only show the custom option
if($month == date('M-Y') ){
?>
<button type="button" class="btn" style="background-color:maroon;color:white" data-target="#customizeModalId" <button type="button" class="btn" style="background-color:maroon;color:white" data-target="#customizeModalId"
data-toggle="modal"> data-toggle="modal">
Customize Customize
</button> </button>
<?php
}
?>
</div> </div>
<div class="col-6"> <div class="col-6">
<div class="dropdown float-right"> <div class="dropdown float-right">
@ -325,6 +333,95 @@ foreach ($period as $day) {
</div> </div>
</div> </div>
</div> </div>
</form>
<form action="<?= base_url('resinStockDetails'); ?>" method="post">
<!-- modal placed here for submission of form -->
<!---------------------------------------
this modal is used to customize table header
1)list table header order
2)choose which material/machines you want
------------------------------------------------------------>
<div>
<div class="modal fade" id="customizeModalId" tabindex="-1" role="dialog" aria-labelledby="customizeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="customizeModalLabel">Customize</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<!-- Dropdown to add back removed items -->
<div class="col">
<div class="form-group">
<label for="customizeHeader"> Add For This Month </label>
<select id="customizeHeader" class="form-control" onchange="addBackToList()">
<option value="">Select</option>
<?php
foreach($activeResinMaterials as $index => $activeResinMaterial){ ?>
<option value="<?=$activeResinMaterial['MaterialCode']?>">
<?=$activeResinMaterial['MaterialCode']?> - <?=$activeResinMaterial['MaterialName']?>
</option>
<?php
}
?>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col">
<h5>List of Selected Items</h5>
<div id="selectedItemsContainer">
<ul id="sortableList">
<?php foreach ($resinMaterials as $resinMaterial): ?>
<div class="sortable-item" draggable="true" id="<?= $resinMaterial['MaterialCode'] ?>_container">
<input type = "checkbox"
id = "<?= $resinMaterial['MaterialCode'] ?>_checkboxId"
name = "customisedMaterialCodes[]"
value = "<?= $resinMaterial['MaterialCode'] ?>"
onclick = "removeSelectedMaterial(this)"
checked>
<label class="grab" for="<?= $resinMaterial['MaterialCode'] ?>_checkboxId">
<?= $resinMaterial['MaterialCode'] ?> - <?= $resinMaterial['MaterialName']; ?>
</label>
<br>
</div>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary float-right"> Apply </button>
</div>
</div>
</div>
</div>
</div>
<!-- hidden fields -->
<input type="hidden" name="month" id="month" value="<?php echo "$month" ?>"
class="form-control mt-2" data-provide="datepicker"
data-date-format="M-yyyy" data-date-min-view-mode="1">
</form> </form>
@ -336,7 +433,7 @@ foreach ($period as $day) {
<tr> <tr>
<th class="celda_encabezado_general" colspan="1">material </th> <th class="celda_encabezado_general" colspan="1">Material </th>
<?php foreach ($resinMaterials as $resinMaterial) { ?> <?php foreach ($resinMaterials as $resinMaterial) { ?>
<!-- this will loop till materials present --> <!-- this will loop till materials present -->
@ -656,71 +753,7 @@ foreach ($period as $day) {
<!---------------------------------------
this modal is used to customize table header
1)list table header order
2)choose which material/machines you want
------------------------------------------------------------>
<div>
<div class="modal fade" id="customizeModalId" tabindex="-1" role="dialog" aria-labelledby="customizeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="customizeModalLabel">Customize</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<!-- Dropdown to add back removed items -->
<div class="col">
<div class="form-group">
<label for="customizeHeader"> Add For This Month </label>
<select id="customizeHeader" class="form-control" onchange="addBackToList()">
<option value="">Select</option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col">
<h5>List of Selected Items</h5>
<div id="selectedItemsContainer">
<ul id="sortableList">
<?php foreach ($resinMaterials as $resinMaterial): ?>
<div class="sortable-item" draggable="true" id="<?= $resinMaterial['MaterialCode'] ?>_container">
<input type="checkbox"
id="<?= $resinMaterial['MaterialCode'] ?>_checkboxId"
name="materialCodes[]"
value="<?= $resinMaterial['MaterialCode'] ?>"
onclick="removeSelectedMaterial(this)"
checked>
<label class="grab" for="<?= $resinMaterial['MaterialCode'] ?>_checkboxId">
<?= $resinMaterial['MaterialName']; ?>
</label>
<br>
</div>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
<button type="button" class="btn btn-primary float-right"> Apply </button>
</div>
</div>
</div>
</div>
</div>
@ -1140,12 +1173,6 @@ foreach ($period as $day) {
let materialCode = checkbox.value; let materialCode = checkbox.value;
let materialName = container.querySelector("label").innerText; let materialName = container.querySelector("label").innerText;
let dropdown = document.getElementById("customizeHeader");
let newOption = document.createElement("option");
newOption.value = materialCode;
newOption.text = materialName;
dropdown.appendChild(newOption);
container.remove(); container.remove();
}; };
@ -1162,7 +1189,7 @@ foreach ($period as $day) {
container.id = materialCode + "_container"; container.id = materialCode + "_container";
container.innerHTML = ` container.innerHTML = `
<input type="checkbox" id="${materialCode}_checkboxId" <input type="checkbox" id="${materialCode}_checkboxId"
name="materialCodes[]" value="${materialCode}" name="customisedMaterialCodes[]" value="${materialCode}"
onclick="removeSelectedMaterial(this)" checked> onclick="removeSelectedMaterial(this)" checked>
<label class="grab" for="${materialCode}_checkboxId"> ${materialName} </label> <label class="grab" for="${materialCode}_checkboxId"> ${materialName} </label>
<br> <br>
@ -1171,7 +1198,6 @@ foreach ($period as $day) {
attachDragEvents(container); attachDragEvents(container);
document.getElementById("sortableList").appendChild(container); document.getElementById("sortableList").appendChild(container);
dropdown.removeChild(selectedOption);
} }
}; };
}); });

View File

@ -321,7 +321,7 @@ $timeOtions[] = "12:00 AM";
<div class="col-3"> <div class="col-3">
<input type="text" name="month" id="month" value="<?php echo "$month" ?>" <input type="text" name="month" id="month" value="<?php echo "$month" ?>"
class="form-control mt-2" data-provide="datepicker" class="form-control mt-2" data-provide="datepicker"
data-date-format="M-yyyy" data-date-min-view-mode="1"> data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
</div> </div>
<div class="form-group col-md-2"> <div class="form-group col-md-2">
<button type="submit" class="btn btn-success"> Change Month </button> <button type="submit" class="btn btn-success"> Change Month </button>
@ -494,6 +494,9 @@ $timeOtions[] = "12:00 AM";
<?php if (!empty($trpProductionDetails)) { <?php if (!empty($trpProductionDetails)) {
$totalWcsReceived = 0 ;
$totalCrsReceived = 0 ;
// dd(array_keys($trpProductionDetails[0])); // dd(array_keys($trpProductionDetails[0]));
// dd($trpProductionDetails); // dd($trpProductionDetails);
@ -963,8 +966,11 @@ $timeOtions[] = "12:00 AM";
$summary['panelGasConsumption'] += is_numeric($trpProductionDetail['panelGasConsumption']) ? $trpProductionDetail['panelGasConsumption'] : 0; $summary['panelGasConsumption'] += is_numeric($trpProductionDetail['panelGasConsumption']) ? $trpProductionDetail['panelGasConsumption'] : 0;
$summary['panelGasPerTon'] += is_numeric($trpProductionDetail['panelGasPerTon']) ? $trpProductionDetail['panelGasPerTon'] : 0; $summary['panelGasPerTon'] += is_numeric($trpProductionDetail['panelGasPerTon']) ? $trpProductionDetail['panelGasPerTon'] : 0;
//total of all incoming waste core sand
foreach($wcsSupplierList as $supplier){ foreach($wcsSupplierList as $supplier){
$summary[$supplier] += is_numeric($trpProductionDetail[$supplier]) ? $trpProductionDetail[$supplier] : 0; $summary[$supplier] += is_numeric($trpProductionDetail[$supplier]) ? $trpProductionDetail[$supplier] : 0;
$totalWcsReceived += is_numeric($trpProductionDetail[$supplier]) ? $trpProductionDetail[$supplier] : 0;
} }
$summary['edRunningHours'] += is_numeric($trpProductionDetail['edRunningHours']) ? $trpProductionDetail['edRunningHours'] : 0; $summary['edRunningHours'] += is_numeric($trpProductionDetail['edRunningHours']) ? $trpProductionDetail['edRunningHours'] : 0;
@ -974,8 +980,11 @@ $timeOtions[] = "12:00 AM";
$summary['trpProductionPerHour'] += is_numeric($trpProductionDetail['trpProductionPerHour']) ? $trpProductionDetail['trpProductionPerHour'] : 0; $summary['trpProductionPerHour'] += is_numeric($trpProductionDetail['trpProductionPerHour']) ? $trpProductionDetail['trpProductionPerHour'] : 0;
$summary['coating'] += is_numeric($trpProductionDetail['coating']) ? $trpProductionDetail['coating'] : 0; $summary['coating'] += is_numeric($trpProductionDetail['coating']) ? $trpProductionDetail['coating'] : 0;
// total of all core reclaimed sand
foreach($crsClientList as $client){ foreach($crsClientList as $client){
$summary[$client] += is_numeric($trpProductionDetail[$client]) ? $trpProductionDetail[$client] : 0; $summary[$client] += is_numeric($trpProductionDetail[$client]) ? $trpProductionDetail[$client] : 0;
$totalCrsReceived += is_numeric($trpProductionDetail[$client]) ? $trpProductionDetail[$client] : 0;
} }
$summary['waterReceipt'] += is_numeric($trpProductionDetail['waterReceipt']) ? $trpProductionDetail['waterReceipt'] : 0; $summary['waterReceipt'] += is_numeric($trpProductionDetail['waterReceipt']) ? $trpProductionDetail['waterReceipt'] : 0;
@ -1444,12 +1453,6 @@ $timeOtions[] = "12:00 AM";
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<?php $abstractDetails = [
] ?>
<h4 style="text-align:center">Abstract for the month <?=$month?></h4> <h4 style="text-align:center">Abstract for the month <?=$month?></h4>
<div class="table-responsive"> <div class="table-responsive">
@ -1457,7 +1460,7 @@ $timeOtions[] = "12:00 AM";
<table id="abstractTableId" class="fht-table table-striped"> <table id="abstractTableId" class="fht-table table-striped">
<thead class="celda_encabezado_general" style="padding: 10px ;"> <thead class="celda_encabezado_general" style="padding: 10px ;">
<tr> <tr>
<th class="celda_encabezado_general">Particulars</th> <th class="celda_encabezado_general" style="width: 200px;">Particulars</th>
<th class="celda_encabezado_general">Running Hours</th> <th class="celda_encabezado_general">Running Hours</th>
<th class="celda_encabezado_general">Per Hour</th> <th class="celda_encabezado_general">Per Hour</th>
<th class="celda_encabezado_general">Opening Stock</th> <th class="celda_encabezado_general">Opening Stock</th>
@ -1466,30 +1469,336 @@ $timeOtions[] = "12:00 AM";
<th class="celda_encabezado_general">Consumption</th> <th class="celda_encabezado_general">Consumption</th>
<th class="celda_encabezado_general">Closing Stock</th> <th class="celda_encabezado_general">Closing Stock</th>
<th class="celda_encabezado_general">Physical Stock</th> <th class="celda_encabezado_general">Physical Stock</th>
<th class="celda_encabezado_general">Remarks</th> <th class="celda_encabezado_general" style="width: 200px;">Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <?php
<td class="celda_normal"> dummy</td>
<td class="celda_normal"> dummy</td>
<td class="celda_normal"> dummy</td>
<td class="celda_normal"> dummy</td> if(!empty($trpAbstract)){
<td class="celda_normal"> dummy</td>
<td class="celda_normal"> dummy</td>
<td class="celda_normal"> dummy</td>
<td class="celda_normal"> dummy</td> $abstractForCurrentMonth=[
<td class="celda_normal"> dummy</td> [
<td class="celda_normal"> dummy</td> 'absDate' => $trpAbstract["Incoming Raw Sand Details"]['date'] ,
</tr> 'absParticulars' => "Incoming Raw Sand Details",
'absRunningHrs' => "",
'absPerHour' => "",
'absOpeningStock'=> (int)$trpAbstract["Incoming Raw Sand Details"]['opening_stock'],
'absReceipt' => $totalWcsReceived,
'absTotal' => (int)$trpAbstract["Incoming Raw Sand Details"]['opening_stock'] + $totalWcsReceived,
'absConsumption' => $summary['edProduction'],
'absClosingStock' => ((int)$trpAbstract["Incoming Raw Sand Details"]['opening_stock'] + $totalWcsReceived) - $summary['edProduction'],
'absPhysicalStock' => (int)$trpAbstract["Incoming Raw Sand Details"]['physical_stock'],
'absRemarks' => $trpAbstract["Incoming Raw Sand Details"]['remarks'],
],
[
'absDate' => $trpAbstract["ED Details"]['date'] ,
'absParticulars' => "ED Details",
'absRunningHrs' => $summary['edRunningHours'],
'absPerHour' => number_format( $summary['edProduction'] / ($summary['edRunningHours'] == 0 ? 1 : $summary['edRunningHours']) ,2),
'absOpeningStock'=> (int)$trpAbstract["ED Details"]['opening_stock'],
'absReceipt' => $summary['edProduction'],
'absTotal' => (int)$trpAbstract["ED Details"]['opening_stock'] + $summary['edProduction'],
'absConsumption' => $summary['edUsage'] + ($summary['coolerBags'] * 1250 ) + ($summary['cycloneWaste'] * 1250 ) + ( $summary['edWaste'] * 1250 ),
'absClosingStock' => (int)$trpAbstract["ED Details"]['opening_stock'] + $summary['edProduction'] - ($summary['edUsage'] + ($summary['coolerBags'] * 1250 ) + ($summary['cycloneWaste'] * 1250 ) + ( $summary['edWaste'] * 1250 ) ),
'absPhysicalStock' =>(int)$trpAbstract["ED Details"]['physical_stock'],
'absRemarks' => $trpAbstract["ED Details"]['remarks'],
],
[
'absDate' => $trpAbstract["TRP Total Sand"]['date'] ,
'absParticulars' => "TRP Total Sand",
'absRunningHrs' => $summary['sandFeedingHours'],
'absPerHour' => $summary['trpProductionPerHour'],
'absOpeningStock'=> (int)$trpAbstract["TRP Total Sand"]['opening_stock'],
'absReceipt' =>$summary['trpProduction'],
'absTotal' =>(int)$trpAbstract["TRP Total Sand"]['opening_stock'] + $summary['trpProduction'],
'absConsumption' =>$totalCrsReceived,
'absClosingStock' =>(int)$trpAbstract["TRP Total Sand"]['opening_stock'] + $summary['trpProduction'] - $totalCrsReceived,
'absPhysicalStock' =>(int)$trpAbstract["TRP Total Sand"]['physical_stock'],
'absRemarks' => $trpAbstract["TRP Total Sand"]['remarks'],
],
[
'absDate' => $trpAbstract["Trp Physical Gas Consumption"]['date'] ,
'absParticulars' => "Trp Physical Gas Consumption",
'absRunningHrs' => "",
'absPerHour' => number_format(($summary['trpPlusDrierGasConsumption']) / ( ( $summary['trpProduction'] == 0 ? 1000 : $summary['trpProduction'] )/1000), 2, '.', ''),
'absOpeningStock'=>(int)$trpAbstract["Trp Physical Gas Consumption"]['opening_stock'],
'absReceipt' => $summary['gasReceiptBg'] + $summary['gasReceiptPg'],
'absTotal' => (int)$trpAbstract["Trp Physical Gas Consumption"]['opening_stock'] + $summary['gasReceiptBg'] + $summary['gasReceiptPg'],
'absConsumption' => $summary['physicalGasConsumption'],
'absClosingStock' => (int)$trpAbstract["Trp Physical Gas Consumption"]['opening_stock'] + $summary['gasReceiptBg'] + $summary['gasReceiptPg'] - $summary['physicalGasConsumption'],
'absPhysicalStock' =>(int)$trpAbstract["Trp Physical Gas Consumption"]['physical_stock'],
'absRemarks' => $trpAbstract["Trp Physical Gas Consumption"]['remarks'],
],
[
'absDate' => $trpAbstract["Trp Panel Gas Consumption"]['date'] ,
'absParticulars' => "Trp Panel Gas Consumption",
'absRunningHrs' => "",
'absPerHour' => number_format(($summary['panelGasConsumption']) / ( ( $summary['trpProduction'] == 0 ? 1000 : $summary['trpProduction'] )/1000) ,2),
'absOpeningStock'=>(int)$trpAbstract["Trp Panel Gas Consumption"]['opening_stock'],
'absReceipt' => $summary['gasReceiptBg'] + $summary['gasReceiptPg'],
'absTotal' => (int)$trpAbstract["Trp Panel Gas Consumption"]['opening_stock'] + $summary['gasReceiptBg'] + $summary['gasReceiptPg'],
'absConsumption' => $summary['panelGasConsumption'],
'absClosingStock' => (int)$trpAbstract["Trp Panel Gas Consumption"]['opening_stock'] + $summary['gasReceiptBg'] + $summary['gasReceiptPg'] - $summary['panelGasConsumption'],
'absPhysicalStock' =>(int)$trpAbstract["Trp Panel Gas Consumption"]['physical_stock'],
'absRemarks' => $trpAbstract["Trp Panel Gas Consumption"]['remarks'],
],
[
'absDate' => $trpAbstract["Water Consumption"]['date'] ,
'absParticulars' => "Water Consumption",
'absRunningHrs' => "",
'absPerHour' => "",
'absOpeningStock'=>(int)$trpAbstract["Water Consumption"]['opening_stock'],
'absReceipt' =>$summary['waterReceipt'],
'absTotal' =>(int)$trpAbstract["Water Consumption"]['opening_stock'] + $summary['waterReceipt'],
'absConsumption' => $summary['waterConsumption'],
'absClosingStock' =>(int)$trpAbstract["Water Consumption"]['opening_stock'] + $summary['waterReceipt'] - $summary['waterConsumption'],
'absPhysicalStock' =>(int)$trpAbstract["Water Consumption"]['physical_stock'],
'absRemarks' => $trpAbstract["Water Consumption"]['remarks'],
],
[
'absDate' => $trpAbstract["Power Consumption"]['date'] ,
'absParticulars' => "Power Consumption",
'absRunningHrs' =>$summary['ebReadingPerUnitTon'],
'absPerHour' => "",
'absOpeningStock'=>(int)$trpAbstract["Power Consumption"]['opening_stock'],
'absReceipt' =>'',
'absTotal' =>'',
'absConsumption' => $summary['ebReading'],
'absClosingStock' =>'',
'absPhysicalStock' =>(int)$trpAbstract["Power Consumption"]['physical_stock'],
'absRemarks' => $trpAbstract["Power Consumption"]['remarks'],
]
];
?>
<?php foreach($abstractForCurrentMonth as $abstract)
{
$absDate = DateTime::createFromFormat('M-Y', $month)->format('Y-m');
$absDate = "$absDate-01";
?>
<tr>
<!-- particulars -->
<td class="celda_normal absParticulars"><?=$abstract['absParticulars'] ?> </td>
<!-- running hours no need -->
<td class="celda_normal absRunningHrs"><?=$abstract['absRunningHrs']?></td>
<!-- per hour no need -->
<td class="celda_normal absPerHour"><?=$abstract['absPerHour']?></td>
<!-- opening stock be -->
<td class="celda_normal absOpeningStock"
oninput="absOpeningStockChange(this)"
contenteditable="true"><?=$abstract['absOpeningStock']?></td>
<!-- receipt total of all incoming waste core sand-->
<td class="celda_normal absReceipt"><?=$abstract['absReceipt']?> </td>
<!-- Total fe -->
<td class="celda_normal absTotal"><?=$abstract['absTotal']?></td>
<!-- consumption fe-->
<td class="celda_normal absConsumption"><?=$abstract['absConsumption']?></td>
<!-- closing stock fe -->
<td class="celda_normal absClosingStock"><?=$abstract['absClosingStock']?> </td>
<!-- physical stock be -->
<td class="celda_normal absPhysicalStock"
contenteditable="true"> <?=$abstract['absPhysicalStock']?> </td>
<!-- remarks be -->
<td class="celda_normal absRemarks"
contenteditable="true"> <?=$abstract['absRemarks']?> </td>
<!-- absDate -->
<td class="absDate" style="display:none"> <?= $absDate; ?> </td>
</tr>
<?php } ?>
<?php }else{
$abstractForCurrentMonth=[
[
'absParticulars' => "Incoming Raw Sand Details",
'absRunningHrs' => "",
'absPerHour' => "",
'absOpeningStock'=>'',
'absReceipt' => $totalWcsReceived,
'absTotal' => $totalWcsReceived,
'absConsumption' => $summary['edProduction'],
'absClosingStock' =>( $totalWcsReceived ) - $summary['edProduction'],
'absPhysicalStock' =>'',
'absRemarks' =>'',
],
[
'absParticulars' => "ED Details",
'absRunningHrs' => $summary['edRunningHours'],
'absPerHour' => number_format( $summary['edProduction'] / ($summary['edRunningHours'] == 0 ? 1 : $summary['edRunningHours']) ,2),
'absOpeningStock'=>'',
'absReceipt' => $summary['edProduction'],
'absTotal' => $summary['edProduction'],
'absConsumption' => $summary['edUsage'] + ($summary['coolerBags'] * 1250 ) + ($summary['cycloneWaste'] * 1250 ) + ( $summary['edWaste'] * 1250 ),
'absClosingStock' => $summary['edProduction'] - $summary['edUsage'] + ($summary['coolerBags'] * 1250 ) + ($summary['cycloneWaste'] * 1250 ) + ( $summary['edWaste'] * 1250 ),
'absPhysicalStock' =>'',
'absRemarks' =>'',
],
[
'absParticulars' => "TRP Total Sand",
'absRunningHrs' => $summary['sandFeedingHours'],
'absPerHour' => $summary['trpProductionPerHour'],
'absOpeningStock'=>'',
'absReceipt' =>$summary['trpProduction'],
'absTotal' =>$summary['trpProduction'],
'absConsumption' =>$totalCrsReceived,
'absClosingStock' =>$summary['trpProduction'] - $totalCrsReceived,
'absPhysicalStock' =>'',
'absRemarks' =>'',
],
[
'absParticulars' => "Trp Physical Gas Consumption",
'absRunningHrs' => "",
'absPerHour' => number_format(($summary['trpPlusDrierGasConsumption']) / ( ( $summary['trpProduction'] == 0 ? 1000 : $summary['trpProduction'] )/1000), 2, '.', ''),
'absOpeningStock'=>'',
'absReceipt' => $summary['gasReceiptBg'] + $summary['gasReceiptPg'],
'absTotal' => $summary['gasReceiptBg'] + $summary['gasReceiptPg'],
'absConsumption' => $summary['physicalGasConsumption'],
'absClosingStock' =>($summary['gasReceiptBg'] + $summary['gasReceiptPg']) - $summary['physicalGasConsumption'],
'absPhysicalStock' =>'',
'absRemarks' =>'',
],
[
'absParticulars' => "Trp Panel Gas Consumption",
'absRunningHrs' => "",
'absPerHour' => number_format(($summary['panelGasConsumption']) / ( ( $summary['trpProduction'] == 0 ? 1000 : $summary['trpProduction'] )/1000) ,2),
'absOpeningStock'=>'',
'absReceipt' => $summary['gasReceiptBg'] + $summary['gasReceiptPg'],
'absTotal' => $summary['gasReceiptBg'] + $summary['gasReceiptPg'],
'absConsumption' => $summary['panelGasConsumption'],
'absClosingStock' =>($summary['gasReceiptBg'] + $summary['gasReceiptPg']) - $summary['panelGasConsumption'],
'absPhysicalStock' =>'',
'absRemarks' =>'',
],
[
'absParticulars' => "Water Consumption",
'absRunningHrs' => "",
'absPerHour' => "",
'absOpeningStock'=>'',
'absReceipt' =>$summary['waterReceipt'],
'absTotal' =>$summary['waterReceipt'],
'absConsumption' =>$summary['waterReceipt'] - $summary['waterConsumption'],
'absClosingStock' =>'',
'absPhysicalStock' =>'',
'absRemarks' =>'',
],
[
'absParticulars' => "Power Consumption",
'absRunningHrs' =>$summary['ebReadingPerUnitTon'],
'absPerHour' => "",
'absOpeningStock'=>'',
'absReceipt' =>'',
'absTotal' =>'',
'absConsumption' => $summary['ebReading'],
'absClosingStock' =>'',
'absPhysicalStock' =>'',
'absRemarks' =>'',
],
]
?>
<?php foreach($abstractForCurrentMonth as $abstract)
{
$absDate = DateTime::createFromFormat('M-Y', $month)->format('Y-m');
$absDate = "$absDate-01";
?>
<tr>
<!-- particulars -->
<td class="celda_normal absParticulars"><?=$abstract['absParticulars']?></td>
<!-- running hours no need -->
<td class="celda_normal absRunningHrs"><?=$abstract['absRunningHrs']?></td>
<!-- per hour no need -->
<td class="celda_normal absPerHour"><?=$abstract['absPerHour']?></td>
<!-- opening stock be -->
<td class="celda_normal absOpeningStock"
oninput="absOpeningStockChange(this)"
contenteditable="true"><?=$abstract['absOpeningStock']?></td>
<!-- receipt total of all incoming waste core sand-->
<td class="celda_normal absReceipt"><?=$abstract['absReceipt']?> </td>
<!-- Total fe -->
<td class="celda_normal absTotal"><?=$abstract['absTotal']?></td>
<!-- consumption fe-->
<td class="celda_normal absConsumption"><?=$abstract['absConsumption']?></td>
<!-- closing stock fe -->
<td class="celda_normal absClosingStock"><?=$abstract['absClosingStock']?> </td>
<!-- physical stock be -->
<td class="celda_normal absPhysicalStock"
contenteditable="true"> <?=$abstract['absPhysicalStock']?> </td>
<!-- remarks be -->
<td class="celda_normal absRemarks"
contenteditable="true"> <?=$abstract['absRemarks']?> </td>
<!-- absDate -->
<td class="absDate" style="display:none"> <?= $absDate; ?> </td>
</tr>
<?php } ?>
<?php }
?>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="row">
<div class="col-md-12 text-center">
<input type="button" class="btn btn-success px-4" id="abstractSaveId" value="save">
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -1552,7 +1861,7 @@ $timeOtions[] = "12:00 AM";
//table to json function //table to json function
var updateTrpProductionDetails = tableToJson(); var updateTrpProductionDetails = tableToJsonTrp();
@ -1594,7 +1903,7 @@ $timeOtions[] = "12:00 AM";
</script> </script>
<script> <script>
function tableToJson() { function tableToJsonTrp() {
const table = $('#trpProductionStockDetailsTableId'); const table = $('#trpProductionStockDetailsTableId');
const rows = []; const rows = [];
@ -1946,142 +2255,175 @@ $timeOtions[] = "12:00 AM";
</script> </script>
<script>
function absOpeningStockChange(element) {
let row = $(element).closest('tr'); // Get the current row
let openingStockTd = row.find('td.absOpeningStock').text().trim()??'';
let receiptTd = row.find('td.absReceipt').text().trim()??'';
let consumptionTd = row.find('td.absConsumption').text().trim()??'';
// Convert to numbers for calculations
let openingStock = validateInput(openingStockTd) || 0;
let receipt = validateInput(receiptTd) || 0;
let consumption = validateInput(consumptionTd) || 0;
// Calculate values
let totalStock = parseFloat(openingStock) + parseFloat(receipt);
let closingStock = parseFloat(totalStock) - parseFloat(consumption);
// Update the table cells
row.find('td.absTotal').text(parseFloat(totalStock).toFixed(2));
row.find('td.absClosingStock').text(parseFloat(closingStock).toFixed(2));
}
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#abstractSaveId').click(function() {
//table to json function
var updateAbstractDetails = tableToJsonAbstract();
alert('Updation may take a while, And we appreciate your patience..!!');
$('#loader').show();
$.ajax({
data: {
updateAbstractDetails
},
type: "POST",
url: "<?php echo base_url();?>updateAbstractDetails",
success: function(data) {
if (data) {
$('#loader').hide();
console.log(data);
alert(data);
}
},
error: function(xhr, status, error) {
alert("An error occurred while processing the request. Please try again.");
console.error("Error Code:", xhr.status);
console.error("Error Message:", error);
console.error("Response Text:", xhr.responseText);
},
complete: function() {
$('#loader').hide();
}
});
});
});
</script>
<script> <script>
// !caution! function tableToJsonAbstract (){
// !caution!
// !caution!
// !caution!
// !caution!
// !caution!
// dont delete this commented code , this is used for refernce in getting td values
// let openingTime = tr.find('td:eq(1)').text().trim(); const table = $("#abstractTableId");
// let closingTime = tr.find('td:eq(2)').text().trim(); const rows = [];
// let totalHours = tr.find('td:eq(3)').text().trim();
// let coldStart = tr.find('td:eq(4)').text().trim(); //this table to json is customized for bagstock not for all
// let breakdownHours = tr.find('td:eq(5)').text().trim();
// let burnerFiringHours = tr.find('td:eq(6)').text().trim(); table.find('tbody tr').each(function() {
// let sandFeedingHours = tr.find('td:eq(7)').text().trim();
// let gasReceiptBg = tr.find('td:eq(8)').text().trim();
// let gasReceiptPg = tr.find('td:eq(9)').text().trim();
// let physicalGasConsumption = tr.find('td:eq(10)').text().trim();
// let drierGasConsumption = tr.find('td:eq(11)').text().trim();
// let coatingGasConsumption = tr.find('td:eq(12)').text().trim();
// let trpPlusDrierGasConsumption = tr.find('td:eq(13)').text().trim();
// let trpPhysicalGasPerTon = tr.find('td:eq(14)').text().trim();
// let panelGasConsumption = tr.find('td:eq(15)').text().trim();
// let panelGasPerTon = tr.find('td:eq(16)').text().trim();
// let isolAls = tr.find('td:eq(17)').text().trim();
// let isolAle = tr.find('td:eq(18)').text().trim();
// let isolMe = tr.find('td:eq(19)').text().trim();
// let isolSi = tr.find('td:eq(20)').text().trim();
// let isolCaparo = tr.find('td:eq(21)').text().trim();
// let isolNemak = tr.find('td:eq(22)').text().trim();
// let isolDr = tr.find('td:eq(23)').text().trim();
// let edRunningHours = tr.find('td:eq(24)').text().trim();
// let edProduction = tr.find('td:eq(25)').text().trim();
// let edUsage = tr.find('td:eq(26)').text().trim();
// let trpProduction = tr.find('td:eq(27)').text().trim();
// let trpProductionPerHour = tr.find('td:eq(28)').text().trim();
// let coating = tr.find('td:eq(29)').text().trim();
// let usageHindhuja = tr.find('td:eq(30)').text().trim();
// let usageNemak = tr.find('td:eq(31)').text().trim();
// let usageMe = tr.find('td:eq(32)').text().trim();
// let usageBi = tr.find('td:eq(33)').text().trim();
// let usageKarmen = tr.find('td:eq(34)').text().trim();
// let waterReceipt = tr.find('td:eq(35)').text().trim();
// let waterConsumption = tr.find('td:eq(36)').text().trim();
// let ebReading = tr.find('td:eq(37)').text().trim();
// let ebReadingPerUnitTon = tr.find('td:eq(38)').text().trim();
// let workingPersonEngineers = tr.find('td:eq(39)').text().trim();
// let workingPersonSupervisiors = tr.find('td:eq(40)').text().trim();
// let workingPersonOperators = tr.find('td:eq(41)').text().trim();
// let rollerDrivers = tr.find('td:eq(42)').text().trim();
// let natureOfMaintenance = tr.find('td:eq(43)').text().trim();
// let location = tr.find('td:eq(44)').text().trim();
// let description = tr.find('td:eq(45)').text().trim();
// let msSeperation = tr.find('td:eq(46)').text().trim();
// let edWaste = tr.find('td:eq(47)').text().trim();
// let coolerBags = tr.find('td:eq(48)').text().trim();
// let edPlus20Waste = tr.find('td:eq(49)').text().trim();
// let cycloneWaste = tr.find('td:eq(50)').text().trim();
// !caution! const rowData = {
// !caution!
// !caution!
// !caution!
// !caution!
// !caution!
// dont delete this commented code , this is used for refernce in getting td values particulars :$(this).find(`td.absParticulars`).text().trim(),
opening_stock :$(this).find(`td.absOpeningStock`).text() ,
physical_stock :$(this).find(`td.absPhysicalStock`).text() ,
remarks :$(this).find(`td.absRemarks`).text(),
date :$(this).find(`td.absDate`).text()
};
rows.push(rowData);
});
return JSON.stringify(rows, null, 2);
}
</script> </script>

View File

@ -172,12 +172,14 @@
.fht-table thead { .fht-table thead {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 20; /* Ensure the entire header stays above table rows */ z-index: 20;
background-color: #50bbd9; /* Header background color */ /* Ensure the entire header stays above table rows */
background-color: #50bbd9;
/* Header background color */
} }
.dropdown-menu { .dropdown-menu {
z-index :25 ; z-index: 25;
} }
@ -186,14 +188,13 @@
.fht-table thead th { .fht-table thead th {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 11; /* Higher than table rows but lower than first column */ z-index: 11;
background-color: #50bbd9; /* Green background */ /* Higher than table rows but lower than first column */
background-color: #50bbd9;
/* Green background */
color: #ffffff; color: #ffffff;
border: 1px solid #ddd; border: 1px solid #ddd;
padding: 10px; padding: 10px;
white-space: normal; /* Allows text to wrap */
word-wrap: break-word; /* Breaks long words if needed */
text-align: center; /* Centers text for better alignment */
} }
/* Sticky First Column */ /* Sticky First Column */
@ -202,7 +203,8 @@
position: sticky; position: sticky;
left: 0; left: 0;
background-color: #50bbd9; background-color: #50bbd9;
z-index: 15; /* Ensures it stays above other cells */ z-index: 15;
/* Ensures it stays above other cells */
border-right: 2px solid #ddd; border-right: 2px solid #ddd;
color: #ffffff; color: #ffffff;
} }
@ -211,21 +213,15 @@
.table-responsive { .table-responsive {
overflow-x: auto; overflow-x: auto;
overflow-y: auto; overflow-y: auto;
max-height: 500px; /* Adjust as needed */ max-height: 500px;
/* Adjust as needed */
position: relative; position: relative;
} }
td{ td {
min-width: 100px; min-width: 150px;
max-width: 100px; max-width: 150px;
} }
</style> </style>
@ -269,7 +265,7 @@
<div class="col-3"> <div class="col-3">
<input type="text" name="month" id="month" value="<?php echo "$month" ?>" <input type="text" name="month" id="month" value="<?php echo "$month" ?>"
class="form-control mt-2" data-provide="datepicker" class="form-control mt-2" data-provide="datepicker"
data-date-format="M-yyyy" data-date-min-view-mode="1"> data-date-format="M-yyyy" data-date-min-view-mode="1" readonly>
</div> </div>
<div class="form-group col-md-2"> <div class="form-group col-md-2">
<button type="submit" class="btn btn-success"> Change Month </button> <button type="submit" class="btn btn-success"> Change Month </button>
@ -382,7 +378,7 @@
} ?> } ?>
<div class="table-responsive" style="width: 700px;"> <div class="table-responsive" >
<table id="trpSandUseStockDetailsTableSummaryId" class="fht-table table-striped"> <table id="trpSandUseStockDetailsTableSummaryId" class="fht-table table-striped">
@ -544,6 +540,7 @@
$('#loader').hide(); $('#loader').hide();
console.log(data); console.log(data);
alert(data); alert(data);
window.location.reload();
} }
}, },

View File

@ -84,22 +84,26 @@
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" <i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button"
id="resetButton" title="Reset"></i> id="resetButton" title="Reset"></i>
<div style="margin-left:auto">
<div class="form-check" style="margin-right: 25px;">
<input class="form-check-input" type="checkbox" id="showArchiveId"
name="showArchive" value="1" onchange="showArchiveList()"
style="width: 18px; height: 18px;">
<label class="form-check-label" for="showArchiveId"
style="font-size: 1rem; margin-left: 8px;">
Show Archive
</label>
</div>
</div>
<div class="error" id="error"></div> <div class="error" id="error"></div>
</form> </form>
<div style="margin-left:auto">
<div class="form-check" style="margin-right: 25px;">
<form id="archiveFormId" action="<?php echo base_url()?>/supplierlisting" method="post">
<input class="form-check-input" type="checkbox" id="showArchiveId"
name="showArchive" value="1" <?php echo $showArchive ? "checked" : " " ?>
style="width: 18px; height: 18px;">
<label class="form-check-label" for="showArchiveId"
style="font-size: 1rem; margin-left: 8px;">
Show Archive
</label>
</form>
</div>
</div>
<div class="card-body" style="overflow-x:scroll;"> <div class="card-body" style="overflow-x:scroll;">
<table class="table dt-responsive nowrap w-100" id="datatable"> <table class="table dt-responsive nowrap w-100" id="datatable">
<thead> <thead>
@ -124,12 +128,7 @@
foreach ($userRecords as $record) { foreach ($userRecords as $record) {
?> ?>
<tr class="<?php if ($record->IsActive == 0) { <tr >
echo "deactivatedRow";
} ?>"
style="<?php if ($record->IsActive == 0) {
echo "display:none";
} ?>">
<?php if (date('d-m-Y', strtotime($record->CreatedOn)) == "30-11--0001") { <?php if (date('d-m-Y', strtotime($record->CreatedOn)) == "30-11--0001") {
$cdate = '00-00-0000'; $cdate = '00-00-0000';
@ -493,28 +492,14 @@ function formatNumberToIndianCurrency(number) {
}); });
function showArchiveList() { </script>
let isChecked = $("#showArchiveId").prop('checked');
// Show or hide the rows based on checkbox status
$(".deactivatedRow").each(function () {
if (isChecked) {
$(this).show();
} else {
$(this).hide();
}
});
}
$(document).ready(function () { <script>
let table = $('#datatable').DataTable(); $(document).on("change", "#showArchiveId", function () {
console.log("Checkbox changed, submitting form...");
$("#archiveFormId").submit();
});
showArchiveList();
table.on('draw', function () {
showArchiveList();
});
});
</script> </script>

View File

@ -121,21 +121,27 @@
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" <i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button"
id="resetButton" title="Reset"></i> id="resetButton" title="Reset"></i>
<div style="margin-left:auto"> <div class="error" id="error"></div>
</form>
<div style="margin-left:auto">
<div class="form-check" style="margin-right: 25px;"> <div class="form-check" style="margin-right: 25px;">
<form id="archiveFormId" action="<?php echo base_url()?>/transporterListing" method="post">
<input class="form-check-input" type="checkbox" id="showArchiveId" <input class="form-check-input" type="checkbox" id="showArchiveId"
name="showArchive" value="1" onchange="showArchiveList()" name="showArchive" value="1" <?php echo $showArchive ? "checked" : " " ?>
style="width: 18px; height: 18px;"> style="width: 18px; height: 18px;">
<label class="form-check-label" for="showArchiveId" <label class="form-check-label" for="showArchiveId"
style="font-size: 1rem; margin-left: 8px;"> style="font-size: 1rem; margin-left: 8px;">
Show Archive Show Archive
</label> </label>
</form>
</div> </div>
</div> </div>
<div class="error" id="error"></div>
</form>
<div class="card-body" style="overflow-x:scroll;"> <div class="card-body" style="overflow-x:scroll;">
<table id="transporter_list" class="table dt-responsive nowrap w-100"> <table id="transporter_list" class="table dt-responsive nowrap w-100">
@ -156,11 +162,8 @@
$date = $createdat->format('d-m-Y'); $date = $createdat->format('d-m-Y');
$time = $createdat->format('h:i A'); $time = $createdat->format('h:i A');
?> ?>
<tr class="<?php if ($record->isactive == 0) { <tr>
echo "deactivatedRow";
} ?>" style="<?php if ($record->isactive == 0) {
echo "display:none";
} ?>">
<td><?php echo $date; ?></td> <td><?php echo $date; ?></td>
<td><?php echo $record->name ?></td> <td><?php echo $record->name ?></td>
<td><?php echo $record->FirstName ?></td> <td><?php echo $record->FirstName ?></td>
@ -423,30 +426,6 @@
} }
function showArchiveList() {
let isChecked = $("#showArchiveId").prop('checked');
// Show or hide the rows based on checkbox status
$(".deactivatedRow").each(function () {
if (isChecked) {
$(this).show();
} else {
$(this).hide();
}
});
}
$(document).ready(function () {
let table = $('#transporter_list').DataTable();
showArchiveList();
table.on('draw', function () {
showArchiveList();
});
});
</script> </script>
@ -458,4 +437,13 @@ $(document).on('keydown', function(event) {
} }
}); });
</script>
<script>
$(document).on("change", "#showArchiveId", function () {
console.log("Checkbox changed, submitting form...");
$("#archiveFormId").submit();
});
</script> </script>

View File

@ -88,22 +88,26 @@
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button> <button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i> <i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div style="margin-left:auto">
<div class="form-check" style="margin-right: 25px;">
<input class="form-check-input" type="checkbox" id="showArchiveId"
name="showArchive" value="1" onchange="showArchiveList()"
style="width: 18px; height: 18px;">
<label class="form-check-label" for="showArchiveId"
style="font-size: 1rem; margin-left: 8px;">
Show Archive
</label>
</div>
</div>
<div class="error" id="error"></div> <div class="error" id="error"></div>
</form> </form>
<div style="margin-left:auto">
<div class="form-check" style="margin-right: 25px;">
<form id="archiveFormId" action="<?php echo base_url()?>userListing" method="post">
<input class="form-check-input" type="checkbox" id="showArchiveId"
name="showArchive" value="1" <?php echo $showArchive ? "checked" : " " ?>
style="width: 18px; height: 18px;">
<label class="form-check-label" for="showArchiveId"
style="font-size: 1rem; margin-left: 8px;">
Show Archive
</label>
</form>
</div>
</div>
<div class="card-body" style="overflow-x:scroll;"> <div class="card-body" style="overflow-x:scroll;">
<table id="user_list_table" class="table dt-responsive nowrap w-100"> <table id="user_list_table" class="table dt-responsive nowrap w-100">
@ -128,12 +132,7 @@
?> ?>
<tr class="<?php if ($record->isDeleted == 1) { <tr>
echo "deactivatedRow";
} ?>"
style="<?php if ($record->isDeleted == 1) {
echo "display:none";
} ?>">
<?php if (date('d-m-Y', strtotime($record->createdDtm)) == "30-11--0001") { <?php if (date('d-m-Y', strtotime($record->createdDtm)) == "30-11--0001") {
$cdate = '00-00-0000'; $cdate = '00-00-0000';
@ -295,29 +294,11 @@
}); });
}); });
</script>
function showArchiveList() {
let isChecked = $("#showArchiveId").prop('checked'); <script>
$(document).on("change", "#showArchiveId", function () {
// Show or hide the rows based on checkbox status console.log("Checkbox changed, submitting form...");
$(".deactivatedRow").each(function () { $("#archiveFormId").submit();
if (isChecked) { });
$(this).show();
} else {
$(this).hide();
}
});
}
$(document).ready(function () {
let table = $('#user_list_table').DataTable();
showArchiveList();
table.on('draw', function () {
showArchiveList();
});
});
</script> </script>

View File

@ -9,6 +9,13 @@
text-align: right; text-align: right;
} }
#Inwardgateregistertable1 thead tr th{
width: 150px;
word-wrap: break-word;
white-space: normal;
}
th { th {
white-space: nowrap; white-space: nowrap;
} }
@ -232,7 +239,8 @@
<tbody> <tbody>
<?php <?php
if(!empty($IGR)) if(!empty($IGR))
{ $index = 0; {
$index = 0;
foreach($IGR as $record) foreach($IGR as $record)
{ $index = $index +1; { $index = $index +1;
$createddate = new DateTime($record->CreatedDate); $createddate = new DateTime($record->CreatedDate);
@ -242,8 +250,17 @@
<tr id="<?php echo $index ?>" > <tr id="<?php echo $index ?>" >
<td align="center"><?php echo $date; ?></td> <td align="center"><?php echo $date; ?></td>
<td align="center"><?php echo $time; ?></td> <td align="center"><?php echo $time; ?></td>
<td style="cursor:pointer; color:#0bb2b5" ><a data-toggle="modal" data-target="#Igrshow" data-id="<?php echo $index;?>" data-inx="<?php echo $index;?>" data-userid="<?php echo $record->IGRNO ?>" data-igrstatus="<?php echo $record->IGRStatus ?>"> <td style="cursor:pointer; color:#0bb2b5" >
<?php echo $record->IGRNO ?></a>
<a data-toggle="modal"
data-target="#Igrshow"
data-id="<?php echo $index;?>"
data-inx="<?php echo $index;?>"
data-userid="<?php echo $record->IGRNO ?>"
data-igrstatus="<?php echo $record->IGRStatus ?>">
<?php echo $record->IGRNO ?>
</a>
</td> </td>
<td style="cursor:pointer; color:#0bb2b5" ><a data-toggle="modal" data-target="#CostCentershow" data-id="<?php echo $index;?>" data-igno="<?php echo $record->IGRNO;?>" data-pono="<?php echo $record->PONO ?>" target="_blank"> <td style="cursor:pointer; color:#0bb2b5" ><a data-toggle="modal" data-target="#CostCentershow" data-id="<?php echo $index;?>" data-igno="<?php echo $record->IGRNO;?>" data-pono="<?php echo $record->PONO ?>" target="_blank">
<?php echo $record->PONO ?></a> <?php echo $record->PONO ?></a>
@ -344,7 +361,7 @@
<!-- modal2 - Edit Igr modal --> <!-- modal2 - Edit Igr modal -->
<div id="Igrshow" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div id="Igrshow" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-full-width"> <div class="modal-dialog modal-xl">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -479,7 +496,7 @@
<tr> <tr>
<th style="width: 50px;">#</th> <th style="width: 50px;">#</th>
<th style="width: 100px;">Item Code</th> <th style="width: 100px;">Item Code</th>
<th style="width: 150px; word-wrap: break-word; word-break: break-all; white-space: normal;">Item Description</th> <th style="width: 150px;">Item Description</th>
<th style="width: 50px;">UOM</th> <th style="width: 50px;">UOM</th>
<th style="width: 100px;">Ordered Qty</th> <th style="width: 100px;">Ordered Qty</th>
<th style="width: 100px;">Received Qty</th> <th style="width: 100px;">Received Qty</th>
@ -489,7 +506,9 @@
<th style="width: 50px;">Taxable Amt</th> <th style="width: 50px;">Taxable Amt</th>
<th style="width: 50px;">Total Amt</th> <th style="width: 50px;">Total Amt</th>
<th style="width: 150px;">Remarks</th> <th style="width: 150px;">Remarks</th>
<th style="width: 50px;"></th> <th style="width: 25px;">Calculate Net Weight</th>
<th style="width: 25px; display:none" id="gasShortageHeader">Add Gas Shortage</th>
<th style="width: 25px; display:none" id="gasShortageListHeader">Gas Shortage list</th>
</tr> </tr>
</thead> </thead>
<tbody id="tbleIGRAppend"> <tbody id="tbleIGRAppend">
@ -636,6 +655,259 @@
</div> </div>
<!-- /.modal fade closed (Weight Calculator)--> <!-- /.modal fade closed (Weight Calculator)-->
<!-- gas shortage list gasShortageList-->
<!-- Modal -->
<div id="gasShortageList" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="gasShortageListLabel" aria-hidden="true">
<div class="modal-dialog modal-xl " role="document">
<div class="modal-content" style="border: 1px solid #ddd; margin-top: 73px; box-shadow: 0 0 40px rgb(0 0 0 / 43%);">
<div class="modal-header">
<h5 class="modal-title" id="gasShortageListLabel" align="center">List of Gas Shortages</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" >
<table id="gasShortageTable" class="table table-bordered table-hover">
<thead>
<tr>
<th>Full Cylinder Date</th>
<th>Empty Cylinder Date</th>
<th>Invoice No</th>
<th>Cylinder No</th>
<th>Gross Weight</th>
<th>Tare Weight</th>
<th>Net Weight</th>
<th>Actual Weight</th>
<th>Shortage</th>
<th style="display:none">ID</th>
<th>Action</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- end of gas shortage list -->
<!-- gas Shortage Calculator modal gasShortageCalculator -->
<div id="gasShortageCalculator" data-form="add" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-large">
<div class="modal-content" style="border: 1px solid #ddd; margin-top: 73px; box-shadow: 0 0 40px rgb(0 0 0 / 43%);">
<div class="modal-header">
<h4 class="modal-title">Add Gas Shortage </h4>
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
</div>
<div class="modal-body p-4">
<form action="#">
<!-- first row full cylinder date and empty cylinder date -->
<div class="form-group row">
<div class="col-md-6">
<label for="fullCylinderDateId"> Full Cylinder Date</label>
<input type="date" class="form-control" id="fullCylinderDateId" name="fullCylinderDate" value="" required>
</div>
<div class="col-md-6">
<label for="emptyCylinderDateId"> Empty Cylinder Date</label>
<input type="date" class="form-control" id="emptyCylinderDateId" name="emptyCylinderDate" value="" required>
</div>
</div>
<!-- second row cylinder no and Invoice No-->
<div class="form-group row">
<div class="col-md-6">
<label for="invoiceNoId"> Invoice No / Bill No</label>
<input type="text" class="form-control" id="invoiceNoId" name="invoiceNo" value="" readonly>
</div>
<div class="col-md-6">
<label for="cylinderNoId"> Cylinder No </label>
<input type="text" class="form-control" id="cylinderNoId" name="cylinderNo" value="" required>
</div>
</div>
<!-- third row gross weight and tare weight -->
<div class="form-group row">
<div class="col-md-6">
<label for="grossWeightId"> Gross Weight </label>
<input type="text" class="form-control" id="grossWeightId" name="grossWeight" value="" required>
</div>
<div class="col-md-6">
<label for="tareWeightId"> Tare Weight </label>
<input type="text" class="form-control" id="tareWeightId" name="tareWeight" value="" required>
</div>
</div>
<!-- fourth row NetWeight and actual weight -->
<div class="form-group row">
<div class="col-md-6">
<label for="actualWeightId"> Actual Weight </label>
<input type="text" class="form-control" id="actualWeightId" name="actualWeight" value="" required>
</div>
<div class="col-md-6">
<label for="netWeightId"> Net Weight (Gross-Tare)</label>
<input type="text" class="form-control" id="netWeightId" name="netWeight" value="" readonly>
</div>
</div>
<!-- fifth row Gas Shortage -->
<div class="form-group row">
<div class="col-md-6">
<label for="shortageId"> Gas Shortage(Actual-Net)</label>
<input type="text" class="form-control" id="shortageId" name="shortage" value="" readonly>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary waves-effect"
data-dismiss="modal" value="Cancel">Cancel</button>
<button type="submit"
class="btn btn-info waves-effect waves-light" >Save</button>
</div>
</form>
</div>
</div>
</div>
<!-- end gas shortage calculator modal -->
<!-- Edit gas Shortage Calculator modal editgasShortageCalculator -->
<div id="editGasShortageCalculator" data-form="edit" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-large">
<div class="modal-content" style="border: 1px solid #ddd; margin-top: 73px; box-shadow: 0 0 40px rgb(0 0 0 / 43%);">
<div class="modal-header">
<h4 class="modal-title">Update Gas Shortage </h4>
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
</div>
<form action="#">
<div class="modal-body p-4">
<!-- first row full cylinder date and empty cylinder date -->
<div class="form-group row">
<div class="col-md-6">
<label for="editFullCylinderDateId"> Full Cylinder Date</label>
<input type="date" class="form-control" id="editFullCylinderDateId" name="fullCylinderDate" value="" required>
</div>
<div class="col-md-6">
<label for="editEmptyCylinderDateId"> Empty Cylinder Date</label>
<input type="date" class="form-control" id="editEmptyCylinderDateId" name="emptyCylinderDate" value="" required>
</div>
</div>
<!-- second row cylinder no and Invoice No-->
<div class="form-group row">
<div class="col-md-6">
<label for="editInvoiceNoId"> Invoice No / Bill No</label>
<input type="text" class="form-control" id="editInvoiceNoId" name="invoiceNo" value="" readonly>
</div>
<div class="col-md-6">
<label for="editCylinderNoId"> Cylinder No </label>
<input type="text" class="form-control" id="editCylinderNoId" name="cylinderNo" value="" required>
</div>
</div>
<!-- third row gross weight and tare weight -->
<div class="form-group row">
<div class="col-md-6">
<label for="editGrossWeightId"> Gross Weight </label>
<input type="text" class="form-control" id="editGrossWeightId" name="grossWeight" value="" required>
</div>
<div class="col-md-6">
<label for="editTareWeightId"> Tare Weight </label>
<input type="text" class="form-control" id="editTareWeightId" name="tareWeight" value="" required>
</div>
</div>
<!-- fourth row NetWeight and actual weight -->
<div class="form-group row">
<div class="col-md-6">
<label for="editActualWeightId"> Actual Weight </label>
<input type="text" class="form-control" id="editActualWeightId" name="actualWeight" value="" required>
</div>
<div class="col-md-6">
<label for="editNetWeightId"> Net Weight (Gross-Tare)</label>
<input type="text" class="form-control" id="editNetWeightId" name="netWeight" value="" readonly>
</div>
</div>
<!-- fifth row Gas Shortage -->
<div class="form-group row">
<div class="col-md-6">
<label for="editShortageId"> Gas Shortage(Actual-Net)</label>
<input type="text" class="form-control" id="editShortageId" name="shortage" value="" readonly>
</div>
</div>
<!-- hidden fields -->
<input type="hidden" id="editId" name="id" value="" >
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary waves-effect"
data-dismiss="modal" value="Cancel">Cancel</button>
<button type="submit"
class="btn btn-info waves-effect waves-light" >Save</button>
</div>
</form>
</div>
</div>
</div>
<!-- end gas shortage calculator modal -->
<!-- modal4 - IGR history modal --> <!-- modal4 - IGR history modal -->
<div id="Historyshow" class="modal fade" tabindex="-1" role="dialog" <div id="Historyshow" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;"> aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
@ -797,12 +1069,13 @@
$('#right-modal').modal('show'); $('#right-modal').modal('show');
} }
//recent work of adding gas shortage done here..!!
$("#Igrshow").on("shown.bs.modal", function(e) { $("#Igrshow").on("shown.bs.modal", function(e) {
$('#loader').show(); $('#loader').show();
console.log("hello");
var inx = $(e.relatedTarget).data('id'); var inx = $(e.relatedTarget).data('id');
var igr = $(e.relatedTarget).data('userid'); var igr = $(e.relatedTarget).data('userid');
var igrstatus = $(e.relatedTarget).data('igrstatus'); var igrstatus = $(e.relatedTarget).data('igrstatus');
@ -821,7 +1094,10 @@
modal.find('#MasterFileLabel').hide(); modal.find('#MasterFileLabel').hide();
var userRole = "<?php echo (int)$userRole; ?>"; var userRole = "<?php echo (int)$userRole; ?>";
//based on user role some fields are just read only
if (userRole != 1) { if (userRole != 1) {
//based on status == ST074
if (igrstatus == "ST074") { if (igrstatus == "ST074") {
buttonContainer.find("#draftIGR, #generateIGR").css("display", "inline-block"); buttonContainer.find("#draftIGR, #generateIGR").css("display", "inline-block");
$(".a_tag_for_mrir").css("display", "block"); $(".a_tag_for_mrir").css("display", "block");
@ -900,6 +1176,9 @@
$.each(parsedData['details'], function(i, item) { $.each(parsedData['details'], function(i, item) {
if (igr == item.IGRNO) { if (igr == item.IGRNO) {
console.log(item,"**"); console.log(item,"**");
//setting values in the igr modal.. particularly input fields
$('#IgrshowTitle').text(" ( " + item.IGRNO + " ) "); $('#IgrshowTitle').text(" ( " + item.IGRNO + " ) ");
$("#IGRNO1").val(item.IGRNO); $("#IGRNO1").val(item.IGRNO);
$("#PONO1").val(item.PONO); $("#PONO1").val(item.PONO);
@ -960,8 +1239,10 @@
i = i + 1; i = i + 1;
// userrole is system admin also know as admin (if) // userrole is system admin also know as admin (if)
//if role is system admin,
if (userRole == 1) { if (userRole == 1) {
$("#pendingQuantityHeader").css("display", "table-cell"); $("#pendingQuantityHeader").css("display", "table-cell");
trIGRHTML += '<tr>' + trIGRHTML += '<tr>' +
'<td style="width: 50px;" >' + i + '</td>' + '<td style="width: 50px;" >' + i + '</td>' +
'<td style="width: 100px;" name="MaterialName" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' + '<td style="width: 100px;" name="MaterialName" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
@ -975,9 +1256,10 @@
'<td style="width: 50px;" id="amount' + i + '">' + amount + '</td>' + '<td style="width: 50px;" id="amount' + i + '">' + amount + '</td>' +
'<td style="width: 50px;" id="grand_total_amount' + i + '">' + grand_total_amount + '</td>' + '<td style="width: 50px;" id="grand_total_amount' + i + '">' + grand_total_amount + '</td>' +
'<td style="width: 100px;"><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" style="width: 75px;" value="'+item.Remarks+'"> </td>' + '<td style="width: 100px;"><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" style="width: 75px;" value="'+item.Remarks+'"> </td>' +
'<td style="width: 50px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' + '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' + '<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
'<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' + '<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
'<input type="hidden" id="MaterialCategory' + i + '" name="MaterialCategory' + i + '" value="' + item.MaterialCategory + '">' +
'<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' + '<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' +
'<input type="hidden" id="txtOrderedQuantity' + i + '" name="txtOrderedQuantity' + i + '" value="' + item.Quantity + '">' + '<input type="hidden" id="txtOrderedQuantity' + i + '" name="txtOrderedQuantity' + i + '" value="' + item.Quantity + '">' +
'<input type="hidden" id="txtGrossWeight' + i + '" name="txtGrossWeight' + i + '" value="' + item.GrossWeight + '">' + '<input type="hidden" id="txtGrossWeight' + i + '" name="txtGrossWeight' + i + '" value="' + item.GrossWeight + '">' +
@ -988,8 +1270,22 @@
'<input type="hidden" id="txtRemarks' + i + '" name="txtRemarks' + i + '"value="' + item.Remarks + '">' + '<input type="hidden" id="txtRemarks' + i + '" name="txtRemarks' + i + '"value="' + item.Remarks + '">' +
'<input type="hidden" id="txtIGRLineItem' + i + '" name="txtIGRLineItem' + i + '"value="' + item.IGRItemNo + '">' + '<input type="hidden" id="txtIGRLineItem' + i + '" name="txtIGRLineItem' + i + '"value="' + item.IGRItemNo + '">' +
'<input type="file" id="txtWeightFile' + i + '" name="txtWeightFile' + i + '"value="' + item.WeightFile + '" style="display:none;">' + '<input type="file" id="txtWeightFile' + i + '" name="txtWeightFile' + i + '"value="' + item.WeightFile + '" style="display:none;">' +
'<input type="hidden" id="txtWeightFileName' + i + '" name="txtWeightFileName' + i + '"value="' + item.WeightFile + '">' + '<input type="hidden" id="txtWeightFileName' + i + '" name="txtWeightFileName' + i + '"value="' + item.WeightFile + '">' ;
'</tr>';
let regex = /gas/i;
if(regex.test(item.MaterialCategory) ){
$('#gasShortageHeader').show();
$('#gasShortageListHeader').show();
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageCalculator" title="gas Shortage Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-gas-pump" style="text-align: center;"></i></a> </td>' ;
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageList" title="gas Shortage List" ><i class="fa fa-solid fa-list" style="text-align: center;"></i></a> </td>' ;
trIGRHTML +='</tr>';
}else{
trIGRHTML +='</tr>';
}
if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) { if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) {
$('#QuantityAsPerInvoice' + i).attr('readonly', 'true'); $('#QuantityAsPerInvoice' + i).attr('readonly', 'true');
@ -1015,7 +1311,7 @@
'<td style="width: 50px;" id="amount' + i + '">' + amount + '</td>' + '<td style="width: 50px;" id="amount' + i + '">' + amount + '</td>' +
'<td style="width: 50px;" id="grand_total_amount' + i + '">' + grand_total_amount + '</td>' + '<td style="width: 50px;" id="grand_total_amount' + i + '">' + grand_total_amount + '</td>' +
'<td style="width: 100px;"><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" style="width: 75px;" value="'+item.Remarks+'"> </td>' + '<td style="width: 100px;"><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" style="width: 75px;" value="'+item.Remarks+'"> </td>' +
'<td style="width: 50px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' + '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' + '<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
'<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' + '<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
'<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' + '<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' +
@ -1028,8 +1324,18 @@
'<input type="hidden" id="txtRemarks' + i + '" name="txtRemarks' + i + '"value="' + item.Remarks + '">' + '<input type="hidden" id="txtRemarks' + i + '" name="txtRemarks' + i + '"value="' + item.Remarks + '">' +
'<input type="hidden" id="txtIGRLineItem' + i + '" name="txtIGRLineItem' + i + '"value="' + item.IGRItemNo + '">' + '<input type="hidden" id="txtIGRLineItem' + i + '" name="txtIGRLineItem' + i + '"value="' + item.IGRItemNo + '">' +
'<input type="file" id="txtWeightFile' + i + '" name="txtWeightFile' + i + '"value="' + item.WeightFile + '" style="display:none;">' + '<input type="file" id="txtWeightFile' + i + '" name="txtWeightFile' + i + '"value="' + item.WeightFile + '" style="display:none;">' +
'<input type="hidden" id="txtWeightFileName' + i + '" name="txtWeightFileName' + i + '"value="' + item.WeightFile + '">' + '<input type="hidden" id="txtWeightFileName' + i + '" name="txtWeightFileName' + i + '"value="' + item.WeightFile + '">' ;
'</tr>';
if(item.MaterialCategory == "gas"){
$('#gasShortageHeader').show();
$('#gasShortageListHeader').show();
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageCalculator" title="gas Shortage Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-gas-pump" style="text-align: center;"></i></a> </td>' ;
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageList" title="gas Shortage List" ><i class="fa fa-solid fa-list" style="text-align: center;"></i></a> </td>' ;
trIGRHTML +='</tr>';
}else{
trIGRHTML +='</tr>';
}
if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) { if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) {
$('#QuantityAsPerInvoice' + i).attr('readonly', 'true'); $('#QuantityAsPerInvoice' + i).attr('readonly', 'true');
@ -1049,7 +1355,7 @@
'<td style="width: 50px;" id="tax_percentage' + i + '">' + tax_percentage + '</td>' + '<td style="width: 50px;" id="tax_percentage' + i + '">' + tax_percentage + '</td>' +
'<td style="width: 50px;" id="amount' + i + '">' + amount + '</td>' + '<td style="width: 50px;" id="amount' + i + '">' + amount + '</td>' +
'<td style="width: 50px;" id="grand_total_amount' + i + '">' + grand_total_amount + '</td>' + '<td style="width: 50px;" id="grand_total_amount' + i + '">' + grand_total_amount + '</td>' +
'<td style="width: 50px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' + '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' + '<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
'<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' + '<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
'<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' + '<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' +
@ -1062,8 +1368,18 @@
'<input type="hidden" id="txtRemarks' + i + '" name="txtRemarks' + i + '"value="' + item.Remarks + '">' + '<input type="hidden" id="txtRemarks' + i + '" name="txtRemarks' + i + '"value="' + item.Remarks + '">' +
'<input type="hidden" id="txtIGRLineItem' + i + '" name="txtIGRLineItem' + i + '"value="' + item.IGRItemNo + '">' + '<input type="hidden" id="txtIGRLineItem' + i + '" name="txtIGRLineItem' + i + '"value="' + item.IGRItemNo + '">' +
'<input type="file" id="txtWeightFile' + i + '" name="txtWeightFile' + i + '"value="' + item.WeightFile + '">' + '<input type="file" id="txtWeightFile' + i + '" name="txtWeightFile' + i + '"value="' + item.WeightFile + '">' +
'<input type="hidden" id="txtWeightFileName' + i + '" name="txtWeightFileName' + i + '"value="' + item.WeightFile + '">' + '<input type="hidden" id="txtWeightFileName' + i + '" name="txtWeightFileName' + i + '"value="' + item.WeightFile + '">';
'</tr>';
if(item.MaterialCategory == "gas"){
$('#gasShortageHeader').show();
$('#gasShortageListHeader').show();
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageCalculator" title="gas Shortage Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-gas-pump" style="text-align: center;"></i></a> </td>' ;
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageList" title="gas Shortage List" ><i class="fa fa-solid fa-list" style="text-align: center;"></i></a> </td>' ;
trIGRHTML +='</tr>';
}else{
trIGRHTML +='</tr>';
}
} }
} }
@ -1103,12 +1419,18 @@
<script> <script>
$(document).ready(function(){ $(document).ready(function(){
$('#Igrshow').on("hide.bs.modal", function(e){ $('#Igrshow').on("hide.bs.modal", function(e){
$('#gasShortageHeader').hide();
$('#gasShortageListHeader').hide();
$('#existingContainer').empty(); $('#existingContainer').empty();
}); });
}); });
</script> </script>
<script> <script>
$('#update').click(function() { $('#update').click(function() {
// $('#content').loader('show'); // $('#content').loader('show');
@ -2058,3 +2380,425 @@
} }
</script> </script>
<!-- 28/02/2025 -->
<!-- add gas shortage calculator -->
<script>
$('#grossWeightId, #tareWeightId,#actualWeightId').change(function() {
console.log("fine here ");
let grossWeightVal = $('#grossWeightId').val().trim();
let tareWeightVal = $('#tareWeightId').val().trim();
// Ensure both fields have values before calculation
if (grossWeightVal === '' || tareWeightVal === '') {
return;
}
let grossWeight = validateNumber(grossWeightVal);
let tareWeight = validateNumber(tareWeightVal);
let netWeight = grossWeight - tareWeight;
$('#netWeightId').val(netWeight);
let actualWeightVal = $('#actualWeightId').val().trim();
// Ensure both fields have values before calculation
if (actualWeightVal === '' || netWeight === '') {
return;
}
let actualWeight = validateNumber(actualWeightVal);
let shortage = actualWeight - netWeight;
$('#shortageId').val(shortage);
});
function validateNumber(givenValue) {
givenValue = givenValue.trim();
if (/^\d+$/.test(givenValue)) {
return parseInt(givenValue, 10); // Convert string to number
} else {
alert('Please Enter a Valid Number..!!');
return 0; // Invalid number
}
}
</script>
<!-- while opening add gas shortage modal -->
<script>
$(document).ready(function(){
$('#gasShortageCalculator').on("shown.bs.modal", function(e){
//invoice needed to store it in the shortage table ,
// coz based on this we can limit the addition of shortage must not exceed than given qty
let invoiceNo = $('#Invoice_No').val();
let materialReceivedDate = $('#MaterialRcvdDate').val().split("-");
//converting it to y-m-d format;
console.log(`${materialReceivedDate[2]}-${materialReceivedDate[1]}-${materialReceivedDate[0]}`);
$('#invoiceNoId').val(invoiceNo);
$('#fullCylinderDateId').val(`${materialReceivedDate[2]}-${materialReceivedDate[1]}-${materialReceivedDate[0]}`);
});
});
</script>
<!-- while closing add gas shortage modal -->
<script>
$(document).ready(function(){
$('#gasShortageCalculator').on("hide.bs.modal", function(e){
$('#invoiceNoId').val(' ');
$('#fullCylinderDateId').val(" ");
$('#emptyCylinderDateId').val(" ");
$('#cylinderNoId').val(" ");
$('#grossWeightId').val(" ");
$('#tareWeightId').val(" ");
$('#actualWeightId').val(" ");
$('#netWeightId').val(" ");
$('#shortageId').val(" ");
});
});
</script>
<!-- end of add gas shortage calculator -->
<!-- edit gasShortageCalculator -->
<script>
$('#editGrossWeightId,#editTareWeightId,#editActualWeightId').change(function() {
let grossWeightVal = $('#editGrossWeightId').val().trim();
let tareWeightVal = $('#editTareWeightId').val().trim();
// Ensure both fields have values before calculation
if (grossWeightVal === '' || tareWeightVal === '') {
return;
}
let grossWeight = validateNumber(grossWeightVal);
let tareWeight = validateNumber(tareWeightVal);
let netWeight = grossWeight - tareWeight;
$('#editNetWeightId').val(netWeight);
let actualWeightVal = $('#editActualWeightId').val().trim();
// Ensure both fields have values before calculation
if (actualWeightVal === '' || netWeight === '') {
return;
}
let actualWeight = validateNumber(actualWeightVal);
let shortage = actualWeight - netWeight;
$('#editShortageId').val(shortage);
});
</script>
<!-- while opening edit gas shortage modal -->
<script>
$(document).ready(function(){
$('#editGasShortageCalculator').on("shown.bs.modal", function(e){
//invoice needed to store it in the shortage table ,
// coz based on this we can limit the addition of shortage must not exceed than given qty
let invoiceNo = $('#Invoice_No').val();
let materialReceivedDate = $('#MaterialRcvdDate').val().split("-");
//converting it to y-m-d format;
console.log(`${materialReceivedDate[2]}-${materialReceivedDate[1]}-${materialReceivedDate[0]}`);
$('#editInvoiceNoId').val(invoiceNo);
$('#editFullCylinderDateId').val(`${materialReceivedDate[2]}-${materialReceivedDate[1]}-${materialReceivedDate[0]}`);
});
});
</script>
<!-- while closing edit gas shortage modal -->
<script>
$(document).ready(function(){
$('#editGasShortageCalculator').on("hide.bs.modal", function(e){
$('#editInvoiceNoId').val(' ');
$('#editFullCylinderDateId').val(" ");
$('#editEmptyCylinderDateId').val(" ");
$('#editCylinderNoId').val(" ");
$('#editGrossWeightId').val(" ");
$('#editTareWeightId').val(" ");
$('#editActualWeightId').val(" ");
$('#editNetWeightId').val(" ");
$('#editShortageId').val(" ");
});
});
</script>
<!-- end of edit gasShortageCalculator -->
<!-- while opening gasShortageList -->
<script>
$(document).ready(function(){
$('#gasShortageList').on("shown.bs.modal",function(e){
let invoiceNo = $('#Invoice_No').val();
console.log("invoice no", invoiceNo);
$('#loader').show();
$.ajax({
type: "POST",
url: "<?php echo base_url()?>/gasShortageList", // 🔹 Change this to your actual backend endpoint
data: {invoiceNo},
dataType: "json",
success: function (response) {
if (response.status === "success") {
console.log(response.data);
let data = response.data ;
console.log("gas shortage list");
console.log(data);
let tableData = '';
data.forEach((val) => {
tableData += `
<tr>
<td>${val.fullCylinderDate}</td>
<td>${val.emptyCylinderDate}</td>
<td>${val.invoiceNo}</td>
<td>${val.cylinderNo}</td>
<td>${val.grossWeight}</td>
<td>${val.tareWeight}</td>
<td>${val.netWeight}</td>
<td>${val.actualWeight}</td>
<td>${val.shortage}</td>
<td style="display:none">${val.id}</td>
<td style="width: 25px;">
<i class="fa fa-solid fa-edit btnEditGasShortageCalculator"
style="text-align: center;"
data-toggle="modal"
data-target="#editGasShortageCalculator"
data-id="${val.id}"
title="Edit Gas Shortage List">
</i>
</td>
</tr>`;
});
// Assuming you have a table with ID "gasShortageTable"
$("#gasShortageTable tbody").html(tableData);
} else {
alert("Error: " + response.message);
}
},
error: function (xhr, status, error) {
console.log(xhr.responseText);
alert("Something went wrong! Please try again.");
},
complete:function(){
console.log("ajax call is completed..!!");
$('#loader').hide();
}
});
})
})
</script>
<!-- while closing gasShortageList -->
<script>
$(document).ready(function(){
$('#gasShortageList').on("hide.bs.modal",function(){
$("#gasShortageTable tbody").html(" ");
})
})
</script>
<!-- ajax call for gas Shortage -->
<script>
$("#gasShortageCalculator, #editGasShortageCalculator").submit(function (event) {
event.preventDefault(); // Prevent form reload
let formData;
let method = $(this).closest(".modal").data("form");
// Prepare form data
let addFormData = {
fullCylinderDate: $('#fullCylinderDateId').val(),
emptyCylinderDate: $('#emptyCylinderDateId').val(),
invoiceNo: $('#invoiceNoId').val(),
cylinderNo: $('#cylinderNoId').val(),
grossWeight: $('#grossWeightId').val(),
tareWeight: $('#tareWeightId').val(),
actualWeight: $('#actualWeightId').val(),
netWeight: $('#netWeightId').val(),
shortage: $('#shortageId').val()
};
let editFormData = {
fullCylinderDate: $('#editFullCylinderDateId').val(),
emptyCylinderDate: $('#editEmptyCylinderDateId').val(),
invoiceNo: $('#editInvoiceNoId').val(),
cylinderNo: $('#editCylinderNoId').val(),
grossWeight: $('#editGrossWeightId').val(),
tareWeight: $('#editTareWeightId').val(),
actualWeight: $('#editActualWeightId').val(),
netWeight: $('#editNetWeightId').val(),
shortage: $('#editShortageId').val(),
id : $('#editId').val()
};
if(method == "add"){ formData = addFormData ;}
if(method == "edit"){ formData = editFormData ;}
$('#loader').show();
$.ajax({
type: "POST",
url: "<?php echo base_url()?>/updateGasShortage", // 🔹 Change this to your actual backend endpoint
data: formData,
dataType: "json",
success: function (response) {
if (response.status === "success") {
alert("Gas Shortage Data Saved Successfully!");
$('#gasShortageCalculator').modal('hide'); // Close modal
$('#editGasShortageCalculator').modal('hide');
} else {
alert("Error: " + response.message);
}
},
error: function (xhr, status, error) {
console.log(xhr.responseText);
alert("Something went wrong! Please try again.");
},
complete:function(){
console.log("ajax call is completed..!!");
$('#loader').hide();
}
});
});
</script>
<script>
$(document).on("click", ".btnEditGasShortageCalculator", function () {
console.log("Edit modal opening place");
let id = $(this).data("id");
console.log("Editing ID:", id);
// Smooth transition: First hide, then show after 300ms
$("#gasShortageList").modal("hide");
setTimeout(() => {
$("#editGasShortageCalculator").modal("show");
}, 300);
$('#loader').show();
// AJAX request to fetch data
$.ajax({
type: "POST",
url: "<?php echo base_url()?>/getGasShortageDetail",
data: { id: id },
dataType: "json",
success: function (response) {
if (response.status === "success") {
let data = response.data;
console.log(data);
if(data.length > 0){
data = data[0];
console.log(data);
// Populate the modal fields
$("#editFullCylinderDateId").val(data.fullCylinderDate);
$("#editEmptyCylinderDateId").val(data.emptyCylinderDate);
$("#editInvoiceNoId").val(data.invoiceNo);
$("#editCylinderNoId").val(data.cylinderNo);
$("#editGrossWeightId").val(data.grossWeight);
$("#editTareWeightId").val(data.tareWeight);
$("#editNetWeightId").val(data.netWeight);
$("#editActualWeightId").val(data.actualWeight);
$("#editShortageId").val(data.shortage);
$("#editId").val(data.id); // Hidden field for ID
}
} else {
alert("Error: " + response.message);
}
},
error: function (xhr, status, error) {
console.log(xhr.responseText);
alert("Something went wrong! Please try again.");
},
complete:function(){
console.log("ajax call is completed..!!");
$('#loader').hide();
}
});
});
</script>

View File

@ -25,7 +25,6 @@
"kint-php/kint": "^5.0.4", "kint-php/kint": "^5.0.4",
"mikey179/vfsstream": "^1.6", "mikey179/vfsstream": "^1.6",
"nexusphp/cs-config": "^3.6", "nexusphp/cs-config": "^3.6",
"phpunit/phpunit": "^10.5.16",
"predis/predis": "^1.1 || ^2.0" "predis/predis": "^1.1 || ^2.0"
}, },
"suggest": { "suggest": {

View File

@ -145,14 +145,16 @@ function serviceValidate(){
alert('Please Select Budget Type'); alert('Please Select Budget Type');
$('#BudgetType').focus(); $('#BudgetType').focus();
return false; return false;
}else if ($('#serviceTax tbody tr').length < 1) { }
alert('Atleast One Line needed'); // else if ($('#ServiceTable tbody tr').length < 1) {
return false; // alert('Atleast One Line needed');
} else if ($('#descofpo').val().trim() == '') { // return false;
alert('Please Enter Description Of Service'); // } else if ($('#descofpo').val().trim() == '') {
$('#descofpo').focus(); // alert('Please Enter Description Of Service');
return false; // $('#descofpo').focus();
}else { // return false;
// }
else {
return true; return true;
} }
} }