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">
|
|
|
|
<h5 class="m-0"><?php echo $pageTitle; ?> <?php showCreateButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add", "Create New " . $pageTitle); ?></h5>
|
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<?php $TableData = $this->db->query("select * from tbl_purchases where status=1")->result(); ?>
|
|
|
|
<table class="table table-bordered table-striped dataTable">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2024-08-25 12:52:52 +00:00
|
|
|
<th class="text-center"><?php myLang('S.N'); ?></th>
|
2024-07-10 12:43:19 +00:00
|
|
|
<th><?php myLang('Date'); ?></th>
|
|
|
|
<th><?php myLang('Purchase Transaction'); ?></th>
|
2024-08-09 03:54:49 +00:00
|
|
|
<th class="text-center"><?php myLang('Amount'); ?></th>
|
|
|
|
<td class="text-center"><b>Action</b></th>
|
2024-07-10 12:43:19 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php $a = 0;
|
|
|
|
foreach ($PurchaseRecords as $TableRow) : $a++; ?>
|
|
|
|
<?php foreach ($TableRow as $cols) : $id = $cols;
|
|
|
|
break;
|
|
|
|
endforeach; ?><tr>
|
|
|
|
<td><?php echo $TableRow->purchase_ref; ?></td>
|
|
|
|
<td><?php echo $TableRow->purchase_date; ?></td>
|
2024-10-08 10:02:07 +00:00
|
|
|
<td><b><?php echo (($this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name ?? "")); ?></b>
|
2024-07-10 12:43:19 +00:00
|
|
|
<div class="row ml-2 mr-2" style="border-bottom: 1px solid;">
|
|
|
|
<span class="col item_name"><?php echo myLang("Particulars") ?></span>
|
|
|
|
<span class="col item_qty"><?php echo myLang("Qty") ?></span>
|
|
|
|
<span class="col item_rate"><?php echo myLang("Rate") ?></span>
|
2024-10-08 10:02:07 +00:00
|
|
|
<span class="col item_vat"><?php echo myLang("vat") ?></span>
|
2024-07-10 12:43:19 +00:00
|
|
|
<span class="col item_amount"><?php echo myLang("Amount") ?></span>
|
|
|
|
</div>
|
|
|
|
<?php $l = 0;
|
|
|
|
foreach ($TableRow->Details as $r) : $l += (($r->qty) * ($r->rate)); ?>
|
|
|
|
<div class="row ml-2 mr-2">
|
|
|
|
<span class="col item_name"><?php echo $r->Item->title; ?></span>
|
|
|
|
<span class="col item_qty"><?php echo $r->qty; ?></span>
|
2024-10-08 10:02:07 +00:00
|
|
|
<span class="col item_rate"><?php echo myCurrency($r->rate, true); ?></span>
|
|
|
|
<span class="col item_vat"><?php echo myCurrency($r->vat, true); ?></span>
|
|
|
|
<span class="col item_amount"><?php echo myCurrency($r->qty * $r->rate, true); ?></span>
|
2024-07-10 12:43:19 +00:00
|
|
|
</div>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<div class="row ml-2 mr-2" style="border-top: 1px dotted;">
|
|
|
|
<span class="col item_name"> </span>
|
|
|
|
<span class="col item_qty"> </span>
|
|
|
|
<span class="col item_rate text-right">Total:</span>
|
|
|
|
<span class="col item_amount"><?php echo myCurrency($l); ?></span>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
<td><?php echo myCurrency($TableRow->TotalPurchase); ?></td>
|
2024-08-09 03:54:49 +00:00
|
|
|
<td class="text-center"><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$id"); ?>
|
2024-07-10 12:43:19 +00:00
|
|
|
<?php showDeleteButton($id); ?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<tbody>
|
|
|
|
</table>
|
|
|
|
<script>
|
|
|
|
function doDelete(id) {
|
|
|
|
if (confirm('Are you sure to delete?')) {
|
|
|
|
window.location = '<?php echo site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/delete/"); ?>' + id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|