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>
*/
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->post('fetchLeaveApplicationForm', 'Monthlypay::fetchLeaveApplicationForm');
$routes->get('deleteLeaveApplicationForm', 'Monthlypay::deleteLeaveApplicationForm');
$routes->post('validateDateRange', 'Monthlypay::validateDateRange');
$routes->match(['GET', 'POST'], 'leaveApplicationPDF/(:any)', 'Monthlypay::leaveApplicationPDF/$1');
$routes->match(['GET', 'POST'], 'overTimeDetails', 'Monthlypay::overTimeDetails');
@ -326,7 +327,9 @@ $routes->post('inwardgateregister/edituploadfile', 'Inwardgateregister::edituplo
$routes->post('getIGRRemarks', 'Inwardgateregister::getIGRRemarks');
$routes->post('saveIGRRemarks', 'Inwardgateregister::saveIGRRemarks');
$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");

View File

@ -229,6 +229,7 @@ class Amendmentpurchaseorder extends BaseController
*/
function EditRevenuePurchaseOrder()
{
helper('numberseries');
$NewPO = '';
$MAD = '';
// $changeStatus ,will havestatus code itself provided from front-end , no need of constants
@ -309,8 +310,9 @@ class Amendmentpurchaseorder extends BaseController
if ($PaymentTerms != 'PT08') {
$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);
$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');
$requestfilename = $file->getName();
$PrePOFile = $this->request->getPost('PrePOFile');
@ -580,13 +582,13 @@ class Amendmentpurchaseorder extends BaseController
$recqty = $qty[0]->rec;
// $POno = $qtyvalue->PONO;
if ($ordqty == $recqty) {
if(!$IsOpenOrder):if ($ordqty == $recqty) {
$Newstatus = array('Status' => IGR_CREATED);
$this->purchaseorder_model->POLineItemsupdatestatus($NewPO, $Newstatus);
$this->purchaseorder_model->pomasterupdatestatus($NewPO, $Newstatus);
}
}endif;
$message = 'Purchase Order ' . $PONO . ' Amended Successfully! - New PO Number is: ' . $NewPO ;
@ -603,7 +605,7 @@ class Amendmentpurchaseorder extends BaseController
function UpdateAmendServicePurchaseOrder()
{
// dd($this->request->getPost());
helper('numberseries');
$PONO = $this->request->getPost('txtPONO');
$changeStatus = $this->request->getPost('changeStatus');
@ -672,6 +674,7 @@ class Amendmentpurchaseorder extends BaseController
$qtycheck = $this->purchaseorder_model->getqtycheck($PONO);
$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) {
$qtycheckresult = $qty->IsQualityChkReqired;
}
@ -685,7 +688,7 @@ class Amendmentpurchaseorder extends BaseController
}
$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');
$PrePOFile = $this->request->getPost('PrePOFile');
$requestfilename = $file ? $file->getName() : null;
@ -879,13 +882,13 @@ class Amendmentpurchaseorder extends BaseController
$recqty = $qty[0]->rec;
// $POno = $qtyvalue->PONO;
if ($ordqty == $recqty) {
if(!$IsOpenOrder):if ($ordqty == $recqty) {
$Newstatus = array('Status' => IGR_CREATED);
$this->purchaseorder_model->POLineItemsupdatestatus($NewPO, $Newstatus);
$this->purchaseorder_model->pomasterupdatestatus($NewPO, $Newstatus);
}
}endif;
$message = 'Purchase Order ' . $PONO . ' Amended Successfully! - New PO Number is: ' . $NewPO ;
if($changeStatus == 'ST014'){
@ -900,6 +903,7 @@ class Amendmentpurchaseorder extends BaseController
*/
function EditAmendCapitalPurchaseOrder()
{
helper('numberseries');
$changeStatus = $this->request->getPost('changeStatus');
$PONO = $this->request->getPost('txtPONO');
$MAD = '';
@ -1309,7 +1313,7 @@ class Amendmentpurchaseorder extends BaseController
function EditAmendImportPO()
{
// echo "<pre>"; print_r($this->request->getPost()); echo"</pre>";
helper('numberseries');
$MAD = '';
$PONO = $this->request->getPost('txtPONO');

View File

@ -122,6 +122,7 @@ class Emergencypurchaseorder extends BaseController
//This used to Create Service Purchase Order
function addNewServicePurchaseOrder()
{
helper('numberseries');
// print_r($this->request->getPost());die;
$txtRowCount = $this->request->getPost('txtRowCount');
$POdt = $this->request->getPost('PODate');
@ -365,7 +366,7 @@ class Emergencypurchaseorder extends BaseController
//This used to Create Revenue Emergency Purchase Order
function addNewRevenuePurchaseOrder()
{
helper('numberseries');
// print_r($this->request->getPost());die;
$txtspl = $this->request->getPost('txtSpecial');
@ -617,12 +618,14 @@ class Emergencypurchaseorder extends BaseController
$igr = array();
$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);
$igrM = $this->inwardgateregister_model->addigrM($igr);
$IGRNO = !empty($igrM) ? $igrM : '';
$IGRNO = $newIGRNO;
if ($Qualitycheck == 0) {
@ -1162,6 +1165,7 @@ class Emergencypurchaseorder extends BaseController
//This used to Create Revenue Purchase Order
function addNewPurchaseOrder()
{
helper('numberseries');
$POdt = $this->request->getPost('PODate');
$PODate = get_date_time_format($POdt);
$SupplierID = $this->request->getPost('drpSupplier');

View File

@ -48,16 +48,10 @@ class Expense extends BaseController
$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()
{
helper('numberseries');
try{
$file = $this->request->getFile('transporterfile');
$fileName = '';
@ -66,28 +60,11 @@ class Expense extends BaseController
$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
$lastSerial = $this->expense_model->getLastSerialNumber($financialYear);
$lastSerial = $this->expense_model->getLastSerialNumber();
// Generate the next serial number
$newSerialNumber = $this->generateSerialNumber($financialYear, $lastSerial);
$newSerialNumber = generate_non_igr_number($lastSerial);
$sesn_uid = $this->session->get('userId');
$data = [

View File

@ -10,6 +10,7 @@ use App\Models\Inwardgateregister_model;
use App\Models\IGRRemarks_model;
use App\Models\GasShortageModel;
use App\Helpers\Notification;
use App\Models\Rawmaterialdetails_model;
use DateTime;
use ZipArchive;
@ -27,6 +28,8 @@ class Inwardgateregister extends BaseController
protected $inwardgateregister_model;
protected $IGRRemarks_model;
protected $gasShortage_model;
protected $rawMaterialDetails_model;
protected $session;
protected $logger;
@ -40,6 +43,7 @@ class Inwardgateregister extends BaseController
$this->inwardgateregister_model = new Inwardgateregister_model();
$this->IGRRemarks_model = new IGRRemarks_model();
$this->gasShortage_model = new GasShortageModel();
$this->rawMaterialDetails_model = new Rawmaterialdetails_model();
$this->session = session();
helper('form'); //$this->load->library('form_validation');
@ -401,6 +405,7 @@ class Inwardgateregister extends BaseController
function SaveIGR()
{
#Step 1 IGR Details
helper('numberseries');
$PONO = $this->request->getPost('PONO');
$IsThisOpenOrderPO = $this->request->getPost('hiddenIsOpenOrder');
$DeliveryChellanOrInvoiceNo = $this->request->getPost('InvoiceNo');
@ -447,7 +452,11 @@ class Inwardgateregister extends BaseController
}
}
#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;
#Step 4 Calling DB to Save IGR Master
$IGRNO = $this->inwardgateregister_model->addigrM($igr);
@ -550,7 +559,16 @@ class Inwardgateregister extends BaseController
}
$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;
log_message('error', 'SaveIGR igrDetails result : ' . json_encode($igrDetails));
@ -928,7 +946,7 @@ function viewIGRDetails()
$result_for_email = $this->inwardgateregister_model->getDetailsforEmail($this->session->get('userId'),$roleId);
$result_for_history = $this->inwardgateregister_model->getHistoryDetailsforEmail($IGRNo);
$notification = new Notification();
$history_content = "<br>IGR History<br><br> <ul>";
@ -984,19 +1002,21 @@ function viewIGRDetails()
// $history_content .= "<br>" . $readable_field . ": `" . $history[$j]->old_data . "` was updated to `" . $history[$j]->new_data . "` .";
}
$history_content .= "</ul>";
$email = "";
for ($i = 0; $i < count($result_for_email['emails']); $i++) {
$email .= $result_for_email['emails'][$i]->email . " , ";
$to_email_addr = "";
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([
'recipient_email' => $email,
'recipient_email' => $to_email_addr,
'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' => $result_for_history['first_line']."<br>" .$history_content,
'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));
@ -1006,9 +1026,9 @@ function viewIGRDetails()
// Log the result
if ($receiving_status) {
$this->logger->info("Email IDs = " . $email . " " . $mail_log);
$this->logger->info("Email IDs = " . $to_email_addr . " " . $mail_log);
} else {
$this->logger->error("Email IDs = " . $email . " " . $mail_log);
$this->logger->error("Email IDs = " . $to_email_addr . " " . $mail_log);
}
// echo "***".$history_content;die;
@ -1424,22 +1444,25 @@ function updateIGRWeight(){
$result_for_email = $this->inwardgateregister_model->getDetailsforEmail($this->session->get('userId'),$roleId);
$email = "";
for ($i = 0; $i < count($result_for_email['emails']); $i++) {
$email .= $result_for_email['emails'][$i]->email . " , ";
}
$email = rtrim($email, " ,");
// print_r($result_for_email);die;
$to_email_addr = '';
for ($i = 0; $i < count($result_for_email['to_mails']); $i++) {
$to_email_addr .= $result_for_email['to_mails'][$i]->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.'"';
$notification = new Notification();
$notification->sendEmail([
'recipient_email' => $email,
'recipient_email' => $to_email_addr,
'subject' => $result_for_email['company'].' - IGR Remark Raised',
'carboncopy' =>"pavithra.t@venbainfotech.com",
'description' => $content,
'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()
{
$postData = $this->request->getPost();
// Validate required data
if (!$postData) {
return $this->response->setJSON(['status' => 'error', 'message' => 'Invalid request. No data received.']);
}
try {
// Validate required fields for adding
if ( !isset($postData['invoiceNo']) ) {
return $this->response->setJSON(['status' => 'error', 'message' => 'Missing required fields: invoice No.']);
}
$postData = $this->request->getJSON(true); // Convert JSON to an associative array
// Handle update (edit)
if (isset($postData["id"])) {
return $this->gasShortage_model->update($postData["id"], $postData)
? $this->response->setJSON(['status' => 'success', 'message' => 'Gas shortage details updated successfully.'])
: $this->response->setJSON(['status' => 'error', 'message' => 'Failed to update gas shortage details.']);
}
// Insert new shortage (add)
return ($insertId = $this->gasShortage_model->insert($postData))
? $this->response->setJSON(['status' => 'success', 'message' => 'Gas shortage details added successfully.', 'data' => ['id' => $insertId]])
: $this->response->setJSON(['status' => 'error', 'message' => 'Failed to save gas shortage details.']);
// Validate if any data is received
if (!$postData) {
return $this->response->setJSON([
'status' => 'error',
'message' => 'Invalid request. No data received.'
]);
}
// Validate required fields
if (empty($postData['invoiceNo']) ) {
return $this->response->setJSON([
'status' => 'error',
'message' => 'Missing invoiceNo data.'
]);
}
$updates = [];
$inserts = [];
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
}
$cylinderData = [
'IGRNO' => $postData['IGRNO'] ?? '',
'fullCylinderDate' => $postData['fullCylinderDate'] ?? '',
'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

@ -101,7 +101,7 @@ class Monthlypay extends BaseController
function attendanceLoad()
{
$month['month'] = '';
$monthdays = 0;
$begin = 0;
@ -111,7 +111,7 @@ class Monthlypay extends BaseController
$current = $this->request->getPost('month');
$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 = $month_arr['month'];
$current = $year . "-" . $month . '-01';
@ -151,7 +151,44 @@ class Monthlypay extends BaseController
$data['datefordropdown'] = $current;
$data['attendance'] = $this->monthlypay_model->monthlyAttendance($current);
$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->loadViews("attendance", $this->global, $data, NULL);
}
@ -971,7 +1008,21 @@ class Monthlypay extends BaseController
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()
{
$leave_application_id = $this->request->getGet('leave_application_id') ? $this->request->getGet('leave_application_id') : '';
@ -994,10 +1045,8 @@ class Monthlypay extends BaseController
$data['leave_info'] = $this->monthlypay_model->getheringleaveApplicationForm($leave_application_id);
$data['company_info'] = $this->monthlypay_model->getCompanyInformation();
$html = view('leaveApplicationPDF', $data);
// echo $html;die;
$data['company_info'] = $this->monthlypay_model->getCompanyInformation();
$html = view('leaveApplicationPDF', $data); // echo $html;
$mpdf = new Mpdf();
$mpdf->WriteHTML($html);

View File

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

View File

@ -1113,6 +1113,7 @@ class Purchaseorder extends BaseController
//This used to Create Revenue Purchase Order
function addNewPurchaseOrder()
{
helper('numberseries');
try {
// Extract POST data
@ -1985,6 +1986,7 @@ class Purchaseorder extends BaseController
function addNewImportPurchaseOrder()
{
helper('numberseries');
try {
$POdt = $this->request->getPost('PODate');
$PODate = get_date_time_format($POdt);
@ -2597,7 +2599,7 @@ class Purchaseorder extends BaseController
} else {
$store = array('Status' => $StatusCode, 'OnHoldOn' => $ApprovedDate, 'OnHoldBy' => $ApprovedBy, 'Remarks' => $Remarks);
$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*/
function addNewCapitalPurchaseOrder()
{
helper('numberseries');
try {
$POdt = $this->request->getPost('PODate');
$PODate = get_date_time_format($POdt);

View File

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

View File

@ -1020,7 +1020,7 @@ class User extends BaseController
// Validation passed
$EmpID = $this->request->getPost('EmpList');
$roleId = '2';
$roleId = !empty($this->request->getPost('role')) ? $this->request->getPost('role') : '2' ;
$password = (string)$this->request->getPost('password');
$Createddt = date('Y-m-d H:i:s');
$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
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'))
{
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'
];
public function getLastSerialNumber($financialYear)
public function getLastSerialNumber()
{
return $this->db->table('t_expense')
->select('serial_number')

View File

@ -6,15 +6,25 @@ use CodeIgniter\Model;
class GasShortageModel extends Model
{
protected $table = 't_gasShortageDetails';
protected $table = 't_gasshortagedetails';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'array';
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields =
['fullCylinderDate','emptyCylinderDate','invoiceNo',
'cylinderNo','grossWeight','tareWeight','netWeight','actualWeight','shortage'
['id',
'IGRNO',
'fullCylinderDate',
'emptyCylinderDate',
'invoiceNo',
'cylinderNo',
'grossWeight',
'tareWeight',
'netWeight',
'actualWeight',
'shortage',
'gas_cylinder_status'
];
protected bool $allowEmptyInserts = false;

File diff suppressed because it is too large Load Diff

View File

@ -72,6 +72,8 @@ class Monthlypay_model extends Model
->orderBy('EmpID', 'asc');
$query = $builder->get();
$result = $query->getResult();
// $last_query = $this->db->getLastQuery();
// echo $last_query;die;
return $result;
}
@ -177,6 +179,8 @@ class Monthlypay_model extends Model
$year_val = date('Y', strtotime($current));
$date_val = cal_days_in_month(CAL_GREGORIAN, $month_val, $year_val);
$lastdate = $year_val . '-' . $month_val . '-' . $date_val;
// echo $current;
// echo "last date - ".$lastdate;die;
$builder = $this->db->table('t_attendance')
->select('t_attendance.*,t_employee_details.FirstName,t_employee_details.LastName')
@ -191,6 +195,8 @@ class Monthlypay_model extends Model
$query = $builder->get();
$result = $query->getResult();
// $last_query = $this->db->getLastQuery();
// echo $last_query;die;
return $result;
}
@ -571,6 +577,26 @@ where Month_Year = ? and att.EmpID in (select EmpID from t_attendance)";
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 = "")
{
@ -617,5 +643,25 @@ where Month_Year = ? and att.EmpID in (select EmpID from t_attendance)";
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)

View File

@ -1252,10 +1252,12 @@ if (!empty($getlogpodtl)) {
<div class="form-row">
<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 == 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
<?php } ?>
<?php if(!$isChecked){ ?>
<a data-toggle="modal"><button type="submit" onclick="myFunction();" class="btn btn-success" id="abcd">Select Line Item</button> </a>
<?php } ?>
<?php } ?>
</div>
</div>
@ -1504,34 +1506,37 @@ if (!empty($getlogpodtl)) {
<div class="form-row ">
<div class="form-group col-md-12" id="splpodiv">
<label>Special po Table List</label>
<table id="table2" class="table table-striped table-hover mb-0" style="font-size:12px;">
<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 class="form-row">
<div class="col-md-5 text-left">
<label class="mt-2">Special po Table List</label>
</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>
<input type="hidden" name="hidecounter" id="hidecounter" 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>
<tr>
<th>Bill No </th>
<!-- <th>Materials</th> -->
<!-- <th>Delivery Challan No</th> -->
<!-- <th>Delivery Challan Date</th>
<th>Vehicle No</th>
<th>Courier No</th> -->
<!-- <th>Delivery Challan Date</th> -->
<!-- <th>Vehicle No</th> -->
<!-- <th>Courier No</th> -->
<!-- <th>Quantity</th> -->
<th>File</th>
<th>Action</th>
</tr>
</thead>
@ -1547,7 +1552,9 @@ if (!empty($getlogpodtl)) {
<input type="hidden" id="billnos<?= $row ?>" value="<?= $gd->BillNo ?>">
<input type="hidden" id="file<?= $row ?>" value="<?= $gd->FilePath ?>">
<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)) { ?>
<a target="_blank" href="<?php echo base_url() . 'public/uploads/BillFiles/' ?><?php echo $gd->FilePath ?>"><i class="fa fa-download"></i></a>
<?php } ?>
@ -1561,6 +1568,7 @@ if (!empty($getlogpodtl)) {
</table>
</div>
<!-- update if condition here -->
<?php if (!empty($update)) { ?>
<!-- <div class="form-group col-md-12" id="editpodiv">
<div class="form-group col-md-12"><label>Editable POScreen</label>
@ -1592,7 +1600,6 @@ if (!empty($getlogpodtl)) {
$inde = $inde + 1;
?>
<tr id="<?php echo $inde; ?>">
<td><?php echo $inde; ?></td>
<td><?php echo $oldpo->PONO ?></td>
@ -1633,8 +1640,9 @@ if (!empty($getlogpodtl)) {
</tbody>
</table>
</div>
</div>--> <?php } else {} ?>
<!-- ends here -->
</div>-->
<?php } else {} ?>
<!-- ends here -->
<!-- f i l e c h o o s e n -->
<div class="col-md-12">
@ -1715,10 +1723,9 @@ if (!empty($getlogpodtl)) {
</div>
<!--/. f o o t e r b u t t o n -->
</div>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div><!-- end col @945-->
</div><!-- end form row -->
</div> <!-- end container-fluid -->
</div> <!-- end content -->
@ -1895,7 +1902,7 @@ if (!empty($getlogpodtl)) {
</div>
<div class="form-group col-md-3">
<?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);
?>
</div>
@ -1969,26 +1976,25 @@ if (!empty($getlogpodtl)) {
<!-- Service Special PO Modal Starts Here -->
<div id="EditServiceSplPOModel" class="modal fade" tabindex="-1" role="dialog"
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-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"
aria-hidden="true">×</button>
</div>
<form class="tagForm" id="tag-form" method="post" enctype="multipart/form-data">
<div class="modal-body p-4">
<div class="form-group col-md-12">
<div class="form-group col-md-5">
<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();" />
<label for="images">Select file <br /><small>(only .pdf,.excel,.doc,.png,.jpg)</small></label>
</div>
<div class="modal-body">
<div class="col-md-12">
<span><label for="images">Select file </label><small>&nbsp;&nbsp;(only .pdf,.excel,.doc,.png,.jpg)</small></span><br>
<input type="file" size="20" input accept=".docx,.pdf,.doc.JPG,.PNG,.jpg" id="imag" name="images" onChange="filecheck();" />
<label class="oldimage mt-2"></label>
</div>
<input type="hidden" name="hideoldfile" id="hideoldfile" class="form-control" readonly>
<input type="hidden" name="hidebillno" id="hidebillno" class="form-control" readonly>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary waves-effect"
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);
$("#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>
@ -2731,10 +2745,11 @@ if (!empty($getlogpodtl)) {
var Billno = $("#billnos" + i).val();
//alert(Billno);
$("#EditServiceSplPOModel").modal("show");
$(".oldimage").text(file);
$(".oldimage").text("Previous Upload - "+file);
$("#hideoldfile").val(file);
$("#hidebillno").val(Billno);
$("#bill").text(Billno);
$("#bill-title").text("Update Bill Number - "+Billno);
}
$('.EditService').click(function() {
tinyMCE.triggerSave();
@ -3085,7 +3100,7 @@ if (!empty($getlogpodtl)) {
}
function validateServiceTax() {
var openOrder = $('#IsOpenOrder').prop('checked');
if ($('#ReqNo').val() == "0") {
alert('Please select the Requisition Number');
$('#ReqNo').focus();
@ -3098,39 +3113,46 @@ if (!empty($getlogpodtl)) {
alert('Please select the Material Code');
$('#MaterialCode').focus();
return false;
} else if ($('#Quantity').val() == '') {
alert('Please Enter the Quantity value');
$('#Quantity').focus();
return false;
} else if ($('#Quantity').val() == 0) {
alert('Please Enter the Valid Quantity Value');
$('#Quantity').focus();
return false;
} else if ($('#Rate').val() == '') {
alert('Please Enter the Rate of the Item');
$('#Rate').focus();
return false;
} else if ($('#Rate').val() == 0) {
alert('Please Enter the Valid Rate of the Item');
$('#Rate').focus();
return false;
} else if (ExceedQuantityCheck() == 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) {
$('#Rate').focus();
return false;
} else {
return true;
var openOrder = <?php echo $IsOpenOrder; ?>;
if(!openOrder){
if ($('#Quantity').val() == '') {
alert('Please Enter the Quantity value');
$('#Quantity').focus();
return false;
} else if ($('#Quantity').val() == 0) {
alert('Please Enter the Valid Quantity Value');
$('#Quantity').focus();
return false;
} else if ($('#Rate').val() == '') {
alert('Please Enter the Rate of the Item');
$('#Rate').focus();
return false;
} else if ($('#Rate').val() == 0) {
alert('Please Enter the Valid Rate of the Item');
$('#Rate').focus();
return false;
} else if (ExceedQuantityCheck() == false) {
return false;
} else if (ExceedBudget($('#txtBasicValue').val(), $('#AvlBudAmt').val()) == false) {
$('#Rate').focus();
return false;
} else{
return true;
}
}else{
return true;
}
}
}
function validateEditServiceTax() {
var openOrder = $('#IsOpenOrder').prop('checked');
if ($('#EditCostCenter').val() == "0") {
alert('Please select the Cost center');
$('#EditCostCenter').focus();
@ -3139,33 +3161,35 @@ if (!empty($getlogpodtl)) {
alert('Please select the Material Code');
$('#EditMaterialCode').focus();
return false;
} else if ($('#EditQuantity').val() == '') {
alert('Please Enter the Quantity value');
$('#EditQuantity').focus();
return false;
} else if ($('#EditQuantity').val() == 0) {
alert('Please Enter the Valid Quantity value');
$('#EditQuantity').focus();
return false;
} else if ($('#EditRate').val() == 0) {
alert('Please Enter the Valid Rate of the Item');
$('#EditRate').focus();
return false;
} else if ($('#EditRate').val() == '') {
alert('Please Enter the Rate of the Item');
$('#EditRate').focus();
return false;
} else if (EditExceedQuantityCheck() == false) {
return false;
} else if ($('#EdittxtSpcialInstruction').val() == '') {
alert('Please Enter the Service Description');
$('#EdittxtSpcialInstruction').focus();
return false;
} else if (ExceedBudget($('#txtEditBasicValue').val(), $('#EditAvlBudAmt').val()) == false) {
$('#EditRate').focus();
return false;
} else {
return true;
if(!openOrder){
if ($('#EditQuantity').val() == '') {
alert('Please Enter the Quantity value');
$('#EditQuantity').focus();
return false;
} else if ($('#EditQuantity').val() == 0) {
alert('Please Enter the Valid Quantity value');
$('#EditQuantity').focus();
return false;
} else if ($('#EditRate').val() == 0) {
alert('Please Enter the Valid Rate of the Item');
$('#EditRate').focus();
return false;
} else if ($('#EditRate').val() == '') {
alert('Please Enter the Rate of the Item');
$('#EditRate').focus();
return false;
} else if (EditExceedQuantityCheck() == false) {
return false;
} else if ($('#EdittxtSpcialInstruction').val() == '') {
alert('Please Enter the Service Description');
$('#EdittxtSpcialInstruction').focus();
return false;
} else if (ExceedBudget($('#txtEditBasicValue').val(), $('#EditAvlBudAmt').val()) == false) {
$('#EditRate').focus();
return false;
} else{ return true; }
}else{return true; }
}
}
@ -3817,8 +3841,8 @@ if (!empty($getlogpodtl)) {
'<div class="form-group col">' +
'<label><br></label>' +
'<input type="file" name="browseFiles" id="images' + counter + '" onchange="Copyfilename(this.name); "><br>' +
'<button class="btn btn-success btn-sm add add_this" id="addbtn" onclick="addRow()">ADD</button>'
'<input type="file" name="browseFiles" id="images' + counter + '" onchange="Copyfilename(this.name); ">' +
'<button class="btn btn-success btn-sm add add_this ml-1" id="addbtn" onclick="addRow()">ADD</button>'
'</div>' +
'</div>' +
@ -3879,17 +3903,25 @@ if (!empty($getlogpodtl)) {
}
}
$('#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);
$('#IsOpenOrder').change(function () {
// 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(); }
</script>

View File

@ -1975,12 +1975,12 @@ if (!empty($INRSYMBOL)) {
}
if (isChecked) {
if (PO == 'REVENUE') {
if (POTy == 'REVENUE') {
//alert('normalemergency');
$('#txtSpecial').val(0);
// $('#content').loader('show');
RevenueSave(1)
} else if (PO == 'SERVICE') {
} else if (POTy == 'SERVICE') {
///alert('normal SERVICE emergency');
$('#txtSpecialservice').val(0);
Save(1)
@ -8636,22 +8636,46 @@ if (!empty($INRSYMBOL)) {
$('#Quantity').val(0);
$('#Quantity').removeAttr('required');
$('#Quantity').attr('readonly', true);
$('#txtTotalOrderValue').val(0);
$('#txtBasicValue').val(0);
$('#EditRevenueQuantity').val(0);
$('#EditRevenueQuantity').removeAttr('required');
$('#EditRevenueQuantity').attr('readonly', true);
}
if (input == 'SERVICE') {
$('#ServiceQuantity').val(0);
$('#ServiceQuantity').removeAttr('required');
$('#ServiceQuantity').attr('readonly', true);
$('#ServiceBasAmt').val(0);
$('#TotalOrderValue').val(0);
$('#EditQuantity').val(0);
$('#EditQuantity').removeAttr('required');
$('#EditQuantity').attr('readonly', true);
}
} else {
if (input == 'REVENUE') {
$('#Quantity').val('');
$('#Quantity').removeAttr('readonly');
$('#Quantity').attr('required', true);
$('#txtTotalOrderValue').val('');
$('#txtBasicValue').val('');
$('#EditRevenueQuantity').val(0);
$('#EditRevenueQuantity').removeAttr('readonly');
$('#EditRevenueQuantity').attr('required', true);
}
if (input == 'SERVICE') {
$('#ServiceQuantity').val('');
$('#ServiceQuantity').removeAttr('readonly');
$('#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
$datefordropdown = format_date($datefordropdown, 0, 'M-Y');
//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');
$currentday = date('d');
// print_r($attendance);
// print_r($employeeleavedate);
// dd($attendance);die;
// echo "<br>------------------------------<br>";
?>
@ -284,8 +281,6 @@ $currentday = date('d');
<?php
$testarray = array();
$finalarray = array();
if (!empty($attendance)) {
@ -347,6 +342,7 @@ $currentday = date('d');
}
}
?>
@ -397,6 +393,7 @@ $currentday = date('d');
</tr>
</thead>
<tbody style="background-color: #fff;">
<?php $index = 0;
@ -416,6 +413,7 @@ $currentday = date('d');
<?php for ($col = 1; $col <= $monthdays; $col++) {
$flag = 0;
$flag2 = 0;
$absent = 0;
if ($col == $currentday) {
$todayflag = 1;
@ -443,9 +441,26 @@ $currentday = date('d');
$WH = 'WH' . $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; ?> "
<?php } else if ($flag == 1) { ?> title="sunday" <?php } ?>
<?php if ($absent == 1) { ?> title="absent" <?php } ?>
class="celda_normal"
onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);"
id="<?php echo $row . 'row' . $col . 'W'; ?>"
@ -454,7 +469,12 @@ $currentday = date('d');
} else if ($todayflag == 1) {
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)) {
echo $a->$WH;
} else {
@ -462,6 +482,7 @@ $currentday = date('d');
} ?></td>
<td <?php if ($flag2 == 1) { ?> title=" <?php echo $title; ?> "
<?php } else if ($flag == 1) { ?> title="sunday" <?php } ?>
<?php if ($absent == 1) { ?> title="absent" <?php } ?>
class="celda_normal"
onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);"
id="<?php echo $row . 'row' . $col . 'OT'; ?>"
@ -470,7 +491,12 @@ $currentday = date('d');
} else if ($todayflag == 1) {
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)) {
echo $a->$OT;
} else {

View File

@ -55,7 +55,7 @@
<td>
<?php if($record->is_driver){ ?>
&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;
</a>
<?php } ?>
@ -122,6 +122,7 @@
</div><!-- /.modal -->
<script>
$(document).ready(function () {
$('.tooltip-trigger').tooltip();
$("#ddwizard").on("shown.bs.modal", function (e) {
var id = $(e.relatedTarget).data('id');
var name = $(e.relatedTarget).data('name');

View File

@ -175,6 +175,12 @@ if (!empty($POMaster)) {
$insurenceno = $Req->InsuranceNumber;
$BudgetType = $Req->BudgetType;
$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>
<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="table-responsive" style="padding-bottom: 30px;">
<table id="revenueTax" class="table table-bordered table-hover" style="font-size:12px;">
@ -2850,6 +2865,11 @@ if (!empty($INRSYMBOL)) {
<script>
$(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
$('#freightmodel').on('show.bs.modal', function () {
// 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
});
});
$('#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(); }
</script>

View File

@ -233,6 +233,7 @@ if (!empty($POMaster)) {
$IsOpenOrder = isset($Req->IsOpenOrder) ? $Req->IsOpenOrder : null;
if ($IsOpenOrder !== null && (int) $IsOpenOrder !== 0) {
$isChecked = true;
} else {
@ -378,7 +379,14 @@ if (!empty($getlogpodtl)) {
var InsuranceNumber = '<?php echo $insurenceno; ?>';
var statuscheck = '<?php echo $PONOStatus; ?>';
$(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; ?>") {
$('#splpodiv').show();
// var js_array =<?php echo json_encode($billfile); ?>;
@ -2346,13 +2354,13 @@ if (!empty($getlogpodtl)) {
<div class="form-row">
<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 == 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
<?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();"
class="btn btn-success" id="abcd">Select Line Item</button> </a>
<?php } ?>
<?php } ?>
</div>
</div>
@ -2720,8 +2728,8 @@ if (!empty($getlogpodtl)) {
style="background-color:#fff;font-size:12px;">
<thead style="background-color: #ddd;">
<tr>
<!-- <th>Bill No </th> -->
<!-- <th>Materials</th> -->
<!-- <th>Bill No </th> -->
<!-- <th>Materials</th> -->
<th>Delivery Challan No</th>
<th>Delivery Challan Date</th>
<th>MaterialReceived Date </th>
@ -2764,9 +2772,10 @@ if (!empty($getlogpodtl)) {
<input type="hidden" id="MaterialRcvdDate<?= $row ?>"
value="<?= $gd->MaterialRcvdDate ?>">
<td style="cursor:pointer;"><span onclick="openmodel(<?= $row ?>);"><i
class="ri-pencil-fill"></i></span>
<td style="cursor:pointer;">
<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>
</tr>
<?php
@ -2801,7 +2810,6 @@ if (!empty($getlogpodtl)) {
<thead>
<tr>
<th>Bill No </th>
<th>File</th>
<th>Action</th>
</tr>
@ -5381,8 +5389,8 @@ if (!empty($getlogpodtl)) {
});
function Save(status) {
// console.log("status");
// console.log(status);
console.log("status");
console.log(status);
if (status == '0') {
stat = '<?php echo PO_DRAFT; ?>';
@ -5498,7 +5506,8 @@ if (!empty($getlogpodtl)) {
$('#EditUOM').val($('#uom' + userid).val());
$('#EditQuantity').val($('#quantity' + 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()
if (per == '') {
$('#EditPer').val($('#uom' + userid).val());
@ -5950,10 +5959,16 @@ if (!empty($getlogpodtl)) {
$('#Quantity').val(0);
$('#Quantity').removeAttr('required');
$('#Quantity').attr('readonly', true);
$('#EditQuantity').val(0.00);
$('#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);
}
});
</script>

View File

@ -154,6 +154,14 @@ if (!empty($POMaster)) {
$DescriptionOfPo = $Req->Description_Of_Service;
$BudgetType = $Req->BudgetType;
$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 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>
@ -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->ReceivedQuantity ?></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; ?>" />
@ -1243,10 +1260,10 @@ foreach ($PaymentTerms as $TER) {
//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"
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>-->
<?php
//} else {
@ -1863,6 +1880,12 @@ foreach ($PaymentTerms as $TER) {
$('#EditotherDescription').hide();
$(document).ready(function() {
var openOrder = <?php echo $IsOpenOrder; ?>;
if(openOrder){
$('#EditQuantity').removeAttr('required');
$('#EditQuantity').attr('readonly', true);
}
$("#EDITSERVICE").on("shown.bs.modal", function(e) {
var AvlBudAmt = '<?php echo $AvlAmount ?>';
@ -2275,7 +2298,6 @@ foreach ($PaymentTerms as $TER) {
}
function validateServiceTax() {
if ($('#ReqNo').val() == "0") {
alert('Please select the Requisition Number');
$('#ReqNo').focus();
@ -2308,7 +2330,10 @@ foreach ($PaymentTerms as $TER) {
}
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") {
alert('Please select the Cost center');
$('#EditCostCenter').focus();
@ -2317,11 +2342,11 @@ foreach ($PaymentTerms as $TER) {
alert('Please select the Material Code');
$('#EditMaterialCode').focus();
return false;
} else if ($('#EditQuantity').val() == '' || $('#EditQuantity').val() == 0.00) {
} else if ($('#EditQuantity').val() == '' || (!openOrder && quantity === 0 )){
alert('Please Enter the Quantity value');
$('#EditQuantity').focus();
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');
$('#EditRate').focus();
return false;
@ -2500,6 +2525,20 @@ foreach ($PaymentTerms as $TER) {
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(); }
$(document).ready(function () {
$("#PaymentTerms").change(function() {

View File

@ -107,23 +107,19 @@
<td><?= esc($d['no_of_days']) ?></td>
<td><?= esc($d['status']) ?></td>
<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;
</a>
<!-- <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"> -->
<a onclick="confirmDelete(event)" style="cursor:pointer;" href="<?php echo base_url() . 'deleteLeaveApplicationForm?leave_application_id=' . esc($d['leave_application_id']); ?>">
<i class="fa fa-trash"></i>&nbsp;&nbsp;&nbsp;
</a>
<?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>
<?php if($d['status'] == "Approved"){ ?>
<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;
</a>
<?php } ?>
</td>
</tr>
<?php } ?>
@ -212,7 +208,7 @@
</div>
<div class="col-md-3">
<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><!--/. r o w 5 -->
<div class="row mt-2">
@ -259,60 +255,67 @@
<script>
$(document).ready(function () {
$('.tooltip-trigger').tooltip();
$(".searchabledropdown").select2();
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);
$('#start_date, #end_date').change(function() {
const start = new Date($('#start_date').val());
const end = new Date($('#end_date').val());
if (!isNaN(start.getTime())) {
$('#end_date').val("");
let minDate = start.toISOString().split("T")[0]; // Convert Date to YYYY-MM-DD format
$("#end_date").attr("min", minDate); // Set min attribute for end_date
}
$('#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() {
let start = new Date($('#start_date').val());
let end = new Date($('#end_date').val());
let formattedStart = start.toISOString().split('T')[0]; // Convert to YYYY-MM-DD format
$("#end_date").attr("min", formattedStart);
if (!isNaN(start) && !isNaN(end)) {
const days = Math.floor((end - start) / 86400000) + 1;
$('#no_of_days').val(days > 0 ? days : 1);
} else {
$('#no_of_days').val('');
}
validateDateRange();
});
$("#applicationModal").on("shown.bs.modal", function (e) {
var id = $(e.relatedTarget).data('id');
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) {
$("#" + field).val("");
});
if (id == 0) {
$('#emp_name').val("").select2();
$('#applicationformTitle').html("Apply Leave");
$("#leave_application_id").val(0);
} else {
var arr = $(e.relatedTarget).data('arr');
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");
}
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'];
fields.forEach(field => $("#" + field).val(arr[field] || "").prop('readonly', true));
if (id == 0) {
$('#emp_name').val("").select2();
$('#applicationformTitle').text("Apply Leave");
$("#leave_application_id").val(0);
$("#tempClick").show();
} else {
$('#applicationformTitle').text(arr.status === "Approved" ? "View Leave" : "Edit Leave");
$("#tempClick").toggle(arr.status !== "Approved");
}
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 () {
if ($('#emp_id').val() === '') {
alert('Please Select the Valid Employee');
return;
@ -333,19 +336,23 @@
alert('Please Select Status');
return;
}
// validateDateRange(function(isValid) {
// if (!isValid) {
// alert("The selected date range overlaps with an existing approved leave.");
// return;
// }
var formData = {
leave_application_id:$('#leave_application_id').val(),
emp_id:$('#emp_id').val(),
start_date:$('#start_date').val(),
end_date:$('#end_date').val(),
no_of_days:$('#no_of_days').val(),
reason:$('#reason').val(),
status:$('#status_val').val(),
};
var formData = {
leave_application_id:$('#leave_application_id').val(),
emp_id:$('#emp_id').val(),
start_date:$('#start_date').val(),
end_date:$('#end_date').val(),
no_of_days:$('#no_of_days').val(),
reason:$('#reason').val(),
status:$('#status_val').val(),
};
$('#loader').show();
$('#loader').show();
$.ajax({
type: 'POST',
@ -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>

View File

@ -136,14 +136,14 @@
$cdate = date('d-m-Y', strtotime($record->Created_date));
} ?>
<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;
<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>
</a>
&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>
</a>
@ -245,6 +245,7 @@
});
});
$(document).ready(function() {
$('.tooltip-trigger').tooltip();
$("#accordion-modal").on("shown.bs.modal", function(e) {
var emp = $(e.relatedTarget).data('emp');
var noData = '<p style="text-align: center;">No History Data Available</p>';

View File

@ -78,7 +78,9 @@
</li>
</ol>
</div>
<a id="addExpense" class="btn btn-success" data-toggle="modal" data-target="#expenseModal" href="">Add New Expense</a>
<?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>
<?php } ?>
</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;">
<i class="fas fa-file-download"></i>
</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>
<?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;">
@ -312,7 +316,7 @@
<label for="status" class="col-form-label">Status</label>
</div>
<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="Completed">Completed</option>
<option value="Canceled">Canceled</option>
@ -332,7 +336,9 @@
<div class="modal-footer">
<button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-info waves-effect waves-light tempClick" id="tempClick">Submit</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>
<?php } ?>
</div>
</div>
</div>
@ -363,7 +369,7 @@ dateInput.addEventListener('change', function () {
$(document).on('click', '.edit-button', function() {
var roleText = '<?php echo session()->get('roleText') ?>';
$('.modal-title').html('Edit Expense');
var expenseId = $(this).data('id');
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>';
// Add the file link and delete button
$('#transporterfile').after(fileLink + ' ' + deleteButton);
if(roleText == 'System Administrator' ||roleText == 'Security' ||roleText == 'Auditor'){
$('#transporterfile').after(fileLink + ' ' + deleteButton);
}else{
$('#transporterfile').after(fileLink);
}
} else {
$('#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 -->
<?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 -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-purchase" role="button"
@ -740,12 +740,30 @@
View Inward Gate Register</a>
</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="">
<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>
</div>
<?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>
</li>
<?php } ?>
@ -865,7 +883,7 @@
<!-- 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">
<a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-stock" role="button"

View File

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

View File

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

View File

@ -49,11 +49,20 @@
<div class="container-fluid">
<!-- start page title -->
<div class="row">
<div class="col-12">
<div class="col-10 mt-2">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title">Material Master Details</h4>
</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>
<?php
helper('form');
@ -74,7 +83,7 @@
<div class="card">
<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;">
<input type="hidden" name="table" value="requisition">
@ -116,12 +125,10 @@
<div class="error" id="error"></div>
</form>
</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 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">
<input class="form-check-input" type="checkbox" id="showArchiveId"
name="showArchive" value="1" <?php echo $showArchive ? "checked" : " " ?>

View File

@ -373,13 +373,13 @@
<input type="text" id="searchInput" placeholder="Search..."
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;">
<i class="fa fa-table btn-lg mt-2"
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-target="#filterModalId">
@ -387,13 +387,13 @@
<i class="fa fa-download btn-lg mt-2"
title="Excel Download"
style="font-size: x-large; cursor:pointer;"
style="font-size: x-large; cursor:pointer; color: #0b7cba"
id="coatingMachineDetailsExport">
</i>
<i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen"
style="font-size: x-large; cursor:pointer;"
style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()">
</i>
@ -402,7 +402,7 @@
title="Add Entry"
data-target="#coatingMachineDetailModal"
data-toggle="modal"
style="font-size: x-large; cursor:pointer;">
style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)" >
</i>
@ -429,18 +429,28 @@
</div>
<!-- form -->
<form method="post"
<form
id="additionalEntriesForm"
method="post"
enctype="multipart/form-data"
action="<?php echo base_url(); ?>addNewCoatingMachineDetails?month=<?= $month; ?>">
<div class="modal-body">
<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 -->
<div class="form-group col-md-3">
<label for="dateId">Date</label>
<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>
<!-- shift -->
@ -626,7 +636,7 @@
</div>
<div class="modal-footer">
<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>
</form>
</div>
@ -650,7 +660,7 @@
</div>
<!-- form -->
<form method="post" id="editCoatingMachineDetailModalFormId"
<form method="post" id="editEntriesForm"
enctype="multipart/form-data"
action="<?php echo base_url(); ?>updateCoatingMachineDetails?month=<?= $month; ?>">
<div class="modal-body">
@ -661,7 +671,7 @@
<div class="form-group col-md-3">
<label for="editDateId">Date</label>
<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">
</div>
@ -847,7 +857,7 @@
</div>
<div class="modal-footer">
<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>
</form>
</div>
@ -944,8 +954,8 @@
<th class="celda_encabezado_general">Total Coating</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">Hour Gas</th>
<th class="celda_encabezado_general">Hour QTY(kg)</th>
<th class="celda_encabezado_general">Per Hour Gas</th>
<th class="celda_encabezado_general">Per Hour QTY(kg)</th>
<th class="celda_encabezado_general">Action</th>
</tr>
</thead>
@ -984,7 +994,8 @@
<!-- td:eq(4) -->
<td class="celda_normal"><?php echo $record['machineRunningInHrs'] ?? ' ' ?></td>
<!-- 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 class="celda_normal"><?php echo $record['grade'] ?? ' ' ?></td>
<!-- td:eq(7) -->
@ -994,9 +1005,9 @@
<!-- td:eq(9) -->
<td class="celda_normal"><?php echo $record['totalGasConsumption'] ?></td>
<!-- 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 class="celda_normal"><?php echo $record['perHourCoatingSandQTY'] ?? '' ?></td>
<td class="celda_normal"><?php echo round($record['perHourCoatingSandQTY']) ?? '' ?></td>
<!-- td:eq(12) -->
<!-- edit and download option..!! -->
<td class="celda_normal">
@ -1069,8 +1080,8 @@
<td class="celda_normal "><?= $summary['totalCoating'] ?></td>
<td class="celda_normal "><?= $summary['totalCoatingSandInKg'] ?></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 "><?= number_format($summary['totalCoatingSandInKg'] / $summary['totalMachineRunningHrs'], 2) ?> (avg)</td>
<td class="celda_normal "><?= round($summary['totalGasConsumption'] / $summary['totalMachineRunningHrs']) ?> (A)</td>
<td class="celda_normal "><?= round($summary['totalCoatingSandInKg'] / $summary['totalMachineRunningHrs']) ?> (A)</td>
</tr>
</tfoot>
@ -1085,14 +1096,22 @@
</tbody>
</table>
</div>
</div>
<br>
<?php if (empty($coatingMachineDetails)) { ?>
<h5 align="center" style="color:grey;">
No Coating Machine Details present in this month
</h5>
<?php }else{?>
<br>
<p align="center">Note :- (A) -> Average</p>
<?php } ?>
@ -1838,8 +1857,10 @@
div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen
if (tableResponsive) {
tableResponsive.style.height = "auto";
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) {
tableResponsive.style.maxHeight = "450px";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
}
}).catch(err => console.log("Error exiting fullscreen:", err));
}
@ -1912,3 +1933,26 @@
</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;
/* Green background */
color: #ffffff;
border: 1px solid #ddd;
border: 2px solid ;
padding: 10px;
white-space: normal;
/* Allows text to wrap */
@ -349,7 +349,7 @@ foreach ($period as $day) {
<input type="text" id="searchInput" placeholder="Search..."
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;">
@ -358,7 +358,7 @@ foreach ($period as $day) {
if ($month == date('M-Y')) {
?>
<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"
data-target="#customizeModalId"
data-toggle="modal">
@ -373,25 +373,25 @@ foreach ($period as $day) {
title="Navigation"
data-toggle="modal"
data-target="#bs-example-modal-lg"
style="font-size: x-large; cursor:pointer;">
style="font-size: x-large; cursor:pointer; color: #bd0906">
</i>
<i class="fa fa-download btn-lg mt-2"
title="Excel Download"
style="font-size: x-large; cursor:pointer;"
style="font-size: x-large; cursor:pointer; color: #0b7cba"
id="bagStockExport">
</i>
<i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen"
style="font-size: x-large; cursor:pointer;"
style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()">
</i>
<i class="fas fa-save btn-lg mt-2"
title="Save"
style="font-size: x-large; cursor:pointer;"
style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)"
id="saveId">
</i>
@ -1364,13 +1364,15 @@ foreach ($period as $day) {
}).catch(err => console.log("Error enabling fullscreen:", err));
} else {
document.exitFullscreen().then(() => {
div.style.width = "100%";
div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen
if (tableResponsive) {
tableResponsive.style.height = "auto";
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) {
tableResponsive.style.maxHeight = "450px";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
}
}).catch(err => console.log("Error exiting fullscreen:", err));
}

View File

@ -213,7 +213,7 @@
background-color: #50bbd9;
/* Green background */
color: #ffffff;
border: 1px solid #ddd;
border: 2px solid ;
padding: 10px;
}
@ -337,8 +337,8 @@ foreach ($period as $day) {
<input type="text" id="searchInput" placeholder="Search..."
class="mt-2"
style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc;
border-radius: 5px;margin-right:15px;">
style=" padding: 8px;margin-bottom: 10px;width: 250px;border: 2px solid rgb(123, 11, 214);
border-radius: 5px;margin-right:15px;">
<?php
@ -346,7 +346,7 @@ foreach ($period as $day) {
if ($month == date('M-Y')) {
?>
<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"
data-target="#customizeModalId"
data-toggle="modal">
@ -361,25 +361,26 @@ foreach ($period as $day) {
title="Navigation"
data-toggle="modal"
data-target="#bs-example-modal-lg"
style="font-size: x-large; cursor:pointer;">
style="font-size: x-large; cursor:pointer; color: #bd0906">
</i>
<i class="fa fa-download btn-lg mt-2"
title="Excel Download"
style="font-size: x-large; cursor:pointer;"
id="dieselMachineStockDetailsExport ">
style="font-size: x-large; cursor:pointer; color: #0b7cba"
id="bagStockExport">
</i>
<i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen"
style="font-size: x-large; cursor:pointer;"
style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()">
</i>
<i class="fas fa-save btn-lg mt-2"
title="Save"
style="font-size: x-large; cursor:pointer;"
style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)"
id="saveId">
</i>
@ -574,11 +575,11 @@ foreach ($period as $day) {
<tbody style="background-color: #fff;">
<?php if (!empty($totalDiesel)) {
<?php if (!empty($totalDiesel) && !empty($groupedDieselMachineStockDetails)) {
$summary = [];
foreach ($groupedDieselMachineStockDetails as $groupedDieselMachineStockDetailsIndex => $dieselStockDetails) {
foreach ($groupedDieselMachineStockDetails as $rowIndex => $dieselStockDetails) {
?>
<tr
@ -594,7 +595,7 @@ foreach ($period as $day) {
<?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">
@ -603,37 +604,37 @@ foreach ($period as $day) {
<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)"
contenteditable="true"
<?php endif; ?>><?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['opening_stock'] ?? ' ' ?></td>
<?php endif; ?>><?= $totalDiesel[$rowIndex]['opening_stock'] ?? ' ' ?></td>
<td class="celda_normal purchaseTD"
data-id="<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['date'] ?>"
data-id="<?= $totalDiesel[$rowIndex]['date'] ?>"
oninput="purchaseTDStockChange(this)"
contenteditable="true">
<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['purchase_diesel'] ?? ' ' ?>
<?= $totalDiesel[$rowIndex]['purchase_diesel'] ?? ' ' ?>
</td>
<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 class="celda_normal balanceTD"
data-id="<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['date'] ?>">
data-id="<?= $totalDiesel[$rowIndex]['date'] ?>">
<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock'] ?? ' ' ?>
<?= $totalDiesel[$rowIndex]['balance_stock'] ?? ' ' ?>
</td>
@ -643,15 +644,15 @@ foreach ($period as $day) {
//before closing outer loop
if (!isset($summary['totalPurchaseDiesel'])) {
$summary['opening_diesel'] = '-';
$summary['openingStock'] = '-';
$summary['totalPurchaseDiesel'] = 0;
$summary['totalFillingDiesel'] = 0;
$summary['balanceStock'] = 0;
}
$summary['totalPurchaseDiesel'] += is_numeric($totalDiesel[$groupedDieselMachineStockDetailsIndex]['purchase_diesel']) ? $totalDiesel[$groupedDieselMachineStockDetailsIndex]['purchase_diesel'] : 0;
$summary['totalFillingDiesel'] += is_numeric($totalDiesel[$groupedDieselMachineStockDetailsIndex]['total_filling_diesel']) ? $totalDiesel[$groupedDieselMachineStockDetailsIndex]['total_filling_diesel'] : 0;
$summary['balanceStock'] = is_numeric($totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock']) ? $totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock'] : 0;
$summary['openingStock'] = is_numeric($totalDiesel[$rowIndex]['opening_stock']) ? $totalDiesel[$rowIndex]['opening_stock'] : 0;
$summary['totalPurchaseDiesel'] += is_numeric($totalDiesel[$rowIndex]['purchase_diesel']) ? $totalDiesel[$rowIndex]['purchase_diesel'] : 0;
$summary['totalFillingDiesel'] += is_numeric($totalDiesel[$rowIndex]['total_filling_diesel']) ? $totalDiesel[$rowIndex]['total_filling_diesel'] : 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"
data-id="<?= $dieselStock['date'] ?> <?= $dieselStock['machine_id'] ?>"
<?php if ($groupedDieselMachineStockDetailsIndex == 0): ?>
<?php if ($rowIndex == 0): ?>
oninput="openingReadingChange(this)"
contenteditable="true"
<?php endif; ?>>
@ -781,7 +782,7 @@ foreach ($period as $day) {
</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['totalFillingDiesel'] ?></td>
<td class="celda_normal "><?= $summary['balanceStock'] ?></td>
@ -836,41 +837,115 @@ foreach ($period as $day) {
</td>
<td class="celda_normal openingTD"
data-id="<?= $dateInMonth ?>"
<?php if ($datesInMonthIndex == 0) { ?>
oninput="openingTDStockChange(this)"
contenteditable="true"
<?php } ?>><?= !empty($previousMonthTotalDieselMachineStockDetails)
? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock']
: " ";
?></td>
<td class="celda_normal purchaseTD"
data-id="<?= $dateInMonth ?>"
oninput="purchaseTDStockChange(this)"
contenteditable="true"> </td>
<td class="celda_normal fillingTD"
data-id="<?= $dateInMonth ?>"> </td>
<td class="celda_normal balanceTD"
data-id="<?= $dateInMonth ?>"><?= !empty($previousMonthTotalDieselMachineStockDetails)
? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock']
: " ";
?>
</td>
<?php
// dd($previousMonthDieselMachineStockDetails);
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"
data-id="<?= $dateInMonth ?>"
<?php if ($datesInMonthIndex == 0) { ?>
oninput="openingTDStockChange(this)"
contenteditable="true"
<?php } ?>>
<?= !empty($previousMonthTotalDieselMachineStockDetails)
? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock']
: " ";
?>
</td>
<td class="celda_normal purchaseTD"
data-id="<?= $dateInMonth ?>"
oninput="purchaseTDStockChange(this)"
contenteditable="true">
</td>
<td class="celda_normal fillingTD"
data-id="<?= $dateInMonth ?>">
</td>
<td class="celda_normal balanceTD"
data-id="<?= $dateInMonth ?>">
<?= !empty($previousMonthTotalDieselMachineStockDetails)
? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock']
: " ";
?>
</td>
<!-- total diesel absent summary section of view ends -->
<?php } ?>
<!-- total diesel stock section of view ends -->
<?php
foreach ($dieselMachines as $dieselMachineIndex => $dieselMachine) {
?>
<!-- this will loop till machines present -->
@ -1566,8 +1641,7 @@ foreach ($period as $day) {
const box = child.getBoundingClientRect();
const offset = y - box.top - box.height / 2;
return offset < 0 && offset > closest.offset ?
{
return offset < 0 && offset > closest.offset ? {
offset,
element: child
} :
@ -1660,8 +1734,10 @@ foreach ($period as $day) {
div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen
if (tableResponsive) {
tableResponsive.style.height = "auto";
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) {
tableResponsive.style.maxHeight = "450px";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
}
}).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..."
class="mt-2"
style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc;
border-radius: 5px;margin-right:15px;">
style="padding: 8px;margin-bottom: 10px;width: 250px;border: 2px solid rgb(123, 11, 214);
border-radius: 5px;margin-right:15px; ">
<i class="fa fa-table btn-lg mt-2"
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-target="#filterModalId">
@ -353,13 +353,13 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<i class="fa fa-download btn-lg mt-2"
title="Excel Download"
style="font-size: x-large; cursor:pointer;"
style="font-size: x-large; cursor:pointer; color: #0b7cba"
id="drierMachineDetailsExport">
</i>
<i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen"
style="font-size: x-large; cursor:pointer;"
style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()">
</i>
@ -368,7 +368,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
title="Add Entry"
data-target="#additionalEntriesModalId"
data-toggle="modal"
style="font-size: x-large; cursor:pointer;">
style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)">
</i>
@ -462,14 +462,16 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
</div>
<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 -->
<?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 $calendarCurrentDate = DateTime::createFromFormat('M-Y', $datefordropdown)->format('Y-m-d'); ?>
<div class="row">
<div class="col-md-3">
<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>
</div>
<div class="col-md-3">
@ -596,7 +598,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
</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 -->
@ -618,7 +620,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
</div>
<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 -->
<?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'); ?>
@ -626,7 +628,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<div class="col-md-3">
<label class="form" for="editEntryDateId">Date</label>
<input type="date" class="form-control" id="editEntryDateId" name="date" value=""
required>
required readonly>
</div>
<div class="col-md-3">
<label class="form" for="editEntryDrierOnTimeId">Drier On Time</label>
@ -673,7 +675,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<option value="<?= $value->SupplierID; ?>"> <?= $value->SupplierName; ?> </option>
<?php } ?>
</select>
</div>
</div>
<!-- input sand qty -->
<div class="col-md-3">
@ -752,7 +754,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
</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 -->
@ -867,22 +869,22 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- td:eq(7) sand_dried_qty -->
<td class="celda_normal">
<?php echo (int)$a['sand_dried_qty']; ?>
<?php echo round($a['sand_dried_qty']); ?>
</td>
<!-- td:eq(8) total_gas_consumption -->
<td class="celda_normal">
<?php echo $a['total_gas_consumption']; ?>
<?php echo round($a['total_gas_consumption']); ?>
</td>
<!-- td:eq(9) gas_per_ton -->
<td class="celda_normal">
<?php echo $a['gas_per_ton']; ?>
<?php echo round($a['gas_per_ton']); ?>
</td>
<!-- td:eq(10) qty_per_hours -->
<td class="celda_normal">
<?php echo (int)$a['qty_per_hours']; ?>
<?php echo round($a['qty_per_hours']); ?>
</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['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['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'];
} ?>
@ -962,8 +967,8 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<td class="celda_normal ">-</td>
<td class="celda_normal "><?= $summary['sand_dried_qty'] ?></td>
<td class="celda_normal "><?= $summary['total_gas_consumption'] ?></td>
<td class="celda_normal "></td>
<td class="celda_normal "></td>
<td class="celda_normal "><?= $summary['gas_per_ton']?>(A)</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['dust_qty'] ?></td>
</tr>
@ -979,7 +984,12 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
</p>
</div>
<?php } ?>
<?php }else{?>
<br>
<p align="center">Note :- (A) -> Average</p>
<?php } ?>
@ -1471,8 +1481,10 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen
if (tableResponsive) {
tableResponsive.style.height = "auto";
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) {
tableResponsive.style.maxHeight = "450px";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
}
}).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>

View File

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

View File

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

View File

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

View File

@ -213,7 +213,7 @@
background-color: #50bbd9;
/* Green background */
color: #ffffff;
border: 1px solid #ddd;
border: 2px solid;
padding: 10px;
}
@ -261,6 +261,11 @@
.card {
margin-bottom: 5px;
}
#powerStockDetailsTableId {
/* Replace with your table's actual ID or selector */
border-collapse: collapse;
}
</style>
@ -339,8 +344,8 @@ foreach ($period as $day) {
<input type="text" id="searchInput" placeholder="Search..."
class="mt-2"
style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc;
border-radius: 5px;margin-right:15px;">
style=" padding: 8px;margin-bottom: 10px;width: 250px;border: 2px solid rgb(123, 11, 214);
border-radius: 5px;margin-right:15px;">
<?php
@ -348,7 +353,7 @@ foreach ($period as $day) {
if ($month == date('M-Y')) {
?>
<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"
data-target="#customizeModalId"
data-toggle="modal">
@ -363,25 +368,25 @@ foreach ($period as $day) {
title="Navigation"
data-toggle="modal"
data-target="#bs-example-modal-lg"
style="font-size: x-large; cursor:pointer;">
style="font-size: x-large; cursor:pointer; color: #bd0906">
</i>
<i class="fa fa-download btn-lg mt-2"
title="Excel Download"
style="font-size: x-large; cursor:pointer;"
id="powerConsumptionExport ">
style="font-size: x-large; cursor:pointer; color: #0b7cba"
id="bagStockExport">
</i>
<i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen"
style="font-size: x-large; cursor:pointer;"
style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()">
</i>
<i class="fas fa-save btn-lg mt-2"
title="Save"
style="font-size: x-large; cursor:pointer;"
style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)"
id="saveId">
</i>
@ -400,7 +405,7 @@ foreach ($period as $day) {
2)choose which material/machines you want
------------------------------------------------------------>
<div>
<div class="modal fade" id="customizeModalId" tabindex="-1" role="dialog" aria-labelledby="customizeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
@ -595,7 +600,7 @@ foreach ($period as $day) {
$currentDate = date('d-m-Y');
$dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $powerStockDetails[0]['date'])->format('d-m-Y');
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');
$dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $dateInMonth)->format('d-m-Y');
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%";
// Reset .table-responsive height when exiting fullscreen
// If .table-responsive exists, set its height to 90vh
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));
}
@ -1641,54 +1648,48 @@ foreach ($period as $day) {
<script>
$(document).ready(function() {
$('.select2').select2({
dropdownParent: $('#fullscreenDiv')
});
// Initialize Select2 when the modal is shown inside full screen
$('#bs-example-modal-lg').on('shown.bs.modal', function () {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
$('#customizeModalId').on('shown.bs.modal', function () {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
$(document).ready(function() {
$('.select2').select2({
dropdownParent: $('#fullscreenDiv')
});
// Initialize Select2 when the modal is shown inside full screen
$('#bs-example-modal-lg').on('shown.bs.modal', function() {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
$('#customizeModalId').on('shown.bs.modal', function() {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
});
</script>
<script>
//getting modal backdrop inside full screen
$(document).ready(function() {
function moveModalBackdropToFullscreen() {
setTimeout(() => {
$('.modal-backdrop').appendTo('#fullscreenDiv'); // Move backdrop inside fullscreen
}, 10); // Small delay ensures backdrop is created first
}
function moveModalBackdropToFullscreen() {
setTimeout(() => {
$('.modal-backdrop').appendTo('#fullscreenDiv'); // Move backdrop inside fullscreen
}, 10); // Small delay ensures backdrop is created first
}
// Move the modal backdrop when a modal opens
$('#bs-example-modal-lg, #customizeModalId').on('show.bs.modal', function () {
moveModalBackdropToFullscreen();
});
// Ensure modals work properly in fullscreen mode
document.addEventListener("fullscreenchange", function() {
setTimeout(() => {
$('.modal-backdrop').remove(); // Remove any existing backdrops
// Move the modal backdrop when a modal opens
$('#bs-example-modal-lg, #customizeModalId').on('show.bs.modal', function() {
moveModalBackdropToFullscreen();
}, 200);
});
// Ensure modals work properly in fullscreen mode
document.addEventListener("fullscreenchange", function() {
setTimeout(() => {
$('.modal-backdrop').remove(); // Remove any existing backdrops
moveModalBackdropToFullscreen();
}, 200);
});
});
});
</script>
</script>

View File

@ -18,23 +18,27 @@
}
.fht-table td:hover {
background-color: rgb(170, 222, 167);
color:rgb(2, 2, 2);
transform: scale(1.25); /* Increases size by 25% */
transition: transform 0.5s ease-in-out; /* Smooth scaling effect */
background-color: rgb(170, 222, 167);
color: rgb(2, 2, 2);
transform: scale(1.25);
/* Increases size by 25% */
transition: transform 0.5s ease-in-out;
/* Smooth scaling effect */
}
.fht-table tr:hover {
background-color: rgb(170, 222, 167);
color:rgb(2, 2, 2);
background-color: rgb(170, 222, 167);
color: rgb(2, 2, 2);
}
.grab {
cursor: grab; /* Default open-hand cursor */
cursor: grab;
/* Default open-hand cursor */
}
.grab:active {
cursor: grabbing; /* Closed-hand cursor when dragging */
cursor: grabbing;
/* Closed-hand cursor when dragging */
}
/*
@ -213,7 +217,7 @@
background-color: #50bbd9;
/* Green background */
color: #ffffff;
border: 1px solid #ddd;
border: 2px solid;
padding: 10px;
}
@ -245,21 +249,22 @@
}
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%;
}
.card-body{
padding-top : 0;
padding-bottom : 0;
.card-body {
padding-top: 0;
padding-bottom: 0;
}
.card{ margin-bottom: 5px;}
.card {
margin-bottom: 5px;
}
</style>
@ -321,160 +326,160 @@ foreach ($period as $day) {
<div class="card-body">
<form id="changeMonthForm" action="<?= base_url('resinStockDetails'); ?>" method="post">
<form id="changeMonthForm" action="<?= base_url('resinStockDetails'); ?>" method="post">
<div class="row">
<div class="row">
<div class="col-2">
<input type="text" name="month" id="month" value="<?php echo "$month" ?>"
class="form-control mt-2"
style="z-index:30;" readonly>
</div>
<div class="col-2">
<input type="text" name="month" id="month" value="<?php echo "$month" ?>"
class="form-control mt-2"
style="z-index:30;" readonly>
</div>
<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..."
class="mt-2"
style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc;
border-radius: 5px;margin-right:15px;">
<input type="text" id="searchInput" placeholder="Search..."
class="mt-2"
style=" padding: 8px;margin-bottom: 10px;width: 250px;border: 2px solid rgb(123, 11, 214);
border-radius: 5px;margin-right:15px;">
<?php
if($month == date('M-Y') ){
?>
<i class="fa fa-cog btn-lg mt-2"
style="font-size: x-large; cursor:pointer;"
title = "Customize"
data-target="#customizeModalId"
data-toggle="modal">
</i>
<?php
}
?>
<i class="fa fa-rocket btn-lg mt-2"
title="Navigation"
data-toggle="modal"
data-target="#bs-example-modal-lg"
style="font-size: x-large; cursor:pointer;">
</i>
<?php
<i class="fa fa-download btn-lg mt-2"
title="Excel Download"
style="font-size: x-large; cursor:pointer;"
id="resinStockExport">
</i>
if ($month == date('M-Y')) {
?>
<i class="fa fa-cog btn-lg mt-2"
style="font-size: x-large; cursor:pointer; color:rgb(95, 102, 105)"
title="Customize"
data-target="#customizeModalId"
data-toggle="modal">
<i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen"
style="font-size: x-large; cursor:pointer;"
onclick="toggleDivFullscreen()" >
</i>
</i>
<i class="fas fa-save btn-lg mt-2"
title="Save"
style="font-size: x-large; cursor:pointer;"
id="saveId" >
</i>
</div>
<?php
}
?>
<i class="fa fa-rocket btn-lg mt-2"
title="Navigation"
data-toggle="modal"
data-target="#bs-example-modal-lg"
style="font-size: x-large; cursor:pointer; color: #bd0906">
</i>
<i class="fa fa-download btn-lg mt-2"
title="Excel Download"
style="font-size: x-large; cursor:pointer; color: #0b7cba"
id="bagStockExport">
</i>
<i class="fe-maximize noti-icon btn-lg mt-2"
title="Full Screen"
style="font-size: x-large; cursor:pointer; color:rgb(230, 184, 35)"
onclick="toggleDivFullscreen()">
</i>
<i class="fas fa-save btn-lg mt-2"
title="Save"
style="font-size: x-large; cursor:pointer; color:rgb(31, 132, 3)"
id="saveId">
</i>
</div>
</form>
</div>
</form>
<form action="<?= base_url('resinStockDetails'); ?>" method="post">
<!-- modal placed here for submission of form -->
<!---------------------------------------
<!-- modal placed here for submission of form -->
<!---------------------------------------
this modal is used to customize table header
1)list table header order
2)choose which material/machines you want
------------------------------------------------------------>
<div>
<div class="modal fade" id="customizeModalId" tabindex="-1" role="dialog" aria-labelledby="customizeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="customizeModalLabel">Customize</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<!-- Dropdown to add back removed items -->
<div class="col">
<div class="form-group">
<label for="customizeHeader"> Add For This Month </label>
<select id="customizeHeader" class="form-control select2" onchange="addBackToList()">
<option value="">Select</option>
<?php
foreach($activeResinMaterials as $index => $activeResinMaterial){ ?>
<div>
<div class="modal fade" id="customizeModalId" tabindex="-1" role="dialog" aria-labelledby="customizeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="customizeModalLabel">Customize</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<!-- Dropdown to add back removed items -->
<div class="col">
<div class="form-group">
<label for="customizeHeader"> Add For This Month </label>
<select id="customizeHeader" class="form-control select2" onchange="addBackToList()">
<option value="">Select</option>
<?php
foreach ($activeResinMaterials as $index => $activeResinMaterial) { ?>
<option value="<?=$activeResinMaterial['MaterialCode']?>">
<?=$activeResinMaterial['MaterialCode']?> - <?=$activeResinMaterial['MaterialName']?>
</option>
<option value="<?= $activeResinMaterial['MaterialCode'] ?>">
<?= $activeResinMaterial['MaterialCode'] ?> - <?= $activeResinMaterial['MaterialName'] ?>
</option>
<?php
}
?>
<?php
}
?>
</select>
</div>
</select>
</div>
</div>
<div class="row">
<div class="col">
<h5>List of Selected Items</h5>
<div id="selectedItemsContainer">
<ul id="sortableList">
<?php foreach ($resinMaterials as $resinMaterial): ?>
<div class="sortable-item" draggable="true" id="<?= $resinMaterial['MaterialCode'] ?>_container">
<input type = "checkbox"
id = "<?= $resinMaterial['MaterialCode'] ?>_checkboxId"
name = "customisedMaterialCodes[]"
value = "<?= $resinMaterial['MaterialCode'] ?>"
onclick = "removeSelectedMaterial(this)"
checked>
<label class="grab" for="<?= $resinMaterial['MaterialCode'] ?>_checkboxId">
<?= $resinMaterial['MaterialCode'] ?> - <?= $resinMaterial['MaterialName']; ?>
</label>
<br>
</div>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary float-right"> Apply </button>
</div>
<div class="row">
<div class="col">
<h5>List of Selected Items</h5>
<div id="selectedItemsContainer">
<ul id="sortableList">
<?php foreach ($resinMaterials as $resinMaterial): ?>
<div class="sortable-item" draggable="true" id="<?= $resinMaterial['MaterialCode'] ?>_container">
<input type="checkbox"
id="<?= $resinMaterial['MaterialCode'] ?>_checkboxId"
name="customisedMaterialCodes[]"
value="<?= $resinMaterial['MaterialCode'] ?>"
onclick="removeSelectedMaterial(this)"
checked>
<label class="grab" for="<?= $resinMaterial['MaterialCode'] ?>_checkboxId">
<?= $resinMaterial['MaterialCode'] ?> - <?= $resinMaterial['MaterialName']; ?>
</label>
<br>
</div>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary float-right"> Apply </button>
</div>
</div>
</div>
</div>
</div>
<!-- hidden fields -->
<input type="hidden" name="month" value="<?php echo "$month" ?>"
class="form-control mt-2" data-provide="datepicker"
data-date-format="M-yyyy" data-date-min-view-mode="1">
<!-- hidden fields -->
<input type="hidden" name="month" value="<?php echo "$month" ?>"
class="form-control mt-2" data-provide="datepicker"
data-date-format="M-yyyy" data-date-min-view-mode="1">
</form>
@ -524,7 +529,7 @@ foreach ($period as $day) {
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
</div>
@ -583,7 +588,7 @@ foreach ($period as $day) {
$currentDate = date('d-m-Y');
$dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $resinStockDetails[0]['date'])->format('d-m-Y');
if ($dateInMonthDmYFormat === $currentDate) {
echo 'style="background: rgb(232, 245, 231);"';
echo 'style="background: #cef0ad;"';
}
?>>
<?php foreach ($resinStockDetails as $resinStockIndex => $resinStock) {
@ -671,126 +676,122 @@ foreach ($period as $day) {
<?php } ?>
<tfoot>
<tr>
<tfoot>
<tr>
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
<b> Total </b>
</td>
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
<b> Total </b>
</td>
<?php foreach ($summary as $each) { ?>
<?php foreach ($summary as $each) { ?>
<td class="celda_normal "><?= $each['opening'] ?></td>
<td class="celda_normal "><?= $each['receipt'] ?></td>
<td class="celda_normal "><?= $each['used'] ?></td>
<td class="celda_normal "><?= $each['balanceStock'] ?></td>
<td class="celda_normal "><?= $each['opening'] ?></td>
<td class="celda_normal "><?= $each['receipt'] ?></td>
<td class="celda_normal "><?= $each['used'] ?></td>
<td class="celda_normal "><?= $each['balanceStock'] ?></td>
<?php } ?>
</tr>
</tfoot>
<!-- this else condition work if groupedBagStockDetails is empty and creating new records
with initial values 0 for entire month -->
<?php } else { ?>
<?php foreach ($datesInMonth as $datesInMonthIndex => $dateInMonth) { ?>
<tr
<?php
$currentDate = date('d-m-Y');
$dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $dateInMonth)->format('d-m-Y');
if ($dateInMonthDmYFormat === $currentDate) {
echo 'style="background: rgb(232, 245, 231);"';
}
?>>
<?php
// dd($resinMaterials);
foreach ($resinMaterials as $resinMaterialIndex => $resinMaterial) { ?>
<!-- this will loop till materials present -->
<?php if ($resinMaterialIndex == 0): ?>
<?php
$startDate = DateTime::createFromFormat('Y-m-d', $dateInMonth)->format('d-m-Y');
?>
<td class="celda_normal">
<?= $startDate ?>
</td>
<?php endif; ?>
<td class="celda_normal" style="display:none">
<?= $dateInMonth ?>
</td>
<td class="celda_normal" style="display:none"
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>">
<?= $resinMaterial['MaterialCode'] ?>
</td>
<td class="celda_normal customer" style="display:none"
data-materialCode="<?= $resinMaterial['MaterialCode'] ?>"
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>">
<?= $resinMaterial['customers'] ?>
</td>
<td class="celda_normal openingStock"
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>"
<?php if ($datesInMonthIndex == 0) { ?>
oninput="openingStockChange(this)"
contenteditable="true"
<?php } ?>>
<?php
foreach($previousMonthResinStockDetails as $index => $previousMonthResinStockDetail)
{
if($previousMonthResinStockDetail['materialCode'] == $resinMaterial['MaterialCode']){
echo $previousMonthResinStockDetail['balanceStock'] ;
break;
}
}
?>
</td>
<td class="celda_normal receiptStock"
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>"
oninput="receiptStockChange(this)"
contenteditable="true"> <?= ' ' ?> </td>
<td class="celda_normal usedStock"
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>"
oninput="usedStockChange(this)"
contenteditable="true"> <?= ' ' ?> </td>
<td class="celda_normal balanceStock"
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>">
<?php
foreach($previousMonthResinStockDetails as $index => $previousMonthResinStockDetail)
{
if($previousMonthResinStockDetail['materialCode'] == $resinMaterial['MaterialCode']){
echo $previousMonthResinStockDetail['balanceStock'] ;
break;
}
}
?>
</td>
<?php } ?>
</tr>
<?php } ?>
<?php } ?>
</tr>
</tfoot>
</tbody>
<!-- this else condition work if groupedBagStockDetails is empty and creating new records
with initial values 0 for entire month -->
<?php } else { ?>
<?php foreach ($datesInMonth as $datesInMonthIndex => $dateInMonth) { ?>
<tr
<?php
$currentDate = date('d-m-Y');
$dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $dateInMonth)->format('d-m-Y');
if ($dateInMonthDmYFormat === $currentDate) {
echo 'style="background: #cef0ad ;"';
}
?>>
<?php
// dd($resinMaterials);
foreach ($resinMaterials as $resinMaterialIndex => $resinMaterial) { ?>
<!-- this will loop till materials present -->
<?php if ($resinMaterialIndex == 0): ?>
<?php
$startDate = DateTime::createFromFormat('Y-m-d', $dateInMonth)->format('d-m-Y');
?>
<td class="celda_normal">
<?= $startDate ?>
</td>
<?php endif; ?>
<td class="celda_normal" style="display:none">
<?= $dateInMonth ?>
</td>
<td class="celda_normal" style="display:none"
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>">
<?= $resinMaterial['MaterialCode'] ?>
</td>
<td class="celda_normal customer" style="display:none"
data-materialCode="<?= $resinMaterial['MaterialCode'] ?>"
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>">
<?= $resinMaterial['customers'] ?>
</td>
<td class="celda_normal openingStock"
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>"
<?php if ($datesInMonthIndex == 0) { ?>
oninput="openingStockChange(this)"
contenteditable="true"
<?php } ?>>
<?php
foreach ($previousMonthResinStockDetails as $index => $previousMonthResinStockDetail) {
if ($previousMonthResinStockDetail['materialCode'] == $resinMaterial['MaterialCode']) {
echo $previousMonthResinStockDetail['balanceStock'];
break;
}
}
?>
</td>
<td class="celda_normal receiptStock"
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>"
oninput="receiptStockChange(this)"
contenteditable="true"> <?= ' ' ?> </td>
<td class="celda_normal usedStock"
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>"
oninput="usedStockChange(this)"
contenteditable="true"> <?= ' ' ?> </td>
<td class="celda_normal balanceStock"
data-id="<?= $dateInMonth ?> <?= $resinMaterial['MaterialCode'] ?>">
<?php
foreach ($previousMonthResinStockDetails as $index => $previousMonthResinStockDetail) {
if ($previousMonthResinStockDetail['materialCode'] == $resinMaterial['MaterialCode']) {
echo $previousMonthResinStockDetail['balanceStock'];
break;
}
}
?>
</td>
<?php } ?>
</tr>
<?php } ?>
<?php } ?>
</tbody>
</table>
</div>
@ -812,7 +813,7 @@ foreach ($period as $day) {
<script>
$(document).ready(function(){
$(document).ready(function() {
$('.select2').select2();
})
</script>
@ -867,9 +868,9 @@ foreach ($period as $day) {
targetColumnIndex = targetColumnIndex * 7;
targetRow.cells[targetColumnIndex].scrollIntoView({
behavior: 'smooth',
inline: 'center',
block: 'center'
behavior: 'smooth',
inline: 'center',
block: 'center'
});
const highlightDuration = 10000;
@ -1099,24 +1100,24 @@ foreach ($period as $day) {
$(document).ready(function() {
function exportTableToExcel(tableID, filename = '') {
let table = document.getElementById(tableID);
let table = document.getElementById(tableID);
let cloneTable = table.cloneNode(true); // Clone the table to modify
// Remove hidden rows
$(cloneTable).find('tr').filter(function () {
$(cloneTable).find('tr').filter(function() {
return $(this).css('display') === 'none';
}).remove();
// Remove hidden columns
$(cloneTable).find('th, td').each(function () {
$(cloneTable).find('th, td').each(function() {
if ($(this).css('display') === 'none') {
$(this).remove();
}
});
$(cloneTable).find('tbody tr').each(function() {
let firstTd = $(this).find('td').eq(0); // Get the first column (Date)
// Convert Date Format (Assuming it's in YYYY-MM-DD format)
let originalDate = firstTd.text().trim(); // Get the text value
let parts = originalDate.split('-'); // Split into [YYYY, MM, DD]
@ -1189,72 +1190,77 @@ foreach ($period as $day) {
</script>
<script>
document.addEventListener("DOMContentLoaded", function () {
const list = document.getElementById("sortableList");
document.addEventListener("DOMContentLoaded", function() {
const list = document.getElementById("sortableList");
let draggedItem = null;
let draggedItem = null;
function attachDragEvents(item) {
item.setAttribute("draggable", "true");
function attachDragEvents(item) {
item.setAttribute("draggable", "true");
item.addEventListener("dragstart", (event) => {
draggedItem = event.target;
event.target.classList.add("dragging");
});
item.addEventListener("dragstart", (event) => {
draggedItem = event.target;
event.target.classList.add("dragging");
});
item.addEventListener("dragend", (event) => {
event.target.classList.remove("dragging");
});
}
list.addEventListener("dragover", (event) => {
event.preventDefault(); // Allow dropping
const dragging = document.querySelector(".dragging");
const closestItem = getClosestItem(list, event.clientY);
if (closestItem) {
list.insertBefore(dragging, closestItem);
} else {
list.appendChild(dragging);
item.addEventListener("dragend", (event) => {
event.target.classList.remove("dragging");
});
}
});
function getClosestItem(container, y) {
const items = [...container.querySelectorAll(".sortable-item:not(.dragging)")];
list.addEventListener("dragover", (event) => {
event.preventDefault(); // Allow dropping
const dragging = document.querySelector(".dragging");
const closestItem = getClosestItem(list, event.clientY);
return items.reduce((closest, child) => {
const box = child.getBoundingClientRect();
const offset = y - box.top - box.height / 2;
if (closestItem) {
list.insertBefore(dragging, closestItem);
} else {
list.appendChild(dragging);
}
});
return offset < 0 && offset > closest.offset
? { offset, element: child }
: closest;
}, { offset: Number.NEGATIVE_INFINITY }).element;
}
function getClosestItem(container, y) {
const items = [...container.querySelectorAll(".sortable-item:not(.dragging)")];
// Attach drag events to existing items
document.querySelectorAll(".sortable-item").forEach(attachDragEvents);
return items.reduce((closest, child) => {
const box = child.getBoundingClientRect();
const offset = y - box.top - box.height / 2;
window.removeSelectedMaterial = function (checkbox) {
let container = checkbox.closest(".sortable-item");
let materialCode = checkbox.value;
let materialName = container.querySelector("label").innerText;
return offset < 0 && offset > closest.offset ?
{
offset,
element: child
} :
closest;
}, {
offset: Number.NEGATIVE_INFINITY
}).element;
}
container.remove();
};
// Attach drag events to existing items
document.querySelectorAll(".sortable-item").forEach(attachDragEvents);
window.addBackToList = function () {
let dropdown = document.getElementById("customizeHeader");
let selectedOption = dropdown.options[dropdown.selectedIndex];
window.removeSelectedMaterial = function(checkbox) {
let container = checkbox.closest(".sortable-item");
let materialCode = checkbox.value;
let materialName = container.querySelector("label").innerText;
if (selectedOption.value !== "") {
let materialCode = selectedOption.value;
let materialName = selectedOption.text;
container.remove();
};
let container = document.createElement("div");
container.classList.add("sortable-item");
container.id = materialCode + "_container";
container.innerHTML = `
window.addBackToList = function() {
let dropdown = document.getElementById("customizeHeader");
let selectedOption = dropdown.options[dropdown.selectedIndex];
if (selectedOption.value !== "") {
let materialCode = selectedOption.value;
let materialName = selectedOption.text;
let container = document.createElement("div");
container.classList.add("sortable-item");
container.id = materialCode + "_container";
container.innerHTML = `
<input type="checkbox" id="${materialCode}_checkboxId"
name="customisedMaterialCodes[]" value="${materialCode}"
onclick="removeSelectedMaterial(this)" checked>
@ -1262,26 +1268,24 @@ foreach ($period as $day) {
<br>
`;
attachDragEvents(container);
document.getElementById("sortableList").appendChild(container);
}
};
});
attachDragEvents(container);
document.getElementById("sortableList").appendChild(container);
}
};
});
</script>
<script>
$(document).ready(function(){
$(document).ready(function() {
$('#customizeHeader').select2();
})
</script>
<script>
$('#month').change(function(){
$('#changeMonthForm').submit();
})
$('#month').change(function() {
$('#changeMonthForm').submit();
})
$('#month').datepicker({
format: 'M-yyyy',
@ -1294,97 +1298,90 @@ foreach ($period as $day) {
<script>
function toggleDivFullscreen() {
let div = document.getElementById("fullscreenDiv");
let tableResponsive = document.getElementById("table-responsive"); // Select the table container inside div
let div = document.getElementById("fullscreenDiv");
let tableResponsive = document.getElementById("table-responsive"); // Select the table container inside div
if (!document.fullscreenElement) {
div.requestFullscreen().then(() => {
div.style.width = "100vw"; // Full viewport width
div.style.height = "100vh"; // Full viewport height
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) {
tableResponsive.style.maxHeight = "90vh";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
}
}).catch(err => console.log("Error enabling fullscreen:", err));
} else {
document.exitFullscreen().then(() => {
div.style.width = "100%";
div.style.height = "100%";
if (!document.fullscreenElement) {
div.requestFullscreen().then(() => {
div.style.width = "100vw"; // Full viewport width
div.style.height = "100vh"; // Full viewport height
// Reset .table-responsive height when exiting fullscreen
if (tableResponsive) {
tableResponsive.style.height = "auto";
}
}).catch(err => console.log("Error exiting fullscreen:", err));
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) {
tableResponsive.style.maxHeight = "90vh";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
}
}).catch(err => console.log("Error enabling fullscreen:", err));
} else {
document.exitFullscreen().then(() => {
div.style.width = "100%";
div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) {
tableResponsive.style.maxHeight = "450px";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
}
}).catch(err => console.log("Error exiting fullscreen:", err));
}
}
}
$("#searchInput").on("keyup", function () {
let value = $(this).val().toLowerCase(); // Convert input to lowercase for case-insensitive search
$("#searchInput").on("keyup", function() {
let value = $(this).val().toLowerCase(); // Convert input to lowercase for case-insensitive search
$(".table-responsive tbody tr").filter(function () {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
$(".table-responsive tbody tr").filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
});
});
});
</script>
<script>
$(document).ready(function() {
$('.select2').select2({
dropdownParent: $('#fullscreenDiv')
});
// Initialize Select2 when the modal is shown inside full screen
$('#bs-example-modal-lg').on('shown.bs.modal', function () {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
$('#customizeModalId').on('shown.bs.modal', function () {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
$(document).ready(function() {
$('.select2').select2({
dropdownParent: $('#fullscreenDiv')
});
// Initialize Select2 when the modal is shown inside full screen
$('#bs-example-modal-lg').on('shown.bs.modal', function() {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
$('#customizeModalId').on('shown.bs.modal', function() {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
});
</script>
<script>
//getting modal backdrop inside full screen
$(document).ready(function() {
function moveModalBackdropToFullscreen() {
setTimeout(() => {
$('.modal-backdrop').appendTo('#fullscreenDiv'); // Move backdrop inside fullscreen
}, 10); // Small delay ensures backdrop is created first
}
function moveModalBackdropToFullscreen() {
setTimeout(() => {
$('.modal-backdrop').appendTo('#fullscreenDiv'); // Move backdrop inside fullscreen
}, 10); // Small delay ensures backdrop is created first
}
// Move the modal backdrop when a modal opens
$('#bs-example-modal-lg, #customizeModalId').on('show.bs.modal', function () {
moveModalBackdropToFullscreen();
});
// Ensure modals work properly in fullscreen mode
document.addEventListener("fullscreenchange", function() {
setTimeout(() => {
$('.modal-backdrop').remove(); // Remove any existing backdrops
// Move the modal backdrop when a modal opens
$('#bs-example-modal-lg, #customizeModalId').on('show.bs.modal', function() {
moveModalBackdropToFullscreen();
}, 200);
});
// Ensure modals work properly in fullscreen mode
document.addEventListener("fullscreenchange", function() {
setTimeout(() => {
$('.modal-backdrop').remove(); // Remove any existing backdrops
moveModalBackdropToFullscreen();
}, 200);
});
});
});
</script>
</script>

View File

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

View File

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

View File

@ -641,8 +641,10 @@
<div class="modal-footer">
<button type="button" class="btn btn-secondary waves-effect"
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"
class="btn btn-info waves-effect waves-light" onclick="modalSave()">Save</button>
<?php } ?>
</div>
</div>
</div>
@ -1082,6 +1084,7 @@
var inx = $(e.relatedTarget).data('id');
var igr = $(e.relatedTarget).data('userid');
var igrstatus = $(e.relatedTarget).data('igrstatus');
var roleText = '<?php echo session()->get('roleText') ?>';
// alert(igrstatus);
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) {
if (igrstatus === "ST074") {
$("#pendingQuantityHeader").css("display", "table-cell");
trIGRHTML += '<tr>' +
@ -1306,15 +1308,26 @@
'<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: 50px;" name="UOM">' + item.UOM + '</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>' +
'<td style="width: 100px;" name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + ((isOpenOrder) ? 0 : parseInt(item.Quantity - item.QuantityAsPerInvoice)) + '</td>' +
'<td style="width: 100px;" id="Quantity' + i + '" name="Quantity">' + parseInt(item.Quantity) + '</td>';
if (userRole == 5) { // 5 - lab staff
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="tax_percentage' + i + '">' + tax_percentage + '</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: 100px;"><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" style="width: 75px;" value="'+item.Remarks+'"> </td>' +
'<td style="width: 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>' +
'<td style="width: 50px;" id="grand_total_amount' + i + '">' + grand_total_amount + '</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="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
'<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' +
@ -1341,6 +1354,7 @@
}else{
trIGRHTML +='</tr>';
}
if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) {
$('#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: 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: 100px;" name="Quantity">' + item.Quantity + '</td>' +
'<td style="width: 100px;" data-name="sel" >' + item.QuantityAsPerInvoice + '</td>' +
'<td style="width: 50px;" id="Rate' + i + '" >' + Number(item.Rate).toFixed(2) + '</td>' +
'<td style="width: 100px;" name="Quantity">' + item.Quantity + '</td>' ;
if (userRole == 5) { // 5 - lab staff
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="amount' + i + '">' + 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>' +
'<td style="width: 50px;" id="grand_total_amount' + i + '">' + grand_total_amount + '</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="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
'<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' +
@ -1387,6 +1413,7 @@
}else{
trIGRHTML +='</tr>';
}
}
}