bankstatement issues
This commit is contained in:
parent
644b35e3ba
commit
f62e3175ae
@ -1016,6 +1016,7 @@ class cashbook extends BaseController
|
||||
$pono = $this->input->post('pono');
|
||||
$igrno=$this->input->post('igrno');
|
||||
$igrlineitem=$this->input->post('igrlineitem');
|
||||
|
||||
$sname = $this->input->post('sname');
|
||||
$tot = $this->input->post('tot');
|
||||
$rowcount = $this->input->post('rc');
|
||||
@ -1083,8 +1084,7 @@ class cashbook extends BaseController
|
||||
$IsActive=1;
|
||||
|
||||
$podata1 = array('Podate'=>$date,'PONO'=>$pono,'IGRNO'=>$igrno,'Suppliername'=>$sname,'Totalpoamount'=>$tot,'Amountpaid'=>$ip,'Balancetopay'=>$balancetopay,'mid'=>$bankid,'IGRLineItemNo'=>$igrlineitem,'IsActive'=>$IsActive);
|
||||
//print_r($podata1);
|
||||
//die();
|
||||
|
||||
$podata = array('Podate'=>$date,'PONO'=>$pono,'IGRNO'=>$igrno,'Suppliername'=>$sname,'Totalpoamount'=>$tot,'Amountpaid'=>$amtpaid,'Balancetopay'=>$balancetopay,'mid'=>$bankid,'IGRLineItemNo'=>$igrlineitem);
|
||||
//die();
|
||||
|
||||
@ -1108,16 +1108,7 @@ class cashbook extends BaseController
|
||||
echo "Saved Successfully!";
|
||||
}
|
||||
|
||||
// if($balancetopay==0)
|
||||
// {
|
||||
// $status=AMOUNT_PAID;
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $status=PARTIALLY_PAID;
|
||||
// }
|
||||
// $pomaster= array('Paymentstatus'=>$status);
|
||||
|
||||
|
||||
if($balancetopay==0)
|
||||
{
|
||||
@ -1300,11 +1291,12 @@ class cashbook extends BaseController
|
||||
}
|
||||
public function Deletemappingporeport()
|
||||
{
|
||||
|
||||
$totalamount =$this->input->post('Totalpoamount');
|
||||
|
||||
$Amount = $this->input->post('paidamount');
|
||||
$id=$this->input->post('mappingid');
|
||||
$igrno = $this->input->post('igrno');
|
||||
$igrno = $this->input->post('IGRItemNo');
|
||||
$Bankid = $this->input->post('bankid');
|
||||
$balancetoclear=$this->input->post('balancetobankingclear');
|
||||
$clearedbalance=$this->input->post('clearbalance');
|
||||
@ -1328,20 +1320,22 @@ class cashbook extends BaseController
|
||||
//for update mapping amount in t_bankmappingpo table//
|
||||
$balancetopay=$this->input->post('balancetopay');
|
||||
$totalbalancetopay=$Amount+$balancetopay;
|
||||
$updatebankpoamount=$totalamount-$totalbalancetopay;
|
||||
//$updateamount=0;
|
||||
$IsActive=0;
|
||||
$result2= $this->cashbook_model->deleteBankmappingpo($id,$IsActive);
|
||||
//for update mapping amount inT_Bankporeport table//
|
||||
//die();
|
||||
$result3= $this->cashbook_model->updateBankporeportpo($igrno,$totalbalancetopay,$updateamount,$Bankid);
|
||||
$result3= $this->cashbook_model->updateBankporeportpo($igrno,$totalbalancetopay,$updatebankpoamount,$Bankid);
|
||||
$this->loadViews("bankstatement", $this->global,$data, NULL);
|
||||
}
|
||||
public function Deletemappingpo()
|
||||
{
|
||||
$totalamount = $_GET['Totalpoamount'];
|
||||
$totalamount = $_GET['totalpoamount'];
|
||||
$Bankid = $_GET['bankid'];
|
||||
$Amount = $_GET['amount'];
|
||||
$igrno = $_GET['igrno'];
|
||||
|
||||
$id=$_GET['id'];
|
||||
$balancetoclear=$_GET['balancetoclear'];
|
||||
$bankamount=$_GET['bankamount'];
|
||||
@ -1365,11 +1359,11 @@ class cashbook extends BaseController
|
||||
//for update mapping amount in t_bankmappingpo table//
|
||||
$balancetopay=$_GET['balancetopay'];
|
||||
$totalbalancetopay=$Amount + $balancetopay;
|
||||
//$updateamount=0;
|
||||
$IsActive=0;
|
||||
$updatebankpoamount=$totalamount-$totalbalancetopay;
|
||||
$result2= $this->cashbook_model->deleteBankmappingpo($id,$IsActive);
|
||||
//for update mapping amount inT_Bankporeport table//
|
||||
$result3= $this->cashbook_model->updateBankporeportpo($igrno,$totalbalancetopay,$updateamount,$Bankid);
|
||||
$result3= $this->cashbook_model->updateBankporeportpo($igrno,$totalbalancetopay,$updatebankpoamount,$Bankid);
|
||||
|
||||
if(count($result2)>0)
|
||||
{
|
||||
@ -1393,9 +1387,16 @@ class cashbook extends BaseController
|
||||
$updateclearbalance=$bankingclear-$amountreceived;
|
||||
$bankstatement=array('cbalancetocleared'=>$updatebalancetoclear,'cclearbalance'=>$updateclearbalance);
|
||||
$result1= $this->cashbook_model->updatebankreportiv($bankid,$bankstatement);
|
||||
//print_r($result1);
|
||||
//die();
|
||||
if($totinvoiceamount==$amountreceived)
|
||||
{
|
||||
$receivedstatus=NO_RECEIVED;
|
||||
}
|
||||
else
|
||||
{
|
||||
$receivedstatus=PARTIALLY_RECEIVED;
|
||||
}
|
||||
$IsActive=0;
|
||||
$result1=$this->cashbook_model->UpdateIpinvoiceStatus($invoiceno,$receivedstatus);
|
||||
$result2= $this->cashbook_model->deletemappinginvoice($mappingid,$IsActive);
|
||||
$updatebalancetoreceived=$balancetoreceived+$amountreceived;
|
||||
$updateamountreceived=$totinvoiceamount-$updatebalancetoreceived;
|
||||
|
||||
@ -287,20 +287,18 @@ function clearedbalance(){
|
||||
function debitbankstatemet($Supplierid,$fdate,$tdate)
|
||||
{
|
||||
$status='ST057';
|
||||
//echo $tdate;
|
||||
//die();
|
||||
//echo $tdate;
|
||||
//die();
|
||||
//$Supplierid;
|
||||
$this->db->distinct();
|
||||
$this->db->select('igr.PONO,supp.SupplierName,igrli.CreatedDate,igrli.IGRItemNo,igr.IGRNO,BR.Balancetopay,BR.Amountpaid,pom.Status,poli.ReceivedQuantity,poli.Rate');
|
||||
//
|
||||
$this->db->select('igr.PONO,igrli.IGRItemNo,igr.IGRNO,supp.SupplierName,igrli.CreatedDate,BR.Balancetopay,BR.Amountpaid,pom.Status,igrli.QuantityAsPerInvoice ,poli.Rate,(igrli.QuantityAsPerInvoice * poli.Rate) as total');
|
||||
$this->db->from ('T_IGR_Details igrli');
|
||||
$this->db->join('T_IGR_Master igr','igrli.IGRNO = igr.IGRNO');
|
||||
$this->db->join('T_PurchaseOrder_LineItem poli','igr.PONO= poli.PONO');
|
||||
$this->db->join('T_PurchaseOrder_Master pom','igr.PONO =pom.PONO');
|
||||
$this->db->join('T_IGR_Master igr','igrli.IGRNO = igr.IGRNO','left');
|
||||
$this->db->join('T_PurchaseOrder_LineItem poli','igr.PONO= poli.PONO and igrli.MaterialCode=poli.MaterialCode');
|
||||
$this->db->join('T_PurchaseOrder_Master pom','poli.PONO =pom.PONO');
|
||||
$this->db->join('T_SupplierDetailsN supp','pom.SupplierID =supp.SupplierID');
|
||||
$this->db->join ('T_Bankporeport BR','pom.PONO = BR.PONO','left');
|
||||
|
||||
if ($fdate and $tdate != ''){
|
||||
$this->db->join ('T_Bankporeport BR','igrli.IGRItemNo = BR.IGRLineItemNo','left');
|
||||
if ($fdate and $tdate != ''){
|
||||
$fromdate= date("Y-m-d",strtotime($fdate));
|
||||
$todate=date("Y-m-d",strtotime($tdate));
|
||||
$date = "date(igr.CreatedDate) >= '".$fromdate."'
|
||||
@ -312,9 +310,6 @@ function clearedbalance(){
|
||||
}
|
||||
$this->db->where_in('pom.Status',[ST044,ST056]);
|
||||
$this->db->where('igrli.BankStatus !=','ST070');
|
||||
//$this->db->group_by('pom.PONO');
|
||||
//$this->db->group_by('igrli.IGRItemNo');
|
||||
//$this->db->group_by('igr.IGRNO');
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
@ -375,16 +370,16 @@ function receiptdata()
|
||||
function debitpolist($bankid)
|
||||
{
|
||||
$this->db->select('bp.id,bp.mid,bp.Podate,bp.PONO,bp.Suppliername,bp.Totalpoamount,
|
||||
bp.Balancetopay,bp.Amountpaid,bp.IGRNO,igrm.file,igrde.IGRItemNo');
|
||||
bp.Balancetopay,bp.Amountpaid,bp.IGRNO,bp.IGRLineItemNo');
|
||||
$this->db->from ('T_Bankmappingpo bp');
|
||||
$this->db->join ('T_IGR_Master igrm','igrm.IGRNO = bp.IGRNO','left');
|
||||
$this->db->join ('T_IGR_Details igrde','igrde.IGRNO=igrm.IGRNO','left');
|
||||
//$this->db->join ('T_IGR_Master igrm','igrm.IGRNO = bp.IGRNO','left');
|
||||
//$this->db->join ('T_IGR_Details igrde','igrde.IGRNO=igrm.IGRNO','left');
|
||||
|
||||
//$this->db->join ('T_PurchaseOrder_BillUpload bu','bu.PONO = bp.PONO','left');
|
||||
$this->db->where('IsActive',1);
|
||||
$this->db->where('mid',$bankid);
|
||||
$this->db->where('igrde.BankStatus !=','ST072');
|
||||
//$this->db->group_by('PONO');
|
||||
$this->db->where('bp.IsActive',1);
|
||||
$this->db->where('bp.mid',$bankid);
|
||||
// $this->db->where('igrde.BankStatus !=','ST072');
|
||||
//$this->db->group_by('igrm.IGRNO');
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
|
||||
@ -724,7 +719,7 @@ function debitpolist($bankid)
|
||||
public function poupdate($podata,$pono)
|
||||
{
|
||||
|
||||
$this->db->where('PONO', $pono);
|
||||
$this->db->where('PONO',$pono);
|
||||
$this->db->update('T_Bankporeport',$podata);
|
||||
|
||||
return TRUE;
|
||||
@ -760,7 +755,7 @@ function debitpolist($bankid)
|
||||
|
||||
function igrdetailstatus($igrdetails,$igrlineitem)
|
||||
{
|
||||
$this->db->where('IGRItemNo', $igrlineitem);
|
||||
$this->db->where('IGRItemNo',$igrlineitem);
|
||||
$this->db->update('T_IGR_Details',$igrdetails);
|
||||
$r = $this->db->affected_rows();
|
||||
return $r;
|
||||
@ -768,7 +763,7 @@ function debitpolist($bankid)
|
||||
}
|
||||
function invoiceamountstatus($invoicemaster,$invid)
|
||||
{
|
||||
echo $invoicemaster;
|
||||
|
||||
$this->db->where('invoice_number',$invid);
|
||||
$this->db->update('ip_invoices',$invoicemaster);
|
||||
$r = $this->db->affected_rows();
|
||||
@ -853,6 +848,15 @@ function debitpolist($bankid)
|
||||
$r = $this->db->affected_rows();
|
||||
return $r;
|
||||
}
|
||||
function UpdateIpinvoiceStatus($invoiceno,$receivedstatus)
|
||||
{
|
||||
$this->db->set('receivedstatus',$receivedstatus);
|
||||
$this->db->where('invoice_number',$invoiceno);
|
||||
$this->db->update('ip_invoices');
|
||||
$r = $this->db->affected_rows();
|
||||
return $r;
|
||||
}
|
||||
|
||||
function deletemappinginvoice($mappingid,$IsActive)
|
||||
{
|
||||
$this->db->set('IsActive',$IsActive);
|
||||
@ -861,10 +865,10 @@ function debitpolist($bankid)
|
||||
$r = $this->db->affected_rows();
|
||||
return $r;
|
||||
}
|
||||
function updateBankporeportpo($igrno,$totalbalancetopay,$updateamount,$Bankid)
|
||||
function updateBankporeportpo($igrno,$totalbalancetopay,$updatebankpoamount,$Bankid)
|
||||
{
|
||||
$this->db->set('Balancetopay',$totalbalancetopay);
|
||||
$this->db->set('Amountpaid',$updateamount);
|
||||
$this->db->set('Balancetopay',$totalbalancetopay);
|
||||
$this->db->set('Amountpaid',$updatebankpoamount);
|
||||
$this->db->where('IGRLineItemNo',$igrno);
|
||||
$this->db->where('mid',$Bankid);
|
||||
$this->db->update('T_Bankporeport');
|
||||
|
||||
@ -216,12 +216,15 @@ $('#content').loader('show');
|
||||
|
||||
var totalamount=$('#tpoa'+i).text();
|
||||
|
||||
|
||||
var paidamount=$('#ap'+i).text();//amount
|
||||
|
||||
var balancetopay=$('#btp'+i).text();
|
||||
|
||||
var Igritemno=$('#igritemno'+i).text();
|
||||
|
||||
var Igritemno=$('#igritemno'+i).text();
|
||||
|
||||
|
||||
var bankid=$('#bankingid'+i).val();
|
||||
|
||||
var mappingid=$('#mapid'+i).val();
|
||||
|
||||
@ -175,8 +175,9 @@ foreach($financialyear as $item)
|
||||
$status=$t->Paymentstatus;
|
||||
$balancetopay=$t->Balancetopay;
|
||||
$ReceivedQuantity=$t->ReceivedQuantity;
|
||||
$rate=$t->Rate;
|
||||
$value=$ReceivedQuantity*$rate;
|
||||
$rate=$t->total;
|
||||
|
||||
|
||||
if($status !='ST057')
|
||||
{
|
||||
?>
|
||||
@ -188,8 +189,8 @@ foreach($financialyear as $item)
|
||||
<td align="left" id="igrno<?php echo $i ?>"><a href="<?= base_url() ?>cashbook/mappingdebit?sid=<?php echo $t->IGRNO;?>"><span><?php echo $t->IGRNO?></span></a></td>
|
||||
<td align="left" id="igrlineitem<?php echo $i ?>" ><span><?php echo $t->IGRItemNo?></span></td>
|
||||
<td align="left" id="sn<?php echo $i ?>" ><span><?php echo $t->SupplierName?></span></td>
|
||||
<td align="left" id="tov<?php echo $i ?>" ><span><?php echo $value?></span></td>
|
||||
<td align="left" id="qw<?php echo $i ?>" ><span><?php echo ($value-$t->Amountpaid)?></span></td>
|
||||
<td align="left" id="tov<?php echo $i ?>" ><span><?php echo $rate?></span></td>
|
||||
<td align="left" id="qw<?php echo $i ?>" ><span><?php echo ($rate-$t->Amountpaid)?></span></td>
|
||||
<td data-name="sel"><input type="text" onkeypress="return isNumberKey(event)" onchange="GetAmount(<?php echo $i ?>)" id="invoicepaymet<?php echo $i ?>"></td>
|
||||
|
||||
</tr>
|
||||
@ -606,6 +607,7 @@ function Save()
|
||||
|
||||
var igrlineitem =$('#hideigrline'+number).val();
|
||||
|
||||
|
||||
var suppliername=$('#hidesupname'+number).val();
|
||||
|
||||
var totalordervalue=$('#hidettlPoamt'+number).val();
|
||||
|
||||
@ -244,7 +244,7 @@ if(!empty($mapping))
|
||||
<td align="left" id="date"><span><?php echo date_format(date_create($ap->Podate),'d-m-Y');?></span></td>
|
||||
<td align="left" id="pono"><a href="<?= base_url() ?>cashbook/mappingdebit?sid=<?php echo $ap->PONO;?>"><span><?php echo $ap->PONO?></span></a></td>
|
||||
<td align="left" id="igrno"><a href="<?= base_url() ?>cashbook/mappingdebit?sid=<?php echo $ap->IGRNO;?>"><span><?php echo $ap->IGRNO?></span></a></td>
|
||||
<td align="left" id="sn"><span><?php echo $ap->IGRItemNo?></span></td>
|
||||
<td align="left" id="sn"><span><?php echo $ap->IGRLineItemNo?></span></td>
|
||||
<!--<td align="left"><a href="<?= base_url() ?>cashbook/bankreceipt?sid=<?php echo $t->PONO;?>"><span><?php echo $t->PONO?></span></a></td>-->
|
||||
<!--<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file ?>"-->
|
||||
<td align="left" id="sn"><span><?php echo $ap->Suppliername?></span></td>
|
||||
@ -271,7 +271,7 @@ if(!empty($mapping))
|
||||
|
||||
?>
|
||||
<td>
|
||||
<a data-toggle="tooltip" href="<?php echo base_url().'cashbook/Deletemappingpo?bankid='.$ap->mid; ?>&id=<?php echo $ap->id ?>&amount=<?php echo $ap->Amountpaid?>&bankamount=<?php echo $bankamount?>&balancetoclear=<?php echo$balancetoclear?>&igrno=<?php echo $ap->IGRItemNo?>&balancetopay=<?php echo $ap->Balancetopay?>&totalpoamount=<?php echo $ap->Totalpoamount?>"><i class="fa fa-trash" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Delete details"></i> </a>
|
||||
<a data-toggle="tooltip" href="<?php echo base_url().'cashbook/Deletemappingpo?bankid='.$ap->mid; ?>&id=<?php echo $ap->id ?>&amount=<?php echo $ap->Amountpaid?>&bankamount=<?php echo $bankamount?>&balancetoclear=<?php echo$balancetoclear?>&igrno=<?php echo $ap->IGRLineItemNo?>&balancetopay=<?php echo $ap->Balancetopay?>&totalpoamount=<?php echo $ap->Totalpoamount?>"><i class="fa fa-trash" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Delete details"></i> </a>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user