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,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>