bank amount map based on po
This commit is contained in:
parent
0cf127b637
commit
62d2319aee
@ -1002,11 +1002,7 @@ class cashbook extends BaseController
|
|||||||
//$data['bankid'] = $_GET['d'];
|
//$data['bankid'] = $_GET['d'];
|
||||||
$data['bankdepitpaid'] = $this->cashbook_model->debitbankstatemet($Supplierid,$fdate,$tdate);
|
$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();
|
$data['getsupplier'] = $this->cashbook_model->getsupplier();
|
||||||
$this->loadViews("bankdebit",$this->global,$data,NULL);
|
$this->loadViews("bankdebit",$this->global,$data,NULL);
|
||||||
//die();
|
//die();
|
||||||
@ -1148,7 +1144,7 @@ class cashbook extends BaseController
|
|||||||
$bankdate = date_create($bankdate);//,'Y-m-d');
|
$bankdate = date_create($bankdate);//,'Y-m-d');
|
||||||
$bankdate = date_format($bankdate,'Y-m-d');
|
$bankdate = date_format($bankdate,'Y-m-d');
|
||||||
$pono = $this->input->post('pono');
|
$pono = $this->input->post('pono');
|
||||||
// $igrno=$this->input->post('igrno');
|
$igrno=$this->input->post('igrno');
|
||||||
// $igrlineitem=$this->input->post('igrlineitem');
|
// $igrlineitem=$this->input->post('igrlineitem');
|
||||||
|
|
||||||
$sname = $this->input->post('sname');
|
$sname = $this->input->post('sname');
|
||||||
@ -1228,13 +1224,13 @@ class cashbook extends BaseController
|
|||||||
|
|
||||||
$amtpaid= ($ip+$ePay);
|
$amtpaid= ($ip+$ePay);
|
||||||
$IsActive=1;
|
$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);
|
$resultn = $this->cashbook_model->mappingpo($podata1);
|
||||||
//print_r($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();
|
//die();
|
||||||
|
|
||||||
$result3 = $this->cashbook_model->getpono($pono);
|
$result3 = $this->cashbook_model->getpono($pono);
|
||||||
@ -1650,10 +1646,7 @@ class cashbook extends BaseController
|
|||||||
$data['tdate']=$tdate;
|
$data['tdate']=$tdate;
|
||||||
$data['bankunpaid'] = $this->cashbook_model->suppliertotalfilter($fa,$aa,$m,$fdate,$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['finyear']=$this->cashbook_model->report_finyearunpaid();
|
||||||
$data['getsupplier'] = $this->cashbook_model->getsupplier();
|
$data['getsupplier'] = $this->cashbook_model->getsupplier();
|
||||||
$this->loadViews("bankunpaidsupp",$this->global,$data,NULL);
|
$this->loadViews("bankunpaidsupp",$this->global,$data,NULL);
|
||||||
|
|||||||
@ -630,8 +630,8 @@ $prefile =array();
|
|||||||
$CreatedBy = $this->session->userdata('userId');
|
$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);
|
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
|
||||||
|
|
||||||
|
|||||||
@ -429,542 +429,130 @@ function clearedcreditbalance(){
|
|||||||
return $query->result();
|
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)
|
function suppliertotalfilter($fa,$aa,$m,$fdate,$tdate)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$sql="select sd.SupplierName as SupplierName,sd.SupplierID,im.MaterialRcvdDate,
|
$status= array('ST027','ST056');
|
||||||
round(ifnull(if(POType = 'REVENUE',
|
$this->db->select('pom.PONO,sum(pom.TotalOrderValue) as TotalOrderValue,sd.SupplierName,sd.SupplierID,im.MaterialRcvdDate,im.CreatedDate');
|
||||||
(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.SGST/100)),
|
$this->db->from ('T_PurchaseOrder_Master pom');
|
||||||
(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.SGST /100))),0),2) as sgst,
|
$this->db->join('T_IGR_Master im','pom.PONO=im.PONO','left');
|
||||||
round(ifnull(if(POType = 'REVENUE',
|
$this->db->join('T_SupplierDetailsN sd','pom.SupplierID=sd.SupplierID','left');
|
||||||
(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.CGST/100)),
|
$this->db->or_where_in('pom.Status',$status);
|
||||||
(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.CGST /100))),0),2) as cgst,
|
$this->db->where('pom.Paymentstatus',NO_PAIDIGR);
|
||||||
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 != ''){
|
if ($fa and $aa != ''){
|
||||||
|
$year="(im.MaterialRcvdDate >= '".$fa."-04-01' and im.MaterialRcvdDate <= '".$aa."-03-31')";
|
||||||
//$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
$this->db->where($year);
|
||||||
$sql.=" and (im.MaterialRcvdDate >= '".$fa."-04-01' and im.MaterialRcvdDate <= '".$aa."-03-31')";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($m!= ''){
|
if ($m!= ''){
|
||||||
|
|
||||||
//$sql.="and monthname(im.CreatedDate) = '".$m."'";
|
$month="monthname(im.MaterialRcvdDate) = '".$m."'";
|
||||||
$sql.="and monthname(im.MaterialRcvdDate) = '".$m."'";
|
$this->db->where($month);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if($fdate!='' && $tdate!='')
|
||||||
|
{
|
||||||
if ($fdate and $tdate != ''){
|
$this->db->where('im.MaterialRcvdDate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($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(array("sd.SupplierID", "pom.PONO"));
|
||||||
|
$this->db->group_by('sd.SupplierID','pom.PONO');
|
||||||
|
//$this->db->group_by('pom.PONO');
|
||||||
|
$query = $this->db->get();
|
||||||
|
|
||||||
|
|
||||||
$sql.="group by sd.SupplierName";
|
|
||||||
//echo $sql;
|
|
||||||
$query = $this->db->query($sql);
|
|
||||||
return $query->result();
|
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,
|
$status= array('ST027','ST056');
|
||||||
round(ifnull(if(POType = 'REVENUE',
|
$this->db->select('pom.PONO,pom.TotalOrderValue,sd.SupplierName,sd.SupplierID,im.MaterialRcvdDate,im.CreatedDate,
|
||||||
(id.QuantityAsPerInvoice * pl.Rate)+(rt.AfterSGST),
|
im.IGRNO');
|
||||||
(id.QuantityAsPerInvoice * pl.Rate)+(st.After_SGST )),0),2) as sgst,
|
$this->db->from('T_PurchaseOrder_Master pom');
|
||||||
round(ifnull(if(POType = 'REVENUE',
|
//$this->db->join('T_PurchaseOrder_BillUpload bu','pom.PONO=bu.PONO','left');,inward.FilePath as iwFpath,bu.FilePath as poFilePath
|
||||||
(id.QuantityAsPerInvoice * pl.Rate)+(rt.AfterCGST),
|
$this->db->join('T_IGR_Master im','im.PONO = pom.PONO','left');
|
||||||
(id.QuantityAsPerInvoice * pl.Rate)+(st.After_CGST)),0),2) as cgst,
|
$this->db->join('T_SupplierDetailsN sd','sd.SupplierID=pom.SupplierID','left');
|
||||||
round(ifnull(if(POType = 'REVENUE',
|
// $this->db->join('T_Bankporeport bm','bm.PONO=pom.PONO and bm.IsActive = 1','left');
|
||||||
(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((
|
//$this->db->join('T_Inwardgateregister_fileupload inward','inward.IGRNO =im.IGRNO','left');
|
||||||
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)))
|
$this->db->or_where_in('pom.Status',$status);
|
||||||
+ round(ifnull(if(POType = 'REVENUE',
|
$this->db->where('pom.Paymentstatus ',NO_PAIDIGR);
|
||||||
(id.QuantityAsPerInvoice * rt.AfterSGST / pl.Quantity),
|
$this->db->where('sd.SupplierID',$supplierid1);
|
||||||
(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."'";
|
|
||||||
|
|
||||||
if ($fa and $aa != ''){
|
if ($fa and $aa != ''){
|
||||||
|
$year="(im.MaterialRcvdDate >= '".$fa."-04-01' and im.MaterialRcvdDate <= '".$aa."-03-31')";
|
||||||
//$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
$this->db->where($year);
|
||||||
$sql.=" and (im.MaterialRcvdDate >= '".$fa."-04-01' and im.MaterialRcvdDate <= '".$aa."-03-31')";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($m!= ''){
|
if ($m!= ''){
|
||||||
|
|
||||||
//$sql.="and monthname(im.CreatedDate) = '".$m."'";
|
$month="monthname(im.MaterialRcvdDate) = '".$m."'";
|
||||||
$sql.="and 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 != ''){
|
//$this->db->group_by('pom.PONO');
|
||||||
$fromd= date("Y-m-d",strtotime($fdate));
|
$query = $this->db->get();
|
||||||
$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();
|
return $query->result();
|
||||||
}
|
}
|
||||||
function amountunpaidfilter($sd,$fa,$aa,$m,$fdate,$tdate)
|
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,
|
$status= array('ST027','ST056');
|
||||||
round(ifnull(if(POType = 'REVENUE',
|
$this->db->select('pom.PONO,pom.TotalOrderValue,sd.SupplierName,sd.SupplierID,im.MaterialRcvdDate,im.CreatedDate,
|
||||||
(id.QuantityAsPerInvoice * pl.Rate)+(rt.AfterSGST),
|
im.IGRNO');
|
||||||
(id.QuantityAsPerInvoice * pl.Rate)+(st.After_SGST )),0),2) as sgst,
|
$this->db->from ('T_PurchaseOrder_Master pom');
|
||||||
round(ifnull(if(POType = 'REVENUE',
|
//$this->db->join('T_PurchaseOrder_BillUpload bu','pom.PONO=bu.PONO','left');
|
||||||
(id.QuantityAsPerInvoice * pl.Rate)+(rt.AfterCGST),
|
$this->db->join('T_IGR_Master im','im.PONO=pom.PONO','left');
|
||||||
(id.QuantityAsPerInvoice * pl.Rate)+(st.After_CGST)),0),2) as cgst,
|
$this->db->join('T_SupplierDetailsN sd','sd.SupplierID=pom.SupplierID','left');
|
||||||
round(ifnull(if(POType = 'REVENUE',
|
//$this->db->join('T_Bankporeport bm','bm.PONO=pom.PONO and bm.IsActive = 1','left');
|
||||||
(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
|
|
||||||
where im.IGRStatus = 'ST027' and id.BankStatus ='ST072' and sd.SupplierID='".$sd."'";
|
|
||||||
|
|
||||||
|
|
||||||
|
//$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);
|
||||||
|
|
||||||
if ($fa and $aa != ''){
|
if ($fa and $aa != ''){
|
||||||
|
$year="(im.MaterialRcvdDate >= '".$fa."-04-01' and im.MaterialRcvdDate <= '".$aa."-03-31')";
|
||||||
//$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
|
$this->db->where($year);
|
||||||
$sql.=" and (im.MaterialRcvdDate >= '".$fa."-04-01' and im.MaterialRcvdDate <= '".$aa."-03-31')";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($m!= ''){
|
if ($m!= ''){
|
||||||
|
|
||||||
//$sql.="and monthname(im.CreatedDate) = '".$m."'";
|
$month="monthname(im.MaterialRcvdDate) = '".$m."'";
|
||||||
$sql.="and monthname(im.MaterialRcvdDate) = '".$m."'";
|
$this->db->where($month);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if($fdate!='' && $tdate!='')
|
||||||
if ($fdate and $tdate != ''){
|
{
|
||||||
$fromd= date("Y-m-d",strtotime($fdate));
|
$this->db->where('im.MaterialRcvdDate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"');
|
||||||
$tod=date("Y-m-d",strtotime($tdate));
|
|
||||||
|
|
||||||
$sql.="and date(im.MaterialRcvdDate) >= '".$fromd."'
|
|
||||||
and date(im.MaterialRcvdDate) <= '".$tod."'";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$sql.="group by id.IGRItemNo";
|
// $this->db->group_by('pom.PONO');
|
||||||
//echo $sql;
|
$query = $this->db->get();
|
||||||
$query = $this->db->query($sql);
|
|
||||||
return $query->result();
|
return $query->result();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function bankinvoice($Customer,$fdate,$tdate)
|
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->from ('ip_invoice_amounts iva');
|
||||||
$this->db->join ('ip_invoices iv','iva.invoice_id = iv.invoice_id');
|
$this->db->join ('ip_invoices iv','iva.invoice_id = iv.invoice_id');
|
||||||
@ -988,6 +576,36 @@ $sql.="group by id.IGRItemNo";
|
|||||||
|
|
||||||
return $query->result();
|
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)
|
function receivedamount($Customer,$fdate,$tdate)
|
||||||
{
|
{
|
||||||
@ -1063,7 +681,7 @@ function receiptdata()
|
|||||||
{
|
{
|
||||||
$this->db->select('bm.id,bm.mid,bm.PONO,bm.Suppliername,bm.Totalpoamount,bm.Podate,bm.BankDate,
|
$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,
|
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->from ('T_Bankmappingpo bm');
|
||||||
// $this->db->join('T_IGR_Details igr','igr.IGRItemNo=bm.IGRLineItemNo');
|
// $this->db->join('T_IGR_Details igr','igr.IGRItemNo=bm.IGRLineItemNo');
|
||||||
$this->db->join('T_Inwardgateregister_fileupload inward','inward.IGRNO =bm.IGRNO','left');
|
$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,
|
$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');
|
bm.Balancetopay,sum(bm.Amountpaid) as Amountpaid,bm.Podate,bm.IGRLineItemNo,bm.BankDate');
|
||||||
$this->db->from ('T_Bankmappingpo bm');
|
$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);
|
$this->db->where('bm.IsActive',1);
|
||||||
|
|
||||||
|
|
||||||
if ($fa and $aa != ''){
|
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')";
|
$year="(bm.BankDate >= '".$fa."-04-01' and bm.BankDate <= '".$aa."-03-31')";
|
||||||
$this->db->where($year);
|
$this->db->where($year);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,7 +64,7 @@ if(!empty($amountpaid))
|
|||||||
<!-- Modal. content-->
|
<!-- Modal. content-->
|
||||||
<form>
|
<form>
|
||||||
|
|
||||||
|
<div class="modal-content" style="width:800px;">
|
||||||
<!-- Table to show the line item of po -->
|
<!-- Table to show the line item of po -->
|
||||||
|
|
||||||
<table class="table table-bordered" id="Inwardgateregistertable1" style="font-size:12px;">
|
<table class="table table-bordered" id="Inwardgateregistertable1" style="font-size:12px;">
|
||||||
@ -86,7 +86,7 @@ if(!empty($amountpaid))
|
|||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
|
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -233,8 +233,8 @@ if(!empty($amountpaid))
|
|||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
<th>BankDate</th>
|
<th>BankDate</th>
|
||||||
<th>PONO</th>
|
<th>PONO</th>
|
||||||
<!--<th>IGR NO</th>
|
<th>IGR NO</th>
|
||||||
<th>IGRItemNo</th>-->
|
<!--<th>IGRItemNo</th>-->
|
||||||
<!--<th>Supplier Name</th>-->
|
<!--<th>Supplier Name</th>-->
|
||||||
<th>Total PO Amount (₹)</th>
|
<th>Total PO Amount (₹)</th>
|
||||||
<!--<th>Advance PO Amount (₹)</th>-->
|
<!--<th>Advance PO Amount (₹)</th>-->
|
||||||
@ -273,8 +273,8 @@ if(!empty($amountpaid))
|
|||||||
<td align="left" id="bankdate<?php echo $i ?>"><span><?php echo date_format(date_create($ap->BankDate),'d-m-Y'); ?></span></td>
|
<td align="left" id="bankdate<?php echo $i ?>"><span><?php echo date_format(date_create($ap->BankDate),'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></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></td>
|
||||||
<!--<td align="left"><a href="<?= base_url() ?>cashbook/bankreceipt?sid=<?php echo $t->PONO;?>"><span><?php echo $t->PONO?></span></a></td>-->
|
<!--<td align="left"><a href="<?= base_url() ?>cashbook/bankreceipt?sid=<?php echo $t->PONO;?>"><span><?php echo $t->PONO?></span></a></td>-->
|
||||||
<!--<td align="left" id="igrno<?php echo $i ?>"><span><?php echo $ap->IGRNO?></span></td>
|
<td align="left" id="igrno<?php echo $i ?>"><span><?php echo $ap->IGRNO?></span></td>
|
||||||
<td align="left" id="igritemno<?php echo $i ?>"><?php echo $ap->IGRLineItemNo?></span></a></td>-->
|
<!--<td align="left" id="igritemno<?php echo $i ?>"><?php echo $ap->IGRLineItemNo?></span></a></td>-->
|
||||||
<!--<td align="left" id="sn<?php echo $i ?>"><span><?php echo $ap->Suppliername?></span></td>-->
|
<!--<td align="left" id="sn<?php echo $i ?>"><span><?php echo $ap->Suppliername?></span></td>-->
|
||||||
<td align="left" id="tpoa<?php echo $i ?>"><span><?php echo $ap->Totalpoamount?></span></td>
|
<td align="left" id="tpoa<?php echo $i ?>"><span><?php echo $ap->Totalpoamount?></span></td>
|
||||||
<td align="left" id="btp<?php echo $i ?>"><span><?php echo $ap->Totalpoamount-$ap->Amountpaid;?></span></td>
|
<td align="left" id="btp<?php echo $i ?>"><span><?php echo $ap->Totalpoamount-$ap->Amountpaid;?></span></td>
|
||||||
@ -341,6 +341,7 @@ if(!empty($amountpaid))
|
|||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
|
<td> </td>
|
||||||
<td class="amount"><strong>
|
<td class="amount"><strong>
|
||||||
<?php echo $tot_amount; ?>
|
<?php echo $tot_amount; ?>
|
||||||
</strong></td>
|
</strong></td>
|
||||||
|
|||||||
@ -241,15 +241,17 @@ foreach($financialyear as $item)
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Invoice No</th>
|
<th>Invoice No</th>
|
||||||
<th>Invoice Date</th><!--delivery challandate /igrmaster -->
|
<!--delivery challandate /igrmaster -->
|
||||||
<th>PONO</th>
|
<th>PONO</th>
|
||||||
<th>Inward Date</th><!--CreatedDate /igrmaster -->
|
|
||||||
<th>IGRNO</th>
|
<th>IGR Created Date</th><!-- IGRCreatedDate /igrmaster -->
|
||||||
<th>IGR Item No</th>
|
<th>Material Received Date</th><!--MaterialReceivedDate -->
|
||||||
<th>IGR Amount (₹)</th>
|
<th style="display:none;">IGRNO</th>
|
||||||
|
<!--<th>IGR Item No</th>-->
|
||||||
|
<th>PO Amount (₹)</th>
|
||||||
<th>IGR File</th>
|
<th>IGR File</th>
|
||||||
<th>PO File</th>
|
<th>PO File</th>
|
||||||
<th>Over Due Days</th><!--DATEDIFF(CURDATE(),igrdetails.CreatedDate)as days-->
|
<!--<th>Over Due Days</th>DATEDIFF(CURDATE(),T_IGR_Master.MaterialReceivedDate)as days-->
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -266,7 +268,7 @@ foreach($financialyear as $item)
|
|||||||
$status=$t->Paymentstatus;
|
$status=$t->Paymentstatus;
|
||||||
$balancetopay=$t->Balancetopay;
|
$balancetopay=$t->Balancetopay;
|
||||||
$ReceivedQuantity=$t->ReceivedQuantity;
|
$ReceivedQuantity=$t->ReceivedQuantity;
|
||||||
$rate=$t->total;
|
$rate=$t->TotalOrderValue;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -287,14 +289,16 @@ foreach($financialyear as $item)
|
|||||||
<?php
|
<?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="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="Cdate<?php echo $i ?>"><span><?php echo date_format(date_create($t->DeliveryChellanDate),'d-m-Y');?></span></td>
|
|
||||||
<td align="left" id="igrno<?php echo $i ?>"><span><?php $tot_amount= $tot_amount + round($rate)?><?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="tov<?php echo $i ?>" ><span><?php echo round($rate,2)?></span></td>
|
<td style="display:none;" align="left" id="igrno<?php echo $i ?>"><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="tov<?php echo $i ?>" ><?php $tot_amount=$tot_amount+round($rate)?><?php echo round($rate,2)?></span></td>
|
||||||
<?php
|
<?php
|
||||||
if($t->iwFpath !='')
|
if($t->iwFpath !='')
|
||||||
{
|
{
|
||||||
@ -334,7 +338,7 @@ foreach($financialyear as $item)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td align="left" id="tov<?php echo $i ?>" ><span><?php echo $t->days?></span></td>
|
<!--<td align="left" id="tov<?php echo $i ?>" ><span><?php echo $t->days?></span></td>-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -351,15 +355,16 @@ foreach($financialyear as $item)
|
|||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
|
||||||
<td> </td>
|
|
||||||
|
|
||||||
<td class="amount"><strong>
|
<td class="amount"><strong>
|
||||||
<?php echo $tot_amount; ?>
|
<?php echo $tot_amount; ?>
|
||||||
</strong></td>
|
</strong></td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
|
|
||||||
|
|||||||
@ -153,10 +153,11 @@ foreach($financialyear as $item)
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Select</th>
|
<th>Select</th>
|
||||||
<th>Date</th>
|
<th>IGR Created Date</th>
|
||||||
|
<th>Material Received Date</th>
|
||||||
<th>PONO</th>
|
<th>PONO</th>
|
||||||
<!--<th>IGRNO</th>
|
<th>IGRNO</th>
|
||||||
<th>IGR Item No</th>-->
|
<!--<th>IGR Item No</th>-->
|
||||||
<th>Supplier Name</th>
|
<th>Supplier Name</th>
|
||||||
<th style="display:none;">Supplier ID</th>
|
<th style="display:none;">Supplier ID</th>
|
||||||
<th>PO Amount (₹)</th>
|
<th>PO Amount (₹)</th>
|
||||||
@ -185,9 +186,10 @@ foreach($financialyear as $item)
|
|||||||
|
|
||||||
<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 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->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="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="igrno<?php echo $i ?>"><span><?php echo $t->IGRNO?></span></td>
|
||||||
<td align="left" id="igrlineitem<?php echo $i ?>"><span><?php echo trim($t->IGRItemNo)?></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 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 style="display:none;" align="left" id="sid<?php echo $i ?>"><span><?php echo $t->SupplierID?></span></td>
|
||||||
<td align="left" id="tov<?php echo $i ?>" ><span><?php echo round($rate,2)?></span></td>
|
<td align="left" id="tov<?php echo $i ?>" ><span><?php echo round($rate,2)?></span></td>
|
||||||
@ -204,13 +206,13 @@ foreach($financialyear as $item)
|
|||||||
<tfoot width="100%">
|
<tfoot width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align:left;"><strong>Total</strong></td>
|
<td style="text-align:left;"><strong>Total</strong></td>
|
||||||
|
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
|
<td> </td>
|
||||||
|
<td> </td>
|
||||||
<td class="amount">
|
<td class="amount">
|
||||||
<strong><input type="text" id="addvalue" name="addvalue">
|
<strong><input type="text" id="addvalue" name="addvalue">
|
||||||
</strong>
|
</strong>
|
||||||
@ -234,7 +236,7 @@ foreach($financialyear as $item)
|
|||||||
|
|
||||||
<div class="col-md-12" id="HidePONODiv"></div>
|
<div class="col-md-12" id="HidePONODiv"></div>
|
||||||
|
|
||||||
<!-- <div class="col-md-12" id="HideIGRDiv"></div>-->
|
<div class="col-md-12" id="HideIGRDiv"></div>
|
||||||
|
|
||||||
<!--<div class="col-md-12" id="HideIGRLineItem"></div>-->
|
<!--<div class="col-md-12" id="HideIGRLineItem"></div>-->
|
||||||
|
|
||||||
@ -343,8 +345,8 @@ function GetPayment(i)
|
|||||||
|
|
||||||
var pono1 =document.getElementById ("pono"+i).innerText;//value taken from table, col name : purchase
|
var pono1 =document.getElementById ("pono"+i).innerText;//value taken from table, col name : purchase
|
||||||
var pono=pono1.trim();
|
var pono=pono1.trim();
|
||||||
// var igrno1 =document.getElementById ("igrno"+i).innerText;
|
var igrno1 =document.getElementById ("igrno"+i).innerText;
|
||||||
// var igrno=igrno1.trim();
|
var igrno=igrno1.trim();
|
||||||
// var igrlineitem1=document.getElementById ("igrlineitem"+i).innerText;
|
// var igrlineitem1=document.getElementById ("igrlineitem"+i).innerText;
|
||||||
// var igrlineitem=igrlineitem1.trim();
|
// var igrlineitem=igrlineitem1.trim();
|
||||||
|
|
||||||
@ -370,12 +372,12 @@ function GetPayment(i)
|
|||||||
value:pono
|
value:pono
|
||||||
}).appendTo('#HidePONODiv');
|
}).appendTo('#HidePONODiv');
|
||||||
|
|
||||||
// $('<input>').attr({
|
$('<input>').attr({
|
||||||
// type:'hidden',
|
type:'hidden',
|
||||||
// name:'hideigrno'+i,
|
name:'hideigrno'+i,
|
||||||
// id:'hideigrno'+i,
|
id:'hideigrno'+i,
|
||||||
// value:igrno
|
value:igrno
|
||||||
// }).appendTo('#HideIGRDiv');
|
}).appendTo('#HideIGRDiv');
|
||||||
|
|
||||||
// $('<input>').attr({
|
// $('<input>').attr({
|
||||||
// type:'hidden',
|
// type:'hidden',
|
||||||
@ -477,7 +479,7 @@ else
|
|||||||
$('#invoicepaymet'+i).val('');
|
$('#invoicepaymet'+i).val('');
|
||||||
$('#hidedate'+i).val('');
|
$('#hidedate'+i).val('');
|
||||||
$('#hidepono'+i).val('');
|
$('#hidepono'+i).val('');
|
||||||
// $('#hideigrno'+i).val('');
|
$('#hideigrno'+i).val('');
|
||||||
// $('#hideigrline'+i).val('');
|
// $('#hideigrline'+i).val('');
|
||||||
$('#hidesupname'+i).val('');
|
$('#hidesupname'+i).val('');
|
||||||
$('#hidesupid'+i).val('');
|
$('#hidesupid'+i).val('');
|
||||||
@ -487,7 +489,7 @@ else
|
|||||||
//$('#invoicepaymet'+i).remove();
|
//$('#invoicepaymet'+i).remove();
|
||||||
$('#hidedate'+i).remove();
|
$('#hidedate'+i).remove();
|
||||||
$('#hidepono'+i).remove();
|
$('#hidepono'+i).remove();
|
||||||
// $('#hideigrno'+i).remove();
|
$('#hideigrno'+i).remove();
|
||||||
// $('#hideigrline'+i).remove();
|
// $('#hideigrline'+i).remove();
|
||||||
$('#hidesupname'+i).remove();
|
$('#hidesupname'+i).remove();
|
||||||
$('#hidesupid'+i).remove();
|
$('#hidesupid'+i).remove();
|
||||||
@ -643,7 +645,7 @@ function Save()
|
|||||||
var bid =$('#bankid').val();
|
var bid =$('#bankid').val();
|
||||||
var date =$('#hidedate'+number).val();
|
var date =$('#hidedate'+number).val();
|
||||||
var pono =$('#hidepono'+number).val();
|
var pono =$('#hidepono'+number).val();
|
||||||
// var igrno =$('#hideigrno'+number).val();
|
var igrno =$('#hideigrno'+number).val();
|
||||||
// var igrlineitem =$('#hideigrline'+number).val();
|
// var igrlineitem =$('#hideigrline'+number).val();
|
||||||
|
|
||||||
var suppliername=$('#hidesupname'+number).val();
|
var suppliername=$('#hidesupname'+number).val();
|
||||||
@ -664,7 +666,7 @@ function Save()
|
|||||||
|
|
||||||
$.ajax(
|
$.ajax(
|
||||||
{
|
{
|
||||||
data:{bankdate:bankdate,podate:date,pono:pono,sname:suppliername,sid:supplierid,tot:totalordervalue,aa:amountpaid,rc:rowCount,tpv:totalvalue,bda:bankdebitamount,bi:bid,check:check,rw:rw},
|
data:{bankdate:bankdate,podate:date,pono:pono,igrno:igrno,sname:suppliername,sid:supplierid,tot:totalordervalue,aa:amountpaid,rc:rowCount,tpv:totalvalue,bda:bankdebitamount,bi:bid,check:check,rw:rw},
|
||||||
//alert(data);
|
//alert(data);
|
||||||
type:"POST",
|
type:"POST",
|
||||||
url:"<?php echo base_url() ?>cashbook/receipt",
|
url:"<?php echo base_url() ?>cashbook/receipt",
|
||||||
|
|||||||
@ -200,7 +200,7 @@ foreach($financialyear as $item)
|
|||||||
$status=$t->Paymentstatus;
|
$status=$t->Paymentstatus;
|
||||||
$balancetopay=$t->Balancetopay;
|
$balancetopay=$t->Balancetopay;
|
||||||
$ReceivedQuantity=$t->ReceivedQuantity;
|
$ReceivedQuantity=$t->ReceivedQuantity;
|
||||||
$rate=$t->total;
|
$rate=$t->TotalOrderValue;
|
||||||
$supplierid=$t->SupplierID;
|
$supplierid=$t->SupplierID;
|
||||||
|
|
||||||
if($status !='ST057')
|
if($status !='ST057')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user