stock module - 01-04-2025
This commit is contained in:
parent
98855fd909
commit
e775324fa2
@ -574,11 +574,11 @@ foreach ($period as $day) {
|
||||
|
||||
<tbody style="background-color: #fff;">
|
||||
|
||||
<?php if (!empty($totalDiesel)) {
|
||||
<?php if (!empty($totalDiesel) && !empty($groupedDieselMachineStockDetails)) {
|
||||
|
||||
$summary = [];
|
||||
|
||||
foreach ($groupedDieselMachineStockDetails as $groupedDieselMachineStockDetailsIndex => $dieselStockDetails) {
|
||||
foreach ($groupedDieselMachineStockDetails as $rowIndex => $dieselStockDetails) {
|
||||
|
||||
?>
|
||||
<tr
|
||||
@ -594,7 +594,7 @@ foreach ($period as $day) {
|
||||
|
||||
|
||||
<?php
|
||||
$startDate = DateTime::createFromFormat('Y-m-d', $totalDiesel[$groupedDieselMachineStockDetailsIndex]['date'])->format('d-m-Y');
|
||||
$startDate = DateTime::createFromFormat('Y-m-d', $totalDiesel[$rowIndex]['date'])->format('d-m-Y');
|
||||
?>
|
||||
|
||||
<td class="celda_normal">
|
||||
@ -603,37 +603,37 @@ foreach ($period as $day) {
|
||||
|
||||
|
||||
<td class="celda_normal openingTD"
|
||||
data-id="<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['date'] ?>"
|
||||
data-id="<?= $totalDiesel[$rowIndex]['date'] ?>"
|
||||
|
||||
|
||||
|
||||
<?php if ($groupedDieselMachineStockDetailsIndex == 0): ?>
|
||||
<?php if ($rowIndex == 0): ?>
|
||||
oninput="openingTDStockChange(this)"
|
||||
contenteditable="true"
|
||||
<?php endif; ?>><?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['opening_stock'] ?? ' ' ?></td>
|
||||
<?php endif; ?>><?= $totalDiesel[$rowIndex]['opening_stock'] ?? ' ' ?></td>
|
||||
|
||||
|
||||
<td class="celda_normal purchaseTD"
|
||||
data-id="<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['date'] ?>"
|
||||
data-id="<?= $totalDiesel[$rowIndex]['date'] ?>"
|
||||
|
||||
oninput="purchaseTDStockChange(this)"
|
||||
contenteditable="true">
|
||||
|
||||
<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['purchase_diesel'] ?? ' ' ?>
|
||||
<?= $totalDiesel[$rowIndex]['purchase_diesel'] ?? ' ' ?>
|
||||
|
||||
</td>
|
||||
|
||||
<td class="celda_normal fillingTD"
|
||||
data-id="<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['date'] ?>">
|
||||
data-id="<?= $totalDiesel[$rowIndex]['date'] ?>">
|
||||
|
||||
<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['total_filling_diesel'] ?? ' ' ?>
|
||||
<?= $totalDiesel[$rowIndex]['total_filling_diesel'] ?? ' ' ?>
|
||||
|
||||
</td>
|
||||
|
||||
<td class="celda_normal balanceTD"
|
||||
data-id="<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['date'] ?>">
|
||||
data-id="<?= $totalDiesel[$rowIndex]['date'] ?>">
|
||||
|
||||
<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock'] ?? ' ' ?>
|
||||
<?= $totalDiesel[$rowIndex]['balance_stock'] ?? ' ' ?>
|
||||
|
||||
</td>
|
||||
|
||||
@ -643,15 +643,15 @@ foreach ($period as $day) {
|
||||
//before closing outer loop
|
||||
|
||||
if (!isset($summary['totalPurchaseDiesel'])) {
|
||||
$summary['opening_diesel'] = '-';
|
||||
$summary['openingStock'] = '-';
|
||||
$summary['totalPurchaseDiesel'] = 0;
|
||||
$summary['totalFillingDiesel'] = 0;
|
||||
$summary['balanceStock'] = 0;
|
||||
}
|
||||
|
||||
$summary['totalPurchaseDiesel'] += is_numeric($totalDiesel[$groupedDieselMachineStockDetailsIndex]['purchase_diesel']) ? $totalDiesel[$groupedDieselMachineStockDetailsIndex]['purchase_diesel'] : 0;
|
||||
$summary['totalFillingDiesel'] += is_numeric($totalDiesel[$groupedDieselMachineStockDetailsIndex]['total_filling_diesel']) ? $totalDiesel[$groupedDieselMachineStockDetailsIndex]['total_filling_diesel'] : 0;
|
||||
$summary['balanceStock'] = is_numeric($totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock']) ? $totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock'] : 0;
|
||||
$summary['openingStock'] = is_numeric($totalDiesel[$rowIndex]['opening_stock']) ? $totalDiesel[$rowIndex]['opening_stock'] : 0;
|
||||
$summary['totalPurchaseDiesel'] += is_numeric($totalDiesel[$rowIndex]['purchase_diesel']) ? $totalDiesel[$rowIndex]['purchase_diesel'] : 0;
|
||||
$summary['totalFillingDiesel'] += is_numeric($totalDiesel[$rowIndex]['total_filling_diesel']) ? $totalDiesel[$rowIndex]['total_filling_diesel'] : 0;
|
||||
$summary['balanceStock'] = is_numeric($totalDiesel[$rowIndex]['balance_stock']) ? $totalDiesel[$rowIndex]['balance_stock'] : 0;
|
||||
|
||||
?>
|
||||
|
||||
@ -675,7 +675,7 @@ foreach ($period as $day) {
|
||||
<td class="celda_normal openingReading"
|
||||
data-id="<?= $dieselStock['date'] ?> <?= $dieselStock['machine_id'] ?>"
|
||||
|
||||
<?php if ($groupedDieselMachineStockDetailsIndex == 0): ?>
|
||||
<?php if ($rowIndex == 0): ?>
|
||||
oninput="openingReadingChange(this)"
|
||||
contenteditable="true"
|
||||
<?php endif; ?>>
|
||||
@ -781,7 +781,7 @@ foreach ($period as $day) {
|
||||
</td>
|
||||
|
||||
|
||||
<td class="celda_normal "><?= $summary['opening_diesel'] ?></td>
|
||||
<td class="celda_normal "><?= $summary['openingStock'] ?></td>
|
||||
<td class="celda_normal "><?= $summary['totalPurchaseDiesel'] ?></td>
|
||||
<td class="celda_normal "><?= $summary['totalFillingDiesel'] ?></td>
|
||||
<td class="celda_normal "><?= $summary['balanceStock'] ?></td>
|
||||
@ -836,41 +836,115 @@ foreach ($period as $day) {
|
||||
</td>
|
||||
|
||||
|
||||
<td class="celda_normal openingTD"
|
||||
data-id="<?= $dateInMonth ?>"
|
||||
|
||||
<?php if ($datesInMonthIndex == 0) { ?>
|
||||
|
||||
oninput="openingTDStockChange(this)"
|
||||
contenteditable="true"
|
||||
|
||||
<?php } ?>><?= !empty($previousMonthTotalDieselMachineStockDetails)
|
||||
? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock']
|
||||
: " ";
|
||||
?></td>
|
||||
|
||||
|
||||
|
||||
<td class="celda_normal purchaseTD"
|
||||
data-id="<?= $dateInMonth ?>"
|
||||
|
||||
oninput="purchaseTDStockChange(this)"
|
||||
contenteditable="true"> </td>
|
||||
|
||||
<td class="celda_normal fillingTD"
|
||||
data-id="<?= $dateInMonth ?>"> </td>
|
||||
|
||||
<td class="celda_normal balanceTD"
|
||||
data-id="<?= $dateInMonth ?>"><?= !empty($previousMonthTotalDieselMachineStockDetails)
|
||||
? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock']
|
||||
: " ";
|
||||
?>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
// dd($previousMonthDieselMachineStockDetails);
|
||||
if (!empty($totalDiesel)) {
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<!-- total diesel present summary section of view starts -->
|
||||
|
||||
<td class="celda_normal openingTD"
|
||||
data-id="<?= $totalDiesel[$datesInMonthIndex]['date'] ?>"
|
||||
|
||||
|
||||
|
||||
<?php if ($datesInMonthIndex == 0): ?>
|
||||
oninput="openingTDStockChange(this)"
|
||||
contenteditable="true"
|
||||
<?php endif; ?>><?= $totalDiesel[$datesInMonthIndex]['opening_stock'] ?? ' ' ?></td>
|
||||
|
||||
|
||||
<td class="celda_normal purchaseTD"
|
||||
data-id="<?= $totalDiesel[$datesInMonthIndex]['date'] ?>"
|
||||
|
||||
oninput="purchaseTDStockChange(this)"
|
||||
contenteditable="true">
|
||||
|
||||
<?= $totalDiesel[$datesInMonthIndex]['purchase_diesel'] ?? ' ' ?>
|
||||
|
||||
</td>
|
||||
|
||||
<td class="celda_normal fillingTD"
|
||||
data-id="<?= $totalDiesel[$datesInMonthIndex]['date'] ?>">
|
||||
|
||||
<?= $totalDiesel[$datesInMonthIndex]['total_filling_diesel'] ?? ' ' ?>
|
||||
|
||||
</td>
|
||||
|
||||
<td class="celda_normal balanceTD"
|
||||
data-id="<?= $totalDiesel[$datesInMonthIndex]['date'] ?>">
|
||||
|
||||
<?= $totalDiesel[$datesInMonthIndex]['balance_stock'] ?? ' ' ?>
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<!-- total diesel present summary section of view ends -->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
<!-- total diesel absent summary section of view starts -->
|
||||
|
||||
<td class="celda_normal openingTD"
|
||||
data-id="<?= $dateInMonth ?>"
|
||||
|
||||
<?php if ($datesInMonthIndex == 0) { ?>
|
||||
|
||||
oninput="openingTDStockChange(this)"
|
||||
contenteditable="true"
|
||||
|
||||
<?php } ?>>
|
||||
|
||||
<?= !empty($previousMonthTotalDieselMachineStockDetails)
|
||||
? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock']
|
||||
: " ";
|
||||
?>
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
<td class="celda_normal purchaseTD"
|
||||
data-id="<?= $dateInMonth ?>"
|
||||
|
||||
oninput="purchaseTDStockChange(this)"
|
||||
contenteditable="true">
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
<td class="celda_normal fillingTD"
|
||||
data-id="<?= $dateInMonth ?>">
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
<td class="celda_normal balanceTD"
|
||||
data-id="<?= $dateInMonth ?>">
|
||||
|
||||
<?= !empty($previousMonthTotalDieselMachineStockDetails)
|
||||
? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock']
|
||||
: " ";
|
||||
?>
|
||||
|
||||
</td>
|
||||
|
||||
<!-- total diesel absent summary section of view ends -->
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- total diesel stock section of view ends -->
|
||||
<?php
|
||||
|
||||
foreach ($dieselMachines as $dieselMachineIndex => $dieselMachine) {
|
||||
?>
|
||||
<!-- this will loop till machines present -->
|
||||
@ -1566,8 +1640,7 @@ foreach ($period as $day) {
|
||||
const box = child.getBoundingClientRect();
|
||||
const offset = y - box.top - box.height / 2;
|
||||
|
||||
return offset < 0 && offset > closest.offset ?
|
||||
{
|
||||
return offset < 0 && offset > closest.offset ? {
|
||||
offset,
|
||||
element: child
|
||||
} :
|
||||
|
||||
Loading…
Reference in New Issue
Block a user