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,66 @@
<div class="content-wrapper">
<!-- <div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0"><?php //echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="<?php //echo base_url(); ?>">Dashboard</a></li>
<li class="breadcrumb-item active"><?php //echo $pageTitle; ?></li>
</ol>
</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="m-0">Create <?php echo $pageTitle; ?> <a href="<?php echo site_url("master/accategories/list"); ?>" class="btn btn-sm btn-primary float-right">List <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<form method=POST action="" enctype="multipart/form-data" name="tbl_accategories">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="accategory_name">Group Name</label><input type="text" class="form-control" id="accategory_name" value="" name="accategory_name">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<?php $this->myaccounts->showAccountsCategoriesCombo("parent_category_id", " Account Type >> Category", "parent_category_id", "status=1", $default = "", $CSSclass = ""); ?>
<?php //fillComboWithValue("parent_category_id", "Parent Category", "parent_category_id", "tbl_accategories", "accategory_name", "accategory_id", $default = "", $CSSclass = "", $multiple = false, $condition = "status=1"); ?>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="remarks">Remarks</label>
<textarea class="form-control" id="remarks" name="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" type="submit" name="submit">Save</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,64 @@
<div class="content-wrapper">
<!-- <div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0"><?php //echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="<?php //echo base_url(); ?>">Dashboard</a></li>
<li class="breadcrumb-item active"><?php //echo $pageTitle; ?></li>
</ol>
</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="m-0">Create <?php echo $pageTitle; ?> <a href="<?php echo site_url("master/accategories/list"); ?>" class="btn btn-sm btn-primary float-right">List <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<form method=POST action="" enctype="multipart/form-data" name="tbl_accategories">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="accategory_name">Category Name</label><input type="text" class="form-control" id="accategory_name" value="" name="accategory_name">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<?php fillComboWithValue("acgroup_id", "Account Type", "acgroup_id", "tbl_acgroups", "acgroup_name", "acgroup_id", $default = "", $CSSclass = "", $multiple = false, $condition = "status=1"); ?>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="remarks">Remarks</label>
<textarea class="form-control" id="remarks" name="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" type="submit" name="submit">Save</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,67 @@
<div class="content-wrapper">
<!-- <div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0"><?php //echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="<?php //echo base_url(); ?>">Dashboard</a></li>
<li class="breadcrumb-item active"><?php //echo $pageTitle; ?></li>
</ol>
</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="m-0">Create <?php echo $pageTitle; ?> <a href="<?php echo site_url("master/accategories/list"); ?>" class="btn btn-sm btn-primary float-right">List <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<form method=POST action="" enctype="multipart/form-data" name="tbl_accategories">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<?php fillComboWithValue("acgroup_id", "Account Type", "acgroup_id", "tbl_acgroups", "acgroup_name", "acgroup_id", $default = "", $CSSclass = "", $multiple = false, $condition = "status=1"); ?>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<?php fillComboWithValue("parent_category_id", "Parent Category", "parent_category_id", "tbl_accategories", "accategory_name", "accategory_id", $default = "", $CSSclass = "", $multiple = false, $condition = "status=1"); ?>
</div>
</div>
<div class="col">
<div class="form-group">
<label for="accategory_name">Accategory Name</label><input type="text" class="form-control" id="accategory_name" value="" name="accategory_name">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="remarks">Remarks</label>
<textarea class="form-control" id="remarks" name="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" type="submit" name="submit">Save</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,75 @@
<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; ?> <?php showListButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/list","List
".$pageTitle); ?></h5>
</div>
<div class="card-body">
<?php $TableData = $AccountCategory; ?>
<form method=POST action="" enctype="multipart/form-data" name="tbl_accategories">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<?php
fillComboWithValue("acgroup_id", "Account Type", "acgroup_id", "tbl_acgroups", "acgroup_name", "acgroup_id", $default = $TableData->acgroup_id, $CSSclass = "", $multiple = false, $condition = "status=1");
?>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<!-- <div class="col">
<div class="form-group">
<?php fillComboWithValue("parent_category_id", "Parent Category", "parent_category_id", "tbl_accategories", "accategory_name", "accategory_id", $default = $TableData->parent_category_id, $CSSclass = "", $multiple = false, $condition = "status=1"); ?>
</div>
</div> -->
<div class="col">
<div class="form-group">
<label for="accategory_name">Category Name</label><input type="text" class="form-control" id="accategory_name" value="<?php echo $TableData->accategory_name; ?>" name="accategory_name">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks">Remarks</label>
<textarea class="form-control" id="remarks" name="remarks"><?php echo $TableData->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" type="submit" name="submit">Save</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,75 @@
<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; ?> <?php showListButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/list","List
".$pageTitle); ?></h5>
</div>
<div class="card-body">
<?php $TableData = $AccountCategory; ?>
<form method=POST action="" enctype="multipart/form-data" name="tbl_accategories">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<?php
fillComboWithValue("acgroup_id","Account Group","acgroup_id","tbl_acgroups", "acgroup_name", "acgroup_id", $default=$TableData->acgroup_id,$CSSclass="",$multiple=false,$condition="status=1");
?>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<?php fillComboWithValue("parent_category_id", "Parent Category", "parent_category_id", "tbl_accategories", "accategory_name", "accategory_id", $default = $TableData->parent_category_id, $CSSclass = "", $multiple = false, $condition = "status=1"); ?>
</div>
</div>
<div class="col">
<div class="form-group">
<label for="accategory_name">Accategory Name</label><input type="text" class="form-control" id="accategory_name" value="<?php echo $TableData->accategory_name; ?>" name="accategory_name">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks">Remarks</label>
<textarea class="form-control" id="remarks" name="remarks"><?php echo $TableData->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" type="submit" name="submit">Save</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,112 @@
<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">Create <?php echo $pageTitle; ?>
<!-- <a href="<?php //echo site_url("master/accategories/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("master/accategories/add_child");?>" enctype="multipart/form-data" name="tbl_accategories">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="accategory_name">Group Name <span style="color:#ff0000">*</span></label><input type="text" class="form-control" id="accategory_name" value="" name="accategory_name" required>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<?php $this->myaccounts->showFixedAccountsCategoriesCombo("parent_category_id", " Under", "parent_category_id", "status=1", $default = "", $CSSclass = ""); ?>
<?php //fillComboWithValue("parent_category_id", "Parent Category", "parent_category_id", "tbl_accategories", "accategory_name", "accategory_id", $default = "", $CSSclass = "", $multiple = false, $condition = "status=1");
?>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="remarks">Remarks</label>
<textarea class="form-control" id="remarks" name="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">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; ?>
<!-- <a href="<?php //echo site_url("master/accategories/add_child");
?>" class="btn btn-sm btn-primary float-right">Create New <?php //echo $pageTitle;
?></a> -->
</h5>
</div>
<div class="card-body table-responsive ">
<?php $TableData = $ACCategories; ?>
<table class="table table-bordered table-striped longdataTable mt-3">
<thead>
<tr>
<!-- <th class="col-2">Type</th> -->
<!-- <th class="col-3">Category</th> -->
<th class="col-3"><?php myLang("Group Name"); ?></th>
<th class="col-3"><?php myLang("Under"); ?></th>
<th class="col-3"><?php myLang('Remarks');?></th>
<th class="col-2 text-center">Action</th>
</tr>
</thead>
<tbody>
<?php $sn = 0;
foreach ($TableData as $TableRow) : $sn++; ?>
<?php foreach ($TableRow as $cols) : $id = $cols;
break;
endforeach; ?>
<?php if ($TableRow->parent_category_id <> 0) : ?>
<tr>
<!-- <td><?php //echo $TableRow->AccountGroup->acgroup_name;
?></td> -->
<!-- <td> <?php //echo $TableRow->Parent->accategory_name; ?></td> -->
<td><?php echo $TableRow->accategory_name; ?></td>
<!-- under -->
<td><?php echo $TableRow->Parent->accategory_name; ?></td>
<td><?php echo $TableRow->remarks; ?></td>
<td class="text-center"><a href="<?php echo site_url("master/accategories/edit/$id"); ?>" class="btn btn-info btn-xs"><i class="fas fa-edit"></i> Edit</a>
<a onClick="javascript:doDelete(<?php echo $id; ?>);" class="btn btn-danger btn-xs"><i class="fas fa-trash"></i> Delete</a>
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
<tbody>
</table>
<script>
function doDelete(id) {
if (confirm('Are you sure to delete?')) {
window.location = '<?php echo site_url("master/accategories/delete/"); ?>' + id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,53 @@
<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("master/accategories/add_parent"); ?>" class="btn btn-sm btn-primary float-right">Create New <?php //echo $pageTitle; ?></a> -->
</h5>
</div>
<div class="card-body">
<?php $TableData = $ACCategories; ?>
<table class="table table-bordered table-striped longdataTable">
<thead>
<tr>
<th class="col-2">Type</th>
<th>Category Name</th>
<td class="col-1">Action</th>
</tr>
</thead>
<tbody>
<?php $sn = 0;
foreach ($TableData as $TableRow) : $sn++; ?>
<?php foreach ($TableRow as $cols) : $id = $cols;
break;
endforeach; ?>
<?php if ($TableRow->parent_category_id == 0) : ?>
<tr>
<td><?php echo $TableRow->AccountGroup->acgroup_name; ?></td>
<td><?php echo $TableRow->accategory_name; ?></td>
<td><a href="<?php echo site_url("master/accategories/edit_parents/$id"); ?>" class="btn btn-info btn-xs"><i class="fas fa-edit"></i> Edit</a>
<!-- <a onClick="javascript:doDelete(<?php //echo $id; ?>);" class="btn btn-danger btn-xs"><i class="fas fa-trash"></i> Delete</a> -->
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
<tbody>
</table>
<script>
function doDelete(id) {
if (confirm('Are you sure to delete?')) {
window.location = '<?php echo site_url("master/accategories/delete_parent/"); ?>' + id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,63 @@
<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("master/accategories/add"); ?>" class="btn btn-sm btn-primary float-right">Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $ACCategories; ?>
<table class="table table-bordered table-striped longdataTable">
<thead>
<tr>
<th class="col-1">Sn</th>
<th class="col-1">ID#</th>
<th class="col-2">Type</th>
<th class="col-2">Parent Category</th>
<th>Category Name</th>
<th class="col-1">Code</th>
<td class="col-1">Action</th>
</tr>
</thead>
<tbody>
<?php $sn = 0;
foreach ($TableData as $TableRow) : $sn++; ?>
<?php foreach ($TableRow as $cols) : $id = $cols;
break;
endforeach; ?><tr>
<td><?php echo $sn; ?></td>
<td><?php echo $TableRow->accategory_id; ?></td>
<td><?php echo getFieldfromValue("tbl_acgroups", "acgroup_name", "acgroup_id", $TableRow->acgroup_id); ?></td>
<td><?php echo ($TableRow->parent_category == "") ? "N/A" : $TableRow->parent_category; ?></td>
<td><?php echo $TableRow->accategory_name; ?></td>
<td><?php echo $TableRow->accategory_code; ?></td>
<td><a href="<?php echo site_url("master/accategories/edit/$id"); ?>" class="btn btn-info btn-xs"><i class="fas fa-edit"></i> Edit</a>
<!-- <a onClick="javascript:doDelete(<?php //echo $id; ?>);" class="btn btn-danger btn-xs"><i class="fas fa-trash"></i> Delete</a> -->
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<script>
function doDelete(id) {
if (confirm('Are you sure to delete?')) {
window.location = '<?php echo site_url("master/accategories/delete/"); ?>' + id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,120 @@
<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("accounts/accountheads/list"); ?>" class="btn btn-sm btn-primary float-right">List <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<!--COL START-->
<div class="col-8">
<div class="form-group"> <label for="account_name">Account Name</label><input type="text" class="form-control" id="account_name" value="" name="account_name" required> </div>
</div>
<div class="col-4">
<div class="form-group">
<label for="exampleInputFile">Upload Image</label>
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input" id="exampleInputFile">
<label class="custom-file-label" for="exampleInputFile">Choose file</label>
</div>
</div>
</div>
<!-- <div class="text-center">
<img class="profile-user-img img-fluid " src="../../dist/img/user4-128x128.jpg" alt="User profile picture">
</div> -->
</div>
<!--COL END-->
</div>
<div class="row">
<div class="col">
<div class="form-group">
<?php
$this->myaccounts->showAccountsCategoriesWithParentsCombo($fieldName = "accategory_id", $displayName = "Account Category", $fieldID = "accategory_id", $condition = "status=1", $default = "", $CSSclass = "select2", "required");
?>
</div>
</div>
<div class="col-3">
<div class="form-group"> <label for="opening_balance">Opening Balance</label><input type="text" class="form-control" id="opening_balance" value="" name="opening_balance"> </div>
</div>
<div class="col-1">
<div class="form-group"> <label for="opening_balance_drcr">Dr/Cr</label>
<select class="form-control" id="opening_balance_drcr" name="opening_balance_drcr" required>
<option value="DR" class="text-left">Dr</option>
<option value="CR" class="text-left">Cr</option>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">Party Details</div>
<div class="card-body">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="account_partyname">Name</label><input type="text" class="form-control" id="account_partyname" value="" name="account_partyname"> </div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="account_partyaddress">Address</label><input type="text" class="form-control" id="account_partyaddress" value="" name="account_partyaddress"> </div>
</div>
<div class="col">
<div class="form-group"> <label for="account_partycontact">Contact</label><input type="text" class="form-control" id="account_partycontact" value="" name="account_partycontact"> </div>
</div>
<div class="col">
<div class="form-group"> <label for="account_partypan">PAN</label><input type="text" class="form-control" id="account_partypan" value="" name="account_partypan"> </div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="account_partyemail">Email</label><input type="email" class="form-control" id="account_partyemail" value="" name="account_partyemail"> </div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="account_partycontactperson">Contact Person</label><input type="text" class="form-control" id="account_partycontactperson" value="" name="account_partycontactperson"> </div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="account_partycontactpersoncontact">Contact Person's Phone</label><input type="text" class="form-control" id="account_partycontactpersoncontact" value="" name="account_partycontactpersoncontact"> </div>
</div>
<!--COL END-->
</div>
</div>
</div>
</div>
<!--COL START-->
<!--COL END-->
<!--COL START-->
<!--COL END-->
<!--COL START-->
<!--COL END-->
<!--COL START-->
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="remarks">Remarks</label> <textarea class="form-control" id="remarks" name="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" type="submit" name="submit">Save</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,146 @@
<style>
.profile-user-img {
border: 3px solid #adb5bd;
margin: 0 auto;
padding: 3px;
width: 150px;
}
</style>
<div class="row">
<div class="col">
<div class="card card-primary card-outline">
<div class="card-body">
<div class="row">
<!--COL START-->
<div class="col-10">
<div class="row">
<div class="col">
<div class="form-group">
<label for="account_code">Account Category</label><input type="text" readonly class="form-control" id="account_code" value="<?php echo getFieldfromValue("tbl_accategories", "accategory_name", "accategory_id", $Account->accategory_id); ?>" name="account_code">
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="account_code">Account Code</label><input type="text" readonly class="form-control" id="account_code" value="<?php echo $Account->account_code; ?>" name="account_code">
</div>
</div>
<!--COL END-->
<div class="col">
<div class="form-group">
<label for="account_name">Account Name</label><input type="text" readonly class="form-control" id="account_name" value="<?php echo $Account->account_name; ?>" name="account_name" readonly>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="form-group">
<label for="account_type">Account Type</label><input type="text" readonly class="form-control" id="account_type" value="<?php echo $Account->account_type; ?>" name="account_type">
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="account_plcategory">P/L Category</label><input type="text" readonly class="form-control" id="account_plcategory" value="<?php echo $Account->account_plcategory; ?>" name="account_plcategory">
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="account_currency">Account Currency</label><input type="text" readonly class="form-control" id="account_currency" value="<?php echo $Account->account_currency; ?>" name="account_currency">
</div>
</div>
<!--COL END-->
</div>
</div>
<div class="col-2">
<div class="text-center">
<img class="profile-user-img img-fluid " src="../../dist/img/user4-128x128.jpg" alt="User profile picture">
</div>
</div>
<div class="col">
<div class="form-group">
<label for="account_code">Account Category</label><input type="text" readonly class="form-control" id="account_code" value="<?php echo getFieldfromValue("tbl_accategories", "accategory_name", "accategory_id", $Account->accategory_id); ?>" name="account_code">
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="account_code">Account Code</label><input type="text" readonly class="form-control" id="account_code" value="<?php echo $Account->account_code; ?>" name="account_code">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="account_partyname">Party Name</label><input type="text" readonly class="form-control" id="account_partyname" value="<?php echo $Account->account_partyname; ?>" name="account_partyname">
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="account_partyaddress">Party Address</label><input type="text" readonly class="form-control" id="account_partyaddress" value="<?php echo $Account->account_partyaddress; ?>" name="account_partyaddress">
</div>
</div>
<div class="col-2">
<div class="form-group">
<label for="account_partypan">PAN</label><input type="text" readonly class="form-control" id="account_partypan" value="<?php echo $Account->account_partypan; ?>" name="account_partypan">
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col-2">
<div class="form-group">
<label for="account_partycontact">Party Contact</label><input type="text" readonly class="form-control" id="account_partycontact" value="<?php echo $Account->account_partycontact; ?>" name="account_partycontact">
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="account_partyemail">Party Email</label><input type="email" readonly class="form-control" id="account_partyemail" value="<?php echo $Account->account_partyemail; ?>" name="account_partyemail">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="account_partycontactperson">Party Contact Person</label><input type="text" readonly class="form-control" id="account_partycontactperson" value="<?php echo $Account->account_partycontactperson; ?>" name="account_partycontactperson">
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="account_partycontactpersoncontact">Party Contact Person Phone</label><input type="text" readonly class="form-control" id="account_partycontactpersoncontact" value="<?php echo $Account->account_partycontactpersoncontact; ?>" name="account_partycontactpersoncontact">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks">Remarks</label>
<textarea class="form-control" id="remarks" name="remarks" readonly></textarea>
</div>
</div>
<!--COL END-->
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,157 @@
<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">Edit <?php echo $pageTitle; ?> <a href="<?php echo site_url("accounts/accountheads/list"); ?>" class="btn btn-sm btn-primary float-right">List <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $Account ?>
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<!--COL START-->
<div class="col-10">
<div class="form-group">
<label for="account_name">Account Name</label><input type="text" class="form-control" id="account_name" value="<?php echo $TableData->account_name; ?>" name="account_name">
</div>
</div>
<div class="col-2">
<div class="form-group">
<label for="exampleInputFile">Upload Image</label>
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input" id="exampleInputFile">
<label class="custom-file-label" for="exampleInputFile">Choose file</label>
</div>
</div>
</div>
</div>
<div class="col-7">
<div class="form-group">
<?php fillComboWithValue("accategory_id", "Under", "accategory_id", "tbl_accategories", "accategory_name", "accategory_id", $TableData->accategory_id, "", false, "status=1"); ?>
</div>
</div>
<!--COL END-->
<!--COL START-->
<!-- <div class="col-2">
<div class="form-group">
<label for="account_code">Account Code</label><input type="text" readonly class="form-control" id="account_code" value="<?php //echo $TableData->account_code; ?>" name="account_code">
</div>
</div> -->
<!--COL END-->
<!--COL START-->
<div class="col-2">
<div class="form-group"> <label for="opening_balance">Opening Balance</label><input type="text" class="form-control" id="opening_balance"
value="<?php echo ($TableData->OpeningEntry)?((($TableData->OpeningEntry->dr)>0)?$TableData->OpeningEntry->dr:$TableData->OpeningEntry->cr):""; ?>" name="opening_balance"> </div>
</div>
<div class="col-1">
<div class="form-group"> <label for="opening_balance_drcr">Dr/Cr</label>
<select class="form-control" id="opening_balance_drcr" name="opening_balance_drcr" required>
<option value="DR"
<?php echo ($TableData->OpeningEntry)?((($TableData->OpeningEntry->dr)!=0)?"SELECTED":""):""; ?>>Dr</option>
<option value="CR"
<?php echo ($TableData->OpeningEntry)?((($TableData->OpeningEntry->cr)!=0)?"SELECTED":""):""; ?>>Cr</option>
</select>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="account_partyname">Party Name</label><input type="text" class="form-control" id="account_partyname" value="<?php echo $TableData->account_partyname; ?>" name="account_partyname">
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="account_partyaddress">Party Address</label><input type="text" class="form-control" id="account_partyaddress" value="<?php echo $TableData->account_partyaddress; ?>" name="account_partyaddress">
</div>
</div>
<div class="col">
<div class="form-group">
<label for="account_partypan">PAN</label><input type="text" class="form-control" id="account_partypan" value="<?php echo $TableData->account_partypan; ?>" name="account_partypan">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="account_partycontact">Party Contact</label><input type="text" class="form-control" id="account_partycontact" value="<?php echo $TableData->account_partycontact; ?>" name="account_partycontact">
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="account_partyemail">Party Email</label><input type="email" class="form-control" id="account_partyemail" value="<?php echo $TableData->account_partyemail; ?>" name="account_partyemail">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="account_partycontactperson">Contact Person</label><input type="text" class="form-control" id="account_partycontactperson" value="<?php echo $TableData->account_partycontactperson; ?>" name="account_partycontactperson">
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="account_partycontactpersoncontact">Contact Person Phone</label><input type="text" class="form-control" id="account_partycontactpersoncontact" value="<?php echo $TableData->account_partycontactpersoncontact; ?>" name="account_partycontactpersoncontact">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks">Remarks</label>
<textarea class="form-control" id="remarks" name="remarks"><?php echo $TableData->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" type="submit" name="submit">Save</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,179 @@
<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 myLang('Create Account'); ?>
<?php //echo $pageTitle;
?>
</h5>
</div>
<div class="card-body">
<form method=POST action="<?php echo site_url("accounts/accountheads/add"); ?>" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="account_name">Account Name <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="account_name" value="" name="account_name" required> </div>
</div>
<!--COL END-->
</div>
<div class="row">
<div class="col-12">
<div class="form-group">
<?php
$this->myaccounts->showAccountsCategoriesWithParentsCombo($fieldName = "accategory_id", $displayName = "Under", $fieldID = "accategory_id", $condition = "status=1", $default = "", $CSSclass = "select2", "required");
?>
</div>
</div>
<div class="col-8">
<div class="form-group"> <label for="opening_balance">Opening Balance</label><input type="text" class="form-control" id="opening_balance" value="" name="opening_balance"> </div>
</div>
<div class="col-4">
<div class="form-group"> <label for="opening_balance_drcr">Dr/Cr</label>
<select class="form-control" id="opening_balance_drcr" name="opening_balance_drcr" required>
<option value="DR" class="text-left">Dr</option>
<option value="CR" class="text-left">Cr</option>
</select>
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="remarks">Remarks</label> <textarea class="form-control" id="remarks" name="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 mt-2" type="submit" name="submit">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 myLang('List Accounts'); ?>
<?php //myLang($pageTitle);
?>
<!-- <span class="float-right">
<a class="btn btn-primary btn-sm" href="<?php //echo site_url("accounts/accountheads/add");
?>"><?php //myLang("Create New Account");
?></a>
<a class="btn btn-warning btn-sm" href="<?php //echo site_url("accounts/accountheads/renumerate");
?>"><?php //myLang("Re-Number Codes");
?></a>
</span> -->
</h5>
</div>
<div class="card-body table-responsive">
<?php $d = 0;
$c = 0;
$TableData = $this->myaccounts->getAccountHeads(true); ?>
<table class="table table-striped table-bordered longdataTable">
<thead>
<tr>
<th class="col-1.5" rowspan="2"><?php myLang("Ledger"); ?></th>
<th class="col-1.5" rowspan="2"><?php myLang(" Group"); ?></th>
<th colspan="2" class="col-3 text-center">Opening Balance</th>
<th class="col-2 text-center" rowspan="2"><?php myLang("Action"); ?></th>
</tr>
<tr>
<th class="col-1 text-center"><?php myLang("Dr"); ?></th>
<th class="col-1 text-center"><?php myLang("Cr"); ?></th>
</tr>
</thead>
<tbody>
<?php $sn = 0;
foreach ($TableData as $TableRow) : $sn++; //pre($TableRow); ?>
<?php foreach ($TableRow as $cols) : $id = $cols;
break;
endforeach; ?><tr>
<td><?php echo linkLedger($TableRow); ?></td>
<td><?php echo linkCategory($TableRow->Group); ?></td>
<td><?php $d += doubleval($TableRow->dr_opening_balance);
echo ($TableRow->dr_opening_balance > 0) ? myCurrency($TableRow->dr_opening_balance) : ""; ?></td>
<td><?php $c += doubleval($TableRow->cr_opening_balance);
echo ($TableRow->cr_opening_balance > 0) ? myCurrency($TableRow->cr_opening_balance) : ""; ?></td>
<td class="text-center">
<a onClick="javascript:showDetails(<?php echo $id; ?>);" class="btn btn-primary btn-xs"><i class="fas fa-copy"></i> </a>
<a href="<?php echo site_url("accounts/accountheads/edit/$id"); ?>" class="btn btn-info btn-xs"><i class="fas fa-edit"></i> </a>
<a onClick="javascript:doDelete(<?php echo $id; ?>);" class="btn btn-danger btn-xs"><i class="fas fa-trash"></i> </a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<!-- Modal -->
<div class="modal fade" id="accountdetails_box" tabindex="-1" role="dialog" aria-labelledby="accountdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Account Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Account Details Goes Here
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<a class="btn btn-primary" id="details_edit_btn" href="">Edit</a>
</div>
</div>
</div>
</div>
<script>
function doDelete(id) {
if (confirm('Are you sure to delete?')) {
window.location = '<?php echo site_url("accounts/accountheads/delete/"); ?>' + id;
}
}
function showDetails(id) {
$.ajax({
url: "<?php echo site_url("accounts/accountheads/getdetails/"); ?>" + id,
success: function(data) {
$("#details_container").html(data);
$("#details_edit_btn").attr("href", "<?php echo site_url("accounts/accountheads/edit/"); ?>" + id);
$("#accountdetails_box").modal('show');
}
});
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,446 @@
<?php
$this->load->library("BIBAccounts");
$BIBAccounts = new BIBAccounts();
?>
<style>
table,
td,
tr {
padding: 0px;
margin: 0px;
}
.group-name {
width: 40%;
}
.group-total {
width: 10%;
}
.table-gray {
background-color: #eee;
}
.table td,
.table th {
padding: 0px;
margin: 0px;
}
.bg-darker {
background-color: #ddd;
}
td .table {
border: 0px !important;
margin-bottom: 0rem;
}
table td:first-child {
padding-left: 5px;
}
.table-bordered.vertical-borders td,
.table-bordered.vertical-borders th {
border-left: 1px solid #dee2e6;
border-right: 1px solid #dee2e6;
}
.table-bordered.vertical-borders thead th {
padding: 0.25rem;
border-top: none;
border-bottom: 2px solid #dee2e6;
}
.table-bordered.vertical-borders tfoot th {
padding: 0.25rem;
border-top: 2px solid #dee2e6;
border-bottom: none;
}
.currency{
font-weight: normal !important;
}
.underline{
text-decoration: underline;
}
.form-control {
display: block;
width: 100%;
height: calc(1.5rem + 1px);
padding: 0.375rem 0.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: 0.25rem;
box-shadow: inset 0 0 0 transparent;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
</style>
<div class="content-wrapper">
<section class="content">
<div class="container-fluid">
<div class="card card-primary ">
<div class="card-header">
<h4 class="card-title">Balance Sheet</h4>
</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">Starting
Period</label>
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="2078-4-1" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
</div>
</div>
<div class="col-2">
<div class="form-group">
<label for="toDate">Ending
Period</label>
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="2079-3-32" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
</div>
</div>
<div class=" text-center">
<div class="form-group">
<label for="showOB">Opening</label>
<input type="checkbox" class="form-control " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance">
</div>
</div>
<div class=" text-center">
<div class="form-group">
<label for="showClosing">Closing</label>
<input type="checkbox" class="form-control " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance">
</div>
</div>
<div class=" text-center">
<div class="form-group">
<label for="showPeriod">Period</label>
<input type="checkbox" class="form-control " name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance">
</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 class="btn btn-success expand-all mr-2" id="exportButton">Export</button>
<button type="button" class="btn btn-warning" onclick="resetForm()">Reset</button>
</div>
</div>
</div>
<small>Currently Filter Option by period are
not available</small>
</form>
<script>
function resetForm() {
document.getElementById("fromDate").value = "2078-4-1";
document.getElementById("toDate").value = "2079-3-32";
document.getElementById("showOB").checked = false;
document.getElementById("showClosing").checked = false;
document.getElementById("FilterForm").submit();
}
</script>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<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; ?> </h5>
</div>
<div class="card-body">
<?php
// echo $_POST['showClosing'];
$ReportOptions = array(
'showZeroBalances' => false,
'showOB' => false,
'showClosing' => true,
'showPeriod' => false,
'AmountColWidth' => 180,
);
?>
<button class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle
Collapse</button>
<table class="table table-bordered">
<thead>
<tr>
<td class="group-name">Particulars</td>
<td class="group-total" width="<?php echo $ReportOptions['AmountColWidth']; ?>">Amount</td>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2">
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(2); ?>
<?php $Side1Total = 0; ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable" border="0">
<?php
// Initialize variables for column totals
$incomes_totalOpeningDr = 0;
$incomes_totalOpeningCr = 0;
$incomes_totalThisYearDr = 0;
$incomes_totalThisYearCr = 0;
$incomes_totalClosingDr = 0;
$incomes_totalClosingCr = 0;
?>
<?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
<td class="group-name"><?php echo $group->acgroup_name; ?></td>
<td class="group-total" width="<?php echo $ReportOptions['AmountColWidth']; ?>"><?php echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0); ?></td>
</tr>
<tr>
<td colspan="7" class="group-details">
<div id="group_<?php echo $group->acgroup_id; ?>" class="collapse">
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTableForBS($Accountcategories, $ReportOptions, false, array()); ?>
</div>
</td>
</tr>
<?php
// Update column totals
$Side1Total += $group->closing_balance;
?>
<?php endforeach; ?>
</table>
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(5); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<?php
// Initialize variables for column totals
$incomes_totalOpeningDr = 0;
$incomes_totalOpeningCr = 0;
$incomes_totalThisYearDr = 0;
$incomes_totalThisYearCr = 0;
$incomes_totalClosingDr = 0;
$incomes_totalClosingCr = 0;
?>
<?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
<td class="group-name"><?php echo $group->acgroup_name; ?></td>
<td class="group-total"><?php echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0); ?></td>
</tr>
<tr>
<td colspan="7" class="group-details">
<div id="group_<?php echo $group->acgroup_id; ?>" class="collapse">
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTableForBS($Accountcategories, $ReportOptions, false, array()); ?>
</div>
</td>
</tr>
<?php
// Update column totals
$Side1Total += $group->closing_balance;
?>
<?php endforeach; ?>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<table class="table table-bordered">
<tr>
<th>Total Amount</th>
<th class="cr closing-cr">
<?php echo myCurrency($Side1Total); ?>
</th>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(1); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<?php
// Initialize variables for column totals
$totalOpeningDr = 0;
$totalOpeningCr = 0;
$totalThisYearDr = 0;
$totalThisYearCr = 0;
$totalClosingDr = 0;
$totalClosingCr = 0;
?>
<?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
<td class="group-name"><?php echo $group->acgroup_name; ?></td>
<td class="group-total"><?php echo myCurrency(($group->posting_side == "DR") ? $group->closing_balance : 0); ?></td>
</tr>
<tr>
<td colspan="7" class="group-details">
<div id="group_<?php echo $group->acgroup_id; ?>" class="collapse">
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTableForBS($Accountcategories, $ReportOptions, false, array()); ?>
</div>
</td>
</tr>
<?php
// Update column totals
$totalOpeningDr += ($group->posting_side == "DR") ? $group->opening_balance : 0;
$totalOpeningCr += ($group->posting_side == "CR") ? $group->opening_balance : 0;
$totalThisYearDr += ($group->posting_side == "DR") ? $group->regular_balance : 0;
$totalThisYearCr += ($group->posting_side == "CR") ? $group->regular_balance : 0;
$totalClosingDr += ($group->posting_side == "DR") ? $group->closing_balance : 0;
$totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
?>
<?php endforeach; ?>
</table>
</td>
</tr>
<?php
// pre($BIBAccounts->getAccountGroupsWithBalances(4));
$TotalIncomes = $BIBAccounts->getAccountGroupsWithBalances(3)[0]->closing_balance;
$TotalExpenses = $BIBAccounts->getAccountGroupsWithBalances(4)[0]->closing_balance;
$PL = $TotalIncomes - $TotalExpenses;
$Side1Total += $PL;
?>
<tr>
<td colspan="2">
<table class="table table-bordered">
<tr>
<td>Total Profit/Loss</td>
<td class="cr closing-cr"><?php echo myCurrency($PL); ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<table class="table table-bordered">
<tr>
<th>Total Amount</th>
<th class="dr closing-dr">
<?php echo myCurrency($totalClosingDr); ?>
</th>
</tr>
</table>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
document.getElementById("toggleShowAll").click();
});
var exportButton = document.getElementById("exportButton");
exportButton.addEventListener("click", function() {
exportTableToCSV("table.csv");
});
document.getElementById("toggleShowAll").addEventListener("click", function() {
var nestedRows = document.getElementsByClassName("collapse");
for (var i = 0; i < nestedRows.length; i++) {
if (nestedRows[i].classList.contains("show")) {
nestedRows[i].classList.remove("show");
} else {
nestedRows[i].classList.add("show");
}
}
});
function exportTableToCSV(filename) {
var csv = [];
var rows = document.querySelectorAll("table tr:not(.hide)");
for (var i = 0; i < rows.length; i++) {
var row = [];
var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)");
// Check if the parent row is collapsed or hidden
var parentRow = rows[i].closest(".collapse");
var isParentCollapsed = parentRow && (!parentRow.classList.contains("show"));
if (isParentCollapsed) {
continue; // Skip child table rows if parent is collapsed
}
for (var j = 0; j < cols.length; j++) {
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value
row.push(cellValue);
}
csv.push(row.join(","));
}
// Create a CSV file
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n");
var encodedUri = encodeURI(csvContent);
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", filename);
document.body.appendChild(link);
link.click();
}
</script>
<?php
}

View File

@@ -0,0 +1,70 @@
<?php
$this->load->library("BIBAccounts");
$BIBAccounts = new BIBAccounts();
?>
<style>
.expandable {
text-decoration: underline;
}
</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"><?php echo $pageTitle; ?> </h5>
</div>
<div class="card-body">
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(); ?>
<table class="table table-bordered longdataTable">
<thead>
<tr>
<th>Account</th>
<th width="<?php echo $drWidth; ?>">Dr</th>
<th width="<?php echo $crWidth; ?>">Cr</th>
</tr>
</thead>
<tbody>
<?php
$drTotal = 0;
$crTotal = 0;
foreach ($AccountGroups->accounts as $Account) :
$drTotal += $AccountCategory->dr;
$crTotal += $AccountCategory->cr;
?>
<tr>
<td>
<a href="<?php echo site_url("accounts/reports/balance_by_ledger") . "?group=" . $AccountCategory->accategory_id; ?>">
<?php echo $AccountCategory->accategory_name; ?>
</a>
</td>
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($AccountCategory->dr); ?></td>
<td width="<?php echo $crWidth; ?>"><?php echo myCurrency($AccountCategory->cr); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<thead>
<tr>
<th>Total</th>
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($drTotal); ?></td>
<td width="<?php echo $crWidth; ?>"><?php echo myCurrency($crTotal); ?></td>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<script>
function toggleSubTable(row) {
var subTable = row.nextElementSibling;
subTable.style.display = subTable.style.display === 'none' ? 'table-row' : 'none';
}
</script>
</div>

View File

@@ -0,0 +1,201 @@
<?php
$drWidth = 250;
$crWidth = 250;
$AccountCategories = $this->acc->getAccountCategories($acgroup_id);
$array = json_decode(json_encode($AccountCategories), true);
$tree=buildCategoryTree($array, false);
function buildCategoryTree($categories, $parent_id = 0, $showZero = true)
{
$tree = array();
foreach ($categories as $category) {
if ($category['parent_category_id'] == $parent_id) {
$children = buildCategoryTree($categories, $category['accategory_id'], $showZero);
if (!empty($children)) {
$category['children'] = $children;
}
if ($showZero && ($category['dr'] !== 0 || $category['cr'] !== 0)) {
$tree[] = $category;
} elseif (!$showZero && ($category['dr'] !== 0 && $category['cr'] !== 0)) {
$tree[] = $category;
}
}
}
return $tree;
}
function displayCategoryTree($tree) {
echo '<table class="table table-bordered">';
foreach ($tree as $category) {
echo '<tr>';
echo '<td class="col-1">' . $category['accategory_id'] . '</td>';
echo '<td><a href="'.site_url("accounts/reports/balance_by_group") . "?category=" . $category['accategory_id'] .'">' . $category['accategory_name'] . '</a></td>';
echo '<td width="250">' . myCurrency($category['dr']) . '</td>';
echo '<td>' . myCurrency($category['cr']) . '</td>';
echo '</tr>';
if (isset($category['children']) && !empty($category['children'])) {
echo '<tr>';
echo '<td colspan="4">';
displayCategoryTree($category['children']);
echo '</td>';
echo '</tr>';
}
}
echo '</table>';
}
?>
<style>
.expandable {
text-decoration: underline;
}
</style>
<div class="content-wrapper">
<div class="content">
<div class="container-fluid">
<?php //pre($tree); ?>
<div class="row">
<div class="col">
<div class="card card-primary card-outline">
<div class="card-header">
<h5 class="m-0"><?php echo $pageTitle; ?> </h5>
</div>
<div class="card-body">
<input type="checkbox" name="showZero" value="true" id="showZero">
<label for="showZero">
Show Zero Balances
</label>
<?php displayCategoryTree($tree); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<script>
function toggleSubTable(row) {
var subTable = row.nextElementSibling;
subTable.style.display = subTable.style.display === 'none' ? 'table-row' : 'none';
}
</script>
</div>
<section class="content">
<div class="container-fluid">
<div class="card">
<!-- ./card-header -->
<div class="card-body p-0">
<table class="table table-head-fixed text-nowrap table-bordered" id="treeTable">
<thead>
<tr>
<th rowspan="2" class="col-6">Particulars</th>
<th colspan="2" class="text-center col-2">Opening</th>
<th colspan="2" class="text-center col-2">This Year</th>
<th colspan="2" class="text-center col-2">Closing</th>
</tr>
<tr>
<th class="text-center">Dr. Amount</th>
<th class="text-center">Cr. Amount</th>
<th class="text-center">Dr. Amount</th>
<th class="text-center">Cr. Amount</th>
<th class="text-center">Dr. Amount</th>
<th class="text-center">Cr. Amount</th>
</tr>
</thead>
<tbody>
<tr class="parent">
<td></td>
<td>10</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="child">
<td><span class="caret" onclick="toggleNode(this)">Current Assets</span></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="grandchild">
<td><span class="caret" onclick="toggleNode(this)">Bank Assets</span></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="great-grandchild">
<td>Nabil Bank</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="great-grandchild">
<td>RBB Bank</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="grandchild">
<td><span class="caret" onclick="toggleNode(this)">Another Grandchild</span></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="great-grandchild">
<td>Child 1</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="great-grandchild">
<td>Child 2</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<!-- /.card-body -->
</div>
</div><!-- /.container-fluid -->
</section>
<!-- /.content -->

View File

@@ -0,0 +1,77 @@
<?php
$drWidth = 250;
$crWidth = 250;
$AccountCategories = $this->myaccounts->getChildAccountCategories();
?>
<style>
.expandable {
text-decoration: underline;
}
</style>
<div class="content-wrapper">
<div class="container-fluid">
</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="m-0"><?php echo $pageTitle; ?> </h5>
</div>
<div class="card-body">
<table class="table table-bordered longdataTable">
<thead>
<tr>
<th>Account</th>
<th width="<?php echo $drWidth; ?>">Dr</th>
<th width="<?php echo $crWidth; ?>">Cr</th>
</tr>
</thead>
<tbody>
<?php
$drTotal = 0;
$crTotal = 0;
foreach ($AccountCategories as $AccountCategory) :
$drTotal += $AccountCategory->dr;
$crTotal += $AccountCategory->cr;
?>
<tr>
<td>
<a href="<?php echo site_url("accounts/reports/balance_by_ledger") . "?group=" . $AccountCategory->accategory_id; ?>">
<?php echo $AccountCategory->accategory_name; ?>
</a>
</td>
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($AccountCategory->dr); ?></td>
<td width="<?php echo $crWidth; ?>"><?php echo myCurrency($AccountCategory->cr); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<thead>
<tr>
<th>Total</th>
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($drTotal); ?></td>
<td width="<?php echo $crWidth; ?>"><?php echo myCurrency($crTotal); ?></td>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<script>
function toggleSubTable(row) {
var subTable = row.nextElementSibling;
subTable.style.display = subTable.style.display === 'none' ? 'table-row' : 'none';
}
</script>
</div>

View File

@@ -0,0 +1,94 @@
<?php
$drWidth = 250;
$crWidth = 250;
$AccountBalances=array();
$AccountGroups = $this->acc->getAccountGroups($AccountBalances);
?>
<style>
.expandable {
text-decoration: underline;
}
</style>
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0"><?php echo $pageTitle; ?> </h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="<?php echo base_url(); ?>">Dashboard</a></li>
<li class="breadcrumb-item active"><?php echo $pageTitle; ?></li>
</ol>
</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 bg-primary">
<h5 class="m-0"><?php echo $pageTitle; ?> <span class="float-right">Dr Balance: <?php echo myCurrency($AccountBalances['DrBalance'],true); ?> / Cr Balance: <?php echo myCurrency($AccountBalances['CrBalance'],true); ?></span></h5>
</div>
<div class="card-body">
<table class="table table-bordered longdataTable">
<thead>
<tr>
<th>Account</th>
<th width="<?php echo $drWidth; ?>" class="text-center">Dr</th>
<th width="<?php echo $crWidth; ?>" class="text-center">Cr</th>
</tr>
</thead>
<tbody>
<?php
$drTotal = 0;
$crTotal = 0;
foreach ($AccountGroups as $AccountGroup) :
$drTotal += $AccountGroup->dr;
$crTotal += $AccountGroup->cr;
?>
<tr>
<td><a href="<?php echo site_url("accounts/reports/balance_by_category") . "?group=" . $AccountGroup->acgroup_id; ?>"><?php echo $AccountGroup->acgroup_name; ?></a></td>
<td width="<?php echo $drWidth; ?>" class="text-center"><?php echo myCurrency($AccountGroup->dr); ?></td>
<td width="<?php echo $crWidth; ?>"class="text-center"><?php echo myCurrency($AccountGroup->cr); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<thead>
<tr>
<th>Total</th>
<th width="<?php echo $drWidth; ?>"><?php echo myCurrency($drTotal); ?></th>
<th width="<?php echo $crWidth; ?>"><?php echo myCurrency($crTotal); ?></th>
</tr>
<tr>
<th>Total</th>
<th width="<?php echo $drWidth; ?>"></th>
<th width="<?php echo $crWidth; ?>"><?php echo myCurrency($drTotal-$crTotal); ?></th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<script>
function toggleSubTable(row) {
var subTable = row.nextElementSibling;
subTable.style.display = subTable.style.display === 'none' ? 'table-row' : 'none';
}
</script>
</div>

View File

@@ -0,0 +1,97 @@
<?php
$drWidth = 250;
$crWidth = 250;
$AccountGroups = $this->myaccounts->getAccountGroups();
$AccountBalances=array();
$AccountGroupTotal=0;
foreach($AccountGroups as $AccountGroup):
$AccountGroupTotal+=$this->myaccounts->getAccountBalanceR("Types",$AccountGroup->acgroup_id,$AccountBalances);
endforeach;
?>
<style>
.expandable {
text-decoration: underline;
}
</style>
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0"><?php echo $pageTitle; ?> </h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="<?php echo base_url(); ?>">Dashboard</a></li>
<li class="breadcrumb-item active"><?php echo $pageTitle; ?></li>
</ol>
</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 bg-primary ">
<h5 class="m-0"><?php echo $pageTitle; ?> <span class="float-right">Dr Balance: <?php echo myCurrency($AccountBalances['DrBalance'],true); ?> / Cr Balance: <?php echo myCurrency($AccountBalances['CrBalance'],true); ?></span></h5>
</div>
<div class="card-body">
<table class="table table-bordered longdataTable">
<thead>
<tr>
<th>Account</th>
<th width="<?php echo $drWidth; ?>">Dr</th>
<th width="<?php echo $crWidth; ?>">Cr</th>
</tr>
</thead>
<tbody>
<?php
$drTotal = 0;
$crTotal = 0;
foreach ($AccountGroups as $AccountGroup) :
$drTotal += $AccountGroup->dr;
$crTotal += $AccountGroup->cr;
?>
<tr>
<td><a href="<?php echo site_url("accounts/reports/balance_by_category") . "?group=" . $AccountGroup->acgroup_id; ?>"><?php echo $AccountGroup->acgroup_name; ?></a></td>
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($AccountGroup->dr); ?></td>
<td width="<?php echo $crWidth; ?>"><?php echo myCurrency($AccountGroup->cr); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<thead>
<tr>
<th>Total</th>
<th width="<?php echo $drWidth; ?>"><?php echo myCurrency($drTotal); ?></th>
<th width="<?php echo $crWidth; ?>"><?php echo myCurrency($crTotal); ?></th>
</tr>
<tr>
<th>Total</th>
<th width="<?php echo $drWidth; ?>"></th>
<th width="<?php echo $crWidth; ?>"><?php echo myCurrency($drTotal-$crTotal); ?></th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<script>
function toggleSubTable(row) {
var subTable = row.nextElementSibling;
subTable.style.display = subTable.style.display === 'none' ? 'table-row' : 'none';
}
</script>
</div>

View File

@@ -0,0 +1,90 @@
<?php
$t="INSERT INTO tbl_acgroups (acgroup_id, acgroup_code, acgroup_name, posting_side, created_on, created_by, remarks, status, display_order)
SELECT 5, '5', 'Equity', 'CR', '2023-05-22', 'admin', '', 1, 2
WHERE NOT EXISTS (
SELECT 1 FROM tbl_acgroups WHERE acgroup_id = 5
);
";
$this->db->query($t);
$LiabilitiesAccounts = $this->acc->getAccountsByGroup(2);
$EquityAccounts = $this->acc->getAccountsByGroup(5);
$AssetsAccounts = $this->acc->getAccountsByGroup(1);
$LiabilitiesTotal = $this->acc->getAccountBalanceByGroup(2);
$EquityTotal = $this->acc->getAccountBalanceByGroup(5);
$AssetsTotal = $this->acc->getAccountBalanceByGroup(1, false);
$IncomeAccounts = $this->acc->getAccountsByGroup(3);
$ExpenseAccounts = $this->acc->getAccountsByGroup(4);
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
$PL = $IncomesTotal - $ExpensesTotal;
$LiabilitiesTotal=$LiabilitiesTotal+$EquityTotal+$PL;
?>
<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; ?> </h5>
</div>
<div class="card-body">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th colspan="4">Balance Sheet Statement</th>
</tr>
</thead>
<tbody>
<tr class="bg-dark">
<th>Liabilities</th>
<th class="col-2">Amount</th>
<th>Assets</th>
<th class="col-2">Amount</th>
</tr>
<tr class="bg-light">
<td colspan="2">
<?php $this->acc->showTable($LiabilitiesAccounts); ?>
<?php $this->acc->showTable($EquityAccounts); ?>
</td>
<td colspan="2">
<?php $this->acc->showTable($AssetsAccounts, false); ?>
</td>
</tr>
</tbody>
<tfoot>
<tr class="bg-light">
<th>Net Profit:</th>
<th><?php echo myCurrency($PL); ?></th>
<th></th>
<th></th>
</tr>
<tr class="bg-light">
<th>Total Liabilities:</th>
<th><?php echo myCurrency($LiabilitiesTotal); ?></th>
<th>Total Assets: </th>
<th><?php echo myCurrency($AssetsTotal); ?></th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,434 @@
<?php
$this->load->library("BIBAccounts");
$BIBAccounts = new BIBAccounts();
?>
<style>
table,
td,
tr {
padding: 0px;
margin: 0px;
}
.group-name {
width: 40%;
font-weight: 600px;
}
.group-total {
width: 10%;
}
.table-gray {
background-color: #eee;
}
.table td,
.table th {
padding: 0px;
margin: 0px;
}
.bg-darker {
background-color: #ddd;
}
td .table {
border: 0px !important;
margin-bottom: 0rem;
}
table td:first-child {
padding-left: 5px;
}
.table-bordered.vertical-borders td,
.table-bordered.vertical-borders th {
border-left: 1px solid #dee2e6;
border-right: 1px solid #dee2e6;
}
.table-bordered.vertical-borders thead th {
padding: 0.25rem;
border-top: none;
border-bottom: 2px solid #dee2e6;
}
.table-bordered.vertical-borders tfoot th {
padding: 0.25rem;
border-top: 2px solid #dee2e6;
border-bottom: none;
}
.currency{
font-weight: normal !important;
}
.underline{
text-decoration: underline;
}
.form-control {
display: block;
width: 100%;
height: calc(1.5rem + 1px);
padding: 0.375rem 0.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: 0.25rem;
box-shadow: inset 0 0 0 transparent;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
</style>
<div class="content-wrapper">
<section 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 = "2078-4-1";
document.getElementById("toDate").value = "2079-3-32";
document.getElementById("showOB").checked = false;
document.getElementById("showClosing").checked = false;
document.getElementById("FilterForm").submit();
}
</script>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col">
<button class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle Collapse</button>
<div class="card card-primary card-outline">
<div class="card-body p-0">
<!-- <button class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle
Collapse</button> -->
<?php
// echo $_POST['showClosing'];
$ReportOptions = array(
'showZeroBalances' => false,
'showOB' => false,
'showClosing' => true,
'showPeriod' => false,
);
?>
<table class="table table-bordered">
<thead>
<tr>
<td class="group-name"><b>Particulars</b></td>
<td class="group-total text-right pr-2 "><b>Amount</b></td>
<td class="group-name"><b>Particulars</b></td>
<td class="group-total text-right pr-2"><b>Amount</b></td>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2" class="p-0">
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(2); ?>
<?php $Side1Total = 0; ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<?php
// Initialize variables for column totals
$incomes_totalOpeningDr = 0;
$incomes_totalOpeningCr = 0;
$incomes_totalThisYearDr = 0;
$incomes_totalThisYearCr = 0;
$incomes_totalClosingDr = 0;
$incomes_totalClosingCr = 0;
?>
<?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
<td ><b><?php echo $group->acgroup_name; ?></b></td>
<td width="20%" ><?php echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0); ?></td>
</tr>
<tr>
<td colspan="7" class="group-details p-0">
<div id="group_<?php echo $group->acgroup_id; ?>" class="collapse">
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
</div>
</td>
</tr>
<?php
// Update column totals
$Side1Total += $group->closing_balance;
?>
<?php endforeach; ?>
</table>
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(5); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<?php
// Initialize variables for column totals
$incomes_totalOpeningDr = 0;
$incomes_totalOpeningCr = 0;
$incomes_totalThisYearDr = 0;
$incomes_totalThisYearCr = 0;
$incomes_totalClosingDr = 0;
$incomes_totalClosingCr = 0;
?>
<?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
<td class="group-name"><?php echo $group->acgroup_name; ?></td>
<td class="group-total"><?php echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0); ?></td>
</tr>
<tr>
<td colspan="7" class="group-details p-0">
<div id="group_<?php echo $group->acgroup_id; ?>" class="collapse">
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
</div>
</td>
</tr>
<?php
// Update column totals
$Side1Total += $group->closing_balance;
?>
<?php endforeach; ?>
</table>
</td>
<td colspan="2" class="p-0">
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(1); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<?php
// Initialize variables for column totals
$totalOpeningDr = 0;
$totalOpeningCr = 0;
$totalThisYearDr = 0;
$totalThisYearCr = 0;
$totalClosingDr = 0;
$totalClosingCr = 0;
?>
<?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
<td class="group-name"><?php echo $group->acgroup_name; ?></td>
<td class="group-total"><?php echo myCurrency(($group->posting_side == "DR") ? $group->closing_balance : 0); ?></td>
</tr>
<tr>
<td colspan="7" class="group-details p-0">
<div id="group_<?php echo $group->acgroup_id; ?>" class="collapse">
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
</div>
</td>
</tr>
<?php
// Update column totals
$totalOpeningDr += ($group->posting_side == "DR") ? $group->opening_balance : 0;
$totalOpeningCr += ($group->posting_side == "CR") ? $group->opening_balance : 0;
$totalThisYearDr += ($group->posting_side == "DR") ? $group->regular_balance : 0;
$totalThisYearCr += ($group->posting_side == "CR") ? $group->regular_balance : 0;
$totalClosingDr += ($group->posting_side == "DR") ? $group->closing_balance : 0;
$totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
?>
<?php endforeach; ?>
</table>
</td>
</tr>
<?php
// pre($BIBAccounts->getAccountGroupsWithBalances(4));
$TotalIncomes = $BIBAccounts->getAccountGroupsWithBalances(3)[0]->closing_balance;
$TotalExpenses = $BIBAccounts->getAccountGroupsWithBalances(4)[0]->closing_balance;
$PL = $TotalIncomes - $TotalExpenses;
$Side1Total += $PL;
?>
<tr>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<td>Total Profit/Loss</td>
<td class="cr closing-cr"><?php echo myCurrency($PL); ?></td>
</tr>
</table>
</td>
<td colspan="2" class="p-0">
</td>
</tr>
<tr>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th>Total Amount</th>
<th class="cr closing-cr">
<?php echo myCurrency($Side1Total); ?>
</th>
</tr>
</table>
</td>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th>Total Amount</th>
<th class="dr closing-dr">
<?php echo myCurrency($totalClosingDr); ?>
</th>
</tr>
</table>
</td>
</tr>
</table>
<?php //pre($BIBAccounts->getAccountGroupsWithBalances($acgroup_id = null)); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
document.getElementById("toggleShowAll").click();
});
document.getElementById("toggleShowAll").addEventListener("click", function() {
var nestedRows = document.getElementsByClassName("collapse");
for (var i = 0; i < nestedRows.length; i++) {
if (nestedRows[i].classList.contains("show")) {
nestedRows[i].classList.remove("show");
} else {
nestedRows[i].classList.add("show");
}
}
});
var exportButton = document.getElementById("exportButton");
exportButton.addEventListener("click", function() {
exportTableToCSV("table.csv");
});
function exportTableToCSV(filename) {
var csv = [];
var rows = document.querySelectorAll("table tr:not(.hide)");
for (var i = 0; i < rows.length; i++) {
var row = [];
var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)");
// Check if the parent row is collapsed or hidden
var parentRow = rows[i].closest(".collapse");
var isParentCollapsed = parentRow && (!parentRow.classList.contains("show"));
if (isParentCollapsed) {
continue; // Skip child table rows if parent is collapsed
}
for (var j = 0; j < cols.length; j++) {
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value
row.push(cellValue);
}
csv.push(row.join(","));
}
// Create a CSV file
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n");
var encodedUri = encodeURI(csvContent);
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", filename);
document.body.appendChild(link);
link.click();
}
</script>
<?php
}

View File

@@ -0,0 +1,322 @@
<?php
$this->load->library("BIBAccounts");
$BIBAccounts = new BIBAccounts();
?>
<!-- Include jQuery -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<!-- Include jQuery UI -->
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<style>
table,
td,
tr {
padding: 0px;
margin: 0px;
}
.group-name {
width: 40%;
}
.group-total {
width: 10%;
}
.table-gray {
background-color: #eee;
}
.table td,
.table th {
padding: 0px;
margin: 0px;
}
.bg-darker {
background-color: #ddd;
}
td .table {
border: 0px !important;
margin-bottom: 0rem;
}
table td:first-child {
padding-left: 5px;
}
.table-bordered.vertical-borders td,
.table-bordered.vertical-borders th {
border-left: 1px solid #dee2e6;
border-right: 1px solid #dee2e6;
}
.table-bordered.vertical-borders thead th {
border-top: none;
border-bottom: 2px solid #dee2e6;
}
.table-bordered.vertical-borders tfoot th {
border-top: 2px solid #dee2e6;
border-bottom: none;
}
</style>
<div class="content-wrapper">
<div class="content">
<div class="container-fluid">
<div class="card card-primary ">
<div class="card-header">
<h4 class="card-title"><?php myLang("Report Options"); ?></h4>
</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" : ""; ?>>
</div>
</div>
<div class="col">
<div class="form-group d-flex justify-content-end">
<button class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle Collapse</button>
<button type="submit" class="btn btn-primary mr-2">Filter</button>
<button class="btn btn-success expand-all mr-2" id="exportButton">Export</button>
<button type="button" class="btn btn-warning" onclick="resetForm()">Reset</button>
</div>
</div>
</div>
<small>Currently Filter Option by period are not available</small>
</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-body p-0 table-responsive">
<?php
// echo $_POST['showClosing'];
$ReportOptions = array(
'showZeroBalances' => false,
// 'showZeroBalances' => false,
'showOB' => false,
'showClosing' => true,
'showPeriod' => false,
);
// die;
?>
<?php
$showZeroBalances = false;
?>
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<thead>
<tr>
<th rowspan="2">Particulars</th>
<th colspan="2" class="text-center">Opening</th>
<th colspan="2" class="text-center">This Year</th>
<th colspan="2" class="text-center">Closing</th>
</tr>
<tr>
<th class="text-right">Dr. Amount</th>
<th class="text-right">Cr. Amount</th>
<th class="text-right">Dr. Amount</th>
<th class="text-right">Cr. Amount</th>
<th class="text-right">Dr. Amount</th>
<th class="text-right">Cr. Amount</th>
</tr>
</thead>
<!-- <thead>
<tr>
<th>Particulars</th>
<th class="dr opening-dr">Opening (Dr)</th>
<th class="cr opening-cr">Opening (Cr)</th>
<th class="dr this-year-dr">This Year (Dr)</th>
<th class="cr this-year-cr">This Year (Cr)</th>
<th class="dr closing-dr">Closing (Dr)</th>
<th class="cr closing-cr">Closing (Cr)</th>
</tr>
</thead> -->
<?php
// Initialize variables for column totals
$totalOpeningDr = 0;
$totalOpeningCr = 0;
$totalThisYearDr = 0;
$totalThisYearCr = 0;
$totalClosingDr = 0;
$totalClosingCr = 0;
?>
<?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
<td class="group-name"><i class="expandable-table-caret fas fa-caret-right fa-fw"></i> <?php echo $group->acgroup_name; ?></td>
<td class="group-total"><?php echo myCurrency(($group->posting_side == "DR") ? $group->opening_balance : 0); ?></td>
<td class="group-total"><?php echo myCurrency(($group->posting_side == "CR") ? $group->opening_balance : 0); ?></td>
<td class="group-total"><?php echo myCurrency(($group->posting_side == "DR") ? $group->regular_balance : 0); ?></td>
<td class="group-total"><?php echo myCurrency(($group->posting_side == "CR") ? $group->regular_balance : 0); ?></td>
<td class="group-total"><?php echo myCurrency(($group->posting_side == "DR") ? $group->closing_balance : 0); ?></td>
<td class="group-total"><?php echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0); ?></td>
</tr>
<tr>
<td colspan="7" class="group-details p-0">
<div id="group_<?php echo $group->acgroup_id; ?>" class="collapse p-0">
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, array(), $showZeroBalances); ?>
</div>
</td>
</tr>
<?php
// Update column totals
$totalOpeningDr += ($group->posting_side == "DR") ? $group->opening_balance : 0;
$totalOpeningCr += ($group->posting_side == "CR") ? $group->opening_balance : 0;
$totalThisYearDr += ($group->posting_side == "DR") ? $group->regular_balance : 0;
$totalThisYearCr += ($group->posting_side == "CR") ? $group->regular_balance : 0;
$totalClosingDr += ($group->posting_side == "DR") ? $group->closing_balance : 0;
$totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
?>
<?php endforeach; ?>
<tfoot>
<tr>
<th>Total Amount</th>
<th class="dr opening-dr"><?php echo myCurrency($totalOpeningDr); ?></th>
<th class="cr opening-cr"><?php echo myCurrency($totalOpeningCr); ?></th>
<th class="dr this-year-dr"><?php echo myCurrency($totalThisYearDr); ?></th>
<th class="cr this-year-cr"><?php echo myCurrency($totalThisYearCr); ?></th>
<th class="dr closing-dr"><?php echo myCurrency($totalClosingDr); ?></th>
<th class="cr closing-cr"><?php echo myCurrency($totalClosingCr); ?></th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
var exportButton = document.getElementById("exportButton");
exportButton.addEventListener("click", function() {
exportTableToCSV("table.csv");
});
document.getElementById("toggleShowAll").addEventListener("click", function() {
var nestedRows = document.getElementsByClassName("collapse");
for (var i = 0; i < nestedRows.length; i++) {
if (nestedRows[i].classList.contains("show")) {
nestedRows[i].classList.remove("show");
} else {
nestedRows[i].classList.add("show");
}
}
});
function exportTableToCSV(filename) {
var csv = [];
var rows = document.querySelectorAll("table tr:not(.hide)");
for (var i = 0; i < rows.length; i++) {
var row = [];
var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)");
// Check if the parent row is collapsed or hidden
var parentRow = rows[i].closest(".collapse");
var isParentCollapsed = parentRow && (!parentRow.classList.contains("show"));
if (isParentCollapsed) {
continue; // Skip child table rows if parent is collapsed
}
for (var j = 0; j < cols.length; j++) {
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value
row.push(cellValue);
}
csv.push(row.join(","));
}
// Create a CSV file
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n");
var encodedUri = encodeURI(csvContent);
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", filename);
document.body.appendChild(link);
link.click();
}
</script>
<?php
}

View File

@@ -0,0 +1,321 @@
<?php
$this->load->library("BIBAccounts");
$BIBAccounts = new BIBAccounts();
?>
<?php
$IncomeAccounts = $this->acc->getAccountsByGroup(3);
$ExpenseAccounts = $this->acc->getAccountsByGroup(4);
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
$PL = $IncomesTotal - $ExpensesTotal;
?>
<style>
table,
td,
tr {
padding: 0px;
margin: 0px;
}
.group-name {
width: 40%;
}
.group-total {
width: 10%;
}
.table-gray {
background-color: #eee;
}
.table td,
.table th {
padding: 0px;
margin: 0px;
}
.bg-darker {
background-color: #ddd;
}
td .table {
border: 0px !important;
margin-bottom: 0rem;
}
table td:first-child {
padding-left: 5px;
}
.table-bordered.vertical-borders td,
.table-bordered.vertical-borders th {
border-left: 1px solid #dee2e6;
border-right: 1px solid #dee2e6;
}
.table-bordered.vertical-borders thead th {
padding: 0.25rem;
border-top: none;
border-bottom: 2px solid #dee2e6;
}
.table-bordered.vertical-borders tfoot th {
padding: 0.25rem;
border-top: 2px solid #dee2e6;
border-bottom: none;
}
.currency {
font-weight: normal !important;
}
.underline {
text-decoration: underline;
}
.form-control {
display: block;
width: 100%;
height: calc(1.5rem + 1px);
padding: 0.375rem 0.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: 0.25rem;
box-shadow: inset 0 0 0 transparent;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
</style>
<div class="content-wrapper">
<section class="content">
<div class="container-fluid">
<div class="card card-primary ">
<div class="card-header">
<h3 class="card-title">Receipts And Payments <?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 class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle Collapse</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 = "2078-4-1";
document.getElementById("toDate").value = "2079-3-32";
document.getElementById("showOB").checked = false;
document.getElementById("showClosing").checked = false;
document.getElementById("FilterForm").submit();
}
</script>
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title">Cash Flow</h4>
</div>
<div class="card-body table-responsive p-0">
<?php $IncomesExpenses = $BIBAccounts->prepareIncomeExpenses() ?>
<table class="table table-head-fixed table-bordered g-0">
<thead>
<tr>
<th class="" width="35%"><?php myLang("Cash inflow"); ?></th>
<th class="text-right" width="15%"></th>
<th class="text-right" width="15%"><?php myLang("Amount"); ?></th>
<th class="" width="35%"><?php echo myLang("Cash outflow"); ?></th>
<th class="text-right" width="15%"></th>
<th class="text-right" width="15%"><?php myLang("Amount"); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td colspan=3 class="p-0">
<table class="table g-0">
<?php $total1 = 0;
foreach ($IncomesExpenses['Incomes'] as $Incomes) { ?>
<?php if ($Incomes['account'] == "GROUP TOTAL") : ?>
<!-- <tr>
<td class="" width="70%"><b><?php echo $Incomes['group']; ?></b></td>
<td width="15%"></td>
<td class="text-right" width="15%"><u><?php echo myCurrency($Incomes['amount']); ?></u></td>
</tr> -->
<?php elseif ($Incomes['account'] == "CATEGORY TOTAL") : ?>
<tr>
<td class="" width="70%"><b><?php echo $Incomes['category']; ?></b></td>
<td class="text-right" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td>
<td width="15%"></td>
</tr>
<?php else : ?>
<?php $total1 += $Incomes['amount']; ?>
<tr>
<td class="" width="70%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Incomes['account']; ?></td>
<td width="15%"></td>
<td class="text-right" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td>
</tr>
<?php endif; ?>
<?php }; ?>
</table>
</td>
<td colspan=3 class="p-0">
<table class="table g-0">
<?php $total = 0;
foreach ($IncomesExpenses['Expenses'] as $Expenses) {
if ($Expenses['account'] == "GROUP TOTAL") : ?>
<!-- <tr>
<td class="" width="70%"><b><?php echo $Expenses['group']; ?></b></td>
<td width="15%"></td>
<td class="text-right" width="15%"><u><?php echo myCurrency($Expenses['amount']); ?></u></td>
</tr> -->
<?php elseif ($Expenses['account'] == "CATEGORY TOTAL") : ?>
<tr>
<td class="" width="70%"><b><?php echo $Expenses['category']; ?></b></td>
<td class="text-right" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td>
<td width="15%"></td>
</tr>
<?php else : ?>
<?php $total += $Expenses['amount']; ?>
<tr>
<td class="" width="70%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Expenses['account']; ?></td>
<td width="15%"></td>
<td class="text-right" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td>
</tr>
<?php endif; ?>
<?php }; ?>
</table>
</td>
</tr>
</tbody>
<tr>
<th>Total</th>
<td></td>
<td class="text-right"><?php echo myCurrency($total1); ?></td>
<th>Total</th>
<td></td>
<td class="text-right"><?php echo myCurrency($total); ?></td>
</tr>
<tr>
<th></th>
<td></td>
<td class="text-right"></td>
<th>Net Inflow</th>
<td></td>
<td class="text-right"><?php echo myCurrency($total1 - $total); ?></td>
</tr>
<?php $Bank = $BIBAccounts->getAccountCategoriesWithBalances(null, 2); ?>
<?php foreach ($Bank->accounts as $account) : ?>
<tr>
<th></th>
<td></td>
<td class="text-right"></td>
<th><?php echo $account->account_name; ?></th>
<td></td>
<td class="text-right"><?php echo myCurrency($account->balances['dr_total'] - $account->balances['cr_total']); ?></td>
</tr>
<?php endforeach; ?>
<?php $Cash = $BIBAccounts->getAccountCategoriesWithBalances(null, 3); ?>
<?php foreach ($Cash->accounts as $account) : ?>
<tr>
<th></th>
<td></td>
<td class="text-right"></td>
<th><?php echo $account->account_name; ?></th>
<td></td>
<td class="text-right"><?php echo myCurrency($account->balances['dr_total'] - $account->balances['cr_total']); ?></td>
</tr>
<?php endforeach; ?>
</table>
<?php //pre($IncomesExpenses);
?>
</div>
</div>
</div><!-- /.container-fluid -->
</section>

View File

@@ -0,0 +1,41 @@
<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; ?> </h5>
</div>
<div class="card-body">
<form method="GET" action="">
<div class="row">
<div class="col-2"><?php createNepaliDateInput("from_date", "Date", "from_date", isset($_GET['from_date']) ? $_GET['from_date'] : ''); ?></div>
<div class="col-1"><?php createButton("show_voucher", "Show", "show_voucher", "Submit", "mt-30"); ?></div>
</div>
</form>
<div id="dataTable_Commands"></div>
<?php
$fromDate = isset($_GET['from_date']) ? NepaliToEnglishDate($_GET['from_date']) : NepaliToEnglishDate(firstDayOfNepaliMonth());
$toDate = isset($_GET['to_date']) ? NepaliToEnglishDate($_GET['to_date']) : Today();
// echo $toDate;
$account_id = isset($_GET['account_id']) ? $_GET['account_id'] : '';
$vouchertype_id = isset($_GET['vouchertypes']) ? $_GET['vouchertypes'] : '';
$this->myaccounts->listVouchers($fromDate, $fromDate, $account_id, $vouchertype_id, true, true);
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,131 @@
<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; ?> </h5>
</div>
<div class="card-body">
<form method=POST action="" enctype="multipart/form-data" name="tbl_vouchers">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="import_type">Voucher List</label>
<select class="form-control" id="import_type" value="" name="import_type">
<option value="Groups">Groups</option>
<option value="Categories">Categories</option>
<option value="Accounts">Accounts</option>
<option value="Vouchers">Vouchers</option>
<option value="VoucherDetails">Voucher Details</option>
<option value="All">All</option>
</select>
</div>
</div>
<div class="col">
<div class="form-group"> <label for="voucher_list">Voucher List</label>
<input type="file" class="form-control" id="voucher_list" value="" name="voucher_list">
</div>
</div>
<!--COL END-->
</div>
</div>
<button class="btn btn-primary" type="submit" name="submit">Save</button>
</form>
<?php if(isset($importedData)) { ?>
<?php $importedAccounts=array(); ?>
<table class="table table-striped table-responsive dataTable">
<thead>
<?php $h = $importedData[0];
unset($importedData[0]); ?>
<tr>
<?php $i=0; foreach ($h as $c) : ?>
<th><?php echo $c." ($i)"; $i++; ?>
</th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($importedData as $r) : ?>
<?php $importedAccounts=addAccounts($r,$importedAccounts); ?>
<tr>
<?php foreach ($r as $c) : ?>
<td><?php echo $c; ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php
$this->db->query("truncate table tbl_accounts");
foreach($importedAccounts as $importedAccount):
$this->db->insert("tbl_accounts",$importedAccount);
endforeach;
?>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function addAccounts($importedLine, $importedAccounts)
{
/*
[0] => account_id
[1] => accategory_id
[2] => account_code
[3] => account_name
[4] => account_type
[5] => account_plcategory
[6] => account_currency
[7] => account_partyname
[8] => account_partyaddress
[9] => account_partypan
[10] => account_partycontact
[11] => account_partyemail
[12] => account_partycontactperson
[13] => account_partycontactpersoncontact
[14] => created_on
[15] => created_by
[16] => remarks
[17] => status
*/
$dbAccount=new stdClass;
$dbAccount->account_id=$importedLine[1];
$dbAccount->accategory_id=$importedLine[2];
$dbAccount->account_code=$importedLine[3];
$dbAccount->account_name=$importedLine[4];
$dbAccount->account_type=$importedLine[5];
$dbAccount->account_plcategory=$importedLine[6];
$dbAccount->account_currency=$importedLine[7];
$dbAccount->account_partyname=$importedLine[14];
$dbAccount->account_partyaddress=$importedLine[15];
$dbAccount->account_partycontact=$importedLine[16];
$dbAccount->account_partyemail='N/A';
$dbAccount->account_partycontactperson=$importedLine[17];
$dbAccount->account_partycontactpersoncontact='';
$dbAccount->created_on=dbDate($importedLine[9]);
$dbAccount->created_by=$importedLine[8];
$dbAccount->remarks=$importedLine[12];
$dbAccount->status=$importedLine[13];
if(!in_array($dbAccount,$importedAccounts)) $importedAccounts[]=$dbAccount;
return $importedAccounts;
}
?>

View File

@@ -0,0 +1,113 @@
<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; ?> </h5>
</div>
<div class="card-body">
<form method=POST action="" enctype="multipart/form-data" name="tbl_vouchers">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="import_type">Voucher List</label>
<select class="form-control" id="import_type" value="" name="import_type">
<option value="Groups">Groups</option>
<option value="Categories">Categories</option>
<option value="Accounts">Accounts</option>
<option value="Vouchers">Vouchers</option>
<option value="VoucherDetails">Voucher Details</option>
<option value="All">All</option>
</select>
</div>
</div>
<div class="col">
<div class="form-group"> <label for="voucher_list">Voucher List</label>
<input type="file" class="form-control" id="voucher_list" value="" name="voucher_list">
</div>
</div>
<!--COL END-->
</div>
</div>
<button class="btn btn-primary" type="submit" name="submit">Save</button>
</form>
<?php if(isset($importedData)) { ?>
<?php $importedCategories=array(); ?>
<table class="table table-striped table-responsive dataTable">
<thead>
<?php $h = $importedData[0];
unset($importedData[0]); ?>
<tr>
<?php $i=0; foreach ($h as $c) : ?>
<th><?php echo $c." ($i)"; $i++; ?>
</th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($importedData as $r) : ?>
<?php $importedCategories=addCategory($r,$importedCategories); ?>
<tr>
<?php foreach ($r as $c) : ?>
<td><?php echo $c; ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php
$this->db->query("truncate table tbl_accategories");
foreach($importedCategories as $importedCategory):
$this->db->insert("tbl_accategories",$importedCategory);
endforeach;
?>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function addCategory($importedLine,$importedCategories)
{
/*
[0] => accategory_id
[1] => acgroup_id
[2] => accategory_code
[3] => accategory_name
[4] => created_on
[5] => created_by
[6] => remarks
[7] => status
*/
$dbCategory=new stdClass;
$dbCategory->accategory_id=$importedLine[1];
$dbCategory->acgroup_id=$importedLine[2];
$dbCategory->accategory_code=$importedLine[3];
$dbCategory->accategory_name=$importedLine[4];
$dbCategory->created_on=dbDate($importedLine[6]);
$dbCategory->created_by=$importedLine[7];
$dbCategory->remarks=$importedLine[8];
$dbCategory->status=$importedLine[9];
if(!in_array($dbCategory,$importedCategories)) $importedCategories[]=$dbCategory;
return $importedCategories;
}
?>

View File

@@ -0,0 +1,111 @@
<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; ?> </h5>
</div>
<div class="card-body">
<form method=POST action="" enctype="multipart/form-data" name="tbl_vouchers">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="import_type">Voucher List</label>
<select class="form-control" id="import_type" value="" name="import_type">
<option value="Groups">Groups</option>
<option value="Categories">Categories</option>
<option value="Accounts">Accounts</option>
<option value="Vouchers">Vouchers</option>
<option value="VoucherDetails">Voucher Details</option>
<option value="All">All</option>
</select>
</div>
</div>
<div class="col">
<div class="form-group"> <label for="voucher_list">Voucher List</label>
<input type="file" class="form-control" id="voucher_list" value="" name="voucher_list">
</div>
</div>
<!--COL END-->
</div>
</div>
<button class="btn btn-primary" type="submit" name="submit">Save</button>
</form>
<?php if(isset($importedData)) { ?>
<?php $importedGroups=array(); ?>
<table class="table table-striped table-responsive dataTable">
<thead>
<?php $h = $importedData[0];
unset($importedData[0]); ?>
<tr>
<?php $i=0; foreach ($h as $c) : ?>
<th><?php echo $c." ($i)"; $i++; ?>
</th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($importedData as $r) : ?>
<?php $importedGroups=addGroup($r,$importedGroups); ?>
<tr>
<?php foreach ($r as $c) : ?>
<td><?php echo $c; ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php
$this->db->query("truncate table tbl_acgroups");
foreach($importedGroups as $importedGroup):
$this->db->insert("tbl_acgroups",$importedGroup);
endforeach;
?>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function addGroup($importedLine, $importedGroups)
{
/*
[0] => acgroup_id
[1] => acgroup_code
[2] => acgroup_name
[3] => created_on
[4] => created_by
[5] => remarks
[6] => status
[7] => display_order
*/
$dbGroup=new stdClass;
$dbGroup->acgroup_id=$importedLine[1];
$dbGroup->acgroup_code=$importedLine[3];
$dbGroup->acgroup_name=$importedLine[4];
$dbGroup->created_on=dbDate($importedLine[5]);
$dbGroup->created_by=$importedLine[6];
$dbGroup->remarks=$importedLine[7];
$dbGroup->status=$importedLine[8];
if(!in_array($dbGroup,$importedGroups)) $importedGroups[]=$dbGroup;
return $importedGroups;
}
?>

View File

@@ -0,0 +1,141 @@
<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; ?> </h5>
</div>
<div class="card-body">
<form method=POST action="" enctype="multipart/form-data" name="tbl_vouchers">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="import_type">Voucher List</label>
<select class="form-control" id="import_type" value="" name="import_type">
<option value="Groups">Groups</option>
<option value="Categories">Categories</option>
<option value="Accounts">Accounts</option>
<option value="Vouchers">Vouchers</option>
<option value="VoucherDetails">Voucher Details</option>
<option value="All">All</option>
</select>
</div>
</div>
<div class="col">
<div class="form-group"> <label for="voucher_list">Voucher List</label>
<input type="file" class="form-control" id="voucher_list" value="" name="voucher_list">
</div>
</div>
<!--COL END-->
</div>
</div>
<button class="btn btn-primary" type="submit" name="submit">Save</button>
</form>
<?php if(isset($importedData)) { ?>
<?php $importedVoucherDetails=array(); ?>
<table class="table table-striped table-responsive dataTable">
<thead>
<?php $h = $importedData[0];
unset($importedData[0]); ?>
<tr>
<?php $i=0; foreach ($h as $c) : ?>
<th><?php echo $c." ($i)"; $i++; ?>
</th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($importedData as $r) : ?>
<?php
$importedVoucherDetails=addVoucherDetails($r,$importedVoucherDetails);
//pre($r);die;
?>
<tr>
<?php foreach ($r as $c) : ?>
<td><?php echo $c; ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php
$this->db->query("truncate table tbl_voucherdetails");
foreach($importedVoucherDetails as $importedVoucherDetail):
$this->db->insert("tbl_voucherdetails",$importedVoucherDetail);
endforeach;
echo "Vouche Details Imported Successfully!!\n";
?>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function addVoucherDetails($importedLine, $importedVoucherDetails)
{
//pre($importedLine);//die;
/*
[0] => voucherdetail_id
[1] => voucher_id
[2] => entry_no
[3] => transaction_date
[4] =>
[5] => narration
[6] => dr
[7] => cr
[8] => cheque
[9] => cheque_details
[10] => currency
[11] => exrate
[12] => fcdr
[13] => fccr
[14] => branch_id
[15] => fiscalyear_id
[16] => created_on
[17] => created_by
[18] => remarks
[19] => status
*/
if(sizeof($importedLine)>0):
$dbVoucherDetail=new stdClass;
$dbVoucherDetail->voucherdetail_id=$importedLine[1];
$dbVoucherDetail->voucher_id=$importedLine[2];
$dbVoucherDetail->entry_no=$importedLine[3];
$dbVoucherDetail->transaction_date=dbDate($importedLine[4]);
$dbVoucherDetail->account_id=$importedLine[5];
$dbVoucherDetail->narration=$importedLine[6];
$dbVoucherDetail->dr=$importedLine[7];
$dbVoucherDetail->cr=$importedLine[8];//$_SESSION['FiscalYearID'];
$dbVoucherDetail->cheque=$importedLine[9];//$_SESSION['BranchID'];
$dbVoucherDetail->cheque_details=$importedLine[10];
$dbVoucherDetail->currency=$importedLine[11];
$dbVoucherDetail->exrate=$importedLine[12];
$dbVoucherDetail->fcdr=$importedLine[13];
$dbVoucherDetail->fccr=$importedLine[14];
$dbVoucherDetail->branch_id=$_SESSION['BranchID'];//$importedLine[47];
$dbVoucherDetail->fiscalyear_id=$_SESSION['FiscalYearID'];//$importedLine[47];
$dbVoucherDetail->created_on=dbDate($importedLine[15]);
$dbVoucherDetail->created_by=$importedLine[16];
$dbVoucherDetail->remarks=$importedLine[19];
$dbVoucherDetail->status=$importedLine[20];
if(!in_array($dbVoucherDetail,$importedVoucherDetails)) $importedVoucherDetails[]=$dbVoucherDetail;
return $importedVoucherDetails;
endif;
return "";
}
?>

View File

@@ -0,0 +1,122 @@
<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; ?> </h5>
</div>
<div class="card-body">
<form method=POST action="" enctype="multipart/form-data" name="tbl_vouchers">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="import_type">Voucher List</label>
<select class="form-control" id="import_type" value="" name="import_type">
<option value="Groups">Groups</option>
<option value="Categories">Categories</option>
<option value="Accounts">Accounts</option>
<option value="Vouchers">Vouchers</option>
<option value="VoucherDetails">Voucher Details</option>
<option value="All">All</option>
</select>
</div>
</div>
<div class="col">
<div class="form-group"> <label for="voucher_list">Voucher List</label>
<input type="file" class="form-control" id="voucher_list" value="" name="voucher_list">
</div>
</div>
<!--COL END-->
</div>
</div>
<button class="btn btn-primary" type="submit" name="submit">Save</button>
</form>
<?php if(isset($importedData)) { ?>
<?php $importedVouchers=array(); ?>
<table class="table table-striped table-responsive dataTable">
<thead>
<?php $h = $importedData[0];
unset($importedData[0]); ?>
<tr>
<?php $i=0; foreach ($h as $c) : ?>
<th><?php echo $c." ($i)"; $i++; ?>
</th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($importedData as $r) : ?>
<?php $importedVouchers=addVouchers($r,$importedVouchers); ?>
<tr>
<?php foreach ($r as $c) : ?>
<td><?php echo $c; ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php
$this->db->query("truncate table tbl_vouchers");
foreach($importedVouchers as $importedVoucher):
$this->db->insert("tbl_vouchers",$importedVoucher);
endforeach;
?>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function addVouchers($importedLine, $importedVouchers)
{
/*
[0] => voucher_id
[1] => voucher_no
[2] => voucher_ref
[3] => voucher_date
[4] => voucher_state
[5] => voucher_type
[6] => fiscalyear_id
[7] => branch_id
[8] => created_by
[9] => created_on
[10] => remarks
[11] => status
*/
$dbVoucher=new stdClass;
$dbVoucher->voucher_id=$importedLine[1];
$dbVoucher->voucher_no=$importedLine[2];
$dbVoucher->voucher_ref=$importedLine[3];
$dbVoucher->voucher_date=dbDate($importedLine[4]);
$dbVoucher->voucher_state=$importedLine[5];
$dbVoucher->voucher_type=$importedLine[6];
$dbVoucher->fiscalyear_id=$_SESSION['FiscalYearID'];
$dbVoucher->branch_id=$_SESSION['BranchID'];
$dbVoucher->created_by=$importedLine[8];
$dbVoucher->created_on=dbDate($importedLine[7]);
$dbVoucher->remarks=$importedLine[11];
$dbVoucher->status=$importedLine[12];
if(!in_array($dbVoucher,$importedVouchers)) $importedVouchers[]=$dbVoucher;
return $importedVouchers;
}
?>

View File

@@ -0,0 +1,199 @@
<?php
$this->load->library("BIBAccounts");
$BIBAccounts = new BIBAccounts();
?>
<?php
$IncomeAccounts = $this->acc->getAccountsByGroup(3);
$ExpenseAccounts = $this->acc->getAccountsByGroup(4);
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
$PL = $IncomesTotal - $ExpensesTotal;
?>
<div class="content-wrapper">
<section class="content">
<div class="container-fluid">
<div class="card card-primary ">
<div class="card-header">
<h4 class="card-title">Report Options</h4>
</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">Starting
Period</label>
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="2078-4-1" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
</div>
</div>
<div class="col-2">
<div class="form-group">
<label for="toDate">Ending
Period</label>
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="2079-3-32" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
</div>
</div>
<div class=" text-center">
<div class="form-group">
<label for="showOB">Opening</label>
<input type="checkbox" class="form-control " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance">
</div>
</div>
<div class=" text-center">
<div class="form-group">
<label for="showClosing">Closing</label>
<input type="checkbox" class="form-control " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance">
</div>
</div>
<div class=" text-center">
<div class="form-group">
<label for="showPeriod">Period</label>
<input type="checkbox" class="form-control " name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance">
</div>
</div>
<div class="col">
<div class="form-group d-flex justify-content-end">
<button class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle
Collapse</button>
<button type="submit" class="btn btn-primary mr-2">Filter</button>
<button class="btn btn-success expand-all mr-2" id="exportButton">Export</button>
<button type="button" class="btn btn-warning" onclick="resetForm()">Reset</button>
</div>
</div>
</div>
<small>Currently Filter Option by period are
not available</small>
</form>
<script>
function resetForm() {
document.getElementById("fromDate").value = "2078-4-1";
document.getElementById("toDate").value = "2079-3-32";
document.getElementById("showOB").checked = false;
document.getElementById("showClosing").checked = false;
document.getElementById("FilterForm").submit();
}
</script>
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title">Incomes and Expenses</h4>
</div>
<div class="card-body table-responsive p-0">
<?php $IncomesExpenses = $BIBAccounts->prepareIncomeExpenses() ?>
<table class="table table-head-fixed table-bordered g-0">
<thead>
<tr>
<th class="" width="35%"><?php myLang("Total Incomes"); ?></th>
<th class="text-right" width="15%"></th>
<th class="text-right" width="15%"><?php myLang("Amount"); ?></th>
<th class="" width="35%"><?php echo myLang("Total Expenses"); ?></th>
<th class="text-right" width="15%"></th>
<th class="text-right" width="15%"><?php myLang("Amount"); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td colspan=3 class="p-0">
<table class="table g-0">
<?php $total = 0;
foreach ($IncomesExpenses['Incomes'] as $Incomes) { ?>
<?php if ($Incomes['account'] == "GROUP TOTAL") : ?>
<tr>
<td class="" width="70%"><b><?php echo $Incomes['group']; ?></b></td>
<td width="15%"></td>
<td class="text-right" width="15%"><u><?php echo myCurrency($Incomes['amount']); ?></u></td>
</tr>
<?php elseif ($Incomes['account'] == "CATEGORY TOTAL") : ?>
<tr>
<td class="" width="70%"><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Incomes['category']; ?></i></td>
<td class="text-right" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td>
<td width="15%"></td>
</tr>
<?php else : ?>
<?php $total += $Incomes['amount']; ?>
<tr>
<td class="" width="70%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Incomes['account']; ?></td>
<td width="15%"></td>
<td class="text-right" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td>
</tr>
<?php endif; ?>
<?php }; ?>
<tr>
<th>Total</th>
<td></td>
<td class="text-right"><?php echo myCurrency($total); ?></td>
</tr>
</table>
</td>
<td colspan=3 class="p-0">
<table class="table g-0">
<?php $total = 0;
foreach ($IncomesExpenses['Expenses'] as $Expenses) {
if ($Expenses['account'] == "GROUP TOTAL") : ?>
<tr>
<td class="" width="70%"><b><?php echo $Expenses['group']; ?></b></td>
<td width="15%"></td>
<td class="text-right" width="15%"><u><?php echo myCurrency($Expenses['amount']); ?></u></td>
</tr>
<?php elseif ($Expenses['account'] == "CATEGORY TOTAL") : ?>
<tr>
<td class="" width="70%"><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Expenses['category']; ?></i></td>
<td class="text-right" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td>
<td width="15%"></td>
</tr>
<?php else : ?>
<?php $total += $Expenses['amount']; ?>
<tr>
<td class="" width="70%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Expenses['account']; ?></td>
<td width="15%"></td>
<td class="text-right" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td>
</tr>
<?php endif; ?>
<?php }; ?>
<tr>
<th>Total</th>
<td></td>
<td class="text-right"><?php echo myCurrency($total); ?></td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div><!-- /.container-fluid -->
</section>

View File

@@ -0,0 +1,127 @@
<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 bg-primary disabled color-palette">
<h3 class='card-title text-center m-0'>Click to view Accounts</h3>
</div>
<div class="card-body">
<div id="tree1"></div>
</div>
</div>
</div> -->
<div class="col">
<div class="card card-primary card-outline">
<div class="card-header bg-primary disabled color-palette">
<h3 class="card-title m-0"><?php echo $pageTitle; ?></h3>
</div>
<div class="card-body">
<div class="row">
<div class="col-12" id="accountsContainer">
<h5 class='text-center'>Accounts Here</h5>
</div>
</div>
<div class="modal fade" id="ledgerdetails_box" tabindex="-1" role="dialog" aria-labelledby="ledgerdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Ledger Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Ledger Details Goes Here
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" data-dismiss="modal">Print</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
$tree = "[\n";
foreach ($AccountGroups as $AccountGroup) :
$tree .= "{text:'" . $AccountGroup->acgroup_name . " <span class=\'node-counts\'>Categories: " . countChildCategories($AccountGroup->acgroup_id) . "</span>',icon: 'fa fa-folder',nodes:[\n";
foreach ($AccountGroup->AccountCategories as $AccountCategory) :
$tree .= "{text:'" . $AccountCategory->accategory_name . " (Accounts: " . countChildAccounts($AccountCategory->accategory_id) . ")',icon: 'fa fa-folder', class:'treecategory_link',id: 'accategory_" . $AccountCategory->accategory_id . "'},\n";
endforeach;
$tree .= "]},";
endforeach;
$tree .= "]";
?>
<script>
$.AccountGroups = <?php echo $tree; ?>;
</script>
<?php function footerFunctions()
{
?>
<script>
$('#tree').bstreeview({
data: $.AccountGroups
});
$(".treecategory_link").click(function(e) {
var id = $(this).attr("id").substr(11);
getAccounts(id);
});
$(".showLedgerTrigger").click(function(e) {
var id = $(this).attr("id").substr(8);
showLedger(id);
});
function getAccounts(id) {
$("#accountsContainer").empty();
$.ajax({
url: "<?php echo site_url("accounts/reports/ajax/accountsbycategory/"); ?>" + id,
success: function(data) {
// console.log(data);
$("#accountsContainer").html(data);
// $("#accountsContainer table").addClass("ajaxDataTable");
// $('.dataTable').DataTable().clear().destroy();
// $(".dataTable").dataTable();
}
});
}
getAccountsAll();
function getAccountsAll() {
$("#accountsContainer").html("");
$.ajax({
url: "<?php echo site_url("accounts/reports/ajax/getallaccounts/"); ?>", //accounts/reports/ajax/getallaccounts/
success: function(data) {
$("#accountsContainer").html(data);
$("#accountsContainer table").addClass("ajaxDataTable");
$('.dataTable').DataTable().clear().destroy();
$(".dataTable").dataTable();
}
});
}
function showLedger(id) {
// $("#accountsContainer").html("");
alert(id);
$.ajax({
url: "<?php echo site_url("accounts/reports/getledgersummary/"); ?>" + id, //accounts/getledgersummary/
success: function(data) {
$("#ledgerdetails_box #details_container").html(data);
$("#ledgerdetails_box").modal("show");
$('.dataTable').DataTable().clear().destroy();
$(".dataTable").dataTable();
}
});
}
</script>
<?php
}
?>

View File

@@ -0,0 +1,66 @@
<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 bg-primary disabled color-palette">
<h3 class="card-title m-0"><?php echo $pageTitle; ?></h3>
</div>
<div class="card-body">
<form method="GET" action="#">
<div class="row">
<div class="col"><?php createNepaliDateInput("from_date", "", "from_date", isset($fromDate_Nepali) ? $fromDate_Nepali : firstDayOfNepaliMonth()); ?></div>
<div class="col"><?php createNepaliDateInput("to_date", "", "to_date", isset($toDate_Nepali) ? $toDate_Nepali : ''); ?></div>
<div class="col"><?php $this->myaccounts->showAccountsCombo("account_id", "", "account_id", "status=1", isset($_GET['account_id']) ? $_GET['account_id'] : '', $CSSclass = ""); ?> </div>
<div class="col"><?php createButton("show_ledger", "Show Ledger", "show_ledger","Submit", "btn btn-primary"); ?></div>
</div>
</form>
</div>
</div>
<div class="card">
<div id="dataTable_Commands">
</div>
<?php if (isset($account_id) && $account_id != "") {
$fromDate = NepaliToEnglishDate(isset($_GET['from_date']) ? $_GET['from_date'] : firstDayOfNepaliMonth());
$toDate = isset($_GET['to_date']) ? $_GET['to_date'] : Today();
$this->myaccounts->showLedger($account_id, $fromDate, $toDate);
} ?>
<div class="modal fade" id="ledgerdetails_box" tabindex="-1" role="dialog" aria-labelledby="ledgerdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Ledger Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Ledger Details Goes Here
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-success" data-dismiss="modal">Print</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,90 @@
<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 bg-primary disabled color-palette">
<h3 class="card-title"><?php echo $pageTitle; ?> </h3>
</div>
<div class="card-body">
<div class="row">
<div class="col">
<div id="dataTable_wrapper">
<?php //$this->myaccounts->getAllAccountsTable(3);
?>
<?php
$accategory_id = 3;
$CI = &get_instance();
$CI->db->where("status", 1)->where("accategory_id = 2");
$CI->db->order_by("account_name ASC");
$Accounts = $CI->db->get("tbl_accounts")->result();
foreach ($Accounts as $Account) {
$Account->Group = $CI->db->query("select * from tbl_acgroups where acgroup_id=(select acgroup_id from tbl_accategories where accategory_id = $Account->accategory_id)")->row();
$Account->Category = $CI->db->query("select * from tbl_accategories where accategory_id = $Account->accategory_id")->row();
}
?>
<div class="row mb-3">
<!-- <div id="dataTable_commands" class="col text-right"></div> -->
</div>
<?php
$html = "";
$html .= "<table class='table table-bordered table-striped longdataTable'>";
$html .= "<thead>";
$html .= "<tr><th class='text-center'>Sn</th><th class='text-center'>Account</th><th class='text-center'>Account Group</th><th class='text-center'>Dr</th><th class='text-center'>Cr</th><th class='text-center'>Action</th></tr>";
$html .= "</thead><tbody>";
$sn = 0;
$BalanceTotal = 0;
foreach ($Accounts as $Account) : $sn++;
$balance = getBalance($Account->account_id);
$BalanceTotal += $balance;
// pre($Account);
$html .= "<tr><td class='col-1 text-center'>" . $sn . "</td><td>" . $Account->account_name . "</td><td class='col-2'>" . $Account->Category->accategory_name . "</td><td class='col-1'>" . (($balance >= 0) ? myCurrency($balance) : "") . "</td><td class='col-1'>" . (($balance < 0) ? myCurrency(abs($balance)) : "") . "</td><td class='col-2 text-center'><a title='Show Ledger' class='btn btn-info btn-xs ' onClick='showLedger(" . $Account->account_id . ")'><i class='fa fa-eye'></i></a></td></tr>";
endforeach;
$html .= "</tbody><tfoot>";
$html .= "<tr><th colspan=3 class='text-right'>Total</th><th class='text-right'>" . myCurrency($BalanceTotal) . "</th><th></th><th></th></tr>";
$html .= "</tfoot></table>\n";
$html .= " <div class=\"modal fade\" id=\"ledgerdetails_box\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"ledgerdetails_box\" aria-hidden=\"true\">
<div class=\"modal-dialog modal-xl\" role=\"document\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h5 class=\"modal-title\" id=\"exampleModalLabel\">Ledger Details</h5>
<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
<span aria-hidden=\"true\">&times;</span>
</button>
</div>
<div class=\"modal-body\" id=\"details_container\">
Ledger Details Goes Here
</div>
<div class=\"modal-footer\">
<button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>
<button type=\"button\" class=\"btn btn-success\" data-dismiss=\"modal\">Print</button>
</div>
</div>
</div>
</div>";
$html .= '<script>function showLedger(id) {$.ajax({url: \'';
$html .= site_url("accounts/reports/ajax/getledgersummary/");
$html .= '\' + id,success: function(data) {$(\'#ledgerdetails_box #details_container\').html(data);$(\'#ledgerdetails_box\').modal(\'show\');}});}</script>';
echo $html;
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php function footerFunctions()
{
?>
<?php
}
?>

View File

@@ -0,0 +1,91 @@
<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 bg-primary disabled color-palette">
<h3 class="card-title"><?php echo $pageTitle; ?> </h3>
</div>
<div class="card-body">
<div class="row">
<div class="col">
<div id="dataTable_wrapper">
<?php //$this->myaccounts->getAllAccountsTable(3);
?>
<?php
$accategory_id = 3;
$CI = &get_instance();
// $CI->db->where("status", 1)->where("(accategory_id = 2 OR accategory_id = 3)");
$CI->db->where("status", 1)->where("accategory_id = 3");
$CI->db->order_by("account_name ASC");
$Accounts = $CI->db->get("tbl_accounts")->result();
foreach ($Accounts as $Account) {
$Account->Group = $CI->db->query("select * from tbl_acgroups where acgroup_id=(select acgroup_id from tbl_accategories where accategory_id = $Account->accategory_id)")->row();
$Account->Category = $CI->db->query("select * from tbl_accategories where accategory_id = $Account->accategory_id")->row();
}
?>
<div class="row mb-3">
<!-- <div id="dataTable_commands" class="col text-right"></div> -->
</div>
<?php
$html = "";
$html .= "<table class='table table-bordered table-striped longdataTable'>";
$html .= "<thead>";
$html .= "<tr><th class='text-center'>Sn</th><th class='text-center'>Account</th><th class='text-center'>Account Group</th><th class='text-center'>Dr</th><th class='text-center'>Cr</th><th class='text-center'>Action</th></tr>";
$html .= "</thead><tbody>";
$sn = 0;
$BalanceTotal = 0;
foreach ($Accounts as $Account) : $sn++;
$balance = getBalance($Account->account_id);
$BalanceTotal += $balance;
// pre($Account);
$html .= "<tr><td class='col-1 text-center'>" . $sn . "</td><td>" . $Account->account_name . "</td><td class='col-2'>" . $Account->Category->accategory_name . "</td><td class='col-1'>" . (($balance >= 0) ? myCurrency($balance) : "") . "</td><td class='col-1'>" . (($balance < 0) ? myCurrency(abs($balance)) : "") . "</td><td class='col-2 text-center'><a title='Show Ledger' class='btn btn-info btn-xs ' onClick='showLedger(" . $Account->account_id . ")'><i class='fa fa-eye'></i></a></td></tr>";
endforeach;
$html .= "</tbody><tfoot>";
$html .= "<tr><th colspan=3 class='text-right'>Total</th><th class='text-right'>" . myCurrency($BalanceTotal) . "</th><th></th><th></th></tr>";
$html .= "</tfoot></table>\n";
$html .= " <div class=\"modal fade\" id=\"ledgerdetails_box\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"ledgerdetails_box\" aria-hidden=\"true\">
<div class=\"modal-dialog modal-xl\" role=\"document\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h5 class=\"modal-title\" id=\"exampleModalLabel\">Ledger Details</h5>
<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
<span aria-hidden=\"true\">&times;</span>
</button>
</div>
<div class=\"modal-body\" id=\"details_container\">
Ledger Details Goes Here
</div>
<div class=\"modal-footer\">
<button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>
<button type=\"button\" class=\"btn btn-success\" data-dismiss=\"modal\">Print</button>
</div>
</div>
</div>
</div>";
$html .= '<script>function showLedger(id) {$.ajax({url: \'';
$html .= site_url("accounts/reports/ajax/getledgersummary/");
$html .= '\' + id,success: function(data) {$(\'#ledgerdetails_box #details_container\').html(data);$(\'#ledgerdetails_box\').modal(\'show\');}});}</script>';
echo $html;
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php function footerFunctions()
{
?>
<?php
}
?>

View File

@@ -0,0 +1,40 @@
<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 bg-primary disabled color-palette">
<h5 class="m-0"><?php echo $pageTitle; ?> </h5>
</div>
<div class="card-body">
<div class="row">
<div class="col">
<div id="dataTable_wrapper">
<?php $this->myaccounts->getAllAccountsTable(30); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php function footerFunctions()
{
?>
<?php
}
?>

View File

@@ -0,0 +1,40 @@
<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 bg-primary disabled color-palette">
<h5 class="m-0"><?php echo $pageTitle; ?></h5>
</div>
<div class="card-body">
<div class="row">
<div class="col">
<div id="dataTable_wrapper">
<?php $this->myaccounts->getAllAccountsTable(4); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php function footerFunctions()
{
?>
<?php
}
?>

View File

@@ -0,0 +1,30 @@
<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 bg-primary disabled color-palette">
<h3 class="card-title"><?php echo $pageTitle; ?> </h3>
</div>
<div class="card-body">
<div class="row">
<div class="col">
<div id="dataTable_wrapper">
<?php $this->myaccounts->getAllAccountsTable(); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php function footerFunctions()
{
?>
<?php
}
?>

View File

@@ -0,0 +1,97 @@
<div class="card card-primary card-outline">
<div class="card-header bg-primary disabled color-palette">
<h5 class="m-0">Viewing Leger for Account : <?php echo $Account->account_name; ?> <a href="" onclick="printDiv('printableDiv');" class="btn btn-success btn-sm float-right">Print</a></h5>
</div>
<div class="card-body" id="printableDiv">
<h3 class="text-center"><?php echo $this->session->userdata("CompanyName"); ?></h3>
<h5 class="text-center">Ledger Details for <?php echo $Account->account_name; ?> (<?php echo $Account->account_code; ?>)</h5>
<?php $TableData = $Transactions; ?>
<table class="table table-bordered table-striped dataTable">
<thead>
<tr>
<th>Sn</th>
<th>Narration</th>
<th>JV#</th>
<th>Dr</th>
<th>Cr</th>
<th>Balance</th>
</tr>
</thead>
<tbody>
<?php $r = 0;
$drTotal = 0;
$crTotal = 0;
$balance = 0;
foreach ($TableData as $TableRow) : $r++; ?>
<tr>
<td><?php echo $r; ?></td>
<td><?php echo $TableRow->narration; ?></td>
<td><?php echo (isset($TableRow->Voucher)) ? linkVoucher($TableRow->Voucher->voucher_id) : "OB"; ?></td>
<td><?php echo myCurrency($TableRow->dr);
$drTotal += $TableRow->dr; ?></td>
<td><?php echo myCurrency($TableRow->cr);
$crTotal += $TableRow->cr; ?></td>
<?php $balance += $TableRow->dr;
$balance -= $TableRow->cr; ?>
<td><?php echo ($balance != 0) ? myCurrency($balance) : showNill(); ?></td>
</tr>
<?php endforeach; ?>
<?php while ($r < 15) : ?>
<tr>
<td>&nbsp;</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<?php $r++;
endwhile; ?>
<tbody>
<tfoot>
<tr>
<td colspan="3" class="text-right">Total</td>
<td><?php echo myCurrency($drTotal); ?></td>
<td><?php echo myCurrency($drTotal); ?></td>
<td><?php echo myCurrency($balance); ?></td>
</tr>
<tr>
<td colspan="6" class="text-right">&nbsp;</td>
</tr>
<tr>
<td colspan="6" class="text-right">&nbsp;</td>
</tr>
<tr>
<td colspan="6" class="text-right">&nbsp;</td>
</tr>
<tr>
<td colspan="6" class="text-center">
<div class="row">
<div class="col-2"><span class="underline-text"><?php echo $this->session->userdata("loggedUser"); ?></span></div>
<div class="col-2 offset-3">______________</div>
<div class="col-2 offset-3">______________</div>
</div>
<div class="row">
<div class="col-2">Entered By</div>
<div class="col-2 offset-3">Checked By</div>
<div class="col-2 offset-3">Approved By</div>
</div>
</td>
</tr>
</tfoot>
</table>
</div>
</div>

View File

@@ -0,0 +1,131 @@
<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; ?> </h5>
</div>
<div class="card-body">
<form method=POST action="" enctype="multipart/form-data" name="tbl_vouchers">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="import_type">Choose Ledger</label>
<?php
$this->myaccounts->showAccountsCombo($fieldName="account_id", $displayName="account_name", $fieldID="account_id", $condition = "", $default = "", $CSSclass = "")
?>
</div>
</div>
<div class="col">
<div class="form-group"> <label for="dr_balance">Opening Balance (Dr)</label>
<input type="text" class="form-control" id="dr_balance" value="" name="dr_balance">
</div>
</div>
<div class="col">
<div class="form-group"> <label for="cr_balance">Opening Balance (Cr)</label>
<input type="text" class="form-control" id="cr_balance" value="" name="cr_balance">
</div>
</div>
<!--COL END-->
</div>
</div>
<button class="btn btn-primary" type="submit" name="submit">Save</button>
</form>
<?php if(isset($importedData)) { ?>
<?php $importedAccounts=array(); ?>
<table class="table table-striped table-responsive dataTable">
<thead>
<?php $h = $importedData[0];
unset($importedData[0]); ?>
<tr>
<?php $i=0; foreach ($h as $c) : ?>
<th><?php echo $c." ($i)"; $i++; ?>
</th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($importedData as $r) : ?>
<?php $importedAccounts=addAccounts($r,$importedAccounts); ?>
<tr>
<?php foreach ($r as $c) : ?>
<td><?php echo $c; ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php
$this->db->query("truncate table tbl_accounts");
foreach($importedAccounts as $importedAccount):
$this->db->insert("tbl_accounts",$importedAccount);
endforeach;
?>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function addAccounts($importedLine, $importedAccounts)
{
/*
[0] => account_id
[1] => accategory_id
[2] => account_code
[3] => account_name
[4] => account_type
[5] => account_plcategory
[6] => account_currency
[7] => account_partyname
[8] => account_partyaddress
[9] => account_partypan
[10] => account_partycontact
[11] => account_partyemail
[12] => account_partycontactperson
[13] => account_partycontactpersoncontact
[14] => created_on
[15] => created_by
[16] => remarks
[17] => status
*/
$dbAccount=new stdClass;
$dbAccount->account_id=$importedLine[1];
$dbAccount->accategory_id=$importedLine[2];
$dbAccount->account_code=$importedLine[3];
$dbAccount->account_name=$importedLine[4];
$dbAccount->account_type=$importedLine[5];
$dbAccount->account_plcategory=$importedLine[6];
$dbAccount->account_currency=$importedLine[7];
$dbAccount->account_partyname=$importedLine[14];
$dbAccount->account_partyaddress=$importedLine[15];
$dbAccount->account_partycontact=$importedLine[16];
$dbAccount->account_partyemail='N/A';
$dbAccount->account_partycontactperson=$importedLine[17];
$dbAccount->account_partycontactpersoncontact='';
$dbAccount->created_on=dbDate($importedLine[9]);
$dbAccount->created_by=$importedLine[8];
$dbAccount->remarks=$importedLine[12];
$dbAccount->status=$importedLine[13];
if(!in_array($dbAccount,$importedAccounts)) $importedAccounts[]=$dbAccount;
return $importedAccounts;
}
?>

View File

@@ -0,0 +1,131 @@
<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; ?> </h5>
</div>
<div class="card-body">
<form method=POST action="" enctype="multipart/form-data" name="tbl_vouchers">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="import_type">Voucher List</label>
<select class="form-control" id="import_type" value="" name="import_type">
<option value="Groups">Groups</option>
<option value="Categories">Categories</option>
<option value="Accounts">Accounts</option>
<option value="Vouchers">Vouchers</option>
<option value="VoucherDetails">Voucher Details</option>
<option value="All">All</option>
</select>
</div>
</div>
<div class="col">
<div class="form-group"> <label for="voucher_list">Voucher List</label>
<input type="file" class="form-control" id="voucher_list" value="" name="voucher_list">
</div>
</div>
<!--COL END-->
</div>
</div>
<button class="btn btn-primary" type="submit" name="submit">Save</button>
</form>
<?php if(isset($importedData)) { ?>
<?php $importedAccounts=array(); ?>
<table class="table table-striped table-responsive dataTable">
<thead>
<?php $h = $importedData[0];
unset($importedData[0]); ?>
<tr>
<?php $i=0; foreach ($h as $c) : ?>
<th><?php echo $c." ($i)"; $i++; ?>
</th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($importedData as $r) : ?>
<?php $importedAccounts=addAccounts($r,$importedAccounts); ?>
<tr>
<?php foreach ($r as $c) : ?>
<td><?php echo $c; ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php
$this->db->query("truncate table tbl_accounts");
foreach($importedAccounts as $importedAccount):
$this->db->insert("tbl_accounts",$importedAccount);
endforeach;
?>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function addAccounts($importedLine, $importedAccounts)
{
/*
[0] => account_id
[1] => accategory_id
[2] => account_code
[3] => account_name
[4] => account_type
[5] => account_plcategory
[6] => account_currency
[7] => account_partyname
[8] => account_partyaddress
[9] => account_partypan
[10] => account_partycontact
[11] => account_partyemail
[12] => account_partycontactperson
[13] => account_partycontactpersoncontact
[14] => created_on
[15] => created_by
[16] => remarks
[17] => status
*/
$dbAccount=new stdClass;
$dbAccount->account_id=$importedLine[1];
$dbAccount->accategory_id=$importedLine[2];
$dbAccount->account_code=$importedLine[3];
$dbAccount->account_name=$importedLine[4];
$dbAccount->account_type=$importedLine[5];
$dbAccount->account_plcategory=$importedLine[6];
$dbAccount->account_currency=$importedLine[7];
$dbAccount->account_partyname=$importedLine[14];
$dbAccount->account_partyaddress=$importedLine[15];
$dbAccount->account_partycontact=$importedLine[16];
$dbAccount->account_partyemail='N/A';
$dbAccount->account_partycontactperson=$importedLine[17];
$dbAccount->account_partycontactpersoncontact='';
$dbAccount->created_on=dbDate($importedLine[9]);
$dbAccount->created_by=$importedLine[8];
$dbAccount->remarks=$importedLine[12];
$dbAccount->status=$importedLine[13];
if(!in_array($dbAccount,$importedAccounts)) $importedAccounts[]=$dbAccount;
return $importedAccounts;
}
?>

View File

@@ -0,0 +1 @@
<embed src="<?php echo $PDFFile; ?>" frameborder="0" width="100%" height="650">

View File

@@ -0,0 +1,126 @@
<?php
$IncomeAccounts = $this->acc->getAccountsByGroup(3);
$ExpenseAccounts = $this->acc->getAccountsByGroup(4);
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
$PL = $IncomesTotal - $ExpensesTotal;
?>
<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; ?> </h5>
</div>
<div class="card-body">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th colspan="4">Profit & Loss Statement</th>
</tr>
</thead>
<tbody>
<tr class="bg-dark">
<th>Incomes</th>
<th>Amount</th>
<th>Expenses</th>
<th>Amount</th>
</tr>
<tr class="bg-light">
<td colspan="2">
<?php showTable($IncomeAccounts); ?>
</td>
<td colspan="2">
<?php showTable($ExpenseAccounts); ?>
</td>
</tr>
</tbody>
<tfoot>
<?php if($PL<0): ?>
<tr class="bg-light">
<th>Net Loss:</th>
<th><?php echo myCurrency($PL); ?></th>
<th></th>
<th></th>
</tr>
<?php else: ?>
<tr class="bg-light">
<th></th>
<th></th>
<th>Net Profit:</th>
<th><?php echo myCurrency($PL); ?></th>
</tr>
<?php endif; ?>
<?php if($PL<0): ?>
<tr class="bg-light">
<th>Total Loss:</th>
<th><?php echo myCurrency($PL + $IncomesTotal); ?></th>
<th>Total: </th>
<th><?php echo myCurrency($IncomesTotal); ?></th>
</tr>
<?php else: ?>
<tr class="bg-light">
<th>Total:</th>
<th><?php echo myCurrency($IncomesTotal); ?></th>
<th>Total:</th>
<th><?php echo myCurrency($PL + $ExpensesTotal); ?></th>
</tr>
<?php endif; ?>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function showTable($Accounts)
{
$total = 0;
?>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Account</th>
<th>Balance</th>
</tr>
</thead>
<tbody>
<?php foreach ($Accounts as $Account) : $total += abs($Account->balance) ?>
<tr>
<td><?php echo $Account->account_name; ?></td>
<td><?php echo myCurrency(abs($Account->balance)); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<!-- <tfoot>
<tr>
<th>Total</th>
<th><?php echo myCurrency($total); ?></th>
</tr>
</tfoot> -->
</table>
<?php
}

View File

@@ -0,0 +1,254 @@
<?php
$this->load->library("NewAcc");
$Acc = new NewAcc();
$CI = &get_instance();
$txt = "SELECT
g.acgroup_id AS group_id,
g.acgroup_name AS group_name,
cp.accategory_id AS parent_id,
cp.acgroup_id AS group_id,
cp.accategory_name AS parent_category_name,
cc.accategory_id AS child_id,
cc.accategory_name AS child_category_name,
ccc.accategory_id AS child_child_id,
ccc.accategory_name AS child_child_category_name,
a.account_id,
a.account_name
FROM tbl_acgroups g
LEFT JOIN tbl_accategories cp ON g.acgroup_id = cp.acgroup_id AND cp.parent_category_id = 0
LEFT JOIN tbl_accategories cc ON cp.accategory_id = cc.parent_category_id
LEFT JOIN tbl_accategories ccc ON cc.accategory_id = ccc.parent_category_id
LEFT JOIN tbl_accounts a ON ccc.accategory_id = a.accategory_id
ORDER BY g.display_order, cp.accategory_id, cc.accategory_id, ccc.accategory_id;
";
$AccountTree = $CI->db->query($txt)->result();
function displayAccountTree($accountTree, $parentCategory = 0)
{
echo '<ul>';
foreach ($accountTree as $row) {
if ($row->parent_id == $parentCategory) {
echo '<li>';
echo 'Category Name: ' . $row->parent_category_name;
echo ' | Account Name: ' . $row->account_name;
displayAccountTree($accountTree, $row->child_id);
echo '</li>';
}
}
echo '</ul>';
}
$IncomeCategories = $Acc->getAccountCategories(3);
$IncomeAccounts = $this->acc->getAccountsByGroup(3);
$ExpenseAccounts = $this->acc->getAccountsByGroup(4);
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
$PL = $IncomesTotal - $ExpensesTotal;
?>
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0"><?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="<?php echo base_url(); ?>">Dashboard </a></li>
<li class="breadcrumb-item active"><?php echo $pageTitle; ?></li>
</ol>
</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="m-0"><?php echo $pageTitle; ?> </h5>
</div>
<div class="card-body">
<?php displayAccountTree($AccountTree); ?>
<?php pre($AccountTree); ?>
</div>
<div class="card-body">
<div class="col-6">
<div id="accordion">
<?php displayCategories($IncomeCategories); ?>
</div>
<?php
function displayCategories($categories, $level = 0)
{
$CI = &get_instance();
$CI->load->library("NewAcc");
$Acc = new NewAcc();
echo '<div id="accordion_' . $level . '">';
foreach ($categories as $category) {
?>
<div class="card">
<div class="card-header" id="heading<?php echo $category->accategory_id; ?>_<?php echo $level; ?>">
<h5 class="mb-0">
<?php
// Add column offset for child categories
if ($level > 0) {
echo '<div class="offset-1">';
}
?>
<div class="row" data-toggle="collapse" data-target="#collapse<?php echo $category->accategory_id; ?>_<?php echo $level; ?>" aria-expanded="true" aria-controls="collapse<?php echo $category->accategory_id; ?>_<?php echo $level; ?>">
<div class="col-6"><?php echo $category->accategory_name; ?></div>
<div class="col-3"><?php echo myCurrency($category->dr); ?></div>
<div class="col-3"><?php echo myCurrency($category->cr); ?></div>
</div>
<?php
if ($level > 0) {
echo '</div>';
}
?>
</h5>
</div>
<div id="collapse<?php echo $category->accategory_id; ?>_<?php echo $level; ?>" class="collapse show" aria-labelledby="heading<?php echo $category->accategory_id; ?>_<?php echo $level; ?>" data-parent="#accordion_<?php echo $level; ?>">
<div class="card-body">
<?php
$category->children = $Acc->getChildCategories($category->accategory_id);
if (!empty($category->children)) {
// Increase the level for child categories
$childLevel = $level + 1;
displayCategories($category->children, $childLevel);
}
?>
</div>
</div>
</div>
<?php
}
echo '</div>';
}
?>
</div>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th colspan="4">Profit & Loss Statement</th>
</tr>
</thead>
<tbody>
<tr class="bg-dark">
<th>Incomes</th>
<th>Amount</th>
<th>Expenses</th>
<th>Amount</th>
</tr>
<tr class="bg-light">
<td colspan="2">
<?php showTable($IncomeAccounts); ?>
</td>
<td colspan="2">
<?php showTable($ExpenseAccounts); ?>
</td>
</tr>
</tbody>
<tfoot>
<?php if ($PL < 0) : ?>
<tr class="bg-light">
<th>Net Loss:</th>
<th><?php echo myCurrency($PL); ?></th>
<th></th>
<th></th>
</tr>
<?php else : ?>
<tr class="bg-light">
<th></th>
<th></th>
<th>Net Profit:</th>
<th><?php echo myCurrency($PL); ?></th>
</tr>
<?php endif; ?>
<?php if ($PL < 0) : ?>
<tr class="bg-light">
<th>Total Loss:</th>
<th><?php echo myCurrency($PL + $IncomesTotal); ?></th>
<th>Total: </th>
<th><?php echo myCurrency($IncomesTotal); ?></th>
</tr>
<?php else : ?>
<tr class="bg-light">
<th>Total:</th>
<th><?php echo myCurrency($IncomesTotal); ?></th>
<th>Total:</th>
<th><?php echo myCurrency($PL + $ExpensesTotal); ?></th>
</tr>
<?php endif; ?>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function showTable($Accounts)
{
$total = 0;
?>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Account</th>
<th>Balance</th>
</tr>
</thead>
<tbody>
<?php foreach ($Accounts as $Account) : $total += abs($Account->balance) ?>
<tr>
<td><?php echo $Account->account_name; ?></td>
<td><?php echo myCurrency(abs($Account->balance)); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<!-- <tfoot>
<tr>
<th>Total</th>
<th><?php echo myCurrency($total); ?></th>
</tr>
</tfoot> -->
</table>
<?php
}

View File

@@ -0,0 +1,422 @@
<?php
$this->load->library("BIBAccounts");
$BIBAccounts = new BIBAccounts();
?>
<!-- Include jQuery -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<!-- Include jQuery UI -->
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<style>
table,
td,
tr {
padding: 0px;
margin: 0px;
}
.group-name {
width: 40%;
}
.group-total {
width: 10%;
}
.table-gray {
background-color: #eee;
}
.table td,
.table th {
padding: 0px;
margin: 0px;
}
.bg-darker {
background-color: #ddd;
}
td .table {
border: 0px !important;
margin-bottom: 0rem;
}
table td:first-child {
padding-left: 5px;
}
.table-bordered.vertical-borders td,
.table-bordered.vertical-borders th {
border-left: 1px solid #dee2e6;
border-right: 1px solid #dee2e6;
}
.table-bordered.vertical-borders thead th {
padding: 0.25rem;
border-top: none;
border-bottom: 2px solid #dee2e6;
}
.table-bordered.vertical-borders tfoot th {
padding: 0.25rem;
border-top: 2px solid #dee2e6;
border-bottom: none;
}
.currency{
font-weight: normal !important;
}
.underline{
text-decoration: underline;
}
.form-control {
display: block;
width: 100%;
height: calc(1.5rem + 1px);
padding: 0.375rem 0.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: 0.25rem;
box-shadow: inset 0 0 0 transparent;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
</style>
<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>
<!-- /.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 class="content">
<div class="container-fluid">
<div class="row">
<div class="col">
<button class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle Collapse</button>
<div class="card card-primary card-outline ">
<div class="card-body p-0">
<?php
// echo $_POST['showClosing'];
$ReportOptions = array(
'showZeroBalances' => false,
'showOB' => false,
'showClosing' => true,
'showPeriod' => false,
);
// die;
?>
<table class="table table-bordered">
<thead>
<tr>
<th class="group-name" width="85%">Particulars</th>
<th class="group-total text-center" width="10%" >Amount</th>
<th class="group-name" width="85%">Particulars</th>
<th class="group-total text-center" width="15%">Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2" class="p-0">
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(3); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<?php
// Initialize variables for column totals
$incomes_totalOpeningDr = 0;
$incomes_totalOpeningCr = 0;
$incomes_totalThisYearDr = 0;
$incomes_totalThisYearCr = 0;
$incomes_totalClosingDr = 0;
$incomes_totalClosingCr = 0;
?>
<?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
<td class="group-name"><b><?php //echo $group->acgroup_name; ?></b></td>
<td class="group-total text-right"><?php //echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0); ?></td>
</tr>
<tr>
<td colspan="7" class="group-details p-0" width="85%">
<div id="group_<?php echo $group->acgroup_id; ?>" class="collapse">
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
</div>
</td>
</tr>
<?php
// Update column totals
$incomes_totalOpeningDr += ($group->posting_side == "DR") ? $group->opening_balance : 0;
$incomes_totalOpeningCr += ($group->posting_side == "CR") ? $group->opening_balance : 0;
$incomes_totalThisYearDr += ($group->posting_side == "DR") ? $group->regular_balance : 0;
$incomes_totalThisYearCr += ($group->posting_side == "CR") ? $group->regular_balance : 0;
$incomes_totalClosingDr += ($group->posting_side == "DR") ? $group->closing_balance : 0;
$incomes_totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
?>
<?php endforeach; ?>
</table>
</td>
<td colspan="2" class="p-0">
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(4); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<?php
// Initialize variables for column totals
$totalOpeningDr = 0;
$totalOpeningCr = 0;
$totalThisYearDr = 0;
$totalThisYearCr = 0;
$totalClosingDr = 0;
$totalClosingCr = 0;
?>
<?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
<td class="group-name" width="85%"> <?php //echo $group->acgroup_name; ?></td>
<td class="group-total" width="15%"><?php //echo myCurrency(($group->posting_side == "DR") ? $group->closing_balance : 0); ?></td>
</tr>
<tr>
<td colspan="7" class="group-details p-0">
<div id="group_<?php echo $group->acgroup_id; ?>" class="collapse">
<i> <?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
</i>
</div>
</td>
</tr>
<?php
// Update column totals
$totalOpeningDr += ($group->posting_side == "DR") ? $group->opening_balance : 0;
$totalOpeningCr += ($group->posting_side == "CR") ? $group->opening_balance : 0;
$totalThisYearDr += ($group->posting_side == "DR") ? $group->regular_balance : 0;
$totalThisYearCr += ($group->posting_side == "CR") ? $group->regular_balance : 0;
$totalClosingDr += ($group->posting_side == "DR") ? $group->closing_balance : 0;
$totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
?>
<?php endforeach; ?>
</table>
</td>
</tr>
<?php $PL = $incomes_totalClosingCr - $totalClosingDr; ?>
<?php if ($incomes_totalClosingCr > $totalClosingDr) : ?>
<tr>
<td colspan="2" width="15%">
</td>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th>Total Profit</th>
<th class="cr closing-cr text-right"><?php echo myCurrency($PL); ?></th>
</tr>
</table>
</td>
</tr>
<?php else : ?>
<tr>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th>Total Loss</th>
<th class="cr closing-cr"><?php echo myCurrency(abs($PL)); ?></th>
</tr>
</table>
</td>
<td colspan="2">
</td>
</tr>
<?php endif; ?>
<tr>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th>Total Incomes</th>
<th class="cr closing-cr">
<?php if ($PL > 0) : ?>
<?php echo myCurrency($incomes_totalClosingCr); ?>
<?php else : ?>
<?php echo myCurrency($incomes_totalClosingCr + abs($PL)); ?>
<?php endif; ?>
</th>
</tr>
</table>
</td>
<td colspan="2" class="p-0">
<table class="table table-bordered">
<tr>
<th>Total Expenses</th>
<th class="dr closing-dr">
<?php if ($PL > 0) : ?>
<?php echo myCurrency($totalClosingDr + abs($PL)); ?>
<?php else : ?>
<?php echo myCurrency($totalClosingDr); ?>
<?php endif; ?>
</th>
</tr>
</table>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
document.addEventListener("DOMContentLoaded", function() {
// Trigger click event on page load
document.getElementById("toggleShowAll").click();
});
document.getElementById("toggleShowAll").addEventListener("click", function(e) {
e.preventDefault();
var nestedRows = document.getElementsByClassName("collapse");
for (var i = 0; i < nestedRows.length; i++) {
if (nestedRows[i].classList.contains("show")) {
nestedRows[i].classList.remove("show");
} else {
nestedRows[i].classList.add("show");
}
}
});
var exportButton = document.getElementById("exportButton");
exportButton.addEventListener("click", function() {
exportTableToCSV("table.csv");
});
function exportTableToCSV(filename) {
var csv = [];
var rows = document.querySelectorAll("table tr:not(.hide)");
for (var i = 0; i < rows.length; i++) {
var row = [];
var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)");
// Check if the parent row is collapsed or hidden
var parentRow = rows[i].closest(".collapse");
var isParentCollapsed = parentRow && (!parentRow.classList.contains("show"));
if (isParentCollapsed) {
continue; // Skip child table rows if parent is collapsed
}
for (var j = 0; j < cols.length; j++) {
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value
row.push(cellValue);
}
csv.push(row.join(","));
}
// Create a CSV file
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n");
var encodedUri = encodeURI(csvContent);
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", filename);
document.body.appendChild(link);
link.click();
}
</script>
<?php
}

View File

@@ -0,0 +1,29 @@
<?php
$IncomeAccounts = $this->acc->getAccountsByGroup(3);
$ExpenseAccounts = $this->acc->getAccountsByGroup(4);
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
$PL = $IncomesTotal - $ExpensesTotal;
?>
<div class="content-wrapper">
<section class="content">
<div class="container">
<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">
Purchase list (To Do)
</div>
</div>
</div>
</div>
</div>
</div><!-- /.container-fluid -->
</section>

View File

@@ -0,0 +1,218 @@
<?php
$IncomeAccounts = $this->acc->getAccountsByGroup(3);
$ExpenseAccounts = $this->acc->getAccountsByGroup(4);
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
$PL = $IncomesTotal - $ExpensesTotal;
?>
<div class="content-wrapper">
<section class="content">
<div class="container-fluid">
<div id="accordion">
<div class="card card-primary">
<div class="card-header">
<h4 class="card-title w-100">
<a class="d-block w-100" data-toggle="collapse" href="#collapseOne" aria-expanded="false">
Profitability ratios
</a>
</h4>
</div>
<div id="collapseOne" class="collapse show" data-parent="#accordion" style="">
<div class="card-body p-0">
<table class="table table-bordered">
<tbody>
<tr>
<td>Gross profit margin </td>
<td>Gross profit margin = Gross profit / Revenue </td>
<td>This ratio measures how much of the revenue is left after deducting the cost of goods sold, such as salaries, materials, and utilities. A higher gross profit margin indicates higher profitability and a lower cost structure </td>
</tr>
<tr>
<td>Operating profit margin </td>
<td>Operating profit margin = Operating profit / Revenue /td&gt;
<td>This ratio measures how much of the revenue is left after deducting all the operating expenses, such as administration, depreciation, and interest. A higher operating profit margin indicates higher profitability and a lower operating cost structure. </td>
</td>
</tr>
<tr>
<td>Net profit margin</td>
<td>Net profit margin = Net profit / Revenue</td>
<td>This ratio measures how much of the revenue is left after deducting all the expenses, including taxes. A higher net profit margin indicates higher profitability and a lower overall cost structure. </td>
</tr>
<tr>
<td>Return on assets</td>
<td>Return on assets = Average total assets</td>
<td>This ratio measures how much profit a school earns for each unit of assets. A higher return on assets indicates higher profitability and higher asset efficiency. </td>
</tr>
<tr>
<td>Return on equity</td>
<td>Return on equity = Net profit / Average total equity</td>
<td>This ratio measures how much profit a school earns for each unit of equity. A higher return on equity indicates higher profitability and higher equity efficiency. </td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="card card-primary">
<div class="card-header">
<h4 class="card-title w-100">
<a class="d-block w-100" data-toggle="collapse" href="#collapseTwo" aria-expanded="false">
Liquidity ratios
</a>
</h4>
</div>
<div id="collapseTwo" class="collapse " data-parent="#accordion" style="">
<div class="card-body p-0">
<table class="table table-bordered">
<tbody>
<tr>
<td>Current Ratio</td>
<td>
<?php
$TCA = $this->myaccounts->getAccountBalanceByAccountCategory(1);
$TCL = abs($this->myaccounts->getAccountBalanceByAccountCategory(10));
$CASH = $this->myaccounts->getAccountBalanceByAccountCategory(10);
$current_ratio = $TCA / $TCL;
?>
<!-- Total Current Assets: <?php echo $TCA; ?><br/>
Total Current Liabilities: <?php echo $TCL;?><br/> -->
Current ratio = <?php echo $current_ratio; ?></td>
<td>This ratio compares the current assets (such as cash, receivables, and inventories) to the current liabilities (such as payables, accrued expenses, and short-term debt). A higher current ratio indicates a better liquidity position.</td>
</tr>
<tr>
<td>Quick Ratio</td>
<!-- <td>Quick ratio = Current assets - Inventories / Current liabilities</td> -->
<td>Quick ratio = Current assets - Inventories / Current liabilities</td>
<td>This ratio is similar to the current ratio, but it excludes inventories, which are less liquid than other current assets. A higher quick ratio indicates a stronger liquidity position.</td>
</tr>
<tr>
<td>Cash Ratio</td>
<td>Cash ratio = Cash and cash equivalents / Current liabilities</td>
<td>This ratio is the most conservative measure of liquidity, as it only considers the most liquid current asset, which is cash and cash equivalents. A higher cash ratio indicates a more liquid position. </td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="card card-primary">
<div class="card-header">
<h4 class="card-title w-100">
<a class="d-block w-100 collapsed" data-toggle="collapse" href="#collapsethree" aria-expanded="false">
Solvency ratios
</a>
</h4>
</div>
<div id="collapsethree" class="collapse" data-parent="#accordion" style="">
<div class="card-body p-0">
<table class="table table-bordered">
<tbody>
<tr>
<td>Debt-to-assets ratio </td>
<td>Debt-to-assets ratio = Total debt / Total assets </td>
<td>This ratio compares the total debt (both short-term and long-term) to the total assets (both current and non-current). A lower debt-to-assets ratio indicates lower leverage and a higher solvency. </td>
</tr>
<tr>
<td>Debt-to-equity ratio </td>
<td>Debt-to-equity&nbsp;ratio = Total&nbsp;debt / Total&nbsp;equity </td>
<td>This ratio compares the total debt to the total equity (the difference between assets and liabilities). A lower debt-to-equity ratio indicates a lower leverage and a higher solvency. </td>
</tr>
<tr>
<td>Debt service coverage ratio </td>
<td>Income&nbsp;before&nbsp;interest&nbsp;and&nbsp;taxes / Debt&nbsp;service </td>
<td>This ratio measures the ability of a school to generate enough income to cover its debt payments, such as interest and principal. A higher debt service coverage ratio indicates a higher solvency and a lower risk of default. </td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="card card-primary">
<div class="card-header">
<h4 class="card-title w-100">
<a class="d-block w-100 collapsed" data-toggle="collapse" href="#collapseFour" aria-expanded="false">
Efficiency ratios
</a>
</h4>
</div>
<div id="collapseFour" class="collapse" data-parent="#accordion" style="">
<div class="card-body p-0">
<table class="table table-bordered">
<tbody>
<tr>
<td>Asset turnover ratio </td>
<td>Asset turnover ratio = Revenue / Average total assets </td>
<td>This ratio measures how much revenue a school generates for each unit of assets. A higher asset turnover ratio indicates higher efficiency and productivity. </td>
</tr>
<tr>
<td>Receivables turnover ratio </td>
<td>Receivables&nbsp;turnover&nbsp;ratio = Revenue / Average&nbsp;receivables</td>
<td>
This ratio measures how quickly a school collects its receivables, such as tuition fees, grants, and donations. A higher receivables turnover ratio indicates a faster collection and a lower risk of bad debts.
</td>
</tr>
<tr>
<td>Inventory turnover ratio </td>
<td>Inventory&nbsp;turnover&nbsp;ratio = Cost&nbsp;of&nbsp;goods&nbsp;sold / Average&nbsp;inventory </td>
<td>This ratio measures how quickly a school sells its inventories, such as books, supplies, and equipment. A higher inventory turnover ratio indicates a faster turnover and a lower risk of obsolescence. </td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="card card-primary">
<div class="card-header">
<h4 class="card-title w-100">
<a class="d-block w-100" data-toggle="collapse" href="#collapseFive">
Growth ratios
</a>
</h4>
</div>
<div id="collapseFive" class="collapse" data-parent="#accordion">
<div class="card-body p-0">
<table class="table table-bordered">
<tbody>
<tr>
<td>Revenue growth rate </td>
<td>Debt-to-assets ratio = Total debt / Total assets </td>
<td>Revenue growth rate = Revenue in current period - Revenue in previous period / Revenue in previous period </td>
</tr>
<tr>
<td>Profit growth rate</td>
<td>This ratio measures the percentage change in profit from one period to another. </td>
<td>This ratio measures the percentage change in profit from one period to another. A higher profit growth rate indicates a higher growth potential and higher profitability. </td>
</tr>
<tr>
<td>Asset growth rate</td>
<td>Asset growth rate = Assets in current period - Assets in previous period / Assets in previous period/td&gt;
<td>This ratio measures the percentage change in assets from one period to another. A higher asset growth rate indicates a higher growth potential and a higher asset efficiency</td>
</td>
</tr>
<tr>
<td>Equity growth rate: </td>
<td>Equity growth rate = Equity in current period - Equity in previous period / Equity in previous period</td>
<td>This ratio measures the percentage change in equity from one period to another. A higher equity growth rate indicates a higher growth potential and higher equity efficiency. </td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div><!-- /.container-fluid -->
</section>

View File

@@ -0,0 +1,292 @@
<?php
$this->load->library("BIBAccounts");
$BIBAccounts = new BIBAccounts();
?>
<?php
$IncomeAccounts = $this->acc->getAccountsByGroup(3);
$ExpenseAccounts = $this->acc->getAccountsByGroup(4);
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
$PL = $IncomesTotal - $ExpensesTotal;
?>
<style>
table,
td,
tr {
padding: 0px;
margin: 0px;
}
.group-name {
width: 40%;
}
.group-total {
width: 10%;
}
.table-gray {
background-color: #eee;
}
.table td,
.table th {
padding: 0px;
margin: 0px;
}
.bg-darker {
background-color: #ddd;
}
td .table {
border: 0px !important;
margin-bottom: 0rem;
}
table td:first-child {
padding-left: 5px;
}
.table-bordered.vertical-borders td,
.table-bordered.vertical-borders th {
border-left: 1px solid #dee2e6;
border-right: 1px solid #dee2e6;
}
.table-bordered.vertical-borders thead th {
padding: 0.25rem;
border-top: none;
border-bottom: 2px solid #dee2e6;
}
.table-bordered.vertical-borders tfoot th {
padding: 0.25rem;
border-top: 2px solid #dee2e6;
border-bottom: none;
}
.currency{
font-weight: normal !important;
}
.underline{
text-decoration: underline;
}
.form-control {
display: block;
width: 100%;
height: calc(1.5rem + 1px);
padding: 0.375rem 0.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: 0.25rem;
box-shadow: inset 0 0 0 transparent;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
</style>
<div class="content-wrapper">
<section class="content">
<div class="container-fluid">
<div class="card card-primary ">
<div class="card-header">
<h3 class="card-title">Receipts And Payments <?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 class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle Collapse</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 = "2078-4-1";
document.getElementById("toDate").value = "2079-3-32";
document.getElementById("showOB").checked = false;
document.getElementById("showClosing").checked = false;
document.getElementById("FilterForm").submit();
}
</script>
</div>
</div>
<div class="card">
<div class="card-body table-responsive p-0">
<?php $IncomesExpenses = $BIBAccounts->prepareIncomeExpenses() ?>
<table class="table table-head-fixed table-bordered g-0">
<thead>
<tr>
<th class="" width="35%"><?php myLang("Receipts"); ?></th>
<th class="text-right" width="15%"></th>
<th class="text-right" width="15%"><?php myLang("Amount"); ?></th>
<th class="" width="35%"><?php echo myLang("Payments"); ?></th>
<th class="text-right" width="15%"></th>
<th class="text-right" width="15%"><?php myLang("Amount"); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td colspan=3 class="p-0">
<table class="table g-0">
<?php $total1 = 0;
foreach ($IncomesExpenses['Incomes'] as $Incomes) { ?>
<?php if ($Incomes['account'] == "GROUP TOTAL") : ?>
<!--tr>
<td class="" width="70%"><b><?php echo $Incomes['group']; ?></b></td>
<td width="15%"></td>
<td class="text-right" width="15%"><u><?php echo myCurrency($Incomes['amount']); ?></u></td>
</tr-->
<?php elseif ($Incomes['account'] == "CATEGORY TOTAL") : ?>
<tr>
<td class="" width="70%"><b><?php echo $Incomes['category']; ?></b></td>
<td class="text-right" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td>
<td width="15%"></td>
</tr>
<?php else : ?>
<?php $total1 += $Incomes['amount']; ?>
<tr>
<td class="" width="70%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Incomes['account']; ?></td>
<td width="15%"></td>
<td class="text-right" width="15%"><?php echo myCurrency($Incomes['amount']); ?></td>
</tr>
<?php endif; ?>
<?php }; ?>
</table>
</td>
<td colspan=3 class="p-0">
<table class="table g-0">
<?php $total = 0;
foreach ($IncomesExpenses['Expenses'] as $Expenses) {
if ($Expenses['account'] == "GROUP TOTAL") : ?>
<!--tr>
<td class="" width="70%"><b><?php echo $Expenses['group']; ?></b></td>
<td width="15%"></td>
<td class="text-right" width="15%"><u><?php echo myCurrency($Expenses['amount']); ?></u></td>
</tr-->
<?php elseif ($Expenses['account'] == "CATEGORY TOTAL") : ?>
<tr>
<td class="" width="70%"><b><?php echo $Expenses['category']; ?></b></td>
<td class="text-right" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td>
<td width="15%"></td>
</tr>
<?php else : ?>
<?php $total += $Expenses['amount']; ?>
<tr>
<td class="" width="70%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $Expenses['account']; ?></td>
<td width="15%"></td>
<td class="text-right" width="15%"><?php echo myCurrency($Expenses['amount']); ?></td>
</tr>
<?php endif; ?>
<?php }; ?>
</table>
</td>
</tr>
<?php $balance_fi = $total1 - $total; ?>
<?php if ($balance_fi < 0) : $total1 +=$balance_fi; ?>
<tr>
<th><?php echo myLang("Closing Balance"); ?></th>
<th></th>
<td><span class="text-red"><?php echo myCurrency($balance_fi); ?></span></td>
<th></th>
<th></th>
<td></td>
</tr>
<?php elseif ($balance_fi > 0) : $total +=$balance_fi; ?>
<tr>
<th></th>
<th></th>
<td></td>
<th><?php echo myLang("Closing Balance"); ?></th>
<th></th>
<td><?php echo myCurrency($balance_fi); ?></td>
</tr>
<?php endif; ?>
<tr>
<th>Total</th>
<th></th>
<td><?php echo myCurrency($total1); ?></td>
<th>Total</th>
<th></th>
<td><?php echo myCurrency($total); ?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div><!-- /.container-fluid -->
</section>

View File

@@ -0,0 +1,160 @@
<?php
$this->load->library("BIBAccounts");
$BIBAccounts = new BIBAccounts();
?>
<?php
$IncomeAccounts = $this->acc->getAccountsByGroup(3);
$ExpenseAccounts = $this->acc->getAccountsByGroup(4);
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
$PL = $IncomesTotal - $ExpensesTotal;
?>
<div class="content-wrapper">
<section class="content">
<div class="container-fluid">
<div class="card card-primary ">
<div class="card-header">
<h4 class="card-title">Report Options</h4>
</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">Starting
Period</label>
<input type="text" class="form-control nepaliDatePicker" name="fromDate" value="2078-4-1" id="fromDate" aria-describedby="helpId_fromDate" placeholder="Starting Period">
</div>
</div>
<div class="col-2">
<div class="form-group">
<label for="toDate">Ending
Period</label>
<input type="text" class="form-control nepaliDatePicker" name="toDate" value="2079-3-32" id="toDate" aria-describedby="helpId_toDate" placeholder="Ending Period">
</div>
</div>
<div class=" text-center">
<div class="form-group">
<label for="showOB">Opening</label>
<input type="checkbox" class="form-control " name="showOB" id="showOB" aria-describedby="helpId_showOB" placeholder="Show Opening Balance">
</div>
</div>
<div class=" text-center">
<div class="form-group">
<label for="showClosing">Closing</label>
<input type="checkbox" class="form-control " name="showClosing" id="showClosing" aria-describedby="helpId_showClosing" placeholder="Show Closing Balance">
</div>
</div>
<div class=" text-center">
<div class="form-group">
<label for="showPeriod">Period</label>
<input type="checkbox" class="form-control " name="showPeriod" id="showPeriod" aria-describedby="helpId_showPeriod" placeholder="Show Periodic Balance">
</div>
</div>
<div class="col">
<div class="form-group d-flex justify-content-end">
<button class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle
Collapse</button>
<button type="submit" class="btn btn-primary mr-2">Filter</button>
<button class="btn btn-success expand-all mr-2" id="exportButton">Export</button>
<button type="button" class="btn btn-warning" onclick="resetForm()">Reset</button>
</div>
</div>
</div>
<small>Currently Filter Option by period are
not available</small>
</form>
<script>
function resetForm() {
document.getElementById("fromDate").value = "2078-4-1";
document.getElementById("toDate").value = "2079-3-32";
document.getElementById("showOB").checked = false;
document.getElementById("showClosing").checked = false;
document.getElementById("FilterForm").submit();
}
</script>
</div>
</div>
<div class="card">
<div class="card-header">
<h4 class="card-title">Incomes and Expenses</h4>
</div>
<div class="card-body table-responsive p-0">
<?php $IncomesExpenses = $BIBAccounts->getIncomeAndExpenditure();
?>
<table class="table table-head-fixed table-bordered g-0">
<thead>
<tr>
<th class="" width="40%">Incomes</th>
<th class="text-right" width="10%">Amount</th>
<th class="" width="40%">Expenses</th>
<th class="text-right" width="10%">Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan=2 class="p-0">
<table class="table g-0">
<?php $total = 0;
foreach ($IncomesExpenses['Incomes'] as $Incomes) {
$total += $Incomes['amount']; ?>
<tr>
<td class="" width="80%"><?php echo $Incomes['account']; ?></td>
<td class="text-right" width="20%"><?php echo myCurrency($Incomes['amount']); ?></td>
</tr>
<?php }; ?>
<tr>
<th>Total</th>
<td class="text-right"><?php echo myCurrency($total); ?></td>
</tr>
</table>
</td>
<td colspan=2 class="p-0">
<table class="table g-0">
<?php $total = 0;
foreach ($IncomesExpenses['Expenses'] as $Expenses) {
$total += $Expenses['amount']; ?>
<tr>
<td class="" width="80%"><?php echo $Expenses['account']; ?></td>
<td class="text-right" width="20%"><?php echo $Expenses['amount']; ?></td>
</tr>
<?php }; ?>
<tr>
<th>Total</th>
<td class="text-right"><?php echo myCurrency($total); ?></td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<?php pre($IncomesExpenses); ?>
</div>
</div>
</div><!-- /.container-fluid -->
</section>

View File

@@ -0,0 +1,22 @@
<?php
$IncomeAccounts = $this->acc->getAccountsByGroup(3);
$ExpenseAccounts = $this->acc->getAccountsByGroup(4);
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
$PL = $IncomesTotal - $ExpensesTotal;
?>
<div class="content-wrapper">
<section class="content">
<div class="container-fluid">
</div><!-- /.container-fluid -->
</section>

View File

@@ -0,0 +1,81 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0"><?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="<?php echo base_url(); ?>">Dashboard</a></li>
<li class="breadcrumb-item active"><?php echo $pageTitle; ?></li>
</ol>
</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="m-0">Create <?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="" enctype="multipart/form-data" name="tbl_vouchertypes">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="voucher_name">Voucher Name</label><input type="text" class="form-control" id="voucher_name" value="" name="voucher_name">
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<?php fillComboWithValue("default_account", "Default Account", "default_account", "tbl_accounts", "account_name", "account_id", $default = "", $CSSclass = "", $multiple = false, $condition = ""); ?>
</div>
</div>
<!--COL END-->
<!--COL START-->
<div class="col">
<div class="form-group">
<?php createSelect("default_accountside", "Default Account Side", array(["Dr", "Debet"], ["Cr", "Credit"]), "default_accountside", "", ""); ?>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="voucher_options">Voucher Options</label>
<textarea class="form-control" id="voucher_options" name="voucher_options"></textarea>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks">Remarks</label>
<textarea class="form-control" id="remarks" name="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">Save</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,157 @@
<style>
/* Style for checked checkbox */
input[type=checkbox]:checked + label {
color: #007bff; /* Change text color */
}
/* Style for unchecked checkbox */
input[type=checkbox] + label {
color: black; /* Default text color */
}
/* Style for checkbox itself */
input[type=checkbox] {
margin-right: 10px;
/* You can change the color here */
/* For example: */
/* border-color: blue; */
}
ul.twocols {
columns: 2;
-webkit-columns: 2;
-moz-columns: 2;
list-style-type: none;
padding-inline-start: 0px !important;
}
ul li {
font-size: 12px;
font-weight: 400;
}
ul li label {
display: inline-block;
margin-bottom: .2rem !important;
letter-spacing: .018rem;
}
.card-header {
padding: .35rem .75rem !important;
margin-bottom: 0;
}
</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"> <?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="" enctype="multipart/form-data" name="tbl_vouchertypes">
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="voucher_name">Voucher Name</label><input type="text" class="form-control" id="voucher_name" value="<?php echo $VoucherType->voucher_name; ?>" name="voucher_name">
</div>
</div>
<div class="col">
<div class="form-group">
<label for="voucher_color">Voucher Color</label>
<input type="color" class="form-control p-0" id="voucher_color" value="<?php echo $VoucherType->voucher_color; ?>" name="voucher_color" style="width:85px;">
</div>
</div>
<!-- <div class="col">
<div class="form-group">
<label for="default_debits">Default Debits</label>
<select class="select2" name="default_debits[]" id="default_debits" multiple>
<?php foreach ($Accountcategories as $Accountcategory) : ?>
<option value="<?php echo $Accountcategory->accategory_id; ?>" <?php if (in_array($Accountcategory->accategory_id, explode(",", ($VoucherType->default_debits != "") ? $VoucherType->default_debits : ""))) echo "SELECTED"; ?>><?php echo $Accountcategory->accategory_name; ?></option>
<?php endforeach; ?>
</select>
</div>
</div> -->
<!-- <div class="col">
<div class="form-group">
<label for="default_credits">Default Credits</label>
<select class="select2" name="default_credits[]" id="default_credits" multiple>
<?php foreach ($Accountcategories as $Accountcategory) : ?>
<option value="<?php echo $Accountcategory->accategory_id; ?>" <?php if (in_array($Accountcategory->accategory_id, explode(",", ($VoucherType->default_credits != "") ? $VoucherType->default_credits : ""))) echo "SELECTED"; ?>><?php echo $Accountcategory->accategory_name; ?></option>
<?php endforeach; ?>
</select>
</div>
</div> -->
<div class="col">
<div class="form-group">
<label for="status">Status</label>
<select class="form-control" name="status" id="status">
<option value="0" <?php if ($VoucherType->status == "0") echo "SELECTED"; ?>>Disabled</option>
<option value="1" <?php if ($VoucherType->status == "1") echo "SELECTED"; ?>>Enabled</option>
</select>
</div>
</div>
<!--COL END-->
</div>
<div class="row">
<div class="col-6">
<div class="card">
<div class="card-header bg-primary">
<h5 class="card-title mb-0">Default Debits Groups</h5>
</div>
<div class="card-body">
<div class="row">
<ul class="twocols">
<?php foreach ($Accountcategories as $Accountcategory) : ?>
<li> <input type="checkbox" id="d_<?php echo $Accountcategory->accategory_id; ?>" name="default_debits[]" <?php if (in_array($Accountcategory->accategory_id, explode(",", ($VoucherType->default_debits != "") ? $VoucherType->default_debits : ""))) echo "CHECKED"; ?> value="<?php echo $Accountcategory->accategory_id; ?>">
<label for="d_<?php echo $Accountcategory->accategory_id; ?>"><?php echo $Accountcategory->accategory_name; ?></label></li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
</div>
<div class="col-6">
<div class="card">
<div class="card-header bg-success">
<h5 class="card-title mb-0">Default Credits Groups</h5>
</div>
<div class="card-body">
<div class="row">
<ul class="twocols">
<?php foreach ($Accountcategories as $Accountcategory) : ?>
<li>
<input type="checkbox" id="c_<?php echo $Accountcategory->accategory_id; ?>" name="default_credits[]" <?php if (in_array($Accountcategory->accategory_id, explode(",", ($VoucherType->default_credits != "") ? $VoucherType->default_credits : ""))) echo "CHECKED"; ?> value="<?php echo $Accountcategory->accategory_id; ?>"> <label for="c_<?php echo $Accountcategory->accategory_id; ?>"><?php echo $Accountcategory->accategory_name; ?></label>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col-lg-12">
<div class="form-group">
<label for="remarks">Remarks</label> <textarea class="form-control" id="remarks" rows="30" name="remarks"></textarea>
</div>
</div>
<!--COL END-->
</div>
<!-- <button type="reset" class="btn btn-default">Reset</button> -->
<button class="btn btn-primary float-right" type="submit" name="submit">Save</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,91 @@
<div class="content-wrapper">
<!-- <div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0"><?php //echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="<?php //echo base_url(); ?>">Dashboard</a></li>
<li class="breadcrumb-item active"><?php //echo $pageTitle; ?></li>
</ol>
</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="m-0"><?php echo $pageTitle; ?>
<!-- <a href="<?php //echo site_url("accounts/setup/addsingleentryvoucher"); ?>" 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_vouchertypes")->result(); ?>
<table class="table table-bordered table-striped dataTable">
<thead>
<tr>
<th>Sn</th>
<th>Voucher Name</th>
<th>Default Debits</th>
<th>Default Credits</th>
<th>Voucher Color</th>
<th class="table-col col-2">Action</th>
</tr>
</thead>
<tbody>
<?php $sn = 0;
foreach ($TableData as $TableRow) : $sn++; ?>
<?php foreach ($TableRow as $cols) : $id = $cols;
break;
endforeach; ?><tr class="<?php echo ($TableRow->status == 0) ? "table-danger" : ""; ?>">
<td><?php echo $sn; ?></td>
<td><?php echo $TableRow->voucher_name; ?></td>
<td><?php echo showAccountCategoriesByIds(($TableRow->default_debits!="")?explode(",",$TableRow->default_debits):array()); ?></td>
<td><?php echo showAccountCategoriesByIds(($TableRow->default_credits!="")?explode(",",$TableRow->default_credits):array()); ?></td>
<td><span class="inline-block" style="padding:0px 8px;border:1px solid <?php echo $TableRow->voucher_color; ?>;background:<?php echo $TableRow->voucher_color; ?>">&nbsp;</span> </td>
<td>
<?php showEditButton($commandURL = "accounts/setup/editvouchertype/" . $TableRow->vouchertype_id); ?>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<script>
function doDelete(id) {
if (confirm('Are you sure to delete?')) {
window.location = '<?php echo site_url("accounts/setup/deletevouchertype/"); ?>' + id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function showTogglebutton($commandURL, $currentValue)
{
?>
<a class="btn btn-success btn-xs" href="<?php echo site_url($commandURL); ?>"><?php echo ($currentValue == 1) ? "Disable" : "Enable"; ?></a>
<?php
}
?>

View File

@@ -0,0 +1,143 @@
<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">Viewing Trial Balance <a onClick="exportTableToExcel('exportableTable','trialbalance')" class="btn btn-success">Export</a><a href="" onclick="printDiv('printableDiv');" class="btn btn-success btn-sm float-right">Print</a></h5>
</div>
<div class="card-body" id="printableDiv">
<h3 class="text-center"><?php echo $this->session->userdata("CompanyName"); ?></h3>
<h5 class="text-center">Trial Balance for FY <?php echo showFiscalYear(); ?></h5>
<div id="dataTable_wrapper">
<table class="table table-bordered table-hover" id="exportableTable">
<thead>
<tr>
<th class="col-8">Account</th>
<th class="col-2">Dr</th>
<th class="col-2">Cr</th>
</tr>
</thead>
<tbody>
<?php
$showZeroBalance = 0;
$r = 0;
$dr = 0;
$cr = 0;
foreach ($AccountGroups as $AccountGroup) :
$drAccountGroupTotal = 0;
$crAccountGroupTotal = 0;
showRow('table-group-heading', $AccountGroup->acgroup_name);
foreach ($AccountGroup->AccountCategories as $AccountCategory) :
$drAccountCategoryTotal = 0;
$crAccountCategoryTotal = 0;
showRow('table-category-heading', "<span class='lp-30'>" . $AccountCategory->accategory_name . "</span>");
foreach ($AccountCategory->Accounts as $Account) :
$drAccountBalance = 0;
$crAccountBalance = 0;
$accountBalance = getBalance($Account->account_id);
$drAccountBalance = ($accountBalance > 0) ? $accountBalance : 0;
$crAccountBalance = ($accountBalance < 0) ? abs($accountBalance) : 0;
$drAccountCategoryTotal += $drAccountBalance;
$dr += $drAccountBalance;
$cr += $crAccountBalance;
$crAccountCategoryTotal += $crAccountBalance;
if ($accountBalance == 0) {
if ($showZeroBalance)
showRow($r, "<span class='lp-60'>" . $Account->account_name . "</span>", myCurrency($drAccountBalance), myCurrency($crAccountBalance));
} else {
showRow($r, "<span class='lp-60'>" . $Account->account_name . "</span>", myCurrency($drAccountBalance), myCurrency($crAccountBalance));
}
endforeach;
showRow('table-category-total', "<span class='text-right table-cell'>Total " . $AccountCategory->accategory_name . "</span>", myCurrency($drAccountCategoryTotal), myCurrency($crAccountCategoryTotal));
$drAccountGroupTotal += $drAccountCategoryTotal;
$crAccountGroupTotal += $crAccountCategoryTotal;
endforeach;
showRowHeader('table-group-total', "<span class='text-right table-cell'>Total " . $AccountGroup->acgroup_name . "</span>", myCurrency($drAccountGroupTotal), myCurrency($crAccountGroupTotal));
endforeach;
?>
</tbody>
<tfoot>
<?php showRowHeader("", "Trial Balance Total", myCurrency($dr), myCurrency($cr)); ?>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function showRow($r = "table-default", $c1 = '&nbsp;', $c2 = '', $c3 = '')
{
if ($c2 == "" && $c3 == "") {
//$html = "<tr class='$r'><td colspan='3'>$c1</td></tr>\n";
$html = "<tr class='$r'><td>$c1</td><td class='col-2'>$c2</td><td class='col-2'>$c3</td></tr>\n";
} else {
$html = "<tr class='$r'><td>$c1</td><td class='col-2'>$c2</td><td class='col-2'>$c3</td></tr>\n";
}
echo $html;
}
function showRowHeader($r = "table-default", $c1 = '&nbsp;', $c2 = '', $c3 = '')
{
$html = "<tr class='$r'><th>$c1</th><th class='col-2'>$c2</th><th class='col-2'>$c3</th></tr>\n";
echo $html;
}
function footerFunctions()
{ ?>
<script>
function exportTableToExcel(tableID, filename = '') {
var downloadLink;
var dataType = 'application/vnd.ms-excel';
var tableSelect = document.getElementById(tableID);
var tableHTML = tableSelect.outerHTML.replace(/ /g, '%20');
// Specify file name
filename = filename ? filename + '.xls' : 'excel_data.xls';
// Create download link element
downloadLink = document.createElement("a");
document.body.appendChild(downloadLink);
if (navigator.msSaveOrOpenBlob) {
var blob = new Blob(['\ufeff', tableHTML], {
type: dataType
});
navigator.msSaveOrOpenBlob(blob, filename);
} else {
// Create a link to the file
downloadLink.href = 'data:' + dataType + ', ' + tableHTML;
// Setting the file name
downloadLink.download = filename;
//triggering the function
downloadLink.click();
}
}
</script>
<?php
}
?>

View File

@@ -0,0 +1,323 @@
<?php
$this->load->library("BIBAccounts");
$BIBAccounts = new BIBAccounts();
?>
<!-- Include jQuery -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<!-- Include jQuery UI -->
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<style>
table,
td,
tr {
padding: 0px;
margin: 0px;
}
.group-name {
width: 40%;
}
.group-total {
width: 10%;
}
.table-gray {
background-color: #eee;
}
.table td,
.table th {
padding: 0px;
margin: 0px;
}
.bg-darker {
background-color: #ddd;
}
td .table {
border: 0px !important;
margin-bottom: 0rem;
}
table td:first-child {
padding-left: 5px;
}
.table-bordered.vertical-borders td,
.table-bordered.vertical-borders th {
border-left: 1px solid #dee2e6;
border-right: 1px solid #dee2e6;
}
.table-bordered.vertical-borders thead th {
padding: 0.25rem;
border-top: none;
border-bottom: 2px solid #dee2e6;
}
.table-bordered.vertical-borders tfoot th {
padding: 0.25rem;
border-top: 2px solid #dee2e6;
border-bottom: none;
}
.currency{
font-weight: normal !important;
}
.underline{
text-decoration: underline;
}
.form-control {
display: block;
width: 100%;
height: calc(1.5rem + 1px);
padding: 0.375rem 0.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: 0.25rem;
box-shadow: inset 0 0 0 transparent;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
</style>
<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; ?> <?php myLang("Report"); ?></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 class="btn btn-secondary toggle-collapse mr-2" id="toggleShowAll">Toggle Collapse</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="m-0"><?php echo $pageTitle; ?> </h5>
</div> -->
<div class="card-body p-0">
<?php
// echo $_POST['showClosing'];
$ReportOptions = array(
'showZeroBalances' => true,
'showOB' => (isset($_POST['showOB'])) ? true : false,
'showClosing' => (isset($_POST['showClosing'])) ? true : false,
'showPeriod' => (isset($_POST['showPeriod'])) ? true : true,
);
$showZeroBalances = false;
?>
<?php $AccountGroups = $BIBAccounts->getAccountGroupsWithBalances(); ?>
<table class="table table-bordered vertical-borders" id="TrialBalanceTable">
<thead class="bg-gray">
<tr>
<th rowspan="2">Particulars</th>
<?php if ($ReportOptions['showOB']) : ?>
<th colspan="2" class="text-center">Opening</th>
<?php endif; ?>
<?php if ($ReportOptions['showPeriod']) : ?>
<th colspan="2" class="text-center">Current Period</th>
<?php endif; ?>
<?php if ($ReportOptions['showClosing']) : ?>
<th colspan="2" class="text-center">Closing</th>
<?php endif; ?>
</tr>
<tr>
<?php if ($ReportOptions['showOB']) : ?>
<th class="dr opening-dr text-center" >Dr</th>
<th class="cr opening-cr text-center">Cr</th>
<?php endif; ?>
<?php if ($ReportOptions['showPeriod']) : ?>
<th class="dr this-year-dr text-center">Dr</th>
<th class="cr this-year-cr text-center">Cr</th>
<?php endif; ?>
<?php if ($ReportOptions['showClosing']) : ?>
<th class="dr closing-dr text-center">Dr</th>
<th class="cr closing-cr text-center">Cr</th>
<?php endif; ?>
</tr>
</thead>
<?php
// Initialize variables for column totals
$totalOpeningDr = 0;
$totalOpeningCr = 0;
$totalThisYearDr = 0;
$totalThisYearCr = 0;
$totalClosingDr = 0;
$totalClosingCr = 0;
?>
<?php foreach ($AccountGroups as $group) : ?>
<tr class="group-heading" data-toggle="collapse" data-target="#group_<?php echo $group->acgroup_id; ?>">
<td class="group-name"><b><?php // echo $group->acgroup_name; ?></b></td>
<?php if ($ReportOptions['showOB']) : ?>
<td class="group-total"><?php // echo myCurrency(($group->posting_side == "DR") ? $group->opening_balance : 0); ?></td>
<td class="group-total"><?php // echo myCurrency(($group->posting_side == "CR") ? $group->opening_balance : 0); ?></td>
<?php endif; ?>
<?php if ($ReportOptions['showPeriod']) : ?>
<td class="group-total"><?php // echo myCurrency(($group->posting_side == "DR") ? $group->regular_balance : 0); ?></td>
<td class="group-total"><?php // echo myCurrency(($group->posting_side == "CR") ? $group->regular_balance : 0); ?></td>
<?php endif; ?>
<?php if ($ReportOptions['showClosing']) : ?>
<td class="group-total"><?php // echo myCurrency(($group->posting_side == "DR") ? $group->closing_balance : 0); ?></td>
<td class="group-total"><?php // echo myCurrency(($group->posting_side == "CR") ? $group->closing_balance : 0); ?></td>
<?php endif; ?>
</tr>
<tr>
<td colspan="7" class="group-details p-0">
<div id="group_<?php echo $group->acgroup_id; ?>" class="collapse ">
<?php $Accountcategories = $BIBAccounts->getRootCategoriesWithBalances($group->acgroup_id); ?>
<?php $BIBAccounts->renderAccountCategoriesTable($Accountcategories, $ReportOptions, false, array()); ?>
</div>
</td>
</tr>
<?php
// Update column totals
$totalOpeningDr += ($group->posting_side == "DR") ? $group->opening_balance : 0;
$totalOpeningCr += ($group->posting_side == "CR") ? $group->opening_balance : 0;
$totalThisYearDr += ($group->posting_side == "DR") ? $group->regular_balance : 0;
$totalThisYearCr += ($group->posting_side == "CR") ? $group->regular_balance : 0;
$totalClosingDr += ($group->posting_side == "DR") ? $group->closing_balance : 0;
$totalClosingCr += ($group->posting_side == "CR") ? $group->closing_balance : 0;
?>
<?php endforeach; ?>
<tfoot>
<tr>
<th>Total Amount</th>
<?php if ($ReportOptions['showOB']) : ?>
<th class="dr opening-dr"><?php echo myCurrency($totalOpeningDr); ?></th>
<th class="cr opening-cr"><?php echo myCurrency($totalOpeningCr); ?></th>
<?php endif; ?>
<?php if ($ReportOptions['showPeriod']) : ?>
<th class="dr this-year-dr"><?php echo myCurrency($totalThisYearDr); ?></th>
<th class="cr this-year-cr"><?php echo myCurrency($totalThisYearCr); ?></th>
<?php endif; ?>
<?php if ($ReportOptions['showClosing']) : ?>
<th class="dr closing-dr"><?php echo myCurrency($totalClosingDr); ?></th>
<th class="cr closing-cr"><?php echo myCurrency($totalClosingCr); ?></th>
<?php endif; ?>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
// var exportButton = document.getElementById("exportButton");
// exportButton.addEventListener("click", function() {
// exportTableToCSV("table.csv");
// });
document.addEventListener("DOMContentLoaded", function() {
// Trigger click event on page load
document.getElementById("toggleShowAll").click();
});
document.getElementById("toggleShowAll").addEventListener("click", function(e) {
e.preventDefault();
var nestedRows = document.getElementsByClassName("collapse");
for (var i = 0; i < nestedRows.length; i++) {
if (nestedRows[i].classList.contains("show")) {
nestedRows[i].classList.remove("show");
} else {
nestedRows[i].classList.add("show");
}
}
});
function exportTableToCSV(filename) {
var csv = [];
var rows = document.querySelectorAll("table tr:not(.hide)");
for (var i = 0; i < rows.length; i++) {
var row = [];
var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)");
// Check if the parent row is collapsed or hidden
var parentRow = rows[i].closest(".collapse");
var isParentCollapsed = parentRow && (!parentRow.classList.contains("show"));
if (isParentCollapsed) {
continue; // Skip child table rows if parent is collapsed
}
for (var j = 0; j < cols.length; j++) {
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value
row.push(cellValue);
}
csv.push(row.join(","));
}
// Create a CSV file
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n");
var encodedUri = encodeURI(csvContent);
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", filename);
document.body.appendChild(link);
link.click();
}
</script>
<?php
}

View File

@@ -0,0 +1,345 @@
<?php
$this->load->library("NewAcc");
$Acc = new NewAcc();
?>
<div class="content-wrapper">
<div class="container-fluid">
<style>
td,tr{
margin: 0;
padding: 0;
}
.particulars {
text-align: center;
}
.particulars-names {
text-align: left;
}
.openingDr {
text-align: center;
}
.openingCr {
text-align: center;
}
.closingDr {
text-align: center;
}
.closingCr {
text-align: center;
}
.collapsing {
transition: height 0.3s ease;
overflow: hidden;
}
.table-responsive {
overflow-x: visible;
}
.nested-table {
width: 100%;
}
.hide {
display: none;
}
</style>
<script src="https://unpkg.com/xlsx/dist/xlsx.full.min.js"></script>
<button id="toggleShowAll">Toggle Show All</button>
<button id="toggleColumns">Toggle Opening Balance Columns</button>
<button id="exportButton">Export</button>
<button id="exportButtonXLS">Export</button>
<script>
</script>
<table class="table table-bordered" id="myTrialBalance">
<thead>
<tr class="bg-dark text-white">
<th rowspan="2" class="particulars">Particulars</th>
<th class="openingDr col-4" colspan="2">Opening Balance</th>
<th class="closingDr col-4" colspan="2">Closing Balance</th>
</tr>
<tr class="bg-dark text-white">
<th class="openingDr col-1">Debit</th>
<th class="openingCr col-1">Credit</th>
<th class="closingDr col-1">Debit</th>
<th class="closingCr col-1">Credit</th>
</tr>
</thead>
<tbody>
<?php foreach ($Acc->getAccountGroups() as $AccountGroup) : ?>
<tr class="bg-gray" data-toggle="collapse" data-target="#group-<?php echo $AccountGroup->acgroup_id; ?>" aria-expanded="false" aria-controls="group-<?php echo $AccountGroup->acgroup_id; ?>">
<td class="particulars-names"><?php echo $AccountGroup->acgroup_name; ?></td>
<td class="openingDr col-1"><?php echo myCurrency($AccountGroup->openingdr); ?></td>
<td class="openingCr col-1"><?php echo myCurrency($AccountGroup->openingcr); ?></td>
<td class="closingDr col-1"><?php echo myCurrency($AccountGroup->dr); ?></td>
<td class="closingCr col-1"><?php echo myCurrency($AccountGroup->cr); ?></td>
</tr>
<tr id="group-<?php echo $AccountGroup->acgroup_id; ?>" class="collapse">
<td colspan="5">
<table class="nested-table">
<?php
foreach ($Acc->getAccountCategories($AccountGroup->acgroup_id, "onlyParents") as $ParentCategory) {
generateNestedTable($ParentCategory, "group-" . $AccountGroup->acgroup_id);
}
?>
</table>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<script>
// Toggle Show/Hide OpeningDr and OpeningCr columns
var exportButton = document.getElementById("exportButton");
exportButton.addEventListener("click", function() {
exportTableToCSV("table.csv");
});
// var exportButton = document.getElementById("exportButtonXLS");
// exportButton.addEventListener("click", function() {
// exportTableToXLS("table.xls");
// });
var exportButton = document.getElementById("exportButtonXLS");
exportButton.addEventListener("click", function() {
exportTableToXLS("table.xls");
});
document.getElementById("toggleShowAll").addEventListener("click", function() {
var nestedRows = document.getElementsByClassName("collapse");
for (var i = 0; i < nestedRows.length; i++) {
if (nestedRows[i].classList.contains("show")) {
nestedRows[i].classList.remove("show");
} else {
nestedRows[i].classList.add("show");
}
}
});
var toggleButton = document.getElementById("toggleColumns");
toggleButton.addEventListener("click", function() {
var openingDrCells = document.querySelectorAll(".openingDr");
var openingCrCells = document.querySelectorAll(".openingCr");
var particularCells = document.querySelectorAll(".particulars-names");
// var openingBalanceHeaders = document.querySelectorAll(".openingDr, .openingCr");
for (var i = 0; i < openingDrCells.length; i++) {
openingDrCells[i].classList.toggle("hide");
}
for (var j = 0; j < openingCrCells.length; j++) {
openingCrCells[j].classList.toggle("hide");
}
for (var i = 0; i < particularCells.length; i++) {
particularCells[i].classList.toggle("col-10");
}
for (var i = 0; i < openingBalanceHeaders.length; i++) {
openingBalanceHeaders[i].classList.toggle("hide");
}
});
function exportTableToCSV(filename) {
var csv = [];
var rows = document.querySelectorAll("table tr:not(.hide)");
for (var i = 0; i < rows.length; i++) {
var row = [];
var cols = rows[i].querySelectorAll("td:not(.hide), th:not(.hide)");
// Check if the parent row is collapsed or hidden
var parentRow = rows[i].closest(".collapse");
var isParentCollapsed = parentRow && (!parentRow.classList.contains("show"));
if (isParentCollapsed) {
continue; // Skip child table rows if parent is collapsed
}
for (var j = 0; j < cols.length; j++) {
var cellValue = cols[j].innerText.replace(/,/g, ""); // Remove commas from the cell value
row.push(cellValue);
}
csv.push(row.join(","));
}
// Create a CSV file
var csvContent = "data:text/csv;charset=utf-8," + csv.join("\n");
var encodedUri = encodeURI(csvContent);
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", filename);
document.body.appendChild(link);
link.click();
}
function exportTableToXLS(filename) {
var table = document.getElementById("myTrialBalance");
// Create a new workbook
var workbook = XLSX.utils.book_new();
// Convert the visible columns and rows of the main table to a worksheet
var mainWorksheet = XLSX.utils.table_to_sheet(table, {
display: true,
});
// Hide hidden and collapsed columns
var cols = table.querySelectorAll("th:not(.hide), td:not(.hide)");
cols.forEach(function(cell) {
var columnIndex = XLSX.utils.decode_cell(cell.getAttribute("data-sheets-column-index")).c;
var isHidden = cell.classList.contains("hide") || cell.parentElement.classList.contains("hide");
if (isHidden) {
XLSX.utils.sheet_set_hidden(mainWorksheet, columnIndex, true);
}
});
// Append the main worksheet to the workbook
XLSX.utils.book_append_sheet(workbook, mainWorksheet, "Sheet1");
// Process child tables
var childTables = table.querySelectorAll(".nested-table");
childTables.forEach(function(childTable) {
// Check if the parent row is collapsed or hidden
var parentRow = childTable.closest(".collapse");
var isParentCollapsed = parentRow && !parentRow.classList.contains("show");
if (isParentCollapsed) {
return; // Skip child table if parent is collapsed
}
// Convert the visible columns and rows of the child table to a worksheet
var childWorksheet = XLSX.utils.table_to_sheet(childTable, {
display: true,
});
// Hide hidden columns
var childCols = childTable.querySelectorAll("th:not(.hide), td:not(.hide)");
childCols.forEach(function(cell) {
var columnIndex = XLSX.utils.decode_cell(cell.getAttribute("data-sheets-column-index")).c;
var isHidden = cell.classList.contains("hide");
if (isHidden) {
XLSX.utils.sheet_set_hidden(childWorksheet, columnIndex, true);
}
});
// Append the child worksheet to the workbook
XLSX.utils.book_append_sheet(workbook, childWorksheet, "Sheet1");
});
// Convert workbook to binary XLS format
var xlsContent = XLSX.write(workbook, {
type: "binary",
bookType: "xls",
});
// Convert binary content to ArrayBuffer
var buffer = new ArrayBuffer(xlsContent.length);
var view = new Uint8Array(buffer);
for (var i = 0; i < xlsContent.length; i++) {
view[i] = xlsContent.charCodeAt(i) & 0xff;
}
// Create Blob from ArrayBuffer
var blob = new Blob([buffer], {
type: "application/octet-stream"
});
// Create a download link for the XLS file
var link = document.createElement("a");
link.href = window.URL.createObjectURL(blob);
link.download = filename;
// Trigger the download
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
</script>
</div>
</div>
<?php
function generateNestedTable($parentCategory, $parentRowID = "")
{
$CI = &get_instance();
$CI->load->library("NewAcc");
$Acc = new NewAcc();
$childCategories = $Acc->getChildCategories($parentCategory->accategory_id);
if (empty($childCategories)) {
// No child categories, generate a single row
?>
<tr class="bg-gray" data-toggle="collapse" data-target="#parents-<?php echo $parentCategory->accategory_id; ?>" aria-expanded="false" aria-controls="parents-<?php echo $parentCategory->accategory_id; ?>">
<td class="particulars-names col-8"><?php echo $parentCategory->accategory_name; ?> AAA</td>
<td class="openingDr col-1"><?php echo myCurrency($parentCategory->openingdr); ?></td>
<td class="openingCr col-1"><?php echo myCurrency($parentCategory->openingcr); ?></td>
<td class="closingDr col-1"><?php echo myCurrency($parentCategory->dr); ?></td>
<td class="closingCr col-1"><?php echo myCurrency($parentCategory->cr); ?></td>
</tr>
<tr id="parents-<?php echo $parentCategory->accategory_id; ?>" class="collapse">
<td colspan="5">
<table class="nested-table">
<?php foreach ($Acc->getAccountsByCategory($parentCategory->accategory_id) as $Accounts) { ?>
<tr>
<td class="particulars-names col-8"><?php echo $Accounts->account_name; ?> </td>
<td class="openingDr col-1"><?php echo myCurrency($Accounts->openingdr); ?></td>
<td class="openingCr col-1"><?php echo myCurrency($Accounts->openingcr); ?></td>
<td class="closingDr col-1"><?php echo myCurrency($Accounts->dr); ?></td>
<td class="closingCr col-1"><?php echo myCurrency($Accounts->cr); ?></td>
</tr>
<?php } ?>
</table>
</td>
</tr>
<?php
} else {
// Generate parent category row with collapse toggle
?>
<tr class="bg-primary" data-toggle="collapse" data-target="#parents-<?php echo $parentCategory->accategory_id; ?>" aria-expanded="false" aria-controls="parents-<?php echo $parentCategory->accategory_id; ?>">
<td class="particulars-names col-8"><?php echo $parentCategory->accategory_name; ?> </td>
<td class="openingDr col-1"><?php echo myCurrency($parentCategory->openingdr); ?></td>
<td class="openingCr col-1"><?php echo myCurrency($parentCategory->openingcr); ?></td>
<td class="closingDr col-1"><?php echo myCurrency($parentCategory->dr); ?></td>
<td class="closingCr col-1"><?php echo myCurrency($parentCategory->cr); ?></td>
</tr>
<tr id="parents-<?php echo $parentCategory->accategory_id; ?>" class="collapse">
<td colspan="5">
<table class="nested-table">
<?php foreach ($childCategories as $childCategory) : ?>
<?php generateNestedTable($childCategory); ?>
<?php endforeach; ?>
</table>
</td>
</tr>
<?php
}
}

View File

@@ -0,0 +1,145 @@
<div class="content-wrapper">
<div class="container-fluid">
<div class="card">
<div class="card-header">
<?php echo $pageTitle; ?>
</div>
<div class="card-body">
<div class="row pb-4 justify-content-end">
<div class="col-8">
<div class="row">
<div class="col bg-primary text-white text-center">Table Heading</div>
<div class="col bg-success text-white text-center">Account Types</div>
<div class="col bg-warning text-dark text-center">Account Categories</div>
<div class="col bg-dark text-white text-center">Account Groups</div>
<div class="col bg-light text-center">List of Ledgers</div>
</div>
</div>
</div>
<style>
.expandable {
text-decoration: underline;
}
</style>
<?php
$drWidth = 150;
$crWidth = 150;
$AccountGroups = $this->myaccounts->getAccountGroups();
$showZero = true;
?>
<table class="table table-bordered">
<thead>
<tr class="bg-primary">
<th>Particulars</th>
<th class="text-center" width="<?php echo $drWidth; ?>">Dr</th>
<th class="text-center" width="<?php echo $crWidth; ?>">Cr</th>
</tr>
</thead>
</table>
<div class="scrollable-content overflow-auto p-0" data-simplebar style="max-height: 800px; overflow-y: auto;">
<!-- Content goes here -->
<table class="table table-bordered">
<tbody>
<?php foreach ($AccountGroups as $AccountGroup) :
if (!$showZero && $AccountGroup->isNonZero()) {
continue;
}
$AccountTypes = $this->myaccounts->getParentAccountCategoriesByGroup($AccountGroup->acgroup_id, false);
?>
<tr <?php if ($AccountTypes) : ?>onclick="toggleSubTable(this)" <?php endif; ?> >
<th><?php echo $AccountGroup->acgroup_name; ?></th>
<th width="<?php echo $drWidth; ?>"><?php echo myCurrency(abs($AccountGroup->dr)); ?></th>
<th width="<?php echo $crWidth; ?>"><?php echo myCurrency(abs($AccountGroup->cr)); ?></th>
</tr>
<?php if ($AccountTypes) : ?>
<tr class="sub-table ">
<td colspan="3" class="p-0">
<table class="table table-bordered">
<tbody>
<?php foreach ($AccountTypes as $AccountType) :
//pre($AccountType);
if (!$showZero) {
if ($AccountType->dr == 0 && $AccountType->cr == 0) continue;
}
$AccountGroups = $this->myaccounts->getChildAccountCategoriesByGroupAndParentCategory($AccountType->acgroup_id, $AccountType->accategory_id, true);
?>
<tr <?php if ($AccountGroups) : ?>onclick="toggleSubTable(this)" <?php endif; ?> >
<td><span class="<?php if ($AccountGroups) : ?> expandable <?php endif; ?>"><?php echo $AccountType->accategory_name; ?></span></td>
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($AccountType->dr); ?></td>
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($AccountType->cr); ?></td>
</tr>
<?php if ($AccountGroups) : ?>
<tr class="sub-table">
<td colspan="3" class="p-0">
<table class="table table-bordered">
<tbody>
<?php
foreach ($AccountGroups as $AccountGroup) :
$Accounts = $this->myaccounts->getAccountsByCategory($AccountGroup->accategory_id, true);
?>
<tr <?php if ($Accounts) : ?> onclick="toggleSubTable(this)" <?php endif; ?> >
<td>>> >> <?php echo $AccountGroup->accategory_name; ?></td>
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($AccountGroup->dr); ?></td>
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($AccountGroup->cr); ?></td>
</tr>
<?php if ($Accounts) : ?>
<tr class="sub-table">
<td colspan="3" class="p-0">
<table class="table table-bordered bg-light">
<tbody>
<?php
foreach ($Accounts as $Account) : ?>
<tr>
<td><?php echo linkLedger($Account); ?> A/C</td>
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($Account->dr); ?></td>
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($Account->cr); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</td>
</tr>
<?php endif;
endforeach; ?>
</tbody>
</table>
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
</div>
<script>
function toggleSubTable(row) {
var subTable = row.nextElementSibling;
subTable.style.display = subTable.style.display === 'none' ? 'table-row' : 'none';
}
</script>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,242 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a>
</li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
Create <?php echo $pageTitle; ?> </h5>
</div>
<div class="card-body">
<?php if ($VoucherType->voucher_options == "") : ?>
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<div class="col-3">
<fieldset>
<legend>Transaction Date</legend><input type="text" class="form-control nepaliDatePicker" id="voucher_date" value="<?php echo NepaliDate(); ?>" name="voucher_date">
</fieldset>
</div>
<div class="col-3">
<fieldset>
<?php $DefaultAccount = $this->myaccounts->getAccountDetails($VoucherType->default_account); ?>
<legend><?php echo $DefaultAccount->account_name; ?> Balance</legend><?php echo myCurrency($DefaultAccount->Balance); ?>
</fieldset>
</div>
<div class="col-3 offset-3">
<fieldset>
<legend>Voucher #</legend><input type="text" readonly class="form-control" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset>
<legend>Enter Transaction</legend>
<table id="EntryTable" class="table order-list">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
<td></td>
</tr>
</thead>
<tbody>
<tr>
<td class="col-3">
<?php fillComboWithValue("account_id", "", "account_id", "tbl_accounts", "account_name", "account_id", "", "", "", "status=1"); ?> </td>
<td class="col-4">
<input type="text" name="narration" id="narration" class="form-control" />
</td>
<td class="col-1">
<input type="text" name="debit" id="debit" value="0" class="form-control" />
</td>
<td class="col-1">
<input type="button" class="btn btn-primary full-width" id="addrow" value="Add" />
</td>
</tr>
</tbody>
</table>
<div id="errorBox" class="alert alert-secondary hidden" role="alert">
<h5></h5>
</div>
</fieldset>
<div class="card card-primary card-outline">
<div class="card-header">
Transaction List </div>
<div class="card-body">
<table id="myTable" class=" table order-list table-striped table-bordered">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
</tr>
</thead>
<tbody> </tbody>
<tfoot>
<tr>
<th colspan="2" class="text-right">
Total</th>
<td>
<div id="debitTotal">
</div>
</td>
<td>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks">
Remarks</label> <textarea class="form-control" id="remarks" name="remarks">
</textarea>
</div>
</div>
<!--COL END-->
</div> <button class="btn btn-primary" type="submit" id="saveButton" name="submit">
Save Voucher</button>
</form>
<?php else : ?>
<?php echo $VoucherType->voucher_options; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var counter = 0;
$("#addrow").on("click", function() {
var msg = "Transaction Row Added !!";
if ($("#account_id").val() != "") {
if (!isAccountAdded($("#account_id").val())) {
if ($("#narration").val() != "") {
var debit = ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0);
if ($.isNumeric(debit)) {
if (debit > 0) {
addRow()
} else {
msg = "Amount contain some value";
}
} else {
msg = "Non numberic value entered in amount. ";
}
} else {
msg = "Narration can't be empty!";
}
} else {
msg = "Account already added in transactions";
}
} else {
msg = "Account Head Not Selected!";
}
$("#errorBox h5").html(msg);
$("#errorBox").fadeTo(2000, 500).slideUp(500, function() {
$("#errorBox").slideUp(500);
});
});
$("table.order-list").on("click", ".ibtnDel", function(event) {
$(this).closest("tr").remove();
calculateTotals();
});
});
function isAccountAdded(account_id) {
var arr = $('input[name="account_id[]"]').map(function() {
return this.value;
}).get();
if ($.inArray(account_id, arr) >= 0) return true;
else return false;
}
function addRow() {
var newRow = $("<tr>");
var cols = "";
cols += '<td><input type="hidden" class="form-control" name="account_ids[]" value="' + $("#account_id").val() + '"/><input type="text" readonly class="form-control" name="account_name[]" value="' + $("#account_id option:selected").text() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="narration[]" value="' + $("#narration").val() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="debit[]" value="' + ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0) + '"/></td>';
cols += '<td><input type="button" class="ibtnDel btn btn-md btn-danger " value="Delete"></td>';
newRow.append(cols);
$("#myTable.order-list").append(newRow);
calculateTotals();
}
function calculateTotals() {
var debitTotal = 0;
var creditTotal = 0;
var balance = 0;
$("table.order-list").find('input[name^="debit[]"]').each(function() {
debitTotal += +$(this).val();
});
$("#debit").val(0);
$("#narration").val("");
$("#debitTotal").text(debitTotal.toFixed(2));
$("#balance").text(balance.toFixed(2));
$("#saveButton").prop("disabled", false);
}
$("#saveButton").prop("disabled", true);
</script>

View File

@@ -0,0 +1,190 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a></li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
<?php echo $pageTitle; ?> <a href="<?php echo site_url("accounts/vouchers/".$VoucherType->voucher_alias."/create"); ?>" class="btn btn-sm btn-primary float-right">
Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $Vouchers ?>
<table class="table table-bordered table-striped" id="voucherList">
<thead>
<tr>
<th>ID#</th>
<th>Voucher No</th>
<th>Voucher Date</th>
<th>Voucher Type</th>
<th>Voucher State</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 data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo($TableRow->voucher_state=="Reversed")?"table-danger":""; ?>">
<td><?php echo $TableRow->voucher_id; ?></td>
<td><?php echo $TableRow->voucher_no; ?></td>
<td><?php echo $TableRow->voucher_date; ?></td>
<td><?php echo $TableRow->voucher_type; ?></td>
<td><?php echo $TableRow->voucher_state; ?></td>
<td class="col-1">
<a onClick="javascript:showDetails(<?php echo $id; ?>);" class="btn btn-success btn-xs" title="View Details">
<i class="fa fa-eye">
</i></a>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<div class="modal fade" id="voucherdetails_box" tabindex="-1" role="dialog" aria-labelledby="voucherdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
Voucher Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">
&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Voucher Details Goes Here
</div>
<div class="modal-footer">
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">
Revarsal Entry</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">
Close</button>
</div>
</div>
</div>
</div>
<script>
function showDetails(id) {
$.ajax({
url: "<?php echo site_url("accounts/vouchers/voucherdetails/"); ?>" + id,
success: function(data) {
$("#details_container").html(data);
$("#reversalBtn").data("id",id);
$("#voucherdetails_box").modal('show');
}
});
}
function reversalEntry()
{
var id=$("#reversalBtn").data("id");
if(confirm("Are you sure you want to post reversal for this voucher?"))
{
window.location="<?php echo site_url("accounts/vouchers/reversal/"); ?>"+id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
var table = $('#voucherList').DataTable();
var tableRows = $('table#voucherList tbody').find('tr');
tableRows.each(function() {
async: false;
var jqueryRow = $(this);
var row = table.row(jqueryRow);
var id=$(this).data("id");
var Transactions="<table class='table table-resonsive'><tr><th>Account<\/th><th>Narration<\/th><th>Dr<\/th><th>Cr<\/th><\/tr><tr><td>Billable Projects<\/td><td>Website Development<\/td><td>50000<\/td><td>0<\/td><\/tr><tr><td>Larke Himal Jadibuti Udhyog<\/td><td>Website Development<\/td><td>0<\/td><td>50000<\/td><\/tr><\/table>";
Transactions=getVoucherDetails(id);
row.child(Transactions).show();
});
});
function getVoucherDetails(id) {
$.data;
$.ajax({
url: "<?php echo site_url("ajax/getVoucherDetailsTable/"); ?>" + id,
async: false,
success: function(data) {
$.data=data;
}
});
return ($.data);
}
</script>
<?php
}
?>

View File

@@ -0,0 +1,242 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a>
</li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
Create <?php echo $pageTitle; ?> </h5>
</div>
<div class="card-body">
<?php if ($VoucherType->voucher_options == "") : ?>
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<div class="col-3">
<fieldset>
<legend>Transaction Date</legend><input type="text" class="form-control nepaliDatePicker" id="voucher_date" value="<?php echo NepaliDate(); ?>" name="voucher_date">
</fieldset>
</div>
<div class="col-3">
<fieldset>
<?php $DefaultAccount = $this->myaccounts->getAccountDetails($VoucherType->default_account); ?>
<legend><?php echo $DefaultAccount->account_name; ?> Balance</legend><?php echo myCurrency($DefaultAccount->Balance); ?>
</fieldset>
</div>
<div class="col-3 offset-3">
<fieldset>
<legend>Voucher #</legend><input type="text" readonly class="form-control" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset>
<legend>Enter Transaction</legend>
<table id="EntryTable" class="table order-list">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
<td></td>
</tr>
</thead>
<tbody>
<tr>
<td class="col-3">
<?php fillComboWithValue("account_id", "", "account_id", "tbl_accounts", "account_name", "account_id", "", "", "", "status=1"); ?> </td>
<td class="col-4">
<input type="text" name="narration" id="narration" class="form-control" />
</td>
<td class="col-1">
<input type="text" name="debit" id="debit" value="0" class="form-control" />
</td>
<td class="col-1">
<input type="button" class="btn btn-primary full-width" id="addrow" value="Add" />
</td>
</tr>
</tbody>
</table>
<div id="errorBox" class="alert alert-secondary hidden" role="alert">
<h5></h5>
</div>
</fieldset>
<div class="card card-primary card-outline">
<div class="card-header">
Transaction List </div>
<div class="card-body">
<table id="myTable" class=" table order-list table-striped table-bordered">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
</tr>
</thead>
<tbody> </tbody>
<tfoot>
<tr>
<th colspan="2" class="text-right">
Total</th>
<td>
<div id="debitTotal">
</div>
</td>
<td>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks">
Remarks</label> <textarea class="form-control" id="remarks" name="remarks">
</textarea>
</div>
</div>
<!--COL END-->
</div> <button class="btn btn-primary" type="submit" id="saveButton" name="submit">
Save Voucher</button>
</form>
<?php else : ?>
<?php echo $VoucherType->voucher_options; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var counter = 0;
$("#addrow").on("click", function() {
var msg = "Transaction Row Added !!";
if ($("#account_id").val() != "") {
if (!isAccountAdded($("#account_id").val())) {
if ($("#narration").val() != "") {
var debit = ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0);
if ($.isNumeric(debit)) {
if (debit > 0) {
addRow()
} else {
msg = "Amount contain some value";
}
} else {
msg = "Non numberic value entered in amount. ";
}
} else {
msg = "Narration can't be empty!";
}
} else {
msg = "Account already added in transactions";
}
} else {
msg = "Account Head Not Selected!";
}
$("#errorBox h5").html(msg);
$("#errorBox").fadeTo(2000, 500).slideUp(500, function() {
$("#errorBox").slideUp(500);
});
});
$("table.order-list").on("click", ".ibtnDel", function(event) {
$(this).closest("tr").remove();
calculateTotals();
});
});
function isAccountAdded(account_id) {
var arr = $('input[name="account_id[]"]').map(function() {
return this.value;
}).get();
if ($.inArray(account_id, arr) >= 0) return true;
else return false;
}
function addRow() {
var newRow = $("<tr>");
var cols = "";
cols += '<td><input type="hidden" class="form-control" name="account_ids[]" value="' + $("#account_id").val() + '"/><input type="text" readonly class="form-control" name="account_name[]" value="' + $("#account_id option:selected").text() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="narration[]" value="' + $("#narration").val() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="debit[]" value="' + ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0) + '"/></td>';
cols += '<td><input type="button" class="ibtnDel btn btn-md btn-danger " value="Delete"></td>';
newRow.append(cols);
$("#myTable.order-list").append(newRow);
calculateTotals();
}
function calculateTotals() {
var debitTotal = 0;
var creditTotal = 0;
var balance = 0;
$("table.order-list").find('input[name^="debit[]"]').each(function() {
debitTotal += +$(this).val();
});
$("#debit").val(0);
$("#narration").val("");
$("#debitTotal").text(debitTotal.toFixed(2));
$("#balance").text(balance.toFixed(2));
$("#saveButton").prop("disabled", false);
}
$("#saveButton").prop("disabled", true);
</script>

View File

@@ -0,0 +1,190 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a>
</li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
<?php echo $pageTitle; ?> <a href="<?php echo site_url("accounts/vouchers/" . $VoucherType->voucher_alias . "/create"); ?>" class="btn btn-sm btn-primary float-right">
Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $Vouchers ?>
<table class="table table-bordered table-striped" id="voucherList">
<thead>
<tr>
<th>ID#</th>
<th>Voucher No</th>
<th>Voucher Date</th>
<th>Voucher Type</th>
<th>Voucher State</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 data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo ($TableRow->voucher_state == "Reversed") ? "table-danger" : ""; ?>">
<td><?php echo $TableRow->voucher_id; ?></td>
<td><?php echo $TableRow->voucher_no; ?></td>
<td><?php echo $TableRow->voucher_date; ?></td>
<td><?php echo $TableRow->voucher_type; ?></td>
<td><?php echo $TableRow->voucher_state; ?></td>
<td class="col-1">
<a onClick="javascript:showDetails(<?php echo $id; ?>);" class="btn btn-success btn-xs" title="View Details">
<i class="fa fa-eye">
</i></a>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<div class="modal fade" id="voucherdetails_box" tabindex="-1" role="dialog" aria-labelledby="voucherdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
Voucher Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">
&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Voucher Details Goes Here
</div>
<div class="modal-footer">
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">
Revarsal Entry</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">
Close</button>
</div>
</div>
</div>
</div>
<script>
function showDetails(id) {
$.ajax({
url: "<?php echo site_url("accounts/vouchers/voucherdetails/"); ?>" + id,
success: function(data) {
$("#details_container").html(data);
$("#reversalBtn").data("id", id);
$("#voucherdetails_box").modal('show');
}
});
}
function reversalEntry() {
var id = $("#reversalBtn").data("id");
if (confirm("Are you sure you want to post reversal for this voucher?")) {
window.location = "<?php echo site_url("accounts/vouchers/reversal/"); ?>" + id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
var table = $('#voucherList').DataTable();
var tableRows = $('table#voucherList tbody').find('tr');
tableRows.each(function() {
async: false;
var jqueryRow = $(this);
var row = table.row(jqueryRow);
var id = $(this).data("id");
var Transactions = "<table class='table table-resonsive'><tr><th>Account<\/th><th>Narration<\/th><th>Dr<\/th><th>Cr<\/th><\/tr><tr><td>Billable Projects<\/td><td>Website Development<\/td><td>50000<\/td><td>0<\/td><\/tr><tr><td>Larke Himal Jadibuti Udhyog<\/td><td>Website Development<\/td><td>0<\/td><td>50000<\/td><\/tr><\/table>";
Transactions = getVoucherDetails(id);
row.child(Transactions).show();
});
});
function getVoucherDetails(id) {
$.data;
$.ajax({
url: "<?php echo site_url("ajax/getVoucherDetailsTable/"); ?>" + id,
async: false,
success: function(data) {
$.data = data;
}
});
return ($.data);
}
</script>
<?php
}
?>

View File

@@ -0,0 +1,245 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a>
</li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
Create <?php echo $pageTitle; ?> </h5>
</div>
<div class="card-body">
<?php if ($VoucherType->voucher_options == "") : ?>
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<div class="col-3">
<fieldset>
<legend>Transaction Date</legend><input type="text" class="form-control nepaliDatePicker" id="voucher_date" value="<?php echo NepaliDate(); ?>" name="voucher_date">
</fieldset>
</div>
<div class="col-3">
<fieldset>
<?php
$DefaultAccount = $this->myaccounts->getAccountDetails($VoucherType->default_account);
print_r($DefaultAccount);
?>
<legend><?php echo isset($DefaultAccount->account_name) ? $DefaultAccount->account_name : '' ?> Balance</legend><?php echo myCurrency($DefaultAccount->Balance); ?>
</fieldset>
</div>
<div class="col-3 offset-3">
<fieldset>
<legend>Voucher #</legend><input type="text" readonly class="form-control" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset>
<legend>Enter Transaction</legend>
<table id="EntryTable" class="table order-list">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
<td></td>
</tr>
</thead>
<tbody>
<tr>
<td class="col-3">
<?php fillComboWithValue("account_id", "", "account_id", "tbl_accounts", "account_name", "account_id", "", "", "", "status=1"); ?> </td>
<td class="col-4">
<input type="text" name="narration" id="narration" class="form-control" />
</td>
<td class="col-1">
<input type="text" name="debit" id="debit" value="0" class="form-control" />
</td>
<td class="col-1">
<input type="button" class="btn btn-primary full-width" id="addrow" value="Add" />
</td>
</tr>
</tbody>
</table>
<div id="errorBox" class="alert alert-secondary hidden" role="alert">
<h5></h5>
</div>
</fieldset>
<div class="card card-primary card-outline">
<div class="card-header">
Transaction List </div>
<div class="card-body">
<table id="myTable" class=" table order-list table-striped table-bordered">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
</tr>
</thead>
<tbody> </tbody>
<tfoot>
<tr>
<th colspan="2" class="text-right">
Total</th>
<td>
<div id="debitTotal">
</div>
</td>
<td>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks">
Remarks</label> <textarea class="form-control" id="remarks" name="remarks">
</textarea>
</div>
</div>
<!--COL END-->
</div> <button class="btn btn-primary" type="submit" id="saveButton" name="submit">
Save Voucher</button>
</form>
<?php else : ?>
<?php echo $VoucherType->voucher_options; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var counter = 0;
$("#addrow").on("click", function() {
var msg = "Transaction Row Added !!";
if ($("#account_id").val() != "") {
if (!isAccountAdded($("#account_id").val())) {
if ($("#narration").val() != "") {
var debit = ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0);
if ($.isNumeric(debit)) {
if (debit > 0) {
addRow()
} else {
msg = "Amount contain some value";
}
} else {
msg = "Non numberic value entered in amount. ";
}
} else {
msg = "Narration can't be empty!";
}
} else {
msg = "Account already added in transactions";
}
} else {
msg = "Account Head Not Selected!";
}
$("#errorBox h5").html(msg);
$("#errorBox").fadeTo(2000, 500).slideUp(500, function() {
$("#errorBox").slideUp(500);
});
});
$("table.order-list").on("click", ".ibtnDel", function(event) {
$(this).closest("tr").remove();
calculateTotals();
});
});
function isAccountAdded(account_id) {
var arr = $('input[name="account_id[]"]').map(function() {
return this.value;
}).get();
if ($.inArray(account_id, arr) >= 0) return true;
else return false;
}
function addRow() {
var newRow = $("<tr>");
var cols = "";
cols += '<td><input type="hidden" class="form-control" name="account_ids[]" value="' + $("#account_id").val() + '"/><input type="text" readonly class="form-control" name="account_name[]" value="' + $("#account_id option:selected").text() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="narration[]" value="' + $("#narration").val() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="debit[]" value="' + ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0) + '"/></td>';
cols += '<td><input type="button" class="ibtnDel btn btn-md btn-danger " value="Delete"></td>';
newRow.append(cols);
$("#myTable.order-list").append(newRow);
calculateTotals();
}
function calculateTotals() {
var debitTotal = 0;
var creditTotal = 0;
var balance = 0;
$("table.order-list").find('input[name^="debit[]"]').each(function() {
debitTotal += +$(this).val();
});
$("#debit").val(0);
$("#narration").val("");
$("#debitTotal").text(debitTotal.toFixed(2));
$("#balance").text(balance.toFixed(2));
$("#saveButton").prop("disabled", false);
}
$("#saveButton").prop("disabled", true);
</script>

View File

@@ -0,0 +1,190 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a></li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
<?php echo $pageTitle; ?> <a href="<?php echo site_url("accounts/vouchers/".$VoucherType->voucher_alias."/create"); ?>" class="btn btn-sm btn-primary float-right">
Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $Vouchers ?>
<table class="table table-bordered table-striped" id="voucherList">
<thead>
<tr>
<th>ID#</th>
<th>Voucher No</th>
<th>Voucher Date</th>
<th>Voucher Type</th>
<th>Voucher State</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 data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo($TableRow->voucher_state=="Reversed")?"table-danger":""; ?>">
<td><?php echo $TableRow->voucher_id; ?></td>
<td><?php echo $TableRow->voucher_no; ?></td>
<td><?php echo $TableRow->voucher_date; ?></td>
<td><?php echo $TableRow->voucher_type; ?></td>
<td><?php echo $TableRow->voucher_state; ?></td>
<td class="col-1">
<a onClick="javascript:showDetails(<?php echo $id; ?>);" class="btn btn-success btn-xs" title="View Details">
<i class="fa fa-eye">
</i></a>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<div class="modal fade" id="voucherdetails_box" tabindex="-1" role="dialog" aria-labelledby="voucherdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
Voucher Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">
&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Voucher Details Goes Here
</div>
<div class="modal-footer">
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">
Revarsal Entry</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">
Close</button>
</div>
</div>
</div>
</div>
<script>
function showDetails(id) {
$.ajax({
url: "<?php echo site_url("accounts/vouchers/voucherdetails/"); ?>" + id,
success: function(data) {
$("#details_container").html(data);
$("#reversalBtn").data("id",id);
$("#voucherdetails_box").modal('show');
}
});
}
function reversalEntry()
{
var id=$("#reversalBtn").data("id");
if(confirm("Are you sure you want to post reversal for this voucher?"))
{
window.location="<?php echo site_url("accounts/vouchers/reversal/"); ?>"+id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
var table = $('#voucherList').DataTable();
var tableRows = $('table#voucherList tbody').find('tr');
tableRows.each(function() {
async: false;
var jqueryRow = $(this);
var row = table.row(jqueryRow);
var id=$(this).data("id");
var Transactions="<table class='table table-resonsive'><tr><th>Account<\/th><th>Narration<\/th><th>Dr<\/th><th>Cr<\/th><\/tr><tr><td>Billable Projects<\/td><td>Website Development<\/td><td>50000<\/td><td>0<\/td><\/tr><tr><td>Larke Himal Jadibuti Udhyog<\/td><td>Website Development<\/td><td>0<\/td><td>50000<\/td><\/tr><\/table>";
Transactions=getVoucherDetails(id);
row.child(Transactions).show();
});
});
function getVoucherDetails(id) {
$.data;
$.ajax({
url: "<?php echo site_url("ajax/getVoucherDetailsTable/"); ?>" + id,
async: false,
success: function(data) {
$.data=data;
}
});
return ($.data);
}
</script>
<?php
}
?>

View File

@@ -0,0 +1,242 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a>
</li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
Create <?php echo $pageTitle; ?> </h5>
</div>
<div class="card-body">
<?php if ($VoucherType->voucher_options == "") : ?>
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<div class="col-3">
<fieldset>
<legend>Transaction Date</legend><input type="text" class="form-control nepaliDatePicker" id="voucher_date" value="<?php echo NepaliDate(); ?>" name="voucher_date">
</fieldset>
</div>
<div class="col-3">
<fieldset>
<?php $DefaultAccount = $this->myaccounts->getAccountDetails($VoucherType->default_account); ?>
<legend><?php echo $DefaultAccount->account_name; ?> Balance</legend><?php echo myCurrency($DefaultAccount->Balance); ?>
</fieldset>
</div>
<div class="col-3 offset-3">
<fieldset>
<legend>Voucher #</legend><input type="text" readonly class="form-control" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset>
<legend>Enter Transaction</legend>
<table id="EntryTable" class="table order-list">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
<td></td>
</tr>
</thead>
<tbody>
<tr>
<td class="col-3">
<?php fillComboWithValue("account_id", "", "account_id", "tbl_accounts", "account_name", "account_id", "", "", "", "status=1"); ?> </td>
<td class="col-4">
<input type="text" name="narration" id="narration" class="form-control" />
</td>
<td class="col-1">
<input type="text" name="debit" id="debit" value="0" class="form-control" />
</td>
<td class="col-1">
<input type="button" class="btn btn-primary full-width" id="addrow" value="Add" />
</td>
</tr>
</tbody>
</table>
<div id="errorBox" class="alert alert-secondary hidden" role="alert">
<h5></h5>
</div>
</fieldset>
<div class="card card-primary card-outline">
<div class="card-header">
Transaction List </div>
<div class="card-body">
<table id="myTable" class=" table order-list table-striped table-bordered">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
</tr>
</thead>
<tbody> </tbody>
<tfoot>
<tr>
<th colspan="2" class="text-right">
Total</th>
<td>
<div id="debitTotal">
</div>
</td>
<td>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks">
Remarks</label> <textarea class="form-control" id="remarks" name="remarks">
</textarea>
</div>
</div>
<!--COL END-->
</div> <button class="btn btn-primary" type="submit" id="saveButton" name="submit">
Save Voucher</button>
</form>
<?php else : ?>
<?php echo $VoucherType->voucher_options; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var counter = 0;
$("#addrow").on("click", function() {
var msg = "Transaction Row Added !!";
if ($("#account_id").val() != "") {
if (!isAccountAdded($("#account_id").val())) {
if ($("#narration").val() != "") {
var debit = ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0);
if ($.isNumeric(debit)) {
if (debit > 0) {
addRow()
} else {
msg = "Amount contain some value";
}
} else {
msg = "Non numberic value entered in amount. ";
}
} else {
msg = "Narration can't be empty!";
}
} else {
msg = "Account already added in transactions";
}
} else {
msg = "Account Head Not Selected!";
}
$("#errorBox h5").html(msg);
$("#errorBox").fadeTo(2000, 500).slideUp(500, function() {
$("#errorBox").slideUp(500);
});
});
$("table.order-list").on("click", ".ibtnDel", function(event) {
$(this).closest("tr").remove();
calculateTotals();
});
});
function isAccountAdded(account_id) {
var arr = $('input[name="account_id[]"]').map(function() {
return this.value;
}).get();
if ($.inArray(account_id, arr) >= 0) return true;
else return false;
}
function addRow() {
var newRow = $("<tr>");
var cols = "";
cols += '<td><input type="hidden" class="form-control" name="account_ids[]" value="' + $("#account_id").val() + '"/><input type="text" readonly class="form-control" name="account_name[]" value="' + $("#account_id option:selected").text() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="narration[]" value="' + $("#narration").val() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="debit[]" value="' + ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0) + '"/></td>';
cols += '<td><input type="button" class="ibtnDel btn btn-md btn-danger " value="Delete"></td>';
newRow.append(cols);
$("#myTable.order-list").append(newRow);
calculateTotals();
}
function calculateTotals() {
var debitTotal = 0;
var creditTotal = 0;
var balance = 0;
$("table.order-list").find('input[name^="debit[]"]').each(function() {
debitTotal += +$(this).val();
});
$("#debit").val(0);
$("#narration").val("");
$("#debitTotal").text(debitTotal.toFixed(2));
$("#balance").text(balance.toFixed(2));
$("#saveButton").prop("disabled", false);
}
$("#saveButton").prop("disabled", true);
</script>

View File

@@ -0,0 +1,191 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a>
</li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
<?php echo $pageTitle; ?> <a href="<?php echo site_url("accounts/vouchers/" . $VoucherType->voucher_alias . "/create"); ?>" class="btn btn-sm btn-primary float-right">
Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $Vouchers ?>
<table class="table table-bordered table-striped" id="voucherList">
<thead>
<tr>
<th>Voucher No</th>
<th>Voucher Date</th>
<th>Voucher Type</th>
<th class="table-col col-2">Action</th>
</tr>
</thead>
<tbody>
<?php
// print_r($TableData);
foreach ($TableData as $TableRow) : ?>
<?php foreach ($TableRow as $cols) : $id = $cols;
break;
endforeach; ?><tr data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo ($TableRow->voucher_state == "Reversed") ? "table-danger" : ""; ?>">
<td><?php echo $TableRow->voucher_no; ?></td>
<td><?php echo $TableRow->voucher_date; ?></td>
<td><?php echo $TableRow->voucher_type; ?></td>
<td class="col-1">
<a onClick="javascript:showDetails(<?php echo $id; ?>);" class="btn btn-success btn-xs" title="View Details">
<i class="fa fa-eye">
</i></a>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<div class="modal fade" id="voucherdetails_box" tabindex="-1" role="dialog" aria-labelledby="voucherdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
Voucher Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">
&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Voucher Details Goes Here
</div>
<div class="modal-footer">
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">
Revarsal Entry</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">
Close</button>
</div>
</div>
</div>
</div>
<script>
function showDetails(id) {
$.ajax({
url: "<?php echo site_url("accounts/vouchers/voucherdetails/"); ?>" + id,
success: function(data) {
$("#details_container").html(data);
$("#reversalBtn").data("id", id);
$("#voucherdetails_box").modal('show');
}
});
}
function reversalEntry() {
var id = $("#reversalBtn").data("id");
if (confirm("Are you sure you want to post reversal for this voucher?")) {
window.location = "<?php echo site_url("accounts/vouchers/reversal/"); ?>" + id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
var table = $('#voucherList').DataTable();
var tableRows = $('table#voucherList tbody').find('tr');
tableRows.each(function() {
async: false;
var jqueryRow = $(this);
var row = table.row(jqueryRow);
var id = $(this).data("id");
var Transactions = "<table class='table table-resonsive'><tr><th>Account<\/th><th>Narration<\/th><th>Dr<\/th><th>Cr<\/th><\/tr><tr><td>Billable Projects<\/td><td>Website Development<\/td><td>50000<\/td><td>0<\/td><\/tr><tr><td>Larke Himal Jadibuti Udhyog<\/td><td>Website Development<\/td><td>0<\/td><td>50000<\/td><\/tr><\/table>";
Transactions = getVoucherDetails(id);
row.child(Transactions).show();
});
});
function getVoucherDetails(id) {
$.data;
$.ajax({
url: "<?php echo site_url("ajax/getVoucherDetailsTable/"); ?>" + id,
async: false,
success: function(data) {
$.data = data;
}
});
return ($.data);
}
</script>
<?php
}
?>

View File

@@ -0,0 +1,191 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a>
</li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
<?php echo $pageTitle; ?> <a href="<?php echo site_url("accounts/vouchers/" . $VoucherType->voucher_alias . "/create"); ?>" class="btn btn-sm btn-primary float-right">
Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $Vouchers ?>
<table class="table table-bordered table-striped" id="voucherList">
<thead>
<tr>
<th>Voucher No</th>
<th>Voucher Date</th>
<th>Voucher Type</th>
<th class="table-col col-2">Action</th>
</tr>
</thead>
<tbody>
<?php
// print_r($TableData);
foreach ($TableData as $TableRow) : ?>
<?php foreach ($TableRow as $cols) : $id = $cols;
break;
endforeach; ?><tr data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo ($TableRow->voucher_state == "Reversed") ? "table-danger" : ""; ?>">
<td><?php echo $TableRow->voucher_no; ?></td>
<td><?php echo $TableRow->voucher_date; ?></td>
<td><?php echo $TableRow->voucher_type; ?></td>
<td class="col-1">
<a onClick="javascript:showDetails(<?php echo $id; ?>);" class="btn btn-success btn-xs" title="View Details">
<i class="fa fa-eye">
</i></a>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<div class="modal fade" id="voucherdetails_box" tabindex="-1" role="dialog" aria-labelledby="voucherdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
Voucher Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">
&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Voucher Details Goes Here
</div>
<div class="modal-footer">
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">
Revarsal Entry</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">
Close</button>
</div>
</div>
</div>
</div>
<script>
function showDetails(id) {
$.ajax({
url: "<?php echo site_url("accounts/vouchers/voucherdetails/"); ?>" + id,
success: function(data) {
$("#details_container").html(data);
$("#reversalBtn").data("id", id);
$("#voucherdetails_box").modal('show');
}
});
}
function reversalEntry() {
var id = $("#reversalBtn").data("id");
if (confirm("Are you sure you want to post reversal for this voucher?")) {
window.location = "<?php echo site_url("accounts/vouchers/reversal/"); ?>" + id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
var table = $('#voucherList').DataTable();
var tableRows = $('table#voucherList tbody').find('tr');
tableRows.each(function() {
async: false;
var jqueryRow = $(this);
var row = table.row(jqueryRow);
var id = $(this).data("id");
var Transactions = "<table class='table table-resonsive'><tr><th>Account<\/th><th>Narration<\/th><th>Dr<\/th><th>Cr<\/th><\/tr><tr><td>Billable Projects<\/td><td>Website Development<\/td><td>50000<\/td><td>0<\/td><\/tr><tr><td>Larke Himal Jadibuti Udhyog<\/td><td>Website Development<\/td><td>0<\/td><td>50000<\/td><\/tr><\/table>";
Transactions = getVoucherDetails(id);
row.child(Transactions).show();
});
});
function getVoucherDetails(id) {
$.data;
$.ajax({
url: "<?php echo site_url("ajax/getVoucherDetailsTable/"); ?>" + id,
async: false,
success: function(data) {
$.data = data;
}
});
return ($.data);
}
</script>
<?php
}
?>

View File

@@ -0,0 +1,204 @@
<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("accounts/vouchers/listvouchers"); ?>" class="btn btn-sm btn-warning float-right"><i class="nav-icon fas fa-times"></i> Cancel <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<div class="col-3">
<fieldset>
<legend>Transaction Date</legend><input type="text" class="form-control nepaliDatePicker" id="voucher_date" value="<?php echo NepaliDate(); ?>" name="voucher_date">
</fieldset>
</div>
<div class="col-3">
<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-3 offset-3">
<fieldset>
<legend>Voucher #</legend><input type="text" readonly class="form-control" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset>
<legend>Enter Transaction</legend>
<table id="EntryTable" class="table order-list">
<thead>
<tr>
<td class="col-4">Account</td>
<td class="col-5">Narration</td>
<td class="col-1">Debit</td>
<td class="col-1">Credit</td>
<td class="col-1"></td>
</tr>
</thead>
<tbody>
<tr>
<td> <?php $this->myaccounts->showAccountsCombo("account_id", "", "account_id", "status=1", $default = "", $CSSclass = ""); ?> </td>
<td> <input type="text" name="narration" id="narration" class="form-control" /> </td>
<td> <input type="text" name="debit" id="debit" value="0" class="form-control" /> </td>
<td> <input type="text" name="credit" id="credit" value="0" class="form-control" /> </td>
<td> <input type="button" class="btn btn-primary full-width" id="addrow" value="Add" /> </td>
</tr>
</tbody>
</table>
<div id="errorBox" class="alert alert-secondary hidden" role="alert">
<h5></h5>
</div>
</fieldset>
<div class="card card-success card-outline mt-4">
<div class="card-header">Transaction List </div>
<div class="card-body">
<table id="myTable" class=" table order-list table-striped table-bordered">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Debit</td>
<td>Credit</td>
</tr>
</thead>
<tbody> </tbody>
<tfoot>
<tr>
<th colspan="2" class="text-right">Total</th>
<td>
<div id="debitTotal"></div>
</td>
<td>
<div id="creditTotal"></div>
</td>
<td>
<div class="bold-text" id="balance"></div>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="remarks">Remarks</label> <textarea class="form-control" id="remarks" name="remarks"></textarea> </div>
</div>
<!--COL END-->
</div> <button class="btn btn-primary" type="submit" id="saveButton" name="submit">Save Voucher</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$("#account_id").change(function(e) {
var account_id = this.value;
$.ajax({
url: "<?php echo site_url("accounts/Ledger/getaccountbalance/"); ?>" + account_id,
async: false,
dataType:"json",
success: function(data) {
$("#selectedAccountName").html(data.account_name);
$("#selectedAccountBalance").html(data.Balance);
}
});
});
var counter = 0; $("#addrow").on("click", function() {
var msg = "Transaction Row Added !!";
if ($("#account_id").val() != "") {
if (!isAccountAdded($("#account_id").val())) {
if ($("#narration").val() != "") {
var debit = ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0);
var credit = ($.isNumeric($("#credit").val()) ? $("#credit").val() : 0);
if ($.isNumeric(debit) && $.isNumeric(credit)) {
if (debit > 0 || credit > 0) {
addRow()
} else {
msg = "Either debit side or credit side must contain some value";
}
} else {
msg = "Non numberic value entered in debit side or credit side. ";
}
} else {
msg = "Narration can't be empty!";
}
} else {
msg = "Account already added in transactions";
}
} else {
msg = "Account Head Not Selected!";
}
$("#errorBox h5").html(msg);
$("#errorBox").fadeTo(2000, 500).slideUp(500, function() {
$("#errorBox").slideUp(500);
});
}); $("table.order-list").on("click", ".ibtnDel", function(event) {
$(this).closest("tr").remove();
calculateTotals();
});
});
function isAccountAdded(account_id) {
var arr = $('input[name="account_id[]"]').map(function() {
return this.value;
}).get();
console.log(arr);
if ($.inArray(account_id, arr) >= 0) return true;
else return false;
}
function addRow() {
var newRow = $("<tr>");
var cols = "";
cols += '<td><input type="hidden" class="form-control" name="account_ids[]" value="' + $("#account_id").val() + '"/><input type="text" readonly class="form-control" name="account_name[]" value="' + $("#account_id option:selected").text() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="narration[]" value="' + $("#narration").val() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="debit[]" value="' + ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0) + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="credit[]" value="' + ($.isNumeric($("#credit").val()) ? $("#credit").val() : 0) + '"/></td>';
cols += '<td><input type="button" class="ibtnDel btn btn-md btn-danger " value="Delete"></td>';
newRow.append(cols);
$("#myTable.order-list").append(newRow);
calculateTotals();
}
function calculateTotals() {
var debitTotal = 0;
var creditTotal = 0;
var balance = 0;
$("table.order-list").find('input[name^="debit[]"]').each(function() {
debitTotal += +$(this).val();
});
$("table.order-list").find('input[name^="credit[]"]').each(function() {
creditTotal += +$(this).val();
});
balance = Number(debitTotal) - Number(creditTotal);
roundbalance=balance.toFixed(2);
$("#debit").val(0);
$("#credit").val(0);
$("#debitTotal").text(debitTotal.toFixed(2));
$("#creditTotal").text(creditTotal.toFixed(2));
$("#balance").text(balance.toFixed(2));
if (roundbalance !=0) {
$("#saveButton").prop("disabled", true);
} else {
$("#saveButton").prop("disabled", false);
}
}
$("#saveButton").prop("disabled", true);
</script>

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">Create <?php echo $pageTitle; ?> </h5>
</div>
<div class="card-body">
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<div class="col-3">
<fieldset>
<legend>Deposit Date</legend><input type="text" class="form-control nepaliDatePicker" id="voucher_date" value="<?php echo NepaliDate(); ?>" name="voucher_date">
</fieldset>
</div>
<div class="col-3">
<fieldset>
<?php $DefaultAccount=$this->myaccounts->getAccountDetails($VoucherType->default_account);?>
<legend><?php echo $DefaultAccount->account_name; ?> <?php myLang("Balance");?></legend><?php echo myCurrency($DefaultAccount->Balance); ?>
</fieldset>
</div>
<div class="col-3 offset-3">
<fieldset>
<legend><?php mylang("Voucher"); ?> #</legend><input type="text" readonly class="form-control" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset>
<legend><?php myLang("Enter Deposit Details"); ?></legend>
<div class="row">
<div class="col"><?php createInput("debit[]","Deposited Amount","debit","",""); ?></div>
<div class="col"><?php fillComboWithValue("account_ids[]", "In Account Against", "account_id", "tbl_accounts", "account_name", "account_id", "", "", "", "status=1"); ?></div>
</div>
<div class="row">
<div class="col"><?php createInput("narration[]","Narration","narration","",""); ?></div>
</div>
<div class="row">
<div class="col"><?php createInput("cheque_number[]","Deposited Cheque","cheque_number","",""); ?></div>
<div class="col"><?php createInput("cheque_details[]","Deposited Cheque Details","cheque_details","",""); ?></div>
</div>
</fieldset>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="remarks">Remarks</label> <textarea class="form-control" id="remarks" name="remarks"></textarea> </div>
</div>
<!--COL END-->
</div> <button class="btn btn-primary" type="submit" id="saveButton" name="submit">Save Voucher</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$("#saveButton").prop("disabled", false);
</script>

View File

@@ -0,0 +1,137 @@
<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("accounts/vouchers/".$VoucherType->voucher_alias."/create"); ?>" class="btn btn-sm btn-primary float-right">Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $Vouchers ?>
<table class="table table-bordered table-striped" id="voucherList">
<thead>
<tr>
<th>ID#</th>
<th>Voucher No</th>
<th>Voucher Date</th>
<th>Voucher Type</th>
<th>Voucher State</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 data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo($TableRow->voucher_state=="Reversed")?"table-danger":""; ?>">
<td><?php echo $TableRow->voucher_id; ?></td>
<td><?php echo $TableRow->voucher_no; ?></td>
<td><?php echo $TableRow->voucher_date; ?></td>
<td><?php echo $TableRow->voucher_type; ?></td>
<td><?php echo $TableRow->voucher_state; ?></td>
<td class="col-1">
<a onClick="javascript:showDetails(<?php echo $id; ?>);" class="btn btn-success btn-xs" title="View Details"><i class="fa fa-eye"></i></a>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<div class="modal fade" id="voucherdetails_box" tabindex="-1" role="dialog" aria-labelledby="voucherdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Voucher Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Voucher Details Goes Here
</div>
<div class="modal-footer">
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">Revarsal Entry</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script>
function showDetails(id) {
$.ajax({
url: "<?php echo site_url("accounts/vouchers/voucherdetails/"); ?>" + id,
success: function(data) {
$("#details_container").html(data);
$("#reversalBtn").data("id",id);
$("#voucherdetails_box").modal('show');
}
});
}
function reversalEntry()
{
var id=$("#reversalBtn").data("id");
if(confirm("Are you sure you want to post reversal for this voucher?"))
{
window.location="<?php echo site_url("accounts/vouchers/reversal/"); ?>"+id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
var table = $('#voucherList').DataTable();
var tableRows = $('table#voucherList tbody').find('tr');
tableRows.each(function() {
async: false;
var jqueryRow = $(this);
var row = table.row(jqueryRow);
var id=$(this).data("id");
var Transactions="<table class='table table-resonsive'><tr><th>Account<\/th><th>Narration<\/th><th>Dr<\/th><th>Cr<\/th><\/tr><tr><td>Billable Projects<\/td><td>Website Development<\/td><td>50000<\/td><td>0<\/td><\/tr><tr><td>Larke Himal Jadibuti Udhyog<\/td><td>Website Development<\/td><td>0<\/td><td>50000<\/td><\/tr><\/table>";
Transactions=getVoucherDetails(id);
row.child(Transactions).show();
});
});
function getVoucherDetails(id) {
$.data;
$.ajax({
url: "<?php echo site_url("ajax/getVoucherDetailsTable/"); ?>" + id,
async: false,
success: function(data) {
$.data=data;
}
});
return ($.data);
}
</script>
<?php
}
?>

View File

@@ -0,0 +1,69 @@
<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; ?> </h5>
</div>
<div class="card-body">
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<div class="col-3">
<fieldset>
<legend><?php myLang("Transaction Date"); ?></legend><input type="text" class="form-control nepaliDatePicker" id="voucher_date" value="<?php echo NepaliDate(); ?>" name="voucher_date">
</fieldset>
</div>
<div class="col-3">
<fieldset>
<?php $DefaultAccount=$this->myaccounts->getAccountDetails($VoucherType->default_account);?>
<legend><?php echo $DefaultAccount->account_name; ?> <?php myLang("Balance"); ?></legend><?php echo myCurrency($DefaultAccount->Balance); ?>
</fieldset>
</div>
<div class="col-3 offset-3">
<fieldset>
<legend><?php myLang("Voucher"); ?> #</legend><input type="text" readonly class="form-control" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset>
<legend><?php myLang("Enter Transaction"); ?></legend>
<div class="row">
<div class="col"><?php createInput("debit[]","Payment Received Amount","debit","",""); ?></div>
<div class="col"><?php fillComboWithValue("account_ids[]", "In Account Against", "account_id", "tbl_accounts", "account_name", "account_id", "", "", "", "status=1"); ?></div>
</div>
<div class="row">
<div class="col"><?php createInput("narration[]","Narration","narration","",""); ?></div>
</div>
</fieldset>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="remarks">Remarks</label> <textarea class="form-control" id="remarks" name="remarks"></textarea> </div>
</div>
<!--COL END-->
</div> <button class="btn btn-primary" type="submit" id="saveButton" name="submit">Save Voucher</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$("#saveButton").prop("disabled", false);
</script>

View File

@@ -0,0 +1,137 @@
<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("accounts/vouchers/".$VoucherType->voucher_alias."/create"); ?>" class="btn btn-sm btn-primary float-right">Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $Vouchers ?>
<table class="table table-bordered table-striped" id="voucherList">
<thead>
<tr>
<th>ID#</th>
<th>Voucher No</th>
<th>Voucher Date</th>
<th>Voucher Type</th>
<th>Voucher State</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 data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo($TableRow->voucher_state=="Reversed")?"table-danger":""; ?>">
<td><?php echo $TableRow->voucher_id; ?></td>
<td><?php echo $TableRow->voucher_no; ?></td>
<td><?php echo $TableRow->voucher_date; ?></td>
<td><?php echo $TableRow->voucher_type; ?></td>
<td><?php echo $TableRow->voucher_state; ?></td>
<td class="col-1">
<a onClick="javascript:showDetails(<?php echo $id; ?>);" class="btn btn-success btn-xs" title="View Details"><i class="fa fa-eye"></i></a>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<div class="modal fade" id="voucherdetails_box" tabindex="-1" role="dialog" aria-labelledby="voucherdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Voucher Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Voucher Details Goes Here
</div>
<div class="modal-footer">
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">Revarsal Entry</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script>
function showDetails(id) {
$.ajax({
url: "<?php echo site_url("accounts/vouchers/voucherdetails/"); ?>" + id,
success: function(data) {
$("#details_container").html(data);
$("#reversalBtn").data("id",id);
$("#voucherdetails_box").modal('show');
}
});
}
function reversalEntry()
{
var id=$("#reversalBtn").data("id");
if(confirm("Are you sure you want to post reversal for this voucher?"))
{
window.location="<?php echo site_url("accounts/vouchers/reversal/"); ?>"+id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
var table = $('#voucherList').DataTable();
var tableRows = $('table#voucherList tbody').find('tr');
tableRows.each(function() {
async: false;
var jqueryRow = $(this);
var row = table.row(jqueryRow);
var id=$(this).data("id");
var Transactions="<table class='table table-resonsive'><tr><th>Account<\/th><th>Narration<\/th><th>Dr<\/th><th>Cr<\/th><\/tr><tr><td>Billable Projects<\/td><td>Website Development<\/td><td>50000<\/td><td>0<\/td><\/tr><tr><td>Larke Himal Jadibuti Udhyog<\/td><td>Website Development<\/td><td>0<\/td><td>50000<\/td><\/tr><\/table>";
Transactions=getVoucherDetails(id);
row.child(Transactions).show();
});
});
function getVoucherDetails(id) {
$.data;
$.ajax({
url: "<?php echo site_url("ajax/getVoucherDetailsTable/"); ?>" + id,
async: false,
success: function(data) {
$.data=data;
}
});
return ($.data);
}
</script>
<?php
}
?>

View File

@@ -0,0 +1,177 @@
<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; ?> </h5>
</div>
<div class="card-body">
<?php if($VoucherType->voucher_options==""): ?>
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<div class="col-3">
<fieldset>
<legend>Transaction Date</legend><input type="text" class="form-control nepaliDatePicker" id="voucher_date" value="<?php echo NepaliDate(); ?>" name="voucher_date">
</fieldset>
</div>
<div class="col-3">
<fieldset>
<?php $DefaultAccount=$this->myaccounts->getAccountDetails($VoucherType->default_account);?>
<legend><?php echo $DefaultAccount->account_name; ?> Balance</legend><?php echo myCurrency($DefaultAccount->Balance); ?>
</fieldset>
</div>
<div class="col-3 offset-3">
<fieldset>
<legend>Voucher #</legend><input type="text" readonly class="form-control" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset>
<legend>Enter Transaction</legend>
<table id="EntryTable" class="table order-list">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
<td></td>
</tr>
</thead>
<tbody>
<tr>
<td class="col-3"> <?php fillComboWithValue("account_id", "", "account_id", "tbl_accounts", "account_name", "account_id", "", "", "", "status=1"); ?> </td>
<td class="col-4"> <input type="text" name="narration" id="narration" class="form-control" /> </td>
<td class="col-1"> <input type="text" name="debit" id="debit" value="0" class="form-control" /> </td>
<td class="col-1"> <input type="button" class="btn btn-primary full-width" id="addrow" value="Add" /> </td>
</tr>
</tbody>
</table>
<div id="errorBox" class="alert alert-secondary hidden" role="alert">
<h5></h5>
</div>
</fieldset>
<div class="card card-primary card-outline">
<div class="card-header">Transaction List </div>
<div class="card-body">
<table id="myTable" class=" table order-list table-striped table-bordered">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
</tr>
</thead>
<tbody> </tbody>
<tfoot>
<tr>
<th colspan="2" class="text-right">Total</th>
<td>
<div id="debitTotal"></div>
</td>
<td>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="remarks">Remarks</label> <textarea class="form-control" id="remarks" name="remarks"></textarea> </div>
</div>
<!--COL END-->
</div> <button class="btn btn-primary" type="submit" id="saveButton" name="submit">Save Voucher</button>
</form>
<?php else: ?>
<?php echo $VoucherType->voucher_options; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var counter = 0;
$("#addrow").on("click", function() {
var msg = "Transaction Row Added !!";
if ($("#account_id").val() != "") {
if (!isAccountAdded($("#account_id").val())) {
if ($("#narration").val() != "") {
var debit = ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0);
if ($.isNumeric(debit)) {
if (debit > 0) {
addRow()
} else {
msg = "Amount contain some value";
}
} else {
msg = "Non numberic value entered in amount. ";
}
} else {
msg = "Narration can't be empty!";
}
} else {
msg = "Account already added in transactions";
}
} else {
msg = "Account Head Not Selected!";
}
$("#errorBox h5").html(msg);
$("#errorBox").fadeTo(2000, 500).slideUp(500, function() {
$("#errorBox").slideUp(500);
});
});
$("table.order-list").on("click", ".ibtnDel", function(event) {
$(this).closest("tr").remove();
calculateTotals();
});
});
function isAccountAdded(account_id) {
var arr = $('input[name="account_id[]"]').map(function() {
return this.value;
}).get();
if ($.inArray(account_id, arr) >= 0) return true;
else return false;
}
function addRow() {
var newRow = $("<tr>");
var cols = "";
cols += '<td><input type="hidden" class="form-control" name="account_ids[]" value="' + $("#account_id").val() + '"/><input type="text" readonly class="form-control" name="account_name[]" value="' + $("#account_id option:selected").text() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="narration[]" value="' + $("#narration").val() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="debit[]" value="' + ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0) + '"/></td>';
cols += '<td><input type="button" class="ibtnDel btn btn-md btn-danger " value="Delete"></td>';
newRow.append(cols);
$("#myTable.order-list").append(newRow);
calculateTotals();
}
function calculateTotals() {
var debitTotal = 0;
var creditTotal = 0;
var balance = 0;
$("table.order-list").find('input[name^="debit[]"]').each(function() {
debitTotal += +$(this).val();
});
$("#debit").val(0);
$("#narration").val("");
$("#debitTotal").text(debitTotal.toFixed(2));
$("#balance").text(balance.toFixed(2));
$("#saveButton").prop("disabled", false);
}
$("#saveButton").prop("disabled", true);
</script>

View File

@@ -0,0 +1,137 @@
<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("accounts/vouchers/".$VoucherType->voucher_alias."/create"); ?>" class="btn btn-sm btn-primary float-right">Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $Vouchers ?>
<table class="table table-bordered table-striped" id="voucherList">
<thead>
<tr>
<th>ID#</th>
<th>Voucher No</th>
<th>Voucher Date</th>
<th>Voucher Type</th>
<th>Voucher State</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 data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo($TableRow->voucher_state=="Reversed")?"table-danger":""; ?>">
<td><?php echo $TableRow->voucher_id; ?></td>
<td><?php echo $TableRow->voucher_no; ?></td>
<td><?php echo $TableRow->voucher_date; ?></td>
<td><?php echo $TableRow->voucher_type; ?></td>
<td><?php echo $TableRow->voucher_state; ?></td>
<td class="col-1">
<a onClick="javascript:showDetails(<?php echo $id; ?>);" class="btn btn-success btn-xs" title="View Details"><i class="fa fa-eye"></i></a>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<div class="modal fade" id="voucherdetails_box" tabindex="-1" role="dialog" aria-labelledby="voucherdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Voucher Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Voucher Details Goes Here
</div>
<div class="modal-footer">
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">Revarsal Entry</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script>
function showDetails(id) {
$.ajax({
url: "<?php echo site_url("accounts/vouchers/voucherdetails/"); ?>" + id,
success: function(data) {
$("#details_container").html(data);
$("#reversalBtn").data("id",id);
$("#voucherdetails_box").modal('show');
}
});
}
function reversalEntry()
{
var id=$("#reversalBtn").data("id");
if(confirm("Are you sure you want to post reversal for this voucher?"))
{
window.location="<?php echo site_url("accounts/vouchers/reversal/"); ?>"+id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
var table = $('#voucherList').DataTable();
var tableRows = $('table#voucherList tbody').find('tr');
tableRows.each(function() {
async: false;
var jqueryRow = $(this);
var row = table.row(jqueryRow);
var id=$(this).data("id");
var Transactions="<table class='table table-resonsive'><tr><th>Account<\/th><th>Narration<\/th><th>Dr<\/th><th>Cr<\/th><\/tr><tr><td>Billable Projects<\/td><td>Website Development<\/td><td>50000<\/td><td>0<\/td><\/tr><tr><td>Larke Himal Jadibuti Udhyog<\/td><td>Website Development<\/td><td>0<\/td><td>50000<\/td><\/tr><\/table>";
Transactions=getVoucherDetails(id);
row.child(Transactions).show();
});
});
function getVoucherDetails(id) {
$.data;
$.ajax({
url: "<?php echo site_url("ajax/getVoucherDetailsTable/"); ?>" + id,
async: false,
success: function(data) {
$.data=data;
}
});
return ($.data);
}
</script>
<?php
}
?>

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">Create <?php echo $pageTitle; ?> </h5>
</div>
<div class="card-body">
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<div class="col-3">
<fieldset>
<legend><?php myLang("Payment Date"); ?></legend><input type="text" class="form-control nepaliDatePicker" id="voucher_date" value="<?php echo NepaliDate(); ?>" name="voucher_date">
</fieldset>
</div>
<div class="col-3">
<fieldset>
<?php $DefaultAccount=$this->myaccounts->getAccountDetails($VoucherType->default_account);?>
<legend><?php echo $DefaultAccount->account_name; ?> <?php myLang("Balance");?></legend><?php echo myCurrency($DefaultAccount->Balance); ?>
</fieldset>
</div>
<div class="col-3 offset-3">
<fieldset>
<legend><?php mylang("Voucher"); ?> #</legend><input type="text" readonly class="form-control" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset>
<legend><?php myLang("Enter Deposit Details"); ?></legend>
<div class="row">
<div class="col"><?php createInput("debit[]","Deposited Amount","debit","",""); ?></div>
<div class="col"><?php fillComboWithValue("account_ids[]", "In Account Against", "account_id", "tbl_accounts", "account_name", "account_id", "", "", "", "status=1"); ?></div>
</div>
<div class="row">
<div class="col"><?php createInput("narration[]","Narration","narration","",""); ?></div>
</div>
<div class="row">
<div class="col"><?php createInput("cheque_number[]","Deposited Cheque","cheque_number","",""); ?></div>
<div class="col"><?php createInput("cheque_details[]","Deposited Cheque Details","cheque_details","",""); ?></div>
</div>
</fieldset>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="remarks">Remarks</label> <textarea class="form-control" id="remarks" name="remarks"></textarea> </div>
</div>
<!--COL END-->
</div> <button class="btn btn-primary" type="submit" id="saveButton" name="submit">Save Voucher</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$("#saveButton").prop("disabled", false);
</script>

View File

@@ -0,0 +1,137 @@
<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("accounts/vouchers/".$VoucherType->voucher_alias."/create"); ?>" class="btn btn-sm btn-primary float-right">Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $Vouchers ?>
<table class="table table-bordered table-striped" id="voucherList">
<thead>
<tr>
<th>ID#</th>
<th>Voucher No</th>
<th>Voucher Date</th>
<th>Voucher Type</th>
<th>Voucher State</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 data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo($TableRow->voucher_state=="Reversed")?"table-danger":""; ?>">
<td><?php echo $TableRow->voucher_id; ?></td>
<td><?php echo $TableRow->voucher_no; ?></td>
<td><?php echo $TableRow->voucher_date; ?></td>
<td><?php echo $TableRow->voucher_type; ?></td>
<td><?php echo $TableRow->voucher_state; ?></td>
<td class="col-1">
<a onClick="javascript:showDetails(<?php echo $id; ?>);" class="btn btn-success btn-xs" title="View Details"><i class="fa fa-eye"></i></a>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<div class="modal fade" id="voucherdetails_box" tabindex="-1" role="dialog" aria-labelledby="voucherdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Voucher Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Voucher Details Goes Here
</div>
<div class="modal-footer">
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">Revarsal Entry</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script>
function showDetails(id) {
$.ajax({
url: "<?php echo site_url("accounts/vouchers/voucherdetails/"); ?>" + id,
success: function(data) {
$("#details_container").html(data);
$("#reversalBtn").data("id",id);
$("#voucherdetails_box").modal('show');
}
});
}
function reversalEntry()
{
var id=$("#reversalBtn").data("id");
if(confirm("Are you sure you want to post reversal for this voucher?"))
{
window.location="<?php echo site_url("accounts/vouchers/reversal/"); ?>"+id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
var table = $('#voucherList').DataTable();
var tableRows = $('table#voucherList tbody').find('tr');
tableRows.each(function() {
async: false;
var jqueryRow = $(this);
var row = table.row(jqueryRow);
var id=$(this).data("id");
var Transactions="<table class='table table-resonsive'><tr><th>Account<\/th><th>Narration<\/th><th>Dr<\/th><th>Cr<\/th><\/tr><tr><td>Billable Projects<\/td><td>Website Development<\/td><td>50000<\/td><td>0<\/td><\/tr><tr><td>Larke Himal Jadibuti Udhyog<\/td><td>Website Development<\/td><td>0<\/td><td>50000<\/td><\/tr><\/table>";
Transactions=getVoucherDetails(id);
row.child(Transactions).show();
});
});
function getVoucherDetails(id) {
$.data;
$.ajax({
url: "<?php echo site_url("ajax/getVoucherDetailsTable/"); ?>" + id,
async: false,
success: function(data) {
$.data=data;
}
});
return ($.data);
}
</script>
<?php
}
?>

View File

@@ -0,0 +1,237 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a></li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
Create <?php echo $pageTitle; ?> </h5>
</div>
<div class="card-body">
<?php if($VoucherType->voucher_options==""): ?>
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<div class="col-3">
<fieldset>
<legend>Transaction Date</legend><input type="text" class="form-control nepaliDatePicker" id="voucher_date" value="<?php echo NepaliDate(); ?>" name="voucher_date">
</fieldset>
</div>
<div class="col-3">
<fieldset>
<?php $DefaultAccount=$this->myaccounts->getAccountDetails($VoucherType->default_account);?>
<legend><?php echo $DefaultAccount->account_name; ?> Balance</legend><?php echo myCurrency($DefaultAccount->Balance); ?>
</fieldset>
</div>
<div class="col-3 offset-3">
<fieldset>
<legend>Voucher #</legend><input type="text" readonly class="form-control" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset>
<legend>Enter Transaction</legend>
<table id="EntryTable" class="table order-list">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
<td></td>
</tr>
</thead>
<tbody>
<tr>
<td class="col-3">
<?php fillComboWithValue("account_id", "", "account_id", "tbl_accounts", "account_name", "account_id", "", "", "", "status=1"); ?> </td>
<td class="col-4">
<input type="text" name="narration" id="narration" class="form-control" /> </td>
<td class="col-1">
<input type="text" name="debit" id="debit" value="0" class="form-control" /> </td>
<td class="col-1">
<input type="button" class="btn btn-primary full-width" id="addrow" value="Add" /> </td>
</tr>
</tbody>
</table>
<div id="errorBox" class="alert alert-secondary hidden" role="alert">
<h5></h5>
</div>
</fieldset>
<div class="card card-primary card-outline">
<div class="card-header">
Transaction List </div>
<div class="card-body">
<table id="myTable" class=" table order-list table-striped table-bordered">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
</tr>
</thead>
<tbody> </tbody>
<tfoot>
<tr>
<th colspan="2" class="text-right">
Total</th>
<td>
<div id="debitTotal">
</div>
</td>
<td>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks">
Remarks</label> <textarea class="form-control" id="remarks" name="remarks">
</textarea> </div>
</div>
<!--COL END-->
</div> <button class="btn btn-primary" type="submit" id="saveButton" name="submit">
Save Voucher</button>
</form>
<?php else: ?>
<?php echo $VoucherType->voucher_options; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var counter = 0;
$("#addrow").on("click", function() {
var msg = "Transaction Row Added !!";
if ($("#account_id").val() != "") {
if (!isAccountAdded($("#account_id").val())) {
if ($("#narration").val() != "") {
var debit = ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0);
if ($.isNumeric(debit)) {
if (debit > 0) {
addRow()
} else {
msg = "Amount contain some value";
}
} else {
msg = "Non numberic value entered in amount. ";
}
} else {
msg = "Narration can't be empty!";
}
} else {
msg = "Account already added in transactions";
}
} else {
msg = "Account Head Not Selected!";
}
$("#errorBox h5").html(msg);
$("#errorBox").fadeTo(2000, 500).slideUp(500, function() {
$("#errorBox").slideUp(500);
});
});
$("table.order-list").on("click", ".ibtnDel", function(event) {
$(this).closest("tr").remove();
calculateTotals();
});
});
function isAccountAdded(account_id) {
var arr = $('input[name="account_id[]"]').map(function() {
return this.value;
}).get();
if ($.inArray(account_id, arr) >= 0) return true;
else return false;
}
function addRow() {
var newRow = $("<tr>");
var cols = "";
cols += '<td><input type="hidden" class="form-control" name="account_ids[]" value="' + $("#account_id").val() + '"/><input type="text" readonly class="form-control" name="account_name[]" value="' + $("#account_id option:selected").text() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="narration[]" value="' + $("#narration").val() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="debit[]" value="' + ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0) + '"/></td>';
cols += '<td><input type="button" class="ibtnDel btn btn-md btn-danger " value="Delete"></td>';
newRow.append(cols);
$("#myTable.order-list").append(newRow);
calculateTotals();
}
function calculateTotals() {
var debitTotal = 0;
var creditTotal = 0;
var balance = 0;
$("table.order-list").find('input[name^="debit[]"]').each(function() {
debitTotal += +$(this).val();
});
$("#debit").val(0);
$("#narration").val("");
$("#debitTotal").text(debitTotal.toFixed(2));
$("#balance").text(balance.toFixed(2));
$("#saveButton").prop("disabled", false);
}
$("#saveButton").prop("disabled", true);
</script>

View File

@@ -0,0 +1,190 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a></li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
<?php echo $pageTitle; ?> <a href="<?php echo site_url("accounts/vouchers/".$VoucherType->voucher_alias."/create"); ?>" class="btn btn-sm btn-primary float-right">
Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $Vouchers ?>
<table class="table table-bordered table-striped" id="voucherList">
<thead>
<tr>
<th>ID#</th>
<th>Voucher No</th>
<th>Voucher Date</th>
<th>Voucher Type</th>
<th>Voucher State</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 data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo($TableRow->voucher_state=="Reversed")?"table-danger":""; ?>">
<td><?php echo $TableRow->voucher_id; ?></td>
<td><?php echo $TableRow->voucher_no; ?></td>
<td><?php echo $TableRow->voucher_date; ?></td>
<td><?php echo $TableRow->voucher_type; ?></td>
<td><?php echo $TableRow->voucher_state; ?></td>
<td class="col-1">
<a onClick="javascript:showDetails(<?php echo $id; ?>);" class="btn btn-success btn-xs" title="View Details">
<i class="fa fa-eye">
</i></a>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<div class="modal fade" id="voucherdetails_box" tabindex="-1" role="dialog" aria-labelledby="voucherdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
Voucher Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">
&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Voucher Details Goes Here
</div>
<div class="modal-footer">
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">
Revarsal Entry</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">
Close</button>
</div>
</div>
</div>
</div>
<script>
function showDetails(id) {
$.ajax({
url: "<?php echo site_url("accounts/vouchers/voucherdetails/"); ?>" + id,
success: function(data) {
$("#details_container").html(data);
$("#reversalBtn").data("id",id);
$("#voucherdetails_box").modal('show');
}
});
}
function reversalEntry()
{
var id=$("#reversalBtn").data("id");
if(confirm("Are you sure you want to post reversal for this voucher?"))
{
window.location="<?php echo site_url("accounts/vouchers/reversal/"); ?>"+id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
var table = $('#voucherList').DataTable();
var tableRows = $('table#voucherList tbody').find('tr');
tableRows.each(function() {
async: false;
var jqueryRow = $(this);
var row = table.row(jqueryRow);
var id=$(this).data("id");
var Transactions="<table class='table table-resonsive'><tr><th>Account<\/th><th>Narration<\/th><th>Dr<\/th><th>Cr<\/th><\/tr><tr><td>Billable Projects<\/td><td>Website Development<\/td><td>50000<\/td><td>0<\/td><\/tr><tr><td>Larke Himal Jadibuti Udhyog<\/td><td>Website Development<\/td><td>0<\/td><td>50000<\/td><\/tr><\/table>";
Transactions=getVoucherDetails(id);
row.child(Transactions).show();
});
});
function getVoucherDetails(id) {
$.data;
$.ajax({
url: "<?php echo site_url("ajax/getVoucherDetailsTable/"); ?>" + id,
async: false,
success: function(data) {
$.data=data;
}
});
return ($.data);
}
</script>
<?php
}
?>

View File

@@ -0,0 +1,425 @@
<!-- <style>
:root {
--contra: #cfbdec;
--payment: #6f42c1;
--receipt: #e83e8c;
--journal: #dc3545;
--sales: #fd7e14;
--creditnote: #ffc107;
--purchase: #28a745;
--debitnote: #20c997;
--reversing: #17a2b8;
.border0 {
border: 0;
}
}
fieldset {
padding-bottom: 0 !important;
}
table {
margin-bottom: 0 !important;
}
.card-body.p-0 .table tbody>tr>td:first-of-type, .card-body.p-0 .table tbody>tr>th:first-of-type, .card-body.p-0 .table tfoot>tr>td:first-of-type, .card-body.p-0 .table tfoot>tr>th:first-of-type, .card-body.p-0 .table thead>tr>td:first-of-type, .card-body.p-0 .table thead>tr>th:first-of-type {
padding-left: .5rem;
}
.form-control1 {
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;
}
.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;
}
</style> -->
<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-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0"></h1>
</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" style="background-color: <?php echo $VoucherType->voucher_color; ?>;">
<h5 class="m-0">
<?php //echo $pageTitle;
?>
<a href="<?php //echo site_url("accounts/vouchers/listvouchers");
?>" class="btn btn-sm btn-warning float-right"><i class="nav-icon fas fa-times"></i> Cancel <?php //echo $pageTitle;
?></a></h5>
</div> -->
<div class="card-body" style="background-color: <?php echo $VoucherType->voucher_color; ?>;">
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<div class="col-3">
<fieldset>
<legend>Transaction Date</legend><input type="text" class="form-control nepaliDatePicker" id="voucher_date" value="<?php echo NepaliDate(); ?>" name="voucher_date">
</fieldset>
</div>
<div class="col-6">
<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-3 ">
<fieldset>
<legend><?php echo $pageTitle; ?> Voucher #</legend><input type="text" readonly class="form-control" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset>
<legend>Enter Transaction</legend>
<table id="EntryTable" class="table table-sm">
<thead>
<tr>
<td class="col-1"></td>
<td class="col-6 ">
<div class="row">
<div class="col-auto"><b>Account</b></div>
<div class="col text-right">
</div>
</div>
</td>
<td class="col-1"></td>
<td class="col-1 text-right"><b>Amount</b></td>
<td class="col-1"></td>
</tr>
</thead>
<tbody>
<tr>
<td> <select name="posting_side_selector" id="posting_side_selector" class="form-control form-select">
<option value="debit">Dr</option>
<option value="credit">Cr</option>
</select> </td>
<td>
<?php
if ($VoucherType->default_debits != null)
$VoucherType->default_debits = explode(",", $VoucherType->default_debits);
if ($VoucherType->default_credits != null)
$VoucherType->default_credits = explode(",", $VoucherType->default_credits);;
?>
<span id="dr_box"><?php $this->myaccounts->showAccountsComboForVoucher("account_id", "", "account_id_dr", "status=1", $default = "", $CSSclass = "", $VoucherType->default_debits) ?></span>
<span id="cr_box" style="display: none;"><?php $this->myaccounts->showAccountsComboForVoucher("account_id", "", "account_id_cr", "status=1", $default = "", $CSSclass = "", $VoucherType->default_credits) ?> </span>
</td>
<td> <span id="balance_display" class="d-inline-block text-center"></span>
</td>
<td> <input type="text" name="amount" id="amount" value="0" class="form-control text-right" /> </td>
<td> <input type="button" class="btn btn-primary btn-block " id="addrow" value="Add" /> </td>
</tr>
</tbody>
</table>
</fieldset>
<div class="card card-success card-outline mt-4">
<div class="card-header"><b>Transaction List</b> </div>
<div class="card-body p-0">
<table id="myTable" class=" table order-list table-striped table-bordered">
<thead>
<tr>
<td></td>
<td width="60%"><b>Account</b></td>
<!-- <td>Narration</td> -->
<td class="text-right" width="15%"><b>Debit Amount</b></td>
<td class="text-right" width="15%"><b>Credit Amount</b></td>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>
<th colspan="2" class="text-right">Total</th>
<td>
<div id="debitTotal" class="text-right text-bold"></div>
</td>
<td>
<div id="creditTotal" class="text-right text-bold"></div>
</td>
<td>
<!-- <div id="balance" class="text-right text-bold"></div> -->
</td>
</tr>
<tr>
<th colspan="2" class="text-right"></th>
<td>
<div id="balance_dr" class="text-right text-warning text-bold"></div>
</td>
<td>
<div id="balance_cr" class="text-right text-warning text-bold"></div>
</td>
<td>
<!-- <div id="balance" class="text-right text-bold"></div> -->
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<textarea class="form-control" rows="3" name="narration" id="narration" placeholder="Narration:"></textarea>
<!-- <input type="text" name="narration" id="narration" class="form-control" /> -->
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div id="errorBox" class="alert alert-secondary hidden" role="alert">
<h5></h5>
</div>
</div>
</div>
<!--COL END-->
<button class="btn btn-primary btn-sm float-right mt-2" type="submit" id="saveButton" name="submit">Save Voucher</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$("#posting_side_selector").change(function(e) {
var posting_side = $("#posting_side_selector").val();
if (posting_side == "debit") {
$("#dr_box").show();
$("#cr_box").hide();
} else {
{
$("#dr_box").hide();
$("#cr_box").show();
}
}
});
$("#posting_side_selector").change();
$("#account_id_dr").change(function(e) {
var account_id = this.value;
$.ajax({
url: "<?php echo site_url("accounts/Ledger/getaccountbalance/"); ?>" + account_id,
async: true,
dataType: "json",
success: function(data) {
// alert("COW");
// console.log(data.BalanceRaw);
$("#balance_display").html("Current Balance: " + data.BalanceRaw).css("white-space text-center", "nowrap");
setTimeout(function() {
$("#amount").val('').focus();
}, 100); // Delay focus by 100 milliseconds
}
});
});
$("#account_id_cr").change(function(e) {
var account_id = this.value;
$.ajax({
url: "<?php echo site_url("accounts/Ledger/getaccountbalance/"); ?>" + account_id,
async: true,
dataType: "json",
success: function(data) {
// alert("COW");
// console.log(data.BalanceRaw);
$("#balance_display").html("Current Balance: " + data.BalanceRaw).css("white-space text-center", "nowrap");
setTimeout(function() {
$("#amount").val('').focus();
}, 100); // Delay focus by 100 milliseconds
}
});
});
var counter = 0;
$("#addrow").on("click", function() {
var msg = "Transaction Row Added !!";
if ($("#account_id").val() != "") {
if (!isAccountAdded($("#account_id").val())) {
var posting_side = $("#posting_side_selector").val();
if (posting_side == "debit") {
var account_id = $("#account_id_dr").val();
var account_name = $("#account_id_dr option:selected").text();
} else {
var account_id = $("#account_id_cr").val();
var account_name = $("#account_id_cr option:selected").text();
}
var amount = ($.isNumeric($("#amount").val()) ? $("#amount").val() : 0);
if ($.isNumeric(amount)) {
debit = (posting_side == "debit") ? amount : 0;
credit = (posting_side == "credit") ? amount : 0;
if (debit > 0 || credit > 0) {
addRow(account_id, account_name, debit, credit);
$("#amount").val('');
} else {
msg = "Either debit side or credit side must contain some value";
}
} else {
msg = "Non numberic value entered in debit side or credit side. ";
}
} else {
msg = "Account already added in transactions";
}
} else {
msg = "Account Head Not Selected!";
}
$("#account_id_cr").val()=0;
$("#account_id_dr").val()=0;
$("#errorBox h5").html(msg);
$("#errorBox").fadeTo(2000, 500).slideUp(500, function() {
$("#errorBox").slideUp(500);
});
});
$("table.order-list").on("click", ".ibtnDel", function(event) {
$(this).closest("tr").remove();
calculateTotals();
});
});
function isAccountAdded(account_id) {
var arr = $('input[name="account_ids[]"]').map(function() {
return this.value;
}).get();
// console.log(arr);
if ($.inArray(account_id, arr) >= 0) return true;
else return false;
}
function addRow(account_id, account_name, debit, credit) {
var newRow = $("<tr>");
var cols = "";
cols += (debit == 0) ? '<td class="text-center">Cr</td>' : '<td class="text-center ">Dr</td>';
cols += '<td class="text-left col-7"><input type="hidden" class="form-control1 boarder0 " name="account_ids[]" value="' + account_id + '"/><input type="hidden" class="form-control1 p-0 border0 float-left " name="account_name[]" value="' + account_name + '"/>' + account_name + '</td>';
// cols += '<td><input type="text" readonly class="form-control" name="narration[]" value="' + $("#narration").val() + '"/></td>';
cols += '<td class="col-2 text-right"><input type="hidden" readonly class="form-control1 border0 text-right" name="debit[]" value="' + debit + '"/>' + debit + '</td>';
cols += '<td class="col-2 text-right"><input type="hidden" readonly class="form-control1 border0 text-right" name="credit[]" value="' + credit + '"/>' + credit + '</td>';
cols += '<td class="col-1 "><input type="button" class="ibtnDel btn btn-xs btn-danger float-right " value="Delete"></td>';
newRow.append(cols);
$("#myTable.order-list").append(newRow);
calculateTotals();
}
function calculateTotals() {
var debitTotal = 0;
var creditTotal = 0;
var balance = 0;
$("table.order-list").find('input[name^="debit[]"]').each(function() {
debitTotal += +$(this).val();
});
$("table.order-list").find('input[name^="credit[]"]').each(function() {
creditTotal += +$(this).val();
});
balance = Number(debitTotal) - Number(creditTotal);
roundbalance = balance.toFixed(2);
$("#debit").val(0);
$("#credit").val(0);
$("#debitTotal").text(debitTotal.toFixed(2));
$("#creditTotal").text(creditTotal.toFixed(2));
if (balance > 0) {
$("#balance_cr").text(balance.toFixed(2));
$("#balance_dr").text("");
} else {
$("#balance_cr").text("");
$("#balance_dr").text(balance.toFixed(2));
}
if (roundbalance != 0) {
$("#saveButton").prop("disabled", true);
} else {
$("#saveButton").prop("disabled", false);
}
}
$("#saveButton").prop("disabled", true);
</script>

View File

@@ -0,0 +1,190 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a>
</li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
<?php echo $pageTitle; ?> <a href="<?php echo site_url("accounts/vouchers/" . $VoucherType->voucher_alias . "/create"); ?>" class="btn btn-sm btn-primary float-right">
Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $Vouchers ?>
<table class="table table-bordered table-striped" id="voucherList">
<thead>
<tr>
<th>ID#</th>
<th>Voucher No</th>
<th>Voucher Date</th>
<th>Voucher Type</th>
<th>Voucher State</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 data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo ($TableRow->voucher_state == "Reversed") ? "table-danger" : ""; ?>">
<td><?php echo $TableRow->voucher_id; ?></td>
<td><?php echo $TableRow->voucher_no; ?></td>
<td><?php echo $TableRow->voucher_date; ?></td>
<td><?php echo $TableRow->voucher_type; ?></td>
<td><?php echo $TableRow->voucher_state; ?></td>
<td class="col-1">
<a onClick="javascript:showDetails(<?php echo $id; ?>);" class="btn btn-success btn-xs" title="View Details">
<i class="fa fa-eye">
</i></a>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<div class="modal fade" id="voucherdetails_box" tabindex="-1" role="dialog" aria-labelledby="voucherdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
Voucher Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">
&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Voucher Details Goes Here
</div>
<div class="modal-footer">
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">
Revarsal Entry</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">
Close</button>
</div>
</div>
</div>
</div>
<script>
function showDetails(id) {
$.ajax({
url: "<?php echo site_url("accounts/vouchers/voucherdetails/"); ?>" + id,
success: function(data) {
$("#details_container").html(data);
$("#reversalBtn").data("id", id);
$("#voucherdetails_box").modal('show');
}
});
}
function reversalEntry() {
var id = $("#reversalBtn").data("id");
if (confirm("Are you sure you want to post reversal for this voucher?")) {
window.location = "<?php echo site_url("accounts/vouchers/reversal/"); ?>" + id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
var table = $('#voucherList').DataTable();
var tableRows = $('table#voucherList tbody').find('tr');
tableRows.each(function() {
async: false;
var jqueryRow = $(this);
var row = table.row(jqueryRow);
var id = $(this).data("id");
var Transactions = "<table class='table table-resonsive'><tr><th>Account<\/th><th>Narration<\/th><th>Dr<\/th><th>Cr<\/th><\/tr><tr><td>Billable Projects<\/td><td>Website Development<\/td><td>50000<\/td><td>0<\/td><\/tr><tr><td>Larke Himal Jadibuti Udhyog<\/td><td>Website Development<\/td><td>0<\/td><td>50000<\/td><\/tr><\/table>";
Transactions = getVoucherDetails(id);
row.child(Transactions).show();
});
});
function getVoucherDetails(id) {
$.data;
$.ajax({
url: "<?php echo site_url("ajax/getVoucherDetailsTable/"); ?>" + id,
async: false,
success: function(data) {
$.data = data;
}
});
return ($.data);
}
</script>
<?php
}
?>

View File

@@ -0,0 +1,477 @@
<style>
:root {
--contra: #cfbdec;
--payment: #6f42c1;
--receipt: #e83e8c;
--journal: #dc3545;
--sales: #fd7e14;
--creditnote: #ffc107;
--purchase: #28a745;
--debitnote: #20c997;
--reversing: #17a2b8;
.border0 {
border: 0;
}
}
table {
margin-bottom: 0 !important;
}
.card-body.p-0 .table tbody>tr>td:first-of-type,
.card-body.p-0 .table tbody>tr>th:first-of-type,
.card-body.p-0 .table tfoot>tr>td:first-of-type,
.card-body.p-0 .table tfoot>tr>th:first-of-type,
.card-body.p-0 .table thead>tr>td:first-of-type,
.card-body.p-0 .table thead>tr>th:first-of-type {
padding-left: .5rem;
}
.tables td {
border: 0px;
}
#addButton {
/* position: absolute; */
top: 0;
right: 0;
background-color: #f0f0f0;
border: none;
cursor: pointer;
padding: 5px;
font-size: 16px;
line-height: 16px;
}
#mySelect {
padding: 5px;
font-size: 16px;
line-height: 16px;
}
.custom-select1 {
position: relative;
display: inline-block;
width: 100%;
}
.select2-container {
width: 94% !important;
}
button.addplus {
position: absolute;
right: 0;
top: 0;
height: 100%;
padding: 10px;
background-color: #ddd;
border: none;
border-left: 1px solid #ccc;
border-radius: 0 4px 4px 0;
cursor: pointer;
font-size: 12px;
}
button:hover {
background-color: #ccc;
}
</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" style="background-color: <?php echo $VoucherType->voucher_color; ?>;">
<h5 class="m-0">
<?php //echo $pageTitle;
?>
<a href="<?php //echo site_url("accounts/vouchers/listvouchers");
?>" class="btn btn-sm btn-warning float-right"><i class="nav-icon fas fa-times"></i> Cancel <?php //echo $pageTitle;
?></a></h5>
</div> -->
<div class="card-body" style="background-color: <?php echo $VoucherType->voucher_color; ?>;">
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<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="voucher_date" value="<?php echo NepaliDate(); ?>" name="voucher_date" 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><?php echo $pageTitle; ?> Voucher #</legend><input type="text" readonly class="form-control2" id="voucher_no" value="<?php echo generateVoucherNo($VoucherType->vouchertype_id); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset>
<legend>Enter Transaction</legend>
<table id="EntryTable" class="table tables table-sm">
<thead>
<tr>
<td class="col-1"></td>
<td class="col-6 ">
<div class="row">
<div class="col-auto"><b>Account</b> <span class="text-danger">*</span></div>
<div class="col text-right">
</div>
</div>
</td>
<td class="col-1 text-bold">Current Balance</td>
<td class="col-1 text-right"><b>Amount</b><span class="text-danger">*</span></td>
<td class="col-1"></td>
</tr>
</thead>
<tbody>
<tr>
<td> <select name="posting_side_selector" id="posting_side_selector" class="form-control form-select">
<option value="debit">Dr</option>
<option value="credit">Cr</option>
</select> </td>
<td>
<?php
if ($VoucherType->default_debits != null)
$VoucherType->default_debits = explode(",", $VoucherType->default_debits);
if ($VoucherType->default_credits != null)
$VoucherType->default_credits = explode(",", $VoucherType->default_credits);;
?>
<span id="dr_box" class="custom-select1">
<?php $this->myaccounts->showAccountsComboForVoucher("account_id", "", "account_id_dr", "status=1", $default = "", $CSSclass = "", $VoucherType->default_debits) ?>
</span>
<span id="cr_box" style="display: none;" class="custom-select1">
<?php $this->myaccounts->showAccountsComboForVoucher("account_id", "", "account_id_cr", "status=1", $default = "", $CSSclass = "", $VoucherType->default_credits) ?>
</span>
</td>
<td class="text-center"> <span id="balance_display" class="d-inline-block text-bold fs-20"></span></td>
<td> <input type="text" name="amount" id="amount" value="0" class="form-control text-right" /> </td>
<td> <input type="button" class="btn btn-primary btn-block btn-sm " id="addrow" value="Add" /> </td>
</tr>
</tbody>
</table>
</fieldset>
<div class="card card-success card-outline mt-3">
<div class="card-header"><b>Transaction List</b> </div>
<div class="card-body p-0">
<table id="myTable" class=" table order-list table-striped table-bordered">
<thead>
<tr>
<td width="60%" colspan="2"><b>Account</b></td>
<!-- <td>Narration</td> -->
<td class="text-right" width="15%"><b>Debit Amount</b></td>
<td class="text-right" width="15%"><b>Credit Amount</b></td>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>
<th colspan="2" class="text-right">Total</th>
<td>
<div id="debitTotal" class="text-right text-bold"></div>
</td>
<td>
<div id="creditTotal" class="text-right text-bold"></div>
</td>
<td>
<!-- <div id="balance" class="text-right text-bold"></div> -->
</td>
</tr>
<tr>
<th colspan="2" class="text-right"></th>
<td>
<div id="balance_dr" class="text-right text-danger text-bold"></div>
</td>
<td>
<div id="balance_cr" class="text-right text-danger text-bold"></div>
</td>
<td>
<!-- <div id="balance" class="text-right text-bold"></div> -->
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<textarea class="form-control" rows="30" style="height: 60px!important;" name="narration" id="narration" placeholder="Narration:"></textarea>
<!-- <input type="text" name="narration" id="narration" class="form-control" /> -->
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div id="errorBox" class="alert alert-secondary hidden" role="alert">
<h5></h5>
</div>
</div>
</div>
<!--COL END-->
<button class="btn btn-primary btn-sm float-right mt-2" type="submit" id="saveButton" name="submit">Save Voucher</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Create Ledger</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="modal-body">
<div class="row">
<!--COL START-->
<div class="col-8">
<div class="form-group"> <label for="account_name">Account Name</label><input type="text" class="form-control" id="account_name" value="" name="account_name" required> </div>
</div>
<div class="col-4">
<div class="form-group">
<label for="exampleInputFile">Upload Image</label>
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input" id="exampleInputFile">
<label class="custom-file-label" for="exampleInputFile">Choose file</label>
</div>
</div>
</div>
<!-- <div class="text-center">
<img class="profile-user-img img-fluid " src="../../dist/img/user4-128x128.jpg" alt="User profile picture">
</div> -->
</div>
<!--COL END-->
</div>
<div class="row">
<div class="col-6">
<div class="form-group">
<?php
$this->myaccounts->showAccountsCategoriesWithParentsCombo($fieldName = "accategory_id", $displayName = "Under", $fieldID = "accategory_id", $condition = "status=1", $default = "", $CSSclass = "select2", "required");
?>
</div>
</div>
<div class="col-4">
<div class="form-group"> <label for="opening_balance">Opening Balance</label><input type="text" class="form-control" id="opening_balance" value="" name="opening_balance"> </div>
</div>
<div class="col-2">
<div class="form-group"> <label for="opening_balance_drcr">Dr/Cr</label>
<select class="form-control" id="opening_balance_drcr" name="opening_balance_drcr" required>
<option value="DR" class="text-left">Dr</option>
<option value="CR" class="text-left">Cr</option>
</select>
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="remarks">Remarks</label> <textarea class="form-control" id="remarks" name="remarks"></textarea> </div>
</div>
<!--COL END-->
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">Close</button>
<button class="btn btn-primary btn-sm" type="submit" name="submit">Save</button>
</div>
</form>
</div>
</div>
</div>
</div>
<script>
function addOption() {
var newOption = prompt("Enter new option:");
if (newOption != null) {
var select = document.getElementById("mySelect");
var option = document.createElement("option");
option.text = newOption;
option.value = newOption.toLowerCase().replace(/\s+/g, '');
select.add(option);
}
}
</script>
<script>
$(document).ready(function() {
$("#posting_side_selector").change(function(e) {
var posting_side = $("#posting_side_selector").val();
if (posting_side == "debit") {
$("#dr_box").show();
$("#cr_box").hide();
} else {
{
$("#dr_box").hide();
$("#cr_box").show();
}
}
});
$("#posting_side_selector").change();
$("#account_id_dr").change(function(e) {
var account_id = this.value;
$.ajax({
url: "<?php echo site_url("accounts/Ledger/getaccountbalance/"); ?>" + account_id,
async: true,
dataType: "json",
success: function(data) {
// alert("COW");
// console.log(data.BalanceRaw);
$("#balance_display").html(" " + data.BalanceRaw).css("white-space text-center", "nowrap");
setTimeout(function() {
$("#amount").val('').focus();
}, 100); // Delay focus by 100 milliseconds
}
});
});
$("#account_id_cr").change(function(e) {
var account_id = this.value;
$.ajax({
url: "<?php echo site_url("accounts/Ledger/getaccountbalance/"); ?>" + account_id,
async: true,
dataType: "json",
success: function(data) {
// alert("COW");
// console.log(data.BalanceRaw);
$("#balance_display").html("Current Balance: " + data.BalanceRaw).css("white-space text-center", "nowrap");
setTimeout(function() {
$("#amount").val('').focus();
}, 100); // Delay focus by 100 milliseconds
}
});
});
var counter = 0;
$("#addrow").on("click", function() {
var msg = "Transaction Row Added !!";
if ($("#account_id").val() != "") {
if (!isAccountAdded($("#account_id").val())) {
var posting_side = $("#posting_side_selector").val();
if (posting_side == "debit") {
var account_id = $("#account_id_dr").val();
var account_name = $("#account_id_dr option:selected").text();
} else {
var account_id = $("#account_id_cr").val();
var account_name = $("#account_id_cr option:selected").text();
}
var amount = ($.isNumeric($("#amount").val()) ? $("#amount").val() : 0);
if ($.isNumeric(amount)) {
debit = (posting_side == "debit") ? amount : 0;
credit = (posting_side == "credit") ? amount : 0;
if (debit > 0 || credit > 0) {
addRow(account_id, account_name, debit, credit);
$("#amount").val('');
} else {
msg = "Either debit side or credit side must contain some value";
}
} else {
msg = "Non numberic value entered in debit side or credit side. ";
}
} else {
msg = "Account already added in transactions";
}
} else {
msg = "Account Head Not Selected!";
}
$("#account_id_cr").val() = 0;
$("#account_id_dr").val() = 0;
$("#errorBox h5").html(msg);
$("#errorBox").fadeTo(2000, 500).slideUp(500, function() {
$("#errorBox").slideUp(500);
});
});
$("table.order-list").on("click", ".ibtnDel", function(event) {
$(this).closest("tr").remove();
calculateTotals();
});
});
function isAccountAdded(account_id) {
var arr = $('input[name="account_ids[]"]').map(function() {
return this.value;
}).get();
// console.log(arr);
if ($.inArray(account_id, arr) >= 0) return true;
else return false;
}
function addRow(account_id, account_name, debit, credit) {
var newRow = $("<tr>");
var cols = "";
cols += (debit == 0) ? '<td class="text-center">Cr</td>' : '<td class="text-center ">Dr</td>';
cols += '<td class="text-left col-7"><input type="hidden" class="form-control1 boarder0 " name="account_ids[]" value="' + account_id + '"/><input type="hidden" class="form-control1 p-0 border0 float-left " name="account_name[]" value="' + account_name + '"/>' + account_name + '</td>';
// cols += '<td><input type="text" readonly class="form-control" name="narration[]" value="' + $("#narration").val() + '"/></td>';
cols += '<td class="col-2 text-right"><input type="hidden" readonly class="form-control1 border0 text-right" name="debit[]" value="' + debit + '"/>' + debit + '</td>';
cols += '<td class="col-2 text-right"><input type="hidden" readonly class="form-control1 border0 text-right" name="credit[]" value="' + credit + '"/>' + credit + '</td>';
cols += '<td class="col-1 "><input type="button" class="ibtnDel btn btn-xs btn-danger float-right " value="Delete"></td>';
newRow.append(cols);
$("#myTable.order-list").append(newRow);
calculateTotals();
}
function calculateTotals() {
var debitTotal = 0;
var creditTotal = 0;
var balance = 0;
$("table.order-list").find('input[name^="debit[]"]').each(function() {
debitTotal += +$(this).val();
});
$("table.order-list").find('input[name^="credit[]"]').each(function() {
creditTotal += +$(this).val();
});
balance = Number(debitTotal) - Number(creditTotal);
roundbalance = balance.toFixed(2);
$("#debit").val(0);
$("#credit").val(0);
$("#debitTotal").text(debitTotal.toFixed(2));
$("#creditTotal").text(creditTotal.toFixed(2));
if (balance > 0) {
$("#balance_cr").text(balance.toFixed(2));
$("#balance_dr").text("");
} else {
$("#balance_cr").text("");
$("#balance_dr").text(balance.toFixed(2));
}
if (roundbalance != 0) {
$("#saveButton").prop("disabled", true);
} else {
$("#saveButton").prop("disabled", false);
}
}
$("#saveButton").prop("disabled", true);
</script>

View File

@@ -0,0 +1,237 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a></li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
Create <?php echo $pageTitle; ?> </h5>
</div>
<div class="card-body">
<?php if($VoucherType->voucher_options==""): ?>
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<div class="col-3">
<fieldset>
<legend>Transaction Date</legend><input type="text" class="form-control nepaliDatePicker" id="voucher_date" value="<?php echo NepaliDate(); ?>" name="voucher_date">
</fieldset>
</div>
<div class="col-3">
<fieldset>
<?php $DefaultAccount=$this->myaccounts->getAccountDetails($VoucherType->default_account);?>
<legend><?php echo $DefaultAccount->account_name; ?> Balance</legend><?php echo myCurrency($DefaultAccount->Balance); ?>
</fieldset>
</div>
<div class="col-3 offset-3">
<fieldset>
<legend>Voucher #</legend><input type="text" readonly class="form-control" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset>
<legend>Enter Transaction</legend>
<table id="EntryTable" class="table order-list">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
<td></td>
</tr>
</thead>
<tbody>
<tr>
<td class="col-3">
<?php fillComboWithValue("account_id", "", "account_id", "tbl_accounts", "account_name", "account_id", "", "", "", "status=1"); ?> </td>
<td class="col-4">
<input type="text" name="narration" id="narration" class="form-control" /> </td>
<td class="col-1">
<input type="text" name="debit" id="debit" value="0" class="form-control" /> </td>
<td class="col-1">
<input type="button" class="btn btn-primary full-width" id="addrow" value="Add" /> </td>
</tr>
</tbody>
</table>
<div id="errorBox" class="alert alert-secondary hidden" role="alert">
<h5></h5>
</div>
</fieldset>
<div class="card card-primary card-outline">
<div class="card-header">
Transaction List </div>
<div class="card-body">
<table id="myTable" class=" table order-list table-striped table-bordered">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
</tr>
</thead>
<tbody> </tbody>
<tfoot>
<tr>
<th colspan="2" class="text-right">
Total</th>
<td>
<div id="debitTotal">
</div>
</td>
<td>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks">
Remarks</label> <textarea class="form-control" id="remarks" name="remarks">
</textarea> </div>
</div>
<!--COL END-->
</div> <button class="btn btn-primary" type="submit" id="saveButton" name="submit">
Save Voucher</button>
</form>
<?php else: ?>
<?php echo $VoucherType->voucher_options; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var counter = 0;
$("#addrow").on("click", function() {
var msg = "Transaction Row Added !!";
if ($("#account_id").val() != "") {
if (!isAccountAdded($("#account_id").val())) {
if ($("#narration").val() != "") {
var debit = ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0);
if ($.isNumeric(debit)) {
if (debit > 0) {
addRow()
} else {
msg = "Amount contain some value";
}
} else {
msg = "Non numberic value entered in amount. ";
}
} else {
msg = "Narration can't be empty!";
}
} else {
msg = "Account already added in transactions";
}
} else {
msg = "Account Head Not Selected!";
}
$("#errorBox h5").html(msg);
$("#errorBox").fadeTo(2000, 500).slideUp(500, function() {
$("#errorBox").slideUp(500);
});
});
$("table.order-list").on("click", ".ibtnDel", function(event) {
$(this).closest("tr").remove();
calculateTotals();
});
});
function isAccountAdded(account_id) {
var arr = $('input[name="account_id[]"]').map(function() {
return this.value;
}).get();
if ($.inArray(account_id, arr) >= 0) return true;
else return false;
}
function addRow() {
var newRow = $("<tr>");
var cols = "";
cols += '<td><input type="hidden" class="form-control" name="account_ids[]" value="' + $("#account_id").val() + '"/><input type="text" readonly class="form-control" name="account_name[]" value="' + $("#account_id option:selected").text() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="narration[]" value="' + $("#narration").val() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="debit[]" value="' + ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0) + '"/></td>';
cols += '<td><input type="button" class="ibtnDel btn btn-md btn-danger " value="Delete"></td>';
newRow.append(cols);
$("#myTable.order-list").append(newRow);
calculateTotals();
}
function calculateTotals() {
var debitTotal = 0;
var creditTotal = 0;
var balance = 0;
$("table.order-list").find('input[name^="debit[]"]').each(function() {
debitTotal += +$(this).val();
});
$("#debit").val(0);
$("#narration").val("");
$("#debitTotal").text(debitTotal.toFixed(2));
$("#balance").text(balance.toFixed(2));
$("#saveButton").prop("disabled", false);
}
$("#saveButton").prop("disabled", true);
</script>

View File

@@ -0,0 +1,190 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a></li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
<?php echo $pageTitle; ?> <a href="<?php echo site_url("accounts/vouchers/".$VoucherType->voucher_alias."/create"); ?>" class="btn btn-sm btn-primary float-right">
Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $Vouchers ?>
<table class="table table-bordered table-striped" id="voucherList">
<thead>
<tr>
<th>ID#</th>
<th>Voucher No</th>
<th>Voucher Date</th>
<th>Voucher Type</th>
<th>Voucher State</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 data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo($TableRow->voucher_state=="Reversed")?"table-danger":""; ?>">
<td><?php echo $TableRow->voucher_id; ?></td>
<td><?php echo $TableRow->voucher_no; ?></td>
<td><?php echo $TableRow->voucher_date; ?></td>
<td><?php echo $TableRow->voucher_type; ?></td>
<td><?php echo $TableRow->voucher_state; ?></td>
<td class="col-1">
<a onClick="javascript:showDetails(<?php echo $id; ?>);" class="btn btn-success btn-xs" title="View Details">
<i class="fa fa-eye">
</i></a>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<div class="modal fade" id="voucherdetails_box" tabindex="-1" role="dialog" aria-labelledby="voucherdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
Voucher Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">
&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Voucher Details Goes Here
</div>
<div class="modal-footer">
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">
Revarsal Entry</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">
Close</button>
</div>
</div>
</div>
</div>
<script>
function showDetails(id) {
$.ajax({
url: "<?php echo site_url("accounts/vouchers/voucherdetails/"); ?>" + id,
success: function(data) {
$("#details_container").html(data);
$("#reversalBtn").data("id",id);
$("#voucherdetails_box").modal('show');
}
});
}
function reversalEntry()
{
var id=$("#reversalBtn").data("id");
if(confirm("Are you sure you want to post reversal for this voucher?"))
{
window.location="<?php echo site_url("accounts/vouchers/reversal/"); ?>"+id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
var table = $('#voucherList').DataTable();
var tableRows = $('table#voucherList tbody').find('tr');
tableRows.each(function() {
async: false;
var jqueryRow = $(this);
var row = table.row(jqueryRow);
var id=$(this).data("id");
var Transactions="<table class='table table-resonsive'><tr><th>Account<\/th><th>Narration<\/th><th>Dr<\/th><th>Cr<\/th><\/tr><tr><td>Billable Projects<\/td><td>Website Development<\/td><td>50000<\/td><td>0<\/td><\/tr><tr><td>Larke Himal Jadibuti Udhyog<\/td><td>Website Development<\/td><td>0<\/td><td>50000<\/td><\/tr><\/table>";
Transactions=getVoucherDetails(id);
row.child(Transactions).show();
});
});
function getVoucherDetails(id) {
$.data;
$.ajax({
url: "<?php echo site_url("ajax/getVoucherDetailsTable/"); ?>" + id,
async: false,
success: function(data) {
$.data=data;
}
});
return ($.data);
}
</script>
<?php
}
?>

View File

@@ -0,0 +1,237 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a></li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
Create <?php echo $pageTitle; ?> </h5>
</div>
<div class="card-body">
<?php if($VoucherType->voucher_options==""): ?>
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<div class="col-3">
<fieldset>
<legend>Transaction Date</legend><input type="text" class="form-control nepaliDatePicker" id="voucher_date" value="<?php echo NepaliDate(); ?>" name="voucher_date">
</fieldset>
</div>
<div class="col-3">
<fieldset>
<?php $DefaultAccount=$this->myaccounts->getAccountDetails($VoucherType->default_account);?>
<legend><?php echo $DefaultAccount->account_name; ?> Balance</legend><?php echo myCurrency($DefaultAccount->Balance); ?>
</fieldset>
</div>
<div class="col-3 offset-3">
<fieldset>
<legend>Voucher #</legend><input type="text" readonly class="form-control" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset>
<legend>Enter Transaction</legend>
<table id="EntryTable" class="table order-list">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
<td></td>
</tr>
</thead>
<tbody>
<tr>
<td class="col-3">
<?php fillComboWithValue("account_id", "", "account_id", "tbl_accounts", "account_name", "account_id", "", "", "", "status=1"); ?> </td>
<td class="col-4">
<input type="text" name="narration" id="narration" class="form-control" /> </td>
<td class="col-1">
<input type="text" name="debit" id="debit" value="0" class="form-control" /> </td>
<td class="col-1">
<input type="button" class="btn btn-primary full-width" id="addrow" value="Add" /> </td>
</tr>
</tbody>
</table>
<div id="errorBox" class="alert alert-secondary hidden" role="alert">
<h5></h5>
</div>
</fieldset>
<div class="card card-primary card-outline">
<div class="card-header">
Transaction List </div>
<div class="card-body">
<table id="myTable" class=" table order-list table-striped table-bordered">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
</tr>
</thead>
<tbody> </tbody>
<tfoot>
<tr>
<th colspan="2" class="text-right">
Total</th>
<td>
<div id="debitTotal">
</div>
</td>
<td>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks">
Remarks</label> <textarea class="form-control" id="remarks" name="remarks">
</textarea> </div>
</div>
<!--COL END-->
</div> <button class="btn btn-primary" type="submit" id="saveButton" name="submit">
Save Voucher</button>
</form>
<?php else: ?>
<?php echo $VoucherType->voucher_options; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var counter = 0;
$("#addrow").on("click", function() {
var msg = "Transaction Row Added !!";
if ($("#account_id").val() != "") {
if (!isAccountAdded($("#account_id").val())) {
if ($("#narration").val() != "") {
var debit = ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0);
if ($.isNumeric(debit)) {
if (debit > 0) {
addRow()
} else {
msg = "Amount contain some value";
}
} else {
msg = "Non numberic value entered in amount. ";
}
} else {
msg = "Narration can't be empty!";
}
} else {
msg = "Account already added in transactions";
}
} else {
msg = "Account Head Not Selected!";
}
$("#errorBox h5").html(msg);
$("#errorBox").fadeTo(2000, 500).slideUp(500, function() {
$("#errorBox").slideUp(500);
});
});
$("table.order-list").on("click", ".ibtnDel", function(event) {
$(this).closest("tr").remove();
calculateTotals();
});
});
function isAccountAdded(account_id) {
var arr = $('input[name="account_id[]"]').map(function() {
return this.value;
}).get();
if ($.inArray(account_id, arr) >= 0) return true;
else return false;
}
function addRow() {
var newRow = $("<tr>");
var cols = "";
cols += '<td><input type="hidden" class="form-control" name="account_ids[]" value="' + $("#account_id").val() + '"/><input type="text" readonly class="form-control" name="account_name[]" value="' + $("#account_id option:selected").text() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="narration[]" value="' + $("#narration").val() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="debit[]" value="' + ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0) + '"/></td>';
cols += '<td><input type="button" class="ibtnDel btn btn-md btn-danger " value="Delete"></td>';
newRow.append(cols);
$("#myTable.order-list").append(newRow);
calculateTotals();
}
function calculateTotals() {
var debitTotal = 0;
var creditTotal = 0;
var balance = 0;
$("table.order-list").find('input[name^="debit[]"]').each(function() {
debitTotal += +$(this).val();
});
$("#debit").val(0);
$("#narration").val("");
$("#debitTotal").text(debitTotal.toFixed(2));
$("#balance").text(balance.toFixed(2));
$("#saveButton").prop("disabled", false);
}
$("#saveButton").prop("disabled", true);
</script>

View File

@@ -0,0 +1,190 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a></li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
<?php echo $pageTitle; ?> <a href="<?php echo site_url("accounts/vouchers/".$VoucherType->voucher_alias."/create"); ?>" class="btn btn-sm btn-primary float-right">
Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $Vouchers ?>
<table class="table table-bordered table-striped" id="voucherList">
<thead>
<tr>
<th>ID#</th>
<th>Voucher No</th>
<th>Voucher Date</th>
<th>Voucher Type</th>
<th>Voucher State</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 data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo($TableRow->voucher_state=="Reversed")?"table-danger":""; ?>">
<td><?php echo $TableRow->voucher_id; ?></td>
<td><?php echo $TableRow->voucher_no; ?></td>
<td><?php echo $TableRow->voucher_date; ?></td>
<td><?php echo $TableRow->voucher_type; ?></td>
<td><?php echo $TableRow->voucher_state; ?></td>
<td class="col-1">
<a onClick="javascript:showDetails(<?php echo $id; ?>);" class="btn btn-success btn-xs" title="View Details">
<i class="fa fa-eye">
</i></a>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<div class="modal fade" id="voucherdetails_box" tabindex="-1" role="dialog" aria-labelledby="voucherdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
Voucher Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">
&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Voucher Details Goes Here
</div>
<div class="modal-footer">
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">
Revarsal Entry</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">
Close</button>
</div>
</div>
</div>
</div>
<script>
function showDetails(id) {
$.ajax({
url: "<?php echo site_url("accounts/vouchers/voucherdetails/"); ?>" + id,
success: function(data) {
$("#details_container").html(data);
$("#reversalBtn").data("id",id);
$("#voucherdetails_box").modal('show');
}
});
}
function reversalEntry()
{
var id=$("#reversalBtn").data("id");
if(confirm("Are you sure you want to post reversal for this voucher?"))
{
window.location="<?php echo site_url("accounts/vouchers/reversal/"); ?>"+id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
var table = $('#voucherList').DataTable();
var tableRows = $('table#voucherList tbody').find('tr');
tableRows.each(function() {
async: false;
var jqueryRow = $(this);
var row = table.row(jqueryRow);
var id=$(this).data("id");
var Transactions="<table class='table table-resonsive'><tr><th>Account<\/th><th>Narration<\/th><th>Dr<\/th><th>Cr<\/th><\/tr><tr><td>Billable Projects<\/td><td>Website Development<\/td><td>50000<\/td><td>0<\/td><\/tr><tr><td>Larke Himal Jadibuti Udhyog<\/td><td>Website Development<\/td><td>0<\/td><td>50000<\/td><\/tr><\/table>";
Transactions=getVoucherDetails(id);
row.child(Transactions).show();
});
});
function getVoucherDetails(id) {
$.data;
$.ajax({
url: "<?php echo site_url("ajax/getVoucherDetailsTable/"); ?>" + id,
async: false,
success: function(data) {
$.data=data;
}
});
return ($.data);
}
</script>
<?php
}
?>

View File

@@ -0,0 +1,53 @@
<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; ?> </h5>
</div>
<div class="card-body">
<form method="GET" action="">
<div class="row">
<div class="col">
<label for="vouchertypes">Voucher Type</label>
<select name="vouchertypes" id="vouchertypes" class="form-control">
<option value="">Choose Voucher Type</option>
<?php foreach ($VoucherTypes as $VoucherType) { ?>
<option value="<?php echo $VoucherType->vouchertype_id; ?>" <?php echo (isset($_GET['vouchertypes'])) ? (($VoucherType->vouchertype_id == $_GET['vouchertypes']) ? "SELECTED" : "") : "" ?>><?php echo $VoucherType->voucher_type; ?></option>
<?php }; ?>
</select>
</div>
<!-- <div class="col"><?php $this->myaccounts->showAccountsCombo("account_id", "Account", "account_id", "status=1", isset($_GET['account_id']) ? $_GET['account_id'] : ''); //fillComboWithValue("account_id","Account","account_id","tbl_accounts","account_name","account_id",isset($_GET['account_id'])?$_GET['account_id']:'');
?></div> -->
<div class="col-2"><?php createNepaliDateInput("from_date", "From Date", "from_date", isset($fromDate_bs) ? $fromDate_bs : FYStart()); ?></div>
<div class="col-2"><?php createNepaliDateInput("to_date", "To Date", "to_date", isset($toDate_bs) ? $toDate_bs : FYEnd()); ?></div>
<div class="col-1"><?php createButton("show_voucher", "Show", "show_voucher", "Submit", "mt-30"); ?></div>
<div class="col-1"><?php createButton("show_voucher_reset", "Reset", "reset", site_url("accounts/vouchers/listvouchers"), "mt-30"); ?></div>
</div>
</form>
<div id="dataTable_Commands"></div>
<?php
$fromDate = isset($_GET['from_date']) ? NepaliToEnglishDate($_GET['from_date']) : NepaliToEnglishDate(firstDayOfNepaliMonth());
$toDate = isset($_GET['to_date']) ? NepaliToEnglishDate($_GET['to_date']) : Today();
// echo $toDate;
$account_id = isset($_GET['account_id']) ? $_GET['account_id'] : '';
$vouchertype_id = isset($_GET['vouchertypes']) ? $_GET['vouchertypes'] : '';
$this->myaccounts->listVouchers($fromDate, $toDate, $account_id, $vouchertype_id, true);
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,237 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a></li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
Create <?php echo $pageTitle; ?> </h5>
</div>
<div class="card-body">
<?php if($VoucherType->voucher_options==""): ?>
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<div class="col-3">
<fieldset>
<legend>Transaction Date</legend><input type="text" class="form-control nepaliDatePicker" id="voucher_date" value="<?php echo NepaliDate(); ?>" name="voucher_date">
</fieldset>
</div>
<div class="col-3">
<fieldset>
<?php $DefaultAccount=$this->myaccounts->getAccountDetails($VoucherType->default_account);?>
<legend><?php echo $DefaultAccount->account_name; ?> Balance</legend><?php echo myCurrency($DefaultAccount->Balance); ?>
</fieldset>
</div>
<div class="col-3 offset-3">
<fieldset>
<legend>Voucher #</legend><input type="text" readonly class="form-control" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset>
<legend>Enter Transaction</legend>
<table id="EntryTable" class="table order-list">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
<td></td>
</tr>
</thead>
<tbody>
<tr>
<td class="col-3">
<?php fillComboWithValue("account_id", "", "account_id", "tbl_accounts", "account_name", "account_id", "", "", "", "status=1"); ?> </td>
<td class="col-4">
<input type="text" name="narration" id="narration" class="form-control" /> </td>
<td class="col-1">
<input type="text" name="debit" id="debit" value="0" class="form-control" /> </td>
<td class="col-1">
<input type="button" class="btn btn-primary full-width" id="addrow" value="Add" /> </td>
</tr>
</tbody>
</table>
<div id="errorBox" class="alert alert-secondary hidden" role="alert">
<h5></h5>
</div>
</fieldset>
<div class="card card-primary card-outline">
<div class="card-header">
Transaction List </div>
<div class="card-body">
<table id="myTable" class=" table order-list table-striped table-bordered">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
</tr>
</thead>
<tbody> </tbody>
<tfoot>
<tr>
<th colspan="2" class="text-right">
Total</th>
<td>
<div id="debitTotal">
</div>
</td>
<td>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group">
<label for="remarks">
Remarks</label> <textarea class="form-control" id="remarks" name="remarks">
</textarea> </div>
</div>
<!--COL END-->
</div> <button class="btn btn-primary" type="submit" id="saveButton" name="submit">
Save Voucher</button>
</form>
<?php else: ?>
<?php echo $VoucherType->voucher_options; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var counter = 0;
$("#addrow").on("click", function() {
var msg = "Transaction Row Added !!";
if ($("#account_id").val() != "") {
if (!isAccountAdded($("#account_id").val())) {
if ($("#narration").val() != "") {
var debit = ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0);
if ($.isNumeric(debit)) {
if (debit > 0) {
addRow()
} else {
msg = "Amount contain some value";
}
} else {
msg = "Non numberic value entered in amount. ";
}
} else {
msg = "Narration can't be empty!";
}
} else {
msg = "Account already added in transactions";
}
} else {
msg = "Account Head Not Selected!";
}
$("#errorBox h5").html(msg);
$("#errorBox").fadeTo(2000, 500).slideUp(500, function() {
$("#errorBox").slideUp(500);
});
});
$("table.order-list").on("click", ".ibtnDel", function(event) {
$(this).closest("tr").remove();
calculateTotals();
});
});
function isAccountAdded(account_id) {
var arr = $('input[name="account_id[]"]').map(function() {
return this.value;
}).get();
if ($.inArray(account_id, arr) >= 0) return true;
else return false;
}
function addRow() {
var newRow = $("<tr>");
var cols = "";
cols += '<td><input type="hidden" class="form-control" name="account_ids[]" value="' + $("#account_id").val() + '"/><input type="text" readonly class="form-control" name="account_name[]" value="' + $("#account_id option:selected").text() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="narration[]" value="' + $("#narration").val() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="debit[]" value="' + ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0) + '"/></td>';
cols += '<td><input type="button" class="ibtnDel btn btn-md btn-danger " value="Delete"></td>';
newRow.append(cols);
$("#myTable.order-list").append(newRow);
calculateTotals();
}
function calculateTotals() {
var debitTotal = 0;
var creditTotal = 0;
var balance = 0;
$("table.order-list").find('input[name^="debit[]"]').each(function() {
debitTotal += +$(this).val();
});
$("#debit").val(0);
$("#narration").val("");
$("#debitTotal").text(debitTotal.toFixed(2));
$("#balance").text(balance.toFixed(2));
$("#saveButton").prop("disabled", false);
}
$("#saveButton").prop("disabled", true);
</script>

View File

@@ -0,0 +1,190 @@
<div class="content-wrapper">
<div class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1 class="m-0">
<?php echo $pageTitle; ?></h1>
</div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item">
<a href="<?php echo base_url(); ?>">
Dashboard</a></li>
<li class="breadcrumb-item active">
<?php echo $pageTitle; ?></li>
</ol>
</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="m-0">
<?php echo $pageTitle; ?> <a href="<?php echo site_url("accounts/vouchers/".$VoucherType->voucher_alias."/create"); ?>" class="btn btn-sm btn-primary float-right">
Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $Vouchers ?>
<table class="table table-bordered table-striped" id="voucherList">
<thead>
<tr>
<th>ID#</th>
<th>Voucher No</th>
<th>Voucher Date</th>
<th>Voucher Type</th>
<th>Voucher State</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 data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo($TableRow->voucher_state=="Reversed")?"table-danger":""; ?>">
<td><?php echo $TableRow->voucher_id; ?></td>
<td><?php echo $TableRow->voucher_no; ?></td>
<td><?php echo $TableRow->voucher_date; ?></td>
<td><?php echo $TableRow->voucher_type; ?></td>
<td><?php echo $TableRow->voucher_state; ?></td>
<td class="col-1">
<a onClick="javascript:showDetails(<?php echo $id; ?>);" class="btn btn-success btn-xs" title="View Details">
<i class="fa fa-eye">
</i></a>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<div class="modal fade" id="voucherdetails_box" tabindex="-1" role="dialog" aria-labelledby="voucherdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
Voucher Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">
&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Voucher Details Goes Here
</div>
<div class="modal-footer">
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">
Revarsal Entry</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">
Close</button>
</div>
</div>
</div>
</div>
<script>
function showDetails(id) {
$.ajax({
url: "<?php echo site_url("accounts/vouchers/voucherdetails/"); ?>" + id,
success: function(data) {
$("#details_container").html(data);
$("#reversalBtn").data("id",id);
$("#voucherdetails_box").modal('show');
}
});
}
function reversalEntry()
{
var id=$("#reversalBtn").data("id");
if(confirm("Are you sure you want to post reversal for this voucher?"))
{
window.location="<?php echo site_url("accounts/vouchers/reversal/"); ?>"+id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
var table = $('#voucherList').DataTable();
var tableRows = $('table#voucherList tbody').find('tr');
tableRows.each(function() {
async: false;
var jqueryRow = $(this);
var row = table.row(jqueryRow);
var id=$(this).data("id");
var Transactions="<table class='table table-resonsive'><tr><th>Account<\/th><th>Narration<\/th><th>Dr<\/th><th>Cr<\/th><\/tr><tr><td>Billable Projects<\/td><td>Website Development<\/td><td>50000<\/td><td>0<\/td><\/tr><tr><td>Larke Himal Jadibuti Udhyog<\/td><td>Website Development<\/td><td>0<\/td><td>50000<\/td><\/tr><\/table>";
Transactions=getVoucherDetails(id);
row.child(Transactions).show();
});
});
function getVoucherDetails(id) {
$.data;
$.ajax({
url: "<?php echo site_url("ajax/getVoucherDetailsTable/"); ?>" + id,
async: false,
success: function(data) {
$.data=data;
}
});
return ($.data);
}
</script>
<?php
}
?>

View File

@@ -0,0 +1,12 @@
<div class="content-wrapper">
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col">
<?php $this->myaccounts->showvoucher($voucher_id); ?>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,177 @@
<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; ?> </h5>
</div>
<div class="card-body">
<?php if($VoucherType->voucher_options==""): ?>
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
<div class="row">
<div class="col-3">
<fieldset>
<legend>Transaction Date</legend><input type="text" class="form-control nepaliDatePicker" id="voucher_date" value="<?php echo NepaliDate(); ?>" name="voucher_date">
</fieldset>
</div>
<div class="col-3">
<fieldset>
<?php $DefaultAccount=$this->myaccounts->getAccountDetails($VoucherType->default_account);?>
<legend><?php echo $DefaultAccount->account_name; ?> Balance</legend><?php echo myCurrency($DefaultAccount->Balance); ?>
</fieldset>
</div>
<div class="col-3 offset-3">
<fieldset>
<legend>Voucher #</legend><input type="text" readonly class="form-control" id="voucher_no" value="<?php echo generateVoucherNo(); ?>" name="voucher_no">
</fieldset>
</div>
</div>
<div class="row">
<div class="col">
<fieldset>
<legend>Enter Transaction</legend>
<table id="EntryTable" class="table order-list">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
<td></td>
</tr>
</thead>
<tbody>
<tr>
<td class="col-3"> <?php fillComboWithValue("account_id", "", "account_id", "tbl_accounts", "account_name", "account_id", "", "", "", "status=1"); ?> </td>
<td class="col-4"> <input type="text" name="narration" id="narration" class="form-control" /> </td>
<td class="col-1"> <input type="text" name="debit" id="debit" value="0" class="form-control" /> </td>
<td class="col-1"> <input type="button" class="btn btn-primary full-width" id="addrow" value="Add" /> </td>
</tr>
</tbody>
</table>
<div id="errorBox" class="alert alert-secondary hidden" role="alert">
<h5></h5>
</div>
</fieldset>
<div class="card card-primary card-outline">
<div class="card-header">Transaction List </div>
<div class="card-body">
<table id="myTable" class=" table order-list table-striped table-bordered">
<thead>
<tr>
<td>Account</td>
<td>Narration</td>
<td>Amount</td>
</tr>
</thead>
<tbody> </tbody>
<tfoot>
<tr>
<th colspan="2" class="text-right">Total</th>
<td>
<div id="debitTotal"></div>
</td>
<td>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<!--COL START-->
<div class="col">
<div class="form-group"> <label for="remarks">Remarks</label> <textarea class="form-control" id="remarks" name="remarks"></textarea> </div>
</div>
<!--COL END-->
</div> <button class="btn btn-primary" type="submit" id="saveButton" name="submit">Save Voucher</button>
</form>
<?php else: ?>
<?php echo $VoucherType->voucher_options; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var counter = 0;
$("#addrow").on("click", function() {
var msg = "Transaction Row Added !!";
if ($("#account_id").val() != "") {
if (!isAccountAdded($("#account_id").val())) {
if ($("#narration").val() != "") {
var debit = ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0);
if ($.isNumeric(debit)) {
if (debit > 0) {
addRow()
} else {
msg = "Amount contain some value";
}
} else {
msg = "Non numberic value entered in amount. ";
}
} else {
msg = "Narration can't be empty!";
}
} else {
msg = "Account already added in transactions";
}
} else {
msg = "Account Head Not Selected!";
}
$("#errorBox h5").html(msg);
$("#errorBox").fadeTo(2000, 500).slideUp(500, function() {
$("#errorBox").slideUp(500);
});
});
$("table.order-list").on("click", ".ibtnDel", function(event) {
$(this).closest("tr").remove();
calculateTotals();
});
});
function isAccountAdded(account_id) {
var arr = $('input[name="account_id[]"]').map(function() {
return this.value;
}).get();
if ($.inArray(account_id, arr) >= 0) return true;
else return false;
}
function addRow() {
var newRow = $("<tr>");
var cols = "";
cols += '<td><input type="hidden" class="form-control" name="account_ids[]" value="' + $("#account_id").val() + '"/><input type="text" readonly class="form-control" name="account_name[]" value="' + $("#account_id option:selected").text() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="narration[]" value="' + $("#narration").val() + '"/></td>';
cols += '<td><input type="text" readonly class="form-control" name="debit[]" value="' + ($.isNumeric($("#debit").val()) ? $("#debit").val() : 0) + '"/></td>';
cols += '<td><input type="button" class="ibtnDel btn btn-md btn-danger " value="Delete"></td>';
newRow.append(cols);
$("#myTable.order-list").append(newRow);
calculateTotals();
}
function calculateTotals() {
var debitTotal = 0;
var creditTotal = 0;
var balance = 0;
$("table.order-list").find('input[name^="debit[]"]').each(function() {
debitTotal += +$(this).val();
});
$("#debit").val(0);
$("#narration").val("");
$("#debitTotal").text(debitTotal.toFixed(2));
$("#balance").text(balance.toFixed(2));
$("#saveButton").prop("disabled", false);
}
$("#saveButton").prop("disabled", true);
</script>

View File

@@ -0,0 +1,137 @@
<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("accounts/vouchers/".$VoucherType->voucher_alias."/create"); ?>" class="btn btn-sm btn-primary float-right">Create New <?php echo $pageTitle; ?></a></h5>
</div>
<div class="card-body">
<?php $TableData = $Vouchers ?>
<table class="table table-bordered table-striped" id="voucherList">
<thead>
<tr>
<th>ID#</th>
<th>Voucher No</th>
<th>Voucher Date</th>
<th>Voucher Type</th>
<th>Voucher State</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 data-id="<?php echo $TableRow->voucher_id; ?>" class="<?php echo($TableRow->voucher_state=="Reversed")?"table-danger":""; ?>">
<td><?php echo $TableRow->voucher_id; ?></td>
<td><?php echo $TableRow->voucher_no; ?></td>
<td><?php echo $TableRow->voucher_date; ?></td>
<td><?php echo $TableRow->voucher_type; ?></td>
<td><?php echo $TableRow->voucher_state; ?></td>
<td class="col-1">
<a onClick="javascript:showDetails(<?php echo $id; ?>);" class="btn btn-success btn-xs" title="View Details"><i class="fa fa-eye"></i></a>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<div class="modal fade" id="voucherdetails_box" tabindex="-1" role="dialog" aria-labelledby="voucherdetails_box" aria-hidden="true">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Voucher Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" id="details_container">
Voucher Details Goes Here
</div>
<div class="modal-footer">
<button type="button" onClick='reversalEntry()' id="reversalBtn" class="btn btn-secondary" data-dismiss="modal" data-id="">Revarsal Entry</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script>
function showDetails(id) {
$.ajax({
url: "<?php echo site_url("accounts/vouchers/voucherdetails/"); ?>" + id,
success: function(data) {
$("#details_container").html(data);
$("#reversalBtn").data("id",id);
$("#voucherdetails_box").modal('show');
}
});
}
function reversalEntry()
{
var id=$("#reversalBtn").data("id");
if(confirm("Are you sure you want to post reversal for this voucher?"))
{
window.location="<?php echo site_url("accounts/vouchers/reversal/"); ?>"+id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
function footerfunctions()
{
?>
<script>
$(document).ready(function() {
var table = $('#voucherList').DataTable();
var tableRows = $('table#voucherList tbody').find('tr');
tableRows.each(function() {
async: false;
var jqueryRow = $(this);
var row = table.row(jqueryRow);
var id=$(this).data("id");
var Transactions="<table class='table table-resonsive'><tr><th>Account<\/th><th>Narration<\/th><th>Dr<\/th><th>Cr<\/th><\/tr><tr><td>Billable Projects<\/td><td>Website Development<\/td><td>50000<\/td><td>0<\/td><\/tr><tr><td>Larke Himal Jadibuti Udhyog<\/td><td>Website Development<\/td><td>0<\/td><td>50000<\/td><\/tr><\/table>";
Transactions=getVoucherDetails(id);
row.child(Transactions).show();
});
});
function getVoucherDetails(id) {
$.data;
$.ajax({
url: "<?php echo site_url("ajax/getVoucherDetailsTable/"); ?>" + id,
async: false,
success: function(data) {
$.data=data;
}
});
return ($.data);
}
</script>
<?php
}
?>

View File

@@ -0,0 +1 @@
<?php $this->myaccounts->showVoucher($Voucher->voucher_id); ?>