salesvspurchase and final accounts pages change

This commit is contained in:
Sampanna Rimal
2024-08-05 13:13:06 +05:45
parent c16163bf01
commit d164f3139d
18 changed files with 743 additions and 412 deletions

View File

@ -79,7 +79,7 @@
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="description"><?php myLang('Description'); ?></label>
<label for="description"><?php myLang('Remarks'); ?></label>
<textarea class="form-control" id="description" name="description"><?php echo isset($item) ? $item->description : ''; ?></textarea>
</div>
</div>

View File

@ -38,10 +38,10 @@
<p><strong>Quantity</strong></p>
</div>
<div class="col">
<p><strong>Price</strong></p>
<p class="text-right"><strong>Price</strong></p>
</div>
<div class="col">
<p><strong>Total</strong></p>
<p class="text-right"><strong>Total</strong></p>
</div>
</div>
</div>

View File

@ -18,7 +18,7 @@
<div class="container-fluid">
<div class="row">
<div class="col">
<div class="card card-primary card-outline">
<!-- <div class="card card-primary card-outline">
<div class="card-header">
Purchase Vs Sales
</div>
@ -111,7 +111,7 @@
</div>
</div>
</div>
</div>
</div> -->
<!-- New Table -->
<div class="card card-primary card-outline">
<div class="card-header">
@ -126,23 +126,26 @@
<th rowspan="2" width="30" valign="middle"><?php myLang('S.No.'); ?></th>
<th rowspan="2"><?php myLang('Item'); ?></th>
<th rowspan="2"><?php myLang('Units'); ?></th>
<th colspan="2" class="text-center"><?php myLang('Opening Stock'); ?></th>
<th colspan="3" class="text-center"><?php myLang('Purchase'); ?></th>
<th colspan="3" class="text-center"><?php myLang('Sales'); ?></th>
<th rowspan="2" class="text-center"><?php myLang('Sold Inventory %'); ?></th>
<th rowspan="2" class="text-center"><?php myLang('Remaining Inventory %'); ?></th>
<th colspan="2" class="text-center"><?php myLang('Remaining Inventory'); ?></th>
<th rowspan="2" class="text-center"><?php myLang('Cost of Goods Sold'); ?></th>
<th rowspan="2" class="text-right"><?php myLang('Cost of Goods Sold'); ?></th>
<th rowspan="2" class="text-center"><?php myLang('Gross Profit Margin'); ?></th>
</tr>
<tr>
<th class="text-center"><?php myLang('Qty'); ?></th>
<th class="text-center"><?php myLang('Avg. Rate'); ?></th>
<th class="text-center"><?php myLang('Amount'); ?></th>
<th class="text-center"><?php myLang('Qty'); ?></th>
<th class="text-center"><?php myLang('Avg. Rate'); ?></th>
<th class="text-center"><?php myLang('Amount'); ?></th>
<th class="text-center"><?php myLang('Qty'); ?></th>
<th class="text-center"><?php myLang('Value'); ?></th>
<th class="text-right"><?php myLang('Qty'); ?></th>
<th class="text-right"><?php myLang('Value'); ?></th>
<th class="text-right"><?php myLang('Qty'); ?></th>
<th class="text-right"><?php myLang('Avg. Rate'); ?></th>
<th class="text-right"><?php myLang('Amount'); ?></th>
<th class="text-right"><?php myLang('Qty'); ?></th>
<th class="text-right"><?php myLang('Avg. Rate'); ?></th>
<th class="text-right"><?php myLang('Amount'); ?></th>
<th class="text-right"><?php myLang('Qty'); ?></th>
<th class="text-right"><?php myLang('Value'); ?></th>
</tr>
</thead>
@ -167,11 +170,13 @@
<td class="text-center">100%</td>
</tr> -->
<?php
$spuramount = 0;
$ssalamount = 0;
$sclqty = 0;
$sclamount = 0;
$scogs = 0;
$sumpuramount = 0;
$sumsaleamount = 0;
$sumclqty = 0;
$sumoqty = 0;
$sumoamount = 0;
$sumclamount = 0;
$sumcogs = 0;
?>
<?php $a = 0;
foreach ($StockItems as $Stock) : $a++; ?>
@ -179,16 +184,18 @@
<td><?php echo $a; ?></td>
<td><?php echo $Stock->Item->title; ?></td>
<td><?php echo $Stock->Summary->Unit->title; ?></td>
<td class="text-right"><?php echo $oqty = $Stock->Summary->Opening->qty; ?></td>
<td class="text-right"><?php echo myCurrency($oamount = $Stock->Summary->Opening->amount); ?></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 $soldinventory = ((($Stock->Summary->Opening->qty)+($Stock->Summary->Purchase->qty)-($Stock->Summary->Closing->qty))/(($Stock->Summary->Opening->qty)+($Stock->Summary->Purchase->qty)))*100; ?>
<td class="text-center"><?php echo number_format($soldinventory, 2). "%"; ?></td>
<?php $remaininventory = 100 - $soldinventory; ?>
<td class="text-center"><?php echo $remaininventory . "%"; ?></td>
<td class="text-center"><?php echo number_format($remaininventory, 2) . "%"; ?></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); ?>
@ -199,11 +206,13 @@
<td></td>
<?php
$spuramount += $puramount;
$ssalamount += $salamount;
$sclqty += $clqty;
$sclamount += $clamount;
$scogs += $cogs;
$sumoqty += $oqty;
$sumoamount += $oamount;
$sumpuramount += $puramount;
$sumsaleamount += $salamount;
$sumclqty += $clqty;
$sumclamount += $clamount;
$sumcogs += $cogs;
?>
</tr>
@ -212,16 +221,20 @@
</tbody>
<tfoot>
<tr>
<td colspan="5" class="text-right text-bold">Grand Total</td>
<td class="text-right text-bold"><?php echo $spuramount ?></td>
<td colspan="3" class="text-right text-bold">Grand Total</td>
<td class="text-right text-bold"><?php echo $sumoqty ?></td>
<td class="text-right text-bold"><?php echo number_format($sumoamount, 2) ?></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"><?php echo number_format($sumpuramount, 2) ?></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"><?php echo number_format($sumsaleamount, 2) ?></td>
<td class="text-right text-bold"></td>
<td class="text-right text-bold"></td>
<td class="text-right text-bold"><?php echo $sumclqty ?></td>
<td class="text-right text-bold"><?php echo number_format($sumclamount, 2) ?></td>
<td class="text-right text-bold"><?php echo number_format($sumcogs, 2) ?></td>
<td class="text-right text-bold"></td>
</tr>

View File

@ -155,7 +155,7 @@
</div>
</div>
<div class="dropdown-divider"></div>
<buttom type="submit" class="btn btn-primary mr-2 text-center">Search Now</buttom>
<button type="submit" class="btn btn-primary mr-2 text-center">Search Now</button>
</div>
</div>
<div class="btn-group">