based on inward

This commit is contained in:
gayathri1990 2018-11-30 11:48:32 +05:30
parent f907137cc4
commit ee394e1e87
3 changed files with 84 additions and 30 deletions

View File

@ -1145,8 +1145,7 @@ class cashbook extends BaseController
$bankdate = date_create($bankdate);//,'Y-m-d');
$bankdate = date_format($bankdate,'Y-m-d');
$pono = $this->input->post('pono');
$igrno=$this->input->post('igrno');
// $igrlineitem=$this->input->post('igrlineitem');
$igrno=$this->input->post('igrno');
$sname = $this->input->post('sname');
$sid = $this->input->post('sid');
@ -1205,7 +1204,7 @@ class cashbook extends BaseController
}
$earlypaid = 0;
//echo $earlypaid;
$earlypaid = $this->cashbook_model->getearlyamount($pono);
$earlypaid = $this->cashbook_model->getearlyamount($igrno);
if(empty($earlypaid))
{
$ePay=0;
@ -1227,26 +1226,26 @@ class cashbook extends BaseController
$IsActive=1;
$podata1 = array('Podate'=>$date,'PONO'=>$pono,'IGRNO'=>$igrno,'Suppliername'=>$sname,'SupplierID'=>$sid,'Totalpoamount'=>$tot,'Amountpaid'=>$ip,'Balancetopay'=>$balancetopay,'mid'=>$bankid,'IsActive'=>$IsActive,'BankDate'=>$bankdate);
$igrdata1 = array('Podate'=>$date,'PONO'=>$pono,'IGRNO'=>$igrno,'Suppliername'=>$sname,'SupplierID'=>$sid,'Totalpoamount'=>$tot,'Amountpaid'=>$ip,'Balancetopay'=>$balancetopay,'mid'=>$bankid,'IsActive'=>$IsActive,'BankDate'=>$bankdate);
$resultn = $this->cashbook_model->mappingpo($podata1);
$resultn = $this->cashbook_model->mappingpo($igrdata1);
//print_r($podata1);
$podata = array('Podate'=>$date,'PONO'=>$pono,'IGRNO'=>$igrno,'Suppliername'=>$sname,'SupplierID'=>$sid,'Totalpoamount'=>$tot,'Amountpaid'=>$amtpaid,'Balancetopay'=>$balancetopay,'mid'=>$bankid,'IsActive'=>$IsActive,'BankDate'=>$bankdate);
$igrdata = array('Podate'=>$date,'PONO'=>$pono,'IGRNO'=>$igrno,'Suppliername'=>$sname,'SupplierID'=>$sid,'Totalpoamount'=>$tot,'Amountpaid'=>$amtpaid,'Balancetopay'=>$balancetopay,'mid'=>$bankid,'IsActive'=>$IsActive,'BankDate'=>$bankdate);
//die();
$result3 = $this->cashbook_model->getpono($pono);
$result3 = $this->cashbook_model->getigrno($igrno);
if(count($result3)<=0)
{
$result = $this->cashbook_model->podata($podata);
$result = $this->cashbook_model->bankporeportdata($igrdata);
}
else
{
//echo "update";
$result3 = $this->cashbook_model->poupdate($podata,$pono);
$result3 = $this->cashbook_model->bankporeportupdate($igrdata,$igrno);
}
if($rw == $rowcount)
@ -1258,17 +1257,17 @@ class cashbook extends BaseController
$now = date('Y-m-d H:i:s');
if($balancetopay==0)
{
$postatus=AMOUNT_PAIDIGR;
$igrpaidstatus=AMOUNT_PAIDIGR;
}
else
{
$postatus=PARTIALLY_PAIDIGR;
$igrpaidstatus=PARTIALLY_PAIDIGR;
}
$igrdetails=array('Paymentstatus'=>$postatus,'StatusUpdatedDate'=>$now);
$igrmaster=array('Paymentstatus'=>$igrpaidstatus,'StatusUpdatedDate'=>$now);
//$podetails=array('Paymentstatus'=>$postatus);
//$result1 = $this->cashbook_model->igrdetailstatus($podetails,$pono);
$result1 = $this->cashbook_model->poamountstatus($igrdetails,$igrno);
$result1 = $this->cashbook_model->igrstatus($igrmaster,$igrno);
$this->loadViews("bankstatement", $this->global,$data, NULL);
}
public function invoiceamount1()
@ -1626,7 +1625,59 @@ class cashbook extends BaseController
$this->loadViews("bankpaidsupp", $this->global,$data, NULL);
//$this->loadViews("bankamountpaid", $this->global,$data, NULL);
}
}
// function supplierledger()
// {
// $this->global['pageTitle'] = 'Siddharth : Bank Report - Amount Payment Details';
// //$suppliername= $_GET['sid'];
// if ($this->input->post('btn_submit'))
// {
// $ab=$this->input->post('financialyear');
// $fa=substr($ab,0,-5);
// $aa=substr($ab,5,5);
// $m=$this->input->post('month');
// $fdate = $this->input->post('from_date');
// $tdate = $this->input->post('to_date');
// $supplierID= $this->input->post('supplier');
// $data['supplierid']=$supplierID;
// $suppliername= $this->input->post('suppliername');
// $data['suppliername']=$suppliername;
// $data['fa']=$fa;
// $data['aa']=$aa;
// $data['m']=$m;
// $data['fdate']=$fdate;
// $data['tdate']=$tdate;
// $data['suppliername']= $suppliername;
// $data['bankdebit'] = $this->cashbook_model->debitpolistfilter($supplierID,$fa,$aa,$m,$fdate,$tdate);
// //print_r($data['bankdebit']);
// }
// else
// {
// $fa=$_GET['fa'];
// $aa=$_GET['aa'];
// $m=$_GET['m'];
// $fdate=$_GET['fdate'];
// $tdate=$_GET['tdate'];
// $data['fa']=$fa;
// $data['aa']=$aa;
// $data['m']=$m;
// $data['fdate']=$fdate;
// $data['tdate']=$tdate;
// $supplierid= $_GET['sid'];
// $data['supplierid']= $supplierid;
// $suppliername= $_GET['sn'];
// $data['suppliername']=$suppliername;
// $data['bankdebit'] = $this->cashbook_model->paided($supplierid,$fa,$aa,$m,$fdate,$tdate);
// }
// $data['finyear']=$this->cashbook_model->report_amountpaid();
// $this->loadViews("banksupplierledger", $this->global,$data, NULL);
// }
public function amountunpaid()
{
@ -2130,7 +2181,8 @@ public function Deletemappingpo()
// echo "<script>alert('Deleted Successfully!');window.location.href='Bankingstatement';</script>";
redirect('Bankingstatement','refresh');
}
}
}
public function convertNumber($amt){
//echo $amt;die();

View File

@ -1174,9 +1174,9 @@ function receiptdata()
$r = $this->db->affected_rows();
return $r;
}
function podata($podata)
function bankporeportdata($igrdata)
{
$this->db->insert('T_Bankporeport',$podata);
$this->db->insert('T_Bankporeport',$igrdata);
// $this->db->where('PONO',$pono);
$r = $this->db->affected_rows();
return $r;
@ -1187,10 +1187,10 @@ function receiptdata()
// $r = $this->db->affected_rows();
// return $r;
// }
function mappingpo($podata1)
function mappingpo($igrdata1)
{
print_r($podata1);
$this->db->insert('T_Bankmappingpo',$podata1);
$this->db->insert('T_Bankmappingpo',$igrdata1);
// $this->db->where('PONO',$pono);
$r = $this->db->affected_rows();
return $r;
@ -1204,11 +1204,11 @@ function receiptdata()
}
public function getpono($igrlineitem)
public function getigrno($igrno)
{
$this->db->select('IGRLineItemNo');
$this->db->select('igrno');
$this->db->from('T_Bankporeport');
$this->db->where('IGRLineItemNo ',$igrlineitem);
$this->db->where('IGRNO',$igrno);
$query = $this->db->get();
// print_r( $this->db->last_query());
return $query->result();
@ -1267,11 +1267,11 @@ function receiptdata()
return TRUE;
}
public function getearlyamount($igrlineitem)
public function getearlyamount($igrno)
{
$this->db->select('Amountpaid');
$this->db->from('T_Bankporeport');
$this->db->where('IGRLineItemNo ',$igrlineitem);
$this->db->where('IGRNO ',$igrno);
$query = $this->db->get();
// print_r( $this->db->last_query());
return $query->result();
@ -1319,11 +1319,11 @@ function receiptdata()
}
public function poupdate($podata,$pono)
public function bankporeportupdate($igrdata,$igrno)
{
$this->db->where('PONO',$pono);
$this->db->update('T_Bankporeport',$podata);
$this->db->where('IGRNO',$igrno);
$this->db->update('T_Bankporeport',$igrdata);
return TRUE;
}
@ -1733,10 +1733,10 @@ function receiptdata()
return $r;
}
function poamountstatus($igrdetails,$igrno)
function igrstatus($igrmaster,$igrno)
{
$this->db->where('IGRNO',$igrno);
$this->db->update('T_IGR_Master',$igrdetails);
$this->db->update('T_IGR_Master',$igrmaster);
$r = $this->db->affected_rows();
return $r;

View File

@ -647,6 +647,8 @@ function Save()
var date =$('#hidedate'+number).val();
var pono =$('#hidepono'+number).val();
var igrno =$('#hideigrno'+number).val();
// var igrlineitem =$('#hideigrline'+number).val();
var suppliername=$('#hidesupname'+number).val();