BBnepal-Accounts/account/application/views/inventory/sales/view.php

104 lines
6.4 KiB
PHP
Raw Normal View History

2024-07-10 12:43:19 +00:00
<div class="content-wrapper">
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col">
<div class="card card-primary card-outline">
<div class="card-header">
2024-08-11 11:44:32 +00:00
<!-- <button class="btn btn-primary btn-xs float-right" style="margin-left: 2px;" onclick="printDiv('printableArea')"><i class="fas fa-print"></i></button> -->
2024-07-10 12:43:19 +00:00
<h5 class="m-0"><?php echo $pageTitle; ?> <a href="<?php echo site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/create"); ?>" class="btn btn-sm btn-primary float-right">Create New <?php echo $pageTitle; ?></a></h5>
</div>
2024-08-11 11:44:32 +00:00
<div id="printableArea">
2024-07-10 12:43:19 +00:00
<div class="card-body">
<div class="row bill-header">
<div class="col text-center">
<h2>Sales Details</h2>
</div>
</div>
<div class="row bill-details">
<div class="col">
<p><strong>Bill Number:</strong> <?php echo $Sales->sales_id; ?></p>
2024-07-26 07:05:15 +00:00
<p><strong>Date:</strong> <?php echo dbDate($Sales->sales_date); ?></p>
2024-10-08 10:02:07 +00:00
<p><strong>Vendor:</strong> <?php echo (($this->myaccounts->getAccountDetails($Sales->accounts_id)->account_name ?? "")); ?></p>
2024-07-10 12:43:19 +00:00
</div>
</div>
<div class="row bill-items">
<div class="col">
<div class="item-row">
<div class="row">
<div class="col">
<p><strong>Item</strong></p>
</div>
<div class="col">
<p><strong>Quantity</strong></p>
</div>
2024-08-08 06:31:46 +00:00
<div class="col text-right">
2024-07-10 12:43:19 +00:00
<p><strong>Price</strong></p>
</div>
2024-10-08 10:02:07 +00:00
<div class="col text-right">
<p><strong>VAT</strong></p>
</div>
2024-08-08 06:31:46 +00:00
<div class="col text-right">
2024-07-10 12:43:19 +00:00
<p><strong>Total</strong></p>
</div>
</div>
</div>
<?php $total=0; foreach($SalesDetails as $SalesDetail): if($SalesDetail->items_id!=""):?>
<div class="item-row">
<div class="row">
<div class="col">
<p><?php echo getFieldfromValue("tbl_items","title","item_id",$SalesDetail->items_id); ?></p>
</div>
<div class="col">
<p><?php $qty=$SalesDetail->qty; echo $qty; ?></p>
</div>
<div class="col">
<p><?php $rate=$SalesDetail->rate; echo myCurrency($rate); ?></p>
</div>
2024-10-08 10:02:07 +00:00
<div class="col">
<p><?php $vat=($SalesDetail->vat); echo myCurrency($vat); ?></p>
</div>
2024-07-10 12:43:19 +00:00
<div class="col">
<p><?php $ltotal=$rate*$qty; $total+=$ltotal; echo myCurrency($ltotal); ?></p>
</div>
</div>
</div>
<?php endif; endforeach; ?>
2024-07-16 06:58:55 +00:00
<?php $discount = $Sales->discount ?>
2024-07-10 12:43:19 +00:00
</div>
</div>
<div class="row bill-footer">
<div class="col text-right">
<p><strong>Subtotal:</strong> <?php echo myCurrency($total,true); ?></p>
2024-08-08 06:31:46 +00:00
<?php $discounted = 0; ?>
<?php if($discount > 0): ?>
<p><strong>Discount percent:</strong> <?php echo myCurrency($discount,true); ?></p>
<?php $discounted = ($total*$discount/100) ?>
<p><strong>Discount amount:</strong> <?php echo myCurrency($discounted,true); ?></p>
<?php endif; ?>
2024-07-16 06:58:55 +00:00
<?php $taxable = $total - $discounted ?>
2024-08-08 06:31:46 +00:00
<?php $tax = 0; ?>
<?php //print_r($Purchase->vatToggle);die; ?>
<!-- <?php //if($Sales->vatToggle != 1): ?> -->
<p><strong>Taxable amount:</strong> <?php echo myCurrency($taxable,true); ?></p>
2024-10-08 10:02:07 +00:00
<!-- <p><strong>Tax (13%):</strong> <?php echo myCurrency($tax=($taxable*13)/100,true); ?></p> -->
2024-08-08 06:31:46 +00:00
<!-- <?php //endif; ?> -->
2024-10-08 10:02:07 +00:00
<!-- <p><strong>Total:</strong> <?php echo myCurrency(($taxable+$tax),true); ?></p> -->
<p><strong>Total:</strong> <?php echo myCurrency(($taxable),true); ?></p>
2024-07-10 12:43:19 +00:00
</div>
</div>
2024-08-11 11:44:32 +00:00
</div>
2024-07-16 06:58:55 +00:00
</div>
2024-07-10 12:43:19 +00:00
</div>
</div>
</div>
</div>
</div>
</div>