stock module latest today vadivel J 19-01-2025
This commit is contained in:
parent
0078d8471e
commit
0d75fd2c32
@ -643,15 +643,15 @@ td {
|
||||
$.ajax({
|
||||
data: $('.requistion').serialize() + "&serviceSchedule=" + serviceSchedule + "&servicePeriod=" + servicePeriod + "&noOfService=" + noOfService,
|
||||
type: "POST",
|
||||
url: "<?php echo base_url() ?>EditRequisition",
|
||||
url: "<?php echo base_url() ?>EditRequisition" ,
|
||||
success: function(data) {
|
||||
if (data) {
|
||||
$('#loader').hide();
|
||||
alert(data);
|
||||
$('#txtRowCount').val('');
|
||||
$('#txtDeletedRow').val('');
|
||||
$('#loader').hide() ;
|
||||
alert(data) ;
|
||||
$('#txtRowCount').val('') ;
|
||||
$('#txtDeletedRow').val('') ;
|
||||
|
||||
window.location = "Requisition";
|
||||
window.location = "Requisition" ;
|
||||
|
||||
} else {
|
||||
$('#loader').hide();
|
||||
|
||||
@ -329,19 +329,25 @@
|
||||
<?=$gasStockDetail['coatingMachineGasconsumption']??'0'?></td>
|
||||
<td class="celda_normal">
|
||||
<?=$gasStockDetail['coatedSand']??'0'?></td>
|
||||
|
||||
<td class="celda_normal trpGasConsumption"
|
||||
data-id="<?=$gasStockDetail['date']?>"
|
||||
oninput = "gasConsumptionChange(this)"
|
||||
contenteditable="true" >
|
||||
<?=$gasStockDetail['trpMachineGasconsumption']??'0'?></td>
|
||||
|
||||
<td class="celda_normal"
|
||||
contenteditable="true" >
|
||||
<?=$gasStockDetail['sandTrp']??'0'?>
|
||||
</td>
|
||||
|
||||
<td class="celda_normal rotaryGasConsumption"
|
||||
data-id="<?=$gasStockDetail['date']?>"
|
||||
oninput = "gasConsumptionChange(this)"
|
||||
contenteditable="true" >
|
||||
<?=$gasStockDetail['rotaryDrierMachineGasconsumption']??'0'?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php }
|
||||
}else{
|
||||
@ -418,13 +424,15 @@
|
||||
<td class="celda_normal trpGasConsumption"
|
||||
data-id="<?=$dateInMonth?>"
|
||||
contenteditable="true"
|
||||
oninput = "gasConsumptionChange(this)"
|
||||
>0</td>
|
||||
<td class="celda_normal"
|
||||
contenteditable="true"
|
||||
>0</td>
|
||||
>0</td>
|
||||
<td class="celda_normal rotaryGasConsumption"
|
||||
data-id="<?=$dateInMonth?>"
|
||||
contenteditable="true"
|
||||
oninput = "gasConsumptionChange(this)"
|
||||
>0</td>
|
||||
</tr>
|
||||
<?php }
|
||||
@ -439,6 +447,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div> <!-- End card-body -->
|
||||
@ -455,6 +470,12 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Modal -->
|
||||
|
||||
<!-- filter modal -->
|
||||
@ -715,9 +736,10 @@
|
||||
let currentBalanceStock = Number(totalGas) - ( Number(toatalGasConsumption) );
|
||||
|
||||
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;
|
||||
|
||||
updateStockValue( date,currentBalanceStock )
|
||||
updateStockValue( date,currentBalanceStock )
|
||||
|
||||
} catch(error){
|
||||
console.error("There is an error updating stock ..!!" + error);
|
||||
|
||||
@ -816,7 +816,7 @@ if (!empty($Emp)) {
|
||||
url: "<?php echo base_url() ?>addNewRequisition",
|
||||
success: function(data) {
|
||||
if (data) {
|
||||
// $('#content').loader('hide');
|
||||
|
||||
alert(data);
|
||||
$('#txtRowCount').val('');
|
||||
$('#txtDeletedRow').val('');
|
||||
|
||||
@ -110,6 +110,16 @@
|
||||
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 {
|
||||
background-color: #fff;
|
||||
@ -301,8 +311,43 @@ foreach ($period as $day) {
|
||||
<tbody style="background-color: #fff;">
|
||||
|
||||
<?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) {
|
||||
|
||||
?>
|
||||
<tr
|
||||
|
||||
@ -314,7 +359,9 @@ foreach ($period as $day) {
|
||||
echo 'style="background: #cef0ad;"';
|
||||
}
|
||||
?>>
|
||||
<?php foreach ($resinStockDetails as $resinStockIndex => $resinStock) { ?>
|
||||
<?php foreach ($resinStockDetails as $resinStockIndex => $resinStock) {
|
||||
|
||||
?>
|
||||
<?php if ($resinStockIndex == 0): ?>
|
||||
<?php
|
||||
$startDate = DateTime::createFromFormat('Y-m-d', $resinStock['date'])->format('d-m-Y');
|
||||
@ -369,6 +416,40 @@ foreach ($period as $day) {
|
||||
</tr>
|
||||
|
||||
<?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
|
||||
with initial values 0 for entire month -->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user