bankstatement based on inward
This commit is contained in:
parent
487c6d41ec
commit
bd5c8ff609
@ -1001,6 +1001,7 @@ class cashbook extends BaseController
|
||||
//$data['cash'] = $_GET['sid'];
|
||||
//$data['bankid'] = $_GET['d'];
|
||||
$data['bankdepitpaid'] = $this->cashbook_model->debitbankstatemet($Supplierid,$fdate,$tdate);
|
||||
// print_r($data['bankdepitpaid']);
|
||||
}
|
||||
|
||||
$data['getsupplier'] = $this->cashbook_model->getsupplier();
|
||||
@ -1264,10 +1265,10 @@ class cashbook extends BaseController
|
||||
$postatus=PARTIALLY_PAIDIGR;
|
||||
|
||||
}
|
||||
$podetails=array('Paymentstatus'=>$postatus,'StatusUpdatedDate'=>$now);
|
||||
$igrdetails=array('Paymentstatus'=>$postatus,'StatusUpdatedDate'=>$now);
|
||||
//$podetails=array('Paymentstatus'=>$postatus);
|
||||
//$result1 = $this->cashbook_model->igrdetailstatus($podetails,$pono);
|
||||
$result1 = $this->cashbook_model->poamountstatus($podetails,$pono);
|
||||
$result1 = $this->cashbook_model->poamountstatus($igrdetails,$igrno);
|
||||
$this->loadViews("bankstatement", $this->global,$data, NULL);
|
||||
}
|
||||
public function invoiceamount1()
|
||||
@ -1882,7 +1883,7 @@ class cashbook extends BaseController
|
||||
|
||||
$id=$this->input->post('mappingid');
|
||||
|
||||
$igrno = $this->input->post('IGRItemNo');
|
||||
$igrno = $this->input->post('igrno');
|
||||
$pono = $this->input->post('pono');
|
||||
$Bankid = $this->input->post('bankid');
|
||||
$balancetoclear=$this->input->post('balancetobankingclear');
|
||||
@ -1891,7 +1892,7 @@ class cashbook extends BaseController
|
||||
$updatebalancetoclear=$Amount+$balancetoclear;
|
||||
$data['$bankmappingamount'] = $this->cashbook_model->gettotalbankmappingpo($id);
|
||||
$amountpaid=$data['$bankmappingamount'][0]->Amountpaid;
|
||||
$data['$bankmappingamountcount'] = $this->cashbook_model->gettotalbankmappingpocount($pono);
|
||||
$data['$bankmappingamountcount'] = $this->cashbook_model->gettotalbankmappingpocount($igrno);
|
||||
$count= $data['$bankmappingamountcount'][0]->countAmountpaid;
|
||||
//$data['$totallineitemamount']=$this->cashbook_model->gettotallineitem($igrno);
|
||||
|
||||
@ -1906,7 +1907,7 @@ class cashbook extends BaseController
|
||||
|
||||
|
||||
|
||||
$result= $this->cashbook_model->PoStatusUpdate($pono,$PaymentStatus);
|
||||
$result= $this->cashbook_model->IGRStatusUpdate($igrno,$PaymentStatus);
|
||||
$result1= $this->cashbook_model->deletemapping($Bankid,$updateamount,$updatebalancetoclear);
|
||||
//for update mapping amount in t_bankmappingpo table//
|
||||
$balancetopay=$this->input->post('balancetopay');
|
||||
@ -1915,7 +1916,7 @@ class cashbook extends BaseController
|
||||
//$updateamount=0;
|
||||
$IsActive=0;
|
||||
$result2= $this->cashbook_model->deleteBankmappingpo($id,$IsActive);
|
||||
$data['$poreportamount'] = $this->cashbook_model->gettotalbankpoamount($pono);
|
||||
$data['$poreportamount'] = $this->cashbook_model->gettotalbankpoamount($igrno);
|
||||
$amountpaidpo= $data['$poreportamount'][0]->Amountpaid;
|
||||
$balancetopaypo= $data['$poreportamount'][0]->Balancetopay;
|
||||
$amountpaidupdate=($amountpaidpo) - ($Amount);
|
||||
@ -1928,7 +1929,7 @@ class cashbook extends BaseController
|
||||
{
|
||||
$IsAct=1;
|
||||
}
|
||||
$result3= $this->cashbook_model->updateBankporeport($pono,$balancetopayupdate,$amountpaidupdate,$IsAct);
|
||||
$result3= $this->cashbook_model->updateBankporeport($igrno,$balancetopayupdate,$amountpaidupdate,$IsAct);
|
||||
$this->loadViews("bankstatement", $this->global,$data, NULL);
|
||||
}
|
||||
public function Deletemappingpo()
|
||||
@ -1936,7 +1937,7 @@ public function Deletemappingpo()
|
||||
$totalamount = $_GET['totalpoamount'];//totalpoamount
|
||||
$Bankid = $_GET['bankid'];
|
||||
$Amount = $_GET['amount'];//paid amount
|
||||
$pono = $_GET['pono'];
|
||||
$igrno = $_GET['igrno'];
|
||||
$balancetoclear=$_GET['balancetoclear'];
|
||||
//for T_Bankreport IsActive//
|
||||
$bankdebit=$_GET['debit'];
|
||||
@ -1949,7 +1950,7 @@ public function Deletemappingpo()
|
||||
$updatebalancetoclear=$Amount+$balancetoclear;
|
||||
$data['$bankmappingamount'] = $this->cashbook_model->gettotalbankmappingpo($id);
|
||||
$amountpaid=$data['$bankmappingamount'][0]->Amountpaid;
|
||||
$data['$bankmappingamountcount'] = $this->cashbook_model->gettotalbankmappingpocount($pono);
|
||||
$data['$bankmappingamountcount'] = $this->cashbook_model->gettotalbankmappingpocount($igrno);
|
||||
$count= $data['$bankmappingamountcount'][0]->countAmountpaid;
|
||||
|
||||
|
||||
@ -1963,7 +1964,7 @@ public function Deletemappingpo()
|
||||
}
|
||||
|
||||
|
||||
$result= $this->cashbook_model->PoStatusUpdate($pono,$PaymentStatus);
|
||||
$result= $this->cashbook_model->IGRStatusUpdate($igrno,$PaymentStatus);
|
||||
$result1= $this->cashbook_model->deletemapping($Bankid,$updateamount,$updatebalancetoclear);
|
||||
//for update mapping amount in t_bankreport table//
|
||||
$balancetopay=$_GET['balancetopay'];//balancetopay
|
||||
@ -1972,7 +1973,7 @@ public function Deletemappingpo()
|
||||
$updatebankpoamount=$totalamount-$totalbalancetopay;
|
||||
$result2= $this->cashbook_model->deleteBankmappingpo($id,$IsActive);
|
||||
//$result3= $this->cashbook_model->updatemappingamount($igrno,$amountpaid);
|
||||
$data['$poreportamount'] = $this->cashbook_model->gettotalbankpoamount($pono);
|
||||
$data['$poreportamount'] = $this->cashbook_model->gettotalbankpoamount($igrno);
|
||||
$amountpaidpo= $data['$poreportamount'][0]->Amountpaid;
|
||||
$balancetopay= $data['$poreportamount'][0]->Balancetopay;
|
||||
$amountpaidupdate=$amountpaidpo-$Amount;
|
||||
@ -1987,7 +1988,7 @@ public function Deletemappingpo()
|
||||
{
|
||||
$IsAct=1;
|
||||
}
|
||||
$result3= $this->cashbook_model->updateBankporeport($pono,$balancetopayupdate,$amountpaidupdate,$IsAct);
|
||||
$result3= $this->cashbook_model->updateBankporeport($igrno,$balancetopayupdate,$amountpaidupdate,$IsAct);
|
||||
|
||||
if(count($result3)>0)
|
||||
{
|
||||
|
||||
@ -433,124 +433,162 @@ function clearedcreditbalance(){
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function suppliertotalfilter($fa,$aa,$m,$fdate,$tdate)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$status= array('ST027','ST056');
|
||||
$this->db->select('pom.PONO,sum(pom.TotalOrderValue) as TotalOrderValue,sd.SupplierName,sd.SupplierID,im.MaterialRcvdDate,im.CreatedDate');
|
||||
$this->db->from ('T_PurchaseOrder_Master pom');
|
||||
$this->db->join('T_IGR_Master im','pom.PONO=im.PONO','left');
|
||||
$this->db->join('T_SupplierDetailsN sd','pom.SupplierID=sd.SupplierID','left');
|
||||
$this->db->or_where_in('pom.Status',$status);
|
||||
$this->db->where('pom.Paymentstatus',NO_PAIDIGR);
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
$year="(im.MaterialRcvdDate >= '".$fa."-04-01' and im.MaterialRcvdDate <= '".$aa."-03-31')";
|
||||
$this->db->where($year);
|
||||
$sql="select pono,igrn,potype,date_format(created_date,'%d-%m-%Y') as created_date,date_format(materialrcvddate,'%d-%m-%Y') as materialrcvddate,supplier_name,sid,
|
||||
sum(total) as total,file,ifile
|
||||
from igr
|
||||
where Status ='ST027' or Status='ST056' and PaymentStatus ='ST072'";
|
||||
|
||||
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
//$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
$sql.=" and (MaterialRcvdDate >= '".$fa."-04-01' and MaterialRcvdDate <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
if ($m!= ''){
|
||||
|
||||
$month="monthname(im.MaterialRcvdDate) = '".$m."'";
|
||||
$this->db->where($month);
|
||||
//$sql.="and monthname(im.CreatedDate) = '".$m."'";
|
||||
$sql.="and monthname(MaterialRcvdDate) = '".$m."'";
|
||||
|
||||
}
|
||||
if($fdate!='' && $tdate!='')
|
||||
{
|
||||
$this->db->where('im.MaterialRcvdDate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"');
|
||||
}
|
||||
// $this->db->group_by(array("sd.SupplierID", "pom.PONO"));
|
||||
$this->db->group_by('sd.SupplierID','pom.PONO');
|
||||
//$this->db->group_by('pom.PONO');
|
||||
$query = $this->db->get();
|
||||
|
||||
return $query->result();
|
||||
|
||||
|
||||
|
||||
if ($fdate and $tdate != ''){
|
||||
$fromd= date("Y-m-d",strtotime($fdate));
|
||||
$tod=date("Y-m-d",strtotime($tdate));
|
||||
|
||||
$sql.="and date(MaterialRcvdDate) >= '".$fromd."'
|
||||
and date(MaterialRcvdDate) <= '".$tod."'";
|
||||
|
||||
}
|
||||
|
||||
|
||||
$sql.="group by sid";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
|
||||
}
|
||||
|
||||
// function suppliertotalfooilter($fa,$aa,$m,$fdate,$tdate)
|
||||
// {
|
||||
|
||||
|
||||
|
||||
// $status= array('ST027','ST056');
|
||||
// $this->db->select('pom.PONO,sum(pom.TotalOrderValue) as TotalOrderValue,sd.SupplierName,sd.SupplierID as SupplierID,im.MaterialRcvdDate,im.CreatedDate');
|
||||
// $this->db->from ('T_PurchaseOrder_Master pom');
|
||||
// $this->db->join('T_IGR_Master im','pom.PONO=im.PONO','left');
|
||||
// $this->db->join('T_SupplierDetailsN sd','pom.SupplierID=sd.SupplierID','left');
|
||||
// // $this->db->or_where_in('pom.Status',$status);
|
||||
// $this->db->where('pom.Status','ST027');
|
||||
// $this->db->where('pom.Paymentstatus',NO_PAIDIGR);
|
||||
|
||||
// if ($fa and $aa != ''){
|
||||
// $year="(im.MaterialRcvdDate >= '".$fa."-04-01' and im.MaterialRcvdDate <= '".$aa."-03-31')";
|
||||
// $this->db->where($year);
|
||||
// }
|
||||
// if ($m!= ''){
|
||||
|
||||
// $month="monthname(im.MaterialRcvdDate) = '".$m."'";
|
||||
// $this->db->where($month);
|
||||
|
||||
// }
|
||||
// if($fdate!='' && $tdate!='')
|
||||
// {
|
||||
// $this->db->where('im.MaterialRcvdDate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"');
|
||||
// }
|
||||
// // $this->db->group_by(array("sd.SupplierID", "pom.PONO"));
|
||||
// // $this->db->group_by(['pom.SupplierID', 'pom.PONO']);
|
||||
// $this->db->group_by('sd.SupplierID','pom.PONO');
|
||||
// //$this->db->group_by('pom.PONO');
|
||||
// $query = $this->db->get();
|
||||
|
||||
// return $query->result();
|
||||
|
||||
|
||||
// }
|
||||
function amountunpaid($supplierid1,$fa,$aa,$m,$fdate,$tdate)
|
||||
{
|
||||
|
||||
$status= array('ST027','ST056');
|
||||
$this->db->select('pom.PONO,pom.TotalOrderValue,sd.SupplierName,sd.SupplierID,im.MaterialRcvdDate,im.CreatedDate,
|
||||
im.IGRNO');
|
||||
$this->db->from('T_PurchaseOrder_Master pom');
|
||||
//$this->db->join('T_PurchaseOrder_BillUpload bu','pom.PONO=bu.PONO','left');,inward.FilePath as iwFpath,bu.FilePath as poFilePath
|
||||
$this->db->join('T_IGR_Master im','im.PONO = pom.PONO','left');
|
||||
$this->db->join('T_SupplierDetailsN sd','sd.SupplierID=pom.SupplierID','left');
|
||||
// $this->db->join('T_Bankporeport bm','bm.PONO=pom.PONO and bm.IsActive = 1','left');
|
||||
|
||||
//$this->db->join('T_Inwardgateregister_fileupload inward','inward.IGRNO =im.IGRNO','left');
|
||||
|
||||
|
||||
$this->db->or_where_in('pom.Status',$status);
|
||||
$this->db->where('pom.Paymentstatus ',NO_PAIDIGR);
|
||||
$this->db->where('sd.SupplierID',$supplierid1);
|
||||
$sql="select pono,igrn,potype,date_format(created_date,'%d-%m-%Y') as created_date,date_format(materialrcvddate,'%d-%m-%Y') as materialrcvddate,supplier_name,sid,
|
||||
sum(total) as total,file,ifile
|
||||
from igr
|
||||
where Status ='ST027' or Status='ST056' and PaymentStatus ='ST072' and sid='".$supplierid1."'";
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
$year="(im.MaterialRcvdDate >= '".$fa."-04-01' and im.MaterialRcvdDate <= '".$aa."-03-31')";
|
||||
$this->db->where($year);
|
||||
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
//$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
$sql.=" and (MaterialRcvdDate >= '".$fa."-04-01' and MaterialRcvdDate <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
if ($m!= ''){
|
||||
|
||||
$month="monthname(im.MaterialRcvdDate) = '".$m."'";
|
||||
$this->db->where($month);
|
||||
//$sql.="and monthname(im.CreatedDate) = '".$m."'";
|
||||
$sql.="and monthname(MaterialRcvdDate) = '".$m."'";
|
||||
|
||||
}
|
||||
if($fdate!='' && $tdate!='')
|
||||
{
|
||||
$this->db->where('im.MaterialRcvdDate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"');
|
||||
}
|
||||
|
||||
|
||||
//$this->db->group_by('pom.PONO');
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
if ($fdate and $tdate != ''){
|
||||
$fromd= date("Y-m-d",strtotime($fdate));
|
||||
$tod=date("Y-m-d",strtotime($tdate));
|
||||
|
||||
$sql.="and date(MaterialRcvdDate) >= '".$fromd."'
|
||||
and date(MaterialRcvdDate) <= '".$tod."'";
|
||||
|
||||
}
|
||||
|
||||
$sql.="group by pono,igrn";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
function amountunpaidfilter($sd,$fa,$aa,$m,$fdate,$tdate)
|
||||
{
|
||||
|
||||
$status= array('ST027','ST056');
|
||||
$this->db->select('pom.PONO,pom.TotalOrderValue,sd.SupplierName,sd.SupplierID,im.MaterialRcvdDate,im.CreatedDate,
|
||||
im.IGRNO');
|
||||
$this->db->from ('T_PurchaseOrder_Master pom');
|
||||
//$this->db->join('T_PurchaseOrder_BillUpload bu','pom.PONO=bu.PONO','left');
|
||||
$this->db->join('T_IGR_Master im','im.PONO=pom.PONO','left');
|
||||
$this->db->join('T_SupplierDetailsN sd','sd.SupplierID=pom.SupplierID','left');
|
||||
//$this->db->join('T_Bankporeport bm','bm.PONO=pom.PONO and bm.IsActive = 1','left');
|
||||
|
||||
//$this->db->join('T_Inwardgateregister_fileupload inward','inward.IGRNO =im.IGRNO','left'); inward.FilePath as iwFpath,bu.FilePath as poFilePath,im.IGRNO
|
||||
$this->db->or_where_in('pom.Status',$status);
|
||||
$this->db->where('pom.Paymentstatus',NO_PAIDIGR);
|
||||
$this->db->where('sd.SupplierID',$sd);
|
||||
$sql="select pono,igrn,potype,date_format(created_date,'%d-%m-%Y') as created_date,date_format(materialrcvddate,'%d-%m-%Y') as materialrcvddate,supplier_name,sid,
|
||||
sum(total) as total,file,ifile
|
||||
from igr
|
||||
where Status ='ST027' or Status='ST056' and PaymentStatus ='ST072' and sid='".$sd."'";
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
$year="(im.MaterialRcvdDate >= '".$fa."-04-01' and im.MaterialRcvdDate <= '".$aa."-03-31')";
|
||||
$this->db->where($year);
|
||||
|
||||
|
||||
if ($fa and $aa != ''){
|
||||
|
||||
//$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
||||
$sql.=" and (MaterialRcvdDate >= '".$fa."-04-01' and MaterialRcvdDate <= '".$aa."-03-31')";
|
||||
|
||||
}
|
||||
if ($m!= ''){
|
||||
|
||||
$month="monthname(im.MaterialRcvdDate) = '".$m."'";
|
||||
$this->db->where($month);
|
||||
//$sql.="and monthname(im.CreatedDate) = '".$m."'";
|
||||
$sql.="and monthname(MaterialRcvdDate) = '".$m."'";
|
||||
|
||||
}
|
||||
if($fdate!='' && $tdate!='')
|
||||
{
|
||||
$this->db->where('im.MaterialRcvdDate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"');
|
||||
}
|
||||
|
||||
|
||||
// $this->db->group_by('pom.PONO');
|
||||
$query = $this->db->get();
|
||||
|
||||
return $query->result();
|
||||
if ($fdate and $tdate != ''){
|
||||
$fromd= date("Y-m-d",strtotime($fdate));
|
||||
$tod=date("Y-m-d",strtotime($tdate));
|
||||
|
||||
$sql.="and date(MaterialRcvdDate) >= '".$fromd."'
|
||||
and date(MaterialRcvdDate) <= '".$tod."'";
|
||||
|
||||
}
|
||||
|
||||
|
||||
$sql.="group by pono,igrn";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
function bankinvoice($Customer,$fdate,$tdate)
|
||||
{
|
||||
$this->db->select('iva.invoice_id,iva.invoice_total,iv.invoice_date_created,iv.invoice_number,iva.invoice_paid,ic.client_name,ic.client_id,BI.balancetoreceived,BI.amountreceived');
|
||||
@ -578,32 +616,34 @@ function amountunpaid($supplierid1,$fa,$aa,$m,$fdate,$tdate)
|
||||
|
||||
}
|
||||
function debitbankstatemet($Supplierid,$fdate,$tdate)
|
||||
{
|
||||
{
|
||||
|
||||
$status= array('ST027','ST056');
|
||||
$this->db->select('pom.PONO,pom.TotalOrderValue,sd.SupplierName,sd.SupplierID,im.MaterialRcvdDate,im.CreatedDate,
|
||||
bm.Balancetopay,bm.Amountpaid,im.IGRNO');
|
||||
$this->db->from ('T_PurchaseOrder_Master pom');
|
||||
$this->db->join('T_IGR_Master im','im.PONO=pom.PONO','left');
|
||||
$this->db->join('T_SupplierDetailsN sd','sd.SupplierID=pom.SupplierID','left');
|
||||
$this->db->join('T_Bankporeport bm','bm.PONO=pom.PONO and bm.IsActive = 1','left');
|
||||
$this->db->or_where_in('pom.Status',$status);
|
||||
$this->db->where('pom.Paymentstatus !=','ST070');
|
||||
if ($Supplierid != ''){
|
||||
$this->db->where('sd.SupplierID',$Supplierid);
|
||||
}
|
||||
if($fdate and $tdate != ''){
|
||||
$fromdate= date("Y-m-d",strtotime($fdate));
|
||||
$todate=date("Y-m-d",strtotime($tdate));
|
||||
$date = "date(im.CreatedDate) >= '".$fromdate."'
|
||||
and date(im.CreatedDate) <= '".$todate."'";
|
||||
$this->db->WHERE($date);
|
||||
}
|
||||
$sql="select pono,igrn,potype,date_format(created_date,'%d-%m-%Y') as created_date,date_format(materialrcvddate,'%d-%m-%Y') as materialrcvddate,supplier_name,sid,Balancetopay,Amountpaid,
|
||||
sum(total) as total,file,ifile
|
||||
from bankdebit
|
||||
where Status ='ST027' and PaymentStatus !='ST070'";
|
||||
|
||||
|
||||
|
||||
if ($Supplierid!= ''){
|
||||
|
||||
$sql.="and sid = '".$Supplierid."'";
|
||||
|
||||
$this->db->group_by('pom.PONO');
|
||||
$query = $this->db->get();
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
if ($fdate and $tdate != ''){
|
||||
$fromd= date("Y-m-d",strtotime($fdate));
|
||||
$tod=date("Y-m-d",strtotime($tdate));
|
||||
|
||||
$sql.="and date(MaterialRcvdDate) >= '".$fromd."'
|
||||
and date(MaterialRcvdDate) <= '".$tod."'";
|
||||
|
||||
}
|
||||
|
||||
$sql.="group by pono,igrn";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
|
||||
|
||||
}
|
||||
@ -1729,10 +1769,10 @@ function receiptdata()
|
||||
return $r;
|
||||
|
||||
}
|
||||
function poamountstatus($podetails,$pono)
|
||||
function poamountstatus($igrdetails,$igrno)
|
||||
{
|
||||
$this->db->where('PONO',$pono);
|
||||
$this->db->update('T_PurchaseOrder_Master',$podetails);
|
||||
$this->db->where('IGRNO',$igrno);
|
||||
$this->db->update('T_IGR_Master',$igrdetails);
|
||||
$r = $this->db->affected_rows();
|
||||
return $r;
|
||||
|
||||
@ -1790,12 +1830,12 @@ function receiptdata()
|
||||
return $r;
|
||||
|
||||
}
|
||||
function PoStatusUpdate($pono,$PaymentStatus)
|
||||
function IGRStatusUpdate($igrno,$PaymentStatus)
|
||||
{
|
||||
|
||||
$this->db->set('Paymentstatus',$PaymentStatus);
|
||||
$this->db->where('PONO',$pono);
|
||||
$this->db->update('T_PurchaseOrder_Master');
|
||||
$this->db->where('IGRNO',$igrno);
|
||||
$this->db->update('T_IGR_Master');
|
||||
$r = $this->db->affected_rows();
|
||||
return $r;
|
||||
}
|
||||
@ -1852,12 +1892,12 @@ function receiptdata()
|
||||
// return $r;
|
||||
// }
|
||||
|
||||
function updateBankporeport($pono,$balancetopayupdate,$amountpaidupdate,$IsAct)
|
||||
function updateBankporeport($igrno,$balancetopayupdate,$amountpaidupdate,$IsAct)
|
||||
{
|
||||
$this->db->set('Balancetopay',$balancetopayupdate);
|
||||
$this->db->set('Amountpaid',$amountpaidupdate);
|
||||
$this->db->set('IsActive',$IsAct);
|
||||
$this->db->where('PONO',$pono);
|
||||
$this->db->where('IGRNO',$igrno);
|
||||
//$this->db->where('mid',$Bankid);
|
||||
$this->db->update('T_Bankporeport');
|
||||
$r = $this->db->affected_rows();
|
||||
@ -1886,11 +1926,11 @@ function receiptdata()
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
}
|
||||
function gettotalbankmappingpocount($pono)
|
||||
function gettotalbankmappingpocount($igrno)
|
||||
{
|
||||
$this->db->select('count(Amountpaid)as countAmountpaid');
|
||||
$this->db->from ('T_Bankmappingpo');
|
||||
$this->db->where('PONO',$pono);
|
||||
$this->db->where('IGRNO',$igrno);
|
||||
$this->db->where('IsActive',1);
|
||||
//$this->db->group_by('T_Bankmappingpo.IGRLineItemNo');
|
||||
$query = $this->db->get();
|
||||
@ -1906,11 +1946,11 @@ function receiptdata()
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
}
|
||||
function gettotalbankpoamount($pono)
|
||||
function gettotalbankpoamount($igrno)
|
||||
{
|
||||
$this->db->select('Amountpaid,Balancetopay');
|
||||
$this->db->from ('T_Bankporeport');
|
||||
$this->db->where('PONO',$pono);
|
||||
$this->db->where('IGRNO',$igrno);
|
||||
$this->db->where('IsActive',1);
|
||||
//$this->db->group_by('T_Bankmappingpo.IGRLineItemNo');
|
||||
$query = $this->db->get();
|
||||
|
||||
@ -390,7 +390,8 @@ var paidamount=$('#ap'+i).text();//amountpaid
|
||||
|
||||
var balancetopay=$('#btp'+i).text();//balancetopay
|
||||
|
||||
var Igritemno=$('#igritemno'+i).text();//igritemno
|
||||
var igrno=$('#igrno'+i).text();//igritemno
|
||||
|
||||
var pono=$('#pono'+i).text();//pono
|
||||
|
||||
var bankid=$('#bankingid'+i).val();//bankid
|
||||
@ -404,7 +405,7 @@ var bankingclear=$('#bankingbalclear'+i).val();
|
||||
var clearedbalance=$('#clearbal'+i).val();
|
||||
|
||||
$.ajax({
|
||||
data:{mappingid:mappingid,Totalpoamount:totalamount,paidamount:paidamount,balancetopay:balancetopay,pono:pono,IGRItemNo:Igritemno,bankid:bankid,balancetobankingclear:bankingclear,clearbalance:clearedbalance},
|
||||
data:{mappingid:mappingid,Totalpoamount:totalamount,paidamount:paidamount,balancetopay:balancetopay,pono:pono,igrno:igrno,bankid:bankid,balancetobankingclear:bankingclear,clearbalance:clearedbalance},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>DeletePo",
|
||||
success:function(data)
|
||||
|
||||
@ -108,7 +108,7 @@ foreach($financialyear as $item)
|
||||
{
|
||||
}
|
||||
?>
|
||||
<center><h4 style="color:#3c8dbc"><span><?php echo $t->SupplierName?></span></h4></center>
|
||||
<center><h4 style="color:#3c8dbc"><span><?php echo $t->supplier_name?></span></h4></center>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
@ -249,8 +249,8 @@ foreach($financialyear as $item)
|
||||
<th style="display:none;">IGRNO</th>
|
||||
<!--<th>IGR Item No</th>-->
|
||||
<th>PO Amount (₹)</th>
|
||||
<th>IGR File</th>
|
||||
<th>PO File</th>
|
||||
<th style="display:none;">IGR File</th>
|
||||
<th style="display:none;">PO File</th>
|
||||
<!--<th>Over Due Days</th>DATEDIFF(CURDATE(),T_IGR_Master.MaterialReceivedDate)as days-->
|
||||
|
||||
</tr>
|
||||
@ -268,7 +268,7 @@ foreach($financialyear as $item)
|
||||
$status=$t->Paymentstatus;
|
||||
$balancetopay=$t->Balancetopay;
|
||||
$ReceivedQuantity=$t->ReceivedQuantity;
|
||||
$rate=$t->TotalOrderValue;
|
||||
$rate=$t->total;
|
||||
|
||||
|
||||
|
||||
@ -289,12 +289,12 @@ foreach($financialyear as $item)
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td align="left" id="pono<?php echo $i ?>"><span><?php echo $t->PONO?></span></a></td>
|
||||
<td align="left" id="Ddate<?php echo $i ?>"><span><?php echo date_format(date_create($t->CreatedDate),'d-m-Y');?></span></td>
|
||||
<td align="left" id="Ddate<?php echo $i ?>"><span><?php echo date_format(date_create($t->MaterialRcvdDate),'d-m-Y');?></span></td>
|
||||
<td align="left" id="pono<?php echo $i ?>"><span><?php echo $t->pono?></span></a></td>
|
||||
<td align="left" id="Ddate<?php echo $i ?>"><span><?php echo date_format(date_create($t->created_date),'d-m-Y');?></span></td>
|
||||
<td align="left" id="Ddate<?php echo $i ?>"><span><?php echo date_format(date_create($t->materialrcvddate),'d-m-Y');?></span></td>
|
||||
|
||||
|
||||
<td style="display:none;" align="left" id="igrno<?php echo $i ?>"><span><?php echo $t->IGRNO?></span></a></td>
|
||||
<td style="display:none;" align="left" id="igrno<?php echo $i ?>"><span><?php echo $t->igrn?></span></a></td>
|
||||
|
||||
<!--<td align="left" id="igrlineitem<?php echo $i ?>" ><span><?php echo $t->IGRItemNo?></span></td>-->
|
||||
|
||||
@ -305,13 +305,13 @@ foreach($financialyear as $item)
|
||||
?>
|
||||
|
||||
|
||||
<td> <a data-toggle="tooltip"><i class="fa fa-download" data-toggle="tooltip" title="<?php echo $record->pono; ?> -Attachment Available for Download/View" onclick="igrfile(<?php echo $i ?>)"></i></a> </td>
|
||||
<td style="display:none;"> <a data-toggle="tooltip"><i class="fa fa-download" data-toggle="tooltip" title="<?php echo $record->pono; ?> -Attachment Available for Download/View" onclick="igrfile(<?php echo $i ?>)"></i></a> </td>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<td>NA</td>
|
||||
<td style="display:none;" >NA</td>
|
||||
<?php
|
||||
}
|
||||
|
||||
@ -321,13 +321,13 @@ foreach($financialyear as $item)
|
||||
|
||||
?>
|
||||
|
||||
<td> <a data-toggle="tooltip"><i class="fa fa-download" data-toggle="tooltip" title="<?php echo $record->pono; ?> -Attachment Available for Download/View" onclick="pofile(<?php echo $i ?>)"></i></a> </td>
|
||||
<td style="display:none;" > <a data-toggle="tooltip"><i class="fa fa-download" data-toggle="tooltip" title="<?php echo $record->pono; ?> -Attachment Available for Download/View" onclick="pofile(<?php echo $i ?>)"></i></a> </td>
|
||||
|
||||
|
||||
<?php
|
||||
} else
|
||||
{ ?>
|
||||
<td>N/A</td>
|
||||
<td style="display:none;" >N/A</td>
|
||||
|
||||
|
||||
|
||||
@ -361,8 +361,8 @@ foreach($financialyear as $item)
|
||||
<td class="amount"><strong>
|
||||
<?php echo $tot_amount; ?>
|
||||
</strong></td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td style="display:none;" > </td>
|
||||
<td style="display:none;" > </td>
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
@ -177,21 +177,21 @@ foreach($financialyear as $item)
|
||||
$status=$t->Paymentstatus;
|
||||
$balancetopay=$t->Balancetopay;
|
||||
$ReceivedQuantity=$t->ReceivedQuantity;
|
||||
//$rate=$t->total;
|
||||
$rate=$t->TotalOrderValue;
|
||||
$rate=$t->total;
|
||||
//$rate=$t->TotalOrderValue;
|
||||
if($status !='ST057')
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
|
||||
<td data-name="sell"><input type="checkbox" class="checkboxcheckbox" onchange="GetPayment(<?php echo $i ?>) "id="checkboxcheckbox<?php echo $i ?>" name="checkbox<?php echo $i ?>";></td>
|
||||
<td align="left" id="date<?php echo $i ?>"><span><?php echo date_format(date_create($t->CreatedDate),'d-m-Y');?></span></td>
|
||||
<td align="left" id="date<?php echo $i ?>"><span><?php echo date_format(date_create($t->MaterialRcvdDate),'d-m-Y');?></span></td>
|
||||
<td align="left" id="pono<?php echo $i ?>"><span><?php echo $t->PONO?></span></td>
|
||||
<td align="left" id="igrno<?php echo $i ?>"><span><?php echo $t->IGRNO?></span></td>
|
||||
<td align="left" id="date<?php echo $i ?>"><span><?php echo date_format(date_create($t->created_date),'d-m-Y');?></span></td>
|
||||
<td align="left" id="date<?php echo $i ?>"><span><?php echo date_format(date_create($t->materialrcvddate),'d-m-Y');?></span></td>
|
||||
<td align="left" id="pono<?php echo $i ?>"><span><?php echo $t->pono?></span></td>
|
||||
<td align="left" id="igrno<?php echo $i ?>"><span><?php echo $t->igrn?></span></td>
|
||||
<!--<td align="left" id="igrlineitem<?php echo $i ?>"><span><?php echo trim($t->IGRItemNo)?></span></td>-->
|
||||
<td align="left" id="sn<?php echo $i ?>"><span><?php echo $t->SupplierName?></span></td>
|
||||
<td style="display:none;" align="left" id="sid<?php echo $i ?>"><span><?php echo $t->SupplierID?></span></td>
|
||||
<td align="left" id="sn<?php echo $i ?>"><span><?php echo $t->supplier_name?></span></td>
|
||||
<td style="display:none;" align="left" id="sid<?php echo $i ?>"><span><?php echo $t->sid?></span></td>
|
||||
<td align="left" id="tov<?php echo $i ?>" ><span><?php echo round($rate,2)?></span></td>
|
||||
<td align="left" id="qw<?php echo $i ?>" ><span><?php echo round($rate-$t->Amountpaid,2)?></span></td>
|
||||
<td data-name="sel"><input type="text" onkeypress="return isNumberKey(event)" onchange="GetAmount(<?php echo $i ?>)" id="invoicepaymet<?php echo $i ?>"></td>
|
||||
|
||||
@ -251,8 +251,8 @@ if(!empty($mapping))
|
||||
|
||||
<th>Date</th>
|
||||
<th>PONO</th>
|
||||
<!--<th>IGR NO</th>
|
||||
<th>IGR Item NO</th>-->
|
||||
<th>IGR NO</th>
|
||||
<!--<th>IGR Item NO</th>-->
|
||||
<th>Supplier Name</th>
|
||||
<th>Total PO Amount (₹)</th>
|
||||
<!--<th>Advance PO Amount (₹)</th>-->
|
||||
@ -284,8 +284,8 @@ if(!empty($mapping))
|
||||
|
||||
<td align="left" id="date<?php echo $i ?>"><span><?php echo date_format(date_create($ap->MaterialRcvdDate),'d-m-Y');?></span></td>
|
||||
<td align="left" id="pono<?php echo $i ?>"><!--<a href="<?= base_url() ?>cashbook/mappingdebit?sid=<?php echo $ap->PONO;?>">--><span><?php echo $ap->PONO?></span></a></td>
|
||||
<!--<td align="left" id="igrno<?php echo $i ?>"><span><?php echo $ap->IGRNO?></span></a></td>
|
||||
<td align="left" id="sn<?php echo $i ?>"><span><?php echo $ap->IGRLineItemNo?></span></td>-->
|
||||
<td align="left" id="igrno<?php echo $i ?>"><span><?php echo $ap->IGRNO?></span></a></td>
|
||||
<!--<td align="left" id="sn<?php echo $i ?>"><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<?php echo $i ?>"><span><?php echo $ap->Suppliername?></span></td>
|
||||
@ -342,7 +342,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?>&pono=<?php echo $ap->PONO?>&balancetopay=<?php echo $ap->Balancetopay?>&totalpoamount=<?php echo $ap->Totalpoamount?>&debit=<?php echo $ap->Debit?>"><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->IGRNO?>&balancetopay=<?php echo $ap->Balancetopay?>&totalpoamount=<?php echo $ap->Totalpoamount?>&debit=<?php echo $ap->Debit?>"><i class="fa fa-trash" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Delete details"></i> </a>
|
||||
</td>
|
||||
|
||||
|
||||
@ -365,7 +365,7 @@ if(!empty($mapping))
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
|
||||
<td> </td>
|
||||
<td class="amount"><strong>
|
||||
<?php echo $tot_amount; ?>
|
||||
</strong></td>
|
||||
|
||||
@ -107,7 +107,7 @@ foreach($financialyear as $item)
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<input type="hidden" id="supplierid" name="supplierid" value="<?php echo $t->SupplierID?>">
|
||||
<input type="hidden" id="supplierid" name="supplierid" value="<?php echo $t->sid?>">
|
||||
<!--<input type="text" id="fa" name="fa" value="<?php echo $fa?>">
|
||||
<input type="text" id="ta" name="ta" value="<?php echo $ta?>">
|
||||
<input type="text" id="m" name="m" value="<?php echo $m?>">
|
||||
@ -200,7 +200,7 @@ foreach($financialyear as $item)
|
||||
$status=$t->Paymentstatus;
|
||||
$balancetopay=$t->Balancetopay;
|
||||
$ReceivedQuantity=$t->ReceivedQuantity;
|
||||
$rate=$t->TotalOrderValue;
|
||||
$rate=$t->total;
|
||||
$supplierid=$t->SupplierID;
|
||||
|
||||
if($status !='ST057')
|
||||
@ -211,7 +211,7 @@ foreach($financialyear as $item)
|
||||
|
||||
|
||||
|
||||
<td align="left" id="sn<?php echo $i ?>" ><a href="<?= base_url() ?>cashbook/supplierwise?sid=<?php echo $supplierid;?>&fa=<?php echo $fa?>&aa=<?php echo $aa?>&m=<?php echo $m?>&fdate=<?php echo $fdate?>&tdate=<?php echo $tdate?>"><span><?php echo $t->SupplierName?></span></a></td>
|
||||
<td align="left" id="sn<?php echo $i ?>" ><a href="<?= base_url() ?>cashbook/supplierwise?sid=<?php echo $t->sid;?>&fa=<?php echo $fa?>&aa=<?php echo $aa?>&m=<?php echo $m?>&fdate=<?php echo $fdate?>&tdate=<?php echo $tdate?>"><span><?php echo $t->supplier_name?></span></a></td>
|
||||
<td align="left" id="tov<?php echo $i ?>" ><span><?php $tot_amount=$tot_amount+round($rate)?><?php echo round($rate,2)?></span></td>
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user