photo remaining

This commit is contained in:
Sampanna Rimal
2024-07-16 12:43:55 +05:45
parent 7ffe31e260
commit de0b041520
18 changed files with 273 additions and 198 deletions

View File

@ -147,10 +147,10 @@
</tr>
</thead>
<tbody>
<tr>
<!-- <tr>
<td>1</td>
<td>Education</td>
<td>Pcs</td>
<td>Example</td>
<td>Example</td>
<td class="text-center">1000</td>
<td class="text-right">1000</td>
<td class="text-right">200000</td>
@ -165,43 +165,64 @@
<td class="text-center">100%</td>
</tr>
</tr> -->
<?php
$spuramount = 0;
$ssalamount = 0;
$sclqty = 0;
$sclamount = 0;
$scogs = 0;
?>
<?php $a = 0;
foreach ($StockRecords as $Stock) : $a++; ?>
foreach ($StockItems as $Stock) : $a++; ?>
<tr>
<td><?php echo $a; ?></td>
<td><?php echo $Stock->Item->title; ?></td>
<td><?php echo $Stock->Item->Unit->title; ?></td>
<td class="text-right"><?php echo $Stock->qty; ?></td>
<td class="text-right"><?php echo $Stock->price; ?></td>
<td class="text-right"><?php echo $Stock->qty * $Stock->price; ?></td>
<td> </td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><?php echo $Stock->Summary->Unit->title; ?></td>
<td class="text-right"><?php echo $Stock->Summary->Purchase->qty; ?></td>
<td class="text-right"><?php echo myCurrency($Stock->Summary->Purchase->rate); ?></td>
<td class="text-right"><?php echo myCurrency($puramount=$Stock->Summary->Purchase->amount); ?></td>
<td class="text-right"><?php echo $Stock->Summary->Sales->qty; ?></td>
<td class="text-right"><?php echo myCurrency($Stock->Summary->Sales->rate); ?></td>
<td class="text-right"><?php echo myCurrency($salamount = $Stock->Summary->Sales->amount); ?></td>
<?php $soldinventory = ((($Stock->Summary->Opening->qty)-($Stock->Summary->Closing->qty))/($Stock->Summary->Opening->qty))*100; ?>
<td class="text-center"><?php echo $soldinventory . "%"; ?></td>
<?php $remaininventory = 100 - $soldinventory; ?>
<td class="text-center"><?php echo $remaininventory . "%"; ?></td>
<td class="text-right"><?php echo $clqty = $Stock->Summary->Closing->qty; ?></td>
<td class="text-right"><?php echo myCurrency($clamount = $Stock->Summary->Closing->amount); ?></td>
<?php $cogs = ($Stock->Summary->Sales->qty) * ($Stock->Summary->Purchase->rate); ?>
<td class="text-right"><?php echo myCurrency($cogs); ?></td>
<?php $gp=($Stock->Summary->Sales->qty) - $cogs; ?>
<?php $gpm = ($Stock->Summary->Sales->amount > 0) ? (($Stock->Summary->Sales->amount - $cogs) / $Stock->Summary->Sales->amount) * 100 : 0; ?>
<td class="text-center"><?php echo number_format($gpm, 2) . "%"; ?></td>
<td></td>
<?php
$spuramount += $puramount;
$ssalamount += $salamount;
$sclqty += $clqty;
$sclamount += $clamount;
$scogs += $cogs;
?>
</tr>
<?php //pre($Stock);
endforeach; ?>
</tbody>
</tbody>
<tfoot>
<tr>
<td colspan="5" class="text-right text-bold">Grand Total</td>
<td class="text-right text-bold">5000</td>
<td class="text-right text-bold">5000</td>
<td class="text-right text-bold">ad</td>
<td class="text-right text-bold">5000</td>
<td class="text-right text-bold">5000</td>
<td class="text-right text-bold">5000</td>
<td class="text-right text-bold">5000</td>
<td class="text-right text-bold">5000</td>
<td class="text-right text-bold">5000</td>
<td class="text-right text-bold">5000</td>
<td class="text-right text-bold"><?php echo $spuramount ?></td>
<td class="text-right text-bold"></td>
<td class="text-right text-bold"></td>
<td class="text-right text-bold"><?php echo $ssalamount ?></td>
<td class="text-right text-bold"></td>
<td class="text-right text-bold"></td>
<td class="text-right text-bold"><?php echo $sclqty ?></td>
<td class="text-right text-bold"><?php echo $sclamount ?></td>
<td class="text-right text-bold"><?php echo $scogs ?></td>
<td class="text-right text-bold"></td>
</tr>
</tfoot>