stock module latest today vadivel J 29-01-2025

This commit is contained in:
vadivelJ96 2025-01-29 18:11:31 +05:30
parent 20a73ed18b
commit 6e9d9f7ea1

View File

@ -100,6 +100,17 @@
}
.celda_encabezado_general {
background-color: #00a65a;
border: 1px solid #ccc;
color: #ffffff;
font-weight: bold;
padding: 6px 10px;;
text-align: center;
}
.celda_encabezado_general {
background-color: #00a65a;
border: 1px solid #ccc;
@ -122,13 +133,7 @@
width: 4px;
}
.celda_normal {
/*background-color: #fff;*/
/* <!-- ad9271 into ffffff brown-light to green-light --> */
text-align: center;
border: 1px solid #ccc;
padding: 2px 4px;
}
/*style excel*/
.excel_cell {
@ -156,19 +161,92 @@
height: 20px;
}
#trpProductionStockDetailsTableId th:nth-child(1),
#trpProductionStockDetailsTableId td:nth-child(1) {
.celda_encabezado_general {
background-color: #00a65a;
border: 1px solid #ccc;
color: #ffffff;
font-weight: bold;
padding: 2px 4px;
text-align: center;
}
.celda_encabezado_total {
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;*/
/* <!-- ad9271 into ffffff brown-light to green-light --> */
text-align: center;
border: 1px solid #ccc;
padding: 10px 6px;
}
/* Make entire thead sticky */
.fht-table thead {
position: sticky;
top: 0;
z-index: 20; /* Ensure the entire header stays above table rows */
background-color: #00a65a; /* Header background color */
}
.dropdown-menu {
z-index :25 ;
}
/* Ensure each <th> in thead stays sticky */
.fht-table thead th {
position: sticky;
top: 0;
z-index: 11; /* Higher than table rows but lower than first column */
background-color: #00a65a; /* 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 */
max-width: 150px; /* Set a max width to control wrapping */
}
/* Sticky First Column */
.fht-table th:nth-child(1),
.fht-table td:nth-child(1) {
position: sticky;
left: 0;
background-color: #00a65a;
z-index: 2;
z-index: 15; /* Ensures it stays above other cells */
border-right: 2px solid #ddd;
color: #ffffff;
}
.modal {
padding-right: 30% ! important;
/* Table Wrapper for Scrolling */
.table-responsive {
overflow-x: auto;
overflow-y: auto;
max-height: 450px; /* Adjust as needed */
position: relative;
}
td{
min-width: 100px;
max-width: 100px;
}
th{
min-width: 100px;
max-width: 100px;
}
</style>
@ -359,7 +437,7 @@
<tr>
<!-- th:eq(0) -->
<th class="celda_encabezado_general" >BG</th>
<th class="celda_encabezado_general" style="z-index:11;" >BG</th>
<!-- th:eq(1) -->
<th class="celda_encabezado_general" >PG </th>
<!-- th:eq(2) -->
@ -1132,28 +1210,28 @@
function calculateSandFeedingHours(totalHours,coldStart,breakdownHours){
let [totalHoursF, coldStartF, breakdownHoursF] = [totalHours, coldStart, breakdownHours].map((time) => {
if (time === "" || time == null) return "0.00";
if (typeof time === "number") return time.toFixed(2);
if (!time.includes(".")) return `${time}.00`;
return time;
});
let [totalHoursF, coldStartF, breakdownHoursF] = [totalHours, coldStart, breakdownHours].map((time) => {
if (time === "" || time == null) return "0.00";
if (typeof time === "number") return time.toFixed(2);
if (!time.includes(".")) return `${time}.00`;
return time;
});
let sandFeedingHours = 0;
let sandFeedingHours = 0;
let totalHoursInt = milliSecondsFormat((totalHours));
let coldStartInt = milliSecondsFormat(coldStart);
let breakdownHoursInt = milliSecondsFormat(breakdownHours);
let totalHoursInt = milliSecondsFormat((totalHoursF));
let coldStartInt = milliSecondsFormat(coldStartF);
let breakdownHoursInt = milliSecondsFormat(breakdownHoursF);
let burnerFiringHoursInt = totalHoursInt - breakdownHoursInt ;
let burnerFiringHoursInt = totalHoursInt - breakdownHoursInt ;
sandFeedingHours = milliSecondsToHourMinuteFormat(burnerFiringHoursInt - coldStartInt);
sandFeedingHours = milliSecondsToHourMinuteFormat(burnerFiringHoursInt - coldStartInt);
burnerFiringHours = milliSecondsToHourMinuteFormat(burnerFiringHoursInt);
burnerFiringHours = milliSecondsToHourMinuteFormat(burnerFiringHoursInt);
return [sandFeedingHours,burnerFiringHours];
return [sandFeedingHours,burnerFiringHours];
}
@ -1205,27 +1283,27 @@ return totalHours;
let tr = $(tdElement).closest('tr');
let totalHours = tr.find('td:eq(3)').text().trim() ?? 0;
let coldStart = tr.find('td:eq(4)').text().trim() ?? 0;
let breakdownHours = tr.find('td:eq(5)').text().trim() ?? 0;
let totalHours = validateInput(tr.find('td:eq(3)').text().trim()) ?? 0;
let coldStart = validateInput(tr.find('td:eq(4)').text().trim()) ?? 0;
let breakdownHours = validateInput(tr.find('td:eq(5)').text().trim()) ?? 0;
let burnerFiringHours = tr.find('td:eq(6)').text().trim() ?? 0;
let sandFeedingHours = tr.find('td:eq(7)').text().trim() ?? 0;
let gasReceiptBg = tr.find('td:eq(8)').text().trim() ?? 0;
let gasReceiptPg = tr.find('td:eq(9)').text().trim() ?? 0;
let physicalGasConsumption = tr.find('td:eq(10)').text().trim()?? 0;
let drierGasConsumption = tr.find('td:eq(11)').text().trim()?? 0;
let coatingGasConsumption = tr.find('td:eq(12)').text().trim()?? 0;
let physicalGasConsumption = validateInput(tr.find('td:eq(10)').text().trim())?? 0;
let drierGasConsumption = validateInput(tr.find('td:eq(11)').text().trim())?? 0;
let coatingGasConsumption = validateInput(tr.find('td:eq(12)').text().trim())?? 0;
let trpPlusDrierGasConsumption = tr.find('td:eq(13)').text().trim()?? 0;
let trpPhysicalGasPerTon = tr.find('td:eq(14)').text().trim()?? 0;
let panelGasConsumption = tr.find('td:eq(15)').text().trim()?? 0;
let panelGasConsumption = validateInput(tr.find('td:eq(15)').text().trim())?? 0;
let panelGasPerTon = tr.find('td:eq(16)').text().trim()?? 0;
let edRunningHours = tr.find('td:eq(24)').text().trim()?? 0;
let edProduction = tr.find('td:eq(25)').text().trim()?? 0;
let edUsage = tr.find('td:eq(26)').text().trim()?? 0;
let trpProduction = tr.find('td:eq(27)').text().trim()?? 0;
let trpProduction = validateInput(tr.find('td:eq(27)').text().trim())?? 0;
let trpProductionPerHour = tr.find('td:eq(28)').text().trim()?? 0;
let coating = tr.find('td:eq(29)').text().trim()?? 0;
@ -1242,35 +1320,33 @@ return totalHours;
burnerFiringHours = result[1];
trpPlusDrierGasConsumption = parseInt( parseFloat(physicalGasConsumption) -
( parseFloat(drierGasConsumption) + parseFloat(coatingGasConsumption) ) );
( parseFloat(drierGasConsumption) + parseFloat(coatingGasConsumption) ) ) ;
trpPhysicalGasPerTon = parseFloat(trpPlusDrierGasConsumption) / (parseFloat(trpProduction)/1000) ;
trpPhysicalGasPerTon = trpProduction == 0 ? " " : parseFloat(trpPlusDrierGasConsumption) / (parseFloat(trpProduction)/1000) ;
panelGasPerTon = parseFloat(panelGasConsumption) / (parseFloat(trpProduction)/1000) ;
panelGasPerTon = trpProduction == 0 ? " " : parseFloat(panelGasConsumption) / (parseFloat(trpProduction)/1000) ;
trpProductionPerHour = parseFloat(trpProduction) / parseFloat(sandFeedingHours) ;
trpProductionPerHour = sandFeedingHours == 0 ? " " : parseFloat(trpProduction) / parseFloat(sandFeedingHours) ;
ebReadingPerUnitTon = parseFloat(ebReading) / (parseFloat(trpProduction)/1000) ;
ebReadingPerUnitTon = trpProduction == 0 ? " " : parseFloat(ebReading) / (parseFloat(trpProduction)/1000) ;
// Final updation of value into td
tr.find('td:eq(7)').text(sandFeedingHours);
tr.find('td:eq(7)').text(Number.isNaN(sandFeedingHours)? " " : sandFeedingHours);
tr.find('td:eq(6)').text(burnerFiringHours);
tr.find('td:eq(6)').text(Number.isNaN(burnerFiringHours)? " " : burnerFiringHours);
tr.find('td:eq(13)').text(trpPlusDrierGasConsumption);
tr.find('td:eq(13)').text(Number.isNaN(trpPlusDrierGasConsumption)? " " : trpPlusDrierGasConsumption);
tr.find('td:eq(14)').text(trpPhysicalGasPerTon);
tr.find('td:eq(14)').text(Number.isNaN(trpPhysicalGasPerTon)? " " : trpPhysicalGasPerTon);
tr.find('td:eq(15)').text(panelGasPerTon);
tr.find('td:eq(15)').text(Number.isNaN(panelGasPerTon)? " " : panelGasPerTon);
tr.find('td:eq(28)').text(trpProductionPerHour);
tr.find('td:eq(28)').text(Number.isNaN(trpProductionPerHour)? " " : (trpProductionPerHour).toFixed(2));
tr.find('td:eq(38)').text(ebReadingPerUnitTon);
tr.find('td:eq(38)').text(Number.isNaN(ebReadingPerUnitTon)? " " : ebReadingPerUnitTon);
@ -1369,8 +1445,32 @@ return totalHours;
</script>
<script>
function validateInput(input) {
if (input == '' || input == ' ' || input == '-') {
return 0;
}
if (typeof input === 'string' && input.split('').map(char => char.charCodeAt(0))[0] == 10) {
return 0;
}
// Validate against the regex
const isValid = /^-?\d*\.?\d*$/.test(input);
if (!isValid) {
alert('Invalid input! Please enter a valid number.');
return 0;
}
return input;
}
</script>