new changes
This commit is contained in:
parent
8f444bdc22
commit
d523e9b287
@ -1077,10 +1077,14 @@ class cashbook extends BaseController
|
||||
$bankid= $_GET['d'];
|
||||
$data['clearbalance']=$_GET['cb'];
|
||||
$data['balancetoclear']=$_GET['btc'];
|
||||
$data['mappingiv'] = $this->cashbook_model->creditinvoicelist($bankid);
|
||||
//print_r($data['mappingiv']);
|
||||
$data['invoiceramount'] = $this->cashbook_model->invoiceamonut($bankid);
|
||||
$data['mappingcashbook']=$this->cashbook_model->mappingcashcreditbankid($bankid);
|
||||
$data['paidcbook'] = $this->cashbook_model->cashbookamount($bankid);
|
||||
$data['mappingiv'] = $this->cashbook_model->creditinvoicelist($bankid);
|
||||
$data['invoiceramount'] = $this->cashbook_model->invoiceamonut($bankid);
|
||||
|
||||
|
||||
|
||||
$data['supplier'] = $this->cashbook_model->getsupplier();
|
||||
//redirect('Bankingstatement','refresh');
|
||||
$this->loadViews("bankinvoicesettlement", $this->global,$data,NULL);
|
||||
@ -1281,6 +1285,7 @@ class cashbook extends BaseController
|
||||
{
|
||||
$arec = $ar->cclearbalance;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($check == 1)
|
||||
@ -1318,6 +1323,23 @@ class cashbook extends BaseController
|
||||
$earlyreceived = 0;
|
||||
//echo $earlypaid;
|
||||
$earlyreceived = $this->cashbook_model->getearlyamountcredit($invid);
|
||||
$earlyreceivedmappingiv = $this->cashbook_model->getearlymappingiv($invid);//new change
|
||||
|
||||
if(empty($earlyreceivedmappingiv))
|
||||
{
|
||||
$eRec1=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
foreach($earlyreceived as $ar)
|
||||
{
|
||||
$eRec1 = $ar->amountreceived;
|
||||
}
|
||||
$updatenew=($invamount-($eRec1+$invoicetext));
|
||||
}
|
||||
// echo $earlyreceivedmappingiv;
|
||||
// die();
|
||||
if(empty($earlyreceived))
|
||||
{
|
||||
$eRec=0;
|
||||
@ -1338,7 +1360,7 @@ class cashbook extends BaseController
|
||||
$IsActive=1;
|
||||
$invoicedata1 = array('indate'=>$date,'invoiceno'=>$invid,'customername'=>$cname,'customerid'=>$cid,'totinvoiceamount'=>$invamount,'balancetoreceived'=>$balancetoreceived1,'amountreceived'=>$amtpaid,'bankid'=>$bankid,'IsActive'=>$IsActive);
|
||||
|
||||
$invoicedata = array('indate'=>$date,'invoiceno'=>$invid,'customername'=>$cname,'customerid'=>$cid,'totinvoiceamount'=>$invamount,'balancetoreceived'=>$balancetoreceived1,'amountreceived'=>$ip,'bankid'=>$bankid,'IsActive'=>$IsActive);
|
||||
$invoicedata = array('indate'=>$date,'invoiceno'=>$invid,'customername'=>$cname,'customerid'=>$cid,'totinvoiceamount'=>$invamount,'balancetoreceived'=>$updatenew,'amountreceived'=>$ip,'bankid'=>$bankid,'IsActive'=>$IsActive);
|
||||
|
||||
// //print_r ($invoicedata);
|
||||
// //die();
|
||||
@ -1496,7 +1518,7 @@ class cashbook extends BaseController
|
||||
$data['m']=$m;
|
||||
$data['fdate']=$fdate;
|
||||
$data['tdate']=$tdate;
|
||||
$data['bankmappingcash'] = $this->cashbook_model->mappingcashreceivedfilter($accountcode,$fa,$aa,$m,$fdate,$tdate);
|
||||
$data['bankmappingcashreceived'] = $this->cashbook_model->mappingcashreceivedfilter($accountcode,$fa,$aa,$m,$fdate,$tdate);
|
||||
|
||||
}
|
||||
else
|
||||
@ -1515,7 +1537,7 @@ class cashbook extends BaseController
|
||||
$data['m']=$m;
|
||||
$data['fdate']=$fdate;
|
||||
$data['tdate']=$tdate;
|
||||
$data['bankmappingcash'] = $this->cashbook_model->mappingcashreceived($accountcode,$fa,$aa,$m,$fdate,$tdate);
|
||||
$data['bankmappingcashreceived'] = $this->cashbook_model->mappingcashreceived($accountcode,$fa,$aa,$m,$fdate,$tdate);
|
||||
}
|
||||
$data['finyear']=$this->cashbook_model->report_cashbook();
|
||||
$this->loadViews("banksettlementcredit", $this->global,$data, NULL);
|
||||
@ -1965,6 +1987,10 @@ class cashbook extends BaseController
|
||||
{
|
||||
$result1=$this->cashbook_model->UpdateIpinvoiceStatus($invoiceno,$receivedstatus);
|
||||
$result2= $this->cashbook_model->deletemappinginvoice($mappingid,$IsActive);
|
||||
// if(count($result2)>0)
|
||||
// {
|
||||
// $result4= $this->cashbook_model->updatemappinginvoice($invoiceno,$amountreceived);
|
||||
// }
|
||||
}
|
||||
$this->loadViews("bankstatement", $this->global,$data, NULL);
|
||||
|
||||
|
||||
@ -1131,6 +1131,7 @@ function receiptdata()
|
||||
// $this->db->where('igrde.BankStatus !=','ST072');
|
||||
$this->db->group_by('bp.id');
|
||||
$query = $this->db->get();
|
||||
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
@ -1138,14 +1139,20 @@ function receiptdata()
|
||||
|
||||
function creditinvoicelist($bankid)
|
||||
{
|
||||
|
||||
$this->db->select('bm.indate,bm.invoiceno,bm.customername,bm.totinvoiceamount,bm.bankid,
|
||||
bm.balancetoreceived,bm.amountreceived,bm.ID,br.Credit,br.cclearbalance,br.cbalancetocleared');
|
||||
bm.balancetoreceived,bm.amountreceived,bm.ID,br.Credit,br.cclearbalance,br.cbalancetocleared');
|
||||
$this->db->from ('T_Bankmappingiv bm');
|
||||
$this->db->join('T_bankreport br','br.ID=bm.bankid');
|
||||
$this->db->where('bm.bankid',$bankid);
|
||||
$this->db->where('bm.bankid',(int)$bankid);
|
||||
$this->db->where('bm.IsActive',1);
|
||||
$this->db->group_by('bm.ID');
|
||||
//$this->db->group_by('invoiceno');
|
||||
$query = $this->db->get();
|
||||
// $str = $this->db->last_query();
|
||||
// print_r($str);
|
||||
|
||||
//print_r($query);
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
@ -1320,12 +1327,13 @@ function receiptdata()
|
||||
}
|
||||
function mappingcashreceived($accountcode,$fdate,$tdate,$fa,$aa,$m)
|
||||
{
|
||||
$this->db->select('ie.date,ie.bankid,ie.cashtype,ie.amounttype,ie.total,ac.name,totalbankamount,ie.id');
|
||||
$this->db->select('ie.date,ie.bankid,ie.cashtype,ie.amounttype,ie.total,ac.name,totalbankamount,ie.id,sd.SupplierName');
|
||||
$this->db->from ('t_income_expense as ie');
|
||||
$this->db->join ('t_accountcode ac ','ac.code = ie.account_code','left');
|
||||
$this->db->join ('T_SupplierDetailsN sd ','sd.SupplierID = ie.Supplier_id','left');
|
||||
$this->db->where('ie.account_code',$accountcode);
|
||||
$this->db->where('ie.amounttype','CREDIT');
|
||||
$this->db->where('IsActive',1);
|
||||
$this->db->where('ie.IsActive',1);
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
//$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
@ -1618,6 +1626,17 @@ function receiptdata()
|
||||
// print_r( $this->db->last_query());
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
public function getearlymappingiv($invid)
|
||||
{
|
||||
$this->db->select('sum(amountreceived) as amountreceived');
|
||||
$this->db->from('T_Bankmappingiv');
|
||||
$this->db->where('invoiceno',$invid);
|
||||
$this->db->where('IsActive',1);
|
||||
$query = $this->db->get();
|
||||
// print_r( $this->db->last_query());
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
public function getalreadypaid($bankid)
|
||||
{
|
||||
@ -1689,7 +1708,7 @@ function receiptdata()
|
||||
and date(bm.Podate) <= '".$todate."'";
|
||||
$this->db->where($date);
|
||||
}
|
||||
//$this->db->group_by('bm.IGRLineItemNo');
|
||||
$this->db->group_by('bm.IGRLineItemNo');
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
@ -1990,7 +2009,7 @@ function receiptdata()
|
||||
$this->db->join ('T_Bankinvoicereport BI',' iv.invoice_number =BI.invoiceno','left');
|
||||
$this->db->where('iv.receivedstatus','ST066');
|
||||
$this->db->where('iv.invoice_status_id','2');
|
||||
$this->db->where('bm.IsActive',1);
|
||||
|
||||
// $this->db->where('bm.customername',$Customer);
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
@ -2134,6 +2153,17 @@ function receiptdata()
|
||||
$r = $this->db->affected_rows();
|
||||
return $r;
|
||||
}
|
||||
// function updatemappinginvoice($invoiceno,$amountreceived)
|
||||
// {
|
||||
// $this->db->set('balancetoreceived',$amountreceived+'balancetoreceived');
|
||||
// $this->db->where('invoiceno',$invoiceno);
|
||||
// $this->db->where('IsActive',1);
|
||||
// $this->db->update('T_Bankmappingiv');
|
||||
// $query = $this->db->get();
|
||||
// print_r(this->db->last_query());
|
||||
// $r = $this->db->affected_rows();
|
||||
// return $r;
|
||||
// }
|
||||
function updateBankporeportpo($igrno,$totalbalancetopay,$updatebankpoamount,$Bankid,$IsActive)
|
||||
{
|
||||
$this->db->set('Balancetopay',$totalbalancetopay);
|
||||
|
||||
@ -511,6 +511,7 @@ function isNumberKey(evt)
|
||||
}
|
||||
function GetAmount(i)
|
||||
{
|
||||
|
||||
//alert("onchnage function getamount"+i);
|
||||
var amount = parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val())
|
||||
|
||||
@ -543,8 +544,8 @@ function GetAmount(i)
|
||||
for(k=1;k<=i;k++)
|
||||
{
|
||||
//alert(k);
|
||||
var idcheck1=$('#igrlineitem'+k).val();
|
||||
var idcheck=idcheck1.trim();
|
||||
var idcheck=$('#hideigrline'+k).val();
|
||||
//var idcheck=idcheck1.trim();
|
||||
|
||||
if(igrlineitem == idcheck)
|
||||
{
|
||||
@ -648,7 +649,8 @@ function Save()
|
||||
|
||||
// alert('igrnoval'+'-'+igrno);
|
||||
|
||||
var igrlineitem =$('#hideigrline'+number).val();
|
||||
var igrlineitem1 =$('#hideigrline'+number).val();
|
||||
var igrlineitem=igrlineitem1.trim();
|
||||
|
||||
var suppliername=$('#hidesupname'+number).val();
|
||||
|
||||
|
||||
@ -622,7 +622,8 @@ function Save()
|
||||
var customerid=$('#hidecustomerid'+number).val();
|
||||
|
||||
|
||||
var invoiceamount=$('#hideinvoiceamount'+number).val();
|
||||
var invoiceamount1=$('#hideinvoiceamount'+number).val();
|
||||
var invoiceamount=invoiceamount1.trim();
|
||||
|
||||
var amountreceived=$('#hideinvoicerecd'+number).val();
|
||||
|
||||
|
||||
@ -148,8 +148,9 @@ foreach($financialyear as $item)
|
||||
<th>INVOICE NO</th>
|
||||
<th>Customer Name</th>
|
||||
<th>Total Amount (₹)</th>
|
||||
<th>Received Amount</th>
|
||||
<th>Balance To Received</th>
|
||||
<th>Received Amount</th>
|
||||
|
||||
<th>Action</th>
|
||||
|
||||
|
||||
@ -177,9 +178,11 @@ foreach($financialyear as $item)
|
||||
<td align="left" id="invno<?php echo $i ?>"><?php echo $ap->invoiceno?></span></td>
|
||||
<td align="left" id="aa<?php echo $i ?>"><span><?php echo $ap->customername?></span></td>
|
||||
<td align="left" id="totinvoiceamount<?php echo $i ?>"><span><?php echo $ap->totinvoiceamount?></span></td>
|
||||
<td align="left" id="balancetoreceived<?php echo $i ?>"><span><?php echo $ap->totinvoiceamount-$ap->amountreceived?></span></td>
|
||||
<td align="left" id="amountreceived<?php echo $i ?>"><span><?php echo $ap->amountreceived?></span></td>
|
||||
<td>
|
||||
|
||||
<!--<td align="left" id="balancetoreceived<?php echo $i ?>"><span><?php echo $ap->totinvoiceamount-$ap->amountreceived?></span></td>-->
|
||||
<td align="left" id="balancetoreceived<?php echo $i ?>"><span><?php echo $ap->balancetoreceived?></span></td>
|
||||
<td>
|
||||
<a data-toggle="tooltip" ><i class="fa fa-trash" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Delete details" onclick="invoice(<?php echo $i ?>)"></i> </a>
|
||||
</td>
|
||||
|
||||
@ -283,12 +286,14 @@ function invoice(i)
|
||||
{
|
||||
|
||||
$('#content').loader('show');
|
||||
var totinvoiceamount=$('#totinvoiceamount'+i).text();
|
||||
var totinvoiceamount=$('#totinvoiceamount'+i).text();
|
||||
|
||||
var balancetoreceived=$('#balancetoreceived'+i).text();
|
||||
var invoiceno=$('#invno'+i).text();
|
||||
//alert(invoiceno);
|
||||
var bankid=$('#bankingid'+i).val();
|
||||
var amountreceived=$('#amountreceived'+i).text();
|
||||
|
||||
var bankingclear=$('#bankingclear'+i).val();
|
||||
var mappingid=$('#mappingid'+i).val();
|
||||
var credit=$('#credit'+i).val();
|
||||
|
||||
@ -265,7 +265,7 @@ foreach($financialyear as $item)
|
||||
|
||||
<?php } ?>
|
||||
</table>
|
||||
<center><h3 class="box-title"><p style="color:#3c8dbc; font-size: 18px;">CashBook(<?php if(!empty($fa)){
|
||||
<center><h3 class="box-title"><p style="color:#3c8dbc; font-size: 18px;">CashBook <?php if(!empty($fa)){
|
||||
echo $fa;
|
||||
}
|
||||
|
||||
@ -293,7 +293,7 @@ foreach($financialyear as $item)
|
||||
echo $tdate;
|
||||
}
|
||||
|
||||
?>)</p></h3></center>
|
||||
?></p></h3></center>
|
||||
<table class="table table-bordered table-hover" id="req1" style="table-layout:auto;">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@ -230,6 +230,7 @@ if(!empty($mapping))
|
||||
|
||||
<th>Date</th>
|
||||
<th>Account Name</th>
|
||||
<th>Supplier Name</th>
|
||||
<!-- <th>Bankid</th>-->
|
||||
<!--<th>Amount Type</th>-->
|
||||
<th>Total Amount (₹)</th>
|
||||
@ -248,9 +249,9 @@ if(!empty($mapping))
|
||||
$i=1;
|
||||
$ti=0.00;
|
||||
$tvt=0.00;
|
||||
if(!empty($bankmappingcash)){
|
||||
if(!empty($bankmappingcashreceived)){
|
||||
|
||||
foreach($bankmappingcash as $mc)
|
||||
foreach($bankmappingcashreceived as $mc)
|
||||
{
|
||||
$id=$mc->id;
|
||||
$rate=$mc->total;
|
||||
@ -263,6 +264,7 @@ if(!empty($mapping))
|
||||
|
||||
<td align="left" id="date<?php echo $i ?>"><span><?php echo $mc->date?></span></td>
|
||||
<td align="left" id="date<?php echo $i ?>"><span><?php echo $mc->name?></span></td>
|
||||
<td align="left" id="date<?php echo $i ?>"><span><?php echo $mc->SupplierName?></span></td>
|
||||
<!--<td align="left" id="sn<?php echo $i ?>"><span><?php echo $mc->bankid?></span></td>-->
|
||||
<!--<td align="left" id="tov<?php echo $i ?>"><span><?php echo $mc->amounttype?></span></td>-->
|
||||
<td align="left" id="aa<?php echo $i ?>"><span><?php $tot_amount=$tot_amount+round($rate);?> <?php echo round($rate,2)?></span></td>
|
||||
@ -290,7 +292,7 @@ if(!empty($mapping))
|
||||
<tr>
|
||||
<td style="text-align:left;"><strong>Total</strong></td>
|
||||
<td> </td>
|
||||
|
||||
<td> </td>
|
||||
|
||||
<td class="amount"><strong>
|
||||
<?php echo $tot_amount; ?>
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
</div>
|
||||
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
||||
<center><h3 class="box-title"><p style="color:#3c8dbc; font-size: 18px;">Sundry Debtors(<?php if(!empty($fa)){
|
||||
<center><h3 class="box-title"><p style="color:#3c8dbc; font-size: 18px;">Sundry Debtors <?php if(!empty($fa)){
|
||||
echo $fa;
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@
|
||||
echo $tdate;
|
||||
}
|
||||
|
||||
?>)</p></h3></center>
|
||||
?></p></h3></center>
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user