Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
029f52c30d
@ -289,6 +289,7 @@ class Rawmaterialdetails extends BaseController
|
||||
$data['assetcode'] = $this->rawmaterialdetails_model->getAssetcode();
|
||||
$data['avg_price'] = $this->rawmaterialdetails_model->getMaterialAvg($RawMaterialID);
|
||||
$data['materialRateHistory'] = $this->rawmaterialdetails_model->getMaterialRateHistory($RawMaterialID);
|
||||
$data['materialListPage'] = $_GET['page'];
|
||||
|
||||
//print_r($data['avg_price']);die();
|
||||
$this->global['pageTitle'] = 'Edit Material Master';
|
||||
@ -317,6 +318,7 @@ class Rawmaterialdetails extends BaseController
|
||||
$stock = $this->request->getPost('openstock');
|
||||
$reorder = $this->request->getPost('reorder');
|
||||
$stockdate = $this->request->getPost('Date');
|
||||
$materialListPage = $this->request->getPost('materialListPage');
|
||||
$stockdate = (empty($stockdate)) ? NULL : get_date_time_dynamical_format('d-m-Y','Y-m-d',"$stockdate");
|
||||
|
||||
$chked = $this->request->getPost('isactive');
|
||||
@ -331,9 +333,13 @@ class Rawmaterialdetails extends BaseController
|
||||
|
||||
if ($result == true) {
|
||||
$this->session->setFlashdata('success', 'RawMaterial Updated successfully!');
|
||||
$this->session->setFlashdata('materialListPage', "$materialListPage");
|
||||
|
||||
} else {
|
||||
echo "<script>alert('RawMaterial Record Not updated!');</script>";
|
||||
$this->session->setFlashdata('error', 'RawMaterial Record Not updated!');
|
||||
$this->session->setFlashdata('materialListPage', "$materialListPage");
|
||||
|
||||
}
|
||||
return redirect()->route('rawmaterialListing');
|
||||
|
||||
|
||||
@ -21,9 +21,10 @@ class Inwardgateregister_model extends Model
|
||||
$afftectedRows = $this->db->affectedRows();
|
||||
return $afftectedRows;
|
||||
}
|
||||
function getAdditionalIGRFile($igr){
|
||||
function getAdditionalIGRFile($igr)
|
||||
{
|
||||
$builder = $this->db->table('t_inwardgateregister_fileupload')->select('*')
|
||||
->where('IGRNO', $igr);
|
||||
->where('IGRNO', $igr);
|
||||
$query = $builder->get();
|
||||
return $query->getResult();
|
||||
}
|
||||
@ -40,8 +41,8 @@ class Inwardgateregister_model extends Model
|
||||
{
|
||||
$arr = array('Isactive' => 0);
|
||||
$this->db->table('t_inwardgateregister_fileupload')
|
||||
->where('BillNo', $fileid)
|
||||
->update($arr);
|
||||
->where('BillNo', $fileid)
|
||||
->update($arr);
|
||||
$aff = $this->db->affectedRows();
|
||||
return $aff > 0 ? true : false;
|
||||
}
|
||||
@ -86,7 +87,7 @@ class Inwardgateregister_model extends Model
|
||||
->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
|
||||
->join('t_inwardgateregister_fileupload fileup', ' igr.IGRNO = fileup.IGRNO', 'left')
|
||||
->join('t_supplierdetailsn` sup', 'PO.SupplierID = sup.SupplierID')
|
||||
->orderBy('igr.IGRID','desc')
|
||||
->orderBy('igr.IGRID', 'desc')
|
||||
->groupBy('igr.IGRNO', 'desc');
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
@ -136,10 +137,10 @@ class Inwardgateregister_model extends Model
|
||||
->join('t_ogr_master OGM ', 'POM.PONO = OGM.PONO_INV', 'left')
|
||||
// ->where('POM.POType !=', SERVICE) // due to client requirements - he wants to remove the conidition.
|
||||
->where('POM.Status', PO_RELEASED)
|
||||
->orWhere('POM.Status',REQITEM_Emergency_PO_CREATED)
|
||||
->orWhere('POM.Status',IGR_CREATED)
|
||||
->orWhere('POM.Status', IGR_DRAFT )
|
||||
->where( 'POM.IsOpenOrder', 1)
|
||||
->orWhere('POM.Status', REQITEM_Emergency_PO_CREATED)
|
||||
->orWhere('POM.Status', IGR_CREATED)
|
||||
->orWhere('POM.Status', IGR_DRAFT)
|
||||
->where('POM.IsOpenOrder', 1)
|
||||
->orWhere('POM.Status', MRIR_CREATED)
|
||||
->orWhere('POM.Status', MRIR_APPROVED)
|
||||
->orWhere('POM.Status', OGR_COMPLETE)
|
||||
@ -169,25 +170,26 @@ class Inwardgateregister_model extends Model
|
||||
return $temp;
|
||||
}
|
||||
|
||||
public function checkdriverMobile($mobile,$driverName) {
|
||||
public function checkdriverMobile($mobile, $driverName)
|
||||
{
|
||||
$builder = $this->db->table('t_igr_master')
|
||||
->distinct()
|
||||
->select('DriverMobileNumber')
|
||||
->like('DriverMobileNumber', $mobile);
|
||||
if($driverName){
|
||||
$builder->where('DriverName', $driverName);
|
||||
}
|
||||
if ($driverName) {
|
||||
$builder->where('DriverName', $driverName);
|
||||
}
|
||||
|
||||
|
||||
$query = $builder->get();
|
||||
$temparr[] = '';
|
||||
foreach ($query->getResult() as $arr) {
|
||||
$temparr[] = $arr->DriverMobileNumber;
|
||||
}
|
||||
// echo $this->db->getLastQuery()->getQuery();die;
|
||||
$temp['suggestions'] = $temparr;
|
||||
$query = $builder->get();
|
||||
$temparr[] = '';
|
||||
foreach ($query->getResult() as $arr) {
|
||||
$temparr[] = $arr->DriverMobileNumber;
|
||||
}
|
||||
// echo $this->db->getLastQuery()->getQuery();die;
|
||||
$temp['suggestions'] = $temparr;
|
||||
|
||||
return $temp;
|
||||
return $temp;
|
||||
}
|
||||
|
||||
function viewpurchaseorder($PO)
|
||||
@ -220,9 +222,10 @@ class Inwardgateregister_model extends Model
|
||||
return $result; */
|
||||
}
|
||||
|
||||
public function igr_history($hsty_arr) {
|
||||
public function igr_history($hsty_arr)
|
||||
{
|
||||
|
||||
$keysToRemove = ["UpdateBY","UpdateBy", "MaterialRcvdDate", "DeliveryChellanDate"];
|
||||
$keysToRemove = ["UpdateBY", "UpdateBy", "MaterialRcvdDate", "DeliveryChellanDate"];
|
||||
|
||||
foreach ($keysToRemove as $key) {
|
||||
if (isset($hsty_arr[$key])) {
|
||||
@ -235,33 +238,35 @@ class Inwardgateregister_model extends Model
|
||||
return $this->db->insertID();
|
||||
}
|
||||
|
||||
function get_igr_history($col,$IGR,$IGRITEM = null)
|
||||
function get_igr_history($col, $IGR, $IGRITEM = null)
|
||||
{
|
||||
|
||||
$builder = $this->db->table('t_igr_history Hist')
|
||||
->select("Hist.*")
|
||||
->where('Hist.field', $col);
|
||||
->select("Hist.*")
|
||||
->where('Hist.field', $col);
|
||||
|
||||
if ($IGR) {
|
||||
$builder->where('Hist.IGR_No', $IGR);
|
||||
}
|
||||
if ($IGR) {
|
||||
$builder->where('Hist.IGR_No', $IGR);
|
||||
}
|
||||
|
||||
if ($IGRITEM !== null) {
|
||||
$builder->where('Hist.IGRItem_No', $IGRITEM);
|
||||
}
|
||||
if ($IGRITEM !== null) {
|
||||
$builder->where('Hist.IGRItem_No', $IGRITEM);
|
||||
}
|
||||
|
||||
$builder->orderBy('Hist.history_dated', 'DESC');
|
||||
$builder->limit(1);
|
||||
$query = $builder->get();
|
||||
$result = $query->getRow();
|
||||
return $result;
|
||||
$builder->orderBy('Hist.history_dated', 'DESC');
|
||||
$builder->limit(1);
|
||||
$query = $builder->get();
|
||||
$result = $query->getRow();
|
||||
return $result;
|
||||
}
|
||||
|
||||
function get_igr_master_for_history($igr_no) {
|
||||
function get_igr_master_for_history($igr_no)
|
||||
{
|
||||
return $this->db->table('t_igr_master Master')->where('Master.IGRNO', $igr_no)->get()->getRow();
|
||||
}
|
||||
|
||||
function get_igr_child_for_history($igr_no, $igr_item_no) {
|
||||
function get_igr_child_for_history($igr_no, $igr_item_no)
|
||||
{
|
||||
$builder = $this->db->table('t_igr_details Child'); // Select only the required field
|
||||
if ($igr_no) {
|
||||
$builder->where('Child.IGRNO', $igr_no);
|
||||
@ -293,34 +298,34 @@ class Inwardgateregister_model extends Model
|
||||
$result = [];
|
||||
if ($YesIAmAffected > 0) {
|
||||
$result = $this->db->table('t_igr_master')
|
||||
->select('IGRNO')
|
||||
->orderBy('CreatedDate', 'desc')
|
||||
->get()
|
||||
->getRow();
|
||||
->select('IGRNO')
|
||||
->orderBy('CreatedDate', 'desc')
|
||||
->get()
|
||||
->getRow();
|
||||
// $result->IGRNO;
|
||||
}
|
||||
|
||||
$igrno = ($YesIAmAffected && !empty($result)) ? $result->IGRNO : '';
|
||||
return $igrno;
|
||||
}
|
||||
return $igrno;
|
||||
}
|
||||
|
||||
function addigrD($igrD)
|
||||
{
|
||||
$this->db->transStart();
|
||||
$builder = $this->db->table('t_igr_details');
|
||||
$builder = $this->db->table('t_igr_details');
|
||||
$builder->insert($igrD);
|
||||
$aff_row = $this->db->affectedRows();
|
||||
$aff_row = $this->db->affectedRows();
|
||||
log_message('error', 'addigrD Query: ' . $this->db->getLastQuery()->getQuery());
|
||||
$this->db->transComplete();
|
||||
$this->db->transComplete();
|
||||
|
||||
$result = $this->db->table('t_igr_details')
|
||||
->select('IGRItemNo')
|
||||
->orderBy('CreatedDate', 'desc')
|
||||
->get()
|
||||
->getRow();
|
||||
->select('IGRItemNo')
|
||||
->orderBy('CreatedDate', 'desc')
|
||||
->get()
|
||||
->getRow();
|
||||
|
||||
$res = ($aff_row > 0) ? $result->IGRItemNo : 0;
|
||||
return $res;
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
@ -371,40 +376,40 @@ class Inwardgateregister_model extends Model
|
||||
return $result;
|
||||
}
|
||||
function ViewigrListing_old()
|
||||
{
|
||||
{
|
||||
|
||||
// $builder = $this->db->table('t_igr_master igr')
|
||||
// ->select('igr.*,PO.IsOpenOrder,PO.DeliveryDate,sup.SupplierName,PO.POType,trans.name as TransporterName')
|
||||
// ->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
|
||||
// ->join('t_supplierdetailsn` sup', 'PO.SupplierID = sup.SupplierID')
|
||||
// $builder = $this->db->table('t_igr_master igr')
|
||||
// ->select('igr.*,PO.IsOpenOrder,PO.DeliveryDate,sup.SupplierName,PO.POType,trans.name as TransporterName')
|
||||
// ->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
|
||||
// ->join('t_supplierdetailsn` sup', 'PO.SupplierID = sup.SupplierID')
|
||||
// ->join('t_transporter` trans', 'igr.TransporterId = trans.id' , 'left')
|
||||
// ->where('igr.IGRStatus !=', MRIR_CREATED)
|
||||
// ->where('igr.IGRStatus !=', MRIR_CREATED)
|
||||
// ->orderBy('igr.CreatedDate', 'desc');
|
||||
|
||||
$builder = $this->db->table('t_igr_details igr_details')
|
||||
->select('igr.*,PO.IsOpenOrder,PO.DeliveryDate,sup.SupplierName,PO.POType,trans.name as TransporterName,item.MaterialName, igr_details.QuantityAsPerInvoice as ReceivedQuantity , igr_details.NetWeight as NetWeight')
|
||||
->select('igr.*,PO.IsOpenOrder,PO.DeliveryDate,sup.SupplierName,PO.POType,trans.name as TransporterName,item.MaterialName, igr_details.QuantityAsPerInvoice as ReceivedQuantity , igr_details.NetWeight as NetWeight')
|
||||
->join('t_igr_master igr', 'igr_details.IGRNo = igr.IGRNo')
|
||||
->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
|
||||
->join('t_supplierdetailsn` sup', 'PO.SupplierID = sup.SupplierID')
|
||||
->join('t_transporter` trans', 'igr.TransporterId = trans.id' , 'left')
|
||||
->join('t_materialmaster` item', 'igr_details.MaterialCode = item.MaterialCode' , 'left')
|
||||
->where('igr.IGRStatus !=', MRIR_CREATED)
|
||||
->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
|
||||
->join('t_supplierdetailsn` sup', 'PO.SupplierID = sup.SupplierID')
|
||||
->join('t_transporter` trans', 'igr.TransporterId = trans.id', 'left')
|
||||
->join('t_materialmaster` item', 'igr_details.MaterialCode = item.MaterialCode', 'left')
|
||||
->where('igr.IGRStatus !=', MRIR_CREATED)
|
||||
->orderBy('igr.CreatedDate', 'desc');
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
|
||||
|
||||
|
||||
// echo $this->db->getLastQuery()->getQuery();die;
|
||||
return $result;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
function ViewigrListing($fromDate,$toDate)
|
||||
{
|
||||
function ViewigrListing($fromDate, $toDate)
|
||||
{
|
||||
$subQuery1 = $this->db->table('t_igr_remarkes')
|
||||
->select('COUNT(id)')
|
||||
->where('igr_no = igr.IGRNo')
|
||||
->getCompiledSelect();
|
||||
->select('COUNT(id)')
|
||||
->where('igr_no = igr.IGRNo')
|
||||
->getCompiledSelect();
|
||||
|
||||
// Build subQuery2 dynamically for rate and tax based on POType
|
||||
$subQuery2 = "(CASE
|
||||
@ -453,17 +458,16 @@ class Inwardgateregister_model extends Model
|
||||
->join('t_igr_details IGRD', 'igr.IGRNo = IGRD.IGRNo')
|
||||
->where('igr.IGRStatus !=', MRIR_CREATED)
|
||||
->groupBy('IGRD.IGRNo');
|
||||
if(session()->get('roleText') == 'Auditor'){
|
||||
if (session()->get('roleText') == 'Auditor') {
|
||||
|
||||
$builder->where('Date(igr.DeliveryChellanDate) >=', "$fromDate")
|
||||
->where('Date(igr.DeliveryChellanDate) <=', "$toDate")
|
||||
->orderBy('igr.DeliveryChellanDate', 'desc');
|
||||
}else{
|
||||
$builder->where('Date(igr.CreatedDate) >=', "$fromDate")
|
||||
->where('Date(igr.CreatedDate) <=', "$toDate")
|
||||
->orderBy('igr.CreatedDate', 'desc');
|
||||
|
||||
}
|
||||
$builder->where('Date(igr.DeliveryChellanDate) >=', "$fromDate")
|
||||
->where('Date(igr.DeliveryChellanDate) <=', "$toDate")
|
||||
->orderBy('igr.DeliveryChellanDate', 'desc');
|
||||
} else {
|
||||
$builder->where('Date(igr.CreatedDate) >=', "$fromDate")
|
||||
->where('Date(igr.CreatedDate) <=', "$toDate")
|
||||
->orderBy('igr.CreatedDate', 'desc');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -473,11 +477,11 @@ class Inwardgateregister_model extends Model
|
||||
$result = $query->getResult();
|
||||
|
||||
|
||||
// echo $this->db->getLastQuery()->getQuery();die;
|
||||
// dd($result);
|
||||
// echo $this->db->getLastQuery()->getQuery();die;
|
||||
// dd($result);
|
||||
|
||||
|
||||
// old - issue in t_igr_remarkes join
|
||||
// old - issue in t_igr_remarkes join
|
||||
// $builder = $this->db->table('t_igr_master igr')
|
||||
// ->select('igr.*,PO.IsOpenOrder,PO.DeliveryDate,sup.SupplierName,PO.POType,trans.name as TransporterName , SUM(IGRD.QuantityAsPerInvoice) as ReceivedQuantity, SUM(IGRD.NetWeight) as NetWeight , count(IGRD.IGRNo) as itemCount , count(remark.id) as remark_count')
|
||||
// ->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
|
||||
@ -498,58 +502,58 @@ class Inwardgateregister_model extends Model
|
||||
|
||||
|
||||
// $builder2 = $this->db->table('t_igr_details igr_details')
|
||||
// ->select('igr.*,PO.IsOpenOrder,PO.DeliveryDate,sup.SupplierName,PO.POType,trans.name as TransporterName,item.MaterialName, igr_details.QuantityAsPerInvoice as ReceivedQuantity , igr_details.NetWeight as NetWeight')
|
||||
// ->select('igr.*,PO.IsOpenOrder,PO.DeliveryDate,sup.SupplierName,PO.POType,trans.name as TransporterName,item.MaterialName, igr_details.QuantityAsPerInvoice as ReceivedQuantity , igr_details.NetWeight as NetWeight')
|
||||
// ->join('t_igr_master igr', 'igr_details.IGRNo = igr.IGRNo')
|
||||
// ->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
|
||||
// ->join('t_supplierdetailsn sup', 'PO.SupplierID = sup.SupplierID')
|
||||
// ->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
|
||||
// ->join('t_supplierdetailsn sup', 'PO.SupplierID = sup.SupplierID')
|
||||
// ->join('t_transporter trans', 'igr.TransporterId = trans.id' , 'left')
|
||||
// ->join('t_materialmaster` item', 'igr_details.MaterialCode = item.MaterialCode' , 'left')
|
||||
// ->where('igr.IGRStatus !=', MRIR_CREATED)
|
||||
// ->where('igr.IGRStatus !=', MRIR_CREATED)
|
||||
// ->orderBy('igr.CreatedDate', 'desc');
|
||||
// $query2 = $builder2->get();
|
||||
// $result2 = $query2->getResult();
|
||||
// echo $this->db->getLastQuery()->getQuery();die;
|
||||
return [$result,[]];
|
||||
}
|
||||
return [$result, []];
|
||||
}
|
||||
|
||||
|
||||
function customViewigrListing($fromDate,$toDate)
|
||||
{
|
||||
function customViewigrListing($fromDate, $toDate)
|
||||
{
|
||||
|
||||
$builder = $this->db->table('t_igr_master igr')
|
||||
->select('igr.*,PO.IsOpenOrder,PO.DeliveryDate,sup.SupplierName,PO.POType,trans.name as TransporterName , SUM(IGRD.QuantityAsPerInvoice) as ReceivedQuantity, SUM(IGRD.NetWeight) as NetWeight , count(IGRD.IGRNo) as itemCount')
|
||||
->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
|
||||
->join('t_supplierdetailsn sup', 'PO.SupplierID = sup.SupplierID')
|
||||
->join('t_transporter trans', 'igr.TransporterId = trans.id' , 'left')
|
||||
$builder = $this->db->table('t_igr_master igr')
|
||||
->select('igr.*,PO.IsOpenOrder,PO.DeliveryDate,sup.SupplierName,PO.POType,trans.name as TransporterName , SUM(IGRD.QuantityAsPerInvoice) as ReceivedQuantity, SUM(IGRD.NetWeight) as NetWeight , count(IGRD.IGRNo) as itemCount')
|
||||
->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
|
||||
->join('t_supplierdetailsn sup', 'PO.SupplierID = sup.SupplierID')
|
||||
->join('t_transporter trans', 'igr.TransporterId = trans.id', 'left')
|
||||
->join('t_igr_details IGRD', 'igr.IGRNo = IGRD.IGRNo')
|
||||
->where('igr.IGRStatus !=', MRIR_CREATED)
|
||||
->where('igr.IGRStatus !=', MRIR_CREATED)
|
||||
->groupStart()
|
||||
->where('Date(igr.CreatedDate) >=', $fromDate)
|
||||
->orWhere('Date(igr.UpdatedOn) >=', $fromDate)
|
||||
->groupEnd()
|
||||
->groupStart()
|
||||
->where('Date(igr.CreatedDate) <=', $toDate)
|
||||
->orWhere('Date(igr.UpdatedOn) <=', $toDate)
|
||||
->where('Date(igr.CreatedDate) <=', $toDate)
|
||||
->orWhere('Date(igr.UpdatedOn) <=', $toDate)
|
||||
->groupEnd()
|
||||
->groupBy('igr.IGRNo')
|
||||
->orderBy('igr.CreatedDate', 'desc');
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
|
||||
$builder2 = $this->db->table('t_igr_details igr_details')
|
||||
->select('igr.*,PO.IsOpenOrder,PO.DeliveryDate,sup.SupplierName,PO.POType,trans.name as TransporterName,item.MaterialName, igr_details.QuantityAsPerInvoice as ReceivedQuantity , igr_details.NetWeight as NetWeight')
|
||||
->select('igr.*,PO.IsOpenOrder,PO.DeliveryDate,sup.SupplierName,PO.POType,trans.name as TransporterName,item.MaterialName, igr_details.QuantityAsPerInvoice as ReceivedQuantity , igr_details.NetWeight as NetWeight')
|
||||
->join('t_igr_master igr', 'igr_details.IGRNo = igr.IGRNo')
|
||||
->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
|
||||
->join('t_supplierdetailsn sup', 'PO.SupplierID = sup.SupplierID')
|
||||
->join('t_transporter trans', 'igr.TransporterId = trans.id' , 'left')
|
||||
->join('t_materialmaster` item', 'igr_details.MaterialCode = item.MaterialCode' , 'left')
|
||||
->where('igr.IGRStatus !=', MRIR_CREATED)
|
||||
->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
|
||||
->join('t_supplierdetailsn sup', 'PO.SupplierID = sup.SupplierID')
|
||||
->join('t_transporter trans', 'igr.TransporterId = trans.id', 'left')
|
||||
->join('t_materialmaster` item', 'igr_details.MaterialCode = item.MaterialCode', 'left')
|
||||
->where('igr.IGRStatus !=', MRIR_CREATED)
|
||||
->orderBy('igr.CreatedDate', 'desc');
|
||||
$query2 = $builder2->get();
|
||||
$result2 = $query2->getResult();
|
||||
$query2 = $builder2->get();
|
||||
$result2 = $query2->getResult();
|
||||
// echo $this->db->getLastQuery()->getQuery();die;
|
||||
return [$result,$result2];
|
||||
}
|
||||
return [$result, $result2];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -579,10 +583,10 @@ class Inwardgateregister_model extends Model
|
||||
->join('t_purchaseorder_lineitem POL', 'igr.PONO = POL.PONO and POL.MaterialCode=igrd.MaterialCode ')
|
||||
->join('t_supplierdetailsn sup', 'sup.SupplierID = POM.SupplierID')
|
||||
->join('t_materialmaster MM', 'MM.MaterialCode = igrd.MaterialCode')
|
||||
->join('t_service_tax st', 'st.LineItemNo = POL.LineItemNo' , 'left')
|
||||
->join('t_revenue_tax rt', 'rt.LineItemNo = POL.LineItemNo' , 'left')
|
||||
->join('t_import_tax it', 'it.LineItemNo = POL.LineItemNo' , 'left')
|
||||
->join('t_configdetails cd','cd.key = MM.Category','left')
|
||||
->join('t_service_tax st', 'st.LineItemNo = POL.LineItemNo', 'left')
|
||||
->join('t_revenue_tax rt', 'rt.LineItemNo = POL.LineItemNo', 'left')
|
||||
->join('t_import_tax it', 'it.LineItemNo = POL.LineItemNo', 'left')
|
||||
->join('t_configdetails cd', 'cd.key = MM.Category', 'left')
|
||||
->where('igr.IGRNO', $IGRNO);
|
||||
|
||||
$query = $builder->get();
|
||||
@ -637,7 +641,7 @@ class Inwardgateregister_model extends Model
|
||||
}
|
||||
}
|
||||
|
||||
function UpdatePOMaster($PONO, $updatedBy,$IGRStatus)
|
||||
function UpdatePOMaster($PONO, $updatedBy, $IGRStatus)
|
||||
{
|
||||
|
||||
$builder = $this->db->table('t_purchaseorder_lineitem')->select('*')
|
||||
@ -969,13 +973,13 @@ class Inwardgateregister_model extends Model
|
||||
// $query = $this->db->query($subQuery);
|
||||
// return $query->getResult();
|
||||
$result = $this->db->table('t_ogr_master')
|
||||
->select('OGRNO')
|
||||
->orderBy('CreatedOn', 'desc')
|
||||
->get()
|
||||
->getRow();
|
||||
->select('OGRNO')
|
||||
->orderBy('CreatedOn', 'desc')
|
||||
->get()
|
||||
->getRow();
|
||||
|
||||
$OGRNO = ($aff_row && $result !== null) ? $result->OGRNO : 0;
|
||||
return $OGRNO;
|
||||
return $OGRNO;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1073,7 +1077,8 @@ class Inwardgateregister_model extends Model
|
||||
$r = $this->db->affectedRows();
|
||||
return $r;
|
||||
}
|
||||
function updateIGRLineItem($igrlineitemarr, $IGRitemNo){
|
||||
function updateIGRLineItem($igrlineitemarr, $IGRitemNo)
|
||||
{
|
||||
$this->db->table('t_igr_details')
|
||||
->where('IGRItemNo', $IGRitemNo)
|
||||
->update($igrlineitemarr);
|
||||
@ -1112,133 +1117,144 @@ class Inwardgateregister_model extends Model
|
||||
}
|
||||
|
||||
public function ViewIGRHistory($igr)
|
||||
{
|
||||
$builder = $this->db->table('t_igr_history');
|
||||
{
|
||||
$builder = $this->db->table('t_igr_history');
|
||||
|
||||
$builder->select('t_igr_history.*, DATE_FORMAT(t_igr_history.history_dated, "%d-%m-%Y") AS indian_date, DATE_FORMAT(t_igr_history.history_dated, "%h:%i:%s %p") AS indian_time, CONCAT_WS(" ", t_employee_details.FirstName, t_employee_details.LastName) AS FullName,t_materialmaster.MaterialName,t_materialmaster.MaterialName,t_materialmaster.MaterialCode');
|
||||
$builder->join('tbl_users', 'tbl_users.userId = t_igr_history.by', 'left');
|
||||
$builder->join('t_employee_details', 'tbl_users.EmpID = t_employee_details.EmpID', 'left');
|
||||
$builder->select('t_igr_history.*, DATE_FORMAT(t_igr_history.history_dated, "%d-%m-%Y") AS indian_date, DATE_FORMAT(t_igr_history.history_dated, "%h:%i:%s %p") AS indian_time, CONCAT_WS(" ", t_employee_details.FirstName, t_employee_details.LastName) AS FullName,t_materialmaster.MaterialName,t_materialmaster.MaterialName,t_materialmaster.MaterialCode');
|
||||
$builder->join('tbl_users', 'tbl_users.userId = t_igr_history.by', 'left');
|
||||
$builder->join('t_employee_details', 'tbl_users.EmpID = t_employee_details.EmpID', 'left');
|
||||
$builder->join('t_igr_details', 'CONVERT(t_igr_history.IGRItem_No USING utf8) = CONVERT(t_igr_details.IGRItemNo USING utf8)', 'left');
|
||||
$builder->join('t_materialmaster', 'CONVERT(t_materialmaster.MaterialCode USING utf8) = CONVERT(t_igr_details.MaterialCode USING utf8)', 'left');
|
||||
$builder->where('CONVERT(IGR_No USING utf8)', $igr);
|
||||
$builder->orderBy('t_igr_history.history_dated', 'asc');
|
||||
// $builder->where('IGR_No', $igr);
|
||||
// $builder->where('IGR_No', $igr);
|
||||
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
return $result;
|
||||
|
||||
}
|
||||
}
|
||||
public function isFileExistsInIGRmaster($filename)
|
||||
{
|
||||
{
|
||||
$result = $this->db->table('t_igr_master')->where('MasterFile', $filename);
|
||||
$query = $result->get();
|
||||
return $query->getResult();
|
||||
}
|
||||
}
|
||||
public function isFileExistsInIGRdetails($filename)
|
||||
{
|
||||
{
|
||||
$result = $this->db->table('t_igr_details')->where('WeightFile', $filename);
|
||||
$query = $result->get();
|
||||
return $query->getResult();
|
||||
}
|
||||
}
|
||||
|
||||
public function getCostCenterData($pono)
|
||||
{
|
||||
$builder = $this->db->table('t_purchaseorder_lineitem');
|
||||
{
|
||||
$builder = $this->db->table('t_purchaseorder_lineitem');
|
||||
|
||||
$builder->select('t_purchaseorder_lineitem.ReqNo,reqMaster.CostCenterCode,CSMaster.CostCenterName');
|
||||
$builder->select('t_purchaseorder_lineitem.ReqNo,reqMaster.CostCenterCode,CSMaster.CostCenterName');
|
||||
$builder->join('t_requestion_master reqMaster', 't_purchaseorder_lineitem.ReqNo = reqMaster.ReqNo', 'left');
|
||||
$builder->join('t_costcenter_master CSMaster', 'reqMaster.CostCenterCode = CSMaster.CostCenterCode', 'left');
|
||||
$builder->where('PONO', $pono);
|
||||
$builder->where('PONO', $pono);
|
||||
$builder->groupBy('t_purchaseorder_lineitem.ReqNo');
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
return $result;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function getAllIgrFileDetails($igrno)
|
||||
{
|
||||
|
||||
// Query 1: Get FilePath and Remarks from t_inwardgateregister_fileupload
|
||||
$builder1 = $this->db->table('t_inwardgateregister_fileupload IFU');
|
||||
$query1 = $builder1->select('IFU.FilePath as file, IFU.Remarks as filename')
|
||||
->where('IFU.IGRNO', $igrno)
|
||||
->where('IFU.Isactive', 1)
|
||||
->get();
|
||||
$result1 = $query1->getResult();
|
||||
|
||||
// Query 2: Get MasterFile from t_igr_master
|
||||
$builder2 = $this->db->table('t_igr_master IM');
|
||||
$query2 = $builder2->select('IM.MasterFile as file, IM.MasterFile as filename')
|
||||
->where('IM.IGRNO', $igrno)
|
||||
->where('IM.MasterFile IS NOT NULL')
|
||||
->get();
|
||||
$result2 = $query2->getResult();
|
||||
|
||||
// Query 3: Get WeightFile from t_igr_details
|
||||
$builder3 = $this->db->table('t_igr_details ID');
|
||||
$query3 = $builder3->select('ID.WeightFile as file, ID.WeightFile as filename')
|
||||
->where('ID.IGRNO', $igrno)
|
||||
->where('ID.WeightFile IS NOT NULL')
|
||||
->get();
|
||||
$result3 = $query3->getResult();
|
||||
|
||||
// Merging results into a single array
|
||||
$results = array_merge($result1, $result2, $result3);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function transporter()
|
||||
{
|
||||
$builder = $this->db->table('t_transporter t');
|
||||
$query = $builder->select('t.*')->get();
|
||||
$result = $query->getResult();
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function findIgrDetailsForIncomingSilicaSand($materialCodes, $month ,$remark)
|
||||
public function getAllIgrFileDetails($igrno)
|
||||
{
|
||||
$builder = $this->db->table('t_igr_details')
|
||||
->select(
|
||||
't_igr_details.IGRNO,
|
||||
|
||||
// Query 1: Get FilePath and Remarks from t_inwardgateregister_fileupload
|
||||
$builder1 = $this->db->table('t_inwardgateregister_fileupload IFU');
|
||||
$query1 = $builder1->select('IFU.FilePath as file, IFU.Remarks as filename')
|
||||
->where('IFU.IGRNO', $igrno)
|
||||
->where('IFU.Isactive', 1)
|
||||
->get();
|
||||
$result1 = $query1->getResult();
|
||||
|
||||
// Query 2: Get MasterFile from t_igr_master
|
||||
$builder2 = $this->db->table('t_igr_master IM');
|
||||
$query2 = $builder2->select('IM.MasterFile as file, IM.MasterFile as filename')
|
||||
->where('IM.IGRNO', $igrno)
|
||||
->where('IM.MasterFile IS NOT NULL')
|
||||
->get();
|
||||
$result2 = $query2->getResult();
|
||||
|
||||
// Query 3: Get WeightFile from t_igr_details
|
||||
$builder3 = $this->db->table('t_igr_details ID');
|
||||
$query3 = $builder3->select('ID.WeightFile as file, ID.WeightFile as filename')
|
||||
->where('ID.IGRNO', $igrno)
|
||||
->where('ID.WeightFile IS NOT NULL')
|
||||
->get();
|
||||
$result3 = $query3->getResult();
|
||||
|
||||
// Merging results into a single array
|
||||
$results = array_merge($result1, $result2, $result3);
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function transporter()
|
||||
{
|
||||
$builder = $this->db->table('t_transporter t');
|
||||
$query = $builder->select('t.*')->get();
|
||||
$result = $query->getResult();
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function findIgrDetailsForIncomingSilicaSand($materialCodes, $month, $remark)
|
||||
{
|
||||
|
||||
$month = new \DateTime($month . "-01"); // Create DateTime for the first day of the month
|
||||
|
||||
|
||||
$builder = $this->db->table('t_igr_details');
|
||||
|
||||
|
||||
$builder->select(
|
||||
't_igr_details.IGRNO,
|
||||
t_igr_details.MaterialCode,
|
||||
igrMast.DeliveryChellanOrInvoiceNo as invoiceNo,
|
||||
igrMast.DeliveryChellanDate as invoiceDate,
|
||||
igrMast.MaterialRcvdDate as materialRecievedDate,
|
||||
igrMast.VehicleNo,
|
||||
supplierDetails.SupplierName,
|
||||
cd.ConfigValue as sandType ,
|
||||
cd.ConfigValue as sandType,
|
||||
t_igr_details.QuantityAsPerInvoice as Qty,
|
||||
issd.*')
|
||||
->whereIn('t_igr_details.MaterialCode', $materialCodes)
|
||||
->where('t_igr_details.QuantityAsPerInvoice <>', 0)
|
||||
->like('t_igr_details.CreatedDate', $month, 'after');
|
||||
issd.*'
|
||||
);
|
||||
|
||||
// remark needed for those who selected any remark.
|
||||
if ($remark != "noRemark") {
|
||||
$builder->where('issd.remark', $remark);
|
||||
}
|
||||
|
||||
$builder->groupBy('t_igr_details.IGRNO, t_igr_details.MaterialCode')
|
||||
->join('t_igr_master igrMast', 'igrMast.IGRNO = t_igr_details.IGRNO')
|
||||
->join('t_incomingsilicasanddetails issd','issd.igrNo_fk = t_igr_details.IGRNO AND issd.materialCode = t_igr_details.MaterialCode','left')
|
||||
->join('t_materialmaster materialMaster', 'materialMaster.MaterialCode = t_igr_details.MaterialCode')
|
||||
->join('t_configdetails cd','cd.key = materialMaster.Category','left')
|
||||
->join('t_purchaseorder_master poMaster', 'poMaster.PONO = igrMast.PONO', 'left')
|
||||
->join('t_supplierdetailsn supplierDetails', 'supplierDetails.SupplierID = poMaster.SupplierID', 'left')
|
||||
->orderBy('t_igr_details.CreatedDate', 'asc ');
|
||||
$builder->join('t_igr_master igrMast', 'igrMast.IGRNO = t_igr_details.IGRNO');
|
||||
$builder->join('t_incomingsilicasanddetails issd', 'issd.igrNo_fk = t_igr_details.IGRNO AND issd.materialCode = t_igr_details.MaterialCode', 'left');
|
||||
$builder->join('t_materialmaster materialMaster', 'materialMaster.MaterialCode = t_igr_details.MaterialCode');
|
||||
$builder->join('t_configdetails cd', 'cd.key = materialMaster.Category', 'left');
|
||||
$builder->join('t_purchaseorder_master poMaster', 'poMaster.PONO = igrMast.PONO', 'left');
|
||||
$builder->join('t_supplierdetailsn supplierDetails', 'supplierDetails.SupplierID = poMaster.SupplierID', 'left');
|
||||
|
||||
$builder->where('Date(t_igr_details.CreatedDate) >=', $month->format('Y-m-01 00:00:00'));
|
||||
$builder->where('Date(t_igr_details.CreatedDate) <=', $month->format('Y-m-t 23:59:59'));
|
||||
$builder->whereIn('t_igr_details.MaterialCode', $materialCodes);
|
||||
$builder->where('t_igr_details.QuantityAsPerInvoice <>', 0);
|
||||
|
||||
// Conditional WHERE clause for remark
|
||||
if ($remark != "noRemark") {
|
||||
$builder->where('issd.remark', $remark);
|
||||
}
|
||||
|
||||
|
||||
$builder->groupBy('t_igr_details.IGRNO, t_igr_details.MaterialCode');
|
||||
|
||||
$builder->orderBy('t_igr_details.CreatedDate', 'asc ');
|
||||
|
||||
$query = $builder->get();
|
||||
$result = $query->getResultArray();
|
||||
|
||||
return $result;
|
||||
return $query->getResultArray();
|
||||
|
||||
}
|
||||
|
||||
public function getHistoryDetailsforEmail($igr){
|
||||
$date = date('Y-m-d H:i:s');
|
||||
public function getHistoryDetailsforEmail($igr)
|
||||
{
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$to = date('Y-m-d H:i:s', strtotime($date . ' +30 seconds'));
|
||||
$from = date('Y-m-d H:i:s', strtotime($date . ' -30 seconds'));
|
||||
|
||||
@ -1247,13 +1263,13 @@ class Inwardgateregister_model extends Model
|
||||
from t_igr_history
|
||||
LEFT JOIN tbl_users ON tbl_users.userId = t_igr_history.by
|
||||
LEFT JOIN t_employee_details ON tbl_users.EmpID = t_employee_details.EmpID
|
||||
where is_add = 1 and IGR_No = '".$igr."'");
|
||||
$first_line = $query3->getRow();
|
||||
where is_add = 1 and IGR_No = '" . $igr . "'");
|
||||
$first_line = $query3->getRow();
|
||||
|
||||
// 392 po
|
||||
// 392 po
|
||||
|
||||
$builder = $this->db->table('t_igr_history')
|
||||
->select('
|
||||
$builder = $this->db->table('t_igr_history')
|
||||
->select('
|
||||
t_igr_history.id,
|
||||
t_igr_history.field,
|
||||
t_igr_history.is_add,
|
||||
@ -1288,15 +1304,15 @@ $builder = $this->db->table('t_igr_history')
|
||||
END AS old_data,
|
||||
t_igr_history.old_data as original_old_data,t_materialmaster.MaterialName,t_materialmaster.MaterialCode
|
||||
')
|
||||
// ->join('t_igr_details IGRD', 'IGRD.IGRItemNo = t_igr_history.IGRItem_No','left')
|
||||
// ->join('t_materialmaster MM','MM.MaterialCode = IGRD.MaterialCode','left')
|
||||
->join('tbl_users', 'tbl_users.userId = t_igr_history.by','left')
|
||||
->join('t_employee_details','tbl_users.EmpID = t_employee_details.EmpID','left')
|
||||
->join('t_igr_details', 'CONVERT(t_igr_history.IGRItem_No USING utf8) = CONVERT(t_igr_details.IGRItemNo USING utf8)', 'left')
|
||||
->join('t_materialmaster', 'CONVERT(t_materialmaster.MaterialCode USING utf8) = CONVERT(t_igr_details.MaterialCode USING utf8)', 'left')
|
||||
->where('CONVERT(t_igr_history.IGR_No USING utf8)', $igr)
|
||||
->where('t_igr_history.is_edit', 1)
|
||||
->where('t_igr_history.history_dated BETWEEN "'.$from.'" AND "'.$to.'"');
|
||||
// ->join('t_igr_details IGRD', 'IGRD.IGRItemNo = t_igr_history.IGRItem_No','left')
|
||||
// ->join('t_materialmaster MM','MM.MaterialCode = IGRD.MaterialCode','left')
|
||||
->join('tbl_users', 'tbl_users.userId = t_igr_history.by', 'left')
|
||||
->join('t_employee_details', 'tbl_users.EmpID = t_employee_details.EmpID', 'left')
|
||||
->join('t_igr_details', 'CONVERT(t_igr_history.IGRItem_No USING utf8) = CONVERT(t_igr_details.IGRItemNo USING utf8)', 'left')
|
||||
->join('t_materialmaster', 'CONVERT(t_materialmaster.MaterialCode USING utf8) = CONVERT(t_igr_details.MaterialCode USING utf8)', 'left')
|
||||
->where('CONVERT(t_igr_history.IGR_No USING utf8)', $igr)
|
||||
->where('t_igr_history.is_edit', 1)
|
||||
->where('t_igr_history.history_dated BETWEEN "' . $from . '" AND "' . $to . '"');
|
||||
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
@ -1304,50 +1320,54 @@ $builder = $this->db->table('t_igr_history')
|
||||
// echo $this->db->getLastQuery()->getQuery(); die;
|
||||
return [
|
||||
'history' => $result,
|
||||
'first_line' => $first_line ? $first_line->IGR_No ." was Created by ". $first_line->history_by ." on ". $first_line->indian_date ." at ". $first_line->indian_time : null,
|
||||
];
|
||||
'first_line' => $first_line ? $first_line->IGR_No . " was Created by " . $first_line->history_by . " on " . $first_line->indian_date . " at " . $first_line->indian_time : null,
|
||||
];
|
||||
}
|
||||
|
||||
public function getDetailsforEmail($userId,$roleId)
|
||||
{
|
||||
public function getDetailsforEmail($userId, $roleId)
|
||||
{
|
||||
$query0 = $this->db->query("
|
||||
SELECT CompanyName,EmailAddress
|
||||
FROM t_company_details");
|
||||
$company = $query0->getRow();
|
||||
$company = $query0->getRow();
|
||||
|
||||
$query1 = $this->db->query("
|
||||
$query1 = $this->db->query(
|
||||
"
|
||||
SELECT CONCAT_WS(' ', t_employee_details.FirstName, t_employee_details.LastName) AS FullName
|
||||
FROM tbl_users
|
||||
LEFT JOIN t_employee_details ON tbl_users.EmpID = t_employee_details.EmpID
|
||||
WHERE tbl_users.userId = ?", [$userId]
|
||||
);
|
||||
$fullName = $query1->getRow();
|
||||
WHERE tbl_users.userId = ?",
|
||||
[$userId]
|
||||
);
|
||||
$fullName = $query1->getRow();
|
||||
|
||||
$query2 = $this->db->query("
|
||||
$query2 = $this->db->query(
|
||||
"
|
||||
SELECT email FROM tbl_users
|
||||
WHERE isDeleted = 0 AND roleId =".$roleId
|
||||
);
|
||||
$to_mails = $query2->getResult();
|
||||
WHERE isDeleted = 0 AND roleId =" . $roleId
|
||||
);
|
||||
$to_mails = $query2->getResult();
|
||||
|
||||
$query3 = $this->db->query("
|
||||
$query3 = $this->db->query(
|
||||
"
|
||||
SELECT email FROM tbl_users
|
||||
WHERE isDeleted = 0 AND userId =".$userId
|
||||
);
|
||||
$from_mails = $query3->getRow();
|
||||
WHERE isDeleted = 0 AND userId =" . $userId
|
||||
);
|
||||
$from_mails = $query3->getRow();
|
||||
|
||||
return [
|
||||
return [
|
||||
'company' => $company ? $company->CompanyName : null,
|
||||
'company_mail' => $company ? $company->EmailAddress : null,
|
||||
'full_name' => $fullName ? $fullName->FullName : null,
|
||||
'from_mails' => $from_mails ? $from_mails->email : null ,
|
||||
'full_name' => $fullName ? $fullName->FullName : null,
|
||||
'from_mails' => $from_mails ? $from_mails->email : null,
|
||||
'to_mails' => $to_mails,
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
public function getdriverlist()
|
||||
{
|
||||
{
|
||||
|
||||
$query = $this->db->query('SELECT DriverName,DriverMobileNumber
|
||||
$query = $this->db->query('SELECT DriverName,DriverMobileNumber
|
||||
FROM t_igr_master
|
||||
WHERE DriverName != ""
|
||||
GROUP BY DriverName,DriverMobileNumber');
|
||||
@ -1355,51 +1375,55 @@ $builder = $this->db->table('t_igr_history')
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getigrstatus($IGRNo){
|
||||
public function getigrstatus($IGRNo)
|
||||
{
|
||||
|
||||
$builder = $this->db->table('t_igr_master')
|
||||
->select('IGRStatus')
|
||||
->where('IGRNO',$IGRNo)
|
||||
->get();
|
||||
->select('IGRStatus')
|
||||
->where('IGRNO', $IGRNo)
|
||||
->get();
|
||||
$result = $builder->getRow();
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function get_status($value){
|
||||
public function get_status($value)
|
||||
{
|
||||
$builder = $this->db->table('t_status')
|
||||
->select('StatusCode,StatusName')
|
||||
->where('StatusCode', $value);
|
||||
->select('StatusCode,StatusName')
|
||||
->where('StatusCode', $value);
|
||||
|
||||
$query = $builder->get()->getRow();
|
||||
$query = $builder->get()->getRow();
|
||||
|
||||
$StatusName = $query ? $query->StatusName : null;
|
||||
return $StatusName;
|
||||
$StatusName = $query ? $query->StatusName : null;
|
||||
return $StatusName;
|
||||
}
|
||||
|
||||
public function get_TransporterId($value){
|
||||
public function get_TransporterId($value)
|
||||
{
|
||||
$builder = $this->db->table('t_transporter')
|
||||
->select('id,name')
|
||||
->where('id', $value);
|
||||
->select('id,name')
|
||||
->where('id', $value);
|
||||
|
||||
$query = $builder->get()->getRow();
|
||||
$query = $builder->get()->getRow();
|
||||
|
||||
$transportername = $query ? $query->name : null;
|
||||
return $transportername;
|
||||
$transportername = $query ? $query->name : null;
|
||||
return $transportername;
|
||||
}
|
||||
|
||||
//Mcat -materialCategory
|
||||
public function getIgrDetailsListByMcatGas($gasMaterialCodes,$gas_status){
|
||||
public function getIgrDetailsListByMcatGas($gasMaterialCodes, $gas_status)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
switch ($gas_status) {
|
||||
switch ($gas_status) {
|
||||
|
||||
|
||||
case "gas_entered":
|
||||
case "gas_entered":
|
||||
|
||||
$builder = $this->db->table('t_igr_details as t_igrd')
|
||||
->select("
|
||||
$builder = $this->db->table('t_igr_details as t_igrd')
|
||||
->select("
|
||||
t_igrd.IGRNO as IGRNO-,
|
||||
(t_igrd.QuantityAsPerInvoice) as gasCylinderCount,
|
||||
t_sd.SupplierName,
|
||||
@ -1407,25 +1431,25 @@ $builder = $this->db->table('t_igr_history')
|
||||
t_mm.MaterialName,
|
||||
t_gsd.*
|
||||
")
|
||||
->join('t_igr_master t_igrm', 't_igrm.IGRNO = t_igrd.IGRNO')
|
||||
->join('t_purchaseorder_master t_pom', 't_igrm.PONO = t_pom.PONO', 'left')
|
||||
->join('t_supplierdetailsn t_sd', 't_sd.SupplierID = t_pom.SupplierID')
|
||||
->join('t_igr_master t_igrm', 't_igrm.IGRNO = t_igrd.IGRNO')
|
||||
->join('t_purchaseorder_master t_pom', 't_igrm.PONO = t_pom.PONO', 'left')
|
||||
->join('t_supplierdetailsn t_sd', 't_sd.SupplierID = t_pom.SupplierID')
|
||||
|
||||
->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', 'left')
|
||||
->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', 'left')
|
||||
|
||||
->join('t_materialmaster t_mm','t_mm.MaterialCode = t_igrd.MaterialCode','left')
|
||||
->whereIn('t_igrd.MaterialCode', $gasMaterialCodes)
|
||||
->where("DATE(t_igrd.CreatedDate) >= '2025-04-01' ")
|
||||
->join('t_materialmaster t_mm', 't_mm.MaterialCode = t_igrd.MaterialCode', 'left')
|
||||
->whereIn('t_igrd.MaterialCode', $gasMaterialCodes)
|
||||
->where("DATE(t_igrd.CreatedDate) >= '2025-04-01' ")
|
||||
|
||||
->where('t_gsd.gas_cylinder_status IS NULL');
|
||||
->where('t_gsd.gas_cylinder_status IS NULL');
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
|
||||
case "gas_pending":
|
||||
case "gas_pending":
|
||||
|
||||
$builder = $this->db->table('t_igr_details as t_igrd')
|
||||
->select("
|
||||
$builder = $this->db->table('t_igr_details as t_igrd')
|
||||
->select("
|
||||
t_igrd.IGRNO as IGRNO-,
|
||||
(t_igrd.QuantityAsPerInvoice) as gasCylinderCount,
|
||||
t_sd.SupplierName,
|
||||
@ -1433,26 +1457,26 @@ $builder = $this->db->table('t_igr_history')
|
||||
t_mm.MaterialName,
|
||||
t_gsd.*
|
||||
")
|
||||
->join('t_igr_master t_igrm', 't_igrm.IGRNO = t_igrd.IGRNO')
|
||||
->join('t_purchaseorder_master t_pom', 't_igrm.PONO = t_pom.PONO', 'left')
|
||||
->join('t_supplierdetailsn t_sd', 't_sd.SupplierID = t_pom.SupplierID')
|
||||
->join('t_igr_master t_igrm', 't_igrm.IGRNO = t_igrd.IGRNO')
|
||||
->join('t_purchaseorder_master t_pom', 't_igrm.PONO = t_pom.PONO', 'left')
|
||||
->join('t_supplierdetailsn t_sd', 't_sd.SupplierID = t_pom.SupplierID')
|
||||
|
||||
->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', 'left')
|
||||
->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', 'left')
|
||||
|
||||
->join('t_materialmaster t_mm','t_mm.MaterialCode = t_igrd.MaterialCode','left')
|
||||
->whereIn('t_igrd.MaterialCode', $gasMaterialCodes)
|
||||
->where("DATE(t_igrd.CreatedDate) >= '2025-04-01' ")
|
||||
->join('t_materialmaster t_mm', 't_mm.MaterialCode = t_igrd.MaterialCode', 'left')
|
||||
->whereIn('t_igrd.MaterialCode', $gasMaterialCodes)
|
||||
->where("DATE(t_igrd.CreatedDate) >= '2025-04-01' ")
|
||||
|
||||
->where('t_gsd.gas_cylinder_status','gas_pending');
|
||||
->where('t_gsd.gas_cylinder_status', 'gas_pending');
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case "gas_returned":
|
||||
case "gas_returned":
|
||||
|
||||
$builder = $this->db->table('t_igr_details as t_igrd')
|
||||
->select("
|
||||
$builder = $this->db->table('t_igr_details as t_igrd')
|
||||
->select("
|
||||
t_igrd.IGRNO as IGRNO-,
|
||||
(t_igrd.QuantityAsPerInvoice) as gasCylinderCount,
|
||||
t_sd.SupplierName,
|
||||
@ -1467,34 +1491,28 @@ $builder = $this->db->table('t_igr_history')
|
||||
Count(t_gsd.gas_cylinder_status) as gasCylinderCompletedCount,
|
||||
(t_igrd.QuantityAsPerInvoice - Count(t_gsd.gas_cylinder_status)) as gasCylinderPendingCount
|
||||
")
|
||||
->join('t_igr_master t_igrm', 't_igrm.IGRNO = t_igrd.IGRNO')
|
||||
->join('t_purchaseorder_master t_pom', 't_igrm.PONO = t_pom.PONO', 'left')
|
||||
->join('t_supplierdetailsn t_sd', 't_sd.SupplierID = t_pom.SupplierID')
|
||||
->join('t_igr_master t_igrm', 't_igrm.IGRNO = t_igrd.IGRNO')
|
||||
->join('t_purchaseorder_master t_pom', 't_igrm.PONO = t_pom.PONO', 'left')
|
||||
->join('t_supplierdetailsn t_sd', 't_sd.SupplierID = t_pom.SupplierID')
|
||||
|
||||
->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', 'left')
|
||||
->join('t_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', 'left')
|
||||
|
||||
->join('t_materialmaster t_mm','t_mm.MaterialCode = t_igrd.MaterialCode','left')
|
||||
->whereIn('t_igrd.MaterialCode', $gasMaterialCodes)
|
||||
->where("DATE(t_igrd.CreatedDate) >= '2025-04-01' ")
|
||||
->join('t_materialmaster t_mm', 't_mm.MaterialCode = t_igrd.MaterialCode', 'left')
|
||||
->whereIn('t_igrd.MaterialCode', $gasMaterialCodes)
|
||||
->where("DATE(t_igrd.CreatedDate) >= '2025-04-01' ")
|
||||
|
||||
->where('t_gsd.gas_cylinder_status','gas_returned')
|
||||
->where('t_gsd.gas_cylinder_status', 'gas_returned')
|
||||
|
||||
->groupBy('t_igrd.IGRNO');
|
||||
->groupBy('t_igrd.IGRNO');
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$result = $builder->get()->getResultArray();
|
||||
$result = $builder->get()->getResultArray();
|
||||
|
||||
|
||||
|
||||
return $result;
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -234,28 +234,41 @@ $currentday = date('d');
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card" id="fullscreenDiv">
|
||||
|
||||
<div class="card-body">
|
||||
<div id="successMessage" style="display: none; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);background: green; color: white; padding: 10px; border-radius: 5px; z-index: 1000;"></div>
|
||||
<?php
|
||||
$attributes = array('id' => 'atten');
|
||||
echo form_open('attendance', $attributes); ?>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-2">
|
||||
<?php $today = date('M-Y'); ?>
|
||||
<input type="text" name="month" id="month" value="<?php echo $datefordropdown; ?>" class="form-control" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1">
|
||||
|
||||
<div class="col-md-2">
|
||||
<?php $today = date('M-Y'); ?>
|
||||
<input type="text" name="month" id="month" value="<?php echo $datefordropdown; ?>" class="form-control" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1">
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<input type="submit" value="Change Month" class="btn btn-success"
|
||||
title='click here for load attendance for specified month' style="margin-top:0px;">
|
||||
</div>
|
||||
<div class="col-1 text-right">
|
||||
<i id="exportButton" class="fas fa-download download-icon" style="font-size: x-large; margin-top:12px;" title="Export Excel"></i>
|
||||
</div>
|
||||
<div class="col-8 text-right">
|
||||
<input type="button" class="btn btn-success" id="c" value="save" style="margin-top:0px;">
|
||||
|
||||
<div class="col-9 text-right d-flex" style="justify-content: end;" id="savebutton">
|
||||
|
||||
<input type="text" id="searchInput" placeholder="Search..." style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc;border-radius: 5px;margin-right:15px;">
|
||||
|
||||
|
||||
|
||||
|
||||
<i id="exportButton" class="fas fa-download download-icon" style="margin-right: 15px;margin-top: 8px;font-size:25px;" title="Export Excel"></i>
|
||||
|
||||
<i class="fe-maximize noti-icon" onclick="toggleDivFullscreen()" style="margin-right: 15px;margin-top: 5px;font-size: 28px;" title="Full screen view"></i>
|
||||
|
||||
<i class="fas fa-save" id="c" style="margin-right: 15px;margin-top: 5px;font-size:28px;" title="Save"></i>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php echo form_close(); ?>
|
||||
|
||||
@ -279,7 +292,7 @@ $currentday = date('d');
|
||||
?>
|
||||
|
||||
<!-- Add table-responsive for horizontal scroll -->
|
||||
<div class="table-responsive">
|
||||
<div class="table-responsive" id="table-responsive">
|
||||
|
||||
|
||||
<table id="attendance" class="fht-table table table-striped" style="font-size: small;">
|
||||
@ -541,11 +554,7 @@ $currentday = date('d');
|
||||
|
||||
|
||||
</div><!-- End table-responsive -->
|
||||
<!-- <div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<input type="button" class="btn btn-success" id="c" value="save">
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
|
||||
</div> <!-- End card-body -->
|
||||
@ -563,7 +572,7 @@ $currentday = date('d');
|
||||
|
||||
|
||||
|
||||
<!-- <script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script> -->
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
@ -571,60 +580,57 @@ $currentday = date('d');
|
||||
// Click event for the button
|
||||
$('#c').click(function() {
|
||||
|
||||
var s = findInvalidData();
|
||||
var s = findInvalidData();
|
||||
|
||||
//alert(s);
|
||||
if (s == 0) {
|
||||
//alert(s);
|
||||
if (s == 0) {
|
||||
|
||||
resetFinalValues();
|
||||
var Totalnoofdays = <?php echo $monthdays ?>;
|
||||
var alldata = $("#attendance").tableToJSON();
|
||||
resetFinalValues();
|
||||
var Totalnoofdays = <?php echo $monthdays ?>;
|
||||
var alldata = $("#attendance").tableToJSON();
|
||||
|
||||
alldata = JSON.stringify(alldata);
|
||||
alldata = JSON.stringify(alldata);
|
||||
|
||||
|
||||
var month = $('#month').val();
|
||||
var currentmonth = month.substr(0, 3);
|
||||
var currentyear = month.substr(4, 4);
|
||||
var month = $('#month').val();
|
||||
var currentmonth = month.substr(0, 3);
|
||||
var currentyear = month.substr(4, 4);
|
||||
|
||||
var montharray = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
||||
var currentmonth = jQuery.inArray(currentmonth, montharray); //!== -1
|
||||
currentmonth++;
|
||||
var montharray = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
||||
var currentmonth = jQuery.inArray(currentmonth, montharray); //!== -1
|
||||
currentmonth++;
|
||||
|
||||
|
||||
var currentdate = '01-' + currentmonth + '-' + currentyear;
|
||||
var currentdate = '01-' + currentmonth + '-' + currentyear;
|
||||
|
||||
var totaldata = 0;
|
||||
var totaldata = 0;
|
||||
|
||||
$('#loader').show();
|
||||
$.ajax({
|
||||
data: {
|
||||
param1: alldata,
|
||||
param2: currentdate,
|
||||
param3: Totalnoofdays
|
||||
},
|
||||
//dataType:"json",
|
||||
type: "POST",
|
||||
url: "<?php echo base_url() ?>monthlypay/saveAttendance",
|
||||
showMessage('Processing , Please wait a moment....');
|
||||
$.ajax({
|
||||
data: {
|
||||
param1: alldata,
|
||||
param2: currentdate,
|
||||
param3: Totalnoofdays
|
||||
},
|
||||
//dataType:"json",
|
||||
type: "POST",
|
||||
url: "<?php echo base_url() ?>monthlypay/saveAttendance",
|
||||
|
||||
success: function(data) {
|
||||
if (data) {
|
||||
success: function(data) {
|
||||
if (data) {
|
||||
|
||||
$('#loader').hide();
|
||||
alert(data);
|
||||
//totaldata = totaldata + parseFloat(data);
|
||||
//console.log(data);
|
||||
showMessage(data);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
alert('Plesae Provide Working Hrs and OT Hrs Correctly..!');
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
alert('Plesae Provide Working Hrs and OT Hrs Correctly..!');
|
||||
}
|
||||
}); });
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
|
||||
@ -695,10 +701,7 @@ $(document).ready(function () {
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
// $("#attendance").CongelarFilaColumna({
|
||||
// lboHoverTr: true
|
||||
// });
|
||||
$('html').bind('keypress', function(e) {
|
||||
$('table').bind('keypress', function(e) {
|
||||
|
||||
|
||||
if (((e.which || e.keyCode) == 8) || ((e.which || e.keyCode) == 9) || ((e.which || e.keyCode) ==
|
||||
@ -1044,4 +1047,60 @@ $(document).ready(function () {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function toggleDivFullscreen() {
|
||||
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%";
|
||||
|
||||
// Reset .table-responsive height when exiting fullscreen
|
||||
if (tableResponsive) {
|
||||
tableResponsive.style.height = "auto";
|
||||
}
|
||||
}).catch(err => console.log("Error exiting fullscreen:", err));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function showMessage(msg) {
|
||||
let msgBox = document.getElementById("successMessage");
|
||||
msgBox.innerText = msg; // Set API message
|
||||
msgBox.style.display = "block";
|
||||
|
||||
// Hide message after 3 seconds
|
||||
setTimeout(() => {
|
||||
msgBox.style.display = "none";
|
||||
}, 3000);
|
||||
}
|
||||
$(document).ready(function() {
|
||||
document.getElementById("searchInput").addEventListener("input", function () {
|
||||
this.value = this.value.replace(/[^a-zA-Z0-9 ]/g, ''); // Allows letters, numbers, and spaces
|
||||
});
|
||||
});
|
||||
|
||||
$("#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);
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
@ -113,7 +113,7 @@ if ($total <= $reorder) {
|
||||
<div class="col-12">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">Edit Material - <?php echo $MaterialCode; ?> Details</h4>
|
||||
<button type="button" class="btn btn-secondary" onclick="window.location.href='<?= base_url() ?>rawmaterialListing'">
|
||||
<button type="button" class="btn btn-secondary" onclick="window.location.href='<?= base_url() ?>rawmaterialListing?materialListPage=<?= $materialListPage ?>'">
|
||||
<span class="bold">Cancel</span>
|
||||
</button>
|
||||
</div>
|
||||
@ -361,10 +361,12 @@ if ($total <= $reorder) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer text-right">
|
||||
<button type="button" class="btn btn-secondary" onclick="window.location.href='<?= base_url() ?>rawmaterialListing'">
|
||||
<button type="button" class="btn btn-secondary" onclick="window.location.href='<?= base_url() ?>rawmaterialListing?materialListPage=<?= $materialListPage ?>'">
|
||||
<span class="bold">Cancel</span>
|
||||
</button>
|
||||
<input type="button" id="editRawMaterialBtnId" class="btn btn-success" value="Submit" />
|
||||
|
||||
<input type="hidden" id="materialListPage" name="materialListPage" value="<?php echo $materialListPage; ?>" />
|
||||
</div>
|
||||
</form>
|
||||
</div><!-- /.card-body -->
|
||||
|
||||
@ -128,21 +128,6 @@
|
||||
<div class="card-body" >
|
||||
<div id="successMessage" style="display: none; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);background: green; color: white; padding: 10px; border-radius: 5px; z-index: 1000;"></div>
|
||||
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<!--<center><h3 class="box-title">-->
|
||||
<div class="box-tools">
|
||||
|
||||
<!-- <p><b>
|
||||
The <span style="background-color:#ff4d4d;">Red</span> highlighted Employee have loan
|
||||
to pay. Put <span style="background-color:#66ff33;">'NA'</span> for Skip Current
|
||||
Month Loan Due.
|
||||
</b></p> -->
|
||||
|
||||
</div>
|
||||
<!--</h3></center>-->
|
||||
|
||||
</div><!-- /.box-header -->
|
||||
<?php
|
||||
|
||||
$year = date("Y");
|
||||
@ -944,7 +929,7 @@ $(document).ready(function () {
|
||||
alldata = JSON.stringify(alldata);
|
||||
var month = $('#monthyear').val();
|
||||
|
||||
$('#loader').show();
|
||||
showMessage('Processing , Please wait a moment....');
|
||||
$.ajax({
|
||||
data: {
|
||||
param1: alldata,
|
||||
@ -956,8 +941,7 @@ $(document).ready(function () {
|
||||
success: function(data) {
|
||||
|
||||
if (data) {
|
||||
$('#loader').hide();
|
||||
// alert(data);
|
||||
|
||||
showMessage(data);
|
||||
}
|
||||
|
||||
@ -1033,7 +1017,7 @@ $(document).ready(function () {
|
||||
var lopDay = parseFloat(document.getElementById('lopDay' + sno).textContent);
|
||||
var paidLeave = parseFloat(document.getElementById('paidLeave' + sno).textContent);
|
||||
var otHrsWork = parseFloat(document.getElementById('otHrsWork' + sno).textContent);
|
||||
var monthDue = parseFloat(document.getElementById('monthDue' + sno).textContent);
|
||||
var monthDue = parseFloat(document.getElementById('monthDue' + sno).textContent) || 0;
|
||||
var duedate = document.getElementById('duedate' + sno).value;
|
||||
duedate = new Date(duedate);
|
||||
var paydate = document.getElementById('paydate').value;
|
||||
@ -1045,9 +1029,9 @@ $(document).ready(function () {
|
||||
var pday = new Date(pyearonly, pmonthonly, 0).getDate();
|
||||
var finalpaydate = pyearonly + '-' + pmonthonly + '-' + pday;
|
||||
finalpaydate = new Date(finalpaydate);
|
||||
var otherDet = parseFloat(document.getElementById('otherDet' + sno).textContent);
|
||||
var otherDet = parseFloat(document.getElementById('otherDet' + sno).textContent) || 0;
|
||||
totalotherDet[sno] = otherDet;
|
||||
var Festival = parseFloat(document.getElementById('Festival' + sno).textContent);
|
||||
var Festival = parseFloat(document.getElementById('Festival' + sno).textContent) || 0;
|
||||
totalfestival[sno] = Festival;
|
||||
var empsal = parseFloat(document.getElementById('empsal' + sno).textContent);
|
||||
var bpay = parseFloat(document.getElementById('bPay' + sno).value);
|
||||
@ -1208,7 +1192,7 @@ $(document).ready(function () {
|
||||
var basicsalary = parseFloat(document.getElementById('bassalary' + sno).textContent);
|
||||
var hrasalary = parseFloat(document.getElementById('hrasalary' + sno).textContent);
|
||||
|
||||
var Festivals = parseFloat(document.getElementById('Festival' + sno).textContent);
|
||||
var Festivals = parseFloat(document.getElementById('Festival' + sno).textContent) || 0;
|
||||
totalfestival[sno] = Festivals;
|
||||
|
||||
var ESI = parseFloat(document.getElementById('esiAmt' + sno).textContent);
|
||||
@ -1219,7 +1203,7 @@ $(document).ready(function () {
|
||||
var loanamt = parseFloat(element.value);
|
||||
|
||||
var paidamt = parseFloat(document.getElementById('paidamt' + sno).value);
|
||||
var monthDue = parseFloat(document.getElementById('monthDue' + sno).textContent);
|
||||
var monthDue = parseFloat(document.getElementById('monthDue' + sno).textContent) || 0;
|
||||
var duedate = document.getElementById('duedate' + sno).value;
|
||||
|
||||
duedate = new Date(duedate);
|
||||
|
||||
@ -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');
|
||||
@ -67,6 +76,9 @@
|
||||
$type = "success";
|
||||
echo show_alert($type, $success);
|
||||
}
|
||||
|
||||
$materialListPage = session()->getFlashdata('materialListPage') ?? $_GET['materialListPage'] ?? 1;
|
||||
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
@ -74,7 +86,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 +128,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" : " " ?>
|
||||
@ -200,6 +210,7 @@
|
||||
<?php } else { ?>
|
||||
|
||||
<a class="a_tag_link"
|
||||
onclick="editMaterial(event)"
|
||||
href="<?php echo base_url() . 'viewRawmaterial?RID=' . $record->MaterialCode . '&MType=' . $record->MaterialType . '&UOM=' . $record->UOM . '&date1=' . $date ?>"
|
||||
data-toggle="tooltip"
|
||||
title="<?php echo $record->MaterialCode; ?> - Click here to view Material details"><i
|
||||
@ -407,6 +418,30 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
|
||||
// Ensure the saved page is a valid number
|
||||
let savedPage =<?= $materialListPage ?? 0 ?>; // Default to 1 if not set
|
||||
|
||||
savedPage = savedPage -1 ;
|
||||
|
||||
|
||||
if (!isNaN(savedPage)) {
|
||||
// Check if the DataTable is initialized
|
||||
if ($.fn.DataTable.isDataTable('#raw_material_list_table')) {
|
||||
var dataTable = $('#raw_material_list_table').DataTable();
|
||||
|
||||
// Get the total number of pages in DataTable
|
||||
var totalPages = dataTable.page.info().pages;
|
||||
|
||||
// Ensure the page number is within range
|
||||
if (savedPage >= totalPages) {
|
||||
savedPage = totalPages > 0 ? totalPages - 1 : 0;
|
||||
}
|
||||
|
||||
// Set DataTable to the saved page
|
||||
dataTable.page(savedPage).draw(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Date range filter function
|
||||
// $.fn.dataTable.ext.search.push(
|
||||
// function (settings, data, dataIndex) {
|
||||
@ -535,10 +570,31 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
function editMaterial(event) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
const targetElement = event.currentTarget;
|
||||
|
||||
let href = $(targetElement).attr('href');
|
||||
|
||||
let paginationNumber = $('#raw_material_list_table').DataTable().page.info().page + 1; // Get the current page number from dataTable
|
||||
|
||||
href += '&page=' + paginationNumber;
|
||||
|
||||
// Update the 'href' attribute of the target element
|
||||
$(targetElement).attr('href', href);
|
||||
|
||||
window.location.href = href;
|
||||
|
||||
}
|
||||
|
||||
function deleteMaterial(mid) {
|
||||
|
||||
var answer = confirm(" Do you want to delete the Material from the List?")
|
||||
|
||||
@ -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,7 +1096,9 @@
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<br>
|
||||
@ -1093,6 +1106,12 @@
|
||||
<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>
|
||||
|
||||
@ -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));
|
||||
}
|
||||
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -1733,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));
|
||||
}
|
||||
|
||||
@ -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>
|
||||
@ -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>
|
||||
@ -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));
|
||||
}
|
||||
|
||||
@ -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));
|
||||
}
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -1448,7 +1448,7 @@
|
||||
<!-- Save All Data in Incoming Silica Sand Details from table -->
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#save').click(function() {
|
||||
$('#saveId').click(function() {
|
||||
|
||||
var incomingSilicaSandDetailsData = incomingSilicaSandTableToJson();
|
||||
|
||||
@ -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));
|
||||
}
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
@ -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="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;" >
|
||||
|
||||
<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;">
|
||||
|
||||
|
||||
<?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>
|
||||
|
||||
<i class="fa fa-download btn-lg mt-2"
|
||||
title="Excel Download"
|
||||
style="font-size: x-large; cursor:pointer;"
|
||||
id="resinStockExport">
|
||||
</i>
|
||||
|
||||
<i class="fe-maximize noti-icon btn-lg mt-2"
|
||||
title="Full Screen"
|
||||
style="font-size: x-large; cursor:pointer;"
|
||||
onclick="toggleDivFullscreen()" >
|
||||
</i>
|
||||
|
||||
|
||||
<i class="fas fa-save btn-lg mt-2"
|
||||
title="Save"
|
||||
style="font-size: x-large; cursor:pointer;"
|
||||
id="saveId" >
|
||||
</i>
|
||||
|
||||
</div>
|
||||
<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>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
<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: 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; color:rgb(95, 102, 105)"
|
||||
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; 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>
|
||||
|
||||
</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>
|
||||
|
||||
@ -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;
|
||||
@ -1104,12 +1105,12 @@ foreach ($period as $day) {
|
||||
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();
|
||||
}
|
||||
@ -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 (!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 .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 (tableResponsive) {
|
||||
tableResponsive.style.height = "auto";
|
||||
}
|
||||
}).catch(err => console.log("Error exiting fullscreen:", err));
|
||||
// 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>
|
||||
|
||||
|
||||
@ -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));
|
||||
}
|
||||
|
||||
@ -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));
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user