commitall

This commit is contained in:
Sampanna Rimal
2024-07-10 18:28:19 +05:45
parent 140abda4e6
commit 9cd05ef3cb
15723 changed files with 4818733 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
<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 isset($itemcategory) ? 'Edit' : 'Add'; ?> <?php echo $pageTitle; ?> <?php showListButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/list","List ".$pageTitle); ?></h5>
</div>
<div class="card-body">
<form method="POST" action="<?php echo isset($itemcategory) ? site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/" . $itemcategory->itemcategory_id) : site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add"); ?>" enctype="multipart/form-data" name="tbl_itemcategories">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<?php fillComboWithValue("units_id","Units","units_id","tbl_units","title","unit_id", isset($itemcategory) ? $itemcategory->units_id : ''); ?>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="title"><?php myLang('Title'); ?></label><input type="text" class="form-control" id="title" value="<?php echo isset($itemcategory) ? $itemcategory->title : ''; ?>" name="title">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="description"><?php myLang('Description'); ?></label>
<textarea class="form-control" id="description" name="description"><?php echo isset($itemcategory) ? $itemcategory->description : ''; ?></textarea>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="display_order"><?php myLang('Display Order'); ?></label><input type="text" class="form-control" id="display_order" value="<?php echo isset($itemcategory) ? $itemcategory->display_order : ''; ?>" name="display_order">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks"><?php myLang('Remarks'); ?></label>
<textarea class="form-control" id="remarks" name="remarks"><?php echo isset($itemcategory) ? $itemcategory->remarks : ''; ?></textarea>
</div>
</div>
<!--COL END-->
</div>
<button type="reset" class="btn btn-default">Reset</button> <button class="btn btn-primary" type="submit" name="submit"><?php echo isset($itemcategory) ? 'Update' : 'Save'; ?></button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,128 @@
<div class="content-wrapper">
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-3">
<div class="card card-primary card-outline">
<div class="card-header">
<h5 class="m-0"><?php echo isset($itemcategory) ? 'Edit' : 'Add'; ?>
<?php //echo $pageTitle; ?> <?php myLang('Inventory Group'); ?>
<?php //echo $pageTitle; ?> <?php //myLang('Category'); ?>
<?php //showListButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/list","List ".$pageTitle); ?>
</h5>
</div>
<div class="card-body">
<form method="POST" action="<?php echo isset($itemcategory) ? site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/" . $itemcategory->itemcategory_id) : site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add"); ?>" enctype="multipart/form-data" name="tbl_itemcategories">
<div class="row">
<!--COL START-->
<!-- <div class="col">
<div class="form-group">
<?php //fillComboWithValue("units_id","Units","units_id","tbl_units","title","unit_id", isset($itemcategory) ? $itemcategory->units_id : ''); ?>
</div>
</div> -->
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="title"><?php myLang('Inventory Group'); ?> <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="title" value="<?php echo isset($itemcategory) ? $itemcategory->title : ''; ?>" name="title" required>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="description"><?php myLang('Description'); ?></label>
<textarea class="form-control" id="description" name="description"><?php echo isset($itemcategory) ? $itemcategory->description : ''; ?></textarea>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<!-- <div class="col">
<div class="form-group">
<label for="display_order"><?php //myLang('Display Order'); ?></label><input type="text" class="form-control" id="display_order" value="<?php //echo isset($itemcategory) ? $itemcategory->display_order : ''; ?>" name="display_order">
</div>
</div> -->
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<!-- <div class="col">
<div class="form-group">
<label for="remarks"><?php //myLang('Remarks'); ?></label>
<textarea class="form-control" id="remarks" name="remarks"><?php //echo isset($itemcategory) ? $itemcategory->remarks : ''; ?></textarea>
</div>
</div> -->
<!--COL END-->
</div>
<!-- <button type="reset" class="btn btn-default btn-sm">Reset</button> -->
<button class="btn btn-primary btn-sm float-right" type="submit" name="submit"><?php echo isset($itemcategory) ? 'Update' : 'Save'; ?></button>
</form>
</div>
</div>
</div>
<div class="col-9">
<div class="card card-primary card-outline">
<div class="card-header">
<h5 class="m-0"><?php myLang('List Inventory Groups'); ?>
<!-- <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_itemcategories where status=1")->result(); ?>
<table class="table table-bordered table-striped dataTable">
<thead>
<tr>
<th width="5%"><?php myLang('S.N'); ?></th>
<th width="30%"><?php myLang('Inventory Group'); ?></th>
<!-- <th width="5%"><?php //myLang('Unit'); ?></th> -->
<th width="57%"><?php myLang('Description'); ?></th>
<td width="8%"><?php myLang("Action"); ?></th>
</tr>
</thead>
<tbody>
<?php $a = 0;
foreach ($TableData as $TableRow) : $a++; ?>
<?php foreach ($TableRow as $cols) : $id = $cols;
break;
endforeach; ?><tr>
<td><?php echo $a; ?></td>
<td><?php echo $TableRow->title; ?></td>
<!-- <td><?php //echo getFieldfromValue("tbl_units", "title", "unit_id", $TableRow->units_id); ?></td> -->
<td><?php echo $TableRow->description; ?></td>
<td>
<?php showEditButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?>
<?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>

View File

@@ -0,0 +1,74 @@
<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 isset($item) ? 'Edit' : 'Add'; ?> <?php echo $pageTitle; ?> <?php showListButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/list", "List
" . $pageTitle); ?></h5>
</div>
<div class="card-body">
<form method="POST" action="<?php echo isset($item) ? site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/" . $item->item_id) : site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add"); ?>" enctype="multipart/form-data" name="tbl_items">
<div class="row">
<!--COL START-->
<div class="col-4">
<div class="form-group">
<?php fillComboWithValue("itemcategories_id", "Item Category", "itemcategories_id", "tbl_itemcategories", "title", "itemcategory_id", isset($item) ? $item->itemcategories_id : ''); ?>
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col-4">
<div class="form-group">
<label for="item_code"><?php myLang('Item Code'); ?></label><input type="text" class="form-control" id="item_code" value="<?php echo isset($item) ? $item->item_code : ''; ?>" name="item_code">
</div>
</div>
<!--COL END-->
<div class="col-4">
<div class="form-group">
<label for="display_order"><?php myLang('Display Order'); ?></label><input type="text" class="form-control" id="display_order" value="<?php echo isset($item) ? $item->display_order : ''; ?>" name="display_order">
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="title"><?php myLang('Title'); ?></label><input type="text" class="form-control" id="title" value="<?php echo isset($item) ? $item->title : ''; ?>" name="title">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="description"><?php myLang('Description'); ?></label>
<textarea class="form-control" id="description" name="description"><?php echo isset($item) ? $item->description : ''; ?></textarea>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<!--COL END-->
</div>
<!-- <div class="row">
<div class="col">
<div class="form-group">
<label for="remarks"><?php //myLang('Remarks'); ?></label>
<textarea class="form-control" id="remarks" name="remarks"><?php //echo isset($item) ? $item->remarks : ''; ?></textarea>
</div>
</div>
</div> -->
<button type="reset" class="btn btn-default">Reset</button> <button class="btn btn-primary" type="submit" name="submit"><?php echo isset($item) ? 'Update' : 'Save'; ?></button>
</form>
</div>

View File

@@ -0,0 +1,181 @@
<div class="content-wrapper">
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-4">
<div class="card card-primary card-outline">
<div class="card-header">
<h5 class="m-0">
<?php echo isset($item) ? 'Edit' : 'Add'; ?>
<?php myLang('Inventory Item'); ?>
<!-- <?php //echo $pageTitle;
?> -->
<?php //showListButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/list", "List " . $pageTitle);
?>
</h5>
</div>
<div class="card-body">
<form method="POST" action="<?php echo isset($item) ? site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/" . $item->item_id) : site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add"); ?>" enctype="multipart/form-data" name="tbl_items">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="title"><?php myLang('Name'); ?><span class="text-danger">*</span></label>
<input type="text" class="form-control" id="title" value="<?php echo isset($item) ? $item->title : ''; ?>" name="title" required>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col-6">
<div class="form-group">
<label for="item_code"><?php myLang('Code'); ?></label>
<input type="text" class="form-control" id="item_code" value="<?php echo isset($item) ? $item->item_code : ''; ?>" name="item_code">
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col-6">
<div class="form-group">
<?php fillComboWithValue("units_id", "Units", "units_id", "tbl_units", "title", "unit_id", isset($item) ? $item->units_id : '',); ?>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<?php fillComboWithValue("itemcategories_id", "Category", "itemcategories_id", "tbl_itemcategories", "title", "itemcategory_id", isset($item) ? $item->itemcategories_id : ''); ?>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col-4">
<div class="form-group">
<label for="opening_stock"><?php myLang('Opening Stock'); ?></label><input type="text" class="form-control" id="opening_stock" value="<?php echo isset($item) ? $item->Stock->opening_stock : ''; ?>" name="opening_stock">
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col-4">
<div class="form-group">
<label for="opening_stock_rate"><?php myLang('Rate'); ?></label><input type="text" class="form-control" id="opening_stock_rate" value="<?php echo isset($item) ? $item->Stock->opening_stock_rate : ''; ?>" name="opening_stock_rate">
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col-4">
<div class="form-group">
<label for="opening_stock_amount"><?php myLang('Amount'); ?></label><input type="text" class="form-control" id="opening_stock_amount" value="<?php echo isset($item) ? $item->Stock->opening_stock_amount : ''; ?>" name="opening_stock_amount">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="description"><?php myLang('Description'); ?></label>
<textarea class="form-control" id="description" name="description"><?php echo isset($item) ? $item->description : ''; ?></textarea>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<!--COL END-->
</div>
<!-- <div class="row">
<div class="col">
<div class="form-group">
<label for="remarks"><?php //myLang('Remarks');
?></label>
<textarea class="form-control" id="remarks" name="remarks"><?php //echo isset($item) ? $item->remarks : '';
?></textarea>
</div>
</div>
</div> -->
<!-- <button type="reset" class="btn btn-default btn-sm">Reset</button> -->
<button class="btn btn-primary btn-sm float-right" type="submit" name="submit"><?php echo isset($item) ? 'Update' : 'Save'; ?></button>
</form>
</div>
</div>
</div>
<div class="col-8">
<div class="card card-primary card-outline">
<div class="card-header">
<h5 class="m-0">List <?php echo $pageTitle; ?>
<?php //showCreateButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add", "Create New " . $pageTitle);
?>
</h5>
</div>
<div class="card-body">
<table class="table table-bordered table-striped dataTable">
<thead>
<tr>
<th width="5%"><?php myLang('S.N'); ?></th>
<th width="25%"><?php myLang('Name'); ?></th>
<th width="10%"><?php myLang('Code'); ?></th>
<th width="10%"><?php myLang('Units'); ?></th>
<th width="10%"><?php myLang('Category'); ?></th>
<th width="10%" class="text-right"><?php myLang('Qty'); ?></th>
<th width="10%" class="text-right"><?php myLang('Rate'); ?></th>
<th width="10%" class="text-right"><?php myLang('Total'); ?></th>
<td width="10%" class="text-bold"><?php myLang("Action"); ?></th>
</tr>
</thead>
<tbody>
<?php $a = 0;
foreach ($TableData as $TableRow) : $a++; ?>
<?php foreach ($TableRow as $cols) : $id = $cols;
break;
endforeach; ?><tr>
<td><?php echo $a; ?></td>
<td><?php echo $TableRow->title; ?></td>
<td><?php echo $TableRow->item_code; ?></td>
<td><?php echo getFieldfromValue("tbl_units", "title", "unit_id", $TableRow->units_id); ?></td>
<td><?php echo getFieldfromValue("tbl_itemcategories", "title", "itemcategory_id", $TableRow->itemcategories_id); ?></td>
<td class="text-right"><?php echo $TableRow->Stock->qty; ?></td>
<td class="text-right"><?php echo $TableRow->Stock->rate; ?></td>
<td class="text-right"><?php echo $TableRow->Stock->amount; ?></td>
<td>
<?php showEditButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?>
<?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>
<script>
// Function to calculate the amount
function calculateAmount() {
var opening_stock = parseFloat(document.getElementById('opening_stock').value);
var opening_stock_rate = parseFloat(document.getElementById('opening_stock_rate').value);
var opening_stock_amount = opening_stock * opening_stock_rate;
// Set the calculated amount in the amount field
document.getElementById('opening_stock_amount').value = opening_stock_amount.toFixed(2); // Adjust decimal places as needed
}
// Event listeners to trigger calculation on input change
document.getElementById('opening_stock').addEventListener('input', calculateAmount);
document.getElementById('opening_stock_rate').addEventListener('input', calculateAmount);
// Initial calculation on page load
calculateAmount();
</script>

View File

@@ -0,0 +1,65 @@
<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 isset($paymentmode) ? 'Edit' : 'Add'; ?> <?php echo $pageTitle; ?> <?php showListButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/list","List
".$pageTitle); ?></h5>
</div>
<div class="card-body">
<form method="POST" action="<?php echo isset($paymentmode) ? site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/" . $paymentmode->paymentmode_id) : site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add"); ?>" enctype="multipart/form-data" name="tbl_paymentmodes">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="title"><?php myLang('Title'); ?></label><input type="text" class="form-control" id="title" value="<?php echo isset($paymentmode) ? $paymentmode->title : ''; ?>" name="title">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="description"><?php myLang('Description'); ?></label>
<textarea class="form-control" id="description" name="description"><?php echo isset($paymentmode) ? $paymentmode->description : ''; ?></textarea>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="display_order"><?php myLang('Display Order'); ?></label><input type="text" class="form-control" id="display_order" value="<?php echo isset($paymentmode) ? $paymentmode->display_order : ''; ?>" name="display_order">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks"><?php myLang('Remarks'); ?></label>
<textarea class="form-control" id="remarks" name="remarks"><?php echo isset($paymentmode) ? $paymentmode->remarks : ''; ?></textarea>
</div>
</div>
<!--COL END-->
</div>
<button type="reset" class="btn btn-default">Reset</button> <button class="btn btn-primary" type="submit" name="submit"><?php echo isset($paymentmode) ? 'Update' : 'Save'; ?></button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,61 @@
<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_paymentmodes where status=1")->result(); ?>
<table class="table table-bordered table-striped dataTable">
<thead>
<tr>
<th width="5%"><?php myLang('Id'); ?></th>
<th width="42%"><?php myLang('Title'); ?></th>
<th><?php myLang('Description'); ?></th>
<th><?php myLang('Display Order'); ?></th>
<th><?php myLang('Status'); ?></th>
<th><?php myLang('Remarks'); ?></th>
<th><?php myLang('Created On'); ?></th>
<th><?php myLang('Created By'); ?></th>
<th class="table-col col-2">Action</th>
</tr>
</thead>
<tbody>
<?php $a = 0;
foreach ($TableData as $TableRow) : $a++; ?>
<?php foreach ($TableRow as $cols) : $id = $cols;
break;
endforeach; ?><tr>
<td><?php echo $TableRow->paymentmode_id; ?></td>
<td><?php echo $TableRow->title; ?></td>
<td><?php echo $TableRow->description; ?></td>
<!--<td><?php //echo $TableRow->display_order;
?></td> -->
<td><?php echo $TableRow->status; ?></td>
<td><?php echo $TableRow->remarks; ?></td>
<td><?php echo $TableRow->created_on; ?></td>
<td><?php echo $TableRow->created_by; ?></td>
<td><?php showEditButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?>
<?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>

View File

@@ -0,0 +1,377 @@
<style>
table tr td {
border: 1px solid #ddd;
}
thead tr th {
border: 1px solid #ddd;
}
.form-control {
display: block;
width: 100%;
height: calc(1.80rem + 2px);
padding: .375rem .75rem;
font-size: .9rem;
font-weight: 400;
line-height: 1.5;
color: #495057;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: .25rem;
box-shadow: inset 0 0 0 transparent;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
text-align: left;
}
.form-control1 {
display: inline-block;
width: 25%;
height: calc(1.80rem + 2px);
/* padding: .375rem .75rem; */
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #495057;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: .25rem;
box-shadow: inset 0 0 0 transparent;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.form-control2 {
display: block;
width: 100%;
/* height: calc(1.80rem + 2px); */
padding: .375rem .75rem;
font-size: .9rem;
font-weight: 400;
line-height: 1.5;
color: #495057;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: .25rem;
box-shadow: inset 0 0 0 transparent;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.select2-container .select2-selection--single {
height: calc(1.80rem + 2px);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 18px
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
margin-top: 0px !important;
}
.bbsn {
left: 50%;
top: 50%;
}
.br0 {
border: 0px;
}
</style>
<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">Create <?php //echo $pageTitle;
?> <a href="<?php // echo site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/list");
?>" class="btn btn-sm btn-primary float-right">List <?php //echo $pageTitle;
?></a></h5>
</div> -->
<div class="card-body">
<form method="POST" action="<?php echo site_url("inventory/purchases/create"); ?>" enctype="multipart/form-data" name="tbl_purchases">
<div class="row mb-2">
<div class="col-2">
<fieldset>
<legend>Transaction Date</legend><input type="text" class="form-control2 nepaliDatePicker" id="purchase_date" value="<?php echo NepaliDate(); ?>" name="purchase_date">
</fieldset>
</div>
<div class="col-8">
<h1 class="text-center"><?php echo $pageTitle; ?> Voucher</h1>
<!-- <fieldset>
<legend><span id="selectedAccountName"></span> Balance</legend><span id="selectedAccountBalance" style="padding: 6px 0px; display: inline-block; text-align: right; width: 100%;">Choose A/C First</span>
</fieldset> -->
</div>
<div class="col-2">
<fieldset>
<legend> Voucher No. #</legend><input type="text" readonly class="form-control2" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<fieldset>
<legend> Enter Transaction</legend>
<div class="row ">
<!--COL START-->
<div class="col-1">
<div class="form-group">
<label for="purchase_ref"><?php myLang('Ref. No.'); ?></label>
<input type="text" class="form-control DatePicker" id="purchase_ref" value="" name="purchase_ref">
</div>
</div>
<div class="col-5">
<?php $this->myaccounts->showAccountsCombo("accounts_id", "Account", "accounts_id", "accategory_id=30"); ?>
</div>
<div class="col-3">
</div>
<div class="col-2 mt-1">
<button type="button" class="btn btn-primary mt-4 addPurchaseDetail" id="addPurchaseDetail">Add Purchase</button>
</div>
<!--COL END-->
</div>
</fieldset>
<!-- Purchase Details Section -->
<div class="col-12 table-responsive p-0 mt-3">
<table class="table table-striped">
<thead>
<tr>
<th>S.No.</th>
<th>Items</th>
<th class="text-right">Qty</th>
<th class="text-right">Units</th>
<th class="text-right">Rate</th>
<th class="text-right">Amount</th>
<th></th>
</tr>
</thead>
<tbody class="purchase-details-section">
<tr class="purchase-detail">
<td class="text-center bbsn">1</td>
<td width=40%> <?php fillComboWithValue("item_id[]", "", "", "tbl_items", "title", "item_id"); ?></td>
<td width=10%> <input type="text" class="form-control input-group-sm" name="quantity[]"></td>
<td width=5%><input type="text" class="form-control" name="pcs/dozen/kgs" required> </td>
<td width=15%><input type="text" class="form-control" name="rate[]"></td>
<td width=15%><input type="text" class="form-control" name="total[]"></td>
<td width="5%">
<button type="button" class="btn btn-primary btn-xs addPurchaseDetail" id="addPurchaseDetail">
<i class="fa fa-plus"></i></button>
<button type="button" class="btn btn-danger btn-xs remove-purchase-detail">
<i class="fa fa-minus"></i>
</button>
<!-- <button type="button" class="btn btn-danger btn-sm remove-purchase-detail"></button></td> -->
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="4" rowspan="5">In words: </td>
<td class="text-right "><b>Total Amount</b></td>
<td class="text-right">
<b><input type="text" class="form-control" name="subtotal" id="subtotal" /></b>
</td>
<td></td>
</tr>
<tr>
<td class="text-right">
<input class="form-control1" type="text" name="discountpercentage" id="discountpercentage" value="0" width="2%">
<b>% Discount</b></td>
<td class="text-right"><b><input type="text" class="form-control" name="discount" id="discount" /></b></td>
<td></td>
</tr>
<tr>
<td class="text-right "><b>Taxable Amount</b></td>
<td class="text-right"><b><input type="text" class="form-control" name="taxable" id="taxable" /></b></td>
<td></td>
</tr>
<tr>
<td class="text-right "><b>13% VAT</b></td>
<td class="text-right">
<input type="text" class="form-control" name="tax" id="tax" />
</td>
<td></td>
</tr>
<tr>
<td class="text-right "><b>Grand Total Amount</b></td>
<td class="text-right">
<input type="text" class="form-control" name="grand_total" id="grand_total" />
</td>
<td></td>
</tr>
</tfoot>
</table>
</div>
<div class="row mb-3">
<div class="col">
<textarea class="form-control2" rows="3" name="narration" id="narration" placeholder="Narration:"></textarea>
<!-- <input type="text" name="narration" id="narration" class="form-control" /> -->
</div>
</div>
<!-- <div class="col">
<div class="purchase-details-section">
<div class="">
<div class="row">
<div class="col">
Item
</div>
<div class="col">
Qty
</div>
<div class="col">
Rate
</div>
<div class="col">
Total
</div>
<div class="col">
</div>
</div>
</div>
<div class="purchase-detail">
<div class="row">
<div class="col">
<?php //fillComboWithValue("item_id[]", "", "", "tbl_items", "title", "item_id");
?>
</div>
<div class="col">
<div class="form-group">
<input type="text" class="form-control" name="quantity[]">
</div>
</div>
<div class="col">
<div class="form-group">
<input type="text" class="form-control" name="rate[]">
</div>
</div>
<div class="col">
<div class="form-group">
<input type="text" class="form-control" name="total[]">
</div>
</div>
<div class="col">
<button type="button" class="btn btn-danger remove-purchase-detail">Remove</button>
</div>
</div>
</div>
</div>
<div class="">
<div class="row">
<div class="col">
</div>
<div class="col">
</div>
<div class="col">
</div>
<div class="col">
Total: <input type="text" class="form-control" name="subtotal" id="subtotal" />
</div>
<div class="col">
</div>
</div>
</div>
<div class="">
<div class="row">
<div class="col">
</div>
<div class="col">
</div>
<div class="col">
</div>
<div class="col">
13% VAT: <input type="text" class="form-control" name="tax" id="tax" />
</div>
<div class="col">
</div>
</div>
</div>
<div class="">
<div class="row">
<div class="col">
</div>
<div class="col">
</div>
<div class="col">
</div>
<div class="col">
Discount: <input type="text" class="form-control" name="discount" id="discount" />
</div>
<div class="col">
</div>
</div>
</div>
<div class="">
<div class="row">
<div class="col">
</div>
<div class="col">
</div>
<div class="col">
</div>
<div class="col">
Grand Total <input type="text" class="form-control" name="grand_total" id="grand_total" />
</div>
<div class="col">
</div>
</div>
</div>
</div> -->
<!-- End Purchase Details Section -->
<div class="float-right">
<!-- <button type="reset" class="btn btn-default">Reset</button> -->
<button class="btn btn-primary" type="submit" name="submit">Save</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
// Clone purchase detail div
var purchaseDetailClone = $(".purchase-detail").clone().show();
// Add Purchase Detail
$(document).on("click", ".addPurchaseDetail", function() {
var newPurchaseDetail = purchaseDetailClone.clone();
$(".purchase-details-section").append(newPurchaseDetail);
});
// Remove Purchase Detail
$(document).on("click", ".remove-purchase-detail", function() {
$(this).closest(".purchase-detail").remove();
calculateTotals();
});
// Calculate totals on change of rate or quantity
$(document).on("change", ".purchase-detail input[name^='quantity'], .purchase-detail input[name^='rate']", function() {
calculateRowTotal($(this).closest(".purchase-detail"));
calculateTotals();
});
$(document).on("change", "input[name=discountpercentage]", function() {
calculateRowTotal($(this).closest(".purchase-detail"));
calculateTotals();
});
// Calculate row total
function calculateRowTotal(row) {
var quantity = parseFloat(row.find("input[name^='quantity']").val()) || 0;
var rate = parseFloat(row.find("input[name^='rate']").val()) || 0;
var total = quantity * rate;
row.find("input[name^='total']").val(total.toFixed(2));
}
// Calculate totals
function calculateTotals() {
var subtotal = 0;
$(".purchase-detail").each(function() {
var total = parseFloat($(this).find("input[name^='total']").val()) || 0;
subtotal += total;
});
var discountpercent = parseFloat($("input[name=discountpercentage]").val());
var discountamount = subtotal * (discountpercent/100);
var taxable = subtotal - discountamount;
var tax = taxable * 0.13;
var grandTotal = taxable + tax;
$("#subtotal").val(subtotal.toFixed(2));
$("#discount").val(discountamount.toFixed(2));
$("#taxable").val(taxable.toFixed(2));
$("#tax").val(tax.toFixed(2));
$("#grand_total").val(grandTotal.toFixed(2));
}
});
</script>

View File

@@ -0,0 +1,77 @@
<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>
<th><?php myLang('S.N'); ?></th>
<th><?php myLang('Date'); ?></th>
<th><?php myLang('Purchase Transaction'); ?></th>
<th><?php myLang('Amount'); ?></th>
<td><b>Action</b></th>
</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>
<td><b><?php echo $this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name; ?></b>
<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>
<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>
<span class="col item_rate text-right"><?php echo myCurrency($r->rate, true); ?></span>
<span class="col item_amount text-right"><?php echo myCurrency($r->qty * $r->rate, true); ?></span>
</div>
<?php endforeach; ?>
<div class="row ml-2 mr-2" style="border-top: 1px dotted;">
<span class="col item_name">&nbsp;</span>
<span class="col item_qty">&nbsp;</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>
<td><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$id"); ?>
<?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>

View File

@@ -0,0 +1,52 @@
<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>
<th><?php myLang('S.N'); ?></th>
<th><?php myLang('Date'); ?></th>
<th><?php myLang('Purchase Transaction'); ?></th>
<th><?php myLang('Amount'); ?></th>
<td><b>Action</b></th>
</tr>
</thead>
<tbody>
<?php $a = 0;
foreach ($PurchaseRecords as $TableRow) : $a++;
$id = $TableRow->purchase_id; ?>
<tr>
<td><?php echo $TableRow->purchase_ref; ?></td>
<td><?php echo $TableRow->purchase_date; ?></td>
<td><?php echo $this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name; ?></td>
<td><?php echo myCurrency($TableRow->TotalPurchase); ?></td>
<td><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$id"); ?>
<?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>

View File

@@ -0,0 +1,84 @@
<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">
<div class="row bill-header">
<div class="col text-center">
<h2>Purchase Details</h2>
</div>
</div>
<div class="row bill-details">
<div class="col">
<p><strong>Bill Number:</strong> <?php echo $Purchase->purchase_id; ?></p>
<p><strong>Date:</strong> <?php echo myDate($Purchase->purchase_date); ?></p>
<p><strong>Vendor:</strong> <?php echo $this->myaccounts->getAccountDetails($Purchase->accounts_id)->account_name; ?></p>
</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>
<div class="col">
<p><strong>Price</strong></p>
</div>
<div class="col">
<p><strong>Total</strong></p>
</div>
</div>
</div>
<?php $total=0; foreach($PurchaseDetails as $PurchaseDetail):?>
<div class="item-row">
<div class="row">
<div class="col">
<p><?php echo getFieldfromValue("tbl_items","title","item_id",$PurchaseDetail->items_id); ?></p>
</div>
<div class="col">
<p><?php $qty=$PurchaseDetail->qty; echo $qty; ?></p>
</div>
<div class="col">
<p><?php $rate=$PurchaseDetail->rate; echo myCurrency($rate); ?></p>
</div>
<div class="col">
<p><?php $ltotal=$rate*$qty; $total+=$ltotal; echo myCurrency($ltotal); ?></p>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<div class="row bill-footer">
<div class="col text-right">
<p><strong>Subtotal:</strong> <?php echo myCurrency($total,true); ?></p>
<p><strong>Tax (13%):</strong> <?php echo myCurrency($tax=($total*13)/100,true); ?></p>
<p><strong>Total:</strong> <?php echo myCurrency(($total+$tax),true); ?></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,215 @@
<style>
table tr td,
table tr th {
border: 1px #ddd solid;
}
table {
border: 1px #ddd solid;
}
.table thead th {
vertical-align: middle !important;
border-bottom: 2px solid #dee2e6;
}
</style>
<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">
Purchase Vs Sales
</div>
<div class="card-body">
<div class="row">
<div class="col">
<div class="card">
<div class="card-heading">Purchase</div>
<div class="card-body">
<?php
// pre($SalesDetails);
?>
<table class="table table-strips">
<thead>
<tr>
<th>Sn</th>
<th>Item</th>
<th>Qty</th>
<th>Rate</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<?php $PTotal = 0;
$a = 0;
foreach ($PurchaseDetails as $Purchase) : $a++; ?>
<tr>
<td><?php echo $a; ?></td>
<td><?php echo $Purchase->Item->title; ?></td>
<td class="text-right"><?php echo $Purchase->total_qty; ?></td>
<td><?php echo myCurrency($Purchase->average_rate); ?></td>
<td><?php echo myCurrency($lTotal = $Purchase->average_rate * $Purchase->total_qty);
$PTotal += $lTotal; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot>
<tr>
<th></th>
<th></th>
<th></th>
<th>Grand Total</th>
<th><?php echo myCurrency($PTotal); ?></th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<div class="col">
<div class="card">
<div class="card-heading">Sales</div>
<div class="card-body">
<table class="table table-strips">
<thead>
<tr>
<th>Sn</th>
<th>Item</th>
<th>Qty</th>
<th>Rate</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<?php $STotal = 0;
$a = 0;
foreach ($SalesDetails as $Sales) : $a++; ?>
<tr>
<td><?php echo $a; ?></td>
<td><?php echo $Sales->Item->title; ?></td>
<td class="text-right"><?php echo $Sales->total_qty; ?></td>
<td><?php echo myCurrency($Sales->average_rate); ?></td>
<td><?php echo myCurrency($lTotal = $Sales->average_rate * $Sales->total_qty);
$STotal += $lTotal; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot>
<tr>
<th></th>
<th></th>
<th></th>
<th>Grand Total</th>
<th><?php echo myCurrency($STotal); ?></th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- New Table -->
<div class="card card-primary card-outline">
<div class="card-header">
<h5 class="card-title mb-0">
Purchase Vs Sales
</h5>
</div>
<div class="card-body p-0">
<table class="table table-boardered ">
<thead>
<tr>
<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="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-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>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Education</td>
<td>Pcs</td>
<td class="text-center">1000</td>
<td class="text-right">1000</td>
<td class="text-right">200000</td>
<td class="text-center">1000</td>
<td class="text-right">1000</td>
<td class="text-right">200000</td>
<td class="text-center">100%</td>
<td class="text-center">100%</td>
<td class="text-right">1000</td>
<td class="text-right">200000</td>
<td class="text-right">200000</td>
<td class="text-center">100%</td>
</tr>
<?php $a = 0;
foreach ($StockRecords 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></td>
</tr>
<?php //pre($Stock);
endforeach; ?>
</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>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,207 @@
<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-body">
<form id="salesForm" method="post" action="<?php echo site_url("inventory/sales/store"); ?>">
<input type="hidden" class="form-control" id="transactionType" name="transactionType" value="Sales Entry">
<div class="row mb-2">
<div class="col-2">
<fieldset>
<legend>Transaction Date <span class="text-danger">*</span></legend>
<input type="text" class="form-control2 nepaliDatePicker" id="salesDate" value="<?php echo NepaliDate(); ?>" name="salesDate" required>
</fieldset>
</div>
<div class="col-8">
<h1 class="text-center"><?php echo $pageTitle; ?> Voucher</h1>
<!-- <fieldset>
<legend><span id="selectedAccountName"></span> Balance</legend><span id="selectedAccountBalance" style="padding: 6px 0px; display: inline-block; text-align: right; width: 100%;">Choose A/C First</span>
</fieldset> -->
</div>
<div class="col-2">
<fieldset>
<legend> Voucher No. #</legend><input type="text" readonly class="form-control2" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<fieldset>
<legend> Enter Transaction </legend>
<div class="form-row mb-2">
<div class="form-group col">
<?php $this->myaccounts->showAccountsCombo("accounts_id", " Account <span class='text-danger'>*</span>", "accounts_id", "accategory_id=4","required"); ?>
</div>
<!-- <div class="form-group col">
<label for="salesDate">Sales Date:</label>
<input type="text" class="form-control" id="salesDate" name="salesDate">
</div> -->
</div>
</fieldset>
<div class="card mt-3">
<div class="card-header">Sales Details</div>
<div class="card-body p-0">
<table class="table table-striped">
<thead>
<tr>
<th width=50%>Items <span class="text-danger">*</span></th>
<th class="text-center" width=5%>Qty <span class="text-danger">*</span></th>
<th class="text-center" width=5%>Units</th>
<th class="text-center" width=13%>Rate <span class="text-danger">*</span></th>
<th class="text-right" width=20%>Amount</th>
<th width=5%></th>
</tr>
</thead>
<tbody id="salesDetails">
<tr class="sales-detail-duplicator">
<td> <select name="item_id[]" class="form-control" required>
<option value="">Select Item</option>
<?php foreach ($items as $item) : ?>
<option value="<?php echo $item->item_id; ?>" required><?php echo $item->title; ?></option>
<?php endforeach; ?>
</select></td>
<td> <input type="text" class="form-control input-group-sm" name="qty[]" required></td>
<td><input type="text" class="form-control" name="pcs/dozen/kgs" required> </td>
<td><input type="text" class="form-control" name="rate[]" required></td>
<td><input type="text" class="form-control" name="ltotal[]" required></td>
<td>
<button type="button" class="btn btn-primary btn-xs add-row">
<i class="fa fa-plus"></i></button>
<button type="button" class="btn btn-danger btn-xs remove-sales-detail">
<i class="fa fa-minus"></i>
</button>
<!-- <button type="button" class="btn btn-danger btn-sm remove-purchase-detail"></button></td> -->
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3" rowspan="5">In words: </td>
<td class="text-right "><b>Total Amount</b></td>
<td class="text-right"><b>
<input type="text" class="form-control" name="subtotal" id="subtotal">
</b></td>
<td></td>
</tr>
<tr>
<td class="text-right">
<input class="form-control1" type="text" name="discountpercentage" id="discountpercentage" value="5" width="2%"> <b>% Discount</b>
</td>
<td class="text-right"><b> <input type="text" class="form-control" id="discount"></b></td>
<td></td>
</tr>
<tr>
<td class="text-right "><b>Taxable Amount</b></td>
<td class="text-right"><b> <input type="text" class="form-control" id="taxable"></b></td>
<td></td>
</tr>
<tr>
<td class="text-right "><b>13% VAT</b></td>
<td class="text-right">
<input type="text" class="form-control" id="tax">
<td></td>
</tr>
<tr>
<td class="text-right "><b>Grand Total Amount</b></td>
<td class="text-right">
<input type="text" class="form-control" id="grandtotal">
</td>
<td></td>
</tr>
</tfoot>
</table>
</div>
</div>
<!-- Sales Details Section -->
<div class="row mb-3">
<div class="col">
<textarea class="form-control" rows="3" name="narration" id="narration" placeholder="Narration:"></textarea>
</div>
</div>
<!-- <div class="form-group">
<label for="remarks">Remarks:</label>
<textarea class="form-control" id="remarks" name="remarks" rows="3"></textarea>
</div> -->
<div class="float-right">
<!-- <button type="reset" class="btn btn-default">Reset</button> -->
<button class="btn btn-primary" type="submit" name="submit">Save</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).on("click", ".remove-sales-detail", function() {
if ($("#salesDetails tr").length > 1) {
$(this).closest("tr").remove();
calculateTotals();
}
});
$(document).on('input', '.sales-detail-duplicator input[name^="qty"], .sales-detail-duplicator input[name^="rate"]', function() {
calculateLineTotal($(this).closest('tr'));
calculateTotals();
});
$(document).on("change", "input[name=discountpercentage]", function() {
calculateLineTotal($(this).closest("tr"));
calculateTotals();
});
function calculateLineTotal(row) {
var quantity = parseFloat(row.find('input[name^="qty"]').val());
var rate = parseFloat(row.find('input[name^="rate"]').val());
if (!isNaN(quantity) && !isNaN(rate)) {
var lineTotal = quantity * rate;
row.find("input[name^='ltotal[]']").val(lineTotal.toFixed(2));
}
}
$(document).ready(function() {
var currentRow = $(".sales-detail-duplicator").clone().show();
$(document).on("click", ".add-row", function() {
var newRow = currentRow.clone();
$("#salesDetails").append(newRow);
// newRow.find('.select2').select2();
// calculateTotals();
});
// $(document).on("click", ".remove-sales-detail", function() {
// $(this).closest(".sales-detail").remove();
// calculateTotals();
// });
// $(document).on('input', 'input[name="qty[]"], input[name="rate[]"]', function() {
// calculateTotals();
// });
});
</script>
<script>
function calculateTotals() {
var subtotal = 0;
$(".sales-detail-duplicator").each(function() {
var lineTotal = parseFloat($(this).find("input[name^='ltotal']").val());
if ((!isNaN(lineTotal))) {
subtotal += lineTotal;
}
});
var discountpercent = parseFloat($("input[name=discountpercentage]").val());
var discountamount = subtotal * (discountpercent/100);
var taxable = subtotal - discountamount;
var tax = taxable * 0.13;
var grandTotal = taxable + tax;
$('#subtotal').val(subtotal.toFixed(2));
$("#discount").val(discountamount.toFixed(2));
$("#taxable").val(taxable.toFixed(2));
$('#tax').val(tax.toFixed(2));
$('#grandtotal').val(grandTotal.toFixed(2));
}
</script>

View File

@@ -0,0 +1,71 @@
<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; ?> <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>
<div class="card-body">
<?php $TableData = $this->db->query("select * from tbl_sales where status=1")->result(); ?>
<table class="table table-bordered table-striped dataTable">
<thead>
<tr>
<th class="table-col col-1"><?php myLang('Sales Voucher #'); ?></th>
<th width="10%"><?php myLang('Date'); ?></th>
<th><?php myLang('Transaction'); ?></th>
<th class="table-col col-1"><?php myLang('Amount'); ?></th>
<th class="table-col col-1"><?php myLang('Action'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($SalesRecords as $TableRow) : ?>
<tr>
<td><?php echo $TableRow->sales_id; ?></td>
<td><?php echo $TableRow->sales_date; ?></td>
<td><b><?php echo $this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name; ?></b>
<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>
<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>
<span class="col item_rate text-right"><?php echo myCurrency($r->rate, true); ?></span>
<span class="col item_amount text-right"><?php echo myCurrency($r->qty * $r->rate, true); ?></span>
</div>
<?php endforeach; ?>
<div class="row ml-2 mr-2" style="border-top: 1px dotted;">
<span class="col item_name">&nbsp;</span>
<span class="col item_qty">&nbsp;</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->totalsales); ?></td>
<td><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$TableRow->sales_id"); ?>
<?php showDeleteButton($TableRow->sales_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>

View File

@@ -0,0 +1,52 @@
<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; ?> <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>
<div class="card-body">
<?php $TableData = $this->db->query("select * from tbl_sales where status=1")->result(); ?>
<table class="table table-bordered table-striped dataTable">
<thead>
<tr>
<th class="table-col col-1"><?php myLang('Sales Voucher #'); ?></th>
<th width="10%"><?php myLang('Date'); ?></th>
<th><?php myLang('Transaction'); ?></th>
<th class="table-col col-1"><?php myLang('Amount'); ?></th>
<th class="table-col col-1"><?php myLang('Action'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($SalesRecords as $TableRow) : ?>
<tr>
<td><?php echo $TableRow->sales_id; ?></td>
<td><?php echo $TableRow->sales_date; ?></td>
<td><?php echo $this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name; ?>
</td>
<td><?php echo myCurrency($TableRow->totalsales); ?></td>
<td><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$TableRow->sales_id"); ?>
<?php showDeleteButton($TableRow->sales_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>

View File

@@ -0,0 +1,84 @@
<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; ?> <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>
<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>
<p><strong>Date:</strong> <?php echo myDate($Sales->sales_date); ?></p>
<p><strong>Vendor:</strong> <?php echo $this->myaccounts->getAccountDetails($Sales->accounts_id)->account_name; ?></p>
</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>
<div class="col">
<p><strong>Price</strong></p>
</div>
<div class="col">
<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>
<div class="col">
<p><?php $ltotal=$rate*$qty; $total+=$ltotal; echo myCurrency($ltotal); ?></p>
</div>
</div>
</div>
<?php endif; endforeach; ?>
</div>
</div>
<div class="row bill-footer">
<div class="col text-right">
<p><strong>Subtotal:</strong> <?php echo myCurrency($total,true); ?></p>
<p><strong>Tax (13%):</strong> <?php echo myCurrency($tax=($total*13)/100,true); ?></p>
<p><strong>Total:</strong> <?php echo myCurrency(($total+$tax),true); ?></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,59 @@
<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 isset($stockLocation) ? 'Edit' : 'Add'; ?> <?php echo $pageTitle; ?> <?php showListButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/list", "List " . $pageTitle); ?></h5>
</div>
<div class="card-body">
<form method="POST" action="<?php echo isset($stockLocation) ? site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/" . $stockLocation->stocklocation_id) : site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add"); ?>" enctype="multipart/form-data" name="tbl_stocklocations">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="title"><?php myLang('Title'); ?></label><input type="text" class="form-control" id="title" value="<?php echo isset($stockLocation) ? $stockLocation->title : ''; ?>" name="title">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="description"><?php myLang('Description'); ?></label>
<textarea class="form-control" id="description" name="description"><?php echo isset($stockLocation) ? $stockLocation->description : ''; ?></textarea>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="display_order"><?php myLang('Display Order'); ?></label><input type="text" class="form-control" id="display_order" value="<?php echo isset($stockLocation) ? $stockLocation->display_order : ''; ?>" name="display_order">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks"><?php myLang('Remarks'); ?></label>
<textarea class="form-control" id="remarks" name="remarks"><?php echo isset($stockLocation) ? $stockLocation->remarks : ''; ?></textarea>
</div>
</div>
<!--COL END-->
</div>
<button type="reset" class="btn btn-default">Reset</button> <button class="btn btn-primary" type="submit" name="submit"><?php echo isset($stockLocation) ? 'Update' : 'Save'; ?></button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,170 @@
<style>
.form-group {
margin-bottom: .5rem;
}
.form-control {
display: block;
width: 100%;
height: calc(1.80rem + 2px);
padding: .375rem .75rem;
font-size: .9rem;
font-weight: 400;
line-height: 1.5;
color: #495057;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: .25rem;
box-shadow: inset 0 0 0 transparent;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
text-align: right;
}
.custom-file-input {
position: relative;
z-index: 2;
width: 100%;
height: calc(1.80rem + 2px);
margin: 0;
overflow: hidden;
opacity: 0;
}
.custom-file-label {
position: absolute;
top: 0;
right: 0;
left: 0;
z-index: 1;
height: calc(1.80rem + 2px);
padding: .350rem .75rem;
overflow: hidden;
font-weight: 400;
line-height: 1.5;
color: #495057;
background-color: #fff;
border: 1px solid #ced4da;
border-radius: .25rem;
box-shadow: none;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
padding-left: 0;
/* height: auto; */
height: calc(1.80rem + 2px) !important;
margin-top: -3px;
}
.select2-container .select2-selection--single {
height: 30px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 20px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
margin-top: 0 !important;
}
</style>
<div class="content-wrapper">
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-3">
<div class="card card-primary card-outline">
<div class="card-header">
<h5 class="m-0"><?php echo isset($stockLocation) ? 'Edit' : 'Add'; ?> <?php echo $pageTitle; ?>
</h5>
</div>
<div class="card-body">
<form method="POST" action="<?php echo isset($stockLocation) ? site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/" . $stockLocation->stocklocation_id) : site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add"); ?>" enctype="multipart/form-data" name="tbl_stocklocations">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="title"> <?php myLang('Stock Location'); ?></label><input type="text" class="form-control" id="title" value="<?php echo isset($stockLocation) ? $stockLocation->title : ''; ?>" name="title">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="description"><?php myLang('Description'); ?></label>
<textarea class="form-control" id="description" name="description"><?php echo isset($stockLocation) ? $stockLocation->description : ''; ?></textarea>
</div>
</div>
<!--COL END-->
</div>
<!-- <div class="row">
<div class="col">
<div class="form-group">
<label for="display_order"><?php //myLang('Display Order'); ?></label><input type="text" class="form-control" id="display_order" value="<?php //echo isset($stockLocation) ? $stockLocation->display_order : ''; ?>" name="display_order">
</div>
</div>
</div> -->
<!-- <div class="row">
<div class="col">
<div class="form-group">
<label for="remarks"><?php //myLang('Remarks'); ?></label>
<textarea class="form-control" id="remarks" name="remarks"><?php //echo isset($stockLocation) ? $stockLocation->remarks : ''; ?></textarea>
</div>
</div>
</div> -->
<button type="reset" class="btn btn-default btn-sm">Reset</button> <button class="btn btn-primary btn-sm" type="submit" name="submit"><?php echo isset($stockLocation) ? 'Update' : 'Save'; ?></button>
</form>
</div>
</div>
</div>
<div class="col-9">
<div class="card card-primary card-outline">
<div class="card-header">
<h5 class="m-0"> <?php echo $pageTitle; ?> List </h5>
<?php //showCreateButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add", "Create New " . $pageTitle); ?>
</div>
<div class="card-body">
<?php $TableData = $this->db->query("select * from tbl_stocklocations where status=1")->result(); ?>
<table class="table table-bordered table-striped dataTable">
<thead>
<tr>
<th class="table-col col-1"><?php myLang('S.N'); ?></th>
<th><?php myLang('Stock Location'); ?></th>
<th class="table-col col-1">Action</th>
</tr>
</thead>
<tbody>
<?php $a = 0;
foreach ($TableData as $TableRow) : $a++; ?>
<?php foreach ($TableRow as $cols) : $id = $cols;
break;
endforeach; ?><tr>
<td><?php echo $a; ?></td>
<td><?php echo $TableRow->title; ?></td>
<td><?php showEditButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?>
<?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>

View File

@@ -0,0 +1,61 @@
<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 isset($stock) ? 'Edit' : 'Add'; ?> <?php echo $pageTitle; ?> <a href="<?php echo site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/list"); ?>" class="btn btn-sm btn-primary float-right">List <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<form method="POST" action="<?php echo isset($stock) ? site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/" . $stock->stock_id) : site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add"); ?>" enctype="multipart/form-data" name="tbl_stocks">
<input type="hidden" name="stocklocations_id" value="1" />
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<?php fillComboWithValue("items_id", "Item", "items_id", "tbl_items", "title", "item_id", isset($stock) ? $stock->items_id : ''); ?>
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="qty"><?php myLang('Qty'); ?></label><input type="text" class="form-control" id="qty" value="<?php echo isset($stock) ? $stock->qty : ''; ?>" name="qty">
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="price"><?php myLang('Price'); ?></label><input type="text" class="form-control" id="price" value="<?php echo isset($stock) ? $stock->price : ''; ?>" name="price">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks"><?php myLang('Remarks'); ?></label>
<textarea class="form-control" id="remarks" name="remarks" rows=10><?php echo isset($stock) ? $stock->remarks : ''; ?></textarea>
</div>
</div>
<!--COL END-->
</div>
<button type="reset" class="btn btn-default">Reset</button> <button class="btn btn-primary" type="submit" name="submit"><?php echo isset($stock) ? 'Update' : 'Save'; ?></button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,150 @@
<?php
$this->load->library("BIBAccounts");
$BIBAccounts = new BIBAccounts();
?>
<div class="content-wrapper">
<div class="content">
<div class="content">
<div class="container-fluid">
<div class="card card-primary ">
<div class="card-header">
<h3 class="card-title"><?php echo $pageTitle; ?> </h3>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fas fa-plus"></i>
</button>
</div>
<!-- /.card-tools -->
</div>
<div class="card-body">
<form method="post" action="" id="FilterForm">
<div class="row align-items-end">
<div class="col-2">
<div class="form-group">
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
</div>
</div>
<div class="col-2">
<div class="form-group">
<label for="toDate"><?php myLang("Ending Period"); ?></label>
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
</div>
</div>
<div class="col-1 text-center">
<div class="form-group">
<label for="showOB"><?php myLang("Opening"); ?></label>
<input type="checkbox" class="form-control " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
</div>
</div>
<div class="col-1 text-center">
<div class="form-group">
<label for="showClosing"><?php myLang("Closing"); ?></label>
<input type="checkbox" class="form-control " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
</div>
</div>
<div class="col-1 text-center">
<div class="form-group">
<label for="showPeriod"><?php myLang("Period"); ?></label>
<input type="checkbox" class="form-control " name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
</div>
</div>
<div class="col">
<div class="form-group d-flex justify-content-end">
<button type="submit" class="btn btn-primary mr-2">Filter</button>
<button type="submit" class="btn btn-success mr-2">Export</button>
<button type="button" class="btn btn-warning" onclick="resetForm()">Reset</button>
</div>
</div>
</div>
</form>
<script>
function resetForm() {
document.getElementById("fromDate").value = "<?php echo NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>";
document.getElementById("toDate").value = "<?php echo NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>";
document.getElementById("showOB").checked = <?php echo "false"; ?>;
document.getElementById("showClosing").checked = <?php echo "false"; ?>;
document.getElementById("FilterForm").submit();
}
</script>
</div>
</div>
</div>
</div>
</div>
<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; ?> <a href="<?php echo site_url("inventory/purchases/add"); ?>" class="btn btn-sm btn-primary float-right">Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $this->db->query("select * from tbl_stocks where status=1")->result(); ?>
<table class="table table-bordered table-striped dataTable">
<thead>
<tr>
<th><?php myLang('Transaction'); ?></th>
<th><?php myLang('Stock Location'); ?></th>
<th class="text-right"><?php myLang('Item'); ?></th>
<th class="text-right"><?php myLang('Qty'); ?></th>
<th class="text-right"><?php myLang('Price'); ?></th>
<th class="text-right"><?php myLang('Amount'); ?></th>
<!-- <td class="text-right"><?php //myLang('Action');
?></th> -->
</tr>
</thead>
<tbody>
<?php $Total = 0;
foreach ($StockRecords as $TableRow) : ?>
<?php foreach ($TableRow as $cols) : $id = $cols;
break;
endforeach; ?><tr>
<td><?php echo $TableRow->title; ?></td>
<td><?php echo $TableRow->StockLocation->title; ?></td>
<td><?php echo $TableRow->Item->title; ?></td>
<td><?php echo $TableRow->qty; ?></td>
<td class="text-right"><?php echo myCurrency($TableRow->price); ?></td>
<td class="text-right"><?php $lTotal = ($TableRow->price * $TableRow->qty);
$Total += $lTotal;
echo myCurrency($lTotal); ?></td>
<td>
<?php showEditButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?>
<?php showDeleteButton($id); ?>
</td>
</tr>
<?php endforeach; ?>
<tbody>
<tfoot>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td><?php echo myCurrency($Total); ?></td>
<td></td>
</tr>
</tfoot>
</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>

View File

@@ -0,0 +1,256 @@
<div class="content-wrapper">
<!-- <div class="content">
<div class="container-fluid">
<div class="card card-primary ">
<div class="card-header">
<h3 class="card-title"><?php //echo $pageTitle;
?> </h3>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-card-widget="collapse"><i class="fas fa-plus"></i>
</button>
</div>
</div>
<div class="card-body">
<form method="post" action="" id="FilterForm">
<div class="row align-items-end">
<div class="col-2">
<div class="form-group">
<label for="fromDate"><?php //myLang("Starting Period");
?></label>
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="<?php //echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from);
?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
</div>
</div>
<div class="col-2">
<div class="form-group">
<label for="toDate"><?php //myLang("Ending Period");
?></label>
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="<?php //echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to);
?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
</div>
</div>
<div class="col-1 text-center">
<div class="form-group">
<label for="showOB"><?php //myLang("Opening");
?></label>
<input type="checkbox" class="form-control " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php //echo (isset($_POST['showOB'])) ? "CHECKED" : "";
?>>
</div>
</div>
<div class="col-1 text-center">
<div class="form-group">
<label for="showClosing"><?php //myLang("Closing");
?></label>
<input type="checkbox" class="form-control " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php //echo (isset($_POST['showClosing'])) ? "CHECKED" : "";
?>>
</div>
</div>
<div class="col-1 text-center">
<div class="form-group">
<label for="showPeriod"><?php //myLang("Period");
?></label>
<input type="checkbox" class="form-control " name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php //echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED";
?>>
</div>
</div>
<div class="col">
<div class="form-group d-flex justify-content-end">
<button type="submit" class="btn btn-primary mr-2">Choose</button>
<button type="submit" class="btn btn-primary mr-2">Filter</button>
<button type="submit" class="btn btn-success mr-2">Export</button>
<button type="button" class="btn btn-warning" onclick="resetForm()">Reset</button>
</div>
</div>
</div>
</form>
<script>
function resetForm() {
document.getElementById("fromDate").value = "<?php //echo NepaliDate($this->session->FiscalYear->fiscalyear_from);
?>";
document.getElementById("toDate").value = "<?php //echo NepaliDate($this->session->FiscalYear->fiscalyear_to);
?>";
document.getElementById("showOB").checked = <?php //echo "false";
?>;
document.getElementById("showClosing").checked = <?php //echo "false";
?>;
document.getElementById("FilterForm").submit();
}
</script>
</div>
</div>
</div>
</div> -->
<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="card-title">
<?php echo $pageTitle; ?>
<!-- <?php //echo $pageTitle;
?> <a href="<?php //echo site_url("inventory/purchases/add");
?>" class="btn btn-sm btn-primary float-right">Create New <?php //echo $pageTitle;
?></a> -->
</h5>
<div class="card-tools">
<!-- button with a dropdown -->
<div class="btn-group">
<button type="button" class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown" data-offset="-52">
Filters
</button>
<div class="dropdown-menu" role="menu">
<div class="form-group p-2 pb-0">
<div class="col">
<div class="form-group">
<label for="fromDate"><?php myLang("Starting Period"); ?></label>
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="<?php echo (isset($_POST['fromDate'])) ? $_POST['fromDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_from); ?>" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
</div>
<div class="form-group">
<label for="toDate"><?php myLang("Ending Period"); ?></label>
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="<?php echo (isset($_POST['toDate'])) ? $_POST['toDate'] : NepaliDate($this->session->FiscalYear->fiscalyear_to); ?>" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
</div>
</div>
<div class="dropdown-divider"></div>
<div class="form-check">
<input class="form-check-input" type="checkbox">
<label class="form-check-label">Select
All</label>
</div>
<div class="form-check">
<input type="checkbox" class="form-check-input " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance" <?php echo (isset($_POST['showOB'])) ? "CHECKED" : ""; ?>>
<!-- <input class="form-check-input" type="checkbox"> -->
<label class="form-check-label">Opening</label>
</div>
<div class="form-check">
<!-- <input class="form-check-input" type="checkbox"> -->
<input type="checkbox" class="form-check-input " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance" <?php echo (isset($_POST['showClosing'])) ? "CHECKED" : ""; ?>>
<label class="form-check-label">Closing</label>
</div>
<div class="form-check">
<!-- <input class="form-check-input" type="checkbox" checked> -->
<input type="checkbox" class="form-check-input" name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance" <?php echo (isset($_POST['showPeriod'])) ? "CHECKED" : "CHECKED"; ?>>
<label class="form-check-label">Period</label>
</div>
</div>
<div class="dropdown-divider"></div>
<buttom type="submit" class="btn btn-primary mr-2 text-center">Search Now</buttom>
</div>
</div>
<div class="btn-group">
<button type="button" class="btn btn-danger btn-sm " data-toggle="dropdown" data-offset="-52">
Export
</button>
<!-- <div class="dropdown-menu" role="menu">
<a href="#" class="dropdown-item">Export</a>
<a href="#" class="dropdown-item">Pdf</a>
<div class="dropdown-divider"></div>
<a href="#" class="dropdown-item">View calendar</a>
</div> -->
</div>
</div>
</div>
<div class="card-body">
<table class="table table-bordered table-striped dataTable">
<thead>
<tr>
<th rowspan="2"><?php myLang('Item'); ?></th>
<th rowspan="2" width="80"><?php myLang('Units'); ?></th>
<th colspan="3" class="text-center"><?php myLang('Opening'); ?></th>
<th colspan="3" class="text-center"><?php myLang('Purchase'); ?></th>
<th colspan="3" class="text-center"><?php myLang('Sales'); ?></th>
<th colspan="3" class="text-center"><?php myLang('Closing'); ?></th>
</tr>
<tr>
<th class="text-center" width="80"><?php myLang('Qty'); ?></th>
<th class="text-center" width="80"><?php myLang('Avg. Rate'); ?></th>
<th class="text-center" width="80"><?php myLang('Amount'); ?></th>
<th class="text-center" width="80"><?php myLang('Qty'); ?></th>
<th class="text-center" width="80"><?php myLang('Avg. Rate'); ?></th>
<th class="text-center" width="80"><?php myLang('Amount'); ?></th>
<th class="text-center" width="80"><?php myLang('Qty'); ?></th>
<th class="text-center" width="80"><?php myLang('Avg. Rate'); ?></th>
<th class="text-center" width="80"><?php myLang('Amount'); ?></th>
<th class="text-center" width="80"><?php myLang('Qty'); ?></th>
<th class="text-center" width="80"><?php myLang('Avg. Rate'); ?></th>
<th class="text-center" width="80"><?php myLang('Amount'); ?></th>
</tr>
</thead>
<tbody>
<?php $Total = 0;$PTotal=0;$STotal=0;$CTotal=0;
foreach ($StockRecords as $TableRow) : ?>
<tr>
<td><?php echo ($TableRow->Item)?$TableRow->Item->title:"N/A"; ?></td>
<td><?php echo getFieldfromValue("tbl_units", "title", "unit_id", $TableRow->Item->units_id); ?></td>
<td class="text-right"><?php echo $TableRow->Summary->Opening->qty; ?></td>
<td class="text-right"><?php echo $TableRow->Summary->Opening->rate; ?></td>
<td><?php echo myCurrency($lTotal = $TableRow->Summary->Opening->amount);
$Total += $lTotal; ?></td>
<td class="text-right"><?php echo $TableRow->Summary->Purchase->qty; ?></td>
<td class="text-right"><?php echo $TableRow->Summary->Purchase->rate; ?></td>
<td><?php echo myCurrency($pTotal = $TableRow->Summary->Purchase->amount);
$PTotal += $pTotal; ?></td>
<td class="text-right"><?php echo $TableRow->Summary->Sales->qty; ?></td>
<td class="text-right"><?php echo $TableRow->Summary->Sales->rate; ?></td>
<td><?php echo myCurrency($sTotal = $TableRow->Summary->Sales->amount);
$STotal += $sTotal; ?></td>
<td class="text-right"><?php echo $TableRow->Summary->Closing->qty; ?></td>
<td class="text-right"><?php echo $TableRow->Summary->Closing->rate; ?></td>
<td><?php echo myCurrency($cTotal = $TableRow->Summary->Closing->amount);
$CTotal += $cTotal; ?></td>
</tr>
<?php endforeach; ?>
<tbody>
<tfoot>
<tr>
<td colspan="4" class="text-right"><b><?php echo myLang("Total"); ?></b></td>
<td><?php echo myCurrency($Total); ?></td>
<td colspan="2"></td>
<td><?php echo myCurrency($PTotal); ?></td>
<td colspan="2"></td>
<td><?php echo myCurrency($STotal); ?></td>
<td colspan="2"></td>
<td><?php echo myCurrency($CTotal); ?></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,58 @@
<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 isset($unit) ? 'Edit' : 'Add'; ?> <?php echo $pageTitle; ?> <?php showListButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/list","List ".$pageTitle); ?></h5>
</div>
<div class="card-body">
<form method="POST" action="<?php echo isset($unit) ? site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/" . $unit->unit_id) : site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add"); ?>" enctype="multipart/form-data" name="tbl_units">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="title"><?php myLang('Unit Name'); ?></label>
<input type="text" class="form-control" id="title" value="<?php echo isset($unit) ? $unit->title : ''; ?>" name="title">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="description"><?php myLang('Unit Code'); ?></label>
<textarea class="form-control" id="description" name="description"><?php echo isset($unit) ? $unit->description : ''; ?></textarea>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks"><?php myLang('Remarks'); ?></label>
<textarea class="form-control" id="remarks" name="remarks"><?php echo isset($unit) ? $unit->remarks : ''; ?></textarea>
</div>
</div>
<!--COL END-->
</div>
<button type="reset" class="btn btn-default">Reset</button> <button class="btn btn-primary" type="submit" name="submit"><?php echo isset($unit) ? 'Update' : 'Save'; ?></button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,106 @@
<div class="content-wrapper">
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-3">
<div class="card card-primary card-outline">
<div class="card-header">
<h5 class="m-0"><?php echo isset($unit) ? 'Edit' : 'Add'; ?>
<?php myLang('Inventory Unit'); ?>
<?php //echo $pageTitle; ?>
<?php //showListButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/list","List ".$pageTitle); ?>
</h5>
</div>
<div class="card-body">
<form method="POST" action="<?php echo isset($unit) ? site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/" . $unit->unit_id) : site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add"); ?>" enctype="multipart/form-data" name="tbl_units">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="title"><?php myLang('Unit Name'); ?><span class="text-danger">*</span></label>
<input type="text" class="form-control" id="title" value="<?php echo isset($unit) ? $unit->title : ''; ?>" name="title" required>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="description"><?php myLang('Unit Code'); ?></label>
<input class="form-control" id="description" name="description"><?php echo isset($unit) ? $unit->description : ''; ?>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<!-- <div class="col">
<div class="form-group">
<label for="remarks"><?php //myLang('Remarks'); ?></label>
<textarea class="form-control" id="remarks" name="remarks"><?php //echo isset($unit) ? $unit->remarks : ''; ?></textarea>
</div>
</div> -->
<!--COL END-->
</div>
<!-- <button type="reset" class="btn btn-default btn-sm">Reset</button> -->
<button class="btn btn-primary btn-sm float-right" type="submit" name="submit"><?php echo isset($unit) ? 'Update' : 'Save'; ?></button>
</form>
</div>
</div>
</div>
<div class="col-9">
<div class="card card-primary card-outline">
<div class="card-header">
<h5 class="m-0"> <?php myLang(' List Inventory Units'); ?> <?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_units where status=1")->result(); ?>
<table class="table table-bordered table-striped dataTable">
<thead>
<tr>
<th class="table-col col-1"><?php myLang('S.N'); ?></th>
<th><?php myLang('Unit Name '); ?></th>
<th><?php myLang('Unit Code'); ?></th>
<th class="table-col col-1">Action</th>
</tr>
</thead>
<tbody>
<?php $a = 0;
foreach ($TableData as $TableRow) : $a++; ?>
<?php foreach ($TableRow as $cols) : $id = $cols;
break;
endforeach; ?><tr>
<td><?php echo $a; ?></td>
<td><?php echo $TableRow->title; ?></td>
<td><?php echo $TableRow->description; ?></td>
<td><?php showEditButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/edit/$id"); ?>
<?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>