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

This commit is contained in:
Gowtham M 2025-04-07 12:32:54 +05:30
commit 9896af42c8
48 changed files with 4504 additions and 1377 deletions

View File

@ -90,5 +90,5 @@ class Autoload extends AutoloadConfig
* *
* @var list<string> * @var list<string>
*/ */
public $helpers = ['datetime','cias','purchaseorder','alert']; public $helpers = ['cias','datetime','image','alert','excel'];
} }

View File

@ -200,6 +200,7 @@ $routes->post('monthlypay/deletePublicHoliday', 'Monthlypay::deletePublicHoliday
$routes->get('leaveApplicationForm', 'Monthlypay::leaveApplicationForm'); $routes->get('leaveApplicationForm', 'Monthlypay::leaveApplicationForm');
$routes->post('fetchLeaveApplicationForm', 'Monthlypay::fetchLeaveApplicationForm'); $routes->post('fetchLeaveApplicationForm', 'Monthlypay::fetchLeaveApplicationForm');
$routes->get('deleteLeaveApplicationForm', 'Monthlypay::deleteLeaveApplicationForm'); $routes->get('deleteLeaveApplicationForm', 'Monthlypay::deleteLeaveApplicationForm');
$routes->post('validateDateRange', 'Monthlypay::validateDateRange');
$routes->match(['GET', 'POST'], 'leaveApplicationPDF/(:any)', 'Monthlypay::leaveApplicationPDF/$1'); $routes->match(['GET', 'POST'], 'leaveApplicationPDF/(:any)', 'Monthlypay::leaveApplicationPDF/$1');
$routes->match(['GET', 'POST'], 'overTimeDetails', 'Monthlypay::overTimeDetails'); $routes->match(['GET', 'POST'], 'overTimeDetails', 'Monthlypay::overTimeDetails');
@ -326,7 +327,9 @@ $routes->post('inwardgateregister/edituploadfile', 'Inwardgateregister::edituplo
$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('updateGasShortage','Inwardgateregister::updateGasShortage');
$routes->post('gasShortageList','Inwardgateregister::gasShortageList'); $routes->get('gasCylinderEntered','Inwardgateregister::gasCylinderEntered');
$routes->get('gasCylinderPending','Inwardgateregister::gasCylinderPending');
$routes->get('gasCylinderReturned','Inwardgateregister::gasCylinderReturned');
$routes->post('getGasShortageDetail',"Inwardgateregister::getGasShortageDetail"); $routes->post('getGasShortageDetail',"Inwardgateregister::getGasShortageDetail");

View File

@ -229,6 +229,7 @@ class Amendmentpurchaseorder extends BaseController
*/ */
function EditRevenuePurchaseOrder() function EditRevenuePurchaseOrder()
{ {
helper('numberseries');
$NewPO = ''; $NewPO = '';
$MAD = ''; $MAD = '';
// $changeStatus ,will havestatus code itself provided from front-end , no need of constants // $changeStatus ,will havestatus code itself provided from front-end , no need of constants
@ -309,8 +310,9 @@ class Amendmentpurchaseorder extends BaseController
if ($PaymentTerms != 'PT08') { if ($PaymentTerms != 'PT08') {
$Otherpayment = ''; $Otherpayment = '';
} }
$IsOpenOrder = ($this->request->getPost('IsOpenOrder') !== null && !empty($this->request->getPost('IsOpenOrder')) && $this->request->getPost('IsOpenOrder') === '1') ? $this->request->getPost('IsOpenOrder') : null;
$AmendmentNewPoNo = generate_amendment_po_number($PONO); $AmendmentNewPoNo = generate_amendment_po_number($PONO);
$POMaster = array('PONO' => $AmendmentNewPoNo, 'ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'POType' => $POType, 'PORange' => $Local_Interstate, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $changeStatus , 'PaymentTerms' => $PaymentTerms, 'PaymentOtherDescription' => $Otherpayment, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Reference' => $supplierreference, 'Supplier_Offer_No' => $supplieroffno, 'Other_Reference' => $otherreference, 'Fincap' => $fincap, 'InsuranceStatus' => $insurancestatus, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $revenuetype, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpecialInstruction, 'CreatedBy' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'UpdatedOn' => $updateddt, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'AmendedDetails' => $MAD, 'IsQualityChkReqired' => $qtycheckresult,'CapitalRange' => $Local_Interstate,'BudgetType' => $BudgetType); // not $POMaster = array('PONO' => $AmendmentNewPoNo, 'ParentPO' => $PONO, 'SupplierID' => $SupplierID, 'POType' => $POType, 'PORange' => $Local_Interstate, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' => $changeStatus , 'PaymentTerms' => $PaymentTerms, 'PaymentOtherDescription' => $Otherpayment, 'Mode_Of_Shipment' => $Modeofshipment, 'Supplier_Reference' => $supplierreference, 'Supplier_Offer_No' => $supplieroffno, 'Other_Reference' => $otherreference, 'Fincap' => $fincap, 'InsuranceStatus' => $insurancestatus, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $revenuetype, 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $SpecialInstruction, 'CreatedBy' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'UpdatedOn' => $updateddt, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'AmendedDetails' => $MAD, 'IsQualityChkReqired' => $qtycheckresult,'CapitalRange' => $Local_Interstate,'BudgetType' => $BudgetType, 'IsOpenOrder'=>$IsOpenOrder); // not
$file = $this->request->getFile('POFile'); $file = $this->request->getFile('POFile');
$requestfilename = $file->getName(); $requestfilename = $file->getName();
$PrePOFile = $this->request->getPost('PrePOFile'); $PrePOFile = $this->request->getPost('PrePOFile');
@ -580,13 +582,13 @@ class Amendmentpurchaseorder extends BaseController
$recqty = $qty[0]->rec; $recqty = $qty[0]->rec;
// $POno = $qtyvalue->PONO; // $POno = $qtyvalue->PONO;
if ($ordqty == $recqty) { if(!$IsOpenOrder):if ($ordqty == $recqty) {
$Newstatus = array('Status' => IGR_CREATED); $Newstatus = array('Status' => IGR_CREATED);
$this->purchaseorder_model->POLineItemsupdatestatus($NewPO, $Newstatus); $this->purchaseorder_model->POLineItemsupdatestatus($NewPO, $Newstatus);
$this->purchaseorder_model->pomasterupdatestatus($NewPO, $Newstatus); $this->purchaseorder_model->pomasterupdatestatus($NewPO, $Newstatus);
} }endif;
$message = 'Purchase Order ' . $PONO . ' Amended Successfully! - New PO Number is: ' . $NewPO ; $message = 'Purchase Order ' . $PONO . ' Amended Successfully! - New PO Number is: ' . $NewPO ;
@ -603,7 +605,7 @@ class Amendmentpurchaseorder extends BaseController
function UpdateAmendServicePurchaseOrder() function UpdateAmendServicePurchaseOrder()
{ {
// dd($this->request->getPost()); helper('numberseries');
$PONO = $this->request->getPost('txtPONO'); $PONO = $this->request->getPost('txtPONO');
$changeStatus = $this->request->getPost('changeStatus'); $changeStatus = $this->request->getPost('changeStatus');
@ -672,6 +674,7 @@ class Amendmentpurchaseorder extends BaseController
$qtycheck = $this->purchaseorder_model->getqtycheck($PONO); $qtycheck = $this->purchaseorder_model->getqtycheck($PONO);
$qtycheckresult = ''; $qtycheckresult = '';
$IsOpenOrder = ($this->request->getPost('IsOpenOrder') !== null && !empty($this->request->getPost('IsOpenOrder')) && $this->request->getPost('IsOpenOrder') === '1') ? $this->request->getPost('IsOpenOrder') : null;
foreach ($qtycheck as $qty) { foreach ($qtycheck as $qty) {
$qtycheckresult = $qty->IsQualityChkReqired; $qtycheckresult = $qty->IsQualityChkReqired;
} }
@ -685,7 +688,7 @@ class Amendmentpurchaseorder extends BaseController
} }
$AmendmentNewPoNo = generate_amendment_po_number($PONO); $AmendmentNewPoNo = generate_amendment_po_number($PONO);
$POMaster = array('PONO' => $AmendmentNewPoNo, 'ParentPO' => $PONO, 'POType' => $POType, 'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' =>$changeStatus , 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $scopeofwork, 'CreatedBy' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $updateddt, 'PaymentTerms' => $PaymentTerms, 'PaymentOtherDescription' => $Otherpayment, 'ServiceWorkStatus' => $WorkStatus, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'AmendedDetails' => $MAD, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'Description_Of_Service' => strip_tags((string)$DescriptionOfPo), 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $qtycheckresult); $POMaster = array('PONO' => $AmendmentNewPoNo, 'ParentPO' => $PONO, 'POType' => $POType, 'SupplierID' => $SupplierID, 'TotalOrderValue' => $TotalOrderValueSummary, 'PODate' => $PODate, 'Status' =>$changeStatus , 'DeliverySchedule' => $DeliverySchedule, 'DeliveryOption' => $DeliveryOption, 'ServiceDescription' => $scopeofwork, 'CreatedBy' => $updatedBy, 'DeliveryAddress' => $DeliveryAddr, 'DeliveryDate' => $Deliverydt, 'CreatedDate' => $updateddt, 'PaymentTerms' => $PaymentTerms, 'PaymentOtherDescription' => $Otherpayment, 'ServiceWorkStatus' => $WorkStatus, 'ReleasedBy' => $updatedBy, 'ReleasedOn' => $updateddt, 'AmendedDetails' => $MAD, 'Supplier_Reference' => $SupplierReference, 'Mode_Of_Shipment' => $ModeOfShipment, 'Supplier_Offer_No' => $SuppliersOfferNo, 'Other_Reference' => $OtherReferences, 'Fincap' => $Fincap, 'Description_Of_Service' => strip_tags((string)$DescriptionOfPo), 'InsuranceStatus' => $InsuranceOptions, 'InsuranceNumber' => $InsuranceNumber, 'POSubType' => $ServiceTypeOptions, 'IsQualityChkReqired' => $qtycheckresult,'IsOpenOrder'=>$IsOpenOrder);
$file = $this->request->getFile('POFile'); $file = $this->request->getFile('POFile');
$PrePOFile = $this->request->getPost('PrePOFile'); $PrePOFile = $this->request->getPost('PrePOFile');
$requestfilename = $file ? $file->getName() : null; $requestfilename = $file ? $file->getName() : null;
@ -879,13 +882,13 @@ class Amendmentpurchaseorder extends BaseController
$recqty = $qty[0]->rec; $recqty = $qty[0]->rec;
// $POno = $qtyvalue->PONO; // $POno = $qtyvalue->PONO;
if ($ordqty == $recqty) { if(!$IsOpenOrder):if ($ordqty == $recqty) {
$Newstatus = array('Status' => IGR_CREATED); $Newstatus = array('Status' => IGR_CREATED);
$this->purchaseorder_model->POLineItemsupdatestatus($NewPO, $Newstatus); $this->purchaseorder_model->POLineItemsupdatestatus($NewPO, $Newstatus);
$this->purchaseorder_model->pomasterupdatestatus($NewPO, $Newstatus); $this->purchaseorder_model->pomasterupdatestatus($NewPO, $Newstatus);
} }endif;
$message = 'Purchase Order ' . $PONO . ' Amended Successfully! - New PO Number is: ' . $NewPO ; $message = 'Purchase Order ' . $PONO . ' Amended Successfully! - New PO Number is: ' . $NewPO ;
if($changeStatus == 'ST014'){ if($changeStatus == 'ST014'){
@ -900,6 +903,7 @@ class Amendmentpurchaseorder extends BaseController
*/ */
function EditAmendCapitalPurchaseOrder() function EditAmendCapitalPurchaseOrder()
{ {
helper('numberseries');
$changeStatus = $this->request->getPost('changeStatus'); $changeStatus = $this->request->getPost('changeStatus');
$PONO = $this->request->getPost('txtPONO'); $PONO = $this->request->getPost('txtPONO');
$MAD = ''; $MAD = '';
@ -1309,7 +1313,7 @@ class Amendmentpurchaseorder extends BaseController
function EditAmendImportPO() function EditAmendImportPO()
{ {
// echo "<pre>"; print_r($this->request->getPost()); echo"</pre>"; // echo "<pre>"; print_r($this->request->getPost()); echo"</pre>";
helper('numberseries');
$MAD = ''; $MAD = '';
$PONO = $this->request->getPost('txtPONO'); $PONO = $this->request->getPost('txtPONO');

View File

@ -122,6 +122,7 @@ class Emergencypurchaseorder extends BaseController
//This used to Create Service Purchase Order //This used to Create Service Purchase Order
function addNewServicePurchaseOrder() function addNewServicePurchaseOrder()
{ {
helper('numberseries');
// 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');
@ -365,7 +366,7 @@ class Emergencypurchaseorder extends BaseController
//This used to Create Revenue Emergency Purchase Order //This used to Create Revenue Emergency Purchase Order
function addNewRevenuePurchaseOrder() function addNewRevenuePurchaseOrder()
{ {
helper('numberseries');
// print_r($this->request->getPost());die; // print_r($this->request->getPost());die;
$txtspl = $this->request->getPost('txtSpecial'); $txtspl = $this->request->getPost('txtSpecial');
@ -617,12 +618,14 @@ class Emergencypurchaseorder extends BaseController
$igr = array(); $igr = array();
$paymentstatus = NO_PAIDIGR; $paymentstatus = NO_PAIDIGR;
$igr = array('PONO' => $PONO, 'VehicleNo' => $Vehicle, 'DeliveryChellanOrInvoiceNo' => $DeliveryChellanInvoiceNo, 'DeliveryChellanDate' => $DeliveryChellanDate, 'MaterialRcvdDate' => $DeliveryChellanDate, 'CourierNo' => $Courier, 'IGRStatus' => $IGRStatus, 'CreatedBy' => $CreatedBy, 'CreatedDate' => $createddt, 'MaterialRcvdDate' => $MaterialReceivedate, 'Paymentstatus' => $paymentstatus); $last_igrno = $this->inwardgateregister_model->lastIGRNO();
$newIGRNO = generate_igr_number($last_igrno);
$igr = array('IGRNO'=>$newIGRNO,'PONO' => $PONO, 'VehicleNo' => $Vehicle, 'DeliveryChellanOrInvoiceNo' => $DeliveryChellanInvoiceNo, 'DeliveryChellanDate' => $DeliveryChellanDate, 'MaterialRcvdDate' => $DeliveryChellanDate, 'CourierNo' => $Courier, 'IGRStatus' => $IGRStatus, 'CreatedBy' => $CreatedBy, 'CreatedDate' => $createddt, 'MaterialRcvdDate' => $MaterialReceivedate, 'Paymentstatus' => $paymentstatus);
//print_r($igr); //print_r($igr);
$igrM = $this->inwardgateregister_model->addigrM($igr); $igrM = $this->inwardgateregister_model->addigrM($igr);
$IGRNO = !empty($igrM) ? $igrM : ''; $IGRNO = $newIGRNO;
if ($Qualitycheck == 0) { if ($Qualitycheck == 0) {
@ -1162,6 +1165,7 @@ class Emergencypurchaseorder extends BaseController
//This used to Create Revenue Purchase Order //This used to Create Revenue Purchase Order
function addNewPurchaseOrder() function addNewPurchaseOrder()
{ {
helper('numberseries');
$POdt = $this->request->getPost('PODate'); $POdt = $this->request->getPost('PODate');
$PODate = get_date_time_format($POdt); $PODate = get_date_time_format($POdt);
$SupplierID = $this->request->getPost('drpSupplier'); $SupplierID = $this->request->getPost('drpSupplier');

View File

@ -48,16 +48,10 @@ class Expense extends BaseController
$this->loadViews("expense_list", $this->global, $data, NULL); $this->loadViews("expense_list", $this->global, $data, NULL);
} }
private function generateSerialNumber($financialYear, $lastSerial)
{
// If no last serial number exists, start with 00001
$lastNumber = $lastSerial ? (int)explode('/', $lastSerial)[2] : 0;
$newNumber = str_pad($lastNumber + 1, 3, '0', STR_PAD_LEFT);
return "NonIGR/$financialYear/$newNumber";
}
public function addExpense() public function addExpense()
{ {
helper('numberseries');
try{ try{
$file = $this->request->getFile('transporterfile'); $file = $this->request->getFile('transporterfile');
$fileName = ''; $fileName = '';
@ -66,28 +60,11 @@ class Expense extends BaseController
$file->move(WRITEPATH . 'uploads', $fileName); $file->move(WRITEPATH . 'uploads', $fileName);
} }
// Fetch the current month
$currentMonth = date('n'); // 'n' gives the month without leading zeros (1-12)
// Calculate the current financial year
if ($currentMonth >= 4) { // If it's April or later
$startYear = date('Y'); // Current year
$endYear = $startYear + 1; // Next year
} else { // If it's January, February, or March
$endYear = date('Y'); // Current year
$startYear = $endYear - 1; // Previous year
}
// Format the financial year as "yy-yy"
$financialYear = substr($startYear, -2) . '-' . substr($endYear, -2);
// Fetch the last serial number for the financial year // Fetch the last serial number for the financial year
$lastSerial = $this->expense_model->getLastSerialNumber($financialYear); $lastSerial = $this->expense_model->getLastSerialNumber();
// Generate the next serial number // Generate the next serial number
$newSerialNumber = $this->generateSerialNumber($financialYear, $lastSerial); $newSerialNumber = generate_non_igr_number($lastSerial);
$sesn_uid = $this->session->get('userId'); $sesn_uid = $this->session->get('userId');
$data = [ $data = [

View File

@ -10,6 +10,7 @@ use App\Models\Inwardgateregister_model;
use App\Models\IGRRemarks_model; use App\Models\IGRRemarks_model;
use App\Models\GasShortageModel; use App\Models\GasShortageModel;
use App\Helpers\Notification; use App\Helpers\Notification;
use App\Models\Rawmaterialdetails_model;
use DateTime; use DateTime;
use ZipArchive; use ZipArchive;
@ -27,6 +28,8 @@ class Inwardgateregister extends BaseController
protected $inwardgateregister_model; protected $inwardgateregister_model;
protected $IGRRemarks_model; protected $IGRRemarks_model;
protected $gasShortage_model; protected $gasShortage_model;
protected $rawMaterialDetails_model;
protected $session; protected $session;
protected $logger; protected $logger;
@ -40,6 +43,7 @@ class Inwardgateregister extends BaseController
$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->gasShortage_model = new GasShortageModel();
$this->rawMaterialDetails_model = new Rawmaterialdetails_model();
$this->session = session(); $this->session = session();
helper('form'); //$this->load->library('form_validation'); helper('form'); //$this->load->library('form_validation');
@ -401,6 +405,7 @@ class Inwardgateregister extends BaseController
function SaveIGR() function SaveIGR()
{ {
#Step 1 IGR Details #Step 1 IGR Details
helper('numberseries');
$PONO = $this->request->getPost('PONO'); $PONO = $this->request->getPost('PONO');
$IsThisOpenOrderPO = $this->request->getPost('hiddenIsOpenOrder'); $IsThisOpenOrderPO = $this->request->getPost('hiddenIsOpenOrder');
$DeliveryChellanOrInvoiceNo = $this->request->getPost('InvoiceNo'); $DeliveryChellanOrInvoiceNo = $this->request->getPost('InvoiceNo');
@ -447,7 +452,11 @@ class Inwardgateregister extends BaseController
} }
} }
#Step 3 Master Details Gathering to Save In DB #Step 3 Master Details Gathering to Save In DB
$igr = array('PONO' => $PONO, 'VehicleNo' => $VehicleNo, 'TransporterId'=>$TransporterId,'DeliveryChellanOrInvoiceNo' => $DeliveryChellanOrInvoiceNo, 'DeliveryChellanDate' => $DeliveryChellanDate, 'MaterialRcvdDate' => $MaterialRcvdDt, 'DriverName' => $DriverName, 'DriverMobileNumber' => $DriverMobileNumber,'IGRStatus' => $IGRStatus, 'CreatedBy' => $CreatedBy, 'CreatedDate' => $createddt, 'PaymentStatus' => $paymentstatus, 'Remark'=>$MasterRemarks); $last_igrno = $this->inwardgateregister_model->lastIGRNO();
// echo $last_igrno;
$newIGRNO = generate_igr_number($last_igrno);
// echo $newIGRNO;die;
$igr = array('IGRNO'=>$newIGRNO,'PONO' => $PONO, 'VehicleNo' => $VehicleNo, 'TransporterId'=>$TransporterId,'DeliveryChellanOrInvoiceNo' => $DeliveryChellanOrInvoiceNo, 'DeliveryChellanDate' => $DeliveryChellanDate, 'MaterialRcvdDate' => $MaterialRcvdDt, 'DriverName' => $DriverName, 'DriverMobileNumber' => $DriverMobileNumber,'IGRStatus' => $IGRStatus, 'CreatedBy' => $CreatedBy, 'CreatedDate' => $createddt, 'PaymentStatus' => $paymentstatus, 'Remark'=>$MasterRemarks);
$igr['MasterFile'] = $requestMasterFileName; $igr['MasterFile'] = $requestMasterFileName;
#Step 4 Calling DB to Save IGR Master #Step 4 Calling DB to Save IGR Master
$IGRNO = $this->inwardgateregister_model->addigrM($igr); $IGRNO = $this->inwardgateregister_model->addigrM($igr);
@ -550,7 +559,16 @@ class Inwardgateregister extends BaseController
} }
$CreatedBy = $this->session->get('userId'); $CreatedBy = $this->session->get('userId');
$igrDetails = array('IGRNO' => $IGRNO, 'MaterialCode' => $MaterialCode, 'QuantityAsPerInvoice' => $QuantityAsPerInvoice, 'Remarks' => $Remarks, 'IGRItemStatus' => $IGRItemStatus,'GrossWeight' => (float)$GrossWeight ,'GrossWeightDate'=> $GrossWeightDate,'TareWeight' => (float)$TareWeight ,'TareWeightDate' => $TareWeightDate ,'NetWeight' => (float)$NetWeight, 'CreatedBy' => $CreatedBy, 'CreatedDate' => $createddt);
$igrDetails = array(
'IGRNO' => $IGRNO, 'MaterialCode' => $MaterialCode, 'QuantityAsPerInvoice' => $QuantityAsPerInvoice,
'Remarks' => $Remarks, 'IGRItemStatus' => $IGRItemStatus,'GrossWeight' => (float)$GrossWeight ,
'GrossWeightDate'=> $GrossWeightDate,'TareWeight' => (float)$TareWeight ,'TareWeightDate' => $TareWeightDate ,
'NetWeight' => (float)$NetWeight, 'CreatedBy' => $CreatedBy, 'CreatedDate' => $createddt,
//current change 04-04-2025 by vadivel
'mIGRStatus' => $IGRStatus);
$igrDetails['WeightFile'] = $requestWeightFileName; $igrDetails['WeightFile'] = $requestWeightFileName;
log_message('error', 'SaveIGR igrDetails result : ' . json_encode($igrDetails)); log_message('error', 'SaveIGR igrDetails result : ' . json_encode($igrDetails));
@ -984,19 +1002,21 @@ function viewIGRDetails()
// $history_content .= "<br>" . $readable_field . ": `" . $history[$j]->old_data . "` was updated to `" . $history[$j]->new_data . "` ."; // $history_content .= "<br>" . $readable_field . ": `" . $history[$j]->old_data . "` was updated to `" . $history[$j]->new_data . "` .";
} }
$history_content .= "</ul>"; $history_content .= "</ul>";
$email = "";
for ($i = 0; $i < count($result_for_email['emails']); $i++) { $to_email_addr = "";
$email .= $result_for_email['emails'][$i]->email . " , "; for ($i = 0; $i < count($result_for_email['to_mails']); $i++) {
$to_email_addr .= $result_for_email['to_mails'][$i]->email . " , ";
} }
$email = rtrim($email, " ,"); // $to_email_addr .= "sanjeev.p@venbainfotech.com,gowtham.m@venbainfotech.com";
$to_email_addr = rtrim($to_email_addr, " ,");
$email_response = $notification->sendEmail([ $email_response = $notification->sendEmail([
'recipient_email' => $email, 'recipient_email' => $to_email_addr,
'subject' => $result_for_email['company'].' - IGR Notification', 'subject' => $result_for_email['company'].' - IGR Notification',
// 'carboncopy'=>Sales@resicoindustries.com,Factory@resicoindustries.com,Invoice@resicoindustries.com, 'carboncopy' =>"pavithra.t@venbainfotech.com",
// 'description' => 'IGR Number : '.$IGRNo.' is Edited By '.($result_for_email['full_name'] ?? $this->session->get('name'))." On ".date('d-m-Y H:i A', strtotime(get_current_date_time() . ' +30 seconds')). $history_content, // 'description' => 'IGR Number : '.$IGRNo.' is Edited By '.($result_for_email['full_name'] ?? $this->session->get('name'))." On ".date('d-m-Y H:i A', strtotime(get_current_date_time() . ' +30 seconds')). $history_content,
'description' => $result_for_history['first_line']."<br>" .$history_content, 'description' => $result_for_history['first_line']."<br>" .$history_content,
'company' => $result_for_email['company'], 'company' => $result_for_email['company'],
'from_mail'=> $result_for_email['from_mail'] 'from_mail'=> $result_for_email['from_mails']
]); ]);
log_message('error', 'email reponse : ' . json_encode($email_response)); log_message('error', 'email reponse : ' . json_encode($email_response));
@ -1006,9 +1026,9 @@ function viewIGRDetails()
// Log the result // Log the result
if ($receiving_status) { if ($receiving_status) {
$this->logger->info("Email IDs = " . $email . " " . $mail_log); $this->logger->info("Email IDs = " . $to_email_addr . " " . $mail_log);
} else { } else {
$this->logger->error("Email IDs = " . $email . " " . $mail_log); $this->logger->error("Email IDs = " . $to_email_addr . " " . $mail_log);
} }
// echo "***".$history_content;die; // echo "***".$history_content;die;
@ -1424,22 +1444,25 @@ function updateIGRWeight(){
$result_for_email = $this->inwardgateregister_model->getDetailsforEmail($this->session->get('userId'),$roleId); $result_for_email = $this->inwardgateregister_model->getDetailsforEmail($this->session->get('userId'),$roleId);
// print_r($result_for_email);die;
$email = ""; $to_email_addr = '';
for ($i = 0; $i < count($result_for_email['emails']); $i++) { for ($i = 0; $i < count($result_for_email['to_mails']); $i++) {
$email .= $result_for_email['emails'][$i]->email . " , "; $to_email_addr .= $result_for_email['to_mails'][$i]->email . " , ";
} }
$email = rtrim($email, " ,"); // $to_email_addr = " venbalap08@gmail.com , sanjeev.p@venbainfotech.com";
$to_email_addr = rtrim($to_email_addr, " ,");
$content = 'A new remark was created by '.$result_for_email['full_name'].' against IGR no '.$IGRNo.',</br></br> "'.$remark.'"'; $content = 'A new remark was created by '.$result_for_email['full_name'].' against IGR no '.$IGRNo.',</br></br> "'.$remark.'"';
$notification = new Notification(); $notification = new Notification();
$notification->sendEmail([ $notification->sendEmail([
'recipient_email' => $email, 'recipient_email' => $to_email_addr,
'subject' => $result_for_email['company'].' - IGR Remark Raised', 'subject' => $result_for_email['company'].' - IGR Remark Raised',
'carboncopy' =>"pavithra.t@venbainfotech.com",
'description' => $content, 'description' => $content,
'company' => $result_for_email['company'], 'company' => $result_for_email['company'],
'from_mail'=> $result_for_email['from_mail'] 'from_mail'=> $result_for_email['from_mails']
]); ]);
@ -1517,60 +1540,166 @@ function updateIGRWeight(){
public function gasShortageList(){ /*
********************************************************* sec_gas_shortage_starts **************************************************************
*/
$postData = $this->request->getPost(); public function gasCylinderEntered(){
$allShortages = $this->gasShortage_model->where('invoiceNo',$postData['invoiceNo'])->findAll(); $this->global['pageTitle'] = 'Gas Cylinder Entered';
return $this->response->setJSON(['status' => 'success', 'data' => $allShortages]); $gasMaterialCodes = $this->rawMaterialDetails_model->getAllGasMaterialCode();
$gasMaterialCodes = array_column($gasMaterialCodes,'MaterialCode');
$igrDetailsListByMcatGas = $this->inwardgateregister_model->getIgrDetailsListByMcatGas($gasMaterialCodes,"gas_entered");
$data['gasCylinderEnteredList'] = $igrDetailsListByMcatGas;
$this->loadViews("gasCylinderEntered", $this->global, $data, NULL);
} }
public function gasCylinderPending(){
public function getGasShortageDetail(){
$postData = $this->request->getPost(); $this->global['pageTitle'] = 'Gas Cylinder Pending';
$shortage = $this->gasShortage_model->where('id',$postData['id'])->find(); $gasMaterialCodes = $this->rawMaterialDetails_model->getAllGasMaterialCode();
$gasMaterialCodes = array_column($gasMaterialCodes,'MaterialCode');
$igrDetailsListByMcatGas = $this->inwardgateregister_model->getIgrDetailsListByMcatGas($gasMaterialCodes,"gas_pending");
$data['gasCylinderPendingList'] = $igrDetailsListByMcatGas;
$this->loadViews("gasCylinderPending", $this->global, $data, NULL);
return $this->response->setJSON(['status' => 'success', 'data' => $shortage]);
} }
public function gasCylinderReturned(){
$this->global['pageTitle'] = 'Gas Cylinder Returned';
$gasMaterialCodes = $this->rawMaterialDetails_model->getAllGasMaterialCode();
$gasMaterialCodes = array_column($gasMaterialCodes,'MaterialCode');
$igrDetailsListByMcatGas = $this->inwardgateregister_model->getIgrDetailsListByMcatGas($gasMaterialCodes,"gas_returned");
$data['gasCylinderReturnedList'] = $igrDetailsListByMcatGas;
$this->loadViews("gasCylinderReturned", $this->global, $data, NULL);
}
public function updateGasShortage() public function updateGasShortage()
{ {
$postData = $this->request->getPost(); try {
// Validate required data $postData = $this->request->getJSON(true); // Convert JSON to an associative array
// Validate if any data is received
if (!$postData) { if (!$postData) {
return $this->response->setJSON(['status' => 'error', 'message' => 'Invalid request. No data received.']); return $this->response->setJSON([
'status' => 'error',
'message' => 'Invalid request. No data received.'
]);
} }
// Validate required fields for adding // Validate required fields
if ( !isset($postData['invoiceNo']) ) { if (empty($postData['invoiceNo']) ) {
return $this->response->setJSON(['status' => 'error', 'message' => 'Missing required fields: invoice No.']); return $this->response->setJSON([
'status' => 'error',
'message' => 'Missing invoiceNo data.'
]);
} }
// Handle update (edit) $updates = [];
if (isset($postData["id"])) { $inserts = [];
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.']); if(isset($postData['id'])){ //update operation
$cylinderData = [
'id' => $postData['id'],
'IGRNO' => $postData['IGRNO'] ?? '',
'fullCylinderDate' => $postData['fullCylinderDate'] ?? '',
'emptyCylinderDate' => $postData['emptyCylinderDate'] ?? '',
'invoiceNo' => $postData['invoiceNo'] ?? '',
'cylinderNo' => $postData['cylinderNo'],
'grossWeight' => $postData['grossWeight'],
'tareWeight' => $postData['tareWeight'] ?? '',
'netWeight' => $postData['netWeight'] ?? '',
'actualWeight' => $postData['actualWeight'],
'shortage' => $postData['shortage'] ?? '',
'gas_cylinder_status' => "gas_returned"
];
$updates[] = $cylinderData ;
}else{//Insert Operation
// Process each cylinder entry
foreach ($postData['cylinders'] as $cylinder) {
// Ensure cylinder data is valid
if (!isset($cylinder['cylinderNo'], $cylinder['grossWeight'], $cylinder['actualWeight'])) {
continue; // Skip incomplete data
} }
// Insert new shortage (add) $cylinderData = [
return ($insertId = $this->gasShortage_model->insert($postData)) 'IGRNO' => $postData['IGRNO'] ?? '',
? $this->response->setJSON(['status' => 'success', 'message' => 'Gas shortage details added successfully.', 'data' => ['id' => $insertId]]) 'fullCylinderDate' => $postData['fullCylinderDate'] ?? '',
: $this->response->setJSON(['status' => 'error', 'message' => 'Failed to save gas shortage details.']); 'emptyCylinderDate' => $postData['emptyCylinderDate'] ?? '',
'invoiceNo' => $postData['invoiceNo'] ?? '',
'cylinderNo' => $cylinder['cylinderNo'],
'grossWeight' => $cylinder['grossWeight'],
'tareWeight' => $cylinder['tareWeight'] ?? '',
'netWeight' => $cylinder['netWeight'] ?? '',
'actualWeight' => $cylinder['actualWeight'],
'shortage' => $cylinder['shortage'] ?? '',
'gas_cylinder_status' => 'gas_pending'
];
$inserts[] = $cylinderData;
} }
}
if (!empty($updates)) {
$this->gasShortage_model->updateBatch($updates, 'id');
}
if (!empty($inserts)) {
$this->gasShortage_model->insertBatch($inserts);
}
return $this->response->setJSON([
'status' => 'success',
'message' => 'Gas shortage details processed successfully.'
]);
} catch (\Throwable $th) {
// Log the error for debugging
log_message('error', 'Gas Shortage Update Error: ' . $th->getMessage());
return $this->response->setJSON([
'status' => 'error',
'message' => 'An unexpected error occurred while processing gas shortage details.',
'error' => $th->getMessage()
]);
}
}
/*
********************************************************* sec_gas_shortage_ends **************************************************************
*/
} }

View File

@ -111,7 +111,7 @@ class Monthlypay extends BaseController
$current = $this->request->getPost('month'); $current = $this->request->getPost('month');
$month_short_name = substr((string)$current, 0, 3); $month_short_name = substr((string)$current, 0, 3);
$year = substr((string)$current, 4); $year = substr((string)$current, 4);// also used
$month_arr = date_parse($month_short_name); $month_arr = date_parse($month_short_name);
$month = $month_arr['month']; $month = $month_arr['month'];
$current = $year . "-" . $month . '-01'; $current = $year . "-" . $month . '-01';
@ -151,7 +151,44 @@ class Monthlypay extends BaseController
$data['datefordropdown'] = $current; $data['datefordropdown'] = $current;
$data['attendance'] = $this->monthlypay_model->monthlyAttendance($current); $data['attendance'] = $this->monthlypay_model->monthlyAttendance($current);
$data['emppay'] = $this->monthlypay_model->getEmpPayDetails($current, $string); $data['emppay'] = $this->monthlypay_model->getEmpPayDetails($current, $string);
// dd($data); $leavedate = $this->monthlypay_model->employeeLeaveDates($month . "-" . $year);
$employeeLeaveDate = [];
if(!empty($leavedate)){
foreach ($leavedate as $entry) {
$empId = $entry['emp_id'];
list($stYear,$stMonth,$stDate) = explode('-', $entry['start_date']);
list($eYear,$eMonth,$eDate) = explode('-', $entry['end_date']);
$start = (int)$stDate;
$end = (int)$eDate;
if ((int)$stYear < (int)$year || ((int)$stYear == (int)$year && (int)$stMonth < (int)$month)) {
$start = 1;
}
// if ((int)$stMonth < (int)$month) $start = 1; // old if
if ((int)$eYear > (int)$year || ((int)$eYear == (int)$year && (int)$eMonth > (int)$month)) {
$end = $monthdays;
}
// if ((int)$eMonth > (int)$month) $end = $monthdays; // old if
if ($start > $monthdays) $start = 1;
for ($i = $start; $i <= $end; $i++) {
$employeeLeaveDate[$empId][] = $i;
// $employeeLeaveDate[$empId][] = str_pad($i, 2, '0', STR_PAD_LEFT);
}
}
if($employeeLeaveDate){
array_walk($employeeLeaveDate, fn(&$dates) => $dates = array_unique($dates));
}
}
$data['employeeleavedate'] = $employeeLeaveDate;
// dd($data['employeeleavedate']);
$this->global['pageTitle'] = 'Monthly Attendance'; $this->global['pageTitle'] = 'Monthly Attendance';
$this->loadViews("attendance", $this->global, $data, NULL); $this->loadViews("attendance", $this->global, $data, NULL);
} }
@ -971,6 +1008,20 @@ class Monthlypay extends BaseController
return $this->response->setJSON($data); return $this->response->setJSON($data);
} }
public function validateDateRange(){
$emp_id = $this->request->getPost('emp_id');
$start_date = $this->request->getPost('start_date');
$end_date = $this->request->getPost('end_date');
$array = $this->monthlypay_model->validateDateRange($emp_id,$start_date,$end_date);
if (!empty($array) && count($array) > 0) {
$data = ['status' => true, 'message' => 'The selected date range overlaps with an existing approved leave.','details'=>$array];
}else{
$data = ['status' => false, 'message' => '','details'=>$array];
}
return $this->response->setJSON($data);
}
function deleteLeaveApplicationForm() function deleteLeaveApplicationForm()
{ {
@ -995,9 +1046,7 @@ class Monthlypay extends BaseController
$data['leave_info'] = $this->monthlypay_model->getheringleaveApplicationForm($leave_application_id); $data['leave_info'] = $this->monthlypay_model->getheringleaveApplicationForm($leave_application_id);
$data['company_info'] = $this->monthlypay_model->getCompanyInformation(); $data['company_info'] = $this->monthlypay_model->getCompanyInformation();
$html = view('leaveApplicationPDF', $data); // echo $html;
$html = view('leaveApplicationPDF', $data);
// echo $html;die;
$mpdf = new Mpdf(); $mpdf = new Mpdf();
$mpdf->WriteHTML($html); $mpdf->WriteHTML($html);

View File

@ -178,6 +178,8 @@ class Payslip extends BaseController
$data['fresh'] = $this->monthlypay_model->getEmpPayDetailsforMonthInputs($current); $data['fresh'] = $this->monthlypay_model->getEmpPayDetailsforMonthInputs($current);
// dd($data['fresh']); // dd($data['fresh']);
$data['drivermonthinputs'] = $this->driverMonthlyPayInputs($current); $data['drivermonthinputs'] = $this->driverMonthlyPayInputs($current);
// $leavedate = $this->monthlypay_model->employeeLeaveDates($current);
$employeeSalary = []; $employeeSalary = [];
$esi = []; $esi = [];
$pf = []; $pf = [];
@ -303,7 +305,6 @@ class Payslip extends BaseController
$data['pf'] = $pf; $data['pf'] = $pf;
$data['over_time'] = $ot; $data['over_time'] = $ot;
$this->global['pageTitle'] = 'Payroll Monthly Inputs'; $this->global['pageTitle'] = 'Payroll Monthly Inputs';
$this->loadViews("monthlypayinputs", $this->global, $data, NULL); $this->loadViews("monthlypayinputs", $this->global, $data, NULL);
} }

View File

@ -1113,6 +1113,7 @@ class Purchaseorder extends BaseController
//This used to Create Revenue Purchase Order //This used to Create Revenue Purchase Order
function addNewPurchaseOrder() function addNewPurchaseOrder()
{ {
helper('numberseries');
try { try {
// Extract POST data // Extract POST data
@ -1985,6 +1986,7 @@ class Purchaseorder extends BaseController
function addNewImportPurchaseOrder() function addNewImportPurchaseOrder()
{ {
helper('numberseries');
try { try {
$POdt = $this->request->getPost('PODate'); $POdt = $this->request->getPost('PODate');
$PODate = get_date_time_format($POdt); $PODate = get_date_time_format($POdt);
@ -2597,7 +2599,7 @@ class Purchaseorder extends BaseController
} else { } else {
$store = array('Status' => $StatusCode, 'OnHoldOn' => $ApprovedDate, 'OnHoldBy' => $ApprovedBy, 'Remarks' => $Remarks); $store = array('Status' => $StatusCode, 'OnHoldOn' => $ApprovedDate, 'OnHoldBy' => $ApprovedBy, 'Remarks' => $Remarks);
$this->purchaseorder_model->UpdatePO($store, $PONO); $this->purchaseorder_model->UpdatePO($store, $PONO);
echo "The Purchase Order No: " . $PONO . "is On Hold"; echo "The Purchase Order No: " . $PONO . " is On Hold";
} }
} }
@ -2670,7 +2672,7 @@ class Purchaseorder extends BaseController
/* Add capital Po*/ /* Add capital Po*/
function addNewCapitalPurchaseOrder() function addNewCapitalPurchaseOrder()
{ {
helper('numberseries');
try { try {
$POdt = $this->request->getPost('PODate'); $POdt = $this->request->getPost('PODate');
$PODate = get_date_time_format($POdt); $PODate = get_date_time_format($POdt);

View File

@ -187,7 +187,7 @@ class Servicepurchaseorder extends BaseController
//This used to Create Service Purchase Order //This used to Create Service Purchase Order
function addNewServicePurchaseOrder() function addNewServicePurchaseOrder()
{ {
helper('numberseries');
$POdt = $this->request->getPost('PODate'); $POdt = $this->request->getPost('PODate');
$PODate = get_date_time_format($POdt); $PODate = get_date_time_format($POdt);
$SupplierID = $this->request->getPost('drpSupplier'); $SupplierID = $this->request->getPost('drpSupplier');

View File

@ -1020,7 +1020,7 @@ class User extends BaseController
// Validation passed // Validation passed
$EmpID = $this->request->getPost('EmpList'); $EmpID = $this->request->getPost('EmpList');
$roleId = '2'; $roleId = !empty($this->request->getPost('role')) ? $this->request->getPost('role') : '2' ;
$password = (string)$this->request->getPost('password'); $password = (string)$this->request->getPost('password');
$Createddt = date('Y-m-d H:i:s'); $Createddt = date('Y-m-d H:i:s');
$email = $this->request->getPost('MailID'); $email = $this->request->getPost('MailID');

49
app/Helpers/excel_helper.php Executable file
View File

@ -0,0 +1,49 @@
<?php
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Reader\Exception as SpreadsheetReaderException;
if (!function_exists('generate_excel')) {
/*
This function generates an Excel file using the given headers and data and saves it with the specified filename.
It utilizes the PhpSpreadsheet library to create and manipulate Excel files.
Parameters:
- $headers: An array containing the column headers for the Excel sheet.
- $data: An array containing the data to be inserted into the Excel sheet.
- $filename: The name of the file to be saved.
- $totals (optional): A flag indicating whether to include total calculations in the Excel sheet.
*/
function generate_excel($headers, $data, $filename)
{
// Create new Spreadsheet object
$spreadsheet = new Spreadsheet();
// Set worksheet title
$spreadsheet->getActiveSheet()->setTitle('Sheet 1');
// Set headers into the spreadsheet
$spreadsheet->getActiveSheet()->fromArray([$headers], null, 'A1');
// Set data into the spreadsheet
$spreadsheet->getActiveSheet()->fromArray($data, null, 'A2');
// Create Excel writer
$writer = new Xlsx($spreadsheet);
try {
// Save Excel file to the specified path
$writer->save($filename);
return true; // Return true if file was successfully saved
} catch (\Exception $e) {
// Log or handle the exception
return false; // Return false if there was an error saving the file
}
}
}

View File

@ -1,49 +1,4 @@
<?php <?php
if (!function_exists('generate_po_number')) {
function generate_po_number($last_pono)
{
$currentYear = date("Y");
$shortenFinYear = get_shorten_financial_year();// Get it From - DateTime Helper refer it.
// if(here have to check fin year if there is a change means both are same means ){
// $counter = $counter + 1;
// }else{
// $counter = 1;
// }
$result = explode('/', $last_pono);
$requestedFinYear = $result[1];
$leftPad = "RIPL";
$digit = 5;
if($requestedFinYear == $shortenFinYear){
$number = ((int)$result[2])+1;
$PoNo = $leftPad . '/' . $shortenFinYear . '/' . str_pad($number, $digit, '0', STR_PAD_LEFT);
}else{
$counter = 1;
$PoNo = $leftPad . '/' . $shortenFinYear . '/' . str_pad($counter, $digit, '0', STR_PAD_LEFT);
}
return $PoNo;
}
}
function generate_amendment_po_number($PoNo, $increment = 1) {
if (strpos($PoNo, '.') !== false) {
list($base, $decimal) = explode('.', $PoNo);
preg_match('/^0*(\d+)$/', $decimal, $matches);
$numeric_part = isset($matches[1]) ? $matches[1] : '';
$new_numeric_part = intval($numeric_part) + $increment;
// Determine the number of leading zeros based on the original numeric part length
$new_decimal_length = strlen($numeric_part) > 1 ? strlen($numeric_part) : 2;
$new_decimal = str_pad($new_numeric_part, $new_decimal_length, '0', STR_PAD_LEFT);
return $base . '.' . $new_decimal;
} else {
return $PoNo . '.01';
}
}
if (!function_exists('invoice_logo_pdf')) if (!function_exists('invoice_logo_pdf'))
{ {
function invoice_logo_pdf() function invoice_logo_pdf()

View File

@ -0,0 +1,109 @@
<?php
if (!function_exists('generate_po_number')) {
function generate_po_number($last_pono)
{
$currentYear = date("Y");
$shortenFinYear = get_shorten_financial_year();// Get it From - DateTime Helper refer it.
// if(here have to check fin year if there is a change means both are same means ){
// $counter = $counter + 1;
// }else{
// $counter = 1;
// }
$result = explode('/', $last_pono);
$requestedFinYear = $result[1];
$leftPad = "RIPL";
$digit = 5;
if($requestedFinYear == $shortenFinYear){
$number = ((int)$result[2])+1;
$PoNo = $leftPad . '/' . $shortenFinYear . '/' . str_pad($number, $digit, '0', STR_PAD_LEFT);
}else{
$counter = 1;
$PoNo = $leftPad . '/' . $shortenFinYear . '/' . str_pad($counter, $digit, '0', STR_PAD_LEFT);
}
return $PoNo;
}
}
if (!function_exists('generate_igr_number')) {
function generate_igr_number($last_igrno)
{
$shortenFinYear = get_shorten_financial_year();
if (preg_match('/^\w+\/\d+-\d+\/\d+$/', $last_igrno)) {
// echo $last_igrno;
$type = 1; // IGRNO/25-26/00001 // 2025 april onwards karthick asked to changed this type.
} elseif (preg_match('/^\w+-\d+$/', $last_igrno)) {
// echo $last_igrno;
$type = 2; // IGRNO-0001 // karthick asked to checked this type 2023- 2025 april
} else {
// echo $last_igrno;
$type = 3; // IGRNO00001 // very first time we followed this type
}
if ($type == 1) {
$result = explode('/', $last_igrno);
$requestedFinYear = $result[1];
$leftPad = "IGR";
$digit = 4;
if($requestedFinYear == $shortenFinYear){ // here i am comparing the shoren fin year
$number = ((int)$result[2])+1;
$IgrNo = $leftPad . '/' . $shortenFinYear . '/' . str_pad($number, $digit, '0', STR_PAD_LEFT);
}else{
// here not same means ressetted type 1 format
$counter = 1;
$IgrNo = $leftPad . '/' . $shortenFinYear . '/' . str_pad($counter, $digit, '0', STR_PAD_LEFT);
}
return $IgrNo;
}else{
// type 2 and type 3 is converted into type 1 format
$leftPad = "IGR";
$digit = 5;
$counter = 1;
$IgrNo = $leftPad . '/' . $shortenFinYear . '/' . str_pad($counter, $digit, '0', STR_PAD_LEFT);
return $IgrNo;
}
}
}
if (!function_exists('generate_non_igr_number')) {
function generate_non_igr_number($last_non_igr)
{
$shortenFinYear = get_shorten_financial_year();// Get it From
$result = explode('/', $last_non_igr);
$requestedFinYear = $result[1];
$leftPad = "NonIGR";
$digit = 3;
if($requestedFinYear == $shortenFinYear){
$number = ((int)$result[2])+1;
$NonIgrNo = $leftPad . '/' . $shortenFinYear . '/' . str_pad($number, $digit, '0', STR_PAD_LEFT);
}else{
$counter = 1;
$NonIgrNo = $leftPad . '/' . $shortenFinYear . '/' . str_pad($counter, $digit, '0', STR_PAD_LEFT);
}
return $NonIgrNo;
}
}
function generate_amendment_po_number($PoNo, $increment = 1) {
if (strpos($PoNo, '.') !== false) {
list($base, $decimal) = explode('.', $PoNo);
preg_match('/^0*(\d+)$/', $decimal, $matches);
$numeric_part = isset($matches[1]) ? $matches[1] : '';
$new_numeric_part = intval($numeric_part) + $increment;
// Determine the number of leading zeros based on the original numeric part length
$new_decimal_length = strlen($numeric_part) > 1 ? strlen($numeric_part) : 2;
$new_decimal = str_pad($new_numeric_part, $new_decimal_length, '0', STR_PAD_LEFT);
return $base . '.' . $new_decimal;
} else {
return $PoNo . '.01';
}
}
?>

View File

@ -12,7 +12,7 @@ class Expense_model extends Model
'serial_number' , 'transporter_file', 'supplier_id', 'remarks', 'item_description', 'cost', 'cgst', 'sgst', 'igst', 'total', 'bill_no' ,'bill_date','status','created_by','updated_by' 'serial_number' , 'transporter_file', 'supplier_id', 'remarks', 'item_description', 'cost', 'cgst', 'sgst', 'igst', 'total', 'bill_no' ,'bill_date','status','created_by','updated_by'
]; ];
public function getLastSerialNumber($financialYear) public function getLastSerialNumber()
{ {
return $this->db->table('t_expense') return $this->db->table('t_expense')
->select('serial_number') ->select('serial_number')

View File

@ -6,15 +6,25 @@ use CodeIgniter\Model;
class GasShortageModel extends Model class GasShortageModel extends Model
{ {
protected $table = 't_gasShortageDetails'; protected $table = 't_gasshortagedetails';
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 = protected $allowedFields =
['fullCylinderDate','emptyCylinderDate','invoiceNo', ['id',
'cylinderNo','grossWeight','tareWeight','netWeight','actualWeight','shortage' 'IGRNO',
'fullCylinderDate',
'emptyCylinderDate',
'invoiceNo',
'cylinderNo',
'grossWeight',
'tareWeight',
'netWeight',
'actualWeight',
'shortage',
'gas_cylinder_status'
]; ];
protected bool $allowEmptyInserts = false; protected bool $allowEmptyInserts = false;

View File

@ -21,7 +21,8 @@ class Inwardgateregister_model extends Model
$afftectedRows = $this->db->affectedRows(); $afftectedRows = $this->db->affectedRows();
return $afftectedRows; return $afftectedRows;
} }
function getAdditionalIGRFile($igr){ function getAdditionalIGRFile($igr)
{
$builder = $this->db->table('t_inwardgateregister_fileupload')->select('*') $builder = $this->db->table('t_inwardgateregister_fileupload')->select('*')
->where('IGRNO', $igr); ->where('IGRNO', $igr);
$query = $builder->get(); $query = $builder->get();
@ -86,7 +87,7 @@ class Inwardgateregister_model extends Model
->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO') ->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
->join('t_inwardgateregister_fileupload fileup', ' igr.IGRNO = fileup.IGRNO', 'left') ->join('t_inwardgateregister_fileupload fileup', ' igr.IGRNO = fileup.IGRNO', 'left')
->join('t_supplierdetailsn` sup', 'PO.SupplierID = sup.SupplierID') ->join('t_supplierdetailsn` sup', 'PO.SupplierID = sup.SupplierID')
->orderBy('igr.IGRID','desc') ->orderBy('igr.IGRID', 'desc')
->groupBy('igr.IGRNO', 'desc'); ->groupBy('igr.IGRNO', 'desc');
$query = $builder->get(); $query = $builder->get();
$result = $query->getResult(); $result = $query->getResult();
@ -136,10 +137,10 @@ class Inwardgateregister_model extends Model
->join('t_ogr_master OGM ', 'POM.PONO = OGM.PONO_INV', 'left') ->join('t_ogr_master OGM ', 'POM.PONO = OGM.PONO_INV', 'left')
// ->where('POM.POType !=', SERVICE) // due to client requirements - he wants to remove the conidition. // ->where('POM.POType !=', SERVICE) // due to client requirements - he wants to remove the conidition.
->where('POM.Status', PO_RELEASED) ->where('POM.Status', PO_RELEASED)
->orWhere('POM.Status',REQITEM_Emergency_PO_CREATED) ->orWhere('POM.Status', REQITEM_Emergency_PO_CREATED)
->orWhere('POM.Status',IGR_CREATED) ->orWhere('POM.Status', IGR_CREATED)
->orWhere('POM.Status', IGR_DRAFT ) ->orWhere('POM.Status', IGR_DRAFT)
->where( 'POM.IsOpenOrder', 1) ->where('POM.IsOpenOrder', 1)
->orWhere('POM.Status', MRIR_CREATED) ->orWhere('POM.Status', MRIR_CREATED)
->orWhere('POM.Status', MRIR_APPROVED) ->orWhere('POM.Status', MRIR_APPROVED)
->orWhere('POM.Status', OGR_COMPLETE) ->orWhere('POM.Status', OGR_COMPLETE)
@ -169,12 +170,13 @@ class Inwardgateregister_model extends Model
return $temp; return $temp;
} }
public function checkdriverMobile($mobile,$driverName) { public function checkdriverMobile($mobile, $driverName)
{
$builder = $this->db->table('t_igr_master') $builder = $this->db->table('t_igr_master')
->distinct() ->distinct()
->select('DriverMobileNumber') ->select('DriverMobileNumber')
->like('DriverMobileNumber', $mobile); ->like('DriverMobileNumber', $mobile);
if($driverName){ if ($driverName) {
$builder->where('DriverName', $driverName); $builder->where('DriverName', $driverName);
} }
@ -220,8 +222,11 @@ class Inwardgateregister_model extends Model
return $result; */ return $result; */
} }
public function igr_history($hsty_arr) { public function igr_history($hsty_arr)
$keysToRemove = ["UpdateBY", "MaterialRcvdDate", "DeliveryChellanDate"]; {
$keysToRemove = ["UpdateBY", "UpdateBy", "MaterialRcvdDate", "DeliveryChellanDate"];
foreach ($keysToRemove as $key) { foreach ($keysToRemove as $key) {
if (isset($hsty_arr[$key])) { if (isset($hsty_arr[$key])) {
unset($hsty_arr[$key]); unset($hsty_arr[$key]);
@ -230,11 +235,10 @@ class Inwardgateregister_model extends Model
$builder = $this->db->table('t_igr_history'); $builder = $this->db->table('t_igr_history');
$builder->insert($hsty_arr); $builder->insert($hsty_arr);
return $this->db->insertID();
return $this->db->insertID(); // Return last inserted ID
} }
function get_igr_history($col,$IGR,$IGRITEM = null) function get_igr_history($col, $IGR, $IGRITEM = null)
{ {
$builder = $this->db->table('t_igr_history Hist') $builder = $this->db->table('t_igr_history Hist')
@ -256,11 +260,13 @@ class Inwardgateregister_model extends Model
return $result; return $result;
} }
function get_igr_master_for_history($igr_no) { function get_igr_master_for_history($igr_no)
{
return $this->db->table('t_igr_master Master')->where('Master.IGRNO', $igr_no)->get()->getRow(); return $this->db->table('t_igr_master Master')->where('Master.IGRNO', $igr_no)->get()->getRow();
} }
function get_igr_child_for_history($igr_no, $igr_item_no) { function get_igr_child_for_history($igr_no, $igr_item_no)
{
$builder = $this->db->table('t_igr_details Child'); // Select only the required field $builder = $this->db->table('t_igr_details Child'); // Select only the required field
if ($igr_no) { if ($igr_no) {
$builder->where('Child.IGRNO', $igr_no); $builder->where('Child.IGRNO', $igr_no);
@ -273,6 +279,13 @@ class Inwardgateregister_model extends Model
return $result; // Return the field value directly return $result; // Return the field value directly
} }
function lastIGRNO()
{
$query = $this->db->table('t_igr_master')->select('IGRNO')->orderBy('IGRID', 'DESC')->limit(1)->get();
$lastIGRNO = $query->getRow()->IGRNO;
return $lastIGRNO;
}
function addigrM($igrM) function addigrM($igrM)
{ {
// print_r($igrM);die; // print_r($igrM);die;
@ -378,8 +391,8 @@ class Inwardgateregister_model extends Model
->join('t_igr_master igr', 'igr_details.IGRNo = igr.IGRNo') ->join('t_igr_master igr', 'igr_details.IGRNo = igr.IGRNo')
->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO') ->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
->join('t_supplierdetailsn` sup', 'PO.SupplierID = sup.SupplierID') ->join('t_supplierdetailsn` sup', 'PO.SupplierID = sup.SupplierID')
->join('t_transporter` trans', 'igr.TransporterId = trans.id' , 'left') ->join('t_transporter` trans', 'igr.TransporterId = trans.id', 'left')
->join('t_materialmaster` item', 'igr_details.MaterialCode = item.MaterialCode' , 'left') ->join('t_materialmaster` item', 'igr_details.MaterialCode = item.MaterialCode', 'left')
->where('igr.IGRStatus !=', MRIR_CREATED) ->where('igr.IGRStatus !=', MRIR_CREATED)
->orderBy('igr.CreatedDate', 'desc'); ->orderBy('igr.CreatedDate', 'desc');
$query = $builder->get(); $query = $builder->get();
@ -391,7 +404,7 @@ class Inwardgateregister_model extends Model
return $result; return $result;
} }
function ViewigrListing($fromDate,$toDate) function ViewigrListing($fromDate, $toDate)
{ {
$subQuery1 = $this->db->table('t_igr_remarkes') $subQuery1 = $this->db->table('t_igr_remarkes')
->select('COUNT(id)') ->select('COUNT(id)')
@ -445,16 +458,15 @@ class Inwardgateregister_model extends Model
->join('t_igr_details IGRD', 'igr.IGRNo = IGRD.IGRNo') ->join('t_igr_details IGRD', 'igr.IGRNo = IGRD.IGRNo')
->where('igr.IGRStatus !=', MRIR_CREATED) ->where('igr.IGRStatus !=', MRIR_CREATED)
->groupBy('IGRD.IGRNo'); ->groupBy('IGRD.IGRNo');
if(session()->get('roleText') == 'Auditor'){ if (session()->get('roleText') == 'Auditor') {
$builder->where('Date(igr.DeliveryChellanDate) >=', "$fromDate") $builder->where('Date(igr.DeliveryChellanDate) >=', "$fromDate")
->where('Date(igr.DeliveryChellanDate) <=', "$toDate") ->where('Date(igr.DeliveryChellanDate) <=', "$toDate")
->orderBy('igr.DeliveryChellanDate', 'desc'); ->orderBy('igr.DeliveryChellanDate', 'desc');
}else{ } else {
$builder->where('Date(igr.CreatedDate) >=', "$fromDate") $builder->where('Date(igr.CreatedDate) >=', "$fromDate")
->where('Date(igr.CreatedDate) <=', "$toDate") ->where('Date(igr.CreatedDate) <=', "$toDate")
->orderBy('igr.CreatedDate', 'desc'); ->orderBy('igr.CreatedDate', 'desc');
} }
@ -501,18 +513,18 @@ class Inwardgateregister_model extends Model
// $query2 = $builder2->get(); // $query2 = $builder2->get();
// $result2 = $query2->getResult(); // $result2 = $query2->getResult();
// echo $this->db->getLastQuery()->getQuery();die; // echo $this->db->getLastQuery()->getQuery();die;
return [$result,[]]; return [$result, []];
} }
function customViewigrListing($fromDate,$toDate) function customViewigrListing($fromDate, $toDate)
{ {
$builder = $this->db->table('t_igr_master igr') $builder = $this->db->table('t_igr_master igr')
->select('igr.*,PO.IsOpenOrder,PO.DeliveryDate,sup.SupplierName,PO.POType,trans.name as TransporterName , SUM(IGRD.QuantityAsPerInvoice) as ReceivedQuantity, SUM(IGRD.NetWeight) as NetWeight , count(IGRD.IGRNo) as itemCount') ->select('igr.*,PO.IsOpenOrder,PO.DeliveryDate,sup.SupplierName,PO.POType,trans.name as TransporterName , SUM(IGRD.QuantityAsPerInvoice) as ReceivedQuantity, SUM(IGRD.NetWeight) as NetWeight , count(IGRD.IGRNo) as itemCount')
->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO') ->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
->join('t_supplierdetailsn sup', 'PO.SupplierID = sup.SupplierID') ->join('t_supplierdetailsn sup', 'PO.SupplierID = sup.SupplierID')
->join('t_transporter trans', 'igr.TransporterId = trans.id' , 'left') ->join('t_transporter trans', 'igr.TransporterId = trans.id', 'left')
->join('t_igr_details IGRD', 'igr.IGRNo = IGRD.IGRNo') ->join('t_igr_details IGRD', 'igr.IGRNo = IGRD.IGRNo')
->where('igr.IGRStatus !=', MRIR_CREATED) ->where('igr.IGRStatus !=', MRIR_CREATED)
->groupStart() ->groupStart()
@ -533,14 +545,14 @@ class Inwardgateregister_model extends Model
->join('t_igr_master igr', 'igr_details.IGRNo = igr.IGRNo') ->join('t_igr_master igr', 'igr_details.IGRNo = igr.IGRNo')
->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO') ->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
->join('t_supplierdetailsn sup', 'PO.SupplierID = sup.SupplierID') ->join('t_supplierdetailsn sup', 'PO.SupplierID = sup.SupplierID')
->join('t_transporter trans', 'igr.TransporterId = trans.id' , 'left') ->join('t_transporter trans', 'igr.TransporterId = trans.id', 'left')
->join('t_materialmaster` item', 'igr_details.MaterialCode = item.MaterialCode' , 'left') ->join('t_materialmaster` item', 'igr_details.MaterialCode = item.MaterialCode', 'left')
->where('igr.IGRStatus !=', MRIR_CREATED) ->where('igr.IGRStatus !=', MRIR_CREATED)
->orderBy('igr.CreatedDate', 'desc'); ->orderBy('igr.CreatedDate', 'desc');
$query2 = $builder2->get(); $query2 = $builder2->get();
$result2 = $query2->getResult(); $result2 = $query2->getResult();
// echo $this->db->getLastQuery()->getQuery();die; // echo $this->db->getLastQuery()->getQuery();die;
return [$result,$result2]; return [$result, $result2];
} }
@ -571,10 +583,10 @@ class Inwardgateregister_model extends Model
->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 ')
->join('t_supplierdetailsn sup', 'sup.SupplierID = POM.SupplierID') ->join('t_supplierdetailsn sup', 'sup.SupplierID = POM.SupplierID')
->join('t_materialmaster MM', 'MM.MaterialCode = igrd.MaterialCode') ->join('t_materialmaster MM', 'MM.MaterialCode = igrd.MaterialCode')
->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') ->join('t_configdetails cd', 'cd.key = MM.Category', 'left')
->where('igr.IGRNO', $IGRNO); ->where('igr.IGRNO', $IGRNO);
$query = $builder->get(); $query = $builder->get();
@ -629,7 +641,7 @@ class Inwardgateregister_model extends Model
} }
} }
function UpdatePOMaster($PONO, $updatedBy,$IGRStatus) function UpdatePOMaster($PONO, $updatedBy, $IGRStatus)
{ {
$builder = $this->db->table('t_purchaseorder_lineitem')->select('*') $builder = $this->db->table('t_purchaseorder_lineitem')->select('*')
@ -1065,7 +1077,8 @@ class Inwardgateregister_model extends Model
$r = $this->db->affectedRows(); $r = $this->db->affectedRows();
return $r; return $r;
} }
function updateIGRLineItem($igrlineitemarr, $IGRitemNo){ function updateIGRLineItem($igrlineitemarr, $IGRitemNo)
{
$this->db->table('t_igr_details') $this->db->table('t_igr_details')
->where('IGRItemNo', $IGRitemNo) ->where('IGRItemNo', $IGRitemNo)
->update($igrlineitemarr); ->update($igrlineitemarr);
@ -1119,7 +1132,6 @@ class Inwardgateregister_model extends Model
$query = $builder->get(); $query = $builder->get();
$result = $query->getResult(); $result = $query->getResult();
return $result; return $result;
} }
public function isFileExistsInIGRmaster($filename) public function isFileExistsInIGRmaster($filename)
{ {
@ -1146,8 +1158,6 @@ class Inwardgateregister_model extends Model
$query = $builder->get(); $query = $builder->get();
$result = $query->getResult(); $result = $query->getResult();
return $result; return $result;
} }
public function getAllIgrFileDetails($igrno) public function getAllIgrFileDetails($igrno)
@ -1191,10 +1201,16 @@ class Inwardgateregister_model extends Model
return $result; return $result;
} }
public function findIgrDetailsForIncomingSilicaSand($materialCodes, $month ,$remark) public function findIgrDetailsForIncomingSilicaSand($materialCodes, $month, $remark)
{ {
$builder = $this->db->table('t_igr_details')
->select( $month = new \DateTime($month . "-01"); // Create DateTime for the first day of the month
$builder = $this->db->table('t_igr_details');
$builder->select(
't_igr_details.IGRNO, 't_igr_details.IGRNO,
t_igr_details.MaterialCode, t_igr_details.MaterialCode,
igrMast.DeliveryChellanOrInvoiceNo as invoiceNo, igrMast.DeliveryChellanOrInvoiceNo as invoiceNo,
@ -1202,34 +1218,42 @@ class Inwardgateregister_model extends Model
igrMast.MaterialRcvdDate as materialRecievedDate, igrMast.MaterialRcvdDate as materialRecievedDate,
igrMast.VehicleNo, igrMast.VehicleNo,
supplierDetails.SupplierName, supplierDetails.SupplierName,
cd.ConfigValue 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) );
->where('t_igr_details.QuantityAsPerInvoice <>', 0)
->like('t_igr_details.CreatedDate', $month, 'after');
// remark needed for those who selected any remark.
$builder->join('t_igr_master igrMast', 'igrMast.IGRNO = t_igr_details.IGRNO');
$builder->join('t_incomingsilicasanddetails issd', 'issd.igrNo_fk = t_igr_details.IGRNO AND issd.materialCode = t_igr_details.MaterialCode', 'left');
$builder->join('t_materialmaster materialMaster', 'materialMaster.MaterialCode = t_igr_details.MaterialCode');
$builder->join('t_configdetails cd', 'cd.key = materialMaster.Category', 'left');
$builder->join('t_purchaseorder_master poMaster', 'poMaster.PONO = igrMast.PONO', 'left');
$builder->join('t_supplierdetailsn supplierDetails', 'supplierDetails.SupplierID = poMaster.SupplierID', 'left');
$builder->where('Date(t_igr_details.CreatedDate) >=', $month->format('Y-m-01 00:00:00'));
$builder->where('Date(t_igr_details.CreatedDate) <=', $month->format('Y-m-t 23:59:59'));
$builder->whereIn('t_igr_details.MaterialCode', $materialCodes);
$builder->where('t_igr_details.QuantityAsPerInvoice <>', 0);
// Conditional WHERE clause for remark
if ($remark != "noRemark") { if ($remark != "noRemark") {
$builder->where('issd.remark', $remark); $builder->where('issd.remark', $remark);
} }
$builder->groupBy('t_igr_details.IGRNO, t_igr_details.MaterialCode')
->join('t_igr_master igrMast', 'igrMast.IGRNO = t_igr_details.IGRNO') $builder->groupBy('t_igr_details.IGRNO, t_igr_details.MaterialCode');
->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') $builder->orderBy('t_igr_details.CreatedDate', 'asc ');
->join('t_configdetails cd','cd.key = materialMaster.Category','left')
->join('t_purchaseorder_master poMaster', 'poMaster.PONO = igrMast.PONO', 'left')
->join('t_supplierdetailsn supplierDetails', 'supplierDetails.SupplierID = poMaster.SupplierID', 'left')
->orderBy('t_igr_details.CreatedDate', 'asc ');
$query = $builder->get(); $query = $builder->get();
$result = $query->getResultArray();
return $result; return $query->getResultArray();
} }
public function getHistoryDetailsforEmail($igr){ public function getHistoryDetailsforEmail($igr)
{
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$to = date('Y-m-d H:i:s', strtotime($date . ' +30 seconds')); $to = date('Y-m-d H:i:s', strtotime($date . ' +30 seconds'));
$from = date('Y-m-d H:i:s', strtotime($date . ' -30 seconds')); $from = date('Y-m-d H:i:s', strtotime($date . ' -30 seconds'));
@ -1239,12 +1263,12 @@ class Inwardgateregister_model extends Model
from t_igr_history from t_igr_history
LEFT JOIN tbl_users ON tbl_users.userId = t_igr_history.by LEFT JOIN tbl_users ON tbl_users.userId = t_igr_history.by
LEFT JOIN t_employee_details ON tbl_users.EmpID = t_employee_details.EmpID LEFT JOIN t_employee_details ON tbl_users.EmpID = t_employee_details.EmpID
where is_add = 1 and IGR_No = '".$igr."'"); where is_add = 1 and IGR_No = '" . $igr . "'");
$first_line = $query3->getRow(); $first_line = $query3->getRow();
// 392 po // 392 po
$builder = $this->db->table('t_igr_history') $builder = $this->db->table('t_igr_history')
->select(' ->select('
t_igr_history.id, t_igr_history.id,
t_igr_history.field, t_igr_history.field,
@ -1282,13 +1306,13 @@ $builder = $this->db->table('t_igr_history')
') ')
// ->join('t_igr_details IGRD', 'IGRD.IGRItemNo = t_igr_history.IGRItem_No','left') // ->join('t_igr_details IGRD', 'IGRD.IGRItemNo = t_igr_history.IGRItem_No','left')
// ->join('t_materialmaster MM','MM.MaterialCode = IGRD.MaterialCode','left') // ->join('t_materialmaster MM','MM.MaterialCode = IGRD.MaterialCode','left')
->join('tbl_users', 'tbl_users.userId = t_igr_history.by','left') ->join('tbl_users', 'tbl_users.userId = t_igr_history.by', 'left')
->join('t_employee_details','tbl_users.EmpID = t_employee_details.EmpID','left') ->join('t_employee_details', 'tbl_users.EmpID = t_employee_details.EmpID', 'left')
->join('t_igr_details', 'CONVERT(t_igr_history.IGRItem_No USING utf8) = CONVERT(t_igr_details.IGRItemNo USING utf8)', 'left') ->join('t_igr_details', 'CONVERT(t_igr_history.IGRItem_No USING utf8) = CONVERT(t_igr_details.IGRItemNo USING utf8)', 'left')
->join('t_materialmaster', 'CONVERT(t_materialmaster.MaterialCode USING utf8) = CONVERT(t_igr_details.MaterialCode USING utf8)', 'left') ->join('t_materialmaster', 'CONVERT(t_materialmaster.MaterialCode USING utf8) = CONVERT(t_igr_details.MaterialCode USING utf8)', 'left')
->where('CONVERT(t_igr_history.IGR_No USING utf8)', $igr) ->where('CONVERT(t_igr_history.IGR_No USING utf8)', $igr)
->where('t_igr_history.is_edit', 1) ->where('t_igr_history.is_edit', 1)
->where('t_igr_history.history_dated BETWEEN "'.$from.'" AND "'.$to.'"'); ->where('t_igr_history.history_dated BETWEEN "' . $from . '" AND "' . $to . '"');
$query = $builder->get(); $query = $builder->get();
$result = $query->getResult(); $result = $query->getResult();
@ -1296,36 +1320,47 @@ $builder = $this->db->table('t_igr_history')
// echo $this->db->getLastQuery()->getQuery(); die; // echo $this->db->getLastQuery()->getQuery(); die;
return [ return [
'history' => $result, 'history' => $result,
'first_line' => $first_line ? $first_line->IGR_No ." was Created by ". $first_line->history_by ." on ". $first_line->indian_date ." at ". $first_line->indian_time : null, 'first_line' => $first_line ? $first_line->IGR_No . " was Created by " . $first_line->history_by . " on " . $first_line->indian_date . " at " . $first_line->indian_time : null,
]; ];
} }
public function getDetailsforEmail($userId,$roleId) public function getDetailsforEmail($userId, $roleId)
{ {
$query0 = $this->db->query(" $query0 = $this->db->query("
SELECT CompanyName,EmailAddress SELECT CompanyName,EmailAddress
FROM t_company_details"); FROM t_company_details");
$company = $query0->getRow(); $company = $query0->getRow();
$query1 = $this->db->query(" $query1 = $this->db->query(
"
SELECT CONCAT_WS(' ', t_employee_details.FirstName, t_employee_details.LastName) AS FullName SELECT CONCAT_WS(' ', t_employee_details.FirstName, t_employee_details.LastName) AS FullName
FROM tbl_users FROM tbl_users
LEFT JOIN t_employee_details ON tbl_users.EmpID = t_employee_details.EmpID LEFT JOIN t_employee_details ON tbl_users.EmpID = t_employee_details.EmpID
WHERE tbl_users.userId = ?", [$userId] WHERE tbl_users.userId = ?",
[$userId]
); );
$fullName = $query1->getRow(); $fullName = $query1->getRow();
$query2 = $this->db->query(" $query2 = $this->db->query(
"
SELECT email FROM tbl_users SELECT email FROM tbl_users
WHERE isDeleted = 0 AND roleId =".$roleId // hardcoded because auditor role only. refer with gwm 29/01/2025 WHERE isDeleted = 0 AND roleId =" . $roleId
); );
$emails = $query2->getResult(); $to_mails = $query2->getResult();
$query3 = $this->db->query(
"
SELECT email FROM tbl_users
WHERE isDeleted = 0 AND userId =" . $userId
);
$from_mails = $query3->getRow();
return [ return [
'from_mail' => $company ? $company->EmailAddress : null,
'full_name' => $fullName ? $fullName->FullName : null,
'company' => $company ? $company->CompanyName : null, 'company' => $company ? $company->CompanyName : null,
'emails' => $emails 'company_mail' => $company ? $company->EmailAddress : null,
'full_name' => $fullName ? $fullName->FullName : null,
'from_mails' => $from_mails ? $from_mails->email : null,
'to_mails' => $to_mails,
]; ];
} }
@ -1340,17 +1375,19 @@ $builder = $this->db->table('t_igr_history')
return $result; return $result;
} }
public function getigrstatus($IGRNo){ public function getigrstatus($IGRNo)
{
$builder = $this->db->table('t_igr_master') $builder = $this->db->table('t_igr_master')
->select('IGRStatus') ->select('IGRStatus')
->where('IGRNO',$IGRNo) ->where('IGRNO', $IGRNo)
->get(); ->get();
$result = $builder->getRow(); $result = $builder->getRow();
return $result; return $result;
} }
public function get_status($value){ public function get_status($value)
{
$builder = $this->db->table('t_status') $builder = $this->db->table('t_status')
->select('StatusCode,StatusName') ->select('StatusCode,StatusName')
->where('StatusCode', $value); ->where('StatusCode', $value);
@ -1361,7 +1398,8 @@ $builder = $this->db->table('t_igr_history')
return $StatusName; return $StatusName;
} }
public function get_TransporterId($value){ public function get_TransporterId($value)
{
$builder = $this->db->table('t_transporter') $builder = $this->db->table('t_transporter')
->select('id,name') ->select('id,name')
->where('id', $value); ->where('id', $value);
@ -1372,5 +1410,109 @@ $builder = $this->db->table('t_igr_history')
return $transportername; return $transportername;
} }
//Mcat -materialCategory
public function getIgrDetailsListByMcatGas($gasMaterialCodes, $gas_status)
{
switch ($gas_status) {
case "gas_entered":
$builder = $this->db->table('t_igr_details as t_igrd')
->select("
t_igrd.IGRNO as IGRNO-,
(t_igrd.QuantityAsPerInvoice) as gasCylinderCount,
t_sd.SupplierName,
t_igrm.*,
t_mm.MaterialName,
t_gsd.*
")
->join('t_igr_master t_igrm', 't_igrm.IGRNO = t_igrd.IGRNO')
->join('t_purchaseorder_master t_pom', 't_igrm.PONO = t_pom.PONO', 'left')
->join('t_supplierdetailsn t_sd', 't_sd.SupplierID = t_pom.SupplierID')
->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', 'left')
->join('t_materialmaster t_mm', 't_mm.MaterialCode = t_igrd.MaterialCode', 'left')
->whereIn('t_igrd.MaterialCode', $gasMaterialCodes)
->where("DATE(t_igrd.CreatedDate) >= '2025-04-01' ")
->where('t_gsd.gas_cylinder_status IS NULL');
break;
case "gas_pending":
$builder = $this->db->table('t_igr_details as t_igrd')
->select("
t_igrd.IGRNO as IGRNO-,
(t_igrd.QuantityAsPerInvoice) as gasCylinderCount,
t_sd.SupplierName,
t_igrm.*,
t_mm.MaterialName,
t_gsd.*
")
->join('t_igr_master t_igrm', 't_igrm.IGRNO = t_igrd.IGRNO')
->join('t_purchaseorder_master t_pom', 't_igrm.PONO = t_pom.PONO', 'left')
->join('t_supplierdetailsn t_sd', 't_sd.SupplierID = t_pom.SupplierID')
->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', 'left')
->join('t_materialmaster t_mm', 't_mm.MaterialCode = t_igrd.MaterialCode', 'left')
->whereIn('t_igrd.MaterialCode', $gasMaterialCodes)
->where("DATE(t_igrd.CreatedDate) >= '2025-04-01' ")
->where('t_gsd.gas_cylinder_status', 'gas_pending');
break;
case "gas_returned":
$builder = $this->db->table('t_igr_details as t_igrd')
->select("
t_igrd.IGRNO as IGRNO-,
(t_igrd.QuantityAsPerInvoice) as gasCylinderCount,
t_sd.SupplierName,
t_igrm.*,
t_mm.MaterialName,
t_gsd.*,
SUM(t_gsd.grossWeight) as grossWeight,
SUM(t_gsd.tareWeight) as tareWeight,
SUM(t_gsd.netWeight) as netWeight,
SUM(t_gsd.actualWeight) as actualWeight,
SUM(t_gsd.shortage) as shortage,
Count(t_gsd.gas_cylinder_status) as gasCylinderCompletedCount,
(t_igrd.QuantityAsPerInvoice - Count(t_gsd.gas_cylinder_status)) as gasCylinderPendingCount
")
->join('t_igr_master t_igrm', 't_igrm.IGRNO = t_igrd.IGRNO')
->join('t_purchaseorder_master t_pom', 't_igrm.PONO = t_pom.PONO', 'left')
->join('t_supplierdetailsn t_sd', 't_sd.SupplierID = t_pom.SupplierID')
->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', 'left')
->join('t_materialmaster t_mm', 't_mm.MaterialCode = t_igrd.MaterialCode', 'left')
->whereIn('t_igrd.MaterialCode', $gasMaterialCodes)
->where("DATE(t_igrd.CreatedDate) >= '2025-04-01' ")
->where('t_gsd.gas_cylinder_status', 'gas_returned')
->groupBy('t_igrd.IGRNO');
break;
}
$result = $builder->get()->getResultArray();
return $result;
}
} }

View File

@ -72,6 +72,8 @@ class Monthlypay_model extends Model
->orderBy('EmpID', 'asc'); ->orderBy('EmpID', 'asc');
$query = $builder->get(); $query = $builder->get();
$result = $query->getResult(); $result = $query->getResult();
// $last_query = $this->db->getLastQuery();
// echo $last_query;die;
return $result; return $result;
} }
@ -177,6 +179,8 @@ class Monthlypay_model extends Model
$year_val = date('Y', strtotime($current)); $year_val = date('Y', strtotime($current));
$date_val = cal_days_in_month(CAL_GREGORIAN, $month_val, $year_val); $date_val = cal_days_in_month(CAL_GREGORIAN, $month_val, $year_val);
$lastdate = $year_val . '-' . $month_val . '-' . $date_val; $lastdate = $year_val . '-' . $month_val . '-' . $date_val;
// echo $current;
// echo "last date - ".$lastdate;die;
$builder = $this->db->table('t_attendance') $builder = $this->db->table('t_attendance')
->select('t_attendance.*,t_employee_details.FirstName,t_employee_details.LastName') ->select('t_attendance.*,t_employee_details.FirstName,t_employee_details.LastName')
@ -191,6 +195,8 @@ class Monthlypay_model extends Model
$query = $builder->get(); $query = $builder->get();
$result = $query->getResult(); $result = $query->getResult();
// $last_query = $this->db->getLastQuery();
// echo $last_query;die;
return $result; return $result;
} }
@ -571,6 +577,26 @@ where Month_Year = ? and att.EmpID in (select EmpID from t_attendance)";
return $this->db->affectedRows(); return $this->db->affectedRows();
} }
} }
public function validateDateRange($emp_id,$start_date,$end_date){
$array = $this->db->table('t_employee_leave_application_form')
->where('emp_id', $emp_id)
->where('status', 'Approved')
->groupStart() // Start grouping OR conditions
->where("'$start_date' BETWEEN start_date AND end_date", null, false)
->orWhere("'$end_date' BETWEEN start_date AND end_date", null, false)
->orWhere("start_date BETWEEN '$start_date' AND '$end_date'", null, false)
->orWhere("end_date BETWEEN '$start_date' AND '$end_date'", null, false)
->groupEnd() // End grouping
->get()
->getRowArray();
// $last_query = $this->db->getLastQuery();
// echo $last_query;
return $array;
}
function getEmpPayDetailsforOTListing($current = "") function getEmpPayDetailsforOTListing($current = "")
{ {
@ -617,5 +643,25 @@ where Month_Year = ? and att.EmpID in (select EmpID from t_attendance)";
return $query->getResult(); return $query->getResult();
} }
function employeeLeaveDates($current){
$current =get_date_time_dynamical_format('m-Y','Y-m',"$current");
$array = $this->db->table('t_employee_leave_application_form')
->select("emp_id,start_date,end_date,status")
->where('status', 'Approved')
->groupStart() // Start grouping OR conditions
->where("DATE_FORMAT(start_date, '%Y-%m') = '$current'", null, false)
->orWhere("DATE_FORMAT(end_date, '%Y-%m') = '$current'", null, false)
->orWhere("DATE_FORMAT(start_date, '%Y-%m') <= '$current' AND DATE_FORMAT(end_date, '%Y-%m') >= '$current'", null, false)
->groupEnd() // End grouping
->get()
->getResultArray();
// $last_query = $this->db->getLastQuery();
// echo $last_query;
return $array;
// return [$current];
}
} }

View File

@ -232,6 +232,18 @@ class Rawmaterialdetails_model extends Model
} }
function getAllGasMaterialCode(){
$builder = $this->db->table('t_materialmaster')
->select('MaterialCode')
->where('Category', '334')
->orderBy('MaterialCode', 'asc');
$query = $builder->get();
$materialResults = $query->getResultArray();
return $materialResults;
}
function getMaterialstock($MaterialCode, $currentdate) function getMaterialstock($MaterialCode, $currentdate)

View File

@ -1252,11 +1252,13 @@ if (!empty($getlogpodtl)) {
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-12 text-right"> <div class="form-group col-md-12 text-right">
<?php if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == REQITEM_Emergency_PO_CREATED) { ?> <?php if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
<?php if ($PONOStatus == REQITEM_Emergency_PO_CREATED) { ?> <?php if($isChecked){ // if ($PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
<input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1" <?php echo $isChecked ? 'checked' : ''; ?>> IS THIS OPEN ORDER FORMAT <input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1" <?php echo $isChecked ? 'checked' : ''; ?>> IS THIS OPEN ORDER FORMAT
<?php } ?> <?php } ?>
<?php if(!$isChecked){ ?>
<a data-toggle="modal"><button type="submit" onclick="myFunction();" class="btn btn-success" id="abcd">Select Line Item</button> </a> <a data-toggle="modal"><button type="submit" onclick="myFunction();" class="btn btn-success" id="abcd">Select Line Item</button> </a>
<?php } ?> <?php } ?>
<?php } ?>
</div> </div>
</div> </div>
@ -1504,34 +1506,37 @@ if (!empty($getlogpodtl)) {
<div class="form-row "> <div class="form-row ">
<div class="form-group col-md-12" id="splpodiv"> <div class="form-group col-md-12" id="splpodiv">
<label>Special po Table List</label> <div class="form-row">
<table id="table2" class="table table-striped table-hover mb-0" style="font-size:12px;"> <div class="col-md-5 text-left">
<label class="mt-2">Special po Table List</label>
<div class="form-group col-md-12">
<div class="col-md-offset-10 col-md-8">
<button type="button" class="btn btn-success" id="addmorebutton">ADD FILES</button>
</div> </div>
<div class="col-md-7 text-right">
<button type="button" class="btn btn-success btn-sm" id="addmorebutton">ADD FILES</button>
</div>
</div>
<div class="col-md-12" style="text-align:right">
<div id="newdiv"></div> <div id="newdiv"></div>
<input type="hidden" name="hidecounter" id="hidecounter" value="0" /> <input type="hidden" name="hidecounter" id="hidecounter" value="0" />
<input type="hidden" name="hideconstant" id="hideconstant" value="0" /> <input type="hidden" name="hideconstant" id="hideconstant" value="0" />
</div> </div>
<table id="table2" class="table table-striped table-hover mb-0" style="font-size: 12px;border-collapse: collapse;margin: auto;width: 60%;">
<thead> <thead>
<tr> <tr>
<th>Bill No </th> <th>Bill No </th>
<!-- <th>Materials</th> --> <!-- <th>Materials</th> -->
<!-- <th>Delivery Challan No</th> --> <!-- <th>Delivery Challan No</th> -->
<!-- <th>Delivery Challan Date</th> <!-- <th>Delivery Challan Date</th> -->
<th>Vehicle No</th> <!-- <th>Vehicle No</th> -->
<th>Courier No</th> --> <!-- <th>Courier No</th> -->
<!-- <th>Quantity</th> --> <!-- <th>Quantity</th> -->
<th>File</th> <th>File</th>
<th>Action</th> <th>Action</th>
</tr> </tr>
</thead> </thead>
@ -1547,7 +1552,9 @@ if (!empty($getlogpodtl)) {
<input type="hidden" id="billnos<?= $row ?>" value="<?= $gd->BillNo ?>"> <input type="hidden" id="billnos<?= $row ?>" value="<?= $gd->BillNo ?>">
<input type="hidden" id="file<?= $row ?>" value="<?= $gd->FilePath ?>"> <input type="hidden" id="file<?= $row ?>" value="<?= $gd->FilePath ?>">
<td><?php echo (!empty($gd->FilePath)) ? $gd->FilePath : "No File"; ?></td> <td><?php echo (!empty($gd->FilePath)) ? $gd->FilePath : "No File"; ?></td>
<td><span onclick="openmodel(<?= $row ?>);"><i class="ri-pencil-fill" data-toggle="tooltip" title="Click here to Edit the Revenue SplPO details"></i></span> <td><a href="javascript:void(0);" onclick="openmodel(<?= $row ?>);" data-toggle="tooltip" title="Click here to Edit the Special PO details">
<i class="ri-pencil-fill"></i>
</a>&nbsp;&nbsp;&nbsp;
<?php if (!empty($gd->FilePath)) { ?> <?php if (!empty($gd->FilePath)) { ?>
<a target="_blank" href="<?php echo base_url() . 'public/uploads/BillFiles/' ?><?php echo $gd->FilePath ?>"><i class="fa fa-download"></i></a> <a target="_blank" href="<?php echo base_url() . 'public/uploads/BillFiles/' ?><?php echo $gd->FilePath ?>"><i class="fa fa-download"></i></a>
<?php } ?> <?php } ?>
@ -1561,6 +1568,7 @@ if (!empty($getlogpodtl)) {
</table> </table>
</div> </div>
<!-- update if condition here -->
<?php if (!empty($update)) { ?> <?php if (!empty($update)) { ?>
<!-- <div class="form-group col-md-12" id="editpodiv"> <!-- <div class="form-group col-md-12" id="editpodiv">
<div class="form-group col-md-12"><label>Editable POScreen</label> <div class="form-group col-md-12"><label>Editable POScreen</label>
@ -1592,7 +1600,6 @@ if (!empty($getlogpodtl)) {
$inde = $inde + 1; $inde = $inde + 1;
?> ?>
<tr id="<?php echo $inde; ?>"> <tr id="<?php echo $inde; ?>">
<td><?php echo $inde; ?></td> <td><?php echo $inde; ?></td>
<td><?php echo $oldpo->PONO ?></td> <td><?php echo $oldpo->PONO ?></td>
@ -1633,7 +1640,8 @@ if (!empty($getlogpodtl)) {
</tbody> </tbody>
</table> </table>
</div> </div>
</div>--> <?php } else {} ?> </div>-->
<?php } else {} ?>
<!-- ends here --> <!-- ends here -->
<!-- f i l e c h o o s e n --> <!-- f i l e c h o o s e n -->
@ -1715,10 +1723,9 @@ if (!empty($getlogpodtl)) {
</div> </div>
<!--/. f o o t e r b u t t o n --> <!--/. f o o t e r b u t t o n -->
</div> </div>
</div> <!-- end card body--> </div> <!-- end card body-->
</div> <!-- end card --> </div> <!-- end card -->
</div><!-- end col--> </div><!-- end col @945-->
</div><!-- end form row --> </div><!-- end form row -->
</div> <!-- end container-fluid --> </div> <!-- end container-fluid -->
</div> <!-- end content --> </div> <!-- end content -->
@ -1895,7 +1902,7 @@ if (!empty($getlogpodtl)) {
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<?php <?php
$data = array('name' => 'AfterSgst', 'value' => set_value('AfterSgst'), 'id' => 'AfterSgst', 'class' => 'form-control num', 'placeholder' => 'After SGST'); $data = array('name' => 'AfterSgst', 'value' => set_value('AfterSgst'), 'id' => 'AfterSgst', 'class' => 'form-control num', 'placeholder' => 'After SGST', 'readonly' => 'true');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
@ -1969,26 +1976,25 @@ if (!empty($getlogpodtl)) {
<!-- Service Special PO Modal Starts Here --> <!-- Service Special PO Modal Starts Here -->
<div id="EditServiceSplPOModel" class="modal fade" tabindex="-1" role="dialog" <div id="EditServiceSplPOModel" 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;">
<div class="modal-dialog modal-full-width"> <div class="modal-dialog"><!-- class="modal-dialog modal-full-width" -->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Update Bill <span id="bill"><span> Details</h4> <h4 class="modal-title" id="bill-title">Update Bill</h4>
<button type="button" class="close" data-dismiss="modal" <button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button> aria-hidden="true">×</button>
</div> </div>
<form class="tagForm" id="tag-form" method="post" enctype="multipart/form-data"> <form class="tagForm" id="tag-form" method="post" enctype="multipart/form-data">
<div class="modal-body p-4"> <div class="modal-body">
<div class="form-group col-md-12"> <div class="col-md-12">
<div class="form-group col-md-5"> <span><label for="images">Select file </label><small>&nbsp;&nbsp;(only .pdf,.excel,.doc,.png,.jpg)</small></span><br>
<label for="oldimagename">Old file Name :<div class="oldimage"></div></label>
<input type="file" size="20" input accept=".docx,.pdf,.doc.JPG,.PNG,.jpg" id="imag" name="images" onChange="filecheck();" /> <input type="file" size="20" input accept=".docx,.pdf,.doc.JPG,.PNG,.jpg" id="imag" name="images" onChange="filecheck();" />
<label for="images">Select file <br /><small>(only .pdf,.excel,.doc,.png,.jpg)</small></label> <label class="oldimage mt-2"></label>
</div>
</div> </div>
<input type="hidden" name="hideoldfile" id="hideoldfile" class="form-control" readonly> <input type="hidden" name="hideoldfile" id="hideoldfile" class="form-control" readonly>
<input type="hidden" name="hidebillno" id="hidebillno" class="form-control" readonly> <input type="hidden" name="hidebillno" id="hidebillno" class="form-control" readonly>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary waves-effect" <button type="button" class="btn btn-secondary waves-effect"
data-dismiss="modal" value="Cancel" onclick="SetExciseCalculationCancel();">Cancel</button> data-dismiss="modal" value="Cancel" onclick="SetExciseCalculationCancel();">Cancel</button>
@ -2541,6 +2547,14 @@ if (!empty($getlogpodtl)) {
$('input[type="file"], input[type="radio"], input[type="checkbox"]').attr('disabled', true); $('input[type="file"], input[type="radio"], input[type="checkbox"]').attr('disabled', true);
$("#PaymentTerms,#drpSupplier,#insuranceStatus,#PoTypeOptions,#workstatus").prop("disabled", true); $("#PaymentTerms,#drpSupplier,#insuranceStatus,#PoTypeOptions,#workstatus").prop("disabled", true);
} }
var openOrder = <?php echo $IsOpenOrder; ?>;
if(openOrder){
$('#Quantity').val(0);
$('#Quantity').removeAttr('required');
$('#Quantity').attr('readonly', true);
$('#EditQuantity').removeAttr('required');
$('#EditQuantity').attr('readonly', true);
}
}); });
</script> </script>
@ -2731,10 +2745,11 @@ if (!empty($getlogpodtl)) {
var Billno = $("#billnos" + i).val(); var Billno = $("#billnos" + i).val();
//alert(Billno); //alert(Billno);
$("#EditServiceSplPOModel").modal("show"); $("#EditServiceSplPOModel").modal("show");
$(".oldimage").text(file); $(".oldimage").text("Previous Upload - "+file);
$("#hideoldfile").val(file); $("#hideoldfile").val(file);
$("#hidebillno").val(Billno); $("#hidebillno").val(Billno);
$("#bill").text(Billno); $("#bill-title").text("Update Bill Number - "+Billno);
} }
$('.EditService').click(function() { $('.EditService').click(function() {
tinyMCE.triggerSave(); tinyMCE.triggerSave();
@ -3085,7 +3100,7 @@ if (!empty($getlogpodtl)) {
} }
function validateServiceTax() { function validateServiceTax() {
var openOrder = $('#IsOpenOrder').prop('checked');
if ($('#ReqNo').val() == "0") { if ($('#ReqNo').val() == "0") {
alert('Please select the Requisition Number'); alert('Please select the Requisition Number');
$('#ReqNo').focus(); $('#ReqNo').focus();
@ -3098,7 +3113,14 @@ if (!empty($getlogpodtl)) {
alert('Please select the Material Code'); alert('Please select the Material Code');
$('#MaterialCode').focus(); $('#MaterialCode').focus();
return false; return false;
} else if ($('#Quantity').val() == '') { } else if ($('#txtSpcialInstruction').val() == '') {
alert('Please Enter the Service Description');
$('#txtSpcialInstruction').focus();
return false;
} else {
var openOrder = <?php echo $IsOpenOrder; ?>;
if(!openOrder){
if ($('#Quantity').val() == '') {
alert('Please Enter the Quantity value'); alert('Please Enter the Quantity value');
$('#Quantity').focus(); $('#Quantity').focus();
return false; return false;
@ -3116,21 +3138,21 @@ if (!empty($getlogpodtl)) {
return false; return false;
} else if (ExceedQuantityCheck() == false) { } else if (ExceedQuantityCheck() == false) {
return false; return false;
} else if ($('#txtSpcialInstruction').val() == '') {
alert('Please Enter the Service Description');
$('#txtSpcialInstruction').focus();
return false;
} else if (ExceedBudget($('#txtBasicValue').val(), $('#AvlBudAmt').val()) == false) { } else if (ExceedBudget($('#txtBasicValue').val(), $('#AvlBudAmt').val()) == false) {
$('#Rate').focus(); $('#Rate').focus();
return false; return false;
} else { } else{
return true; return true;
} }
}else{
return true;
}
}
} }
function validateEditServiceTax() { function validateEditServiceTax() {
var openOrder = $('#IsOpenOrder').prop('checked');
if ($('#EditCostCenter').val() == "0") { if ($('#EditCostCenter').val() == "0") {
alert('Please select the Cost center'); alert('Please select the Cost center');
$('#EditCostCenter').focus(); $('#EditCostCenter').focus();
@ -3139,7 +3161,9 @@ if (!empty($getlogpodtl)) {
alert('Please select the Material Code'); alert('Please select the Material Code');
$('#EditMaterialCode').focus(); $('#EditMaterialCode').focus();
return false; return false;
} else if ($('#EditQuantity').val() == '') { } else {
if(!openOrder){
if ($('#EditQuantity').val() == '') {
alert('Please Enter the Quantity value'); alert('Please Enter the Quantity value');
$('#EditQuantity').focus(); $('#EditQuantity').focus();
return false; return false;
@ -3164,8 +3188,8 @@ if (!empty($getlogpodtl)) {
} else if (ExceedBudget($('#txtEditBasicValue').val(), $('#EditAvlBudAmt').val()) == false) { } else if (ExceedBudget($('#txtEditBasicValue').val(), $('#EditAvlBudAmt').val()) == false) {
$('#EditRate').focus(); $('#EditRate').focus();
return false; return false;
} else { } else{ return true; }
return true; }else{return true; }
} }
} }
@ -3817,8 +3841,8 @@ if (!empty($getlogpodtl)) {
'<div class="form-group col">' + '<div class="form-group col">' +
'<label><br></label>' + '<label><br></label>' +
'<input type="file" name="browseFiles" id="images' + counter + '" onchange="Copyfilename(this.name); "><br>' + '<input type="file" name="browseFiles" id="images' + counter + '" onchange="Copyfilename(this.name); ">' +
'<button class="btn btn-success btn-sm add add_this" id="addbtn" onclick="addRow()">ADD</button>' '<button class="btn btn-success btn-sm add add_this ml-1" id="addbtn" onclick="addRow()">ADD</button>'
'</div>' + '</div>' +
'</div>' + '</div>' +
@ -3879,17 +3903,25 @@ if (!empty($getlogpodtl)) {
} }
} }
$('#IsOpenOrder').change(function() { $('#IsOpenOrder').change(function () {
if (this.checked) {
$('#ServiceQuantity').val(0);
$('#ServiceQuantity').removeAttr('required');
$('#ServiceQuantity').attr('readonly', true);
} else {
$('#ServiceQuantity').val('');
$('#ServiceQuantity').removeAttr('readonly');
$('#ServiceQuantity').attr('required', true);
// alert("IsOpenOrder");
if (this.checked) {
$('#Quantity').val(0);
$('#Quantity').removeAttr('required');
$('#Quantity').attr('readonly', true);
$('#EditQuantity').val(0);
$('#EditQuantity').removeAttr('required');
$('#EditQuantity').attr('readonly', true);
} else {
$('#Quantity').val('');
$('#Quantity').removeAttr('readonly');
$('#Quantity').attr('required', true);
$('#EditQuantity').val('');
$('#EditQuantity').removeAttr('readonly');
$('#EditQuantity').attr('required', true);
} }
}); });
function Reset() { location.reload(); } function Reset() { location.reload(); }
</script> </script>

View File

@ -1975,12 +1975,12 @@ if (!empty($INRSYMBOL)) {
} }
if (isChecked) { if (isChecked) {
if (PO == 'REVENUE') { if (POTy == 'REVENUE') {
//alert('normalemergency'); //alert('normalemergency');
$('#txtSpecial').val(0); $('#txtSpecial').val(0);
// $('#content').loader('show'); // $('#content').loader('show');
RevenueSave(1) RevenueSave(1)
} else if (PO == 'SERVICE') { } else if (POTy == 'SERVICE') {
///alert('normal SERVICE emergency'); ///alert('normal SERVICE emergency');
$('#txtSpecialservice').val(0); $('#txtSpecialservice').val(0);
Save(1) Save(1)
@ -8636,22 +8636,46 @@ if (!empty($INRSYMBOL)) {
$('#Quantity').val(0); $('#Quantity').val(0);
$('#Quantity').removeAttr('required'); $('#Quantity').removeAttr('required');
$('#Quantity').attr('readonly', true); $('#Quantity').attr('readonly', true);
$('#txtTotalOrderValue').val(0);
$('#txtBasicValue').val(0);
$('#EditRevenueQuantity').val(0);
$('#EditRevenueQuantity').removeAttr('required');
$('#EditRevenueQuantity').attr('readonly', true);
} }
if (input == 'SERVICE') { if (input == 'SERVICE') {
$('#ServiceQuantity').val(0); $('#ServiceQuantity').val(0);
$('#ServiceQuantity').removeAttr('required'); $('#ServiceQuantity').removeAttr('required');
$('#ServiceQuantity').attr('readonly', true); $('#ServiceQuantity').attr('readonly', true);
$('#ServiceBasAmt').val(0);
$('#TotalOrderValue').val(0);
$('#EditQuantity').val(0);
$('#EditQuantity').removeAttr('required');
$('#EditQuantity').attr('readonly', true);
} }
} else { } else {
if (input == 'REVENUE') { if (input == 'REVENUE') {
$('#Quantity').val(''); $('#Quantity').val('');
$('#Quantity').removeAttr('readonly'); $('#Quantity').removeAttr('readonly');
$('#Quantity').attr('required', true); $('#Quantity').attr('required', true);
$('#txtTotalOrderValue').val('');
$('#txtBasicValue').val('');
$('#EditRevenueQuantity').val(0);
$('#EditRevenueQuantity').removeAttr('readonly');
$('#EditRevenueQuantity').attr('required', true);
} }
if (input == 'SERVICE') { if (input == 'SERVICE') {
$('#ServiceQuantity').val(''); $('#ServiceQuantity').val('');
$('#ServiceQuantity').removeAttr('readonly'); $('#ServiceQuantity').removeAttr('readonly');
$('#ServiceQuantity').attr('required', true); $('#ServiceQuantity').attr('required', true);
$('#ServiceBasAmt').val('');
$('#TotalOrderValue').val('');
$('#EditQuantity').val(0);
$('#EditQuantity').removeAttr('readonly');
$('#EditQuantity').attr('required', true);
} }
} }
}); });

View File

@ -1,14 +1,11 @@
<
<?php <?php
$datefordropdown = format_date($datefordropdown, 0, 'M-Y'); $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
//echo $datefordropdown; //echo $datefordropdown;
$attendance = array_merge($attendance, $emppay); $attendance = array_merge($attendance, $emppay); // initial step there is no attendance entry so emppay data is merged
date_default_timezone_set('Asia/Kolkata'); date_default_timezone_set('Asia/Kolkata');
$currentday = date('d'); $currentday = date('d');
// print_r($attendance); // print_r($employeeleavedate);
// dd($attendance);die;
// echo "<br>------------------------------<br>"; // echo "<br>------------------------------<br>";
?> ?>
@ -284,8 +281,6 @@ $currentday = date('d');
<?php <?php
$testarray = array(); $testarray = array();
$finalarray = array(); $finalarray = array();
if (!empty($attendance)) { if (!empty($attendance)) {
@ -347,6 +342,7 @@ $currentday = date('d');
} }
} }
?> ?>
@ -397,6 +393,7 @@ $currentday = date('d');
</tr> </tr>
</thead> </thead>
<tbody style="background-color: #fff;"> <tbody style="background-color: #fff;">
<?php $index = 0; <?php $index = 0;
@ -416,6 +413,7 @@ $currentday = date('d');
<?php for ($col = 1; $col <= $monthdays; $col++) { <?php for ($col = 1; $col <= $monthdays; $col++) {
$flag = 0; $flag = 0;
$flag2 = 0; $flag2 = 0;
$absent = 0;
if ($col == $currentday) { if ($col == $currentday) {
$todayflag = 1; $todayflag = 1;
@ -443,9 +441,26 @@ $currentday = date('d');
$WH = 'WH' . $col; $WH = 'WH' . $col;
$OT = 'OT' . $col; $OT = 'OT' . $col;
foreach ($employeeleavedate as $eid => $absentdate){
if($a->EmpID == $eid){
foreach ($absentdate as $particulardate){
// echo " $eid particulardate = ".$particulardate ." col = ".$col;
if($col === $particulardate){
$absent = 1;
// echo "1) empid = $a->EmpID, date = $col, absent = $absent";
}// else $absent = 0;
}
}
}
// echo "<pre>"."empid = $a->EmpID, date = $col, absent = $absent"."</pre>";
// echo "<pre>"."2) all Flags : flag2 = $flag2, flag = $flag2, absent = $absent"."</pre>";
?> ?>
<td <?php if ($flag2 == 1) { ?> title=" <?php echo $title; ?> " <td <?php if ($flag2 == 1) { ?> title=" <?php echo $title; ?> "
<?php } else if ($flag == 1) { ?> title="sunday" <?php } ?> <?php } else if ($flag == 1) { ?> title="sunday" <?php } ?>
<?php if ($absent == 1) { ?> title="absent" <?php } ?>
class="celda_normal" class="celda_normal"
onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);" onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);"
id="<?php echo $row . 'row' . $col . 'W'; ?>" id="<?php echo $row . 'row' . $col . 'W'; ?>"
@ -454,7 +469,12 @@ $currentday = date('d');
} else if ($todayflag == 1) { } else if ($todayflag == 1) {
echo "style='background: #cef0ad ;'"; echo "style='background: #cef0ad ;'";
} ?> } ?>
contenteditable="true" tabindex="<?php echo $col; ?>"> <?php if ($absent == 1) {
echo "contenteditable='false'";
} else if ($absent == 0) {
echo "contenteditable='true'";
} ?>
tabindex="<?php echo $col; ?>">
<?php if (!empty($a->$WH)) { <?php if (!empty($a->$WH)) {
echo $a->$WH; echo $a->$WH;
} else { } else {
@ -462,6 +482,7 @@ $currentday = date('d');
} ?></td> } ?></td>
<td <?php if ($flag2 == 1) { ?> title=" <?php echo $title; ?> " <td <?php if ($flag2 == 1) { ?> title=" <?php echo $title; ?> "
<?php } else if ($flag == 1) { ?> title="sunday" <?php } ?> <?php } else if ($flag == 1) { ?> title="sunday" <?php } ?>
<?php if ($absent == 1) { ?> title="absent" <?php } ?>
class="celda_normal" class="celda_normal"
onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);" onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);"
id="<?php echo $row . 'row' . $col . 'OT'; ?>" id="<?php echo $row . 'row' . $col . 'OT'; ?>"
@ -470,7 +491,12 @@ $currentday = date('d');
} else if ($todayflag == 1) { } else if ($todayflag == 1) {
echo "style='background: #cef0ad ;'"; echo "style='background: #cef0ad ;'";
} ?> } ?>
contenteditable="true" tabindex="<?php echo $col; ?>"> <?php if ($absent == 1) {
echo "contenteditable='false'";
} else if ($absent == 0) {
echo "contenteditable='true'";
} ?>
tabindex="<?php echo $col; ?>">
<?php if (!empty($a->$OT)) { <?php if (!empty($a->$OT)) {
echo $a->$OT; echo $a->$OT;
} else { } else {

View File

@ -55,7 +55,7 @@
<td> <td>
<?php if($record->is_driver){ ?> <?php if($record->is_driver){ ?>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<a title="Trip Details" style="cursor:pointer;" href="<?= base_url() . 'loadDriverAttendance?drv_id=' . $record->EmpID; ?>"> <a class="tooltip-trigger" title="Click here to View <?php echo $record->FirstName; ?> Trip Details" style="cursor:pointer;" href="<?= base_url() . 'loadDriverAttendance?drv_id=' . $record->EmpID; ?>">
<i class="fa fa-truck"></i>&nbsp;&nbsp;&nbsp; <i class="fa fa-truck"></i>&nbsp;&nbsp;&nbsp;
</a> </a>
<?php } ?> <?php } ?>
@ -122,6 +122,7 @@
</div><!-- /.modal --> </div><!-- /.modal -->
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$('.tooltip-trigger').tooltip();
$("#ddwizard").on("shown.bs.modal", function (e) { $("#ddwizard").on("shown.bs.modal", function (e) {
var id = $(e.relatedTarget).data('id'); var id = $(e.relatedTarget).data('id');
var name = $(e.relatedTarget).data('name'); var name = $(e.relatedTarget).data('name');

View File

@ -175,6 +175,12 @@ if (!empty($POMaster)) {
$insurenceno = $Req->InsuranceNumber; $insurenceno = $Req->InsuranceNumber;
$BudgetType = $Req->BudgetType; $BudgetType = $Req->BudgetType;
$PrePOFile = $Req->POFile; $PrePOFile = $Req->POFile;
$IsOpenOrder = isset($Req->IsOpenOrder) ? $Req->IsOpenOrder : null;
if ($IsOpenOrder !== null && (int)$IsOpenOrder !== 0) {
$isChecked = true;
} else {
$isChecked = false;
}
} }
} }
@ -1293,6 +1299,15 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<br> <br>
<div class="form-row">
<?php if($isChecked){ // ($PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
<div class="form-group col-md-12 text-right">
<input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1" <?php echo $isChecked ? 'checked' : ''; ?>> IS THIS OPEN ORDER FORMAT
</div>
<?php } ?>
</div>
<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" style="font-size:12px;"> <table id="revenueTax" class="table table-bordered table-hover" style="font-size:12px;">
@ -2850,6 +2865,11 @@ if (!empty($INRSYMBOL)) {
<script> <script>
$(document).ready(function () { $(document).ready(function () {
var openOrder = <?php echo $IsOpenOrder; ?>;
if(openOrder){
$('#EditQuantity').removeAttr('required');
$('#EditQuantity').attr('readonly', true);
}
// When the second modal is about to be shown // When the second modal is about to be shown
$('#freightmodel').on('show.bs.modal', function () { $('#freightmodel').on('show.bs.modal', function () {
// Set a higher z-index for the second modal to appear on top // Set a higher z-index for the second modal to appear on top
@ -2865,5 +2885,18 @@ if (!empty($INRSYMBOL)) {
$('#freightmodel').css('z-index', ''); // Reset to default $('#freightmodel').css('z-index', ''); // Reset to default
}); });
}); });
$('#IsOpenOrder').change(function () {
// alert("IsOpenOrder");
if (this.checked) {
$('#EditQuantity').val(0);
$('#EditQuantity').removeAttr('required');
$('#EditQuantity').attr('readonly', true);
} else {
$('#EditQuantity').val('');
$('#EditQuantity').removeAttr('readonly');
$('#EditQuantity').attr('required', true);
}
});
function Reset() { location.reload(); } function Reset() { location.reload(); }
</script> </script>

View File

@ -233,6 +233,7 @@ if (!empty($POMaster)) {
$IsOpenOrder = isset($Req->IsOpenOrder) ? $Req->IsOpenOrder : null; $IsOpenOrder = isset($Req->IsOpenOrder) ? $Req->IsOpenOrder : null;
if ($IsOpenOrder !== null && (int) $IsOpenOrder !== 0) { if ($IsOpenOrder !== null && (int) $IsOpenOrder !== 0) {
$isChecked = true; $isChecked = true;
} else { } else {
@ -378,7 +379,14 @@ if (!empty($getlogpodtl)) {
var InsuranceNumber = '<?php echo $insurenceno; ?>'; var InsuranceNumber = '<?php echo $insurenceno; ?>';
var statuscheck = '<?php echo $PONOStatus; ?>'; var statuscheck = '<?php echo $PONOStatus; ?>';
$(document).ready(function () { $(document).ready(function () {
//alert('capital-'); var openOrder = <?php echo $IsOpenOrder; ?>;
if(openOrder){
$('#Quantity').val(0);
$('#Quantity').removeAttr('required');
$('#Quantity').attr('readonly', true);
$('#EditQuantity').removeAttr('required');
$('#EditQuantity').attr('readonly', true);
}
if (statuscheck == "<?php echo SPECIAL_PO; ?>") { if (statuscheck == "<?php echo SPECIAL_PO; ?>") {
$('#splpodiv').show(); $('#splpodiv').show();
// var js_array =<?php echo json_encode($billfile); ?>; // var js_array =<?php echo json_encode($billfile); ?>;
@ -2346,14 +2354,14 @@ if (!empty($getlogpodtl)) {
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-12" align="right"> <div class="form-group col-md-12" align="right">
<?php if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == REQITEM_Emergency_PO_CREATED) { ?> <?php if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
<?php if ($PONOStatus == REQITEM_Emergency_PO_CREATED) { ?> <?php if($isChecked){ // if ($PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
<input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1" <?php echo $isChecked ? 'checked' : ''; ?>> IS THIS OPEN ORDER FORMAT <input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1" <?php echo $isChecked ? 'checked' : ''; ?>> IS THIS OPEN ORDER FORMAT
<?php } ?> <?php } ?>
<!-- <a data-toggle="modal" onclick="showmodel();" class=" btn btn-success"> Select Line Item </a> --> <?php if(!$isChecked){ ?>
<a data-toggle="modal"><button type="submit" onclick="myFunction();" <a data-toggle="modal"><button type="submit" onclick="myFunction();"
class="btn btn-success" id="abcd">Select Line Item</button> </a> class="btn btn-success" id="abcd">Select Line Item</button> </a>
<?php } ?> <?php } ?>
<?php } ?>
</div> </div>
</div> </div>
<br> <br>
@ -2764,9 +2772,10 @@ if (!empty($getlogpodtl)) {
<input type="hidden" id="MaterialRcvdDate<?= $row ?>" <input type="hidden" id="MaterialRcvdDate<?= $row ?>"
value="<?= $gd->MaterialRcvdDate ?>"> value="<?= $gd->MaterialRcvdDate ?>">
<td style="cursor:pointer;"><span onclick="openmodel(<?= $row ?>);"><i <td style="cursor:pointer;">
class="ri-pencil-fill"></i></span> <a href="javascript:void(0);" onclick="openmodel(<?= $row ?>);" data-toggle="tooltip" title="Click here to Edit the Special PO details">
<i class="ri-pencil-fill"></i>
</a>&nbsp;&nbsp;&nbsp;
</td> </td>
</tr> </tr>
<?php <?php
@ -2801,7 +2810,6 @@ if (!empty($getlogpodtl)) {
<thead> <thead>
<tr> <tr>
<th>Bill No </th> <th>Bill No </th>
<th>File</th> <th>File</th>
<th>Action</th> <th>Action</th>
</tr> </tr>
@ -5381,8 +5389,8 @@ if (!empty($getlogpodtl)) {
}); });
function Save(status) { function Save(status) {
// console.log("status"); console.log("status");
// console.log(status); console.log(status);
if (status == '0') { if (status == '0') {
stat = '<?php echo PO_DRAFT; ?>'; stat = '<?php echo PO_DRAFT; ?>';
@ -5498,7 +5506,8 @@ if (!empty($getlogpodtl)) {
$('#EditUOM').val($('#uom' + userid).val()); $('#EditUOM').val($('#uom' + userid).val());
$('#EditQuantity').val($('#quantity' + userid).val()); $('#EditQuantity').val($('#quantity' + userid).val());
tinyMCE.get('Edit_Service_Description').setContent($('#service_description' + userid).val()); tinyMCE.get('Edit_Service_Description').setContent($('#service_description' + userid).val());
$('#EditRate').val($('#itemRate' + userid).val()); var editrate = parseFloat($('#itemRate' + userid).val()).toFixed(2);
$('#EditRate').val(editrate);
var per = $('#per' + userid).val() var per = $('#per' + userid).val()
if (per == '') { if (per == '') {
$('#EditPer').val($('#uom' + userid).val()); $('#EditPer').val($('#uom' + userid).val());
@ -5950,10 +5959,16 @@ if (!empty($getlogpodtl)) {
$('#Quantity').val(0); $('#Quantity').val(0);
$('#Quantity').removeAttr('required'); $('#Quantity').removeAttr('required');
$('#Quantity').attr('readonly', true); $('#Quantity').attr('readonly', true);
$('#EditQuantity').val(0.00);
$('#EditQuantity').removeAttr('required');
$('#EditQuantity').attr('readonly', true);
} else { } else {
$('#Quantity').val(''); $('#Quantity').val('');
$('#Quantity').removeAttr('readonly'); $('#Quantity').removeAttr('readonly');
$('#Quantity').attr('required', true); $('#Quantity').attr('required', true);
$('#EditQuantity').val('');
$('#EditQuantity').removeAttr('readonly');
$('#EditQuantity').attr('required', true);
} }
}); });
</script> </script>

View File

@ -154,6 +154,14 @@ if (!empty($POMaster)) {
$DescriptionOfPo = $Req->Description_Of_Service; $DescriptionOfPo = $Req->Description_Of_Service;
$BudgetType = $Req->BudgetType; $BudgetType = $Req->BudgetType;
$PrePOFile = $Req->POFile; $PrePOFile = $Req->POFile;
$IsOpenOrder = isset($Req->IsOpenOrder) ? $Req->IsOpenOrder : null;
if ($IsOpenOrder !== null && (int)$IsOpenOrder !== 0) {
$isChecked = true;
} else {
$isChecked = false;
}
} }
} }
@ -1091,7 +1099,11 @@ foreach ($PaymentTerms as $TER) {
</div> </div>
<div class="form-row"> <div class="form-row">
<?php if($isChecked){ // ($PONOStatus == REQITEM_Emergency_PO_CREATED) { ?>
<div class="form-group col-md-12 text-right">
<input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1" <?php echo $isChecked ? 'checked' : ''; ?>> IS THIS OPEN ORDER FORMAT
</div>
<?php } ?>
</div> </div>
@ -1166,6 +1178,11 @@ foreach ($PaymentTerms as $TER) {
<td style="text-align:right !important"><?php echo $record->Quantity ?></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 $record->ReceivedQuantity ?></td>
<td style="text-align:right !important"><?php echo number_format($record->Quantity - $record->ReceivedQuantity, 2, '.', ''); ?></td> <td style="text-align:right !important"><?php echo number_format($record->Quantity - $record->ReceivedQuantity, 2, '.', ''); ?></td>
<td>
<a href="#" data-toggle="modal" data-target="#EDITSERVICE" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" class="tooltip-trigger" title="Click here to view/Edit the <?php echo $record->ReqNo; ?> Requisition details">
<i class="ri-pencil-fill"style="text-align: center;"></i>
</a>
</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 'Reqnumber' . $index ?>" id="<?php echo 'Reqnumber' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
@ -1243,10 +1260,10 @@ foreach ($PaymentTerms as $TER) {
//if($PONOStatus == PO_DRAFT) //if($PONOStatus == PO_DRAFT)
//{ //{
?> ?>
<td> <a data-target='#EDITSERVICE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" <!-- <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" data-toggle="modal" href="#EDITSERVICE"><i class="ri-pencil-fill" data-toggle="tooltip"
title="Click here to view/Edit the <?php echo $record->ReqNo; ?> title="Click here to view/Edit the <?php echo $record->ReqNo; ?>
Requisition details"></i>&nbsp;&nbsp;&nbsp; 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>--> <!-- </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 <?php
//} else { //} else {
@ -1863,6 +1880,12 @@ foreach ($PaymentTerms as $TER) {
$('#EditotherDescription').hide(); $('#EditotherDescription').hide();
$(document).ready(function() { $(document).ready(function() {
var openOrder = <?php echo $IsOpenOrder; ?>;
if(openOrder){
$('#EditQuantity').removeAttr('required');
$('#EditQuantity').attr('readonly', true);
}
$("#EDITSERVICE").on("shown.bs.modal", function(e) { $("#EDITSERVICE").on("shown.bs.modal", function(e) {
var AvlBudAmt = '<?php echo $AvlAmount ?>'; var AvlBudAmt = '<?php echo $AvlAmount ?>';
@ -2275,7 +2298,6 @@ foreach ($PaymentTerms as $TER) {
} }
function validateServiceTax() { function validateServiceTax() {
if ($('#ReqNo').val() == "0") { if ($('#ReqNo').val() == "0") {
alert('Please select the Requisition Number'); alert('Please select the Requisition Number');
$('#ReqNo').focus(); $('#ReqNo').focus();
@ -2308,7 +2330,10 @@ foreach ($PaymentTerms as $TER) {
} }
function validateEditServiceTax() { function validateEditServiceTax() {
var openOrder = $('#IsOpenOrder').prop('checked');
var quantity = parseFloat($('#EditQuantity').val()) || 0;
var rate = parseFloat($('#EditRate').val()) || 0;
console.log(openOrder);
if ($('#EditCostCenter').val() == "0") { if ($('#EditCostCenter').val() == "0") {
alert('Please select the Cost center'); alert('Please select the Cost center');
$('#EditCostCenter').focus(); $('#EditCostCenter').focus();
@ -2317,11 +2342,11 @@ foreach ($PaymentTerms as $TER) {
alert('Please select the Material Code'); alert('Please select the Material Code');
$('#EditMaterialCode').focus(); $('#EditMaterialCode').focus();
return false; return false;
} else if ($('#EditQuantity').val() == '' || $('#EditQuantity').val() == 0.00) { } else if ($('#EditQuantity').val() == '' || (!openOrder && quantity === 0 )){
alert('Please Enter the Quantity value'); alert('Please Enter the Quantity value');
$('#EditQuantity').focus(); $('#EditQuantity').focus();
return false; return false;
} else if ($('#EditRate').val() == '' || $('#EditRate').val() == 0.00) { } else if ($('#EditRate').val() == '' || (!openOrder && rate === 0 )){
alert('Please Enter the Rate of the Item'); alert('Please Enter the Rate of the Item');
$('#EditRate').focus(); $('#EditRate').focus();
return false; return false;
@ -2500,6 +2525,20 @@ foreach ($PaymentTerms as $TER) {
return TAXval; // $('#AfterServiceTax').val(TAXval); return TAXval; // $('#AfterServiceTax').val(TAXval);
} }
$('#IsOpenOrder').change(function () {
// alert("IsOpenOrder");
if (this.checked) {
$('#EditQuantity').val(0);
$('#EditQuantity').removeAttr('required');
$('#EditQuantity').attr('readonly', true);
} else {
$('#EditQuantity').val('');
$('#EditQuantity').removeAttr('readonly');
$('#EditQuantity').attr('required', true);
}
});
function Reset() { location.reload(); } function Reset() { location.reload(); }
$(document).ready(function () { $(document).ready(function () {
$("#PaymentTerms").change(function() { $("#PaymentTerms").change(function() {

View File

@ -107,23 +107,19 @@
<td><?= esc($d['no_of_days']) ?></td> <td><?= esc($d['no_of_days']) ?></td>
<td><?= esc($d['status']) ?></td> <td><?= esc($d['status']) ?></td>
<td><?php if($d['leave_application_id']){ ?> <td><?php if($d['leave_application_id']){ ?>
<a data-toggle="modal" href="#applicationModal" data-arr='<?php echo json_encode($d); ?>' data-id='<?= esc($d['leave_application_id']) ?>' data-toggle="tooltip" title="<?php echo $d['emp_id']; ?> - Click here to view Employee Leave Details"> <a data-toggle="modal" href="#applicationModal" data-arr='<?php echo json_encode($d); ?>' data-id='<?= esc($d['leave_application_id']) ?>' title="<?php echo $d['emp_id']; ?> - Click here to View/Edit Employee Leave Details">
<i class="fas fa-edit"></i>&nbsp;&nbsp;&nbsp; <i class="fas fa-edit"></i>&nbsp;&nbsp;&nbsp;
</a> </a>
<?php } ?>
<!-- <a onclick="confirmDelete(event)" style="cursor:pointer;" href="<?php echo base_url() . 'deleteLeaveApplicationForm?leave_application_id=' . esc($d['leave_application_id']); ?>" data-toggle="tooltip" title="<?php echo $d['emp_id']; ?> - Click here to delete Employee Leave Details"> --> <?php if($d['status'] == "Approved"){ ?>
<a onclick="confirmDelete(event)" style="cursor:pointer;" href="<?php echo base_url() . 'deleteLeaveApplicationForm?leave_application_id=' . esc($d['leave_application_id']); ?>"> <a style="cursor:pointer;" href="<?php echo base_url() . 'leaveApplicationPDF/' . esc($d['leave_application_id']); ?>" title="<?php echo $d['emp_id']; ?> - Click here to Download Employee Leave Details">
<i class="fa fa-download"></i>&nbsp;&nbsp;&nbsp;
</a>
<?php }else{ ?>
<a style="cursor:pointer;" onclick="confirmDelete(event)" href="<?php echo base_url() . 'deleteLeaveApplicationForm?leave_application_id=' . esc($d['leave_application_id']); ?>" title="<?php echo $d['emp_id']; ?> - Click here to Delete Employee Leave Details">
<i class="fa fa-trash"></i>&nbsp;&nbsp;&nbsp; <i class="fa fa-trash"></i>&nbsp;&nbsp;&nbsp;
</a> </a>
<?php } ?> <?php } ?>
<?php if($d['status'] == "APPROVED"){} ?>
<!-- <a style="cursor:pointer;" href="<?php echo base_url() . 'leaveApplicationPDF/' . esc($d['leave_application_id']); ?>" data-toggle="tooltip" title="<?php echo $d['emp_id']; ?> - Click here to download Employee Leave Details"> -->
<a style="cursor:pointer;" href="<?php echo base_url() . 'leaveApplicationPDF/' . esc($d['leave_application_id']); ?>">
<i class="fa fa-download"></i>&nbsp;&nbsp;&nbsp;
</a>
</td> </td>
</tr> </tr>
<?php } ?> <?php } ?>
@ -212,7 +208,7 @@
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label class="form" for="no_of_days">No Of Days </label> <label class="form" for="no_of_days">No Of Days </label>
<input type="text" class="form-control" id="no_of_days" name="no_of_days"> <input type="text" class="form-control" id="no_of_days" name="no_of_days" readonly>
</div> </div>
</div><!--/. r o w 5 --> </div><!--/. r o w 5 -->
<div class="row mt-2"> <div class="row mt-2">
@ -259,60 +255,67 @@
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$('.tooltip-trigger').tooltip();
$(".searchabledropdown").select2(); $(".searchabledropdown").select2();
let today = new Date().toISOString().split("T")[0]; // Format: YYYY-MM-DD let today = new Date().toISOString().split("T")[0]; // Format: YYYY-MM-DD
$("#start_date").attr("min", today); $("#start_date").attr("min", today);
$("#end_date").attr("min", today); $("#end_date").attr("min", today);
$('#start_date').change(function() {
let start = new Date($('#start_date').val());
let formattedStart = start.toISOString().split('T')[0]; // Convert to YYYY-MM-DD format
// Reset the end_date input and set its min attribute
$('#end_date').val('').attr('min', formattedStart);
});
$('#start_date, #end_date').change(function() { $('#start_date, #end_date').change(function() {
const start = new Date($('#start_date').val()); let start = new Date($('#start_date').val());
const end = new Date($('#end_date').val()); let end = new Date($('#end_date').val());
if (!isNaN(start.getTime())) { let formattedStart = start.toISOString().split('T')[0]; // Convert to YYYY-MM-DD format
$('#end_date').val("");
let minDate = start.toISOString().split("T")[0]; // Convert Date to YYYY-MM-DD format $("#end_date").attr("min", formattedStart);
$("#end_date").attr("min", minDate); // Set min attribute for end_date
}
if (!isNaN(start) && !isNaN(end)) { if (!isNaN(start) && !isNaN(end)) {
const days = Math.floor((end - start) / 86400000) + 1; const days = Math.floor((end - start) / 86400000) + 1;
$('#no_of_days').val(days > 0 ? days : 1); $('#no_of_days').val(days > 0 ? days : 1);
} else { } else {
$('#no_of_days').val(''); $('#no_of_days').val('');
} }
validateDateRange();
}); });
$("#applicationModal").on("shown.bs.modal", function (e) { $("#applicationModal").on("shown.bs.modal", function (e) {
var id = $(e.relatedTarget).data('id'); var id = $(e.relatedTarget).data('id');
var arr = $(e.relatedTarget).data('arr') || {};
let fields = ['leave_application_id','emp_name','emp_id','start_date','end_date','no_of_days','reason','status_val','department','designation']; let fields = ['leave_application_id','emp_name','emp_id','start_date','end_date','no_of_days','reason','status_val','department','designation'];
fields.forEach(function(field) { fields.forEach(field => $("#" + field).val(arr[field] || "").prop('readonly', true));
$("#" + field).val("");
});
if (id == 0) { if (id == 0) {
$('#emp_name').val("").select2(); $('#emp_name').val("").select2();
$('#applicationformTitle').html("Apply Leave"); $('#applicationformTitle').text("Apply Leave");
$("#leave_application_id").val(0); $("#leave_application_id").val(0);
$("#tempClick").show();
} else { } else {
var arr = $(e.relatedTarget).data('arr'); $('#applicationformTitle').text(arr.status === "Approved" ? "View Leave" : "Edit Leave");
$("#tempClick").toggle(arr.status !== "Approved");
fields.forEach(function(field) {
if(field == 'emp_name'){
let empID = arr && arr['emp_id'] ? arr['emp_id'] : "";
$("#emp_name").val(empID).select2();
}else if(field == 'status_val'){
$("#status_val").val(arr && arr['status']);
}else{
$("#" + field).val(arr && arr[field] ? arr[field] : "");
} }
});
$('#applicationformTitle').html("Edit Leave"); if (id == 0 || arr.status !== "Approved") {
$("#emp_name, #start_date, #end_date, #status_val, #reason").prop({readonly: false, disabled: false});
$("#start_date, #end_date").prop('required', true);
} else {
$("#emp_name, #status_val").prop('disabled', true);
} }
if (arr.emp_id) $("#emp_name").val(arr.emp_id).select2();
if (arr.status) $("#status_val").val(arr.status);
}); });
$('#tempClick').click(function () { $('#tempClick').click(function () {
if ($('#emp_id').val() === '') { if ($('#emp_id').val() === '') {
alert('Please Select the Valid Employee'); alert('Please Select the Valid Employee');
return; return;
@ -333,7 +336,11 @@
alert('Please Select Status'); alert('Please Select Status');
return; return;
} }
// validateDateRange(function(isValid) {
// if (!isValid) {
// alert("The selected date range overlaps with an existing approved leave.");
// return;
// }
var formData = { var formData = {
leave_application_id:$('#leave_application_id').val(), leave_application_id:$('#leave_application_id').val(),
@ -372,7 +379,7 @@
} }
}); });
// });
}); });
@ -463,6 +470,39 @@
// } // }
// }); // });
}); });
function validateDateRange() {
let startDate = $("#start_date").val();
let endDate = $("#end_date").val();
let empId = $("#emp_name").val();
if (!startDate || !endDate || !empId) return;
else{
$.ajax({
url: "<?php echo base_url(); ?>validateDateRange", // Replace with your actual API endpoint
type: "POST",
data: { emp_id: empId, start_date: startDate, end_date: endDate },
dataType: 'json',
success: function (response) {
if (response.status) {
alert(response.message);
$("#start_date, #end_date, #no_of_days").val("");
}else{
console.log(response.status,response.array);
}
},
error: function (xhr, status, error) {
alert("Error checking leave dates.");
},
complete: function () {
console.log("validate leave dates ajax call completed");
}
});
}
}
</script> </script>
<script> <script>

View File

@ -136,14 +136,14 @@
$cdate = date('d-m-Y', strtotime($record->Created_date)); $cdate = date('d-m-Y', strtotime($record->Created_date));
} ?> } ?>
<td> <td>
<a class="a_tag_link" href="<?php echo base_url() . 'employeedetails/ViewEmployee/?EmpID=' . $record->EmpID; ?>" data-toggle="tooltip" title="<?php echo $record->EmpID; ?> - Click here to view Employee Details"><?php echo $record->EmpID ?> </a></u> <a class="tooltip-trigger a_tag_link" href="<?php echo base_url() . 'employeedetails/ViewEmployee/?EmpID=' . $record->EmpID; ?>" title="<?php echo $record->EmpID; ?> - Click here to view Employee Details"><?php echo $record->EmpID ?> </a></u>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<a href="<?php echo base_url() . 'employeedetails/downloadEmployeeDetails/?EmpID=' . $record->EmpID; ?>" data-toggle="tooltip" title="<?php echo $record->EmpID; ?> - Click here to Download Employee Details"> <a href="<?php echo base_url() . 'employeedetails/downloadEmployeeDetails/?EmpID=' . $record->EmpID; ?>" class="tooltip-trigger" title="<?php echo $record->EmpID; ?> - Click here to Download Employee Details">
<i class="fas fa-download"></i> <i class="fas fa-download"></i>
</a> </a>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<a href="#" data-toggle="modal" data-target="#accordion-modal" data-emp="<?php echo $record->EmpID ?>" data-toggle="tooltip" title="<?php echo $record->EmpID; ?> - Click here to view Employee History"> <a href="#" data-toggle="modal" data-target="#accordion-modal" data-emp="<?php echo $record->EmpID ?>" class="tooltip-trigger" title="<?php echo $record->EmpID; ?> - Click here to View Employee History">
<i class="fas fa-history"style="text-align: center;"></i> <i class="fas fa-history"style="text-align: center;"></i>
</a> </a>
@ -245,6 +245,7 @@
}); });
}); });
$(document).ready(function() { $(document).ready(function() {
$('.tooltip-trigger').tooltip();
$("#accordion-modal").on("shown.bs.modal", function(e) { $("#accordion-modal").on("shown.bs.modal", function(e) {
var emp = $(e.relatedTarget).data('emp'); var emp = $(e.relatedTarget).data('emp');
var noData = '<p style="text-align: center;">No History Data Available</p>'; var noData = '<p style="text-align: center;">No History Data Available</p>';

View File

@ -78,7 +78,9 @@
</li> </li>
</ol> </ol>
</div> </div>
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Auditor'){?>
<a id="addExpense" class="btn btn-success" data-toggle="modal" data-target="#expenseModal" href="">Add New Expense</a> <a id="addExpense" class="btn btn-success" data-toggle="modal" data-target="#expenseModal" href="">Add New Expense</a>
<?php } ?>
</div> </div>
</div> </div>
</div> </div>
@ -184,7 +186,9 @@
<button title="Download FIle" class="download_button" onclick="downloadFile('<?php echo $record['id']; ?>', '<?php echo $record['transporter_file']; ?>')" style="border: none;background-color: white;color: #02a8b5;"> <button title="Download FIle" class="download_button" onclick="downloadFile('<?php echo $record['id']; ?>', '<?php echo $record['transporter_file']; ?>')" style="border: none;background-color: white;color: #02a8b5;">
<i class="fas fa-file-download"></i> <i class="fas fa-file-download"></i>
</button> </button>
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Auditor'){?>
<button title="Delete File" id="deleteFile" class="delete_button" data-value="<?php echo $record['id'] ?>" data-id="<?php echo $record['id'] ?>" data-file="<?php echo $record['transporter_file'] ?>"><i class="fas fa-trash"></i></button> <button title="Delete File" id="deleteFile" class="delete_button" data-value="<?php echo $record['id'] ?>" data-id="<?php echo $record['id'] ?>" data-file="<?php echo $record['transporter_file'] ?>"><i class="fas fa-trash"></i></button>
<?php } ?>
<?php } ?> <?php } ?>
<button title="Edit" class="edit-button" data-toggle="modal" data-target="#expenseModal" data-id="<?php echo $record['id']; ?>" style="border: none;background-color: white;color: #02a8b5;"> <button title="Edit" class="edit-button" data-toggle="modal" data-target="#expenseModal" data-id="<?php echo $record['id']; ?>" style="border: none;background-color: white;color: #02a8b5;">
@ -312,7 +316,7 @@
<label for="status" class="col-form-label">Status</label> <label for="status" class="col-form-label">Status</label>
</div> </div>
<div class="col"> <div class="col">
<select name="status" id="non_igr_status" class="form-control"> <select name="status" id="non_igr_status" class="form-control" required>
<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> <option value="Canceled">Canceled</option>
@ -332,7 +336,9 @@
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Cancel</button> <button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Cancel</button>
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Auditor'){?>
<button type="button" class="btn btn-info waves-effect waves-light tempClick" id="tempClick">Submit</button> <button type="button" class="btn btn-info waves-effect waves-light tempClick" id="tempClick">Submit</button>
<?php } ?>
</div> </div>
</div> </div>
</div> </div>
@ -363,7 +369,7 @@ dateInput.addEventListener('change', function () {
$(document).on('click', '.edit-button', function() { $(document).on('click', '.edit-button', function() {
var roleText = '<?php echo session()->get('roleText') ?>';
$('.modal-title').html('Edit Expense'); $('.modal-title').html('Edit Expense');
var expenseId = $(this).data('id'); var expenseId = $(this).data('id');
var supplier_list = [<?php echo $supplier_list; ?>]; var supplier_list = [<?php echo $supplier_list; ?>];
@ -414,7 +420,11 @@ dateInput.addEventListener('change', function () {
var deleteButton = '<button id="deleteFile" class="delete_button" data-value="' + expense.id + '" data-id="' + expense.id + '" data-file="' + expense.transporter_file + '"><i class="fas fa-trash"></i></button>'; var deleteButton = '<button id="deleteFile" class="delete_button" data-value="' + expense.id + '" data-id="' + expense.id + '" data-file="' + expense.transporter_file + '"><i class="fas fa-trash"></i></button>';
// Add the file link and delete button // Add the file link and delete button
if(roleText == 'System Administrator' ||roleText == 'Security' ||roleText == 'Auditor'){
$('#transporterfile').after(fileLink + ' ' + deleteButton); $('#transporterfile').after(fileLink + ' ' + deleteButton);
}else{
$('#transporterfile').after(fileLink);
}
} else { } else {
$('#transporterfile_name').val(''); // Clear hidden input if no file $('#transporterfile_name').val(''); // Clear hidden input if no file
} }

View File

@ -0,0 +1,734 @@
<!-- Flatpickr CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<!-- Flatpickr JS -->
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<style>
.num {
text-align: right;
}
#Inwardgateregistertable1 thead tr th{
width: 150px;
word-wrap: break-word;
white-space: normal;
}
th {
white-space: nowrap;
}
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px;
/* Adjust the gap as needed */
}
.Date-filter-form input,
.Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
</style>
<style>
th,
td {
white-space: nowrap;
}
</style>
<style>
.dataTables_wrapper .top {
display: flex;
justify-content: space-between;
align-items: center;
}
.dataTables_wrapper .dataTables_length {
float: left;
}
.footer-textarea {
width: 100%;
padding: 10px;
border-radius: 5px;
border: 1px solid #ccc;
}
.send-btn {
padding: 10px 20px;
background-color: #2ecc71; /* Green color */
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.send-btn:hover {
background-color: #27ae60; /* Darker green on hover */
}
</style>
<script>
$(function() {
var d = new Date();
var month = d.getMonth();
var day = d.getDate();
var year = d.getFullYear();
var SIAStartYear = year - 2015;
var mindt = year - 70;
var maxdt = year - 15;
});
</script>
<style>
.autocomplete-suggestion {
cursor: pointer;
background-color: skyblue;
/* background-color: darkgrey; */
outline: 1px solid slategrey;
}
.igr-remarks{
position: relative;
}
.igr-remarks i{
font-size: 14px;
}
.igr-remarks span{
position: absolute;
top: -5px;
right: -6px;
background-color: transparent;
border-radius: 50px!important;
font-weight: 600;
width: 14px;
box-shadow: 0 0 20px 0 rgba(0,0,0,0.2);
color:#35462c;
}
</style>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/Autocomplete/jquery.autocomplete.js"></script>
<div class="content-page">
<div class="content">
<!-- Start Content-->
<div class="container-fluid">
<!-- start page title -->
<div>
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Inward</a></li>
<li class="breadcrumb-item active">
<h4 class="page-title">Gas Cylinder Entered </h4>
</li>
</ol>
</div>
</div>
</div>
</div>
<?php if (session()->getFlashdata('message')): ?>
<div class="alert alert-warning" role="alert">
<?= esc(session()->getFlashdata('message')); ?>
</div>
<?php endif; ?>
<div class="row">
<div class="col-12">
<div class="card">
<div class="row">
<div class="col-md-8">
<form class="Date-filter-form" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;" method="post" action="<?= base_url('ViewIGR'); ?>">
<label for="fromDate">From:</label>
<input class="form-control date_range form-date-search"
value=""
id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
<label for="toDate">To:</label>
<input class="form-control date_range to-date-search"
value=""
id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
<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"
style="cursor:pointer;"
aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div>
</form>
</div>
<!-- <div class="col-md-4">
<button id="downloadExcel" class="btn btn-primary" style="margin-top: 14px;margin-bottom: -11px;margin-right: 25px;float: right;">Download Excel</button>
</div> -->
</div>
<div class="card-body" style="overflow-x:scroll;">
<table id="view_inward_gate_register" class="table table-bordered table-hover">
<thead>
<tr>
<!-- basic details -->
<th>Full Cylinder Date</th>
<th>IGR No</th>
<th>Supplier</th>
<th>Bill/Invoice No</th>
<th>Cylinder Name</th>
<!-- cylinderdetails -->
<!-- least details -->
<th>Bill Date</th>
<th>Driver Name</th>
<th>Vehicle No</th>
<th>Cylinder Count</th>
<th>Gas Details</th>
</tr>
</thead>
<tbody>
<?php if(empty($gasCylinderEnteredList)){?>
<p align="center"> No Gas Cylinder Entered in the Given Dates..!!</p>
<?php }else{ ?>
<?php foreach($gasCylinderEnteredList as $index => $gasCylinder):
$gasCylinder['MaterialRcvdDate'] = date('d-m-Y',strtotime($gasCylinder['MaterialRcvdDate']));
$gasCylinder['DeliveryChellanDate'] = date('d-m-Y',strtotime($gasCylinder['DeliveryChellanDate']));
?>
<tr>
<!-- basic details -->
<!-- td:eq(0) -->
<td><?=$gasCylinder['MaterialRcvdDate']?></td>
<!-- td:eq(1) -->
<td><?=$gasCylinder['IGRNO-']?></td>
<!-- td:eq(2) -->
<td><?=$gasCylinder['SupplierName']?></td>
<!-- td:eq(3) -->
<td><?=$gasCylinder['DeliveryChellanOrInvoiceNo']?></td>
<!-- td:eq(4) -->
<td><?=$gasCylinder['MaterialName']?></td>
<!-- cylinderdetails -->
<!-- least details -->
<!-- td:eq(5) -->
<td><?=$gasCylinder['DeliveryChellanDate']?></td>
<!-- td:eq(6) -->
<td><?=$gasCylinder['DriverName']?></td>
<!-- td:eq(7) -->
<td><?=$gasCylinder['VehicleNo']?></td>
<!-- td:eq(8) -->
<td><?=$gasCylinder['gasCylinderCount']?></td>
<!-- #gasEnteredDetails modal will open when clicking this button -->
<td>
<a href="#">
<i class="fa fa-edit gas-entered-details" ></i>
</a>
</td>
</tr>
<?php endforeach ?>
<?php } ?>
</tbody>
</table>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
</div>
</div> <!-- container -->
</div> <!-- content -->
</div>
<!-- box closed here -->
<!-- gas Entered modal -->
<div id="gasEnteredDetails" data-form="add" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-xl">
<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">Gas Cylinder Details </h4>
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
</div>
<div class="modal-body p-4">
<form action="#">
<!-- first row -->
<div class="form-group row">
<div class="col-md-4">
<label for="fullCylinderDate"> Full Cylinder Date</label>
<input type="date" class="form-control" id="fullCylinderDate" name="fullCylinderDate" value="" readonly>
</div>
<div class="col-md-4">
<label for="IGRNO"> IGRNO</label>
<input type="text" class="form-control" id="IGRNO" name="IGRNO" value="" readonly>
</div>
<div class="col-md-4">
<label for="supplierName"> Supplier Name</label>
<input type="text" class="form-control" id="supplierName" name="supplierName" value="" readonly>
</div>
</div>
<!-- second row -->
<div class="form-group row">
<div class="col-md-4">
<label for="invoiceNo"> Bill No/Invoice No </label>
<input type="text" class="form-control" id="invoiceNo" name="invoiceNo" value="" readonly>
</div>
<div class="col-md-4">
<label for="billDate"> Bill Date</label>
<input type="date" class="form-control" id="billDate" name="billDate" value="" readonly>
</div>
<div class="col-md-4">
<label for="driverName"> Driver Name</label>
<input type="text" class="form-control" id="driverName" name="driverName" value="" readonly>
</div>
</div>
<!-- third row -->
<div class="form-group row">
<div class="col-md-4">
<label for="vehicleNo"> Vehicle No</label>
<input type="text" class="form-control" id="vehicleNo" name="vehicleNo" value="" readonly>
</div>
<div class="col-md-4">
<label for="cylinderCount"> Cylinder Name </label>
<input type="text" class="form-control" id="cylinderName" name="cylinderName" value="" readonly>
</div>
<div class="col-md-4">
<label for="cylinderCount"> Cylinder Count </label>
<input type="text" class="form-control" id="cylinderCount" name="cylinderCount" value="" readonly>
</div>
</div>
<hr>
<!-- fourth row -->
<div id="cylinderDiv">
</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 -->
<!-- format date time helper -->
<script>
function formatDateTime(dateString, flag) {
// Note 1 means DATE only
// 2 means DATE and Time
// Check if the date string is null or empty
if (!dateString || dateString == 'null' || dateString === '0000-00-00 00:00:00') {
return '';
} else {
console.log("Received date string:", dateString);
// Split the date string into date and time components
var dateTimeParts = dateString.split(' ');
var dateParts = dateTimeParts[0].split('-');
var timeParts = dateTimeParts[1].split(':');
// Extract individual components
var year = parseInt(dateParts[0], 10);
var month = parseInt(dateParts[1], 10) - 1; // Months are zero-based in JavaScript
var day = parseInt(dateParts[2], 10);
var hours = parseInt(timeParts[0], 10);
var minutes = parseInt(timeParts[1], 10);
var seconds = parseInt(timeParts[2], 10);
// Create a new Date object
var date = new Date(year, month, day, hours, minutes, seconds);
// Extract date components
var day = date.getDate().toString().padStart(2, '0');
var month = (date.getMonth() + 1).toString().padStart(2, '0'); // Months are zero-based
var year = date.getFullYear();
// Extract time components
var hours = date.getHours().toString().padStart(2, '0');
var minutes = date.getMinutes().toString().padStart(2, '0');
var seconds = date.getSeconds().toString().padStart(2, '0');
var formattedDate = '';
// Format the date and time in DD-MM-YYYY HH:MM:SS format
if (flag == 1) {
formattedDate = `${day}-${month}-${year}`;
} else if (flag == 2) {
formattedDate = `${day}-${month}-${year} ${hours}:${minutes}:${seconds}`;
}
return formattedDate;
}
}
</script>
<!-- number validation -->
<script>
function isNumberKey(evt) {
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode != 46 && charCode > 31 &&
(charCode < 48 || charCode > 57))
return false;
return true;
}
</script>
<!-- data table related initialization -->
<script>
$(document).ready(function() {
// this code for table date filed ordering
$.fn.dataTable.ext.type.order['date-dd-mm-yyyy-pre'] = function(date) {
if (!date) return 0;
var parts = date.split('-'); // Split the date into parts (DD, MM, YYYY)
return new Date(parts[2], parts[1] - 1, parts[0]).getTime(); // Convert to timestamp
};
var orderColumnIndex = <?php echo (session()->get('roleText') == 'Auditor') ? 6 : 0; ?>;
table = $('#view_inward_gate_register').DataTable({
dom: 'Blfrtip',
buttons: [
{
extend: 'excel',
text: 'Excel',
exportOptions: {
columns: ':not(:last-child)' // Exclude the last column
}
}
],
pageLength: 10,
lengthMenu: [
[10, 20, 30, 50, -1],
[10, 20, 30, 50, "All"]
],
responsive: false,
ordering: true,
columnDefs: [
{ targets: parseInt(orderColumnIndex), type: 'date-dd-mm-yyyy' } // Apply custom sorting
],
order: [[parseInt(orderColumnIndex), 'desc']],
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>', // Next button icon
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
}
}
});
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").val('');
$("#toDate").val('');
window.location="gasCylinderEntered"
});
// Automatically focus and open the To Date picker when From Date is selected
document.getElementById('fromDate').addEventListener('change', function() {
var fromDate = this.value;
var toDateInput = document.getElementById('toDate');
// Set the min attribute of the To Date input to the selected From Date
toDateInput.min = fromDate;
// Optionally reset the To Date input if the current value is before the new min date
if (toDateInput.value < fromDate) {
toDateInput.value = fromDate;
}
});
});
</script>
<!-- data table related date filter -->
<script>
$(document).ready(function() {
$('#fromDate , #toDate').change(function() {
let fromDate = $('#fromDate').val();
let toDate = $('#toDate').val();
let fromDateObj = new Date(fromDate.split('-').reverse().join('-'));
let toDateObj = new Date(toDate.split('-').reverse().join('-'));
if (fromDateObj > toDateObj) {
alert('Incorrect Date Applied For Filter..!!');
$('#toDate').attr('min', fromDate);
$('#toDate').val('');
}
});
});
</script>
<!-- while Opening gasEnteredDetails modal -->
<script>
$(document).on('click', '.gas-entered-details', function() {
let row = $(this).closest("tr");
let fullCylinderDate = row.find("td:eq(0)").text().trim();
let igrNo = row.find("td:eq(1)").text().trim();
let supplierName = row.find("td:eq(2)").text().trim();
let invoiceNo = row.find("td:eq(3)").text().trim();
let cylinderName = row.find("td:eq(4)").text().trim();
let billDate = row.find("td:eq(5)").text().trim();
let driverName = row.find("td:eq(6)").text().trim();
let vehicleNo = row.find("td:eq(7)").text().trim();
let cylinderCount = parseInt(row.find("td:eq(8)").text().trim(), 10);
// Convert fullCylinderDate to YYYY-MM-DD
if (fullCylinderDate) {
let dateParts = fullCylinderDate.split("-");
fullCylinderDate = `${dateParts[2]}-${dateParts[1]}-${dateParts[0]}`;
}
// Convert billDate to YYYY-MM-DD
if (billDate) {
let dateParts = billDate.split("-");
billDate = `${dateParts[2]}-${dateParts[1]}-${dateParts[0]}`;
}
// Assign values to modal inputs
$('#fullCylinderDate').val(fullCylinderDate);
$('#IGRNO').val(igrNo);
$('#supplierName').val(supplierName);
$('#invoiceNo').val(invoiceNo);
$('#billDate').val(billDate);
$('#driverName').val(driverName);
$('#vehicleNo').val(vehicleNo);
$('#cylinderName').val(cylinderName);
$('#cylinderCount').val(cylinderCount);
// Clear previous cylinder inputs
$('#cylinderDiv').html("");
// Generate cylinder input fields dynamically
if (cylinderCount > 0) {
let inputFields = `
<div class="form-group row">
<div class="col-md-4"><label>Cylinder Number</label> <span class="text-danger">*</span> </div>
<div class="col-md-4"><label>Gross Weight</label> <span class="text-danger">*</span> </div>
<div class="col-md-4"><label>Actual Weight</label> <span class="text-danger">*</span> </div>
</div>`;
for (let i = 1; i <= cylinderCount; i++) {
inputFields += `
<div class="form-group row dynamicField">
<div class="col-md-4">
<input type="text" class="form-control" name="cylinderNumber[]" placeholder="Cylinder ${i}" required>
</div>
<div class="col-md-4">
<input type="number" class="form-control" name="grossWeight[]" placeholder="Gross Weight ${i}" required>
</div>
<div class="col-md-4">
<input type="number" class="form-control" name="actualWeight[]" placeholder="Actual Weight ${i}" required>
</div>
</div>`;
}
$('#cylinderDiv').html(inputFields);
}
// Show the modal
$('#gasEnteredDetails').modal('show');
});
</script>
<!-- while closing gasEnteredDetails modal -->
<script>
$(document).ready(function(){
$('#gasEnteredDetails').on("hide.bs.modal", function(e){
$('#fullCylinderDate').val(" ");
$('#IGRNO').val(" ");
$('#supplierName').val(" ");
$('#invoiceNo').val(" ");
$('#billDate').val(" ");
$('#driverName').val(" ");
$('#vehicleNo').val(" ");
$('#cylinderName').val(" ");
$('#cylinderCount').val(" ");
$('#cylinderDiv').html("");
});
});
</script>
<!-- end of add gas shortage calculator -->
<!-- ajax call for gas Shortage -->
<script>
$(document).ready(function () {
$("#gasEnteredDetails form").submit(function (event) {
event.preventDefault(); // Prevent form reload
let method = $("#gasEnteredDetails").data("form"); // Get form type
// Collecting form data
let formData = {
fullCylinderDate: $("#fullCylinderDate").val(),
IGRNO: $("#IGRNO").val(),
supplierName: $("#supplierName").val(),
invoiceNo: $("#invoiceNo").val(),
billDate: $("#billDate").val(),
driverName: $("#driverName").val(),
vehicleNo: $("#vehicleNo").val(),
cylinderName: $('#cylinderName').val(),
cylinderCount: $("#cylinderCount").val(),
cylinders: [] // Array to store cylinder details
};
// Loop through dynamically generated cylinder inputs
$("#cylinderDiv .form-group.row.dynamicField").each(function () {
let cylinderData = {
cylinderNo : $(this).find("input[name='cylinderNumber[]']").val(),
grossWeight : $(this).find("input[name='grossWeight[]']").val(),
actualWeight: $(this).find("input[name='actualWeight[]']").val(),
};
formData.cylinders.push(cylinderData);
});
console.log(formData); // Debugging - Check if data is correct
$('#loader').show(); // Show loader
$.ajax({
type: "POST",
url: "<?php echo base_url()?>/updateGasShortage", // Adjust endpoint as needed
data: JSON.stringify(formData), // Send data as JSON
contentType: "application/json",
dataType: "json",
success: function (response) {
if (response.status === "success") {
alert("Gas Shortage Data Saved Successfully!");
$('#gasEnteredDetails').modal('hide'); // Close modal
window.location.reload();
} 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 request completed.");
$('#loader').hide();
}
});
});
});
</script>

View File

@ -0,0 +1,800 @@
<!-- Flatpickr CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<!-- Flatpickr JS -->
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<style>
.num {
text-align: right;
}
#Inwardgateregistertable1 thead tr th{
width: 150px;
word-wrap: break-word;
white-space: normal;
}
th {
white-space: nowrap;
}
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px;
/* Adjust the gap as needed */
}
.Date-filter-form input,
.Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
</style>
<style>
th,
td {
white-space: nowrap;
}
</style>
<style>
.dataTables_wrapper .top {
display: flex;
justify-content: space-between;
align-items: center;
}
.dataTables_wrapper .dataTables_length {
float: left;
}
.footer-textarea {
width: 100%;
padding: 10px;
border-radius: 5px;
border: 1px solid #ccc;
}
.send-btn {
padding: 10px 20px;
background-color: #2ecc71; /* Green color */
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.send-btn:hover {
background-color: #27ae60; /* Darker green on hover */
}
</style>
<script>
$(function() {
var d = new Date();
var month = d.getMonth();
var day = d.getDate();
var year = d.getFullYear();
var SIAStartYear = year - 2015;
var mindt = year - 70;
var maxdt = year - 15;
});
</script>
<style>
.autocomplete-suggestion {
cursor: pointer;
background-color: skyblue;
/* background-color: darkgrey; */
outline: 1px solid slategrey;
}
.igr-remarks{
position: relative;
}
.igr-remarks i{
font-size: 14px;
}
.igr-remarks span{
position: absolute;
top: -5px;
right: -6px;
background-color: transparent;
border-radius: 50px!important;
font-weight: 600;
width: 14px;
box-shadow: 0 0 20px 0 rgba(0,0,0,0.2);
color:#35462c;
}
</style>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/Autocomplete/jquery.autocomplete.js"></script>
<div class="content-page">
<div class="content">
<!-- Start Content-->
<div class="container-fluid">
<!-- start page title -->
<div>
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Inward</a></li>
<li class="breadcrumb-item active">
<h4 class="page-title">Gas Cylinder Pending </h4>
</li>
</ol>
</div>
</div>
</div>
</div>
<?php if (session()->getFlashdata('message')): ?>
<div class="alert alert-warning" role="alert">
<?= esc(session()->getFlashdata('message')); ?>
</div>
<?php endif; ?>
<div class="row">
<div class="col-12">
<div class="card">
<div class="row">
<div class="col-md-8">
<form class="Date-filter-form" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;" method="post" action="<?= base_url('ViewIGR'); ?>">
<label for="fromDate">From:</label>
<input class="form-control date_range form-date-search"
value=""
id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
<label for="toDate">To:</label>
<input class="form-control date_range to-date-search"
value=""
id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
<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"
style="cursor:pointer;"
aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div>
</form>
</div>
<!-- <div class="col-md-4">
<button id="downloadExcel" class="btn btn-primary" style="margin-top: 14px;margin-bottom: -11px;margin-right: 25px;float: right;">Download Excel</button>
</div> -->
</div>
<div class="card-body" style="overflow-x:scroll;">
<table id="view_inward_gate_register" class="table table-bordered table-hover">
<thead>
<tr>
<!-- basic details -->
<th>Full Cylinder Date</th>
<th>IGR No</th>
<th>Supplier</th>
<th>Bill/Invoice No</th>
<th>Cylinder Name</th>
<!-- cylinderdetails -->
<th>Cylinder No</th>
<th>Gross Weight</th>
<th>Actual Weight</th>
<!-- least details -->
<th>Bill Date</th>
<th>Driver Name</th>
<th>Vehicle No</th>
<th>Cylinder Count</th>
<th>Gas Details</th>
<th style="display: none;">id</th>
</tr>
</thead>
<tbody>
<?php if(empty($gasCylinderPendingList)){?>
<p align="center" > No Gas Cylinder Pending in the Given Dates..!!</p>
<?php }else{ ?>
<?php foreach($gasCylinderPendingList as $index => $gasCylinder):
$gasCylinder['MaterialRcvdDate'] = date('d-m-Y',strtotime($gasCylinder['MaterialRcvdDate']));
$gasCylinder['DeliveryChellanDate'] = date('d-m-Y',strtotime($gasCylinder['DeliveryChellanDate']));
?>
<tr>
<!-- basic details -->
<!-- td:eq(0) -->
<td><?=$gasCylinder['MaterialRcvdDate']?></td>
<!-- td:eq(1) -->
<td><?=$gasCylinder['IGRNO-']?></td>
<!-- td:eq(2) -->
<td><?=$gasCylinder['SupplierName']?></td>
<!-- td:eq(3) -->
<td><?=$gasCylinder['DeliveryChellanOrInvoiceNo']?></td>
<!-- td:eq(4) -->
<td><?=$gasCylinder['MaterialName']?></td>
<!-- cylinder details -->
<!-- td:eq(5) -->
<td><?=$gasCylinder['cylinderNo']?></td>
<!-- td:eq(6) -->
<td><?=$gasCylinder['grossWeight']?></td>
<!-- td:eq(7) -->
<td><?=$gasCylinder['actualWeight']?></td>
<!-- least details -->
<!-- td:eq(8) -->
<td><?=$gasCylinder['DeliveryChellanDate']?></td>
<!-- td:eq(9) -->
<td><?=$gasCylinder['DriverName']?></td>
<!-- td:eq(10) -->
<td><?=$gasCylinder['VehicleNo']?></td>
<!-- td:eq(11) -->
<td><?=$gasCylinder['gasCylinderCount']?></td>
<!-- td:eq(12) -->
<td style="display: none;"><?=$gasCylinder['id']?></td>
<!-- #gasPendingDetails modal will open when clicking this button -->
<td>
<a href="#">
<i class="fa fa-edit gas-pending-details" ></i>
</a>
</td>
</tr>
<?php endforeach ?>
<?php } ?>
</tbody>
</table>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
</div>
</div> <!-- container -->
</div> <!-- content -->
</div>
<!-- box closed here -->
<!-- gas Entered modal -->
<div id="gasPendingDetails" data-form="add" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-xl">
<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">Gas Cylinder Details </h4>
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">×</button>
</div>
<div class="modal-body p-4">
<form action="#">
<!-- first row -->
<div class="form-group row">
<div class="col-md-4">
<label for="fullCylinderDate"> Full Cylinder Date</label>
<input type="date" class="form-control" id="fullCylinderDate" name="fullCylinderDate" value="" readonly>
</div>
<div class="col-md-4">
<label for="IGRNO"> IGRNO</label>
<input type="text" class="form-control" id="IGRNO" name="IGRNO" value="" readonly>
</div>
<div class="col-md-4">
<label for="emptyCylinderDate"> Empty Cylinder Date</label>
<input type="date" class="form-control" id="emptyCylinderDate" name="emptyCylinderDate" value="" readonly>
</div>
</div>
<!-- second row -->
<div class="form-group row">
<div class="col-md-4">
<label for="supplierName"> Supplier Name</label>
<input type="text" class="form-control" id="supplierName" name="supplierName" value="" readonly>
</div>
<div class="col-md-4">
<label for="invoiceNo"> Bill No/Invoice No </label>
<input type="text" class="form-control" id="invoiceNo" name="invoiceNo" value="" readonly>
</div>
<div class="col-md-4">
<label for="billDate"> Bill Date</label>
<input type="date" class="form-control" id="billDate" name="billDate" value="" readonly>
</div>
</div>
<!-- third row -->
<div class="form-group row">
<div class="col-md-4">
<label for="driverName"> Driver Name</label>
<input type="text" class="form-control" id="driverName" name="driverName" value="" readonly>
</div>
<div class="col-md-4">
<label for="vehicleNo"> Vehicle No</label>
<input type="text" class="form-control" id="vehicleNo" name="vehicleNo" value="" readonly>
</div>
<div class="col-md-4">
<label for="cylinderCount"> Cylinder Name </label>
<input type="text" class="form-control" id="cylinderName" name="cylinderName" value="" readonly>
</div>
</div>
<hr>
<!-- fourth row -->
<div class="form-group row">
<div class="col-md-4">
<label for="cylinderNo"> Cylinder Number </label>
<input type="text" class="form-control" id="cylinderNo" name="cylinderNo" value="" readonly>
</div>
<div class="col-md-4">
<label for="grossWeight"> Gross Weight </label>
<input type="text" class="form-control" id="grossWeight" name="grossWeight" value="" readonly>
</div>
<div class="col-md-4">
<label for="tareWeight"> Tare Weight </label>
<input type="text" class="form-control" id="tareWeight" name="tareWeight" value="" >
</div>
</div>
<!-- fifth row -->
<div class="form-group row">
<div class="col-md-4">
<label for="netWeight"> Net Weight (Gross-Tare) </label>
<input type="text" class="form-control" id="netWeight" name="netWeight" value="" readonly>
</div>
<div class="col-md-4">
<label for="actualWeight"> ActualWeight </label>
<input type="text" class="form-control" id="actualWeight" name="actualWeight" value="" readonly>
</div>
<div class="col-md-4">
<label for="shortage"> Shortage (Net-Actual) </label>
<input type="text" class="form-control" id="shortage" name="shortage" value="" readonly>
</div>
</div>
<span>* shortage value in positive indicates shortage And negative indicates excess </span>
<!-- hidden fields -->
<input type="hidden" name="id" id="id" >
</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 -->
<!-- format date time helper -->
<script>
function formatDateTime(dateString, flag) {
// Note 1 means DATE only
// 2 means DATE and Time
// Check if the date string is null or empty
if (!dateString || dateString == 'null' || dateString === '0000-00-00 00:00:00') {
return '';
} else {
console.log("Received date string:", dateString);
// Split the date string into date and time components
var dateTimeParts = dateString.split(' ');
var dateParts = dateTimeParts[0].split('-');
var timeParts = dateTimeParts[1].split(':');
// Extract individual components
var year = parseInt(dateParts[0], 10);
var month = parseInt(dateParts[1], 10) - 1; // Months are zero-based in JavaScript
var day = parseInt(dateParts[2], 10);
var hours = parseInt(timeParts[0], 10);
var minutes = parseInt(timeParts[1], 10);
var seconds = parseInt(timeParts[2], 10);
// Create a new Date object
var date = new Date(year, month, day, hours, minutes, seconds);
// Extract date components
var day = date.getDate().toString().padStart(2, '0');
var month = (date.getMonth() + 1).toString().padStart(2, '0'); // Months are zero-based
var year = date.getFullYear();
// Extract time components
var hours = date.getHours().toString().padStart(2, '0');
var minutes = date.getMinutes().toString().padStart(2, '0');
var seconds = date.getSeconds().toString().padStart(2, '0');
var formattedDate = '';
// Format the date and time in DD-MM-YYYY HH:MM:SS format
if (flag == 1) {
formattedDate = `${day}-${month}-${year}`;
} else if (flag == 2) {
formattedDate = `${day}-${month}-${year} ${hours}:${minutes}:${seconds}`;
}
return formattedDate;
}
}
</script>
<!-- number validation -->
<script>
function isNumberKey(evt) {
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode != 46 && charCode > 31 &&
(charCode < 48 || charCode > 57))
return false;
return true;
}
</script>
<!-- data table related initialization -->
<script>
$(document).ready(function() {
// this code for table date filed ordering
$.fn.dataTable.ext.type.order['date-dd-mm-yyyy-pre'] = function(date) {
if (!date) return 0;
var parts = date.split('-'); // Split the date into parts (DD, MM, YYYY)
return new Date(parts[2], parts[1] - 1, parts[0]).getTime(); // Convert to timestamp
};
var orderColumnIndex = <?php echo (session()->get('roleText') == 'Auditor') ? 6 : 0; ?>;
table = $('#view_inward_gate_register').DataTable({
dom: 'Blfrtip',
buttons: [
{
extend: 'excel',
text: 'Excel',
exportOptions: {
columns: ':not(:last-child)' // Exclude the last column
}
}
],
pageLength: 10,
lengthMenu: [
[10, 20, 30, 50, -1],
[10, 20, 30, 50, "All"]
],
responsive: false,
ordering: true,
columnDefs: [
{ targets: parseInt(orderColumnIndex), type: 'date-dd-mm-yyyy' } // Apply custom sorting
],
order: [[parseInt(orderColumnIndex), 'desc']],
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>', // Next button icon
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
}
}
});
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").val('');
$("#toDate").val('');
window.location="gasCylinderPending"
});
// Automatically focus and open the To Date picker when From Date is selected
document.getElementById('fromDate').addEventListener('change', function() {
var fromDate = this.value;
var toDateInput = document.getElementById('toDate');
// Set the min attribute of the To Date input to the selected From Date
toDateInput.min = fromDate;
// Optionally reset the To Date input if the current value is before the new min date
if (toDateInput.value < fromDate) {
toDateInput.value = fromDate;
}
});
});
</script>
<!-- data table related date filter -->
<script>
$(document).ready(function() {
$('#fromDate , #toDate').change(function() {
let fromDate = $('#fromDate').val();
let toDate = $('#toDate').val();
let fromDateObj = new Date(fromDate.split('-').reverse().join('-'));
let toDateObj = new Date(toDate.split('-').reverse().join('-'));
if (fromDateObj > toDateObj) {
alert('Incorrect Date Applied For Filter..!!');
$('#toDate').attr('min', fromDate);
$('#toDate').val('');
}
});
});
</script>
<!-- while Opening gasPendingDetails modal -->
<script>
$(document).on('click', '.gas-pending-details', function() {
let row = $(this).closest("tr");
let fullCylinderDate = row.find("td:eq(0)").text().trim();
let IGRNO = row.find("td:eq(1)").text().trim();
let supplierName = row.find("td:eq(2)").text().trim();
let invoiceNo = row.find("td:eq(3)").text().trim();
let cylinderName = row.find("td:eq(4)").text().trim();
let cylinderNo = row.find("td:eq(5)").text().trim();
let grossWeight = row.find("td:eq(6)").text().trim();
let actualWeight = row.find("td:eq(7)").text().trim();
let billDate = row.find("td:eq(8)").text().trim();
let driverName = row.find("td:eq(9)").text().trim();
let vehicleNo = row.find("td:eq(10)").text().trim();
let cylinderCount = row.find("td:eq(11)").text().trim();
let id = row.find("td:eq(12)").text().trim();
let emptyCylinderDate = new Date().toISOString().slice(0, 10);
// Convert fullCylinderDate to YYYY-MM-DD
if (fullCylinderDate) {
let dateParts = fullCylinderDate.split("-");
fullCylinderDate = `${dateParts[2]}-${dateParts[1]}-${dateParts[0]}`;
}
// Convert billDate to YYYY-MM-DD
if (billDate) {
let dateParts = billDate.split("-");
billDate = `${dateParts[2]}-${dateParts[1]}-${dateParts[0]}`;
}
// Assign values to modal inputs
$('#fullCylinderDate').val(fullCylinderDate);
$('#IGRNO').val(IGRNO);
$('#emptyCylinderDate').val(emptyCylinderDate);
$('#supplierName').val(supplierName);
$('#invoiceNo').val(invoiceNo);
$('#cylinderName').val(cylinderName);
$('#cylinderNo').val(cylinderNo);
$('#grossWeight').val(grossWeight);
$('#actualWeight').val(actualWeight);
$('#billDate').val(billDate);
$('#driverName').val(driverName);
$('#vehicleNo').val(vehicleNo);
$('#cylinderCount').val(cylinderCount);
$('#id').val(id);
// Show the modal
$('#gasPendingDetails').modal('show');
});
</script>
<script>
$(document).on('change','#tareWeight',function(){
let tareWeight = $('#tareWeight').val();
let grossWeight = $('#grossWeight').val();
let netWeight = $('#netWeight').val();
let actualWeight= $('#actualWeight').val();
let shortage = $('#shortage').val();
netWeight = Number(grossWeight) - Number(tareWeight) ;
shortage = Number(netWeight) - Number(actualWeight) ;
$('#netWeight').val(netWeight);
$('#shortage').val(shortage);
})
</script>
<!-- while closing gasPendingDetails modal -->
<script>
$(document).ready(function(){
$('#gasPendingDetails').on("hide.bs.modal", function(e){
$('#fullCylinderDate').val(" ");
$('#IGRNO').val(" ");
$('#emptyCylinderDate').val(" ");
$('#supplierName').val(" ");
$('#invoiceNo').val(" ");
$('#cylinderName').val(" ");
$('#cylinderNo').val(" ");
$('#grossWeight').val(" ");
$('#actualWeight').val(" ");
$('#billDate').val(" ");
$('#driverName').val(" ");
$('#vehicleNo').val(" ");
$('#cylinderCount').val(" ");
$('#id').val(" ");
});
});
</script>
<!-- ajax call for gas Shortage -->
<script>
$(document).ready(function () {
$("#gasPendingDetails form").submit(function (event) {
event.preventDefault(); // Prevent form reload
let method = $("#gasPendingDetails").data("form"); // Get form type
// Collecting form data
let formData = {
fullCylinderDate: $('#fullCylinderDate').val(),
IGRNO: $('#IGRNO').val(),
emptyCylinderDate: $('#emptyCylinderDate').val(),
supplierName: $('#supplierName').val(),
invoiceNo: $('#invoiceNo').val(),
cylinderName: $('#cylinderName').val(),
cylinderNo: $('#cylinderNo').val(),
grossWeight: $('#grossWeight').val(),
tareWeight: $('#tareWeight').val(),
netWeight: $('#netWeight').val(),
actualWeight: $('#actualWeight').val(),
shortage: $('#shortage').val(),
id: $('#id').val(),
};
console.log(formData); // Debugging - Check if data is correct
$('#loader').show(); // Show loader
$.ajax({
type: "POST",
url: "<?php echo base_url()?>/updateGasShortage", // Adjust endpoint as needed
data: JSON.stringify(formData), // Send data as JSON
contentType: "application/json",
dataType: "json",
success: function (response) {
if (response.status === "success") {
alert("Gas Shortage Data Updated Successfully!");
$('#gasPendingDetails').modal('hide'); // Close modal
window.location.reload();
} 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 request completed.");
$('#loader').hide();
}
});
});
});
</script>

View File

@ -0,0 +1,619 @@
<!-- Flatpickr CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<!-- Flatpickr JS -->
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<style>
.num {
text-align: right;
}
#Inwardgateregistertable1 thead tr th{
width: 150px;
word-wrap: break-word;
white-space: normal;
}
th {
white-space: nowrap;
}
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px;
/* Adjust the gap as needed */
}
.Date-filter-form input,
.Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
</style>
<style>
th,
td {
white-space: nowrap;
}
</style>
<style>
.dataTables_wrapper .top {
display: flex;
justify-content: space-between;
align-items: center;
}
.dataTables_wrapper .dataTables_length {
float: left;
}
.footer-textarea {
width: 100%;
padding: 10px;
border-radius: 5px;
border: 1px solid #ccc;
}
.send-btn {
padding: 10px 20px;
background-color: #2ecc71; /* Green color */
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.send-btn:hover {
background-color: #27ae60; /* Darker green on hover */
}
</style>
<script>
$(function() {
var d = new Date();
var month = d.getMonth();
var day = d.getDate();
var year = d.getFullYear();
var SIAStartYear = year - 2015;
var mindt = year - 70;
var maxdt = year - 15;
});
</script>
<style>
.autocomplete-suggestion {
cursor: pointer;
background-color: skyblue;
/* background-color: darkgrey; */
outline: 1px solid slategrey;
}
.igr-remarks{
position: relative;
}
.igr-remarks i{
font-size: 14px;
}
.igr-remarks span{
position: absolute;
top: -5px;
right: -6px;
background-color: transparent;
border-radius: 50px!important;
font-weight: 600;
width: 14px;
box-shadow: 0 0 20px 0 rgba(0,0,0,0.2);
color:#35462c;
}
</style>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/Autocomplete/jquery.autocomplete.js"></script>
<div class="content-page">
<div class="content">
<!-- Start Content-->
<div class="container-fluid">
<!-- start page title -->
<div>
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Inward</a></li>
<li class="breadcrumb-item active">
<h4 class="page-title">Gas Cylinder Returned </h4>
</li>
</ol>
</div>
</div>
</div>
</div>
<?php if (session()->getFlashdata('message')): ?>
<div class="alert alert-warning" role="alert">
<?= esc(session()->getFlashdata('message')); ?>
</div>
<?php endif; ?>
<div class="row">
<div class="col-12">
<div class="card">
<div class="row">
<div class="col-md-8">
<form class="Date-filter-form" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;" method="post" action="<?= base_url('ViewIGR'); ?>">
<label for="fromDate">From:</label>
<input class="form-control date_range form-date-search"
value=""
id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
<label for="toDate">To:</label>
<input class="form-control date_range to-date-search"
value=""
id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
<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"
style="cursor:pointer;"
aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div>
</form>
</div>
<!-- <div class="col-md-4">
<button id="downloadExcel" class="btn btn-primary" style="margin-top: 14px;margin-bottom: -11px;margin-right: 25px;float: right;">Download Excel</button>
</div> -->
</div>
<div class="card-body" style="overflow-x:scroll;">
<table id="view_inward_gate_register" class="table table-bordered table-hover">
<thead>
<tr>
<!-- basic details -->
<th>Full Cylinder Date</th>
<th>IGR No</th>
<th>Supplier</th>
<th>Bill/Invoice No</th>
<th>Cylinder Name</th>
<!-- cylinderdetails -->
<th>Gross Weight</th>
<th>Empty Cylinder Date</th>
<th>Tare Weight</th>
<th>Net Weight</th>
<th>Actual Weight</th>
<th>Shortage</th>
<th>Cylinder Pending</th>
<!-- least details -->
<th>Bill Date</th>
<th>Driver Name</th>
<th>Vehicle No</th>
</tr>
</thead>
<tbody>
<?php if(empty($gasCylinderReturnedList)){?>
<p align="center" > No Gas Cylinder Returned in the Given Dates..!!</p>
<?php }else{ ?>
<?php foreach($gasCylinderReturnedList as $index => $gasCylinder):
$gasCylinder['MaterialRcvdDate'] = date('d-m-Y',strtotime($gasCylinder['MaterialRcvdDate']));
$gasCylinder['DeliveryChellanDate'] = date('d-m-Y',strtotime($gasCylinder['DeliveryChellanDate']));
$gasCylinder['emptyCylinderDate'] = date('d-m-Y',strtotime($gasCylinder['emptyCylinderDate']));
?>
<tr>
<!-- basic details -->
<td><?=$gasCylinder['MaterialRcvdDate']?></td>
<td><?=$gasCylinder['IGRNO-']?></td>
<td><?=$gasCylinder['SupplierName']?></td>
<td><?=$gasCylinder['DeliveryChellanOrInvoiceNo']?></td>
<td><?=$gasCylinder['MaterialName']?></td>
<!-- cylinderdetails -->
<td><?=$gasCylinder['grossWeight']?></td>
<td><?=$gasCylinder['emptyCylinderDate']?></td>
<td><?=$gasCylinder['tareWeight']?></td>
<td><?=$gasCylinder['netWeight']?></td>
<td><?=$gasCylinder['actualWeight']?></td>
<td><?=$gasCylinder['shortage']?></td>
<td><?=$gasCylinder['gasCylinderPendingCount']?></td>
<!-- least details -->
<td><?=$gasCylinder['DeliveryChellanDate']?></td>
<td><?=$gasCylinder['DriverName']?></td>
<td><?=$gasCylinder['VehicleNo']?></td>
</tr>
<?php endforeach ?>
<?php } ?>
</tbody>
</table>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
</div>
</div> <!-- container -->
</div> <!-- content -->
</div>
<!-- box closed here -->
<!-- format date time helper -->
<script>
function formatDateTime(dateString, flag) {
// Note 1 means DATE only
// 2 means DATE and Time
// Check if the date string is null or empty
if (!dateString || dateString == 'null' || dateString === '0000-00-00 00:00:00') {
return '';
} else {
console.log("Received date string:", dateString);
// Split the date string into date and time components
var dateTimeParts = dateString.split(' ');
var dateParts = dateTimeParts[0].split('-');
var timeParts = dateTimeParts[1].split(':');
// Extract individual components
var year = parseInt(dateParts[0], 10);
var month = parseInt(dateParts[1], 10) - 1; // Months are zero-based in JavaScript
var day = parseInt(dateParts[2], 10);
var hours = parseInt(timeParts[0], 10);
var minutes = parseInt(timeParts[1], 10);
var seconds = parseInt(timeParts[2], 10);
// Create a new Date object
var date = new Date(year, month, day, hours, minutes, seconds);
// Extract date components
var day = date.getDate().toString().padStart(2, '0');
var month = (date.getMonth() + 1).toString().padStart(2, '0'); // Months are zero-based
var year = date.getFullYear();
// Extract time components
var hours = date.getHours().toString().padStart(2, '0');
var minutes = date.getMinutes().toString().padStart(2, '0');
var seconds = date.getSeconds().toString().padStart(2, '0');
var formattedDate = '';
// Format the date and time in DD-MM-YYYY HH:MM:SS format
if (flag == 1) {
formattedDate = `${day}-${month}-${year}`;
} else if (flag == 2) {
formattedDate = `${day}-${month}-${year} ${hours}:${minutes}:${seconds}`;
}
return formattedDate;
}
}
</script>
<!-- number validation -->
<script>
function isNumberKey(evt) {
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode != 46 && charCode > 31 &&
(charCode < 48 || charCode > 57))
return false;
return true;
}
</script>
<!-- data table related initialization -->
<script>
$(document).ready(function() {
// this code for table date filed ordering
$.fn.dataTable.ext.type.order['date-dd-mm-yyyy-pre'] = function(date) {
if (!date) return 0;
var parts = date.split('-'); // Split the date into parts (DD, MM, YYYY)
return new Date(parts[2], parts[1] - 1, parts[0]).getTime(); // Convert to timestamp
};
var orderColumnIndex = <?php echo (session()->get('roleText') == 'Auditor') ? 6 : 0; ?>;
table = $('#view_inward_gate_register').DataTable({
dom: 'Blfrtip',
buttons: [
{
extend: 'excel',
text: 'Excel',
exportOptions: {
columns: ':not(:last-child)' // Exclude the last column
}
}
],
pageLength: 10,
lengthMenu: [
[10, 20, 30, 50, -1],
[10, 20, 30, 50, "All"]
],
responsive: false,
ordering: true,
columnDefs: [
{ targets: parseInt(orderColumnIndex), type: 'date-dd-mm-yyyy' } // Apply custom sorting
],
order: [[parseInt(orderColumnIndex), 'desc']],
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>', // Next button icon
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
}
}
});
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").val('');
$("#toDate").val('');
window.location="gasCylinderReturned"
});
// Automatically focus and open the To Date picker when From Date is selected
document.getElementById('fromDate').addEventListener('change', function() {
var fromDate = this.value;
var toDateInput = document.getElementById('toDate');
// Set the min attribute of the To Date input to the selected From Date
toDateInput.min = fromDate;
// Optionally reset the To Date input if the current value is before the new min date
if (toDateInput.value < fromDate) {
toDateInput.value = fromDate;
}
});
});
</script>
<!-- data table related date filter -->
<script>
$(document).ready(function() {
$('#fromDate , #toDate').change(function() {
let fromDate = $('#fromDate').val();
let toDate = $('#toDate').val();
let fromDateObj = new Date(fromDate.split('-').reverse().join('-'));
let toDateObj = new Date(toDate.split('-').reverse().join('-'));
if (fromDateObj > toDateObj) {
alert('Incorrect Date Applied For Filter..!!');
$('#toDate').attr('min', fromDate);
$('#toDate').val('');
}
});
});
</script>
<!-- while Opening gasEnteredDetails modal -->
<script>
$(document).on('click', '.gas-entered-details', function() {
let row = $(this).closest("tr");
let fullCylinderDate = row.find("td:eq(0)").text().trim();
let igrNo = row.find("td:eq(1)").text().trim();
let supplierName = row.find("td:eq(2)").text().trim();
let invoiceNo = row.find("td:eq(3)").text().trim();
let billDate = row.find("td:eq(4)").text().trim();
let driverName = row.find("td:eq(5)").text().trim();
let vehicleNo = row.find("td:eq(6)").text().trim();
let cylinderName = row.find("td:eq(7)").text().trim();
let cylinderCount = parseInt(row.find("td:eq(8)").text().trim(), 10);
// Convert fullCylinderDate to YYYY-MM-DD
if (fullCylinderDate) {
let dateParts = fullCylinderDate.split("-");
fullCylinderDate = `${dateParts[2]}-${dateParts[1]}-${dateParts[0]}`;
}
// Convert billDate to YYYY-MM-DD
if (billDate) {
let dateParts = billDate.split("-");
billDate = `${dateParts[2]}-${dateParts[1]}-${dateParts[0]}`;
}
// Assign values to modal inputs
$('#fullCylinderDate').val(fullCylinderDate);
$('#IGRNO').val(igrNo);
$('#supplierName').val(supplierName);
$('#invoiceNo').val(invoiceNo);
$('#billDate').val(billDate);
$('#driverName').val(driverName);
$('#vehicleNo').val(vehicleNo);
$('#cylinderName').val(cylinderName);
$('#cylinderCount').val(cylinderCount);
// Clear previous cylinder inputs
$('#cylinderDiv').html("");
// Generate cylinder input fields dynamically
if (cylinderCount > 0) {
let inputFields = `
<div class="form-group row">
<div class="col-md-4"><label>Cylinder Number</label> <span class="text-danger">*</span> </div>
<div class="col-md-4"><label>Gross Weight</label> <span class="text-danger">*</span> </div>
<div class="col-md-4"><label>Actual Weight</label> <span class="text-danger">*</span> </div>
</div>`;
for (let i = 1; i <= cylinderCount; i++) {
inputFields += `
<div class="form-group row dynamicField">
<div class="col-md-4">
<input type="text" class="form-control" name="cylinderNumber[]" placeholder="Cylinder ${i}" required>
</div>
<div class="col-md-4">
<input type="number" class="form-control" name="grossWeight[]" placeholder="Gross Weight ${i}" required>
</div>
<div class="col-md-4">
<input type="number" class="form-control" name="actualWeight[]" placeholder="Actual Weight ${i}" required>
</div>
</div>`;
}
$('#cylinderDiv').html(inputFields);
}
// Show the modal
$('#gasEnteredDetails').modal('show');
});
</script>
<!-- while closing gasEnteredDetails modal -->
<script>
$(document).ready(function(){
$('#gasEnteredDetails').on("hide.bs.modal", function(e){
$('#fullCylinderDate').val(" ");
$('#IGRNO').val(" ");
$('#supplierName').val(" ");
$('#invoiceNo').val(" ");
$('#billDate').val(" ");
$('#driverName').val(" ");
$('#vehicleNo').val(" ");
$('#cylinderName').val(" ");
$('#cylinderCount').val(" ");
$('#cylinderDiv').html("");
});
});
</script>
<!-- end of add gas shortage calculator -->
<!-- ajax call for gas Shortage -->
<script>
$(document).ready(function () {
$("#gasEnteredDetails form").submit(function (event) {
event.preventDefault(); // Prevent form reload
let method = $("#gasEnteredDetails").data("form"); // Get form type
// Collecting form data
let formData = {
fullCylinderDate: $("#fullCylinderDate").val(),
IGRNO: $("#IGRNO").val(),
supplierName: $("#supplierName").val(),
invoiceNo: $("#invoiceNo").val(),
billDate: $("#billDate").val(),
driverName: $("#driverName").val(),
vehicleNo: $("#vehicleNo").val(),
cylinderName: $('#cylinderName').val(),
cylinderCount: $("#cylinderCount").val(),
cylinders: [] // Array to store cylinder details
};
// Loop through dynamically generated cylinder inputs
$("#cylinderDiv .form-group.row.dynamicField").each(function () {
let cylinderData = {
cylinderNo : $(this).find("input[name='cylinderNumber[]']").val(),
grossWeight : $(this).find("input[name='grossWeight[]']").val(),
actualWeight: $(this).find("input[name='actualWeight[]']").val(),
};
formData.cylinders.push(cylinderData);
});
console.log(formData); // Debugging - Check if data is correct
$('#loader').show(); // Show loader
$.ajax({
type: "POST",
url: "<?php echo base_url()?>/updateGasShortage", // Adjust endpoint as needed
data: JSON.stringify(formData), // Send data as JSON
contentType: "application/json",
dataType: "json",
success: function (response) {
if (response.status === "success") {
alert("Gas Shortage Data Saved Successfully!");
$('#gasEnteredDetails').modal('hide'); // Close modal
} 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 request completed.");
$('#loader').hide();
}
});
});
});
</script>

View File

@ -718,7 +718,7 @@
<!-- IGR module --> <!-- IGR module -->
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Auditor' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Stock Handler'){?> <?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Auditor' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Stock Handler' || session()->get('roleText') == 'Lab Staff'){?>
<!-- Inward Module --> <!-- Inward Module -->
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-purchase" role="button" <a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-purchase" role="button"
@ -740,12 +740,30 @@
View Inward Gate Register</a> View Inward Gate Register</a>
</div> </div>
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Auditor'){?> <?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Auditor' || session()->get('roleText') == 'Lab Staff'){?>
<div class=""> <div class="">
<a href="<?php echo base_url(); ?>ListIGR" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i> <a href="<?php echo base_url(); ?>ListIGR" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i>
Non IGR / Expense</a> Non IGR / Expense</a>
</div> </div>
<?php } ?> <?php } ?>
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Auditor' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Stock Handler'){?>
<div class="dropdown" >
<a class="dropdown-item dropdown-toggle arrow-none" href="#" id="topnav-po"
role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-arrow-down mr-1"></i> Gas Shortage <div class="arrow-down"></div>
</a>
<div class="dropdown-menu" aria-labelledby="topnav-po" >
<a href="<?php echo base_url(); ?>gasCylinderEntered" class="dropdown-item"><i class="fa fa-truck mr-1"></i>Gas Cylinder Entered</a>
<a href="<?php echo base_url(); ?>gasCylinderPending" class="dropdown-item"><i class="fa fa fa-hourglass-half mr-1"></i>Gas Cylinder Pending </a>
<a href="<?php echo base_url(); ?>gasCylinderReturned" class="dropdown-item"><i class="fa fa-check mr-1"></i>Gas Cylinder Returned</a>
</div>
</div>
<?php } ?>
</div> </div>
</li> </li>
<?php } ?> <?php } ?>
@ -865,7 +883,7 @@
<!-- Stock module --> <!-- Stock module -->
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Stock Handler'){?> <?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Stock Handler' || session()->get('roleText') == 'Lab Staff'){?>
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-stock" role="button" <a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-stock" role="button"

View File

@ -13,7 +13,7 @@
color: #3A3A3A; color: #3A3A3A;
background: #FFFFFF; background: #FFFFFF;
font-family: sans-serif; font-family: sans-serif;
font-size: 0.8em; font-size: 12px;
} }
.main-table { .main-table {
@ -34,21 +34,57 @@
.form-title { .form-title {
font-weight: bold; font-weight: bold;
padding: 10px 0; padding: 10px 1px;
} }
#leaveDetails { #leaveDetails {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
} }
#leaveDetails td, #leaveDetails th { #leaveDetails th, #leaveDetails td {
border: 1px solid #000 !important; border: 0 !important; /* Reset all borders first */
} }
/* Header Row */
#leaveDetails th:nth-child(1) { /* From Date */
border-right: 1px solid #000;
border-bottom: 1px solid #000;
}
#leaveDetails th:nth-child(2) { /* To Date */
border-left: 1px solid #000;
border-right: 1px solid #000;
border-bottom: 1px solid #000;
}
#leaveDetails th:nth-child(3) { /* No's Days */
border-left: 1px solid #000;
border-bottom: 1px solid #000;
}
/* Data Row */
#leaveDetails td:nth-child(1) { /* From Date value */
border-right: 1px solid #000;
border-top: 1px solid #000;
}
#leaveDetails td:nth-child(2) { /* To Date value */
border-left: 1px solid #000;
border-right: 1px solid #000;
border-top: 1px solid #000;
}
#leaveDetails td:nth-child(3) { /* No's Days value */
border-left: 1px solid #000;
border-top: 1px solid #000;
}
#leaveDetails td, #leaveDetails th {
padding: 5px; /* or 0 if you want no padding */
margin: 0;
}
.signature-section {
padding-top: 40px;
}
</style> </style>
</head> </head>
@ -75,7 +111,7 @@
<table class="main-table"> <table class="main-table">
<!-- Company Name & Address --> <!-- Company Name & Address -->
<tr> <tr>
<td colspan="12" class="text-center"> <td colspan="12" class="text-center" style="width:12.5em">
<div class="company-header"><?php echo $CompanyName ? _htmlsc($CompanyName) : ""; ?></div> <div class="company-header"><?php echo $CompanyName ? _htmlsc($CompanyName) : ""; ?></div>
<?php if ($CompanyAddress) { <?php if ($CompanyAddress) {
echo '<div>' . _htmlsc($CompanyAddress) . '</div>'; echo '<div>' . _htmlsc($CompanyAddress) . '</div>';
@ -90,36 +126,36 @@
<!-- Employee Details --> <!-- Employee Details -->
<tr> <tr>
<td colspan="5" class="text-right"><?php echo trans('Employee Name'); ?></td> <td colspan="3" class="text-right"><?php echo trans('Employee Name'); ?></td>
<td colspan="7" class="text-left"><?php echo _htmlsc($emp_name); ?></td> <td colspan="9" class="text-left"><?php echo _htmlsc($emp_name); ?></td>
</tr> </tr>
<tr> <tr>
<td colspan="5" class="text-right"><?php echo trans('Employee ID'); ?></td> <td colspan="3" class="text-right"><?php echo trans('Employee ID'); ?></td>
<td colspan="7" class="text-left"><?php echo _htmlsc($emp_id); ?></td> <td colspan="9" class="text-left"><?php echo _htmlsc($emp_id); ?></td>
</tr> </tr>
<tr> <tr>
<td colspan="5" class="text-right"><?php echo trans('Department'); ?></td> <td colspan="3" class="text-right"><?php echo trans('Department'); ?></td>
<td colspan="7" class="text-left"><?php echo _htmlsc($department); ?></td> <td colspan="9" class="text-left"><?php echo _htmlsc($department); ?></td>
</tr> </tr>
<tr> <tr>
<td colspan="5" class="text-right"><?php echo trans('Designation'); ?></td> <td colspan="3" class="text-right"><?php echo trans('Designation'); ?></td>
<td colspan="7" class="text-left"><?php echo _htmlsc($designation); ?></td> <td colspan="9" class="text-left"><?php echo _htmlsc($designation); ?></td>
</tr> </tr>
<!-- Leave Details Table --> <!-- Leave Details Table -->
<tr> <tr>
<td colspan="5" class="text-right"><?php echo trans('No. of days'); ?></td> <td colspan="3" class="text-right"><?php echo trans('Date Range'); ?></td>
<td colspan="7"> <td colspan="9" style="padding: 0 !important;margin: 0 !important">
<table id="leaveDetails"> <table id="leaveDetails">
<tr> <tr>
<th>From Date</th> <th>From Date</th>
<th>To Date</th> <th>To Date</th>
<th>No's Days</th> <th>No Of Days</th>
</tr> </tr>
<tr> <tr>
<td><?php echo _htmlsc($start_date); ?></td> <td class="text-center"><?php echo _htmlsc($start_date); ?></td>
<td><?php echo _htmlsc($end_date); ?></td> <td class="text-center"><?php echo _htmlsc($end_date); ?></td>
<td><?php echo _htmlsc($no_of_days); ?></td> <td class="text-center"><?php echo _htmlsc($no_of_days); ?></td>
</tr> </tr>
</table> </table>
</td> </td>
@ -127,20 +163,20 @@
<!-- Status and Reason --> <!-- Status and Reason -->
<tr> <tr>
<td colspan="5" class="text-right"><?php echo trans('Status'); ?></td> <td colspan="3" class="text-right"><?php echo trans('Status'); ?></td>
<td colspan="7" class="text-left"><?php echo _htmlsc($status); ?></td> <td colspan="9" class="text-left"><?php echo _htmlsc($status); ?></td>
</tr> </tr>
<tr> <tr>
<td colspan="5" class="text-right"><?php echo trans('Reason'); ?></td> <td colspan="3" class="text-right"><?php echo trans('Reason'); ?></td>
<td colspan="7" class="text-left"><?php echo _htmlsc($reason); ?></td> <td colspan="9" class="text-left"><?php echo _htmlsc($reason); ?></td>
</tr> </tr>
<!-- Signature Section --> <!-- Signature Section -->
<tr> <tr>
<td colspan="6" class="text-center signature-section"> <td colspan="6" class="text-center" style="height: 50px; padding-top: 50px;">
<h6>Employee Signatory</h6> <h6>Employee Signatory</h6>
</td> </td>
<td colspan="6" class="text-center signature-section"> <td colspan="6" class="text-center" style="height: 50px; padding-top: 50px;">
<h6>Authorized Signatory</h6> <h6>Authorized Signatory</h6>
</td> </td>
</tr> </tr>

View File

@ -47,7 +47,6 @@
} }
</style> </style>
<?php <?php
$sample = $fresh; $sample = $fresh;
$ex = explode('-', $dropdownvalue); $ex = explode('-', $dropdownvalue);
@ -211,7 +210,7 @@
</div> </div>
</div> </div>
<?php // echo "<pre>"; print_r($fresh); echo "</pre>"; ?>
<div class="table-responsive" id="table-responsive" style="overflow-x:scroll;"> <div class="table-responsive" id="table-responsive" style="overflow-x:scroll;">
<table id="monthlylistings" class="table table-bordered table-hover fht-table" <table id="monthlylistings" class="table table-bordered table-hover fht-table"
style="background-color:#fff;font-size:12px;white-space: nowrap;"> style="background-color:#fff;font-size:12px;white-space: nowrap;">
@ -521,7 +520,7 @@
<td style="text-align:right;" style="background-color:blue;"> <td style="text-align:right;" style="background-color:blue;">
<?php echo $inx; ?></td> <?php echo $inx; ?></td>
<td style="max-width:80px"><?php echo $record->EmpID; ?></td> <td style="max-width:80px"><?php echo $record->EmpID; ?></td>
<td style="background-color: #d8d8ea;" > <td> <!-- style="background-color: #6cb4ff17;" -->
<?php echo $record->FirstName; ?> <?php echo $record->FirstName; ?>
</td> </td>
<td style="max-width: 100px;"> <td style="max-width: 100px;">

View File

@ -49,11 +49,20 @@
<div class="container-fluid"> <div class="container-fluid">
<!-- start page title --> <!-- start page title -->
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-10 mt-2">
<div class="page-title-box page-title-box-alt"> <div class="page-title-box page-title-box-alt">
<h4 class="page-title">Material Master Details</h4> <h4 class="page-title">Material Master Details</h4>
</div> </div>
</div> </div>
<div class="col-2 text-right pr-3">
<a class="btn btn-success"
href="<?php echo base_url(); ?>addRawmaterial">
Add New Material
</a>
</div>
</div> </div>
<?php <?php
helper('form'); helper('form');
@ -74,7 +83,7 @@
<div class="card"> <div class="card">
<div class="row"> <div class="row">
<div class="col-8"> <div class="col-10">
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px; margin-bottom: -11px; margin-left: 33px;"> <form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px; margin-bottom: -11px; margin-left: 33px;">
<input type="hidden" name="table" value="requisition"> <input type="hidden" name="table" value="requisition">
@ -116,12 +125,10 @@
<div class="error" id="error"></div> <div class="error" id="error"></div>
</form> </form>
</div> </div>
<div class="col-2">
<a class="btn btn-success mt-3" href="<?php echo base_url(); ?>addRawmaterial">Add New Material</a>
</div>
<div class="col-2"> <div class="col-2">
<div style="margin-left:auto"> <div style="margin-left:auto">
<div class="form-check mt-4" style="margin-right: 25px;"> <div class="form-check mt-4 mr-2 text-right" >
<form id="archiveFormId" action="<?php echo base_url()?>/rawmaterialListing" method="post"> <form id="archiveFormId" action="<?php echo base_url()?>/rawmaterialListing" method="post">
<input class="form-check-input" type="checkbox" id="showArchiveId" <input class="form-check-input" type="checkbox" id="showArchiveId"
name="showArchive" value="1" <?php echo $showArchive ? "checked" : " " ?> name="showArchive" value="1" <?php echo $showArchive ? "checked" : " " ?>

View File

@ -373,13 +373,13 @@
<input type="text" id="searchInput" placeholder="Search..." <input type="text" id="searchInput" placeholder="Search..."
class="mt-2" class="mt-2"
style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc; style="padding: 8px;margin-bottom: 10px;width: 250px;border: 2px solid rgb(123, 11, 214);
border-radius: 5px;margin-right:15px;"> border-radius: 5px;margin-right:15px;">
<i class="fa fa-table btn-lg mt-2" <i class="fa fa-table btn-lg mt-2"
title="Date Range Filter" title="Date Range Filter"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(95, 102, 105)"
data-toggle="modal" data-toggle="modal"
data-target="#filterModalId"> data-target="#filterModalId">
@ -387,13 +387,13 @@
<i class="fa fa-download btn-lg mt-2" <i class="fa fa-download btn-lg mt-2"
title="Excel Download" title="Excel Download"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color: #0b7cba"
id="coatingMachineDetailsExport"> id="coatingMachineDetailsExport">
</i> </i>
<i class="fe-maximize noti-icon btn-lg mt-2" <i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen" title="Full Screen"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()"> onclick="toggleDivFullscreen()">
</i> </i>
@ -402,7 +402,7 @@
title="Add Entry" title="Add Entry"
data-target="#coatingMachineDetailModal" data-target="#coatingMachineDetailModal"
data-toggle="modal" data-toggle="modal"
style="font-size: x-large; cursor:pointer;"> style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)" >
</i> </i>
@ -429,18 +429,28 @@
</div> </div>
<!-- form --> <!-- form -->
<form method="post" <form
id="additionalEntriesForm"
method="post"
enctype="multipart/form-data" enctype="multipart/form-data"
action="<?php echo base_url(); ?>addNewCoatingMachineDetails?month=<?= $month; ?>"> action="<?php echo base_url(); ?>addNewCoatingMachineDetails?month=<?= $month; ?>">
<div class="modal-body"> <div class="modal-body">
<div class="form-row"> <div class="form-row">
<?php $calendarStartDate = DateTime::createFromFormat('M-Y', $month)->modify('first day of this month')->format('Y-m-d'); ?>
<?php $calendarEndDate = DateTime::createFromFormat('M-Y', $month)->modify('last day of this month')->format('Y-m-d'); ?>
<?php $calendarCurrentDate = DateTime::createFromFormat('M-Y', $month)->format('Y-m-d'); ?>
<!-- date --> <!-- date -->
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="dateId">Date</label> <label for="dateId">Date</label>
<span class="badge mandatory">*</span> <span class="badge mandatory">*</span>
<input type="date" class="form-control" id="dateId" name="date" value="" required> <input type="date" class="form-control" id="dateId" name="date"
value="<?=$calendarCurrentDate?>"
min="<?= $calendarStartDate ?>"
max="<?= $calendarEndDate ?>"
required>
</div> </div>
<!-- shift --> <!-- shift -->
@ -626,7 +636,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button> <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary">Save </button> <button type="submit" class="btn btn-primary submit-btn">Save </button>
</div> </div>
</form> </form>
</div> </div>
@ -650,7 +660,7 @@
</div> </div>
<!-- form --> <!-- form -->
<form method="post" id="editCoatingMachineDetailModalFormId" <form method="post" id="editEntriesForm"
enctype="multipart/form-data" enctype="multipart/form-data"
action="<?php echo base_url(); ?>updateCoatingMachineDetails?month=<?= $month; ?>"> action="<?php echo base_url(); ?>updateCoatingMachineDetails?month=<?= $month; ?>">
<div class="modal-body"> <div class="modal-body">
@ -661,7 +671,7 @@
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="editDateId">Date</label> <label for="editDateId">Date</label>
<span class="badge mandatory">*</span> <span class="badge mandatory">*</span>
<input type="date" class="form-control" id="editDateId" name="date" value="" required> <input type="date" class="form-control" id="editDateId" name="date" value="" required readonly>
<input type="hidden" name="editCoatingMachineDetailId" id="editCoatingMachineDetailId"> <input type="hidden" name="editCoatingMachineDetailId" id="editCoatingMachineDetailId">
</div> </div>
@ -847,7 +857,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="cancelBtn">Cancel</button> <button type="button" class="btn btn-secondary" data-dismiss="modal" id="cancelBtn">Cancel</button>
<button type="submit" class="btn btn-primary">Save </button> <button type="submit" class="btn btn-primary submit-btn">Save </button>
</div> </div>
</form> </form>
</div> </div>
@ -944,8 +954,8 @@
<th class="celda_encabezado_general">Total Coating</th> <th class="celda_encabezado_general">Total Coating</th>
<th class="celda_encabezado_general">Total Coating Sand(kg)</th> <th class="celda_encabezado_general">Total Coating Sand(kg)</th>
<th class="celda_encabezado_general">Total Gas Consumption</th> <th class="celda_encabezado_general">Total Gas Consumption</th>
<th class="celda_encabezado_general">Hour Gas</th> <th class="celda_encabezado_general">Per Hour Gas</th>
<th class="celda_encabezado_general">Hour QTY(kg)</th> <th class="celda_encabezado_general">Per Hour QTY(kg)</th>
<th class="celda_encabezado_general">Action</th> <th class="celda_encabezado_general">Action</th>
</tr> </tr>
</thead> </thead>
@ -984,7 +994,8 @@
<!-- td:eq(4) --> <!-- td:eq(4) -->
<td class="celda_normal"><?php echo $record['machineRunningInHrs'] ?? ' ' ?></td> <td class="celda_normal"><?php echo $record['machineRunningInHrs'] ?? ' ' ?></td>
<!-- td:eq(5) --> <!-- td:eq(5) -->
<td class="celda_normal"><?php echo $record['customerName'] ?? '' ?></td> <td class="celda_normal"
style="text-align: left !important;"><?php echo $record['customerName'] ?? '' ?></td>
<!-- td:eq(6) --> <!-- td:eq(6) -->
<td class="celda_normal"><?php echo $record['grade'] ?? ' ' ?></td> <td class="celda_normal"><?php echo $record['grade'] ?? ' ' ?></td>
<!-- td:eq(7) --> <!-- td:eq(7) -->
@ -994,9 +1005,9 @@
<!-- td:eq(9) --> <!-- td:eq(9) -->
<td class="celda_normal"><?php echo $record['totalGasConsumption'] ?></td> <td class="celda_normal"><?php echo $record['totalGasConsumption'] ?></td>
<!-- td:eq(10) --> <!-- td:eq(10) -->
<td class="celda_normal"><?php echo $record['perHourGasConsumption'] ?? '' ?></td> <td class="celda_normal"><?php echo round($record['perHourGasConsumption']) ?? '' ?></td>
<!-- td:eq(11) --> <!-- td:eq(11) -->
<td class="celda_normal"><?php echo $record['perHourCoatingSandQTY'] ?? '' ?></td> <td class="celda_normal"><?php echo round($record['perHourCoatingSandQTY']) ?? '' ?></td>
<!-- td:eq(12) --> <!-- td:eq(12) -->
<!-- edit and download option..!! --> <!-- edit and download option..!! -->
<td class="celda_normal"> <td class="celda_normal">
@ -1069,8 +1080,8 @@
<td class="celda_normal "><?= $summary['totalCoating'] ?></td> <td class="celda_normal "><?= $summary['totalCoating'] ?></td>
<td class="celda_normal "><?= $summary['totalCoatingSandInKg'] ?></td> <td class="celda_normal "><?= $summary['totalCoatingSandInKg'] ?></td>
<td class="celda_normal "><?= $summary['totalGasConsumption'] ?></td> <td class="celda_normal "><?= $summary['totalGasConsumption'] ?></td>
<td class="celda_normal "><?= number_format($summary['totalGasConsumption'] / $summary['totalMachineRunningHrs'], 2) ?> (avg)</td> <td class="celda_normal "><?= round($summary['totalGasConsumption'] / $summary['totalMachineRunningHrs']) ?> (A)</td>
<td class="celda_normal "><?= number_format($summary['totalCoatingSandInKg'] / $summary['totalMachineRunningHrs'], 2) ?> (avg)</td> <td class="celda_normal "><?= round($summary['totalCoatingSandInKg'] / $summary['totalMachineRunningHrs']) ?> (A)</td>
</tr> </tr>
</tfoot> </tfoot>
@ -1085,6 +1096,8 @@
</tbody> </tbody>
</table> </table>
</div> </div>
@ -1093,6 +1106,12 @@
<h5 align="center" style="color:grey;"> <h5 align="center" style="color:grey;">
No Coating Machine Details present in this month No Coating Machine Details present in this month
</h5> </h5>
<?php }else{?>
<br>
<p align="center">Note :- (A) -> Average</p>
<?php } ?> <?php } ?>
@ -1838,8 +1857,10 @@
div.style.height = "100%"; div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen // Reset .table-responsive height when exiting fullscreen
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) { if (tableResponsive) {
tableResponsive.style.height = "auto"; tableResponsive.style.maxHeight = "450px";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
} }
}).catch(err => console.log("Error exiting fullscreen:", err)); }).catch(err => console.log("Error exiting fullscreen:", err));
} }
@ -1912,3 +1933,26 @@
</script> </script>
<script>
document.getElementById('additionalEntriesForm').addEventListener('submit', function() {
event.preventDefault(); // Prevent default form submission
const submitButtons = document.getElementsByClassName('submit-btn');
for (let i = 0; i < submitButtons.length; i++) {
submitButtons[i].disabled = true;
submitButtons[i].innerText = 'Submitting...';
}
this.submit(); // Submit the form programmatically
});
document.getElementById('editEntriesForm').addEventListener('submit', function() {
event.preventDefault(); // Prevent default form submission
const submitButtons = document.getElementsByClassName('submit-btn');
for (let i = 0; i < submitButtons.length; i++) {
submitButtons[i].disabled = true;
submitButtons[i].innerText = 'Submitting...';
}
this.submit(); // Submit the form programmatically
});
</script>

View File

@ -212,7 +212,7 @@
background-color: #50bbd9; background-color: #50bbd9;
/* Green background */ /* Green background */
color: #ffffff; color: #ffffff;
border: 1px solid #ddd; border: 2px solid ;
padding: 10px; padding: 10px;
white-space: normal; white-space: normal;
/* Allows text to wrap */ /* Allows text to wrap */
@ -349,7 +349,7 @@ foreach ($period as $day) {
<input type="text" id="searchInput" placeholder="Search..." <input type="text" id="searchInput" placeholder="Search..."
class="mt-2" class="mt-2"
style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc; style=" padding: 8px;margin-bottom: 10px;width: 250px;border: 2px solid rgb(123, 11, 214);
border-radius: 5px;margin-right:15px;"> border-radius: 5px;margin-right:15px;">
@ -358,7 +358,7 @@ foreach ($period as $day) {
if ($month == date('M-Y')) { if ($month == date('M-Y')) {
?> ?>
<i class="fa fa-cog btn-lg mt-2" <i class="fa fa-cog btn-lg mt-2"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(95, 102, 105)"
title="Customize" title="Customize"
data-target="#customizeModalId" data-target="#customizeModalId"
data-toggle="modal"> data-toggle="modal">
@ -373,25 +373,25 @@ foreach ($period as $day) {
title="Navigation" title="Navigation"
data-toggle="modal" data-toggle="modal"
data-target="#bs-example-modal-lg" data-target="#bs-example-modal-lg"
style="font-size: x-large; cursor:pointer;"> style="font-size: x-large; cursor:pointer; color: #bd0906">
</i> </i>
<i class="fa fa-download btn-lg mt-2" <i class="fa fa-download btn-lg mt-2"
title="Excel Download" title="Excel Download"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color: #0b7cba"
id="bagStockExport"> id="bagStockExport">
</i> </i>
<i class="fe-maximize noti-icon btn-lg mt-2" <i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen" title="Full Screen"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()"> onclick="toggleDivFullscreen()">
</i> </i>
<i class="fas fa-save btn-lg mt-2" <i class="fas fa-save btn-lg mt-2"
title="Save" title="Save"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)"
id="saveId"> id="saveId">
</i> </i>
@ -1364,13 +1364,15 @@ foreach ($period as $day) {
}).catch(err => console.log("Error enabling fullscreen:", err)); }).catch(err => console.log("Error enabling fullscreen:", err));
} else { } else {
document.exitFullscreen().then(() => { document.exitFullscreen().then(() => {
div.style.width = "100%";
div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen // Reset .table-responsive height when exiting fullscreen
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) { if (tableResponsive) {
tableResponsive.style.height = "auto"; tableResponsive.style.maxHeight = "450px";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
} }
}).catch(err => console.log("Error exiting fullscreen:", err)); }).catch(err => console.log("Error exiting fullscreen:", err));
} }

View File

@ -213,7 +213,7 @@
background-color: #50bbd9; background-color: #50bbd9;
/* Green background */ /* Green background */
color: #ffffff; color: #ffffff;
border: 1px solid #ddd; border: 2px solid ;
padding: 10px; padding: 10px;
} }
@ -337,7 +337,7 @@ foreach ($period as $day) {
<input type="text" id="searchInput" placeholder="Search..." <input type="text" id="searchInput" placeholder="Search..."
class="mt-2" class="mt-2"
style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc; style=" padding: 8px;margin-bottom: 10px;width: 250px;border: 2px solid rgb(123, 11, 214);
border-radius: 5px;margin-right:15px;"> border-radius: 5px;margin-right:15px;">
@ -346,7 +346,7 @@ foreach ($period as $day) {
if ($month == date('M-Y')) { if ($month == date('M-Y')) {
?> ?>
<i class="fa fa-cog btn-lg mt-2" <i class="fa fa-cog btn-lg mt-2"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(95, 102, 105)"
title="Customize" title="Customize"
data-target="#customizeModalId" data-target="#customizeModalId"
data-toggle="modal"> data-toggle="modal">
@ -361,25 +361,26 @@ foreach ($period as $day) {
title="Navigation" title="Navigation"
data-toggle="modal" data-toggle="modal"
data-target="#bs-example-modal-lg" data-target="#bs-example-modal-lg"
style="font-size: x-large; cursor:pointer;"> style="font-size: x-large; cursor:pointer; color: #bd0906">
</i> </i>
<i class="fa fa-download btn-lg mt-2" <i class="fa fa-download btn-lg mt-2"
title="Excel Download" title="Excel Download"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color: #0b7cba"
id="dieselMachineStockDetailsExport "> id="bagStockExport">
</i> </i>
<i class="fe-maximize noti-icon btn-lg mt-2" <i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen" title="Full Screen"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()"> onclick="toggleDivFullscreen()">
</i> </i>
<i class="fas fa-save btn-lg mt-2" <i class="fas fa-save btn-lg mt-2"
title="Save" title="Save"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)"
id="saveId"> id="saveId">
</i> </i>
@ -574,11 +575,11 @@ foreach ($period as $day) {
<tbody style="background-color: #fff;"> <tbody style="background-color: #fff;">
<?php if (!empty($totalDiesel)) { <?php if (!empty($totalDiesel) && !empty($groupedDieselMachineStockDetails)) {
$summary = []; $summary = [];
foreach ($groupedDieselMachineStockDetails as $groupedDieselMachineStockDetailsIndex => $dieselStockDetails) { foreach ($groupedDieselMachineStockDetails as $rowIndex => $dieselStockDetails) {
?> ?>
<tr <tr
@ -594,7 +595,7 @@ foreach ($period as $day) {
<?php <?php
$startDate = DateTime::createFromFormat('Y-m-d', $totalDiesel[$groupedDieselMachineStockDetailsIndex]['date'])->format('d-m-Y'); $startDate = DateTime::createFromFormat('Y-m-d', $totalDiesel[$rowIndex]['date'])->format('d-m-Y');
?> ?>
<td class="celda_normal"> <td class="celda_normal">
@ -603,37 +604,37 @@ foreach ($period as $day) {
<td class="celda_normal openingTD" <td class="celda_normal openingTD"
data-id="<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['date'] ?>" data-id="<?= $totalDiesel[$rowIndex]['date'] ?>"
<?php if ($groupedDieselMachineStockDetailsIndex == 0): ?> <?php if ($rowIndex == 0): ?>
oninput="openingTDStockChange(this)" oninput="openingTDStockChange(this)"
contenteditable="true" contenteditable="true"
<?php endif; ?>><?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['opening_stock'] ?? ' ' ?></td> <?php endif; ?>><?= $totalDiesel[$rowIndex]['opening_stock'] ?? ' ' ?></td>
<td class="celda_normal purchaseTD" <td class="celda_normal purchaseTD"
data-id="<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['date'] ?>" data-id="<?= $totalDiesel[$rowIndex]['date'] ?>"
oninput="purchaseTDStockChange(this)" oninput="purchaseTDStockChange(this)"
contenteditable="true"> contenteditable="true">
<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['purchase_diesel'] ?? ' ' ?> <?= $totalDiesel[$rowIndex]['purchase_diesel'] ?? ' ' ?>
</td> </td>
<td class="celda_normal fillingTD" <td class="celda_normal fillingTD"
data-id="<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['date'] ?>"> data-id="<?= $totalDiesel[$rowIndex]['date'] ?>">
<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['total_filling_diesel'] ?? ' ' ?> <?= $totalDiesel[$rowIndex]['total_filling_diesel'] ?? ' ' ?>
</td> </td>
<td class="celda_normal balanceTD" <td class="celda_normal balanceTD"
data-id="<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['date'] ?>"> data-id="<?= $totalDiesel[$rowIndex]['date'] ?>">
<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock'] ?? ' ' ?> <?= $totalDiesel[$rowIndex]['balance_stock'] ?? ' ' ?>
</td> </td>
@ -643,15 +644,15 @@ foreach ($period as $day) {
//before closing outer loop //before closing outer loop
if (!isset($summary['totalPurchaseDiesel'])) { if (!isset($summary['totalPurchaseDiesel'])) {
$summary['opening_diesel'] = '-'; $summary['openingStock'] = '-';
$summary['totalPurchaseDiesel'] = 0; $summary['totalPurchaseDiesel'] = 0;
$summary['totalFillingDiesel'] = 0; $summary['totalFillingDiesel'] = 0;
$summary['balanceStock'] = 0; $summary['balanceStock'] = 0;
} }
$summary['openingStock'] = is_numeric($totalDiesel[$rowIndex]['opening_stock']) ? $totalDiesel[$rowIndex]['opening_stock'] : 0;
$summary['totalPurchaseDiesel'] += is_numeric($totalDiesel[$groupedDieselMachineStockDetailsIndex]['purchase_diesel']) ? $totalDiesel[$groupedDieselMachineStockDetailsIndex]['purchase_diesel'] : 0; $summary['totalPurchaseDiesel'] += is_numeric($totalDiesel[$rowIndex]['purchase_diesel']) ? $totalDiesel[$rowIndex]['purchase_diesel'] : 0;
$summary['totalFillingDiesel'] += is_numeric($totalDiesel[$groupedDieselMachineStockDetailsIndex]['total_filling_diesel']) ? $totalDiesel[$groupedDieselMachineStockDetailsIndex]['total_filling_diesel'] : 0; $summary['totalFillingDiesel'] += is_numeric($totalDiesel[$rowIndex]['total_filling_diesel']) ? $totalDiesel[$rowIndex]['total_filling_diesel'] : 0;
$summary['balanceStock'] = is_numeric($totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock']) ? $totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock'] : 0; $summary['balanceStock'] = is_numeric($totalDiesel[$rowIndex]['balance_stock']) ? $totalDiesel[$rowIndex]['balance_stock'] : 0;
?> ?>
@ -675,7 +676,7 @@ foreach ($period as $day) {
<td class="celda_normal openingReading" <td class="celda_normal openingReading"
data-id="<?= $dieselStock['date'] ?> <?= $dieselStock['machine_id'] ?>" data-id="<?= $dieselStock['date'] ?> <?= $dieselStock['machine_id'] ?>"
<?php if ($groupedDieselMachineStockDetailsIndex == 0): ?> <?php if ($rowIndex == 0): ?>
oninput="openingReadingChange(this)" oninput="openingReadingChange(this)"
contenteditable="true" contenteditable="true"
<?php endif; ?>> <?php endif; ?>>
@ -781,7 +782,7 @@ foreach ($period as $day) {
</td> </td>
<td class="celda_normal "><?= $summary['opening_diesel'] ?></td> <td class="celda_normal "><?= $summary['openingStock'] ?></td>
<td class="celda_normal "><?= $summary['totalPurchaseDiesel'] ?></td> <td class="celda_normal "><?= $summary['totalPurchaseDiesel'] ?></td>
<td class="celda_normal "><?= $summary['totalFillingDiesel'] ?></td> <td class="celda_normal "><?= $summary['totalFillingDiesel'] ?></td>
<td class="celda_normal "><?= $summary['balanceStock'] ?></td> <td class="celda_normal "><?= $summary['balanceStock'] ?></td>
@ -836,6 +837,61 @@ foreach ($period as $day) {
</td> </td>
<?php
if (!empty($totalDiesel)) {
?>
<!-- total diesel present summary section of view starts -->
<td class="celda_normal openingTD"
data-id="<?= $totalDiesel[$datesInMonthIndex]['date'] ?>"
<?php if ($datesInMonthIndex == 0): ?>
oninput="openingTDStockChange(this)"
contenteditable="true"
<?php endif; ?>><?= $totalDiesel[$datesInMonthIndex]['opening_stock'] ?? ' ' ?></td>
<td class="celda_normal purchaseTD"
data-id="<?= $totalDiesel[$datesInMonthIndex]['date'] ?>"
oninput="purchaseTDStockChange(this)"
contenteditable="true">
<?= $totalDiesel[$datesInMonthIndex]['purchase_diesel'] ?? ' ' ?>
</td>
<td class="celda_normal fillingTD"
data-id="<?= $totalDiesel[$datesInMonthIndex]['date'] ?>">
<?= $totalDiesel[$datesInMonthIndex]['total_filling_diesel'] ?? ' ' ?>
</td>
<td class="celda_normal balanceTD"
data-id="<?= $totalDiesel[$datesInMonthIndex]['date'] ?>">
<?= $totalDiesel[$datesInMonthIndex]['balance_stock'] ?? ' ' ?>
</td>
<!-- total diesel present summary section of view ends -->
<?php } else { ?>
<!-- total diesel absent summary section of view starts -->
<td class="celda_normal openingTD" <td class="celda_normal openingTD"
data-id="<?= $dateInMonth ?>" data-id="<?= $dateInMonth ?>"
@ -844,10 +900,14 @@ foreach ($period as $day) {
oninput="openingTDStockChange(this)" oninput="openingTDStockChange(this)"
contenteditable="true" contenteditable="true"
<?php } ?>><?= !empty($previousMonthTotalDieselMachineStockDetails) <?php } ?>>
<?= !empty($previousMonthTotalDieselMachineStockDetails)
? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock'] ? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock']
: " "; : " ";
?></td> ?>
</td>
@ -855,22 +915,37 @@ foreach ($period as $day) {
data-id="<?= $dateInMonth ?>" data-id="<?= $dateInMonth ?>"
oninput="purchaseTDStockChange(this)" oninput="purchaseTDStockChange(this)"
contenteditable="true"> </td> contenteditable="true">
</td>
<td class="celda_normal fillingTD" <td class="celda_normal fillingTD"
data-id="<?= $dateInMonth ?>"> </td> data-id="<?= $dateInMonth ?>">
</td>
<td class="celda_normal balanceTD" <td class="celda_normal balanceTD"
data-id="<?= $dateInMonth ?>"><?= !empty($previousMonthTotalDieselMachineStockDetails) data-id="<?= $dateInMonth ?>">
<?= !empty($previousMonthTotalDieselMachineStockDetails)
? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock'] ? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock']
: " "; : " ";
?> ?>
</td> </td>
<!-- total diesel absent summary section of view ends -->
<?php } ?>
<!-- total diesel stock section of view ends -->
<?php <?php
// dd($previousMonthDieselMachineStockDetails);
foreach ($dieselMachines as $dieselMachineIndex => $dieselMachine) { foreach ($dieselMachines as $dieselMachineIndex => $dieselMachine) {
?> ?>
<!-- this will loop till machines present --> <!-- this will loop till machines present -->
@ -1566,8 +1641,7 @@ foreach ($period as $day) {
const box = child.getBoundingClientRect(); const box = child.getBoundingClientRect();
const offset = y - box.top - box.height / 2; const offset = y - box.top - box.height / 2;
return offset < 0 && offset > closest.offset ? return offset < 0 && offset > closest.offset ? {
{
offset, offset,
element: child element: child
} : } :
@ -1660,8 +1734,10 @@ foreach ($period as $day) {
div.style.height = "100%"; div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen // Reset .table-responsive height when exiting fullscreen
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) { if (tableResponsive) {
tableResponsive.style.height = "auto"; tableResponsive.style.maxHeight = "450px";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
} }
}).catch(err => console.log("Error exiting fullscreen:", err)); }).catch(err => console.log("Error exiting fullscreen:", err));
} }

View File

@ -339,13 +339,13 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<input type="text" id="searchInput" placeholder="Search..." <input type="text" id="searchInput" placeholder="Search..."
class="mt-2" class="mt-2"
style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc; style="padding: 8px;margin-bottom: 10px;width: 250px;border: 2px solid rgb(123, 11, 214);
border-radius: 5px;margin-right:15px;"> border-radius: 5px;margin-right:15px; ">
<i class="fa fa-table btn-lg mt-2" <i class="fa fa-table btn-lg mt-2"
title="Date Range Filter" title="Date Range Filter"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(95, 102, 105)"
data-toggle="modal" data-toggle="modal"
data-target="#filterModalId"> data-target="#filterModalId">
@ -353,13 +353,13 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<i class="fa fa-download btn-lg mt-2" <i class="fa fa-download btn-lg mt-2"
title="Excel Download" title="Excel Download"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color: #0b7cba"
id="drierMachineDetailsExport"> id="drierMachineDetailsExport">
</i> </i>
<i class="fe-maximize noti-icon btn-lg mt-2" <i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen" title="Full Screen"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()"> onclick="toggleDivFullscreen()">
</i> </i>
@ -368,7 +368,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
title="Add Entry" title="Add Entry"
data-target="#additionalEntriesModalId" data-target="#additionalEntriesModalId"
data-toggle="modal" data-toggle="modal"
style="font-size: x-large; cursor:pointer;"> style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)">
</i> </i>
@ -462,14 +462,16 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form action="<?php echo base_url("/addOrEditdrierMachineDetails") ?>" method="POST"> <form id="additionalEntriesForm" action="<?php echo base_url("/addOrEditdrierMachineDetails") ?>" method="POST">
<!--first row --> <!--first row -->
<?php $calendarStartDate = DateTime::createFromFormat('M-Y', $datefordropdown)->modify('first day of this month')->format('Y-m-d'); ?> <?php $calendarStartDate = DateTime::createFromFormat('M-Y', $datefordropdown)->modify('first day of this month')->format('Y-m-d'); ?>
<?php $calendarEndDate = DateTime::createFromFormat('M-Y', $datefordropdown)->modify('last day of this month')->format('Y-m-d'); ?> <?php $calendarEndDate = DateTime::createFromFormat('M-Y', $datefordropdown)->modify('last day of this month')->format('Y-m-d'); ?>
<?php $calendarCurrentDate = DateTime::createFromFormat('M-Y', $datefordropdown)->format('Y-m-d'); ?>
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
<label class="form" for="additionalEntryDateId">Date</label> <label class="form" for="additionalEntryDateId">Date</label>
<input type="date" class="form-control" id="additionalEntryDateId" name="date" value="<?= $calendarStartDate ?>" <input type="date" class="form-control" id="additionalEntryDateId" name="date" value="<?= $calendarCurrentDate ?>"
min="<?= $calendarStartDate ?>" max="<?= $calendarEndDate ?>" required> min="<?= $calendarStartDate ?>" max="<?= $calendarEndDate ?>" required>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
@ -596,7 +598,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
</div> </div>
</div> </div>
<button type="submit" class="btn btn-primary float-right">Add</button> <button type="submit" class="btn btn-primary float-right submit-btn">Add</button>
<!-- hidden fields --> <!-- hidden fields -->
@ -618,7 +620,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form action="<?php echo base_url("/addOrEditdrierMachineDetails") ?>" method="POST"> <form id="editEntriesForm" action="<?php echo base_url("/addOrEditdrierMachineDetails") ?>" method="POST">
<!--first row --> <!--first row -->
<?php $calendarStartDate = DateTime::createFromFormat('M-Y', $datefordropdown)->modify('first day of this month')->format('Y-m-d'); ?> <?php $calendarStartDate = DateTime::createFromFormat('M-Y', $datefordropdown)->modify('first day of this month')->format('Y-m-d'); ?>
<?php $calendarEndDate = DateTime::createFromFormat('M-Y', $datefordropdown)->modify('last day of this month')->format('Y-m-d'); ?> <?php $calendarEndDate = DateTime::createFromFormat('M-Y', $datefordropdown)->modify('last day of this month')->format('Y-m-d'); ?>
@ -626,7 +628,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<div class="col-md-3"> <div class="col-md-3">
<label class="form" for="editEntryDateId">Date</label> <label class="form" for="editEntryDateId">Date</label>
<input type="date" class="form-control" id="editEntryDateId" name="date" value="" <input type="date" class="form-control" id="editEntryDateId" name="date" value=""
required> required readonly>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label class="form" for="editEntryDrierOnTimeId">Drier On Time</label> <label class="form" for="editEntryDrierOnTimeId">Drier On Time</label>
@ -752,7 +754,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
</div> </div>
</div> </div>
<button type="submit" class="btn btn-primary float-right">Update</button> <button type="submit" class="btn btn-primary float-right submit-btn">Update</button>
<!-- hidden fields --> <!-- hidden fields -->
@ -867,22 +869,22 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- td:eq(7) sand_dried_qty --> <!-- td:eq(7) sand_dried_qty -->
<td class="celda_normal"> <td class="celda_normal">
<?php echo (int)$a['sand_dried_qty']; ?> <?php echo round($a['sand_dried_qty']); ?>
</td> </td>
<!-- td:eq(8) total_gas_consumption --> <!-- td:eq(8) total_gas_consumption -->
<td class="celda_normal"> <td class="celda_normal">
<?php echo $a['total_gas_consumption']; ?> <?php echo round($a['total_gas_consumption']); ?>
</td> </td>
<!-- td:eq(9) gas_per_ton --> <!-- td:eq(9) gas_per_ton -->
<td class="celda_normal"> <td class="celda_normal">
<?php echo $a['gas_per_ton']; ?> <?php echo round($a['gas_per_ton']); ?>
</td> </td>
<!-- td:eq(10) qty_per_hours --> <!-- td:eq(10) qty_per_hours -->
<td class="celda_normal"> <td class="celda_normal">
<?php echo (int)$a['qty_per_hours']; ?> <?php echo round($a['qty_per_hours']); ?>
</td> </td>
@ -942,7 +944,10 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
$summary['input_sand_qty'] += $a['input_sand_qty'] == "-" ? 0 : (float) $a['input_sand_qty']; $summary['input_sand_qty'] += $a['input_sand_qty'] == "-" ? 0 : (float) $a['input_sand_qty'];
$summary['moisture_loss_qty'] += $a['moisture_loss_qty'] == "-" ? 0 : (float) $a['moisture_loss_qty']; $summary['moisture_loss_qty'] += $a['moisture_loss_qty'] == "-" ? 0 : (float) $a['moisture_loss_qty'];
$summary['sand_dried_qty'] += $a['sand_dried_qty'] == "-" ? 0 : (float) $a['sand_dried_qty']; $summary['sand_dried_qty'] += $a['sand_dried_qty'] == "-" ? 0 : (float) $a['sand_dried_qty'];
$summary['gas_per_ton'] = round(($summary['total_gas_consumption'] / $summary['sand_dried_qty']));
$summary['qty_per_hrs'] = round( ($summary['sand_dried_qty'] / $summary['drier_running_hours']) );
$summary['dust_qty'] += $a['dust_qty'] == "-" ? 0 : (float) $a['dust_qty']; $summary['dust_qty'] += $a['dust_qty'] == "-" ? 0 : (float) $a['dust_qty'];
} ?> } ?>
@ -962,8 +967,8 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<td class="celda_normal ">-</td> <td class="celda_normal ">-</td>
<td class="celda_normal "><?= $summary['sand_dried_qty'] ?></td> <td class="celda_normal "><?= $summary['sand_dried_qty'] ?></td>
<td class="celda_normal "><?= $summary['total_gas_consumption'] ?></td> <td class="celda_normal "><?= $summary['total_gas_consumption'] ?></td>
<td class="celda_normal "></td> <td class="celda_normal "><?= $summary['gas_per_ton']?>(A)</td>
<td class="celda_normal "></td> <td class="celda_normal "><?= $summary['qty_per_hrs']?>(A)</td>
<td class="celda_normal "><?= $summary['moisture_loss_qty'] ?></td> <td class="celda_normal "><?= $summary['moisture_loss_qty'] ?></td>
<td class="celda_normal "><?= $summary['dust_qty'] ?></td> <td class="celda_normal "><?= $summary['dust_qty'] ?></td>
</tr> </tr>
@ -979,11 +984,16 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
</p> </p>
</div> </div>
<?php }else{?>
<br>
<p align="center">Note :- (A) -> Average</p>
<?php } ?> <?php } ?>
</div><!-- End table-responsive --> </div><!-- End table-responsive -->
</div> </div>
@ -1471,8 +1481,10 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
div.style.height = "100%"; div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen // Reset .table-responsive height when exiting fullscreen
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) { if (tableResponsive) {
tableResponsive.style.height = "auto"; tableResponsive.style.maxHeight = "450px";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
} }
}).catch(err => console.log("Error exiting fullscreen:", err)); }).catch(err => console.log("Error exiting fullscreen:", err));
} }
@ -1543,4 +1555,27 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
</script>
<script>
document.getElementById('additionalEntriesForm').addEventListener('submit', function() {
event.preventDefault(); // Prevent default form submission
const submitButtons = document.getElementsByClassName('submit-btn');
for (let i = 0; i < submitButtons.length; i++) {
submitButtons[i].disabled = true;
submitButtons[i].innerText = 'Submitting...';
}
this.submit(); // Submit the form programmatically
});
document.getElementById('editEntriesForm').addEventListener('submit', function() {
event.preventDefault(); // Prevent default form submission
const submitButtons = document.getElementsByClassName('submit-btn');
for (let i = 0; i < submitButtons.length; i++) {
submitButtons[i].disabled = true;
submitButtons[i].innerText = 'Submitting...';
}
this.submit(); // Submit the form programmatically
});
</script> </script>

View File

@ -217,7 +217,7 @@
background-color: #50bbd9; background-color: #50bbd9;
/* Green background */ /* Green background */
color: #ffffff; color: #ffffff;
border: 1px solid #ddd; border: 2px solid ;
padding: 10px; padding: 10px;
} }
@ -342,7 +342,7 @@
<div class="col-3"> <div class="col-3">
</div> </div>
<div class="col-2 mt-2"> <div class="col-2 mt-2 ml-4">
<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 " class="form-control "
@ -359,13 +359,13 @@
<input type="text" id="searchInput" placeholder="Search..." <input type="text" id="searchInput" placeholder="Search..."
class="mt-2" class="mt-2"
style="padding: 8px;margin-bottom: 10px;width: 150px;border: 1px solid #ccc; style="padding: 8px;margin-bottom: 10px;width: 150px;border: 2px solid rgb(123, 11, 214);
border-radius: 5px;margin-right:15px;"> border-radius: 5px;margin-right:15px;">
<i class="fa fa-table btn-lg mt-2" <i class="fa fa-table btn-lg mt-2"
title="Date Range Filter" title="Date Range Filter"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(95, 102, 105)"
data-toggle="modal" data-toggle="modal"
data-target="#filterModalId"> data-target="#filterModalId">
@ -373,20 +373,20 @@
<i class="fa fa-download btn-lg mt-2" <i class="fa fa-download btn-lg mt-2"
title="Excel Download" title="Excel Download"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color: #0b7cba"
id="dustAndRoughStockExport"> id="dustAndRoughStockExport">
</i> </i>
<i class="fe-maximize noti-icon btn-lg mt-2" <i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen" title="Full Screen"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()"> onclick="toggleDivFullscreen()">
</i> </i>
<i class="fa fa-save btn-lg mt-2" <i class="fa fa-save btn-lg mt-2"
title="Save" title="Save"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)"
id="saveId"> id="saveId">
</i> </i>
@ -394,7 +394,7 @@
</div> </div>
<div class="col-2"> <div class="col-4">
</div> </div>
</div> </div>
@ -967,8 +967,10 @@
div.style.height = "100%"; div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen // Reset .table-responsive height when exiting fullscreen
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) { if (tableResponsive) {
tableResponsive.style.height = "auto"; tableResponsive.style.maxHeight = "450px";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
} }
}).catch(err => console.log("Error exiting fullscreen:", err)); }).catch(err => console.log("Error exiting fullscreen:", err));
} }

View File

@ -202,7 +202,7 @@
background-color: #50bbd9; background-color: #50bbd9;
/* Green background */ /* Green background */
color: #ffffff; color: #ffffff;
border: 1px solid #ddd; border: 2px solid ;
padding: 10px; padding: 10px;
} }
@ -222,7 +222,7 @@
.table-responsive { .table-responsive {
overflow-x: auto; overflow-x: auto;
overflow-y: auto; overflow-y: auto;
max-height: 500px; max-height: 450px;
max-width: 100%; max-width: 100%;
position: relative; position: relative;
} }
@ -335,13 +335,13 @@
<input type="text" id="searchInput" placeholder="Search..." <input type="text" id="searchInput" placeholder="Search..."
class="mt-2" class="mt-2"
style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc; style="padding: 8px;margin-bottom: 10px;width: 250px; border: 2px solid rgb(123, 11, 214);
border-radius: 5px;margin-right:15px;"> border-radius: 5px;margin-right:15px;">
<i class="fa fa-table btn-lg mt-2" <i class="fa fa-table btn-lg mt-2"
title="Date Range Filter" title="Date Range Filter"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(95, 102, 105);"
data-toggle="modal" data-toggle="modal"
data-target="#filterModalId"> data-target="#filterModalId">
@ -349,20 +349,20 @@
<i class="fa fa-download btn-lg mt-2" <i class="fa fa-download btn-lg mt-2"
title="Excel Download" title="Excel Download"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color: #0b7cba;"
id="gasStockDetailsExport"> id="gasStockDetailsExport">
</i> </i>
<i class="fe-maximize noti-icon btn-lg mt-2" <i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen" title="Full Screen"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()"> onclick="toggleDivFullscreen()">
</i> </i>
<i class="fa fa-save btn-lg mt-2" <i class="fa fa-save btn-lg mt-2"
title="Save" title="Save"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)"
id="saveId"> id="saveId">
</i> </i>
@ -453,16 +453,15 @@
<tr> <tr>
<th class="celda_encabezado_general" rowspan="1" colspan="1">RIPL </th> <th class="celda_encabezado_general" rowspan="1" colspan="1">RIPL </th>
<th class="celda_encabezado_general" colspan="6">Gas Stock </th> <th class="celda_encabezado_general" colspan="6">Gas Stock </th>
<th class="celda_encabezado_general">FBD 10 Ton Dryer</th> <th class="celda_encabezado_general" colspan="2">FBD 10 Ton Dryer</th>
<th class="celda_encabezado_general">Sand Dried</th> <th class="celda_encabezado_general" colspan="2">Coating Machine</th>
<th class="celda_encabezado_general">Coating Machine</th>
<th class="celda_encabezado_general">Sand Coated</th>
<th class="celda_encabezado_general" colspan="2">TRP </th> <th class="celda_encabezado_general" colspan="2">TRP </th>
<th class="celda_encabezado_general">Sand TRP</th> <th class="celda_encabezado_general">Sand TRP</th>
<th class="celda_encabezado_general">Rotary Drier </th> <th class="celda_encabezado_general">Rotary Drier </th>
</tr> </tr>
<tr> <tr>
<!-- gas stock details stored -->
<th class="celda_encabezado_general">Date </th> <th class="celda_encabezado_general">Date </th>
<th class="celda_encabezado_general">Opening Stock</th> <th class="celda_encabezado_general">Opening Stock</th>
<th class="celda_encabezado_general">Purchase(Bharath)</th> <th class="celda_encabezado_general">Purchase(Bharath)</th>
@ -470,10 +469,12 @@
<th class="celda_encabezado_general">Total</th> <th class="celda_encabezado_general">Total</th>
<th class="celda_encabezado_general">Consumption </th> <th class="celda_encabezado_general">Consumption </th>
<th class="celda_encabezado_general">Balance Stock</th> <th class="celda_encabezado_general">Balance Stock</th>
<!-- gas stock details stored -->
<th class="celda_encabezado_general">Consumption </th> <th class="celda_encabezado_general">Consumption </th>
<th class="celda_encabezado_general">Ton </th> <th class="celda_encabezado_general">Sand Dried Qty </th>
<th class="celda_encabezado_general">Consumption</th> <th class="celda_encabezado_general">Consumption</th>
<th class="celda_encabezado_general">Ton </th> <th class="celda_encabezado_general">Sand Coated Qty </th>
<th class="celda_encabezado_general">Panel Consumption</th> <th class="celda_encabezado_general">Panel Consumption</th>
<th class="celda_encabezado_general">Physical Consumption</th> <th class="celda_encabezado_general">Physical Consumption</th>
<th class="celda_encabezado_general">Ton </th> <th class="celda_encabezado_general">Ton </th>
@ -1272,8 +1273,10 @@
div.style.height = "100%"; div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen // Reset .table-responsive height when exiting fullscreen
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) { if (tableResponsive) {
tableResponsive.style.height = "auto"; tableResponsive.style.maxHeight = "450px";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
} }
}).catch(err => console.log("Error exiting fullscreen:", err)); }).catch(err => console.log("Error exiting fullscreen:", err));
} }

View File

@ -340,27 +340,27 @@
<input type="text" id="searchInput" placeholder="Search..." <input type="text" id="searchInput" placeholder="Search..."
class="mt-2" class="mt-2"
style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc; style="padding: 8px;margin-bottom: 10px;width: 250px; border: 2px solid rgb(123, 11, 214);
border-radius: 5px;margin-right:15px;"> border-radius: 5px;margin-right:15px;">
<i class="fa fa-download btn-lg mt-2" <i class="fa fa-download btn-lg mt-2"
title="Excel Download" title="Excel Download"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color: #0b7cba"
id="incomingSilicaSandDetailsExport"> id="incomingSilicaSandDetailsExport">
</i> </i>
<i class="fe-maximize noti-icon btn-lg mt-2" <i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen" title="Full Screen"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()"> onclick="toggleDivFullscreen()">
</i> </i>
<i class="fas fa-save btn-lg mt-2" <i class="fas fa-save btn-lg mt-2"
title="Save" title="Save"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)"
id="saveId"> id="saveId">
</i> </i>
@ -1577,11 +1577,16 @@
if (i === 0 || i === 1) { if (i === 0 || i === 1) {
newPlus20Loss += Number(result[i]['WEIGH OF SAND']); newPlus20Loss += Number(result[i]['WEIGH OF SAND']);
newSieveLossQty = (parseFloat(qty) * newPlus20Loss) / 100;
} }
if (i === 0 || i === 1 || i === 2) { if (i === 0 || i === 1 || i === 2) {
newPlus30Loss += Number(result[i]['WEIGH OF SAND']); newPlus30Loss += Number(result[i]['WEIGH OF SAND']);
newSieveLossQty = (parseFloat(qty) * newPlus20Loss) / 100;
} }
totalWeighOfSand += Number(result[i]['WEIGH OF SAND']); totalWeighOfSand += Number(result[i]['WEIGH OF SAND']);
@ -1958,8 +1963,10 @@
div.style.height = "100%"; div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen // Reset .table-responsive height when exiting fullscreen
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) { if (tableResponsive) {
tableResponsive.style.height = "auto"; tableResponsive.style.maxHeight = "450px";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
} }
}).catch(err => console.log("Error exiting fullscreen:", err)); }).catch(err => console.log("Error exiting fullscreen:", err));
} }

View File

@ -213,7 +213,7 @@
background-color: #50bbd9; background-color: #50bbd9;
/* Green background */ /* Green background */
color: #ffffff; color: #ffffff;
border: 1px solid #ddd; border: 2px solid;
padding: 10px; padding: 10px;
} }
@ -261,6 +261,11 @@
.card { .card {
margin-bottom: 5px; margin-bottom: 5px;
} }
#powerStockDetailsTableId {
/* Replace with your table's actual ID or selector */
border-collapse: collapse;
}
</style> </style>
@ -339,7 +344,7 @@ foreach ($period as $day) {
<input type="text" id="searchInput" placeholder="Search..." <input type="text" id="searchInput" placeholder="Search..."
class="mt-2" class="mt-2"
style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc; style=" padding: 8px;margin-bottom: 10px;width: 250px;border: 2px solid rgb(123, 11, 214);
border-radius: 5px;margin-right:15px;"> border-radius: 5px;margin-right:15px;">
@ -348,7 +353,7 @@ foreach ($period as $day) {
if ($month == date('M-Y')) { if ($month == date('M-Y')) {
?> ?>
<i class="fa fa-cog btn-lg mt-2" <i class="fa fa-cog btn-lg mt-2"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(95, 102, 105)"
title="Customize" title="Customize"
data-target="#customizeModalId" data-target="#customizeModalId"
data-toggle="modal"> data-toggle="modal">
@ -363,25 +368,25 @@ foreach ($period as $day) {
title="Navigation" title="Navigation"
data-toggle="modal" data-toggle="modal"
data-target="#bs-example-modal-lg" data-target="#bs-example-modal-lg"
style="font-size: x-large; cursor:pointer;"> style="font-size: x-large; cursor:pointer; color: #bd0906">
</i> </i>
<i class="fa fa-download btn-lg mt-2" <i class="fa fa-download btn-lg mt-2"
title="Excel Download" title="Excel Download"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color: #0b7cba"
id="powerConsumptionExport "> id="bagStockExport">
</i> </i>
<i class="fe-maximize noti-icon btn-lg mt-2" <i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen" title="Full Screen"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()"> onclick="toggleDivFullscreen()">
</i> </i>
<i class="fas fa-save btn-lg mt-2" <i class="fas fa-save btn-lg mt-2"
title="Save" title="Save"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)"
id="saveId"> id="saveId">
</i> </i>
@ -595,7 +600,7 @@ foreach ($period as $day) {
$currentDate = date('d-m-Y'); $currentDate = date('d-m-Y');
$dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $powerStockDetails[0]['date'])->format('d-m-Y'); $dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $powerStockDetails[0]['date'])->format('d-m-Y');
if ($dateInMonthDmYFormat === $currentDate) { if ($dateInMonthDmYFormat === $currentDate) {
echo 'style="background: rgb(232, 245, 231);"'; echo 'style="background: #cef0ad;"';
} }
?>> ?>>
@ -830,7 +835,7 @@ foreach ($period as $day) {
$currentDate = date('d-m-Y'); $currentDate = date('d-m-Y');
$dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $dateInMonth)->format('d-m-Y'); $dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $dateInMonth)->format('d-m-Y');
if ($dateInMonthDmYFormat === $currentDate) { if ($dateInMonthDmYFormat === $currentDate) {
echo 'style="background: rgb(232, 245, 231);"'; echo 'style="background: #cef0ad;"';
} }
?>> ?>>
@ -1623,8 +1628,10 @@ foreach ($period as $day) {
div.style.height = "100%"; div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen // Reset .table-responsive height when exiting fullscreen
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) { if (tableResponsive) {
tableResponsive.style.height = "auto"; tableResponsive.style.maxHeight = "450px";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
} }
}).catch(err => console.log("Error exiting fullscreen:", err)); }).catch(err => console.log("Error exiting fullscreen:", err));
} }
@ -1647,25 +1654,22 @@ foreach ($period as $day) {
}); });
// Initialize Select2 when the modal is shown inside full screen // Initialize Select2 when the modal is shown inside full screen
$('#bs-example-modal-lg').on('shown.bs.modal', function () { $('#bs-example-modal-lg').on('shown.bs.modal', function() {
$('.select2').select2({ $('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal dropdownParent: $(this) // This ensures Select2 works in the modal
}); });
}); });
$('#customizeModalId').on('shown.bs.modal', function () { $('#customizeModalId').on('shown.bs.modal', function() {
$('.select2').select2({ $('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal dropdownParent: $(this) // This ensures Select2 works in the modal
}); });
}); });
}); });
</script> </script>
<script> <script>
//getting modal backdrop inside full screen //getting modal backdrop inside full screen
$(document).ready(function() { $(document).ready(function() {
@ -1676,7 +1680,7 @@ foreach ($period as $day) {
} }
// Move the modal backdrop when a modal opens // Move the modal backdrop when a modal opens
$('#bs-example-modal-lg, #customizeModalId').on('show.bs.modal', function () { $('#bs-example-modal-lg, #customizeModalId').on('show.bs.modal', function() {
moveModalBackdropToFullscreen(); moveModalBackdropToFullscreen();
}); });
@ -1687,8 +1691,5 @@ foreach ($period as $day) {
moveModalBackdropToFullscreen(); moveModalBackdropToFullscreen();
}, 200); }, 200);
}); });
}); });
</script> </script>

View File

@ -19,22 +19,26 @@
.fht-table td:hover { .fht-table td:hover {
background-color: rgb(170, 222, 167); background-color: rgb(170, 222, 167);
color:rgb(2, 2, 2); color: rgb(2, 2, 2);
transform: scale(1.25); /* Increases size by 25% */ transform: scale(1.25);
transition: transform 0.5s ease-in-out; /* Smooth scaling effect */ /* Increases size by 25% */
transition: transform 0.5s ease-in-out;
/* Smooth scaling effect */
} }
.fht-table tr:hover { .fht-table tr:hover {
background-color: rgb(170, 222, 167); background-color: rgb(170, 222, 167);
color:rgb(2, 2, 2); color: rgb(2, 2, 2);
} }
.grab { .grab {
cursor: grab; /* Default open-hand cursor */ cursor: grab;
/* Default open-hand cursor */
} }
.grab:active { .grab:active {
cursor: grabbing; /* Closed-hand cursor when dragging */ cursor: grabbing;
/* Closed-hand cursor when dragging */
} }
/* /*
@ -213,7 +217,7 @@
background-color: #50bbd9; background-color: #50bbd9;
/* Green background */ /* Green background */
color: #ffffff; color: #ffffff;
border: 1px solid #ddd; border: 2px solid;
padding: 10px; padding: 10px;
} }
@ -245,21 +249,22 @@
} }
tfoot tr { tfoot tr {
background-color:rgb(235, 236, 203); background-color: rgb(235, 236, 203);
} }
body[data-layout-mode = horizontal] .container-fluid{ body[data-layout-mode=horizontal] .container-fluid {
max-width: 100%; max-width: 100%;
} }
.card-body{ .card-body {
padding-top : 0; padding-top: 0;
padding-bottom : 0; padding-bottom: 0;
} }
.card{ margin-bottom: 5px;} .card {
margin-bottom: 5px;
}
</style> </style>
@ -335,21 +340,21 @@ foreach ($period as $day) {
<div class="col-10 text-right d-flex" style="justify-content: end;" > <div class="col-10 text-right d-flex" style="justify-content: end;">
<input type="text" id="searchInput" placeholder="Search..." <input type="text" id="searchInput" placeholder="Search..."
class="mt-2" class="mt-2"
style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc; style=" padding: 8px;margin-bottom: 10px;width: 250px;border: 2px solid rgb(123, 11, 214);
border-radius: 5px;margin-right:15px;"> border-radius: 5px;margin-right:15px;">
<?php <?php
if($month == date('M-Y') ){ if ($month == date('M-Y')) {
?> ?>
<i class="fa fa-cog btn-lg mt-2" <i class="fa fa-cog btn-lg mt-2"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(95, 102, 105)"
title = "Customize" title="Customize"
data-target="#customizeModalId" data-target="#customizeModalId"
data-toggle="modal"> data-toggle="modal">
@ -363,26 +368,26 @@ foreach ($period as $day) {
title="Navigation" title="Navigation"
data-toggle="modal" data-toggle="modal"
data-target="#bs-example-modal-lg" data-target="#bs-example-modal-lg"
style="font-size: x-large; cursor:pointer;"> style="font-size: x-large; cursor:pointer; color: #bd0906">
</i> </i>
<i class="fa fa-download btn-lg mt-2" <i class="fa fa-download btn-lg mt-2"
title="Excel Download" title="Excel Download"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color: #0b7cba"
id="resinStockExport"> id="bagStockExport">
</i> </i>
<i class="fe-maximize noti-icon btn-lg mt-2" <i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen" title="Full Screen"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()" > onclick="toggleDivFullscreen()">
</i> </i>
<i class="fas fa-save btn-lg mt-2" <i class="fas fa-save btn-lg mt-2"
title="Save" title="Save"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)"
id="saveId" > id="saveId">
</i> </i>
</div> </div>
@ -419,10 +424,10 @@ foreach ($period as $day) {
<select id="customizeHeader" class="form-control select2" onchange="addBackToList()"> <select id="customizeHeader" class="form-control select2" onchange="addBackToList()">
<option value="">Select</option> <option value="">Select</option>
<?php <?php
foreach($activeResinMaterials as $index => $activeResinMaterial){ ?> foreach ($activeResinMaterials as $index => $activeResinMaterial) { ?>
<option value="<?=$activeResinMaterial['MaterialCode']?>"> <option value="<?= $activeResinMaterial['MaterialCode'] ?>">
<?=$activeResinMaterial['MaterialCode']?> - <?=$activeResinMaterial['MaterialName']?> <?= $activeResinMaterial['MaterialCode'] ?> - <?= $activeResinMaterial['MaterialName'] ?>
</option> </option>
<?php <?php
@ -446,11 +451,11 @@ foreach ($period as $day) {
<?php foreach ($resinMaterials as $resinMaterial): ?> <?php foreach ($resinMaterials as $resinMaterial): ?>
<div class="sortable-item" draggable="true" id="<?= $resinMaterial['MaterialCode'] ?>_container"> <div class="sortable-item" draggable="true" id="<?= $resinMaterial['MaterialCode'] ?>_container">
<input type = "checkbox" <input type="checkbox"
id = "<?= $resinMaterial['MaterialCode'] ?>_checkboxId" id="<?= $resinMaterial['MaterialCode'] ?>_checkboxId"
name = "customisedMaterialCodes[]" name="customisedMaterialCodes[]"
value = "<?= $resinMaterial['MaterialCode'] ?>" value="<?= $resinMaterial['MaterialCode'] ?>"
onclick = "removeSelectedMaterial(this)" onclick="removeSelectedMaterial(this)"
checked> checked>
<label class="grab" for="<?= $resinMaterial['MaterialCode'] ?>_checkboxId"> <label class="grab" for="<?= $resinMaterial['MaterialCode'] ?>_checkboxId">
<?= $resinMaterial['MaterialCode'] ?> - <?= $resinMaterial['MaterialName']; ?> <?= $resinMaterial['MaterialCode'] ?> - <?= $resinMaterial['MaterialName']; ?>
@ -583,7 +588,7 @@ foreach ($period as $day) {
$currentDate = date('d-m-Y'); $currentDate = date('d-m-Y');
$dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $resinStockDetails[0]['date'])->format('d-m-Y'); $dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $resinStockDetails[0]['date'])->format('d-m-Y');
if ($dateInMonthDmYFormat === $currentDate) { if ($dateInMonthDmYFormat === $currentDate) {
echo 'style="background: rgb(232, 245, 231);"'; echo 'style="background: #cef0ad;"';
} }
?>> ?>>
<?php foreach ($resinStockDetails as $resinStockIndex => $resinStock) { <?php foreach ($resinStockDetails as $resinStockIndex => $resinStock) {
@ -705,7 +710,7 @@ foreach ($period as $day) {
$currentDate = date('d-m-Y'); $currentDate = date('d-m-Y');
$dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $dateInMonth)->format('d-m-Y'); $dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $dateInMonth)->format('d-m-Y');
if ($dateInMonthDmYFormat === $currentDate) { if ($dateInMonthDmYFormat === $currentDate) {
echo 'style="background: rgb(232, 245, 231);"'; echo 'style="background: #cef0ad ;"';
} }
?>> ?>>
<?php <?php
@ -747,13 +752,11 @@ foreach ($period as $day) {
<?php } ?>> <?php } ?>>
<?php <?php
foreach($previousMonthResinStockDetails as $index => $previousMonthResinStockDetail) foreach ($previousMonthResinStockDetails as $index => $previousMonthResinStockDetail) {
{ if ($previousMonthResinStockDetail['materialCode'] == $resinMaterial['MaterialCode']) {
if($previousMonthResinStockDetail['materialCode'] == $resinMaterial['MaterialCode']){ echo $previousMonthResinStockDetail['balanceStock'];
echo $previousMonthResinStockDetail['balanceStock'] ;
break; break;
} }
} }
?> ?>
@ -773,13 +776,11 @@ foreach ($period as $day) {
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>"> data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>">
<?php <?php
foreach($previousMonthResinStockDetails as $index => $previousMonthResinStockDetail) foreach ($previousMonthResinStockDetails as $index => $previousMonthResinStockDetail) {
{ if ($previousMonthResinStockDetail['materialCode'] == $resinMaterial['MaterialCode']) {
if($previousMonthResinStockDetail['materialCode'] == $resinMaterial['MaterialCode']){ echo $previousMonthResinStockDetail['balanceStock'];
echo $previousMonthResinStockDetail['balanceStock'] ;
break; break;
} }
} }
?> ?>
@ -812,7 +813,7 @@ foreach ($period as $day) {
<script> <script>
$(document).ready(function(){ $(document).ready(function() {
$('.select2').select2(); $('.select2').select2();
}) })
</script> </script>
@ -1104,12 +1105,12 @@ foreach ($period as $day) {
let cloneTable = table.cloneNode(true); // Clone the table to modify let cloneTable = table.cloneNode(true); // Clone the table to modify
// Remove hidden rows // Remove hidden rows
$(cloneTable).find('tr').filter(function () { $(cloneTable).find('tr').filter(function() {
return $(this).css('display') === 'none'; return $(this).css('display') === 'none';
}).remove(); }).remove();
// Remove hidden columns // Remove hidden columns
$(cloneTable).find('th, td').each(function () { $(cloneTable).find('th, td').each(function() {
if ($(this).css('display') === 'none') { if ($(this).css('display') === 'none') {
$(this).remove(); $(this).remove();
} }
@ -1189,7 +1190,7 @@ foreach ($period as $day) {
</script> </script>
<script> <script>
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function() {
const list = document.getElementById("sortableList"); const list = document.getElementById("sortableList");
let draggedItem = null; let draggedItem = null;
@ -1226,16 +1227,21 @@ foreach ($period as $day) {
const box = child.getBoundingClientRect(); const box = child.getBoundingClientRect();
const offset = y - box.top - box.height / 2; const offset = y - box.top - box.height / 2;
return offset < 0 && offset > closest.offset return offset < 0 && offset > closest.offset ?
? { offset, element: child } {
: closest; offset,
}, { offset: Number.NEGATIVE_INFINITY }).element; element: child
} :
closest;
}, {
offset: Number.NEGATIVE_INFINITY
}).element;
} }
// Attach drag events to existing items // Attach drag events to existing items
document.querySelectorAll(".sortable-item").forEach(attachDragEvents); document.querySelectorAll(".sortable-item").forEach(attachDragEvents);
window.removeSelectedMaterial = function (checkbox) { window.removeSelectedMaterial = function(checkbox) {
let container = checkbox.closest(".sortable-item"); let container = checkbox.closest(".sortable-item");
let materialCode = checkbox.value; let materialCode = checkbox.value;
let materialName = container.querySelector("label").innerText; let materialName = container.querySelector("label").innerText;
@ -1243,7 +1249,7 @@ foreach ($period as $day) {
container.remove(); container.remove();
}; };
window.addBackToList = function () { window.addBackToList = function() {
let dropdown = document.getElementById("customizeHeader"); let dropdown = document.getElementById("customizeHeader");
let selectedOption = dropdown.options[dropdown.selectedIndex]; let selectedOption = dropdown.options[dropdown.selectedIndex];
@ -1267,19 +1273,17 @@ foreach ($period as $day) {
document.getElementById("sortableList").appendChild(container); document.getElementById("sortableList").appendChild(container);
} }
}; };
}); });
</script> </script>
<script> <script>
$(document).ready(function(){ $(document).ready(function() {
$('#customizeHeader').select2(); $('#customizeHeader').select2();
}) })
</script> </script>
<script> <script>
$('#month').change(function(){ $('#month').change(function() {
$('#changeMonthForm').submit(); $('#changeMonthForm').submit();
}) })
@ -1316,22 +1320,22 @@ foreach ($period as $day) {
div.style.height = "100%"; div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen // Reset .table-responsive height when exiting fullscreen
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) { if (tableResponsive) {
tableResponsive.style.height = "auto"; tableResponsive.style.maxHeight = "450px";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
} }
}).catch(err => console.log("Error exiting fullscreen:", err)); }).catch(err => console.log("Error exiting fullscreen:", err));
} }
} }
$("#searchInput").on("keyup", function () { $("#searchInput").on("keyup", function() {
let value = $(this).val().toLowerCase(); // Convert input to lowercase for case-insensitive search let value = $(this).val().toLowerCase(); // Convert input to lowercase for case-insensitive search
$(".table-responsive tbody tr").filter(function () { $(".table-responsive tbody tr").filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1); $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
}); });
}); });
</script> </script>
@ -1342,25 +1346,22 @@ $("#searchInput").on("keyup", function () {
}); });
// Initialize Select2 when the modal is shown inside full screen // Initialize Select2 when the modal is shown inside full screen
$('#bs-example-modal-lg').on('shown.bs.modal', function () { $('#bs-example-modal-lg').on('shown.bs.modal', function() {
$('.select2').select2({ $('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal dropdownParent: $(this) // This ensures Select2 works in the modal
}); });
}); });
$('#customizeModalId').on('shown.bs.modal', function () { $('#customizeModalId').on('shown.bs.modal', function() {
$('.select2').select2({ $('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal dropdownParent: $(this) // This ensures Select2 works in the modal
}); });
}); });
}); });
</script> </script>
<script> <script>
//getting modal backdrop inside full screen //getting modal backdrop inside full screen
$(document).ready(function() { $(document).ready(function() {
@ -1371,7 +1372,7 @@ $("#searchInput").on("keyup", function () {
} }
// Move the modal backdrop when a modal opens // Move the modal backdrop when a modal opens
$('#bs-example-modal-lg, #customizeModalId').on('show.bs.modal', function () { $('#bs-example-modal-lg, #customizeModalId').on('show.bs.modal', function() {
moveModalBackdropToFullscreen(); moveModalBackdropToFullscreen();
}); });
@ -1382,9 +1383,5 @@ $("#searchInput").on("keyup", function () {
moveModalBackdropToFullscreen(); moveModalBackdropToFullscreen();
}, 200); }, 200);
}); });
}); });
</script> </script>

View File

@ -210,7 +210,7 @@
background-color: #50bbd9; background-color: #50bbd9;
/* Green background */ /* Green background */
color: #ffffff; color: #ffffff;
border: 1px solid #ddd; border: 2px solid ;
white-space: normal; white-space: normal;
/* Allows text to wrap */ /* Allows text to wrap */
word-wrap: break-word; word-wrap: break-word;
@ -305,6 +305,12 @@
.card { .card {
margin-bottom: 5px; margin-bottom: 5px;
} }
#trpProductionStockDetailsTableId { /* Replace with your table's actual ID or selector */
border-collapse: collapse;
}
</style> </style>
@ -399,10 +405,7 @@ $timeOtions[] = "12:00 AM";
<div class="col-2 mt-2"> <div class="col-2 mt-2">
<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 " class="form-control " readonly
data-provide="datepicker"
data-date-format="M-yyyy"
data-date-min-view-mode="1" readonly
style="max-width: 175px;"> style="max-width: 175px;">
</div> </div>
@ -413,13 +416,13 @@ $timeOtions[] = "12:00 AM";
<input type="text" id="searchInput" placeholder="Search..." <input type="text" id="searchInput" placeholder="Search..."
class="mt-2" class="mt-2"
style="padding: 8px;margin-bottom: 10px;width: 150px;border: 1px solid #ccc; style="padding: 8px;margin-bottom: 10px;width: 150px;border: 2px solid rgb(123, 11, 214);
border-radius: 5px;margin-right:15px;"> border-radius: 5px;margin-right:15px;">
<i class="fa fa-table btn-lg mt-2" <i class="fa fa-table btn-lg mt-2"
title="Date Range Filter" title="Date Range Filter"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(95, 102, 105)"
data-toggle="modal" data-toggle="modal"
data-target="#filterModalId"> data-target="#filterModalId">
@ -427,20 +430,20 @@ $timeOtions[] = "12:00 AM";
<i class="fa fa-download btn-lg mt-2" <i class="fa fa-download btn-lg mt-2"
title="Excel Download" title="Excel Download"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color: #0b7cba"
id="trpProductionDetailsExport"> id="trpProductionDetailsExport">
</i> </i>
<i class="fe-maximize noti-icon btn-lg mt-2" <i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen" title="Full Screen"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()"> onclick="toggleDivFullscreen()">
</i> </i>
<i class="fa fa-save btn-lg mt-2" <i class="fa fa-save btn-lg mt-2"
title="Save" title="Save"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)"
id="saveId"> id="saveId">
</i> </i>
@ -1498,17 +1501,19 @@ $timeOtions[] = "12:00 AM";
</div> </div>
<div class="col-2"> <div class="col-2">
<a href="#">
<i class="fa fa-download btn-lg mt-2" <i class="fa fa-download btn-lg mt-2"
style="font-size: x-large;" style="font-size: x-large; color: #0b7cba"
id="trpAbstractDetailsExport"> id="trpAbstractDetailsExport">
</i> </i>
</a>
<i class="fas fa-save btn-lg "
title="Save"
style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)"
id="abstractSaveId">
</i>
<input type="button" class="btn btn-success px-4 mb-3" id="abstractSaveId" value="Save">
</div> </div>
<div class="col-1"> <div class="col-1">
</div> </div>
@ -1703,36 +1708,36 @@ $timeOtions[] = "12:00 AM";
'absRunningHrs' => "", 'absRunningHrs' => "",
'absPerHour' => "", 'absPerHour' => "",
'absOpeningStock' => '', 'absOpeningStock' => '',
'absReceipt' => $totalWcsReceived, 'absReceipt' => $totalWcsReceived == 0 ? " " : $totalWcsReceived,
'absTotal' => $totalWcsReceived, 'absTotal' => $totalWcsReceived == 0 ? " " : $totalWcsReceived,
'absConsumption' => $summary['edProduction'], 'absConsumption' => $summary['edProduction'] == 0 ? " " : $summary['edProduction'] ,
'absClosingStock' => ($totalWcsReceived) - $summary['edProduction'], 'absClosingStock' => ($totalWcsReceived) - $summary['edProduction'] == 0 ? " " : $totalWcsReceived - $summary['edProduction'],
'absPhysicalStock' => '', 'absPhysicalStock' => '',
'absRemarks' => '', 'absRemarks' => '',
], ],
[ [
'absParticulars' => "ED Details", 'absParticulars' => "ED Details",
'absRunningHrs' => $summary['edRunningHours'], 'absRunningHrs' => $summary['edRunningHours'] == 0 ? " " : $summary['edRunningHours'],
'absPerHour' => number_format($summary['edProduction'] / ($summary['edRunningHours'] == 0 ? 1 : $summary['edRunningHours']), 2), 'absPerHour' => number_format($summary['edProduction'] / ($summary['edRunningHours'] == 0 ? 1 : $summary['edRunningHours']), 2) == 0 ? " " : number_format($summary['edProduction'] / ($summary['edRunningHours'] == 0 ? 1 : $summary['edRunningHours']), 2),
'absOpeningStock' => '', 'absOpeningStock' => '',
'absReceipt' => $summary['edProduction'], 'absReceipt' => $summary['edProduction'] == 0 ? " " : $summary['edProduction'],
'absTotal' => $summary['edProduction'], 'absTotal' => $summary['edProduction'] == 0 ? " " : $summary['edProduction'],
'absConsumption' => $summary['edUsage'] + ($summary['coolerBags'] * 1250) + ($summary['cycloneWaste'] * 1250) + ($summary['edWaste'] * 1250), 'absConsumption' => $summary['edUsage'] + ($summary['coolerBags'] * 1250) + ($summary['cycloneWaste'] * 1250) + ($summary['edWaste'] * 1250) == 0 ? " " : $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), 'absClosingStock' => $summary['edProduction'] - $summary['edUsage'] + ($summary['coolerBags'] * 1250) + ($summary['cycloneWaste'] * 1250) + ($summary['edWaste'] * 1250) == 0 ? " " : $summary['edProduction'] - ($summary['edUsage'] + ($summary['coolerBags'] * 1250) + ($summary['cycloneWaste'] * 1250) + ($summary['edWaste'] * 1250)),
'absPhysicalStock' => '', 'absPhysicalStock' => '',
'absRemarks' => '', 'absRemarks' => '',
], ],
[ [
'absParticulars' => "TRP Total Sand", 'absParticulars' => "TRP Total Sand",
'absRunningHrs' => $summary['sandFeedingHours'], 'absRunningHrs' => $summary['sandFeedingHours'] == 0 ? " " : $summary['sandFeedingHours'],
'absPerHour' => $summary['trpProductionPerHour'], 'absPerHour' => $summary['trpProductionPerHour'] == 0 ? " " : $summary['trpProductionPerHour'],
'absOpeningStock' => '', 'absOpeningStock' => '',
'absReceipt' => $summary['trpProduction'], 'absReceipt' => $summary['trpProduction'] == 0 ? " " : $summary['trpProduction'],
'absTotal' => $summary['trpProduction'], 'absTotal' => $summary['trpProduction'] == 0 ? " " : $summary['trpProduction'],
'absConsumption' => $totalCrsReceived, 'absConsumption' => $totalCrsReceived == 0 ? " " : $totalCrsReceived,
'absClosingStock' => $summary['trpProduction'] - $totalCrsReceived, 'absClosingStock' => $summary['trpProduction'] - $totalCrsReceived == 0 ? " " : $summary['trpProduction'] - $totalCrsReceived,
'absPhysicalStock' => '', 'absPhysicalStock' => '',
'absRemarks' => '', 'absRemarks' => '',
], ],
@ -1740,12 +1745,12 @@ $timeOtions[] = "12:00 AM";
'absParticulars' => "Trp Physical Gas Consumption", 'absParticulars' => "Trp Physical Gas Consumption",
'absRunningHrs' => "", 'absRunningHrs' => "",
'absPerHour' => number_format(($summary['trpPlusDrierGasConsumption']) / (($summary['trpProduction'] == 0 ? 1000 : $summary['trpProduction']) / 1000), 2, '.', ''), 'absPerHour' => number_format(($summary['trpPlusDrierGasConsumption']) / (($summary['trpProduction'] == 0 ? 1000 : $summary['trpProduction']) / 1000), 2, '.', '') == 0 ? " " : number_format(($summary['trpPlusDrierGasConsumption']) / (($summary['trpProduction'] == 0 ? 1000 : $summary['trpProduction']) / 1000), 2, '.', ''),
'absOpeningStock' => '', 'absOpeningStock' => '',
'absReceipt' => $summary['gasReceiptBg'] + $summary['gasReceiptPg'], 'absReceipt' => $summary['gasReceiptBg'] + $summary['gasReceiptPg'] == 0 ? " " : $summary['gasReceiptBg'] + $summary['gasReceiptPg'],
'absTotal' => $summary['gasReceiptBg'] + $summary['gasReceiptPg'], 'absTotal' => $summary['gasReceiptBg'] + $summary['gasReceiptPg'] == 0 ? " " : $summary['gasReceiptBg'] + $summary['gasReceiptPg'],
'absConsumption' => $summary['physicalGasConsumption'], 'absConsumption' => $summary['physicalGasConsumption'] == 0 ? " " : $summary['physicalGasConsumption'],
'absClosingStock' => ($summary['gasReceiptBg'] + $summary['gasReceiptPg']) - $summary['physicalGasConsumption'], 'absClosingStock' => ($summary['gasReceiptBg'] + $summary['gasReceiptPg']) - $summary['physicalGasConsumption'] == 0 ? " " : ($summary['gasReceiptBg'] + $summary['gasReceiptPg']) - $summary['physicalGasConsumption'],
'absPhysicalStock' => '', 'absPhysicalStock' => '',
'absRemarks' => '', 'absRemarks' => '',
], ],
@ -1753,12 +1758,12 @@ $timeOtions[] = "12:00 AM";
'absParticulars' => "Trp Panel Gas Consumption", 'absParticulars' => "Trp Panel Gas Consumption",
'absRunningHrs' => "", 'absRunningHrs' => "",
'absPerHour' => number_format(($summary['panelGasConsumption']) / (($summary['trpProduction'] == 0 ? 1000 : $summary['trpProduction']) / 1000), 2), 'absPerHour' => number_format(($summary['panelGasConsumption']) / (($summary['trpProduction'] == 0 ? 1000 : $summary['trpProduction']) / 1000), 2) == 0 ? " " : number_format(($summary['panelGasConsumption']) / (($summary['trpProduction'] == 0 ? 1000 : $summary['trpProduction']) / 1000), 2),
'absOpeningStock' => '', 'absOpeningStock' => '',
'absReceipt' => $summary['gasReceiptBg'] + $summary['gasReceiptPg'], 'absReceipt' => $summary['gasReceiptBg'] + $summary['gasReceiptPg'] == 0 ? " " : $summary['gasReceiptBg'] + $summary['gasReceiptPg'],
'absTotal' => $summary['gasReceiptBg'] + $summary['gasReceiptPg'], 'absTotal' => $summary['gasReceiptBg'] + $summary['gasReceiptPg'] == 0 ? " " : $summary['gasReceiptBg'] + $summary['gasReceiptPg'],
'absConsumption' => $summary['panelGasConsumption'], 'absConsumption' => $summary['panelGasConsumption'] == 0 ? " " : $summary['panelGasConsumption'] ,
'absClosingStock' => ($summary['gasReceiptBg'] + $summary['gasReceiptPg']) - $summary['panelGasConsumption'], 'absClosingStock' => ($summary['gasReceiptBg'] + $summary['gasReceiptPg']) - $summary['panelGasConsumption'] == 0 ? " " : ($summary['gasReceiptBg'] + $summary['gasReceiptPg']) - $summary['panelGasConsumption'],
'absPhysicalStock' => '', 'absPhysicalStock' => '',
'absRemarks' => '', 'absRemarks' => '',
], ],
@ -1768,9 +1773,9 @@ $timeOtions[] = "12:00 AM";
'absRunningHrs' => "", 'absRunningHrs' => "",
'absPerHour' => "", 'absPerHour' => "",
'absOpeningStock' => '', 'absOpeningStock' => '',
'absReceipt' => $summary['waterReceipt'], 'absReceipt' => $summary['waterReceipt'] == 0 ? " " : $summary['waterReceipt'],
'absTotal' => $summary['waterReceipt'], 'absTotal' => $summary['waterReceipt'] == 0 ? " " : $summary['waterReceipt'],
'absConsumption' => $summary['waterReceipt'] - $summary['waterConsumption'], 'absConsumption' => $summary['waterReceipt'] - $summary['waterConsumption'] == 0 ? " " : $summary['waterReceipt'] - $summary['waterConsumption'],
'absClosingStock' => '', 'absClosingStock' => '',
'absPhysicalStock' => '', 'absPhysicalStock' => '',
'absRemarks' => '', 'absRemarks' => '',
@ -1778,12 +1783,12 @@ $timeOtions[] = "12:00 AM";
[ [
'absParticulars' => "Power Consumption", 'absParticulars' => "Power Consumption",
'absRunningHrs' => $summary['ebReadingPerUnitTon'], 'absRunningHrs' => $summary['ebReadingPerUnitTon'] == 0 ? " " : $summary['ebReadingPerUnitTon'],
'absPerHour' => "", 'absPerHour' => "",
'absOpeningStock' => '', 'absOpeningStock' => '',
'absReceipt' => '', 'absReceipt' => '',
'absTotal' => '', 'absTotal' => '',
'absConsumption' => $summary['ebReading'], 'absConsumption' => $summary['ebReading'] == 0 ? " " : $summary['ebReading'],
'absClosingStock' => '', 'absClosingStock' => '',
'absPhysicalStock' => '', 'absPhysicalStock' => '',
'absRemarks' => '', 'absRemarks' => '',
@ -2528,8 +2533,6 @@ $timeOtions[] = "12:00 AM";
}) })
</script> </script>
<script> <script>
$('#month').change(function() { $('#month').change(function() {
$('#changeMonthForm').submit(); $('#changeMonthForm').submit();
@ -2567,11 +2570,13 @@ $timeOtions[] = "12:00 AM";
} else { } else {
document.exitFullscreen().then(() => { document.exitFullscreen().then(() => {
div.style.width = "100%"; div.style.width = "100%";
div.style.height = "100%"; div.style.height = "auto";
// Reset .table-responsive height when exiting fullscreen // Reset .table-responsive height when exiting fullscreen
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) { if (tableResponsive) {
tableResponsive.style.height = "auto"; tableResponsive.style.maxHeight = "450px";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
} }
}).catch(err => console.log("Error exiting fullscreen:", err)); }).catch(err => console.log("Error exiting fullscreen:", err));
} }

View File

@ -202,7 +202,7 @@
background-color: #50bbd9; background-color: #50bbd9;
/* Green background */ /* Green background */
color: #ffffff; color: #ffffff;
border: 1px solid #ddd; border: 2px solid ;
padding: 10px; padding: 10px;
} }
@ -328,7 +328,7 @@
<div class="col-3"> <div class="col-3">
</div> </div>
<div class="col-2 mt-2"> <div class="col-2 mt-2 ml-4">
<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 " class="form-control "
@ -345,13 +345,13 @@
<input type="text" id="searchInput" placeholder="Search..." <input type="text" id="searchInput" placeholder="Search..."
class="mt-2" class="mt-2"
style="padding: 8px;margin-bottom: 10px;width: 150px;border: 1px solid #ccc; style="padding: 8px;margin-bottom: 10px;width: 150px;border: 2px solid rgb(123, 11, 214);
border-radius: 5px;margin-right:15px;"> border-radius: 5px;margin-right:15px;">
<i class="fa fa-table btn-lg mt-2" <i class="fa fa-table btn-lg mt-2"
title="Date Range Filter" title="Date Range Filter"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(95, 102, 105)"
data-toggle="modal" data-toggle="modal"
data-target="#filterModalId"> data-target="#filterModalId">
@ -359,20 +359,20 @@
<i class="fa fa-download btn-lg mt-2" <i class="fa fa-download btn-lg mt-2"
title="Excel Download" title="Excel Download"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color: #0b7cba"
id="trpSandUseStockExport"> id="trpSandUseStockExport">
</i> </i>
<i class="fe-maximize noti-icon btn-lg mt-2" <i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen" title="Full Screen"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()"> onclick="toggleDivFullscreen()">
</i> </i>
<i class="fa fa-save btn-lg mt-2" <i class="fa fa-save btn-lg mt-2"
title="Save" title="Save"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)"
id="saveId"> id="saveId">
</i> </i>
@ -380,7 +380,7 @@
</div> </div>
<div class="col-2"> <div class="col-4">
</div> </div>
</div> </div>
@ -998,8 +998,10 @@
div.style.height = "100%"; div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen // Reset .table-responsive height when exiting fullscreen
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) { if (tableResponsive) {
tableResponsive.style.height = "auto"; tableResponsive.style.maxHeight = "450px";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
} }
}).catch(err => console.log("Error exiting fullscreen:", err)); }).catch(err => console.log("Error exiting fullscreen:", err));
} }

View File

@ -641,8 +641,10 @@
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary waves-effect" <button type="button" class="btn btn-secondary waves-effect"
data-dismiss="modal" value="Cancel">Cancel</button> data-dismiss="modal" value="Cancel">Cancel</button>
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Auditor'){?>
<button type="button" <button type="button"
class="btn btn-info waves-effect waves-light" onclick="modalSave()">Save</button> class="btn btn-info waves-effect waves-light" onclick="modalSave()">Save</button>
<?php } ?>
</div> </div>
</div> </div>
</div> </div>
@ -1082,6 +1084,7 @@
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');
var roleText = '<?php echo session()->get('roleText') ?>';
// alert(igrstatus); // alert(igrstatus);
var buttonContainer = $(".buttonContainer"); var buttonContainer = $(".buttonContainer");
@ -1295,10 +1298,9 @@
} }
} }
// userrole is security based on status we show and here (else if) // other userrole(except admin). based on status we show and here (else if)
else if (userRole !== 1) { else if (userRole !== 1) {
if (igrstatus === "ST074") { if (igrstatus === "ST074") {
$("#pendingQuantityHeader").css("display", "table-cell"); $("#pendingQuantityHeader").css("display", "table-cell");
trIGRHTML += '<tr>' + trIGRHTML += '<tr>' +
@ -1306,15 +1308,26 @@
'<td style="width: 100px;" name="MaterialName" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' + '<td style="width: 100px;" name="MaterialName" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
'<td style="width: 150px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' + '<td style="width: 150px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' +
'<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' + '<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' +
'<td style="width: 100px;" id="Quantity' + i + '" name="Quantity">' + parseInt(item.Quantity) + '</td>' + '<td style="width: 100px;" id="Quantity' + i + '" name="Quantity">' + parseInt(item.Quantity) + '</td>';
'<td style="width: 100px;" data-name="sel" ><input type="text" onchange="validateReceivedQuantity(' + i + ',' + isOpenOrder + ')"id="QuantityAsPerInvoice' + i + '" name="QuantityAsPerInvoice' + i + '" value="' + parseInt(item.QuantityAsPerInvoice) + '" onkeypress="return isNumberKey(event);" style="width: 75px;"></td>' + if (userRole == 5) { // 5 - lab staff
'<td style="width: 100px;" name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + ((isOpenOrder) ? 0 : parseInt(item.Quantity - item.QuantityAsPerInvoice)) + '</td>' + trIGRHTML += '<td style="width: 100px;"> ' + parseInt(item.QuantityAsPerInvoice) + ' </td>';
} else {
trIGRHTML += '<td style="width: 100px;" data-name="sel" ><input type="text" onchange="validateReceivedQuantity(' + i + ',' + isOpenOrder + ')"id="QuantityAsPerInvoice' + i + '" name="QuantityAsPerInvoice' + i + '" value="' + parseInt(item.QuantityAsPerInvoice) + '" onkeypress="return isNumberKey(event);" style="width: 75px;"></td>';
}
trIGRHTML += '<td style="width: 100px;" name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + ((isOpenOrder) ? 0 : parseInt(item.Quantity - item.QuantityAsPerInvoice)) + '</td>' +
'<td style="width: 50px;" id="Rate' + i + '" >' + Number(item.Rate).toFixed(2) + '</td>' + '<td style="width: 50px;" id="Rate' + i + '" >' + Number(item.Rate).toFixed(2) + '</td>' +
'<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: 100px;"><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" style="width: 75px;" value="'+item.Remarks+'"> </td>' + if (userRole == 5) {
'<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>' + trIGRHTML += '<td style="width: 100px;"> ' + item.Remarks + ' </td>';
} else {
trIGRHTML += '<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>';
}
trIGRHTML += '<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 + '">' +
@ -1342,6 +1355,7 @@
trIGRHTML +='</tr>'; 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');
} }
@ -1354,13 +1368,25 @@
'<td style="width: 100px;" name="MaterialName" id="MaterialCode" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' + '<td style="width: 100px;" name="MaterialName" id="MaterialCode" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
'<td style="width: 150px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' + '<td style="width: 150px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' +
'<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' + '<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' +
'<td style="width: 100px;" name="Quantity">' + item.Quantity + '</td>' + '<td style="width: 100px;" name="Quantity">' + item.Quantity + '</td>' ;
'<td style="width: 100px;" data-name="sel" >' + item.QuantityAsPerInvoice + '</td>' + if (userRole == 5) { // 5 - lab staff
'<td style="width: 50px;" id="Rate' + i + '" >' + Number(item.Rate).toFixed(2) + '</td>' + trIGRHTML += '<td style="width: 100px;"> ' + Number(item.QuantityAsPerInvoice).toFixed(2) + ' </td>';
} else {
trIGRHTML += '<td style="width: 100px;" data-name="sel" >' + item.QuantityAsPerInvoice + '</td>';
}
trIGRHTML += '<td style="width: 50px;" id="Rate' + i + '" >' + Number(item.Rate).toFixed(2) + '</td>' +
'<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: 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>' + if (userRole == 5) {
trIGRHTML += '<td style="width: 100px;"> ' + item.Remarks + ' </td>';
} else {
trIGRHTML += '<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>';
}
trIGRHTML += '<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 + '">' +
@ -1388,6 +1414,7 @@
trIGRHTML +='</tr>'; trIGRHTML +='</tr>';
} }
} }
} }
} }