stock module latest today vadivel J 19-01-2025
This commit is contained in:
parent
0078d8471e
commit
0d75fd2c32
@ -643,15 +643,15 @@ td {
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
data: $('.requistion').serialize() + "&serviceSchedule=" + serviceSchedule + "&servicePeriod=" + servicePeriod + "&noOfService=" + noOfService,
|
data: $('.requistion').serialize() + "&serviceSchedule=" + serviceSchedule + "&servicePeriod=" + servicePeriod + "&noOfService=" + noOfService,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<?php echo base_url() ?>EditRequisition",
|
url: "<?php echo base_url() ?>EditRequisition" ,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
$('#loader').hide();
|
$('#loader').hide() ;
|
||||||
alert(data);
|
alert(data) ;
|
||||||
$('#txtRowCount').val('');
|
$('#txtRowCount').val('') ;
|
||||||
$('#txtDeletedRow').val('');
|
$('#txtDeletedRow').val('') ;
|
||||||
|
|
||||||
window.location = "Requisition";
|
window.location = "Requisition" ;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$('#loader').hide();
|
$('#loader').hide();
|
||||||
|
|||||||
@ -329,19 +329,25 @@
|
|||||||
<?=$gasStockDetail['coatingMachineGasconsumption']??'0'?></td>
|
<?=$gasStockDetail['coatingMachineGasconsumption']??'0'?></td>
|
||||||
<td class="celda_normal">
|
<td class="celda_normal">
|
||||||
<?=$gasStockDetail['coatedSand']??'0'?></td>
|
<?=$gasStockDetail['coatedSand']??'0'?></td>
|
||||||
|
|
||||||
<td class="celda_normal trpGasConsumption"
|
<td class="celda_normal trpGasConsumption"
|
||||||
data-id="<?=$gasStockDetail['date']?>"
|
data-id="<?=$gasStockDetail['date']?>"
|
||||||
|
oninput = "gasConsumptionChange(this)"
|
||||||
contenteditable="true" >
|
contenteditable="true" >
|
||||||
<?=$gasStockDetail['trpMachineGasconsumption']??'0'?></td>
|
<?=$gasStockDetail['trpMachineGasconsumption']??'0'?></td>
|
||||||
|
|
||||||
<td class="celda_normal"
|
<td class="celda_normal"
|
||||||
contenteditable="true" >
|
contenteditable="true" >
|
||||||
<?=$gasStockDetail['sandTrp']??'0'?>
|
<?=$gasStockDetail['sandTrp']??'0'?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="celda_normal rotaryGasConsumption"
|
<td class="celda_normal rotaryGasConsumption"
|
||||||
data-id="<?=$gasStockDetail['date']?>"
|
data-id="<?=$gasStockDetail['date']?>"
|
||||||
|
oninput = "gasConsumptionChange(this)"
|
||||||
contenteditable="true" >
|
contenteditable="true" >
|
||||||
<?=$gasStockDetail['rotaryDrierMachineGasconsumption']??'0'?>
|
<?=$gasStockDetail['rotaryDrierMachineGasconsumption']??'0'?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php }
|
<?php }
|
||||||
}else{
|
}else{
|
||||||
@ -418,6 +424,7 @@
|
|||||||
<td class="celda_normal trpGasConsumption"
|
<td class="celda_normal trpGasConsumption"
|
||||||
data-id="<?=$dateInMonth?>"
|
data-id="<?=$dateInMonth?>"
|
||||||
contenteditable="true"
|
contenteditable="true"
|
||||||
|
oninput = "gasConsumptionChange(this)"
|
||||||
>0</td>
|
>0</td>
|
||||||
<td class="celda_normal"
|
<td class="celda_normal"
|
||||||
contenteditable="true"
|
contenteditable="true"
|
||||||
@ -425,6 +432,7 @@
|
|||||||
<td class="celda_normal rotaryGasConsumption"
|
<td class="celda_normal rotaryGasConsumption"
|
||||||
data-id="<?=$dateInMonth?>"
|
data-id="<?=$dateInMonth?>"
|
||||||
contenteditable="true"
|
contenteditable="true"
|
||||||
|
oninput = "gasConsumptionChange(this)"
|
||||||
>0</td>
|
>0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php }
|
<?php }
|
||||||
@ -439,6 +447,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div> <!-- End card-body -->
|
</div> <!-- End card-body -->
|
||||||
@ -455,6 +470,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
|
|
||||||
<!-- filter modal -->
|
<!-- filter modal -->
|
||||||
@ -715,6 +736,7 @@
|
|||||||
let currentBalanceStock = Number(totalGas) - ( Number(toatalGasConsumption) );
|
let currentBalanceStock = Number(totalGas) - ( Number(toatalGasConsumption) );
|
||||||
|
|
||||||
document.querySelector(`td.total[data-id="${dataId}"]`).innerText = totalGas;
|
document.querySelector(`td.total[data-id="${dataId}"]`).innerText = totalGas;
|
||||||
|
document.querySelector(`td.consumption[data-id="${dataId}"]`).innerText =toatalGasConsumption ;
|
||||||
document.querySelector(`td.balanceStock[data-id="${dataId}"]`).innerText = currentBalanceStock;
|
document.querySelector(`td.balanceStock[data-id="${dataId}"]`).innerText = currentBalanceStock;
|
||||||
|
|
||||||
updateStockValue( date,currentBalanceStock )
|
updateStockValue( date,currentBalanceStock )
|
||||||
|
|||||||
@ -816,7 +816,7 @@ if (!empty($Emp)) {
|
|||||||
url: "<?php echo base_url() ?>addNewRequisition",
|
url: "<?php echo base_url() ?>addNewRequisition",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
// $('#content').loader('hide');
|
|
||||||
alert(data);
|
alert(data);
|
||||||
$('#txtRowCount').val('');
|
$('#txtRowCount').val('');
|
||||||
$('#txtDeletedRow').val('');
|
$('#txtDeletedRow').val('');
|
||||||
|
|||||||
@ -110,6 +110,16 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.celda_encabezado_total {
|
||||||
|
background-color:rgb(162, 41, 0);
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
color: #ffffff;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 6px 10px;
|
||||||
|
;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
._Separador {
|
._Separador {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@ -301,8 +311,43 @@ foreach ($period as $day) {
|
|||||||
<tbody style="background-color: #fff;">
|
<tbody style="background-color: #fff;">
|
||||||
|
|
||||||
<?php if (!empty($groupedResinStockDetails)) {
|
<?php if (!empty($groupedResinStockDetails)) {
|
||||||
//dd($groupedResinStockDetails);
|
|
||||||
|
function sumMaterialValues($groupedResinStockDetails) {
|
||||||
|
$summary = [];
|
||||||
|
|
||||||
|
foreach ($groupedResinStockDetails as $resinStockDetails) {
|
||||||
|
foreach ($resinStockDetails as $resinStock) {
|
||||||
|
$materialCode = $resinStock['materialCode']; // Unique identifier
|
||||||
|
|
||||||
|
// Initialize the material entry if it doesn't exist
|
||||||
|
if (!isset($summary[$materialCode])) {
|
||||||
|
$summary[$materialCode] = [
|
||||||
|
'opening' => "-" ,
|
||||||
|
'receipt' => 0,
|
||||||
|
'used' => 0,
|
||||||
|
'balanceStock' => 0,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sum values for the material
|
||||||
|
;
|
||||||
|
$summary[$materialCode]['opening'] = "-" ;
|
||||||
|
$summary[$materialCode]['receipt'] += $resinStock['receipt'];
|
||||||
|
$summary[$materialCode]['used'] += $resinStock['used'];
|
||||||
|
$summary[$materialCode]['balanceStock'] = $resinStock['balanceStock'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $summary;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Example usage:
|
||||||
|
$summary = sumMaterialValues($groupedResinStockDetails);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach ($groupedResinStockDetails as $groupedResinStockDetailsIndex => $resinStockDetails) {
|
foreach ($groupedResinStockDetails as $groupedResinStockDetailsIndex => $resinStockDetails) {
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr
|
<tr
|
||||||
|
|
||||||
@ -314,7 +359,9 @@ foreach ($period as $day) {
|
|||||||
echo 'style="background: #cef0ad;"';
|
echo 'style="background: #cef0ad;"';
|
||||||
}
|
}
|
||||||
?>>
|
?>>
|
||||||
<?php foreach ($resinStockDetails as $resinStockIndex => $resinStock) { ?>
|
<?php foreach ($resinStockDetails as $resinStockIndex => $resinStock) {
|
||||||
|
|
||||||
|
?>
|
||||||
<?php if ($resinStockIndex == 0): ?>
|
<?php if ($resinStockIndex == 0): ?>
|
||||||
<?php
|
<?php
|
||||||
$startDate = DateTime::createFromFormat('Y-m-d', $resinStock['date'])->format('d-m-Y');
|
$startDate = DateTime::createFromFormat('Y-m-d', $resinStock['date'])->format('d-m-Y');
|
||||||
@ -369,6 +416,40 @@ foreach ($period as $day) {
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table id="resinStockDetailsTableSummaryId" class="fht-table table-striped">
|
||||||
|
|
||||||
|
<thead >
|
||||||
|
<th class="celda_encabezado_total">Total Sum</th>
|
||||||
|
<?php foreach($summary as $each){ ?>
|
||||||
|
<th class="celda_encabezado_total">Opening Stock</th>
|
||||||
|
<th class="celda_encabezado_total">Receipt</th>
|
||||||
|
<th class="celda_encabezado_total">Used</th>
|
||||||
|
<th class="celda_encabezado_total">Balance Stock</th>
|
||||||
|
<?php } ?>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td> </td>
|
||||||
|
<?php foreach($summary as $each){ ?>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="celda_normal "><?=$each['opening']?></td>
|
||||||
|
<td class="celda_normal "><?=$each['receipt']?></td>
|
||||||
|
<td class="celda_normal "><?=$each['used']?></td>
|
||||||
|
<td class="celda_normal "><?=$each['balanceStock']?></td>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- this else condition work if groupedBagStockDetails is empty and creating new records
|
<!-- this else condition work if groupedBagStockDetails is empty and creating new records
|
||||||
with initial values 0 for entire month -->
|
with initial values 0 for entire month -->
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user