bankstatement advance screen
This commit is contained in:
parent
8e9daa9f1c
commit
7a8389fd0a
@ -221,6 +221,7 @@ $route['Distribution'] = "MRIRcontroller/viewmMaterialDistributionList";
|
||||
//<-------------Cashbook page----------------->
|
||||
$route['ViewIncomeExpense'] = "cashbook/incomeExpenseList";
|
||||
$route['EditIncomeExpense'] = "cashbook/editcashbook";
|
||||
$route['AdvanceList']="cashbook/AdvanceList";
|
||||
$route['addNewIncomeExpense'] = "cashbook/addNewIncomeExpenseLoad";
|
||||
$route['addIncomeExpense'] = "cashbook/addIncomeExpense";
|
||||
$route['updateExpense'] = "cashbook/updateExpense";
|
||||
|
||||
@ -648,20 +648,87 @@ class cashbook extends BaseController
|
||||
//advance list
|
||||
public function AdvanceList()
|
||||
{
|
||||
|
||||
|
||||
$this->load->model('cashbook_model');
|
||||
// $data['dropdownvalues1'] = $this->cashbook_model->getAccounTypes1();
|
||||
// print_r($data['dropdownvalues1']);
|
||||
// die();
|
||||
$data['list'] = $this->cashbook_model->Selectadvance();
|
||||
// print_r($data);
|
||||
// die();
|
||||
$this->global['pageTitle'] = 'Siddharth : Advance Listing';
|
||||
|
||||
$this->loadViews("Advancelisting", $this->global, $data, NULL);
|
||||
|
||||
$aid = $this->uri->segment(3);
|
||||
$str = $this->uri->segment(4);
|
||||
if(!empty($aid)){
|
||||
|
||||
if(!empty($str))
|
||||
{
|
||||
//echo "PDF";
|
||||
$data['company'] = $this->cashbook_model->getCompany();
|
||||
|
||||
$data['data'] = $this->cashbook_model->getAdvanceList($aid);
|
||||
//$pic1 = $data['company'][0]->ProfilePic;
|
||||
//echo $pic1;
|
||||
//$pic = base_url().'uploads/images'.$pic1;
|
||||
//echo $pic;
|
||||
//die();
|
||||
$totalamt = $data['data'][0]->total;
|
||||
$data['amtinwords'] = $this->convertNumber($totalamt);
|
||||
$mpdf=new mPDF('utf-8','A4-P',7, 10,10, 10, 3, 0, 0, 0);
|
||||
$mpdf->SetHTMLHeader($HtmlHeading);
|
||||
$html = $this->load->view('cashbookpdf',$data,true);
|
||||
$mpdf->SetDisplayMode('fullpage');
|
||||
$mpdf->setFooter($HTMLFooter . "Page {PAGENO} of {nb}");
|
||||
$mpdf->list_indent_first_level = 1;
|
||||
$mpdf->setAutoTopMargin = 'stretch';
|
||||
$mpdf->setAutoBottomMargin = 'stretch';
|
||||
$mpdf->WriteHTML($html);
|
||||
$filename = "cashbook.pdf";
|
||||
$mpdf->Output($filename,I);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$data['data'] = $this->cashbook_model->getAdvanceList($aid);
|
||||
//print_r($data['dropdownvalues']);die();
|
||||
$this->global['pageTitle'] = 'Siddharth : Cash Book: View Income Expense ';
|
||||
$this->loadViews("viewIndIncomeExpense", $this->global, $data , NULL);
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
// $data['list'] = $this->cashbook_model->getIncomeExpenseList();
|
||||
// $this->global['pageTitle'] = 'Siddharth : Cash Book: Listing';
|
||||
|
||||
}
|
||||
// $this->loadViews("income_expense_list", $this->global, $data , NULL);
|
||||
$this->global['pageTitle'] = 'Siddharth : Cash Book: Listing';
|
||||
|
||||
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->getAdvance($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->getAdvance($preyear,$currentyear);
|
||||
$data['finyear']=$this->cashbook_model->finyear();
|
||||
}
|
||||
$this->loadViews("Advancelist", $this->global, $data , NULL);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function cashbookdtl()
|
||||
@ -1305,10 +1372,11 @@ class cashbook extends BaseController
|
||||
}
|
||||
public function cashbanking()
|
||||
{
|
||||
$this->global['pageTitle'] ='Siddharth :bankcashbook';
|
||||
$data['dropdownvalues'] = $this->cashbook_model->getAccounTypes();
|
||||
//$data['cashbanking'] = $this->cashbook_model->newcashbook();
|
||||
$data['getsupplier'] = $this->cashbook_model->getsupplier();
|
||||
$this->global['pageTitle'] ='Siddharth :bankcashbook';
|
||||
|
||||
$this->loadViews("bankcashnew", $this->global,$data,NULL);
|
||||
|
||||
}
|
||||
|
||||
@ -971,8 +971,8 @@ $RequestedBy = $this->input->post('drpDepartment');
|
||||
|
||||
$CreatedBy = $this->session->userdata('userId');
|
||||
|
||||
|
||||
$igrDetails = array('IGRNO'=>$IGRNO,'MaterialCode'=>$MaterialCode,'QuantityAsPerInvoice'=>$QuantityAsPerInvoice,'Remarks'=>$Remarks,'IGRItemStatus'=>$IGRItemStatus,'CreatedBy'=>$CreatedBy,'CreatedDate'=>$createddt);
|
||||
$bankstatus = NO_PAIDIGR;
|
||||
$igrDetails = array('IGRNO'=>$IGRNO,'MaterialCode'=>$MaterialCode,'QuantityAsPerInvoice'=>$QuantityAsPerInvoice,'Remarks'=>$Remarks,'IGRItemStatus'=>$IGRItemStatus,'CreatedBy'=>$CreatedBy,'CreatedDate'=>$createddt,'BankStatus'=>$bankstatus);
|
||||
|
||||
|
||||
//print_r($igrDetails);
|
||||
|
||||
@ -47,6 +47,7 @@ class cashbook_model extends CI_Model
|
||||
$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');
|
||||
$this->db->where('t_income_expense.IsActive',1);
|
||||
$this->db->where('t_income_expense.account_code !=','ADV001');
|
||||
$this->db->order_by("date","desc");
|
||||
if(!empty($i))
|
||||
{
|
||||
@ -56,6 +57,7 @@ class cashbook_model extends CI_Model
|
||||
$r = $this->db->get();
|
||||
return $r->result();
|
||||
}
|
||||
|
||||
function getIncomeExpense($firstyear,$secondyear,$frmdt,$todt)
|
||||
{
|
||||
$this->db->select('t_accountcode.name,cashtype,T_Employee_Details.FirstName,T_Employee_Details.LastName,t_income_expense.*');
|
||||
@ -64,6 +66,53 @@ class cashbook_model extends CI_Model
|
||||
$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');
|
||||
$this->db->where('t_income_expense.IsActive',1);
|
||||
$this->db->where('t_income_expense.account_code !=','ADV001');
|
||||
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 getAdvanceList($i="")
|
||||
{
|
||||
// echo $i;
|
||||
$this->db->select('t_accountcode.name,cashtype,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');
|
||||
$this->db->where('t_income_expense.IsActive',1);
|
||||
$this->db->where('t_income_expense.account_code','ADV001');
|
||||
$this->db->order_by("date","desc");
|
||||
if(!empty($i))
|
||||
{
|
||||
$this->db->where('t_income_expense.id',$i);
|
||||
|
||||
}
|
||||
$r = $this->db->get();
|
||||
return $r->result();
|
||||
}
|
||||
|
||||
function getAdvance($firstyear,$secondyear,$frmdt,$todt)
|
||||
{
|
||||
$this->db->select('t_accountcode.name,cashtype,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');
|
||||
$this->db->where('t_income_expense.IsActive',1);
|
||||
$this->db->where('t_income_expense.account_code','ADV001');
|
||||
if ($firstyear and $secondyear != ''){
|
||||
$finyear = "t_income_expense.date >= '".$firstyear."-04-01' and t_income_expense.date <= '".$secondyear."-03-31'";
|
||||
$this->db->where($finyear);
|
||||
|
||||
314
application/views/Advancelist.php
Normal file
314
application/views/Advancelist.php
Normal file
@ -0,0 +1,314 @@
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
|
||||
|
||||
<style>
|
||||
.dataTables_filter input {padding: 4px;}
|
||||
.dataTables_filter {
|
||||
width: 50%;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
.dataTables_paginate {
|
||||
width: 50%;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
div.dt-buttons {
|
||||
position: relative;
|
||||
float: right;
|
||||
|
||||
}
|
||||
.btn-success {
|
||||
background-color: #3c8dbc;
|
||||
border-color: #3c8dbc;
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
//print_r($list);
|
||||
// ?>
|
||||
<!-- <CENTER><strong><h3 class="box-title">Siddharth Industries - Receipt and Payment List</h3></strong></CENTER> -->
|
||||
<div class="content-wrapper">
|
||||
|
||||
|
||||
<section class="content">
|
||||
|
||||
<div class="box">
|
||||
|
||||
<div class="box-header">
|
||||
|
||||
<CENTER><strong><h3 class="box-title">Siddharth Industries - Advance List</h3></strong></CENTER>
|
||||
|
||||
<div align="right" style="padding-right:10px">
|
||||
<a href="addNewIncomeExpense" class="btn btn-primary" align="right"style="padding-right:10px" >Add New</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<!-- <form role="form" id="Datewisecashbookreport" action="<?php echo base_url() ?>Datewisecashbookreport" enctype="multipart/form-data" method="post"> -->
|
||||
<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">
|
||||
|
||||
<thead style="background-color:#ddf">
|
||||
<tr>
|
||||
<th>Account Type</th>
|
||||
<th>DATE</th>
|
||||
<th>Account Name</th>
|
||||
<th>Cash Type</th>
|
||||
<th>Amount</th>
|
||||
<th>Details</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="inexlistbody">
|
||||
|
||||
<?php if(!empty($list))
|
||||
{
|
||||
$base = base_url();
|
||||
foreach($list as $l)
|
||||
{
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo '<a href="'.$base.'cashbook/incomeExpenseList/'.$l->id.'">'.$l->type.'</a>';?></td>
|
||||
<td style="text-align:right;"><?php echo date_format(date_create($l->date),'d-m-Y');?></td>
|
||||
<td><?php echo $l->name;?></td>
|
||||
<td><?php echo $l->cashtype;?></td>
|
||||
<td style="text-align:right;"><?php echo $l->total;?></td>
|
||||
<td><?php echo $l->description;?></td>
|
||||
<td>
|
||||
<a href="<?php echo base_url(); ?>cashbook/editcashbook?sid=<?php echo $l->id;?>"><i class="fa fa-pencil" data-toggle="tooltip" data-placement="left" title="Click here to view/Edit the ".<?php echo $l->type; ?>." Details "></i> </a>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div> </section>
|
||||
</div>
|
||||
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||
<script>
|
||||
|
||||
|
||||
// Bootstrap datepicker
|
||||
// Set up your table
|
||||
$(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,
|
||||
|
||||
|
||||
|
||||
"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'
|
||||
]
|
||||
|
||||
} );
|
||||
} );
|
||||
|
||||
|
||||
// jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
// "date-uk-pre": function ( a ) {
|
||||
// var ukDatea = a.split('-');
|
||||
// return (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1;
|
||||
// },
|
||||
|
||||
// "date-uk-asc": function ( a, b ) {
|
||||
// return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
// },
|
||||
|
||||
// "date-uk-desc": function ( a, b ) {
|
||||
// return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
// }
|
||||
// } );
|
||||
|
||||
// $('#mySelect').on('change',function(){
|
||||
|
||||
// table
|
||||
// .column(4)
|
||||
// .search(this.value)
|
||||
// .draw();
|
||||
// });
|
||||
|
||||
$( function() {
|
||||
//var dateFormat = "mm/dd/yy",
|
||||
from = $( "#min-date" )
|
||||
.datepicker({
|
||||
dateFormat: "dd-mm-yy",
|
||||
defaultDate: "+0d",
|
||||
changeMonth: true,
|
||||
//numberOfMonths: 1
|
||||
|
||||
})
|
||||
.on( "change", function() {
|
||||
to.datepicker("option", "minDate", getDate( this ) );
|
||||
}),
|
||||
to = $( "#max-date" ).datepicker({
|
||||
dateFormat: "dd-mm-yy",
|
||||
defaultDate: "+0d",
|
||||
changeMonth: true,
|
||||
//numberOfMonths: 1
|
||||
|
||||
})
|
||||
.on( "change", function() {
|
||||
from.datepicker( "option", "maxDate", getDate( this ) );
|
||||
});
|
||||
|
||||
} );
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script>
|
||||
<script>
|
||||
|
||||
$(function () {
|
||||
|
||||
|
||||
// $('#inexlist').DataTable({
|
||||
// "paging": true,
|
||||
// "lengthChange": true,
|
||||
// "searching": true,
|
||||
// "aaSorting": [[ 0, "desc" ]],
|
||||
// "ordering": true,
|
||||
//
|
||||
// "info": true,
|
||||
// "autoWidth": true
|
||||
|
||||
// });
|
||||
from = $( "#min-date" )
|
||||
.datepicker({
|
||||
dateFormat: "dd-mm-yy",
|
||||
defaultDate: "+0d",
|
||||
changeMonth: true,
|
||||
//numberOfMonths: 1
|
||||
|
||||
})
|
||||
.on( "change", function() {
|
||||
to.datepicker("option", "minDate", getDate( this ) );
|
||||
}),
|
||||
to = $( "#max-date" ).datepicker({
|
||||
dateFormat: "dd-mm-yy",
|
||||
defaultDate: "+0d",
|
||||
changeMonth: true,
|
||||
//numberOfMonths: 1
|
||||
|
||||
})
|
||||
.on( "change", function() {
|
||||
from.datepicker( "option", "maxDate", getDate( this ) );
|
||||
});
|
||||
});
|
||||
</script>
|
||||
-->
|
||||
@ -1408,7 +1408,7 @@ else{
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<a href="<?php echo base_url(); ?>cashbook/AdvanceList">
|
||||
<a href="<?php echo base_url(); ?>AdvanceList">
|
||||
<i class="fa fa-vcard"></i> <span>Advance</span>
|
||||
</a>
|
||||
</li>
|
||||
@ -1509,7 +1509,7 @@ else{
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<a href="<?php echo base_url(); ?>cashbook/AdvanceList">
|
||||
<a href="<?php echo base_url(); ?>AdvanceList">
|
||||
<i class="fa fa-vcard"></i> <span>Advance</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user