stock module latest today vadivel J 06-02-2025

This commit is contained in:
vadivelJ96 2025-02-06 17:28:25 +05:30
parent 3b69e053bd
commit 3c45042672
11 changed files with 179 additions and 71 deletions

View File

@ -130,19 +130,33 @@ class StockController extends BaseController
{
if ($this->request->getMethod() === 'POST') {
$month = $this->request->getPost('month');
$date = DateTime::createFromFormat('M-Y', $month);
$formattedDate = $date->format('Y-m');
$month = $formattedDate;
$month = $formattedDate;
$session = session ();
$session->set('stock_month',$month);
} else {
$filteredMonth = $this->request->getGet('month');
$month = $filteredMonth ?? date('Y-m');
$session = session();
$month = $session->get('stock_month');
if (empty($month)) {
$month = date('Y-m'); // Default to the current month
}
}
$data['month'] = $month ;
$this->global['pageTitle'] = 'Coating Machine Details ';
@ -181,8 +195,6 @@ class StockController extends BaseController
$message3 = '';
$postData = $this->request->getPost();
$month = $this->request->getGet('month');
$month = DateTime::createFromFormat('M-Y', $month)->format('Y-m');
$date = $postData['date'];
$shift = $postData['shift'];
@ -265,7 +277,7 @@ class StockController extends BaseController
// Set flashdata for success message
return redirect()->to("/coatingMachineDetails?month=$month")
return redirect()->to("/coatingMachineDetails")
->with('success', $message1 . " " . $message2 . " " . $message3);
} catch (\Exception $error) {
$this->db->transRollback();
@ -284,8 +296,7 @@ class StockController extends BaseController
$message3 = '';
$putData = $this->request->getPost();
$month = $this->request->getGet('month');
$month = DateTime::createFromFormat('M-Y', $month)->format('Y-m');
$id = $putData['editCoatingMachineDetailId'];
@ -361,7 +372,7 @@ class StockController extends BaseController
// Set flashdata for success message
return redirect()->to("/coatingMachineDetails?month=$month")
return redirect()->to("/coatingMachineDetails")
->with('success', $message1 . " " . $message2 . " " . $message3);
} else {
throw new \Exception('Failed to update Coating machine details.');
@ -443,10 +454,23 @@ class StockController extends BaseController
$formattedDate = $date->format('Y-m');
$month = $formattedDate;
$session = session ();
$session->set('stock_month',$month);
} else {
$remark = $this->request->getVar('remark');
$month = date('Y-m');
$session = session();
$month = $session->get('stock_month');
if (empty($month)) {
$month = date('Y-m'); // Default to the current month
}
}
$data['month'] = $month;
@ -677,14 +701,21 @@ class StockController extends BaseController
$month = $formattedDate;
$session = session ();
$session->set('stock_month',$month);
$filterMaterialCode = $this->request->getPost('filterMaterialCode');
$filterMaterialCode = $this->request->getPost('filterMaterialCode');
} else {
$month = date('Y-m');
$session = session();
$month = $session->get('stock_month');
if (empty($month)) {
$month = date('Y-m'); // Default to the current month
}
}
$data = [];
@ -879,8 +910,19 @@ class StockController extends BaseController
$formattedDate = $date->format('Y-m');
$month = $formattedDate;
$session = session ();
$session->set('stock_month',$month);
} else {
$month = date('Y-m');
$session = session();
$month = $session->get('stock_month');
if (empty($month)) {
$month = date('Y-m'); // Default to the current month
}
}
$data = [];
@ -975,8 +1017,19 @@ class StockController extends BaseController
$formattedDate = $date->format('Y-m');
$month = $formattedDate;
$session = session ();
$session->set('stock_month',$month);
} else {
$month = date('Y-m');
$session = session();
$month = $session->get('stock_month');
if (empty($month)) {
$month = date('Y-m'); // Default to the current month
}
}
$data = [];
@ -1175,8 +1228,19 @@ class StockController extends BaseController
$formattedDate = $date->format('Y-m');
$month = $formattedDate;
$session = session ();
$session->set('stock_month',$month);
} else {
$month = date('Y-m');
$session = session();
$month = $session->get('stock_month');
if (empty($month)) {
$month = date('Y-m'); // Default to the current month
}
}
$data = [];
@ -1446,7 +1510,13 @@ class StockController extends BaseController
$month = $formattedDate;
} else {
$month = date('Y-m');
$session = session();
$month = $session->get('stock_month');
if (empty($month)) {
$month = date('Y-m'); // Default to the current month
}
}
$data = [];
@ -1543,12 +1613,21 @@ class StockController extends BaseController
$formattedDate = $date->format('Y-m');
$month = $formattedDate;
$session = session ();
$session->set('stock_month',$month);
} else {
// $month = new DateTime('2024-10-01');
// $month = $month->format('Y-m');
$session = session();
$month = date('Y-m');
$month = $session->get('stock_month');
if (empty($month)) {
$month = date('Y-m'); // Default to the current month
}
}
@ -2061,11 +2140,21 @@ class StockController extends BaseController
$formattedDate = $date->format('Y-m');
$month = $formattedDate;
$session = session ();
$session->set('stock_month',$month);
} else {
// $month = '2024-12';
$session = session();
$month = date('Y-m');
$month = $session->get('stock_month');
if (empty($month)) {
$month = date('Y-m'); // Default to the current month
}
}
$data = [];
@ -2336,11 +2425,20 @@ class StockController extends BaseController
$formattedDate = $date->format('Y-m');
$month = $formattedDate;
$session = session ();
$session->set('stock_month',$month);
} else {
// $month = '2025-02';
$session = session();
$month = date('Y-m');
$month = $session->get('stock_month');
if (empty($month)) {
$month = date('Y-m'); // Default to the current month
}
}
$data = [];

View File

@ -32,7 +32,7 @@
}
.fht-table td:hover {
background-color: #00a65a;
background-color: #50bbd9;
color: #ffffff;
}
@ -1493,6 +1493,10 @@
let machineOnTime12 = machineOnTimeHr;
let machineOffTime12 = machineOffTimeHr;
if(machineOnTime12 == machineOffTime12){
return `24.00`;
}
let machineOnTime24 = convertTo24Hr(machineOnTime12);
let machineOffTime24 = convertTo24Hr(machineOffTime12);

View File

@ -18,7 +18,7 @@
}
.fht-table td:hover {
background-color: #00a65a;
background-color: #50bbd9;
color: #ffffff;
}
@ -140,7 +140,7 @@
.celda_encabezado_general {
background-color: #00a65a;
background-color: #50bbd9;
border: 1px solid #ccc;
color: #ffffff;
font-weight: bold;
@ -171,7 +171,7 @@
position: sticky;
top: 0;
z-index: 20; /* Ensure the entire header stays above table rows */
background-color: #00a65a; /* Header background color */
background-color: #50bbd9; /* Header background color */
}
.dropdown-menu {
@ -185,7 +185,7 @@
position: sticky;
top: 0;
z-index: 11; /* Higher than table rows but lower than first column */
background-color: #00a65a; /* Green background */
background-color: #50bbd9; /* Green background */
color: #ffffff;
border: 1px solid #ddd;
padding: 10px;
@ -196,7 +196,7 @@
.fht-table td:nth-child(1) {
position: sticky;
left: 0;
background-color: #00a65a;
background-color: #50bbd9;
z-index: 15; /* Ensures it stays above other cells */
border-right: 2px solid #ddd;
color: #ffffff;

View File

@ -18,7 +18,7 @@
}
.fht-table td:hover {
background-color: #00a65a;
background-color: #50bbd9;
color: #ffffff;
}
@ -142,7 +142,7 @@
.celda_encabezado_general {
background-color: #00a65a;
background-color: #50bbd9;
border: 1px solid #ccc;
color: #ffffff;
font-weight: bold;
@ -173,7 +173,7 @@
position: sticky;
top: 0;
z-index: 20; /* Ensure the entire header stays above table rows */
background-color: #00a65a; /* Header background color */
background-color: #50bbd9; /* Header background color */
}
.dropdown-menu {
@ -187,7 +187,7 @@
position: sticky;
top: 0;
z-index: 11; /* Higher than table rows but lower than first column */
background-color: #00a65a; /* Green background */
background-color: #50bbd9; /* Green background */
color: #ffffff;
border: 1px solid #ddd;
padding: 10px;
@ -198,7 +198,7 @@
.fht-table td:nth-child(1) {
position: sticky;
left: 0;
background-color: #00a65a;
background-color: #50bbd9;
z-index: 15; /* Ensures it stays above other cells */
border-right: 2px solid #ddd;
color: #ffffff;

View File

@ -23,7 +23,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
}
.fht-table td:hover {
background-color: #00a65a;
background-color: #50bbd9;
color: #ffffff;
}
@ -107,7 +107,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
th.celda_encabezado_general {
background-color: #00a65a;
background-color: #50bbd9;
border: 1px solid #ccc;
color: #ffffff;
font-weight: bold;
@ -188,7 +188,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
.celda_encabezado_general {
background-color: #00a65a;
background-color: #50bbd9;
border: 1px solid #ccc;
color: #ffffff;
font-weight: bold;
@ -218,7 +218,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
position: sticky;
top: 0;
z-index: 20; /* Ensure the entire header stays above table rows */
background-color: #00a65a; /* Header background color */
background-color: #50bbd9; /* Header background color */
}
.dropdown-menu {

View File

@ -18,7 +18,7 @@
}
.fht-table td:hover {
background-color: #00a65a;
background-color: #50bbd9;
color: #ffffff;
}
@ -144,7 +144,7 @@
.celda_encabezado_general {
background-color: #00a65a;
background-color: #50bbd9;
border: 1px solid #ccc;
color: #ffffff;
font-weight: bold;
@ -175,7 +175,7 @@
position: sticky;
top: 0;
z-index: 20; /* Ensure the entire header stays above table rows */
background-color: #00a65a; /* Header background color */
background-color: #50bbd9; /* Header background color */
}
.dropdown-menu {
@ -189,7 +189,7 @@
position: sticky;
top: 0;
z-index: 11; /* Higher than table rows but lower than first column */
background-color: #00a65a; /* Green background */
background-color: #50bbd9; /* Green background */
color: #ffffff;
border: 1px solid #ddd;
padding: 10px;
@ -200,7 +200,7 @@
.fht-table td:nth-child(1) {
position: sticky;
left: 0;
background-color: #00a65a;
background-color: #50bbd9;
z-index: 15; /* Ensures it stays above other cells */
border-right: 2px solid #ddd;
color: #ffffff;

View File

@ -24,7 +24,7 @@
}
.fht-table td:hover {
background-color: #00a65a;
background-color: #50bbd9;
color: #ffffff;
}
@ -107,7 +107,7 @@
.celda_encabezado_general {
background-color: #00a65a;
background-color: #50bbd9;
border: 1px solid #ccc;
color: #ffffff;
font-weight: bold;
@ -187,7 +187,7 @@
position: sticky;
left: 0;
top: 0;
background-color: #00a65a;
background-color: #50bbd9;
z-index: 7!important;
border-right: 2px solid #ddd;
color: #ffffff;
@ -198,7 +198,7 @@
{
position: sticky;
left: 0;
background-color: #00a65a;
background-color: #50bbd9;
z-index: 2;
border-right: 2px solid #ddd;
color: #ffffff;
@ -565,12 +565,12 @@
<!-- 'td:eq(30)' -->
<td class="celda_normal">
<?php echo $record['moistureLossQty'] ?? ' '; ?>
<?php echo (int)$record['moistureLossQty'] == 0 ? ' ' : (int)$record['moistureLossQty'] ; ?>
</td>
<!-- 'td:eq(31)' -->
<td class="celda_normal">
<?php echo $record['sieveLossQty'] ?? ' '; ?>
<?php echo (int)$record['sieveLossQty'] == 0 ? ' ' : (int)$record['sieveLossQty']; ?>
</td>
<!-- 'td:eq(32)' -->

View File

@ -18,7 +18,7 @@
}
.fht-table td:hover {
background-color: #00a65a;
background-color: #50bbd9;
color: #ffffff;
}
@ -142,7 +142,7 @@
.celda_encabezado_general {
background-color: #00a65a;
background-color: #50bbd9;
border: 1px solid #ccc;
color: #ffffff;
font-weight: bold;
@ -173,7 +173,7 @@
position: sticky;
top: 0;
z-index: 20; /* Ensure the entire header stays above table rows */
background-color: #00a65a; /* Header background color */
background-color: #50bbd9; /* Header background color */
}
.dropdown-menu {
@ -187,7 +187,7 @@
position: sticky;
top: 0;
z-index: 11; /* Higher than table rows but lower than first column */
background-color: #00a65a; /* Green background */
background-color: #50bbd9; /* Green background */
color: #ffffff;
border: 1px solid #ddd;
padding: 10px;
@ -198,7 +198,7 @@
.fht-table td:nth-child(1) {
position: sticky;
left: 0;
background-color: #00a65a;
background-color: #50bbd9;
z-index: 15; /* Ensures it stays above other cells */
border-right: 2px solid #ddd;
color: #ffffff;

View File

@ -18,7 +18,7 @@
}
.fht-table td:hover {
background-color: #00a65a;
background-color: #50bbd9;
color: #ffffff;
}
@ -141,7 +141,7 @@
.celda_encabezado_general {
background-color: #00a65a;
background-color: #50bbd9;
border: 1px solid #ccc;
color: #ffffff;
font-weight: bold;
@ -172,7 +172,7 @@
position: sticky;
top: 0;
z-index: 20; /* Ensure the entire header stays above table rows */
background-color: #00a65a; /* Header background color */
background-color: #50bbd9; /* Header background color */
}
.dropdown-menu {
@ -186,7 +186,7 @@
position: sticky;
top: 0;
z-index: 11; /* Higher than table rows but lower than first column */
background-color: #00a65a; /* Green background */
background-color: #50bbd9; /* Green background */
color: #ffffff;
border: 1px solid #ddd;
padding: 10px;
@ -197,7 +197,7 @@
.fht-table td:nth-child(1) {
position: sticky;
left: 0;
background-color: #00a65a;
background-color: #50bbd9;
z-index: 15; /* Ensures it stays above other cells */
border-right: 2px solid #ddd;
color: #ffffff;

View File

@ -18,7 +18,7 @@
}
.fht-table td:hover {
background-color: #00a65a;
background-color: #50bbd9;
color: #ffffff;
}
@ -143,7 +143,7 @@
.celda_encabezado_general {
background-color: #00a65a;
background-color: #50bbd9;
border: 1px solid #ccc;
color: #ffffff;
font-weight: bold;
@ -175,7 +175,7 @@
top: 0;
z-index: 20;
/* Ensure the entire header stays above table rows */
background-color: #00a65a;
background-color: #50bbd9;
/* Header background color */
}
@ -191,11 +191,14 @@
top: 0;
z-index: 11;
/* Higher than table rows but lower than first column */
background-color: #00a65a;
background-color: #50bbd9;
/* Green background */
color: #ffffff;
border: 1px solid #ddd;
padding: 10px;
white-space: normal; /* Allows text to wrap */
word-wrap: break-word; /* Breaks long words if needed */
text-align: center; /* Centers text for better alignment */
}
/* Sticky First Column */
@ -203,7 +206,7 @@
.fht-table td:nth-child(1) {
position: sticky;
left: 0;
background-color: #00a65a;
background-color: #50bbd9;
z-index: 15;
/* Ensures it stays above other cells */
border-right: 2px solid #ddd;

View File

@ -18,7 +18,7 @@
}
.fht-table td:hover {
background-color: #00a65a;
background-color: #50bbd9;
color: #ffffff;
}
@ -143,7 +143,7 @@
.celda_encabezado_general {
background-color: #00a65a;
background-color: #50bbd9;
border: 1px solid #ccc;
color: #ffffff;
font-weight: bold;
@ -174,7 +174,7 @@
position: sticky;
top: 0;
z-index: 20; /* Ensure the entire header stays above table rows */
background-color: #00a65a; /* Header background color */
background-color: #50bbd9; /* Header background color */
}
.dropdown-menu {
@ -188,10 +188,13 @@
position: sticky;
top: 0;
z-index: 11; /* Higher than table rows but lower than first column */
background-color: #00a65a; /* Green background */
background-color: #50bbd9; /* Green background */
color: #ffffff;
border: 1px solid #ddd;
padding: 10px;
white-space: normal; /* Allows text to wrap */
word-wrap: break-word; /* Breaks long words if needed */
text-align: center; /* Centers text for better alignment */
}
/* Sticky First Column */
@ -199,7 +202,7 @@
.fht-table td:nth-child(1) {
position: sticky;
left: 0;
background-color: #00a65a;
background-color: #50bbd9;
z-index: 15; /* Ensures it stays above other cells */
border-right: 2px solid #ddd;
color: #ffffff;