diff --git a/app/Models/Rawmaterialdetails_model.php b/app/Models/Rawmaterialdetails_model.php
index 31db025e..cbd3a5fa 100755
--- a/app/Models/Rawmaterialdetails_model.php
+++ b/app/Models/Rawmaterialdetails_model.php
@@ -146,7 +146,7 @@ class Rawmaterialdetails_model extends Model
$builder = $this->db->table('t_materialmaster')
->select('MaterialCode')
- ->where('Category', 'silica sand')
+ ->where('Category', '248')
->orderBy('CreatedDate', 'desc');
$query = $builder->get();
$materialResults = $query->getResultArray();
@@ -158,7 +158,7 @@ class Rawmaterialdetails_model extends Model
$builder = $this->db->table('t_materialmaster')
->select('MaterialCode')
- ->where('Category', 'waste core')
+ ->where('Category', '328')
->orderBy('CreatedDate', 'desc');
$query = $builder->get();
$materialResults = $query->getResultArray();
@@ -171,7 +171,7 @@ class Rawmaterialdetails_model extends Model
//when no data present for current month we are showing only active materials with filter option
$builder = $this->db->table('t_materialmaster')
->select('MaterialCode, MaterialName')
- ->where('Category', 'Packing Material')
+ ->where('Category', '236')
->where('IsActive', 1)
->orderBy('MaterialCode', 'asc');
$query = $builder->get();
@@ -184,7 +184,7 @@ class Rawmaterialdetails_model extends Model
//when data present with whether material is active or not we have to show them with filter option
$builder = $this->db->table('t_materialmaster')
->select('MaterialCode, MaterialName')
- ->where('Category', 'Packing Material')
+ ->where('Category', '236')
->whereIn('MaterialCode', $distinctMaterialCodes)
->orderBy('MaterialCode', 'asc');
$query = $builder->get();
@@ -199,7 +199,7 @@ class Rawmaterialdetails_model extends Model
$builder = $this->db->table('t_materialmaster')
->select('MaterialCode , MaterialName')
->where('IsActive', 1)
- ->where('Category', 'Resin')
+ ->where('Category', '327')
->orderBy('MaterialCode', 'asc');
$query = $builder->get();
$materialResults = $query->getResultArray();
@@ -212,6 +212,7 @@ class Rawmaterialdetails_model extends Model
{
$builder = $this->db->table('t_materialmaster')
->select('MaterialCode, MaterialName')
+ ->where('Category', '327')
->whereIn('MaterialCode', $distinctMaterialCodes) // Matches MaterialCode with the array
->orderBy('MaterialCode', 'asc');
diff --git a/app/Views/stock/dieselStockDetails.php b/app/Views/stock/dieselStockDetails.php
index 778e53c6..50b61eb4 100644
--- a/app/Views/stock/dieselStockDetails.php
+++ b/app/Views/stock/dieselStockDetails.php
@@ -704,6 +704,7 @@ foreach ($period as $day) {
$dieselMachine) {
?>
@@ -731,16 +732,18 @@ foreach ($period as $day) {
- >= !empty($previousMonthDieselMachineStockDetails)
+ >= (!empty($previousMonthDieselMachineStockDetails) && isset($previousMonthDieselMachineStockDetails[$dieselMachineIndex]) )
? $previousMonthDieselMachineStockDetails[$dieselMachineIndex]['closing_reading']
:" " ;
- ?>
+ ?>
= !empty($previousMonthDieselMachineStockDetails)
+ contenteditable="true">
+
+ = !empty($previousMonthDieselMachineStockDetails) && isset($previousMonthDieselMachineStockDetails[$dieselMachineIndex])
? $previousMonthDieselMachineStockDetails[$dieselMachineIndex]['closing_reading']
:" " ;
?>
diff --git a/app/Views/stock/powerConsumptionDetails.php b/app/Views/stock/powerConsumptionDetails.php
index 1925e8ac..a8c272c8 100644
--- a/app/Views/stock/powerConsumptionDetails.php
+++ b/app/Views/stock/powerConsumptionDetails.php
@@ -156,14 +156,14 @@
}
.celda_encabezado_total {
- background-color:#ffffff !important;
+ background-color: #ffffff !important;
border: 1px solid #ffffff;
color: #ffffff !important;
font-weight: bold;
padding: 6px 10px;
text-align: center;
}
-
+
.celda_normal {
/*background-color: #fff;*/
/* */
@@ -177,12 +177,14 @@
.fht-table thead {
position: sticky;
top: 0;
- z-index: 20; /* Ensure the entire header stays above table rows */
- background-color: #50bbd9; /* Header background color */
+ z-index: 20;
+ /* Ensure the entire header stays above table rows */
+ background-color: #50bbd9;
+ /* Header background color */
}
- .dropdown-menu {
- z-index :25 ;
+ .dropdown-menu {
+ z-index: 25;
}
@@ -191,8 +193,10 @@
.fht-table thead th {
position: sticky;
top: 0;
- z-index: 11; /* Higher than table rows but lower than first column */
- background-color: #50bbd9; /* Green background */
+ z-index: 11;
+ /* Higher than table rows but lower than first column */
+ background-color: #50bbd9;
+ /* Green background */
color: #ffffff;
border: 1px solid #ddd;
padding: 10px;
@@ -204,7 +208,8 @@
position: sticky;
left: 0;
background-color: #50bbd9;
- z-index: 15; /* Ensures it stays above other cells */
+ z-index: 15;
+ /* Ensures it stays above other cells */
border-right: 2px solid #ddd;
color: #ffffff;
}
@@ -212,22 +217,16 @@
/* Table Wrapper for Scrolling */
.table-responsive {
overflow-x: auto;
- overflow-y: auto;
- max-height: 500px; /* Adjust as needed */
+ overflow-y: auto;
+ max-height: 500px;
+ /* Adjust as needed */
position: relative;
}
- td{
- min-width: 100px;
- max-width: 100px;
+ td {
+ min-width: 100px;
+ max-width: 100px;
}
-
-
-
-
-
-
-
@@ -328,13 +327,13 @@ foreach ($period as $day) {
| Machine |
-
- 150 KW Power
- |
+
+ 150 KW Power
+ |
-
+
= $electricMachine['machine_name'] ?>
|
@@ -346,15 +345,15 @@ foreach ($period as $day) {
- | Date |
- Opening Reading |
- Final Reading |
- Total Reading |
- Total Units |
- Average PF |
- Present PF |
- MD |
- MF *60 |
+ Date |
+ Opening Reading |
+ Final Reading |
+ Total Reading |
+ Total Units |
+ Average PF |
+ Present PF |
+ MD |
+ MF *60 |
@@ -365,7 +364,7 @@ foreach ($period as $day) {
Total Units |
-
+
@@ -374,13 +373,13 @@ foreach ($period as $day) {
$powerStockDetails) {
-
-
+
+
?>
>
- format('d-m-Y');
- ?>
+ format('d-m-Y');
+ ?>
- |
- = $startDate ?>
- |
+
+ = $startDate ?>
+ |
-
- oninput="openingTPStockChange(this)"
- contenteditable="true"
-
-
- >= $totalPower[$groupedIndex]['opening_reading'] ?? ' ' ?> |
+
-
- = $totalPower[$groupedIndex]['final_reading'] ?? ' ' ?>
-
- |
-
-
-
- = $totalPower[$groupedIndex]['total_reading'] ?? ' ' ?>
-
- |
-
-
-
- = $totalPower[$groupedIndex]['total_units'] ?? ' ' ?>
-
- |
-
-
-
- = $totalPower[$groupedIndex]['average_pf'] ?? ' ' ?>
-
- |
-
-
-
- = $totalPower[$groupedIndex]['present_pf'] ?? ' ' ?>
-
- |
-
-
-
- = $totalPower[$groupedIndex]['md'] ?? ' ' ?>
-
- |
-
-
-
- = $totalPower[$groupedIndex]['mf'] ?? ' ' ?>
-
- |
-
-
+ oninput="openingTPStockChange(this)"
+ contenteditable="true"
+ >= $totalPower[$groupedIndex]['opening_reading'] ?? ' ' ?>
-
-
- ?>
+
+
+ = $totalPower[$groupedIndex]['final_reading'] ?? ' ' ?>
+
+ |
+
+
+
+ = $totalPower[$groupedIndex]['total_reading'] ?? ' ' ?>
+
+ |
+
+
+
+ = $totalPower[$groupedIndex]['total_units'] ?? ' ' ?>
+
+ |
+
+
+
+ = $totalPower[$groupedIndex]['average_pf'] ?? ' ' ?>
+
+ |
+
+
+
+ = $totalPower[$groupedIndex]['present_pf'] ?? ' ' ?>
+
+ |
+
+
+
+ = $totalPower[$groupedIndex]['md'] ?? ' ' ?>
+
+ |
+
+
+
+ = $totalPower[$groupedIndex]['mf'] ?? ' ' ?>
+
+ |
+
+ $powerStock) { ?>
+ ?>
+
+
+
+
+ $powerStock) { ?>
= $powerStock['date'] ?>
@@ -518,7 +510,7 @@ foreach ($period as $day) {
|
-
+
= $powerStock['machine_id'] ?>
|
@@ -530,7 +522,7 @@ foreach ($period as $day) {
oninput="openingUnitsChange(this)"
contenteditable="true"
>
-
+
= $powerStock['opening_units'] ?? " " ?>
@@ -555,109 +547,102 @@ foreach ($period as $day) {
-
-
- "-" ,
- 'closing_units' => 0 ,
- 'total_units' => 0 ,
- ];
- }
+ "-",
+ 'closing_units' => 0,
+ 'total_units' => 0,
+ ];
+ }
+
+ // Sum values for the material
+
+ $summary["machineId_$machineId"]['opening_units'] = " ";
+ $summary["machineId_$machineId"]['closing_units'] = " ";
+ $summary["machineId_$machineId"]['total_units'] += is_numeric($powerStock['total_units']) ? $powerStock['total_units'] : 0;
+ } ?>
-
-
-
-
-
- } ?>
-
-
+
-
-
-
- | Date |
- Opening Reading |
- Final Reading |
- Total Reading |
- Total Units |
- Average PF |
- Present PF |
- MD |
- MF *60 |
+
-
-
- Date |
- Machine Id |
- Opening Units |
- Final Units |
- Total Units |
-
+
+ | Date |
+ Opening Reading |
+ Final Reading |
+ Total Reading |
+ Total Units |
+ Average PF |
+ Present PF |
+ MD |
+ MF *60 |
-
+
+
+ Date |
+ Machine Id |
+ Opening Units |
+ Final Units |
+ Total Units |
+
-
-
-
+
-
+
- |
- Total
- |
+
- = $summary['openingReading'] ?> |
- = $summary['finalReading'] ?> |
- = $summary['totalReading'] ?> |
- = $summary['totalUnits'] ?> |
- = $summary['averagePf'] ?> |
- = $summary['presentPf'] ?> |
- = $summary['md'] ?> |
- = $summary['mf'] ?> |
+
-
+ |
+ Total
+ |
- =$each['opening_units']?> |
- =$each['closing_units']?> |
- =$each['total_units']?> |
+ = $summary['openingReading'] ?> |
+ = $summary['finalReading'] ?> |
+ = $summary['totalReading'] ?> |
+ = $summary['totalUnits'] ?> |
+ = $summary['averagePf'] ?> |
+ = $summary['presentPf'] ?> |
+ = $summary['md'] ?> |
+ = $summary['mf'] ?> |
-
+
-
-
+ = $each['opening_units'] ?> |
+ = $each['closing_units'] ?> |
+ = $each['total_units'] ?> |
-
-
-
+
+
+
+
+
+
+
+
@@ -674,93 +659,81 @@ foreach ($period as $day) {
if ($dateInMonthDmYFormat === $currentDate) {
echo 'style="background: #cef0ad;"';
}
- ?> >
+ ?>>
+
+ format('d-m-Y');
+
+ ?>
+
+
+ = $startDate ?>
+ |
+
+
+
+
+ oninput="openingTPStockChange(this)"
+ contenteditable="true"
+
+ >
+ |
+
+
+
+
format('d-m-Y');
-
- ?>
+ if (empty($previousMonthTotalPowerMachineStockDetails)) {
+ echo " ";
+ } else {
+ echo $previousMonthTotalPowerMachineStockDetails[0]['final_reading'];
+ }
- |
- = $startDate ?>
- |
+ ?>
+
- |
-
+ |
- oninput="openingTPStockChange(this)"
- contenteditable="true"
+ |
+ |
-
+ |
- >
-
-
-
-
-
-
-
-
- |
-
- |
-
- |
-
- |
- |
-
- |
-
- |
+ |
$powerMachine) {
- ?>
+ foreach ($electricMachines as $powerMachineIndex => $powerMachine) {
+ ?>
-
+
= $dateInMonth ?>
@@ -772,37 +745,30 @@ foreach ($period as $day) {
|
-
- oninput="openingUnitsChange(this)"
- contenteditable="true"
-
+ oninput="openingUnitsChange(this)"
+ contenteditable="true"
-
- >
+
+ data-id="= $dateInMonth ?> = $powerMachine['id'] ?>">
+ = (!empty($previousMonthPowerConsumptionStockDetails) && isset($previousMonthPowerConsumptionStockDetails[$powerMachineIndex]))
+ ? $previousMonthPowerConsumptionStockDetails[$powerMachineIndex]['closing_units']
+ : " ";
+
+ ?>
|
-
+
+ = (!empty($previousMonthPowerConsumptionStockDetails) && isset($previousMonthPowerConsumptionStockDetails[$powerMachineIndex]))
+ ? $previousMonthPowerConsumptionStockDetails[$powerMachineIndex]['closing_units']
+ : " ";
+
+ ?>
|
function tableToJson() {
const table = $('#powerStockDetailsTableId');
- const summaryRowPart = [] ;
+ const summaryRowPart = [];
const readingsRowPart = [];
- const allRow = [] ;
+ const allRow = [];
//this table to json is customized for powerStock not for all
@@ -1023,67 +989,64 @@ foreach ($period as $day) {
const formattedDate = `${date.split('-')[2]}-${date.split('-')[1]}-${date.split('-')[0]}`;
-
- const summaryRowData = {
- date: formattedDate,
- opening_reading: rowCells.eq(1).text().trim(),
- final_reading : rowCells.eq(2).text().trim(),
- total_reading : rowCells.eq(3).text().trim(),
- total_units : rowCells.eq(4).text().trim(),
- average_pf : rowCells.eq(5).text().trim(),
- present_pf : rowCells.eq(6).text().trim(),
- md : rowCells.eq(7).text().trim(),
- mf : rowCells.eq(8).text().trim()
- };
- summaryRowPart.push(summaryRowData);
-
+ const summaryRowData = {
+ date: formattedDate,
+ opening_reading: rowCells.eq(1).text().trim(),
+ final_reading: rowCells.eq(2).text().trim(),
+ total_reading: rowCells.eq(3).text().trim(),
+ total_units: rowCells.eq(4).text().trim(),
+ average_pf: rowCells.eq(5).text().trim(),
+ present_pf: rowCells.eq(6).text().trim(),
+ md: rowCells.eq(7).text().trim(),
+ mf: rowCells.eq(8).text().trim()
+ };
+
+ summaryRowPart.push(summaryRowData);
+
/** we get eight entries against a machines so we loop from 1 to 8 and so on
in a single row **/
- for (let i = 9 ; i < rowCells.length; i += 5 ) {
+ for (let i = 9; i < rowCells.length; i += 5) {
const readingsRowData = {
date: rowCells.eq(i).text().trim(),
machine_id: rowCells.eq(i + 1).text().trim(),
opening_units: rowCells.eq(i + 2).text().trim(),
closing_units: rowCells.eq(i + 3).text().trim(),
- total_units : rowCells.eq(i + 4).text().trim(),
+ total_units: rowCells.eq(i + 4).text().trim(),
};
readingsRowPart.push(readingsRowData);
}
-
+
});
- allRow.push(summaryRowPart ,readingsRowPart )
+ allRow.push(summaryRowPart, readingsRowPart)
return JSON.stringify(allRow, null, 2);
}
+
\ No newline at end of file
diff --git a/app/Views/stock/resinStockDetails.php b/app/Views/stock/resinStockDetails.php
index f39ae0ef..4e7013a6 100644
--- a/app/Views/stock/resinStockDetails.php
+++ b/app/Views/stock/resinStockDetails.php
@@ -511,6 +511,7 @@ foreach ($period as $day) {
}
?>>
$resinMaterial) { ?>
|