From 0c61c66b36e8905b8923fb78e229108a124ac3a5 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sat, 5 Apr 2025 17:33:30 +0530 Subject: [PATCH 1/7] stock changes 05-04-2025 --- app/Views/rawmaterialListing.php | 19 ++++-- app/Views/stock/CoatingMachineDetail.php | 68 ++++++++++++++----- app/Views/stock/bagStockDetails.php | 12 ++-- app/Views/stock/dieselStockDetails.php | 8 ++- app/Views/stock/drierMachineDetails.php | 63 +++++++++++++---- app/Views/stock/dustAndRoughStockDetails.php | 12 ++-- app/Views/stock/gasStockDetails.php | 25 ++++--- app/Views/stock/incomingSilicaSandDetails.php | 6 +- app/Views/stock/powerConsumptionDetails.php | 19 ++++-- app/Views/stock/resinStockDetails.php | 26 +++---- app/Views/stock/trpProductionStockDetails.php | 18 +++-- app/Views/stock/trpSandUseStockDetails.php | 12 ++-- 12 files changed, 197 insertions(+), 91 deletions(-) diff --git a/app/Views/rawmaterialListing.php b/app/Views/rawmaterialListing.php index 10b57846..4ea7e148 100755 --- a/app/Views/rawmaterialListing.php +++ b/app/Views/rawmaterialListing.php @@ -49,11 +49,20 @@
-
+

Material Master Details

+
+ +
-
+
@@ -116,12 +125,10 @@
- +
-
+
diff --git a/app/Views/stock/CoatingMachineDetail.php b/app/Views/stock/CoatingMachineDetail.php index 2305db33..bc775cee 100644 --- a/app/Views/stock/CoatingMachineDetail.php +++ b/app/Views/stock/CoatingMachineDetail.php @@ -429,7 +429,9 @@
-
@@ -650,7 +652,7 @@
-
@@ -944,8 +946,8 @@ Total Coating Total Coating Sand(kg) Total Gas Consumption - Hour Gas - Hour QTY(kg) + Per Hour Gas + Per Hour QTY(kg) Action @@ -984,7 +986,8 @@ - + @@ -994,9 +997,9 @@ - + - + @@ -1069,8 +1072,8 @@ - (avg) - (avg) + (A) + (A) @@ -1085,14 +1088,22 @@ -
- + + +
+
No Coating Machine Details present in this month
+ +
+

Note :- (A) -> Average

+ + + @@ -1838,8 +1849,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 +1925,26 @@ + + diff --git a/app/Views/stock/bagStockDetails.php b/app/Views/stock/bagStockDetails.php index f819e15e..4fd3fc3f 100644 --- a/app/Views/stock/bagStockDetails.php +++ b/app/Views/stock/bagStockDetails.php @@ -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 */ @@ -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)); } diff --git a/app/Views/stock/dieselStockDetails.php b/app/Views/stock/dieselStockDetails.php index 08e5781a..abefaa59 100644 --- a/app/Views/stock/dieselStockDetails.php +++ b/app/Views/stock/dieselStockDetails.php @@ -213,7 +213,7 @@ background-color: #50bbd9; /* Green background */ color: #ffffff; - border: 1px solid #ddd; + border: 2px solid ; padding: 10px; } @@ -1733,8 +1733,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)); } diff --git a/app/Views/stock/drierMachineDetails.php b/app/Views/stock/drierMachineDetails.php index 3e2976ef..c48584fb 100644 --- a/app/Views/stock/drierMachineDetails.php +++ b/app/Views/stock/drierMachineDetails.php @@ -462,7 +462,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
- + @@ -618,7 +618,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
@@ -752,7 +752,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
- + @@ -867,22 +867,22 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); - + - + - + - + @@ -942,7 +942,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 +965,8 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); - - - + (A) + (A) @@ -979,7 +982,12 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');

- + +
+

Note :- (A) -> Average

+ + + @@ -1471,8 +1479,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 +1553,27 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); + + + \ No newline at end of file diff --git a/app/Views/stock/dustAndRoughStockDetails.php b/app/Views/stock/dustAndRoughStockDetails.php index 331eb25e..5f545965 100644 --- a/app/Views/stock/dustAndRoughStockDetails.php +++ b/app/Views/stock/dustAndRoughStockDetails.php @@ -217,7 +217,7 @@ background-color: #50bbd9; /* Green background */ color: #ffffff; - border: 1px solid #ddd; + border: 2px solid ; padding: 10px; } @@ -342,7 +342,7 @@
-
+
" class="form-control " @@ -394,7 +394,7 @@
-
+
@@ -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)); } diff --git a/app/Views/stock/gasStockDetails.php b/app/Views/stock/gasStockDetails.php index 029b2079..e2253d7d 100644 --- a/app/Views/stock/gasStockDetails.php +++ b/app/Views/stock/gasStockDetails.php @@ -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; } @@ -453,16 +453,15 @@ RIPL Gas Stock - FBD 10 Ton Dryer - Sand Dried - Coating Machine - Sand Coated - TRP + FBD 10 Ton Dryer + Coating Machine + TRP Sand TRP Rotary Drier + Date Opening Stock Purchase(Bharath) @@ -470,10 +469,12 @@ Total Consumption Balance Stock + + Consumption - Ton + Sand Dried Qty Consumption - Ton + Sand Coated Qty Panel Consumption Physical Consumption Ton @@ -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)); } diff --git a/app/Views/stock/incomingSilicaSandDetails.php b/app/Views/stock/incomingSilicaSandDetails.php index 7a015ea9..9a22384a 100644 --- a/app/Views/stock/incomingSilicaSandDetails.php +++ b/app/Views/stock/incomingSilicaSandDetails.php @@ -1958,8 +1958,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)); } diff --git a/app/Views/stock/powerConsumptionDetails.php b/app/Views/stock/powerConsumptionDetails.php index 3d052ec8..3db3d7d1 100644 --- a/app/Views/stock/powerConsumptionDetails.php +++ b/app/Views/stock/powerConsumptionDetails.php @@ -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; + } + @@ -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;"'; } ?>> @@ -1617,14 +1622,16 @@ foreach ($period as $day) { tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed } }).catch(err => console.log("Error enabling fullscreen:", err)); - } else { + } 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)); } diff --git a/app/Views/stock/resinStockDetails.php b/app/Views/stock/resinStockDetails.php index e06bc111..0663ac6f 100644 --- a/app/Views/stock/resinStockDetails.php +++ b/app/Views/stock/resinStockDetails.php @@ -213,7 +213,7 @@ background-color: #50bbd9; /* Green background */ color: #ffffff; - border: 1px solid #ddd; + border: 2px solid ; padding: 10px; } @@ -583,7 +583,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;"'; } ?>> $resinStock) { @@ -705,7 +705,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 ;"'; } ?>> console.log("Error enabling fullscreen:", err)); } else { - document.exitFullscreen().then(() => { - div.style.width = "100%"; - div.style.height = "100%"; + 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 () { diff --git a/app/Views/stock/trpProductionStockDetails.php b/app/Views/stock/trpProductionStockDetails.php index 194b1364..f6e7ceac 100644 --- a/app/Views/stock/trpProductionStockDetails.php +++ b/app/Views/stock/trpProductionStockDetails.php @@ -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; + } + + @@ -2566,12 +2572,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)); } diff --git a/app/Views/stock/trpSandUseStockDetails.php b/app/Views/stock/trpSandUseStockDetails.php index cdaa356b..c3e9efe8 100644 --- a/app/Views/stock/trpSandUseStockDetails.php +++ b/app/Views/stock/trpSandUseStockDetails.php @@ -202,7 +202,7 @@ background-color: #50bbd9; /* Green background */ color: #ffffff; - border: 1px solid #ddd; + border: 2px solid ; padding: 10px; } @@ -328,7 +328,7 @@
-
+
" class="form-control " @@ -380,7 +380,7 @@
-
+
@@ -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)); } From 0289595c8605b1d9cb2beb27fab446d9c0cd03b9 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sun, 6 Apr 2025 09:04:58 +0530 Subject: [PATCH 2/7] stock changes 06-04-2025 --- app/Models/Inwardgateregister_model.php | 723 ++++++++++++------------ 1 file changed, 372 insertions(+), 351 deletions(-) diff --git a/app/Models/Inwardgateregister_model.php b/app/Models/Inwardgateregister_model.php index dfda37a3..b7e1fb70 100755 --- a/app/Models/Inwardgateregister_model.php +++ b/app/Models/Inwardgateregister_model.php @@ -6,7 +6,7 @@ use CodeIgniter\Model; class Inwardgateregister_model extends Model { - + function updatefile($bill, $Picture, $oldfile) { @@ -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,12 +41,12 @@ 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; } - + /*------------------------------------------------------------*/ function addMaterialStockHistory($MaterialstockHistoryadd) @@ -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; - - return $temp; + + $query = $builder->get(); + $temparr[] = ''; + foreach ($query->getResult() as $arr) { + $temparr[] = $arr->DriverMobileNumber; + } + // echo $this->db->getLastQuery()->getQuery();die; + $temp['suggestions'] = $temparr; + + return $temp; } function viewpurchaseorder($PO) @@ -205,7 +207,7 @@ class Inwardgateregister_model extends Model $query = $this->db->query($subQuery, [$PO]); - + return $query->getResult(); /* @@ -219,49 +221,52 @@ class Inwardgateregister_model extends Model $result = $query->getResult(); return $result; */ } - - public function igr_history($hsty_arr) { - - $keysToRemove = ["UpdateBY","UpdateBy", "MaterialRcvdDate", "DeliveryChellanDate"]; - + + public function igr_history($hsty_arr) + { + + $keysToRemove = ["UpdateBY", "UpdateBy", "MaterialRcvdDate", "DeliveryChellanDate"]; + foreach ($keysToRemove as $key) { if (isset($hsty_arr[$key])) { unset($hsty_arr[$key]); } } - + $builder = $this->db->table('t_igr_history'); $builder->insert($hsty_arr); 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(); - log_message('error', 'addigrD Query: ' . $this->db->getLastQuery()->getQuery()); - $this->db->transComplete(); - + $aff_row = $this->db->affectedRows(); + log_message('error', 'addigrD Query: ' . $this->db->getLastQuery()->getQuery()); + $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,31 +458,30 @@ 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'); + } - } - - - - $query = $builder->get(); + + + $query = $builder->get(); $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,59 +502,59 @@ 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(); + ->orderBy('igr.CreatedDate', 'desc'); + $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]; + } + function viewigr($IGRNO) @@ -559,7 +563,7 @@ class Inwardgateregister_model extends Model // ->select('igrd.IGRItemNo','igrd.IGRNO','igrd.MaterialCode','igrd.QuantityAsPerInvoice') // ->select('igrd.Remarks','igrd.IGRItemStatus','igrd.CancelNote','igrd.BankStatus') // ->select('MM.MaterialName,MM.UOM,sup.Address,sup.SupplierName,POM.ServiceDescription,POL.Quantity,POM.POType') - + $builder = $this->db->table('t_igr_master igr') ->distinct() ->select(" @@ -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,16 +973,16 @@ 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,147 @@ class Inwardgateregister_model extends Model } public function ViewIGRHistory($igr) - { - $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 = $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->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->orderBy('t_igr_history.history_dated', 'asc'); + // $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->select('t_purchaseorder_lineitem.ReqNo,reqMaster.CostCenterCode,CSMaster.CostCenterName'); + { + $builder = $this->db->table('t_purchaseorder_lineitem'); + + $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(); + $query = $builder->get(); + $result = $query->getResult(); return $result; - - - } + } public function getAllIgrFileDetails($igrno) - { - - // Query 1: Get FilePath and Remarks from t_inwardgateregister_fileupload + { + + // 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(); + $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 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(); + // 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); + // Merging results into a single array + $results = array_merge($result1, $result2, $result3); - return $results; - } + return $results; + } public function transporter() - { + { $builder = $this->db->table('t_transporter t'); - $query = $builder->select('t.*')->get(); - $result = $query->getResult(); + $query = $builder->select('t.*')->get(); + $result = $query->getResult(); return $result; } - public function findIgrDetailsForIncomingSilicaSand($materialCodes, $month ,$remark) - { - $builder = $this->db->table('t_igr_details') - ->select( - 't_igr_details.IGRNO, - t_igr_details.MaterialCode, - igrMast.DeliveryChellanOrInvoiceNo as invoiceNo, - igrMast.DeliveryChellanDate as invoiceDate, - igrMast.MaterialRcvdDate as materialRecievedDate, - igrMast.VehicleNo, + public function findIgrDetailsForIncomingSilicaSand($materialCodes, $month, $remark) + { + $builder = $this->db->table('t_igr_details'); + + // 1. Select the necessary columns + $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 , - 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'); + cd.ConfigValue as sandType, + t_igr_details.QuantityAsPerInvoice as Qty, + issd.*' + ); - // remark needed for those who selected any remark. - if ($remark != "noRemark") { - $builder->where('issd.remark', $remark); - } + // 2. Apply the most selective WHERE clause(s) first - in this case, the date range + $nowIST = new \DateTime('now', new \DateTimeZone('Asia/Kolkata')); + + $builder->where('Date(t_igr_details.CreatedDate) >=', $nowIST->format('Y-m-01 00:00:00')); + $builder->where('Date(t_igr_details.CreatedDate) <=', $nowIST->format('Y-m-t 23:59:59')); + + // 3. Apply other WHERE clause conditions + $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); + } + + // 4. Apply JOIN clauses + $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'); + + // 5. Apply GROUP BY clause + $builder->groupBy('t_igr_details.IGRNO, t_igr_details.MaterialCode'); + + // 6. Apply ORDER BY clause + $builder->orderBy('t_igr_details.CreatedDate', 'asc '); + + // 7. Get the query results + $query = $builder->get(); - $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 '); - $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 +1266,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(); - - // 392 po + where is_add = 1 and IGR_No = '" . $igr . "'"); + $first_line = $query3->getRow(); -$builder = $this->db->table('t_igr_history') - ->select(' + // 392 po + + $builder = $this->db->table('t_igr_history') + ->select(' t_igr_history.id, t_igr_history.field, t_igr_history.is_add, @@ -1288,118 +1307,126 @@ $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(); + $query = $builder->get(); + $result = $query->getResult(); // 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(); - - $query2 = $this->db->query(" - SELECT email FROM tbl_users - WHERE isDeleted = 0 AND roleId =".$roleId - ); - $to_mails = $query2->getResult(); + WHERE tbl_users.userId = ?", + [$userId] + ); + $fullName = $query1->getRow(); - $query3 = $this->db->query(" + $query2 = $this->db->query( + " SELECT email FROM tbl_users - WHERE isDeleted = 0 AND userId =".$userId - ); - $from_mails = $query3->getRow(); + WHERE isDeleted = 0 AND roleId =" . $roleId + ); + $to_mails = $query2->getResult(); - return [ + $query3 = $this->db->query( + " + SELECT email FROM tbl_users + WHERE isDeleted = 0 AND userId =" . $userId + ); + $from_mails = $query3->getRow(); + + 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'); - $result = $query->getResultArray(); - return $result; + $result = $query->getResultArray(); + return $result; } - public function getigrstatus($IGRNo){ + public function getigrstatus($IGRNo) + { $builder = $this->db->table('t_igr_master') - ->select('IGRStatus') - ->where('IGRNO',$IGRNo) - ->get(); - $result = $builder->getRow(); - return $result; + ->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 +1434,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 +1460,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_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', 'left') + ->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_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_gasshortagedetails t_gsd', 't_gsd.IGRNO = t_igrm.IGRNO', 'left') - ->where('t_gsd.gas_cylinder_status','gas_pending'); + ->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' ") - break; + ->where('t_gsd.gas_cylinder_status', 'gas_pending'); + + 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 +1494,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') - - ->groupBy('t_igrd.IGRNO'); - - break; - - } + ->where('t_gsd.gas_cylinder_status', 'gas_returned') - - $result = $builder->get()->getResultArray(); + ->groupBy('t_igrd.IGRNO'); + + break; + } + + + $result = $builder->get()->getResultArray(); - return $result; - + return $result; } - - - - -} \ No newline at end of file +} From cb73af88976384a4623c893e20c2c3b3d4680796 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Mon, 7 Apr 2025 11:11:11 +0530 Subject: [PATCH 3/7] stock changes 07-04-2025 --- app/Models/Inwardgateregister_model.php | 39 +- app/Views/stock/CoatingMachineDetail.php | 20 +- app/Views/stock/bagStockDetails.php | 12 +- app/Views/stock/dieselStockDetails.php | 17 +- app/Views/stock/drierMachineDetails.php | 16 +- app/Views/stock/dustAndRoughStockDetails.php | 10 +- app/Views/stock/gasStockDetails.php | 10 +- app/Views/stock/incomingSilicaSandDetails.php | 15 +- app/Views/stock/powerConsumptionDetails.php | 104 ++- app/Views/stock/resinStockDetails.php | 765 +++++++++--------- app/Views/stock/trpProductionStockDetails.php | 99 ++- app/Views/stock/trpSandUseStockDetails.php | 10 +- 12 files changed, 558 insertions(+), 559 deletions(-) diff --git a/app/Models/Inwardgateregister_model.php b/app/Models/Inwardgateregister_model.php index b7e1fb70..c162bb3a 100755 --- a/app/Models/Inwardgateregister_model.php +++ b/app/Models/Inwardgateregister_model.php @@ -1203,9 +1203,13 @@ class Inwardgateregister_model extends Model 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'); - // 1. Select the necessary columns + $builder->select( 't_igr_details.IGRNO, t_igr_details.MaterialCode, @@ -1218,14 +1222,17 @@ class Inwardgateregister_model extends Model t_igr_details.QuantityAsPerInvoice as Qty, issd.*' ); + - // 2. Apply the most selective WHERE clause(s) first - in this case, the date range - $nowIST = new \DateTime('now', new \DateTimeZone('Asia/Kolkata')); + $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) >=', $nowIST->format('Y-m-01 00:00:00')); - $builder->where('Date(t_igr_details.CreatedDate) <=', $nowIST->format('Y-m-t 23:59:59')); - - // 3. Apply other WHERE clause conditions + $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); @@ -1234,25 +1241,15 @@ class Inwardgateregister_model extends Model $builder->where('issd.remark', $remark); } - // 4. Apply JOIN clauses - $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'); - - // 5. Apply GROUP BY clause + $builder->groupBy('t_igr_details.IGRNO, t_igr_details.MaterialCode'); - - // 6. Apply ORDER BY clause + $builder->orderBy('t_igr_details.CreatedDate', 'asc '); - - // 7. Get the query results + $query = $builder->get(); - return $query->getResultArray(); + } public function getHistoryDetailsforEmail($igr) diff --git a/app/Views/stock/CoatingMachineDetail.php b/app/Views/stock/CoatingMachineDetail.php index bc775cee..60aff806 100644 --- a/app/Views/stock/CoatingMachineDetail.php +++ b/app/Views/stock/CoatingMachineDetail.php @@ -373,13 +373,13 @@ @@ -387,13 +387,13 @@ @@ -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)" > @@ -438,11 +438,19 @@
+ modify('first day of this month')->format('Y-m-d'); ?> + modify('last day of this month')->format('Y-m-d'); ?> + format('Y-m-d'); ?> +
* - +
diff --git a/app/Views/stock/bagStockDetails.php b/app/Views/stock/bagStockDetails.php index 4fd3fc3f..13341b9f 100644 --- a/app/Views/stock/bagStockDetails.php +++ b/app/Views/stock/bagStockDetails.php @@ -349,7 +349,7 @@ foreach ($period as $day) { @@ -358,7 +358,7 @@ foreach ($period as $day) { if ($month == date('M-Y')) { ?> @@ -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"> diff --git a/app/Views/stock/dieselStockDetails.php b/app/Views/stock/dieselStockDetails.php index abefaa59..5adc25eb 100644 --- a/app/Views/stock/dieselStockDetails.php +++ b/app/Views/stock/dieselStockDetails.php @@ -337,8 +337,8 @@ foreach ($period as $day) { + style=" padding: 8px;margin-bottom: 10px;width: 250px;border: 2px solid rgb(123, 11, 214); + border-radius: 5px;margin-right:15px;"> @@ -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"> + + style="font-size: x-large; cursor:pointer; color: #0b7cba" + id="bagStockExport"> diff --git a/app/Views/stock/drierMachineDetails.php b/app/Views/stock/drierMachineDetails.php index c48584fb..79ac5c1f 100644 --- a/app/Views/stock/drierMachineDetails.php +++ b/app/Views/stock/drierMachineDetails.php @@ -339,13 +339,13 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); + style="padding: 8px;margin-bottom: 10px;width: 250px;border: 2px solid rgb(123, 11, 214); + border-radius: 5px;margin-right:15px; "> @@ -353,13 +353,13 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); @@ -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)"> @@ -466,10 +466,12 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); modify('first day of this month')->format('Y-m-d'); ?> modify('last day of this month')->format('Y-m-d'); ?> + format('Y-m-d'); ?> +
-
diff --git a/app/Views/stock/dustAndRoughStockDetails.php b/app/Views/stock/dustAndRoughStockDetails.php index 5f545965..4f14fd9a 100644 --- a/app/Views/stock/dustAndRoughStockDetails.php +++ b/app/Views/stock/dustAndRoughStockDetails.php @@ -359,13 +359,13 @@ @@ -373,20 +373,20 @@ diff --git a/app/Views/stock/gasStockDetails.php b/app/Views/stock/gasStockDetails.php index e2253d7d..b4110044 100644 --- a/app/Views/stock/gasStockDetails.php +++ b/app/Views/stock/gasStockDetails.php @@ -335,13 +335,13 @@ @@ -349,20 +349,20 @@ diff --git a/app/Views/stock/incomingSilicaSandDetails.php b/app/Views/stock/incomingSilicaSandDetails.php index 9a22384a..e2afc565 100644 --- a/app/Views/stock/incomingSilicaSandDetails.php +++ b/app/Views/stock/incomingSilicaSandDetails.php @@ -340,27 +340,27 @@ @@ -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']); diff --git a/app/Views/stock/powerConsumptionDetails.php b/app/Views/stock/powerConsumptionDetails.php index 3db3d7d1..d51596cc 100644 --- a/app/Views/stock/powerConsumptionDetails.php +++ b/app/Views/stock/powerConsumptionDetails.php @@ -213,7 +213,7 @@ background-color: #50bbd9; /* Green background */ color: #ffffff; - border: 2px solid ; + border: 2px solid; padding: 10px; } @@ -262,10 +262,10 @@ margin-bottom: 5px; } - #powerStockDetailsTableId { /* Replace with your table's actual ID or selector */ - border-collapse: collapse; + #powerStockDetailsTableId { + /* Replace with your table's actual ID or selector */ + border-collapse: collapse; } - @@ -344,8 +344,8 @@ foreach ($period as $day) { + style=" padding: 8px;margin-bottom: 10px;width: 250px;border: 2px solid rgb(123, 11, 214); + border-radius: 5px;margin-right:15px;"> @@ -368,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"> + style="font-size: x-large; cursor:pointer; color: #0b7cba" + id="bagStockExport"> @@ -405,7 +405,7 @@ foreach ($period as $day) { 2)choose which material/machines you want ------------------------------------------------------------> - +
-
+
@@ -671,126 +676,122 @@ foreach ($period as $day) { - - + + - - Total - + + Total + - + - - - - + + + + - - - - - - - - - - - $dateInMonth) { ?> - format('d-m-Y'); - if ($dateInMonthDmYFormat === $currentDate) { - echo 'style="background: #cef0ad ;"'; - } - ?>> - $resinMaterial) { ?> - - - - format('d-m-Y'); - ?> - - - - - - - - - - - - - - - - - - - - oninput="openingStockChange(this)" - contenteditable="true" - - > - - $previousMonthResinStockDetail) - { - if($previousMonthResinStockDetail['materialCode'] == $resinMaterial['MaterialCode']){ - echo $previousMonthResinStockDetail['balanceStock'] ; - break; - } - - } - ?> - - - - - - - - - - $previousMonthResinStockDetail) - { - if($previousMonthResinStockDetail['materialCode'] == $resinMaterial['MaterialCode']){ - echo $previousMonthResinStockDetail['balanceStock'] ; - break; - } - - } - ?> - - - - - + + + - + + + + + $dateInMonth) { ?> + format('d-m-Y'); + if ($dateInMonthDmYFormat === $currentDate) { + echo 'style="background: #cef0ad ;"'; + } + ?>> + $resinMaterial) { ?> + + + + format('d-m-Y'); + ?> + + + + + + + + + + + + + + + + + + + + oninput="openingStockChange(this)" + contenteditable="true" + + > + + $previousMonthResinStockDetail) { + if ($previousMonthResinStockDetail['materialCode'] == $resinMaterial['MaterialCode']) { + echo $previousMonthResinStockDetail['balanceStock']; + break; + } + } + ?> + + + + + + + + + + $previousMonthResinStockDetail) { + if ($previousMonthResinStockDetail['materialCode'] == $resinMaterial['MaterialCode']) { + echo $previousMonthResinStockDetail['balanceStock']; + break; + } + } + ?> + + + + + + + + +
@@ -812,7 +813,7 @@ foreach ($period as $day) { @@ -867,9 +868,9 @@ foreach ($period as $day) { targetColumnIndex = targetColumnIndex * 7; targetRow.cells[targetColumnIndex].scrollIntoView({ - behavior: 'smooth', - inline: 'center', - block: 'center' + behavior: 'smooth', + inline: 'center', + block: 'center' }); const highlightDuration = 10000; @@ -1099,24 +1100,24 @@ foreach ($period as $day) { $(document).ready(function() { function exportTableToExcel(tableID, filename = '') { - let table = document.getElementById(tableID); - + let table = document.getElementById(tableID); + let cloneTable = table.cloneNode(true); // Clone the table to modify - + // Remove hidden rows - $(cloneTable).find('tr').filter(function () { + $(cloneTable).find('tr').filter(function() { return $(this).css('display') === 'none'; }).remove(); - + // Remove hidden columns - $(cloneTable).find('th, td').each(function () { + $(cloneTable).find('th, td').each(function() { if ($(this).css('display') === 'none') { $(this).remove(); } }); $(cloneTable).find('tbody tr').each(function() { let firstTd = $(this).find('td').eq(0); // Get the first column (Date) - + // Convert Date Format (Assuming it's in YYYY-MM-DD format) let originalDate = firstTd.text().trim(); // Get the text value let parts = originalDate.split('-'); // Split into [YYYY, MM, DD] @@ -1189,72 +1190,77 @@ foreach ($period as $day) { - + \ No newline at end of file diff --git a/app/Views/stock/trpProductionStockDetails.php b/app/Views/stock/trpProductionStockDetails.php index f6e7ceac..2e3892e3 100644 --- a/app/Views/stock/trpProductionStockDetails.php +++ b/app/Views/stock/trpProductionStockDetails.php @@ -405,10 +405,7 @@ $timeOtions[] = "12:00 AM";
" - 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;">
@@ -419,13 +416,13 @@ $timeOtions[] = "12:00 AM"; @@ -433,20 +430,20 @@ $timeOtions[] = "12:00 AM"; @@ -1504,16 +1501,18 @@ $timeOtions[] = "12:00 AM";
- - - - + + + + -
@@ -1709,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' => '', ], @@ -1746,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' => '', ], @@ -1759,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' => '', ], @@ -1774,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' => '', @@ -1784,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' => '', @@ -2331,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); @@ -2534,8 +2533,6 @@ $timeOtions[] = "12:00 AM"; }) - - \ No newline at end of file diff --git a/app/Views/monthlypayinputs.php b/app/Views/monthlypayinputs.php index f3dca305..66a885c1 100755 --- a/app/Views/monthlypayinputs.php +++ b/app/Views/monthlypayinputs.php @@ -128,22 +128,7 @@
- -
-
- -
- - -
- - -
Date: Mon, 7 Apr 2025 12:40:53 +0530 Subject: [PATCH 5/7] Monthly pay info NAN issue : GWM --- app/Views/monthlypayinputs.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Views/monthlypayinputs.php b/app/Views/monthlypayinputs.php index f948cca8..1cb5f9e8 100755 --- a/app/Views/monthlypayinputs.php +++ b/app/Views/monthlypayinputs.php @@ -1017,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; @@ -1029,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); @@ -1192,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); @@ -1203,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); From 7291373b39e1dbda6e6f6fb7d9f95ae33c305540 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Mon, 7 Apr 2025 15:27:28 +0530 Subject: [PATCH 6/7] GWM : code merge --- app/Views/attendance.php | 108 ++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 58 deletions(-) diff --git a/app/Views/attendance.php b/app/Views/attendance.php index 21326805..8d32e346 100755 --- a/app/Views/attendance.php +++ b/app/Views/attendance.php @@ -237,7 +237,7 @@ $currentday = date('d');
- + 'atten'); echo form_open('attendance', $attributes); ?> @@ -257,6 +257,8 @@ $currentday = date('d');
+ + @@ -267,15 +269,6 @@ $currentday = date('d');
- - -
@@ -561,11 +554,7 @@ $currentday = date('d');
- +
@@ -583,7 +572,7 @@ $currentday = date('d'); - + @@ -711,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) == @@ -1102,6 +1089,11 @@ function showMessage(msg) { 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 From ba328c5fe7627970b495fd694225495670e0f3cf Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Mon, 7 Apr 2025 15:48:21 +0530 Subject: [PATCH 7/7] stock changes 07-04-2025 --- app/Controllers/Rawmaterialdetails.php | 8 ++- app/Views/editRawmaterial.php | 6 ++- app/Views/rawmaterialListing.php | 49 +++++++++++++++++++ app/Views/stock/incomingSilicaSandDetails.php | 2 +- 4 files changed, 61 insertions(+), 4 deletions(-) diff --git a/app/Controllers/Rawmaterialdetails.php b/app/Controllers/Rawmaterialdetails.php index 0d3ebff8..990f37ef 100755 --- a/app/Controllers/Rawmaterialdetails.php +++ b/app/Controllers/Rawmaterialdetails.php @@ -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'); @@ -329,11 +331,15 @@ class Rawmaterialdetails extends BaseController $result = $this->rawmaterialdetails_model->editRawmaterial($RawMaterial, $MaterialCode); - if ($result == true) { + if ($result == true) { $this->session->setFlashdata('success', 'RawMaterial Updated successfully!'); + $this->session->setFlashdata('materialListPage', "$materialListPage"); + } else { echo ""; $this->session->setFlashdata('error', 'RawMaterial Record Not updated!'); + $this->session->setFlashdata('materialListPage', "$materialListPage"); + } return redirect()->route('rawmaterialListing'); diff --git a/app/Views/editRawmaterial.php b/app/Views/editRawmaterial.php index e29874fd..e142d4b3 100755 --- a/app/Views/editRawmaterial.php +++ b/app/Views/editRawmaterial.php @@ -113,7 +113,7 @@ if ($total <= $reorder) {

Edit Material - Details

-
@@ -361,10 +361,12 @@ if ($total <= $reorder) {
diff --git a/app/Views/rawmaterialListing.php b/app/Views/rawmaterialListing.php index 4ea7e148..565072ef 100755 --- a/app/Views/rawmaterialListing.php +++ b/app/Views/rawmaterialListing.php @@ -76,6 +76,9 @@ $type = "success"; echo show_alert($type, $success); } + + $materialListPage = session()->getFlashdata('materialListPage') ?? $_GET['materialListPage'] ?? 1; + ?>
@@ -207,6 +210,7 @@ ; // 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) { @@ -542,10 +570,31 @@ $(document).ready(function () { }); }); + +