From 62d2319aee9306f20ac5bc0fc3da44560589536b Mon Sep 17 00:00:00 2001 From: gayathri1990 Date: Wed, 28 Nov 2018 11:06:34 +0530 Subject: [PATCH] bank amount map based on po --- application/controllers/cashbook.php | 23 +- .../controllers/inwardgateregister.php | 4 +- application/models/cashbook_model.php | 612 ++++-------------- application/views/bankamountpaid.php | 13 +- application/views/bankamountunpaid.php | 41 +- application/views/bankdebit.php | 42 +- application/views/bankunpaidsupp.php | 2 +- 7 files changed, 176 insertions(+), 561 deletions(-) diff --git a/application/controllers/cashbook.php b/application/controllers/cashbook.php index 4e00ea1b..c69ed519 100644 --- a/application/controllers/cashbook.php +++ b/application/controllers/cashbook.php @@ -995,18 +995,14 @@ class cashbook extends BaseController $this->global['pageTitle'] = 'Siddharth : Bank Debit Report'; if ($this->input->post('btn_submit')) { - $Supplierid = $this->input->post('SupplierName'); + $Supplierid = $this->input->post('SupplierName'); $fdate = $this->input->post('from_date'); $tdate = $this->input->post('to_date'); //$data['cash'] = $_GET['sid']; //$data['bankid'] = $_GET['d']; $data['bankdepitpaid'] = $this->cashbook_model->debitbankstatemet($Supplierid,$fdate,$tdate); } - // else - // { - // $data['bankdepitpaid'] = $this->cashbook_model->debitbankstatemet1(); - // //print_r($data['bankdepit']); - // } + $data['getsupplier'] = $this->cashbook_model->getsupplier(); $this->loadViews("bankdebit",$this->global,$data,NULL); //die(); @@ -1148,7 +1144,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'); + $igrno=$this->input->post('igrno'); // $igrlineitem=$this->input->post('igrlineitem'); $sname = $this->input->post('sname'); @@ -1228,13 +1224,13 @@ class cashbook extends BaseController $amtpaid= ($ip+$ePay); $IsActive=1; - $igrno='IGR'; - $igrlineitem='IGRLINo'; - $podata1 = array('Podate'=>$date,'PONO'=>$pono,'IGRNO'=>$igrno,'Suppliername'=>$sname,'SupplierID'=>$sid,'Totalpoamount'=>$tot,'Amountpaid'=>$ip,'Balancetopay'=>$balancetopay,'mid'=>$bankid,'IGRLineItemNo'=>$igrlineitem,'IsActive'=>$IsActive,'BankDate'=>$bankdate); + + + $podata1 = 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); //print_r($podata1); - $podata = array('Podate'=>$date,'PONO'=>$pono,'IGRNO'=>$igrno,'Suppliername'=>$sname,'SupplierID'=>$sid,'Totalpoamount'=>$tot,'Amountpaid'=>$amtpaid,'Balancetopay'=>$balancetopay,'mid'=>$bankid,'IGRLineItemNo'=>$igrlineitem,'IsActive'=>$IsActive,'BankDate'=>$bankdate); + $podata = 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); @@ -1650,10 +1646,7 @@ class cashbook extends BaseController $data['tdate']=$tdate; $data['bankunpaid'] = $this->cashbook_model->suppliertotalfilter($fa,$aa,$m,$fdate,$tdate); } - else - { - $data['bankunpaid'] = $this->cashbook_model->suppliertotal(); - } + $data['finyear']=$this->cashbook_model->report_finyearunpaid(); $data['getsupplier'] = $this->cashbook_model->getsupplier(); $this->loadViews("bankunpaidsupp",$this->global,$data,NULL); diff --git a/application/controllers/inwardgateregister.php b/application/controllers/inwardgateregister.php index 5c0d93ab..00db80ae 100644 --- a/application/controllers/inwardgateregister.php +++ b/application/controllers/inwardgateregister.php @@ -630,8 +630,8 @@ $prefile =array(); $CreatedBy = $this->session->userdata('userId'); - $bankstatus = NO_PAIDIGR; - $igrDetails = array('IGRNO'=>$IGRNO,'MaterialCode'=>$MaterialCode,'QuantityAsPerInvoice'=>$QuantityAsPerInvoice,'Remarks'=>$Remarks,'IGRItemStatus'=>$IGRItemStatus,'CreatedBy'=>$CreatedBy,'CreatedDate'=>$createddt,'BankStatus'=>$bankstatus); + + $igrDetails = array('IGRNO'=>$IGRNO,'MaterialCode'=>$MaterialCode,'QuantityAsPerInvoice'=>$QuantityAsPerInvoice,'Remarks'=>$Remarks,'IGRItemStatus'=>$IGRItemStatus,'CreatedBy'=>$CreatedBy,'CreatedDate'=>$createddt); $igrD = $this->inwardgateregister_model->addigrD($igrDetails); diff --git a/application/models/cashbook_model.php b/application/models/cashbook_model.php index 02d36638..4db2fac2 100644 --- a/application/models/cashbook_model.php +++ b/application/models/cashbook_model.php @@ -429,543 +429,131 @@ function clearedcreditbalance(){ return $query->result(); } - function debitbankstatemet(){ - - $this->db->select('pom.PONO,pom.TotalOrderValue,pom.PODate,sd.SupplierName,sd.SupplierID, - bm.Balancetopay,bm.Amountpaid'); - $this->db->from ('T_PurchaseOrder_Master pom'); - $this->db->join('T_Bankporeport bm','bm.PONO=pom.PONO','left'); - $this->db->join('T_SupplierDetailsN sd','sd.SupplierID=pom.SupplierID','left'); - $this->db->where('pom.Status','ST027'); - $this->db->or_where('pom.Status','ST056'); - $this->db->where('pom.Paymentstatus !=','ST070'); - $this->db->group_by('pom.PONO'); - $query = $this->db->get(); - return $query->result(); - - - } -// function debitbankstatemet($Supplierid,$fdate,$tdate){ - - - // $sql="select im.IGRNO as igrn,pm.POType as potype,im.PONO as PONO,im.IGRNO,id.IGRItemNo,im.MaterialRcvdDate as CreatedDate,br.Balancetopay,br.Amountpaid,sd.SupplierName as SupplierName,sd.SupplierID as SupplierID, -// round(ifnull(if(POType = 'REVENUE', -// (id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.SGST/100)), -// (id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.SGST /100))),0),2) as sgst, -// round(ifnull(if(POType = 'REVENUE', -// (id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.CGST/100)), -// (id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.CGST /100))),0),2) as cgst, -// round(ifnull(if(POType = 'REVENUE', -// (id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.IGST/100)), -// (id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.IGST /100))),0),2) as igst, -// round(ifnull(if(POType = 'REVENUE', -// (id.QuantityAsPerInvoice * pl.Rate)- (rt.AfterDiscount), -// (id.QuantityAsPerInvoice * pl.Rate)- (st.Afterdiscountval)),0),2) as discount, -// round(ifnull(if(POType = 'REVENUE', -// (id.QuantityAsPerInvoice * pl.Rate) + (rt.AfterFreightValue), -// (id.QuantityAsPerInvoice * pl.Rate) + (st.AfterFreightValue)),0),2) as freight, -// round(ifnull(if(POType = 'REVENUE', -// (id.QuantityAsPerInvoice * pl.Rate) +(rt.AfterPackagingValue),0),0),2) as Package, + -// round(( -// if(POType = 'IMPORT',(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)), -// if(POType = 'CAPITAL' && CapitalRange = 0,(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)), -// ifnull((id.QuantityAsPerInvoice * pl.Rate),0))) -// + round(ifnull(if(POType = 'REVENUE', - // (id.QuantityAsPerInvoice * rt.AfterSGST / pl.Quantity), - // (id.QuantityAsPerInvoice * st.After_SGST / pl.Quantity)),0),2) -// + round(ifnull(if(POType = 'REVENUE', - // (id.QuantityAsPerInvoice * rt.AfterCGST / pl.Quantity), - // (id.QuantityAsPerInvoice * st.After_CGST / pl.Quantity)),0),2) -// + round(ifnull(if(POType = 'REVENUE', - // (id.QuantityAsPerInvoice * rt.AfterIGST / pl.Quantity), - // (id.QuantityAsPerInvoice * st.After_IGST / pl.Quantity)),0),2) -// + round(ifnull(if(POType = 'REVENUE', - // (id.QuantityAsPerInvoice * rt.AfterFreightValue / pl.Quantity), - // (id.QuantityAsPerInvoice * st.AfterFreightValue / pl.Quantity)),0),2) -// + round(ifnull(if(POType = 'REVENUE', - // (id.QuantityAsPerInvoice * rt.AfterPackagingValue / pl.Quantity),0),0),2) -// - round(ifnull(if(POType = 'REVENUE', - // (id.QuantityAsPerInvoice * rt.AfterDiscount / pl.Quantity), - // (id.QuantityAsPerInvoice * st.Afterdiscountval / pl.Quantity)),0),2)),2) as total -// from T_IGR_Master im -// left join T_PurchaseOrder_LineItem pl on pl.PONO = im.PONO -// join T_IGR_Details id on id.IGRNO = im.IGRNO and id.MaterialCode = pl.MaterialCode -// join T_PurchaseOrder_Master pm on pm.PONO = pl.PONO -// left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID -// left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo -// left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo -// left join T_Bankporeport br on br.IGRLineItemNo=id.IGRItemNo and br.IsActive = 1 -// where im.IGRStatus = 'ST027' and id.BankStatus!='ST070'"; - - -// if ($Supplierid!= '') - // { - - // $sql.="and sd.SupplierID = '".$Supplierid."'"; - - // } - - - // if ($fdate and $tdate != ''){ - // $fromd= date("Y-m-d",strtotime($fdate)); - // $tod=date("Y-m-d",strtotime($tdate)); - - // $sql.="and date(im.CreatedDate) >= '".$fromd."' - // and date(im.CreatedDate) <= '".$tod."'"; - - // } - - -// $sql.="group by id.IGRItemNo"; -// //echo $sql; - // $query = $this->db->query($sql); - // return $query->result(); - // } - // function debitbankstatemet1(){ - - - // $sql="select im.IGRNO as igrn,pm.POType as potype,im.PONO as PONO,im.IGRNO,id.IGRItemNo,im.MaterialRcvdDate as CreatedDate,br.Balancetopay,br.Amountpaid,sd.SupplierName as SupplierName,sd.SupplierID as SupplierID, -// round(ifnull(if(POType = 'REVENUE', -// (id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.SGST/100)), -// (id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.SGST /100))),0),2) as sgst, -// round(ifnull(if(POType = 'REVENUE', -// (id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.CGST/100)), -// (id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.CGST /100))),0),2) as cgst, -// round(ifnull(if(POType = 'REVENUE', -// (id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.IGST/100)), -// (id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.IGST /100))),0),2) as igst, -// round(ifnull(if(POType = 'REVENUE', -// (id.QuantityAsPerInvoice * pl.Rate)- (rt.AfterDiscount), -// (id.QuantityAsPerInvoice * pl.Rate)- (st.Afterdiscountval)),0),2) as discount, -// round(ifnull(if(POType = 'REVENUE', -// (id.QuantityAsPerInvoice * pl.Rate) + (rt.AfterFreightValue), -// (id.QuantityAsPerInvoice * pl.Rate) + (st.AfterFreightValue)),0),2) as freight, -// round(ifnull(if(POType = 'REVENUE', -// (id.QuantityAsPerInvoice * pl.Rate) +(rt.AfterPackagingValue),0),0),2) as Package, - -// round(( -// if(POType = 'IMPORT',(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)), -// if(POType = 'CAPITAL' && CapitalRange = 0,(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)), -// ifnull((id.QuantityAsPerInvoice * pl.Rate),0))) -// + round(ifnull(if(POType = 'REVENUE', - // (id.QuantityAsPerInvoice * rt.AfterSGST / pl.Quantity), - // (id.QuantityAsPerInvoice * st.After_SGST / pl.Quantity)),0),2) -// + round(ifnull(if(POType = 'REVENUE', - // (id.QuantityAsPerInvoice * rt.AfterCGST / pl.Quantity), - // (id.QuantityAsPerInvoice * st.After_CGST / pl.Quantity)),0),2) -// + round(ifnull(if(POType = 'REVENUE', - // (id.QuantityAsPerInvoice * rt.AfterIGST / pl.Quantity), - // (id.QuantityAsPerInvoice * st.After_IGST / pl.Quantity)),0),2) -// + round(ifnull(if(POType = 'REVENUE', - // (id.QuantityAsPerInvoice * rt.AfterFreightValue / pl.Quantity), - // (id.QuantityAsPerInvoice * st.AfterFreightValue / pl.Quantity)),0),2) -// + round(ifnull(if(POType = 'REVENUE', - // (id.QuantityAsPerInvoice * rt.AfterPackagingValue / pl.Quantity),0),0),2) -// - round(ifnull(if(POType = 'REVENUE', - // (id.QuantityAsPerInvoice * rt.AfterDiscount / pl.Quantity), - // (id.QuantityAsPerInvoice * st.Afterdiscountval / pl.Quantity)),0),2)),2) as total -// from T_IGR_Master im -// left join T_PurchaseOrder_LineItem pl on pl.PONO = im.PONO -// join T_IGR_Details id on id.IGRNO = im.IGRNO and id.MaterialCode = pl.MaterialCode -// join T_PurchaseOrder_Master pm on pm.PONO = pl.PONO -// left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID -// left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo -// left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo -// left join T_Bankporeport br on br.IGRLineItemNo=id.IGRItemNo -// where im.IGRStatus = 'ST027' and id.BankStatus !='ST070'"; - -// $sql.=" group by id.IGRItemNo"; -// //echo $sql; - // $query = $this->db->query($sql); - // return $query->result(); - // } - // function bank_finyear(){ - - // $sql="SELECT - // CASE WHEN MONTH(MaterialRcvdDate)>=4 - // THEN concat(YEAR(MaterialRcvdDate), '-',YEAR(MaterialRcvdDate)+1) - // ELSE concat(YEAR(MaterialRcvdDate)-1,'-', YEAR(MaterialRcvdDate)) - // END AS financial_year - // FROM T_IGR_Master - // GROUP BY financial_year"; - // $query = $this->db->query($sql); - // return $query->result(); - - // } - // function debitbankstatemet($Supplierid,$fdate,$tdate) - // { - // echo $Supplierid; - // $status='ST057'; - // //echo $tdate; - // //die(); - // // +rt.SGST/100+rt.IGST/100)) - // //$Supplierid; - // $this->db->distinct(); - // $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,((igrli.QuantityAsPerInvoice * poli.Rate)+(rt.FreightValue)-(rt.DiscountValue))+((igrli.QuantityAsPerInvoice * poli.Rate)*(rt.CGST/100))+((igrli.QuantityAsPerInvoice * poli.Rate)*(rt.SGST as rtsgst/100))+((igrli.QuantityAsPerInvoice * poli.Rate)*(rt.IGST as rtigst/100))+((igrli.QuantityAsPerInvoice * poli.Rate)*(st.IGST as stigst/100))+((igrli.QuantityAsPerInvoice * poli.Rate)*(st.SGST as stsgst/100))+((igrli.QuantityAsPerInvoice * poli.Rate)*(st.CGST /100)) as finalamount'); - - // $this->db->from ('T_IGR_Details igrli'); - // $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_Revenue_Tax rt','poli.LineItemNo=rt.LineItemNo','left'); - // $this->db->join('T_Service_Tax st','poli.LineItemNo=st.LineItemNo','left'); - // $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."' - // and date(igr.CreatedDate) <= '".$todate."'"; - // $this->db->where($date); - // } - // if ($Supplierid != ''){ - // $this->db->where('supp.SupplierID',$Supplierid); - // } - // $this->db->where_in('igr.IGRStatus','ST027'); - // //$this->db->where_in('pom.Status',[ST044,ST056]); - // $this->db->where('igrli.BankStatus !=','ST070'); - // $this->db->group_by('igrli.IGRItemNo'); - // $query = $this->db->get(); - // return $query->result(); - - // } - function suppliertotal() - { - $sql="select sd.SupplierName as SupplierName,sd.SupplierID,im.CreatedDate, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.SGST/100)), -(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.SGST /100))),0),2) as sgst, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.CGST/100)), -(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.CGST /100))),0),2) as cgst, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.IGST/100)), -(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.IGST /100))),0),2) as igst, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate)- (rt.AfterDiscount), -(id.QuantityAsPerInvoice * pl.Rate)- (st.Afterdiscountval)),0),2) as discount, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate) + (rt.AfterFreightValue), -(id.QuantityAsPerInvoice * pl.Rate) + (st.AfterFreightValue)),0),2) as freight, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate) +(rt.AfterPackagingValue),0),0),2) as Package, - -sum(round(( -if(POType = 'IMPORT',(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)), -if(POType = 'CAPITAL' && CapitalRange = 0,(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)), -ifnull((id.QuantityAsPerInvoice * pl.Rate),0))) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterSGST / pl.Quantity), - (id.QuantityAsPerInvoice * st.After_SGST / pl.Quantity)),0),2) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterCGST / pl.Quantity), - (id.QuantityAsPerInvoice * st.After_CGST / pl.Quantity)),0),2) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterIGST / pl.Quantity), - (id.QuantityAsPerInvoice * st.After_IGST / pl.Quantity)),0),2) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterFreightValue / pl.Quantity), - (id.QuantityAsPerInvoice * st.AfterFreightValue / pl.Quantity)),0),2) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterPackagingValue / pl.Quantity),0),0),2) -- round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterDiscount / pl.Quantity), - (id.QuantityAsPerInvoice * st.Afterdiscountval / pl.Quantity)),0),2)),2)) as total -from T_IGR_Master im -left join T_PurchaseOrder_LineItem pl on pl.PONO = im.PONO -join T_IGR_Details id on id.IGRNO = im.IGRNO and id.MaterialCode = pl.MaterialCode -join T_PurchaseOrder_Master pm on pm.PONO = pl.PONO -left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID -left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo -left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo -left join T_Bankporeport br on br.IGRLineItemNo=id.IGRItemNo -where im.IGRStatus = 'ST027' and id.BankStatus ='ST072'"; - - -if ($Supplierid!= ''){ - - $sql.="and sd.SupplierID = '".$Supplierid."'"; - - } - - - if ($fdate and $tdate != ''){ - $fromd= date("Y-m-d",strtotime($fdate)); - $tod=date("Y-m-d",strtotime($tdate)); - - $sql.="and date(im.CreatedDate) >= '".$fromd."' - and date(im.CreatedDate) <= '".$tod."'"; - - } - - -$sql.="group by sd.SupplierID"; -//echo $sql; - $query = $this->db->query($sql); - return $query->result(); - - } + + function suppliertotalfilter($fa,$aa,$m,$fdate,$tdate) { - $sql="select sd.SupplierName as SupplierName,sd.SupplierID,im.MaterialRcvdDate, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.SGST/100)), -(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.SGST /100))),0),2) as sgst, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.CGST/100)), -(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.CGST /100))),0),2) as cgst, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.IGST/100)), -(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.IGST /100))),0),2) as igst, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate)- (rt.AfterDiscount), -(id.QuantityAsPerInvoice * pl.Rate)- (st.Afterdiscountval)),0),2) as discount, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate) + (rt.AfterFreightValue), -(id.QuantityAsPerInvoice * pl.Rate) + (st.AfterFreightValue)),0),2) as freight, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate) +(rt.AfterPackagingValue),0),0),2) as Package, - -sum(round(( -if(POType = 'IMPORT',(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)), -if(POType = 'CAPITAL' && CapitalRange = 0,(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)), -ifnull((id.QuantityAsPerInvoice * pl.Rate),0))) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterSGST / pl.Quantity), - (id.QuantityAsPerInvoice * st.After_SGST / pl.Quantity)),0),2) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterCGST / pl.Quantity), - (id.QuantityAsPerInvoice * st.After_CGST / pl.Quantity)),0),2) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterIGST / pl.Quantity), - (id.QuantityAsPerInvoice * st.After_IGST / pl.Quantity)),0),2) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterFreightValue / pl.Quantity), - (id.QuantityAsPerInvoice * st.AfterFreightValue / pl.Quantity)),0),2) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterPackagingValue / pl.Quantity),0),0),2) -- round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterDiscount / pl.Quantity), - (id.QuantityAsPerInvoice * st.Afterdiscountval / pl.Quantity)),0),2)),2)) as total -from T_IGR_Master im -left join T_PurchaseOrder_LineItem pl on pl.PONO = im.PONO -join T_IGR_Details id on id.IGRNO = im.IGRNO and id.MaterialCode = pl.MaterialCode -join T_PurchaseOrder_Master pm on pm.PONO = pl.PONO -left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID -left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo -left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo -left join T_Bankporeport br on br.IGRLineItemNo=id.IGRItemNo -where im.IGRStatus = 'ST027' and id.BankStatus ='ST072'"; - - - - if ($fa and $aa != ''){ - - //$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')"; - $sql.=" and (im.MaterialRcvdDate >= '".$fa."-04-01' and im.MaterialRcvdDate <= '".$aa."-03-31')"; - + $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); } if ($m!= ''){ - //$sql.="and monthname(im.CreatedDate) = '".$m."'"; - $sql.="and monthname(im.MaterialRcvdDate) = '".$m."'"; + $month="monthname(im.MaterialRcvdDate) = '".$m."'"; + $this->db->where($month); } - - - if ($fdate and $tdate != ''){ - $fromd= date("Y-m-d",strtotime($fdate)); - $tod=date("Y-m-d",strtotime($tdate)); - - $sql.="and date(im.MaterialRcvdDate) >= '".$fromd."' - and date(im.MaterialRcvdDate) <= '".$tod."'"; - - } - - -$sql.="group by sd.SupplierName"; -//echo $sql; - $query = $this->db->query($sql); - return $query->result(); + 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(); + } -function amountunpaid($supplierid,$fa,$aa,$m,$fdate,$tdate) +function amountunpaid($supplierid1,$fa,$aa,$m,$fdate,$tdate) { - $sql="select im.IGRNO as igrn,pm.POType as potype,im.PONO as PONO,im.IGRNO,id.IGRItemNo,im.MaterialRcvdDate,im.DeliveryChellanDate,im.CreatedDate,br.Balancetopay,br.Amountpaid,sd.SupplierName as SupplierName,bu.FilePath as poFilePath ,bu.BillNo,inward.FilePath as iwFpath, sd.SupplierID,im.DeliveryChellanOrInvoiceNo,DATEDIFF(CURDATE(),id.CreatedDate)as days, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate)+(rt.AfterSGST), -(id.QuantityAsPerInvoice * pl.Rate)+(st.After_SGST )),0),2) as sgst, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate)+(rt.AfterCGST), -(id.QuantityAsPerInvoice * pl.Rate)+(st.After_CGST)),0),2) as cgst, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate)+(rt.AfterIGST), -(id.QuantityAsPerInvoice * pl.Rate)+(st.After_IGST)),0),2) as igst, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate)- (rt.AfterDiscount), -(id.QuantityAsPerInvoice * pl.Rate)- (st.Afterdiscountval)),0),2) as discount, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate) + (rt.AfterFreightValue), -(id.QuantityAsPerInvoice * pl.Rate) + (st.AfterFreightValue)),0),2) as freight, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate) +(rt.AfterPackagingValue),0),0),2) as Package, - -round(( -if(POType = 'IMPORT',(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)), -if(POType = 'CAPITAL' && CapitalRange = 0,(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)), -ifnull((id.QuantityAsPerInvoice * pl.Rate),0))) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterSGST / pl.Quantity), - (id.QuantityAsPerInvoice * st.After_SGST / pl.Quantity)),0),2) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterCGST / pl.Quantity), - (id.QuantityAsPerInvoice * st.After_CGST / pl.Quantity)),0),2) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterIGST / pl.Quantity), - (id.QuantityAsPerInvoice * st.After_IGST / pl.Quantity)),0),2) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterFreightValue / pl.Quantity), - (id.QuantityAsPerInvoice * st.AfterFreightValue / pl.Quantity)),0),2) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterPackagingValue / pl.Quantity),0),0),2) -- round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterDiscount / pl.Quantity), - (id.QuantityAsPerInvoice * st.Afterdiscountval / pl.Quantity)),0),2)),2) as total -from T_IGR_Master im -left join T_PurchaseOrder_LineItem pl on pl.PONO = im.PONO -join T_IGR_Details id on id.IGRNO = im.IGRNO and id.MaterialCode = pl.MaterialCode -join T_PurchaseOrder_Master pm on pm.PONO = pl.PONO -left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID -left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo -left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo -left join T_Bankporeport br on br.IGRLineItemNo=id.IGRItemNo -left join T_Inwardgateregister_fileupload inward on inward.IGRNO =im.IGRNO -left join T_PurchaseOrder_BillUpload bu on bu.PONO=pm.PONO -where im.IGRStatus = 'ST027' and id.BankStatus ='ST072' and sd.SupplierID='".$supplierid."'"; + $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); if ($fa and $aa != ''){ - - //$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')"; - $sql.=" and (im.MaterialRcvdDate >= '".$fa."-04-01' and im.MaterialRcvdDate <= '".$aa."-03-31')"; - + $year="(im.MaterialRcvdDate >= '".$fa."-04-01' and im.MaterialRcvdDate <= '".$aa."-03-31')"; + $this->db->where($year); } if ($m!= ''){ - //$sql.="and monthname(im.CreatedDate) = '".$m."'"; - $sql.="and monthname(im.MaterialRcvdDate) = '".$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)).'"'); + } - if ($fdate and $tdate != ''){ - $fromd= date("Y-m-d",strtotime($fdate)); - $tod=date("Y-m-d",strtotime($tdate)); - - $sql.="and date(im.MaterialRcvdDate) >= '".$fromd."' - and date(im.MaterialRcvdDate) <= '".$tod."'"; - - } -$sql.="group by id.IGRItemNo"; -//echo $sql; - $query = $this->db->query($sql); - return $query->result(); + //$this->db->group_by('pom.PONO'); + $query = $this->db->get(); + return $query->result(); } function amountunpaidfilter($sd,$fa,$aa,$m,$fdate,$tdate) { - $sql="select im.IGRNO as igrn,pm.POType as potype,im.PONO as PONO,im.IGRNO,id.IGRItemNo,im.MaterialRcvdDate,im.DeliveryChellanDate,im.CreatedDate,br.Balancetopay,br.Amountpaid,sd.SupplierName as SupplierName,sd.SupplierID,im.DeliveryChellanOrInvoiceNo,DATEDIFF(CURDATE(),id.CreatedDate)as days, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate)+(rt.AfterSGST), -(id.QuantityAsPerInvoice * pl.Rate)+(st.After_SGST )),0),2) as sgst, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate)+(rt.AfterCGST), -(id.QuantityAsPerInvoice * pl.Rate)+(st.After_CGST)),0),2) as cgst, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate)+(rt.AfterIGST), -(id.QuantityAsPerInvoice * pl.Rate)+(st.After_IGST)),0),2) as igst, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate)- (rt.AfterDiscount), -(id.QuantityAsPerInvoice * pl.Rate)- (st.Afterdiscountval)),0),2) as discount, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate) + (rt.AfterFreightValue), -(id.QuantityAsPerInvoice * pl.Rate) + (st.AfterFreightValue)),0),2) as freight, -round(ifnull(if(POType = 'REVENUE', -(id.QuantityAsPerInvoice * pl.Rate) +(rt.AfterPackagingValue),0),0),2) as Package, + $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); -round(( -if(POType = 'IMPORT',(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)), -if(POType = 'CAPITAL' && CapitalRange = 0,(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)), -ifnull((id.QuantityAsPerInvoice * pl.Rate),0))) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterSGST / pl.Quantity), - (id.QuantityAsPerInvoice * st.After_SGST / pl.Quantity)),0),2) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterCGST / pl.Quantity), - (id.QuantityAsPerInvoice * st.After_CGST / pl.Quantity)),0),2) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterIGST / pl.Quantity), - (id.QuantityAsPerInvoice * st.After_IGST / pl.Quantity)),0),2) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterFreightValue / pl.Quantity), - (id.QuantityAsPerInvoice * st.AfterFreightValue / pl.Quantity)),0),2) -+ round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterPackagingValue / pl.Quantity),0),0),2) -- round(ifnull(if(POType = 'REVENUE', - (id.QuantityAsPerInvoice * rt.AfterDiscount / pl.Quantity), - (id.QuantityAsPerInvoice * st.Afterdiscountval / pl.Quantity)),0),2)),2) as total -from T_IGR_Master im -left join T_PurchaseOrder_LineItem pl on pl.PONO = im.PONO -join T_IGR_Details id on id.IGRNO = im.IGRNO and id.MaterialCode = pl.MaterialCode -join T_PurchaseOrder_Master pm on pm.PONO = pl.PONO -left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID -left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo -left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo -left join T_Bankporeport br on br.IGRLineItemNo=id.IGRItemNo -where im.IGRStatus = 'ST027' and id.BankStatus ='ST072' and sd.SupplierID='".$sd."'"; - - - - if ($fa and $aa != ''){ - - //$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')"; - $sql.=" and (im.MaterialRcvdDate >= '".$fa."-04-01' and im.MaterialRcvdDate <= '".$aa."-03-31')"; - + if ($fa and $aa != ''){ + $year="(im.MaterialRcvdDate >= '".$fa."-04-01' and im.MaterialRcvdDate <= '".$aa."-03-31')"; + $this->db->where($year); } - if ($m!= ''){ - //$sql.="and monthname(im.CreatedDate) = '".$m."'"; - $sql.="and monthname(im.MaterialRcvdDate) = '".$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)).'"'); + } - if ($fdate and $tdate != ''){ - $fromd= date("Y-m-d",strtotime($fdate)); - $tod=date("Y-m-d",strtotime($tdate)); - - $sql.="and date(im.MaterialRcvdDate) >= '".$fromd."' - and date(im.MaterialRcvdDate) <= '".$tod."'"; + + // $this->db->group_by('pom.PONO'); + $query = $this->db->get(); + + return $query->result(); } -$sql.="group by id.IGRItemNo"; -//echo $sql; - $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'); + $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'); $this->db->from ('ip_invoice_amounts iva'); $this->db->join ('ip_invoices iv','iva.invoice_id = iv.invoice_id'); $this->db->join ('ip_clients ic','iv.client_id = ic.client_id','left'); @@ -989,6 +577,36 @@ $sql.="group by id.IGRItemNo"; return $query->result(); } + 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); + } + + $this->db->group_by('pom.PONO'); + $query = $this->db->get(); + + return $query->result(); + + + } function receivedamount($Customer,$fdate,$tdate) { // $status='ST065'; @@ -1063,7 +681,7 @@ function receiptdata() { $this->db->select('bm.id,bm.mid,bm.PONO,bm.Suppliername,bm.Totalpoamount,bm.Podate,bm.BankDate, bm.Balancetopay,bm.Amountpaid,bm.IGRNO,bm.IGRLineItemNo,br.Balancetocleared,br.Clearbalance, - inward.FilePath as igrfile,bu.FilePath pofile'); + inward.FilePath as igrfile,bu.FilePath as pofile'); $this->db->from ('T_Bankmappingpo bm'); // $this->db->join('T_IGR_Details igr','igr.IGRItemNo=bm.IGRLineItemNo'); $this->db->join('T_Inwardgateregister_fileupload inward','inward.IGRNO =bm.IGRNO','left'); @@ -1872,15 +1490,11 @@ function receiptdata() $this->db->select('bm.id,bm.mid,bm.PONO,bm.Suppliername,bm.SupplierID,sum(bm.Totalpoamount)as Totalpoamount, bm.Balancetopay,sum(bm.Amountpaid) as Amountpaid,bm.Podate,bm.IGRLineItemNo,bm.BankDate'); $this->db->from ('T_Bankmappingpo bm'); - //$this->db->join('T_bankreport br','br.ID=bm.mid'); - //$this->db->join('T_IGR_Details igr','igr.IGRItemNo=bm.IGRLineItemNo'); - //$this->db->where('igr.BankStatus !=',ST072); $this->db->where('bm.IsActive',1); if ($fa and $aa != ''){ - //$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')"; $year="(bm.BankDate >= '".$fa."-04-01' and bm.BankDate <= '".$aa."-03-31')"; $this->db->where($year); } diff --git a/application/views/bankamountpaid.php b/application/views/bankamountpaid.php index 0364c06a..bcafae25 100644 --- a/application/views/bankamountpaid.php +++ b/application/views/bankamountpaid.php @@ -64,7 +64,7 @@ if(!empty($amountpaid))
- +