cashbook changes
This commit is contained in:
parent
91b0152ffc
commit
5ad352e1c4
@ -69,9 +69,36 @@ class cashbook extends BaseController
|
||||
}
|
||||
else{
|
||||
//$data['list'] = $this->cashbook_model->getIncomeExpenseList();
|
||||
$data['list'] = $this->cashbook_model->getreceiptpaymentlist();
|
||||
//$data['list'] = $this->cashbook_model->getreceiptpaymentlist();
|
||||
//$this->global['pageTitle'] = 'Resico : Cash Book: Listing';
|
||||
$this->global['pageTitle'] = $this->CompanyName.': Receipt and Payment Details';
|
||||
if ($this->input->post('btn_submit')) {
|
||||
|
||||
$fromdt = $this->input->post('from_date');
|
||||
$todt = $this->input->post('to_date');
|
||||
$ab=$this->input->post('financialyear');
|
||||
|
||||
$fromyear=substr($ab,0,-5);
|
||||
$toyear=substr($ab,5,5);
|
||||
|
||||
|
||||
$data['finyear']=$this->cashbook_model->finyear();
|
||||
$data['list'] = $this->cashbook_model->getIncomeExpense($fromyear,$toyear,$fromdt,$todt);
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
if (date('m') <= 3) {
|
||||
$preyear = (date('Y')-1);
|
||||
$currentyear = date('Y');
|
||||
} else {
|
||||
$preyear = date('Y') ;
|
||||
$currentyear = (date('Y') + 1);
|
||||
}
|
||||
|
||||
$data['list'] = $this->cashbook_model->getIncomeExpense($preyear,$currentyear);
|
||||
$data['finyear']=$this->cashbook_model->finyear();
|
||||
}
|
||||
$this->loadViews("income_expense_list", $this->global, $data , NULL);
|
||||
}
|
||||
|
||||
|
||||
@ -1062,7 +1062,7 @@ class purchaseorder extends BaseController
|
||||
$SupplierID = $this->input->post('drpSupplier');
|
||||
|
||||
$newsup=$this->input->post('newsup');
|
||||
$newSupId = split("[ - ]+", $newsup);
|
||||
$newSupId = preg_split("[ - ]", $newsup);
|
||||
|
||||
$DeliveryAddr = $this->input->post('txtDeliveryAddress');
|
||||
$dt = $this->input->post('Deliverydt');
|
||||
@ -1142,7 +1142,6 @@ class purchaseorder extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for($i = 1; $i <= $RowCount; $i++)
|
||||
{
|
||||
|
||||
|
||||
@ -71,8 +71,44 @@ class cashbook_model extends CI_Model
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
function getIncomeExpense($firstyear,$secondyear,$frmdt,$todt)
|
||||
{
|
||||
$this->db->select('t_accountcode.name,T_Employee_Details.FirstName,T_Employee_Details.LastName,t_income_expense.*');
|
||||
$this->db->from('t_income_expense');
|
||||
$this->db->join('t_accountcode','t_income_expense.account_code=t_accountcode.code','left');
|
||||
$this->db->join('tbl_users','t_income_expense.Created_By=tbl_users.userId','left');
|
||||
$this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID','left');
|
||||
|
||||
if ($firstyear and $secondyear != ''){
|
||||
$finyear = "t_income_expense.date >= '".$firstyear."-04-01' and t_income_expense.date <= '".$secondyear."-03-31'";
|
||||
$this->db->where($finyear);
|
||||
}
|
||||
if ($frmdt and $todt != ''){
|
||||
$fromdate= date("Y-m-d",strtotime($frmdt));
|
||||
$todate=date("Y-m-d",strtotime($todt));
|
||||
$date = "date(t_income_expense.date) >= '".$fromdate."'
|
||||
and date(t_income_expense.date) <= '".$todate."'";
|
||||
$this->db->where($date);
|
||||
}
|
||||
$this->db->order_by("date","desc");
|
||||
$r = $this->db->get();
|
||||
return $r->result();
|
||||
}
|
||||
|
||||
function finyear(){
|
||||
|
||||
|
||||
$sql="SELECT
|
||||
CASE WHEN MONTH(date)>=4 THEN
|
||||
concat(YEAR(date), '-',YEAR(date)+1)
|
||||
ELSE concat(YEAR(date)-1,'-', YEAR(date)) END AS financial_year
|
||||
FROM t_income_expense
|
||||
GROUP BY financial_year";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
|
||||
function getCompany()
|
||||
{
|
||||
|
||||
@ -1,23 +1,86 @@
|
||||
<?php//print_r($list); ?>
|
||||
|
||||
<div class="content-wrapper" style="min-height: 537px;">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<!-- <center> Resico Industries - Receipt and Payment List </center> -->
|
||||
<center><?php echo $PageTitle; ?></center>
|
||||
</h1>
|
||||
</section>
|
||||
<div class="content-wrapper">
|
||||
|
||||
|
||||
<section class="content">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<div align="right" style="padding-right:10px">
|
||||
<a href="<?php echo base_url(); ?>cashbook/addNewIncomeExpenseLoad" class="btn btn-primary" align="right"style="padding-right:10px" >Add New</a>
|
||||
<!-- <a href="<?php echo base_url(); ?>addNewIncomeExpenseLoad" class="btn btn-primary" align="right"style="padding-right:10px" >Add New</a> -->
|
||||
</div>
|
||||
</div>
|
||||
<table id="inexlist" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||
<section class="content">
|
||||
|
||||
<div class="box">
|
||||
|
||||
<div class="box-header">
|
||||
<center><strong><h3 class="box-title"><?php echo $pageTitle; ?></h3></strong></center>
|
||||
<div align="right" style="padding-right:10px">
|
||||
<a href="<?php echo base_url(); ?>cashbook/addNewIncomeExpenseLoad" class="btn btn-primary" align="right"style="padding-right:10px" >Add New</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-3">
|
||||
<b><label for="From Date">From Date:</label></b>
|
||||
<div class="input-group">
|
||||
<input name="from_date" id="max-date" class="form-control datepicker">
|
||||
<span class="input-group-addon">
|
||||
<i class="fa fa-calendar fa-fw"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<b><label for="To Date">To Date:</label></b>
|
||||
<div class="input-group">
|
||||
<input name="to_date" id="min-date" class="form-control datepicker">
|
||||
<span class="input-group-addon">
|
||||
<i class="fa fa-calendar fa-fw"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
|
||||
<b><label for="year">Year:</label></b>
|
||||
|
||||
<select class="form-control" id="financialyear" name="financialyear">
|
||||
<option value="">Select Year</option>
|
||||
<?php
|
||||
foreach($finyear as $item):
|
||||
|
||||
{?>
|
||||
|
||||
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
|
||||
|
||||
|
||||
<?php } endforeach; ?>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<div style="padding-right:10px;padding-top: 20px;" align="right">
|
||||
|
||||
|
||||
<input type="submit" class="btn btn-success" name="btn_submit" value="View Report">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<table id="inexlist" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||
<div align="right" style="padding-right:10px">
|
||||
<div id="content" > </div>
|
||||
<div class="modal fade" role="dialog">
|
||||
@ -112,21 +175,56 @@
|
||||
|
||||
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
$.fn.dataTable.moment( 'DD-MM-YYYY' );
|
||||
$('#inexlist').DataTable({
|
||||
$(document).ready(function() {
|
||||
$.fn.dataTable.moment( 'DD-MM-YYYY' );
|
||||
table = $('#inexlist').DataTable( {
|
||||
|
||||
"aaSorting": [[ 1, "desc" ]],
|
||||
"autoWidth": false,
|
||||
//"columnDefs" : [{"targets":1, "type":"date-eu"}],
|
||||
orderCellsTop: true,
|
||||
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": true,
|
||||
"aaSorting": [[ 1, "desc" ]],
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": true
|
||||
|
||||
|
||||
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
||||
"<'row'<'col-md-6'><'col-md-6'>>" +
|
||||
"<'row'<'col-md-12't>><'row'<'col-md-2'i><'col-md-10'p>>",
|
||||
buttons: [
|
||||
|
||||
// {
|
||||
// extend: 'excelHtml5',
|
||||
// footer: 'true',
|
||||
|
||||
// messageTop: 'Cashbook Report',
|
||||
// title: $('h3').text(),
|
||||
// exportOptions: {
|
||||
// columns: ':visible'
|
||||
|
||||
// }
|
||||
// },
|
||||
|
||||
// 'colvis'
|
||||
]
|
||||
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
// $(function () {
|
||||
|
||||
// $.fn.dataTable.moment( 'DD-MM-YYYY' );
|
||||
// $('#inexlist').DataTable({
|
||||
|
||||
// "paging": true,
|
||||
// "lengthChange": true,
|
||||
// "searching": true,
|
||||
// "aaSorting": [[ 1, "desc" ]],
|
||||
// "ordering": true,
|
||||
// "info": true,
|
||||
// "autoWidth": true
|
||||
|
||||
});
|
||||
});
|
||||
// });
|
||||
// });
|
||||
|
||||
function inex(input){
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user