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;">
|
<tbody style="background-color: #fff;">
|
||||||
|
|
||||||
<?php if (!empty($totalDiesel)) {
|
<?php if (!empty($totalDiesel) && !empty($groupedDieselMachineStockDetails)) {
|
||||||
|
|
||||||
$summary = [];
|
$summary = [];
|
||||||
|
|
||||||
foreach ($groupedDieselMachineStockDetails as $groupedDieselMachineStockDetailsIndex => $dieselStockDetails) {
|
foreach ($groupedDieselMachineStockDetails as $rowIndex => $dieselStockDetails) {
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr
|
<tr
|
||||||
@ -594,7 +594,7 @@ foreach ($period as $day) {
|
|||||||
|
|
||||||
|
|
||||||
<?php
|
<?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">
|
<td class="celda_normal">
|
||||||
@ -603,37 +603,37 @@ foreach ($period as $day) {
|
|||||||
|
|
||||||
|
|
||||||
<td class="celda_normal openingTD"
|
<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)"
|
oninput="openingTDStockChange(this)"
|
||||||
contenteditable="true"
|
contenteditable="true"
|
||||||
<?php endif; ?>><?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['opening_stock'] ?? ' ' ?></td>
|
<?php endif; ?>><?= $totalDiesel[$rowIndex]['opening_stock'] ?? ' ' ?></td>
|
||||||
|
|
||||||
|
|
||||||
<td class="celda_normal purchaseTD"
|
<td class="celda_normal purchaseTD"
|
||||||
data-id="<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['date'] ?>"
|
data-id="<?= $totalDiesel[$rowIndex]['date'] ?>"
|
||||||
|
|
||||||
oninput="purchaseTDStockChange(this)"
|
oninput="purchaseTDStockChange(this)"
|
||||||
contenteditable="true">
|
contenteditable="true">
|
||||||
|
|
||||||
<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['purchase_diesel'] ?? ' ' ?>
|
<?= $totalDiesel[$rowIndex]['purchase_diesel'] ?? ' ' ?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="celda_normal fillingTD"
|
<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>
|
||||||
|
|
||||||
<td class="celda_normal balanceTD"
|
<td class="celda_normal balanceTD"
|
||||||
data-id="<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['date'] ?>">
|
data-id="<?= $totalDiesel[$rowIndex]['date'] ?>">
|
||||||
|
|
||||||
<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock'] ?? ' ' ?>
|
<?= $totalDiesel[$rowIndex]['balance_stock'] ?? ' ' ?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
@ -643,15 +643,15 @@ foreach ($period as $day) {
|
|||||||
//before closing outer loop
|
//before closing outer loop
|
||||||
|
|
||||||
if (!isset($summary['totalPurchaseDiesel'])) {
|
if (!isset($summary['totalPurchaseDiesel'])) {
|
||||||
$summary['opening_diesel'] = '-';
|
$summary['openingStock'] = '-';
|
||||||
$summary['totalPurchaseDiesel'] = 0;
|
$summary['totalPurchaseDiesel'] = 0;
|
||||||
$summary['totalFillingDiesel'] = 0;
|
$summary['totalFillingDiesel'] = 0;
|
||||||
$summary['balanceStock'] = 0;
|
$summary['balanceStock'] = 0;
|
||||||
}
|
}
|
||||||
|
$summary['openingStock'] = is_numeric($totalDiesel[$rowIndex]['opening_stock']) ? $totalDiesel[$rowIndex]['opening_stock'] : 0;
|
||||||
$summary['totalPurchaseDiesel'] += is_numeric($totalDiesel[$groupedDieselMachineStockDetailsIndex]['purchase_diesel']) ? $totalDiesel[$groupedDieselMachineStockDetailsIndex]['purchase_diesel'] : 0;
|
$summary['totalPurchaseDiesel'] += is_numeric($totalDiesel[$rowIndex]['purchase_diesel']) ? $totalDiesel[$rowIndex]['purchase_diesel'] : 0;
|
||||||
$summary['totalFillingDiesel'] += is_numeric($totalDiesel[$groupedDieselMachineStockDetailsIndex]['total_filling_diesel']) ? $totalDiesel[$groupedDieselMachineStockDetailsIndex]['total_filling_diesel'] : 0;
|
$summary['totalFillingDiesel'] += is_numeric($totalDiesel[$rowIndex]['total_filling_diesel']) ? $totalDiesel[$rowIndex]['total_filling_diesel'] : 0;
|
||||||
$summary['balanceStock'] = is_numeric($totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock']) ? $totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock'] : 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"
|
<td class="celda_normal openingReading"
|
||||||
data-id="<?= $dieselStock['date'] ?> <?= $dieselStock['machine_id'] ?>"
|
data-id="<?= $dieselStock['date'] ?> <?= $dieselStock['machine_id'] ?>"
|
||||||
|
|
||||||
<?php if ($groupedDieselMachineStockDetailsIndex == 0): ?>
|
<?php if ($rowIndex == 0): ?>
|
||||||
oninput="openingReadingChange(this)"
|
oninput="openingReadingChange(this)"
|
||||||
contenteditable="true"
|
contenteditable="true"
|
||||||
<?php endif; ?>>
|
<?php endif; ?>>
|
||||||
@ -781,7 +781,7 @@ foreach ($period as $day) {
|
|||||||
</td>
|
</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['totalPurchaseDiesel'] ?></td>
|
||||||
<td class="celda_normal "><?= $summary['totalFillingDiesel'] ?></td>
|
<td class="celda_normal "><?= $summary['totalFillingDiesel'] ?></td>
|
||||||
<td class="celda_normal "><?= $summary['balanceStock'] ?></td>
|
<td class="celda_normal "><?= $summary['balanceStock'] ?></td>
|
||||||
@ -836,41 +836,115 @@ foreach ($period as $day) {
|
|||||||
</td>
|
</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
|
<?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) {
|
foreach ($dieselMachines as $dieselMachineIndex => $dieselMachine) {
|
||||||
?>
|
?>
|
||||||
<!-- this will loop till machines present -->
|
<!-- this will loop till machines present -->
|
||||||
@ -1566,8 +1640,7 @@ foreach ($period as $day) {
|
|||||||
const box = child.getBoundingClientRect();
|
const box = child.getBoundingClientRect();
|
||||||
const offset = y - box.top - box.height / 2;
|
const offset = y - box.top - box.height / 2;
|
||||||
|
|
||||||
return offset < 0 && offset > closest.offset ?
|
return offset < 0 && offset > closest.offset ? {
|
||||||
{
|
|
||||||
offset,
|
offset,
|
||||||
element: child
|
element: child
|
||||||
} :
|
} :
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user