bankreport
This commit is contained in:
parent
5c9f7d5e3e
commit
3a820ca3b1
@ -514,6 +514,7 @@ class cashbook extends BaseController
|
||||
|
||||
$cashbookdatas = array('type'=>$acc_type,'code'=>$acc_code,'name'=>$acc_name,'accountname'=>$acc_pname,'categories'=>$acc_categories,'description'=>$acc_desc,'status'=>$acc_status,'created_on'=>$acc_createddt);
|
||||
// print_r($cashbookdatas);
|
||||
|
||||
$result = $this->cashbook_model->Cashbook($cashbookdatas);
|
||||
}
|
||||
}
|
||||
@ -544,6 +545,7 @@ class cashbook extends BaseController
|
||||
$this->load->model('cashbook_model');
|
||||
|
||||
$data['DepDetails'] = $this->cashbook_model->viewdepartment($cash);
|
||||
|
||||
//$data['deletefile'] = $this->cashbook-model->deletefile($cash);
|
||||
$data['dropdownvalues'] = $this->cashbook_model->getAccounTypes();
|
||||
//print_r( $data['DepDetails']);die();
|
||||
@ -603,6 +605,9 @@ class cashbook extends BaseController
|
||||
$description1 = $this->input->post('description');
|
||||
$deleteflag = $this->input->post('deleteflag');
|
||||
$oldfile = $this->input->post('oldfile');
|
||||
$amounttype = $this->input->post('amounttype');
|
||||
$bankid=$this->input->post('bankid');
|
||||
$normalid=$this->input->post('normalid');
|
||||
$document =null;
|
||||
|
||||
//$document1=$this->input->post('myfile');
|
||||
@ -632,9 +637,48 @@ class cashbook extends BaseController
|
||||
$document = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$updateaccount = array('type'=>$option,'account_code'=>$accountcode1,'date'=>$date,'towhom'=>$towhome1,'invoice_no'=>$Invoiceno1,'merchant'=>$merchant1,'merchant_gst'=>$Merchantgst1,'HSN'=>$hsn1,'value_before_gst'=>$valuebeforegST1,'sgst'=>$SGST1,'cgst'=>$CGST1,'igst'=>$IGST1,'total'=>$totalamount1,'description'=>$description1,'document'=>$document);
|
||||
$res = $this->cashbook_model->updatedepartment($updateaccount,$id1);
|
||||
//print_r($updateaccount);die();
|
||||
$res = $this->cashbook_model->updatedepartment($updateaccount,$id1);
|
||||
$cashbookamount=$this->cashbook_model->cashbookamount($bankid);
|
||||
$invoiceamount=$this->cashbook_model->invoiceamonut($bankid);
|
||||
$poamount=$this->cashbook_model->poamonut($bankid);
|
||||
foreach($invoiceamount as $ia)
|
||||
{
|
||||
$invam=$ia->amountreceived;
|
||||
}
|
||||
foreach($poamount as $pa)
|
||||
{
|
||||
$poamnt=$pa->amountpaid;
|
||||
}
|
||||
foreach($cashbookamount as $ca)
|
||||
{
|
||||
$cashamnt=$ca->total;
|
||||
}
|
||||
|
||||
//print_r($invoiceamount);
|
||||
if($amounttype=='CREDIT')
|
||||
{
|
||||
$updatecredit=$invam+$cashamnt;
|
||||
//print_r($updateamount);
|
||||
$cashbookstatus1= array('cclearbalance'=>$updatecredit,'cstatus'=>$statu);
|
||||
//print_r($cashbookstatus1);
|
||||
//die();
|
||||
$res1 = $this->cashbook_model->cashcreditupdate($cashbookstatus1,$bankid);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$updatedepit=$poamnt+$cashamnt;
|
||||
$cashbookstatus = array('Clearbalance'=>$updatedepit,'Status'=>$stat);
|
||||
print_r($cashbookstatus);
|
||||
//die();
|
||||
$res = $this->cashbook_model->cashbankupdate($cashbookstatus,$bankid);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//if( $res == 1 ){
|
||||
echo "<script>alert('Saved Successfully!');window.location.href='ViewIncomeExpense';</script>";
|
||||
|
||||
@ -87,8 +87,9 @@ class cashbook_model extends CI_Model
|
||||
}
|
||||
function viewdepartment($sid='')
|
||||
{
|
||||
$sql="SELECT ie.*,ac.name,date_format(ie.date,'%d-%m-%Y')as date FROM t_income_expense ie
|
||||
$sql="SELECT ie.*,br.ID,ac.name,ie.id,date_format(ie.date,'%d-%m-%Y')as date FROM t_income_expense ie
|
||||
join t_accountcode ac on ac.code=ie.account_code
|
||||
join T_bankreport br on br.ID=ie.bankid
|
||||
WHERE ie.id = ?";
|
||||
$query = $this->db->query($sql,array($sid));
|
||||
//print_r($this->db->last_query());
|
||||
@ -234,8 +235,39 @@ function debitpolist($bankid)
|
||||
balancetoreceived,amountreceived');
|
||||
$this->db->from ('T_Bankinvoicereport');
|
||||
$this->db->where('bankid',$bankid);
|
||||
|
||||
$this->db->group_by('invoiceno');
|
||||
$this->db->group_by('invoiceno');
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
//for cashbook edit screen and update bankreport//
|
||||
function invoiceamonut($bankid)
|
||||
{
|
||||
$this->db->select('sum(amountreceived)as amountreceived');
|
||||
$this->db->from ('T_Bankinvoicereport');
|
||||
$this->db->where('bankid',$bankid);
|
||||
//$this->db->group_by('invoiceno');
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
//for cashbook edit screen and update bankreport//
|
||||
function poamonut($bankid)
|
||||
{
|
||||
$this->db->select('sum(Amountpaid)as amountpaid');
|
||||
$this->db->from ('T_Bankporeport');
|
||||
$this->db->where('mid',$bankid);
|
||||
//$this->db->group_by('invoiceno');
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
function cashbookamount($bankid)
|
||||
{
|
||||
$this->db->select('sum(total)as total');
|
||||
$this->db->from ('t_income_expense');
|
||||
$this->db->where('bankid',$bankid);
|
||||
//$this->db->group_by('invoiceno');
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
|
||||
@ -15,9 +15,13 @@ $(function() {
|
||||
{
|
||||
$("#accode").append( $('<option></option>').val(item.code).html(item.name));
|
||||
}
|
||||
else(item.type == 'PAYMENT')
|
||||
{
|
||||
$("#accode").append( $('<option></option>').val(item.code).html(item.name));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$('#gst').click(function(){
|
||||
$('#gstarea').toggle();
|
||||
@ -65,7 +69,7 @@ function isNumberKey(evt)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//$(document).ready(function(id)
|
||||
function loadAccountType(id)
|
||||
{
|
||||
//alert('called'+id);
|
||||
@ -337,6 +341,11 @@ if(!empty($cashbanking))
|
||||
<textarea class="form-control" id="description" name="description" >
|
||||
</textarea>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<b><span for="Description">File Upload:</span></b>
|
||||
<img id="slip" alt="your image" style="width: 139px;"/><br/>
|
||||
<input type='file' input accept=".JPG,.PNG" onchange="readURL(this);" id="file" name="myfile" accept="image/*"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -387,7 +396,18 @@ if(!empty($cashbanking))
|
||||
|
||||
</div>
|
||||
<script>
|
||||
|
||||
// $(document).ready(function() {
|
||||
// var amounttype=$('#type').val();
|
||||
// alert(amounttype);
|
||||
// if (amounttype=='DEBIT')
|
||||
// {
|
||||
// $('#towhom').text('Paid To:');
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $('#towhom').text('Received From:');
|
||||
// }
|
||||
// } );
|
||||
function validate()
|
||||
{
|
||||
var accode = $('#accode').val();
|
||||
@ -492,15 +512,50 @@ function calculateTotal()
|
||||
|
||||
$('#totalamount').val((total.toFixed(2)));
|
||||
}
|
||||
$(function() {
|
||||
|
||||
var t = [];
|
||||
var ex = [];
|
||||
var inc = [];
|
||||
t= <?php echo json_encode($dropdownvalues)?>;
|
||||
|
||||
$('#myradio1').click(function(){
|
||||
|
||||
$('#towhom').text('Received From:');
|
||||
$('#towhom').ready('Received From:');
|
||||
$.each(t,function(i,item){
|
||||
if(item.type == 'RECEIPT')
|
||||
{
|
||||
$("#accode").append( $('<option></option>').val(item.code).html(item.name));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#myradio2').click(function(){
|
||||
$('#myradio2').ready(function(){
|
||||
|
||||
$('#towhom').text('Paid To:');
|
||||
else(item.type == 'PAYMENT')
|
||||
{
|
||||
$("#accode").append( $('<option></option>').val(item.code).html(item.name));
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
// $(document).ready(function() {
|
||||
// $('#myradio1').click(function(){
|
||||
|
||||
// $('#towhom').text('Received From:');
|
||||
// });
|
||||
|
||||
// $('#myradio2').click(function(){
|
||||
|
||||
// $('#towhom').text('Paid To:');
|
||||
// });
|
||||
// </script>
|
||||
@ -477,7 +477,7 @@ if (x==true)
|
||||
var text = e.options[e.selectedIndex].text;
|
||||
var camount =$('#credit'+i).text();
|
||||
var RowCount= $('#Rowid').val();
|
||||
var id=document.getElementById ("bankid"+value).innerText;
|
||||
var id=document.getElementById ("bankid"+bankid).innerText;
|
||||
var date=document.getElementById ("date"+value).innerText;
|
||||
var debit=document.getElementById ("debit"+value ).innerText;
|
||||
var idvalue = id+'-'+debit;
|
||||
@ -521,8 +521,7 @@ if (x==true)
|
||||
}
|
||||
else if(value=='3' && (type=='0' ||type=='1'))
|
||||
{
|
||||
alert(value+'cash');
|
||||
alert(amounttype);
|
||||
|
||||
if(avalue>0)
|
||||
{
|
||||
$('#content').loader('show');
|
||||
@ -530,7 +529,7 @@ if (x==true)
|
||||
{
|
||||
data:{bankdate:date,bankid:id,type:amounttype,bankamount:avalue,forstatus:avalue,alreadypaid:tpaid,alreadycreditpaid:tcpaid,debitamount:debit1,creditamount:credit1},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>cashbook/cashpayment",
|
||||
url:"<?php echo base_url() ?>Payment",
|
||||
success:function(data)
|
||||
{
|
||||
|
||||
|
||||
@ -30,8 +30,13 @@ if(!empty($DepDetails))
|
||||
$final = base_url().$document;
|
||||
//echo $final;
|
||||
// print_r( $DepDetails);die();
|
||||
$bankid=$ded->ID;
|
||||
$normalid=$ded->id;
|
||||
$accountcode1=$ded->account_code;
|
||||
$id=$ded->id;
|
||||
$amounttype=$ded->amounttype;
|
||||
$alreadypaid=$ded->Clearbalance;
|
||||
$alreadyreceived=$ded->cclearbalance;
|
||||
$type1=$ded->type;
|
||||
$viewdep=$ded->total;
|
||||
$dropdown=$ded->name;
|
||||
@ -390,6 +395,11 @@ function loadAccountType(id)
|
||||
<input type="text" class="form-control" id="totalamount" name="totalamount" onkeypress="return isNumberKey(event)" style="text-align:right;" value="<?php echo $viewdep; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="amounttype" name="amounttype" value="<?php echo $amounttype;?>">
|
||||
<input type="hidden" id="bankid" name="bankid" value="<?php echo $bankid;?>">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@ -1118,6 +1118,16 @@ $(function() {
|
||||
<span>Receipt and Payment</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<span id="menu" data-toggle="dropdown" ><i class="fa fa-money"></i> Banking <span class="caret"></span></span>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="menu3">
|
||||
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Bankingview">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
@ -1130,48 +1140,7 @@ $(function() {
|
||||
<span>Bank Statements</span>
|
||||
</a>
|
||||
</li>
|
||||
<!--<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Debitstatement">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
<span>Amount Paid</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Bankamountpaid">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
<span>Depit Reports</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Receipt">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
<span>Receipt</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Payment">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
<span>Payment</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Invoice">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
<span>Invoice</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Bankamountreceived">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
<span>Credit Reports</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Bankcash">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
<span>addincexp</span>
|
||||
</a>
|
||||
</li>-->
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
@ -1218,6 +1187,16 @@ $(function() {
|
||||
<span>Receipt and Payment</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<span id="menu" data-toggle="dropdown" ><i class="fa fa-money"></i> Banking <span class="caret"></span></span>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="menu3">
|
||||
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Bankingview">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
@ -1230,52 +1209,11 @@ $(function() {
|
||||
<span>Bank Statements</span>
|
||||
</a>
|
||||
</li>
|
||||
<!--<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Debitstatement">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
<span>Amount Paid</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Bankamountpaid">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
<span>Depit Reports</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Receipt">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
<span>Receipt</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Payment">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
<span>Payment</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Invoice">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
<span>Invoice</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Bankamountreceived">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
<span>Credit Reports</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Bankcash">
|
||||
<i class="fa fa-credit-card"></i>
|
||||
<span>addincexp</span>
|
||||
</a>
|
||||
</li>-->
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php if($check ==1){break;}}}?>
|
||||
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
<th>Account Type</th>
|
||||
<th>DATE</th>
|
||||
<th>Account Name</th>
|
||||
<th>Cash Type</th>
|
||||
<th>Amount</th>
|
||||
<th>Details</th>
|
||||
<th>Action</th>
|
||||
@ -47,6 +48,7 @@
|
||||
<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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user