bank book-bankbook
This commit is contained in:
parent
23f042a909
commit
54d3f1aae5
@ -316,7 +316,7 @@ class cashbook extends BaseController
|
|||||||
$credit=$sheet->getCell('G'.$x)->getValue();
|
$credit=$sheet->getCell('G'.$x)->getValue();
|
||||||
$balance=$sheet->getCell('H'.$x)->getValue();
|
$balance=$sheet->getCell('H'.$x)->getValue();
|
||||||
|
|
||||||
// $IsActive=0;
|
// $IsActive=0;
|
||||||
$filedataupload= array('reportdate'=>$Date1,'valuedate'=>$Date2,'chequeNo'=>$cod,'Narration'=>$narration,'Cod'=> $chqno,'Debit'=>$debit,'Credit'=>$credit,'cbalancetocleared'=>$credit,'Balance'=>$balance,'Bankname'=>$bank,'IsActive'=> $IsActive);
|
$filedataupload= array('reportdate'=>$Date1,'valuedate'=>$Date2,'chequeNo'=>$cod,'Narration'=>$narration,'Cod'=> $chqno,'Debit'=>$debit,'Credit'=>$credit,'cbalancetocleared'=>$credit,'Balance'=>$balance,'Bankname'=>$bank,'IsActive'=> $IsActive);
|
||||||
|
|
||||||
|
|
||||||
@ -1395,22 +1395,43 @@ class cashbook extends BaseController
|
|||||||
{
|
{
|
||||||
|
|
||||||
$this->global['pageTitle'] = 'Siddharth : Bank Debit Report';
|
$this->global['pageTitle'] = 'Siddharth : Bank Debit Report';
|
||||||
if ($this->input->post('btn_submit'))
|
|
||||||
{
|
$data['bankdepit'] = $this->cashbook_model->suppliertotal();
|
||||||
$Supplierid = $this->input->post('SupplierName');
|
// }
|
||||||
$fdate = $this->input->post('from_date');
|
$data['finyear']=$this->cashbook_model->report_finyear();
|
||||||
$tdate = $this->input->post('to_date');
|
$data['getsupplier'] = $this->cashbook_model->getsupplier();
|
||||||
//$data['cash'] = $_GET['sid'];
|
$this->loadViews("bankunpaidsupp",$this->global,$data,NULL);
|
||||||
//$data['bankid'] = $_GET['d'];
|
|
||||||
$data['bankdepit'] = $this->cashbook_model->debitbankstatemet($Supplierid,$fdate,$tdate);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$data['getsupplier'] = $this->cashbook_model->getsupplier();
|
|
||||||
$this->loadViews("bankamountunpaid",$this->global,$data,NULL);
|
|
||||||
//die();
|
//die();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public function supplierwise()
|
||||||
|
{
|
||||||
|
$this->global['pageTitle'] = 'Siddharth : Bank Debit Report';
|
||||||
|
|
||||||
|
$sd=$this->input->post('supplierid');
|
||||||
|
if ($this->input->post('btn_submit'))
|
||||||
|
{
|
||||||
|
|
||||||
|
$ab=$this->input->post('financialyear');
|
||||||
|
$fa=substr($ab,0,-5);
|
||||||
|
$aa=substr($ab,5,5);
|
||||||
|
$m=$this->input->post('month');
|
||||||
|
$fdate = $this->input->post('from_date');
|
||||||
|
$tdate = $this->input->post('to_date');
|
||||||
|
$data['bankdepit'] = $this->cashbook_model->amountunpaidfilter($sd,$fa,$aa,$m,$fdate,$tdate);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$supplierid1 = $_GET['sid'];
|
||||||
|
$data['bankdepit'] = $this->cashbook_model->amountunpaid($supplierid1);
|
||||||
|
}
|
||||||
|
$data['finyear']=$this->cashbook_model->report_finyear();
|
||||||
|
// $data['getsupplier'] = $this->cashbook_model->getsupplier();
|
||||||
|
$this->loadViews("bankamountunpaid",$this->global,$data,NULL);
|
||||||
|
//die();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
public function amountreceived()
|
public function amountreceived()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -348,7 +348,7 @@ function clearedcreditbalance(){
|
|||||||
function debitbankstatemet($Supplierid,$fdate,$tdate){
|
function debitbankstatemet($Supplierid,$fdate,$tdate){
|
||||||
|
|
||||||
|
|
||||||
$sql="select im.IGRNO as igrn,pm.POType as potype,im.PONO as PONO,im.IGRNO,id.IGRItemNo,id.CreatedDate,br.Balancetopay,br.Amountpaid,sd.SupplierName as SupplierName,
|
$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,
|
||||||
round(ifnull(if(POType = 'REVENUE',
|
round(ifnull(if(POType = 'REVENUE',
|
||||||
(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.SGST/100)),
|
(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,
|
(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.SGST /100))),0),2) as sgst,
|
||||||
@ -422,6 +422,20 @@ $sql.="group by id.IGRItemNo";
|
|||||||
return $query->result();
|
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)
|
// function debitbankstatemet($Supplierid,$fdate,$tdate)
|
||||||
// {
|
// {
|
||||||
// echo $Supplierid;
|
// echo $Supplierid;
|
||||||
@ -459,9 +473,10 @@ $sql.="group by id.IGRItemNo";
|
|||||||
// return $query->result();
|
// return $query->result();
|
||||||
|
|
||||||
// }
|
// }
|
||||||
function amountunpaid($Supplierid,$fdate,$tdate)
|
|
||||||
{
|
function suppliertotal()
|
||||||
$sql="select im.IGRNO as igrn,pm.POType as potype,im.PONO as PONO,im.IGRNO,id.IGRItemNo,id.CreatedDate,br.Balancetopay,br.Amountpaid,sd.SupplierName as SupplierName,
|
{
|
||||||
|
$sql="select sd.SupplierName as SupplierName,sd.SupplierID,
|
||||||
round(ifnull(if(POType = 'REVENUE',
|
round(ifnull(if(POType = 'REVENUE',
|
||||||
(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.SGST/100)),
|
(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,
|
(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.SGST /100))),0),2) as sgst,
|
||||||
@ -480,6 +495,95 @@ round(ifnull(if(POType = 'REVENUE',
|
|||||||
round(ifnull(if(POType = 'REVENUE',
|
round(ifnull(if(POType = 'REVENUE',
|
||||||
(id.QuantityAsPerInvoice * pl.Rate) +(rt.AfterPackagingValue),0),0),2) as Package,
|
(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.SupplierName";
|
||||||
|
//echo $sql;
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
return $query->result();
|
||||||
|
|
||||||
|
}
|
||||||
|
// function seperatesupplier($supplierid)
|
||||||
|
|
||||||
|
// {
|
||||||
|
// $this->db->select('pom.PONO,supp.SupplierName,pom.TotalOrderValue');
|
||||||
|
// $this->db->from ('T_SupplierDetailsN supp');
|
||||||
|
// $this->db->join('T_PurchaseOrder_Master pom','pom.SupplierID=supp.SupplierID');
|
||||||
|
// $this->db->where_in('pom.Status',[ST044,ST056]);
|
||||||
|
// $this->db->where('supp.SupplierID',$supplierid);
|
||||||
|
// //$this->db->group_by('supp.SupplierName');
|
||||||
|
// $query = $this->db->get();
|
||||||
|
// return $query->result();
|
||||||
|
// }
|
||||||
|
function amountunpaid($supplierid)
|
||||||
|
{
|
||||||
|
|
||||||
|
$sql="select im.IGRNO as igrn,pm.POType as potype,im.PONO as PONO,im.IGRNO,id.IGRItemNo,im.MaterialRcvdDate,br.Balancetopay,br.Amountpaid,sd.SupplierName as SupplierName,sd.SupplierID,im.DeliveryChellanOrInvoiceNo,
|
||||||
|
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((
|
round((
|
||||||
if(POType = 'IMPORT',(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)),
|
if(POType = 'IMPORT',(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)),
|
||||||
if(POType = 'CAPITAL' && CapitalRange = 0,(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)),
|
if(POType = 'CAPITAL' && CapitalRange = 0,(pm.ExchangeRate * (id.QuantityAsPerInvoice * pl.Rate)),
|
||||||
@ -509,22 +613,86 @@ left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
|
|||||||
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
|
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_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
|
||||||
left join T_Bankporeport br on br.IGRLineItemNo=id.IGRItemNo
|
left join T_Bankporeport br on br.IGRLineItemNo=id.IGRItemNo
|
||||||
where im.IGRStatus = 'ST027' and id.BankStatus ='ST072' ";
|
where im.IGRStatus = 'ST027' and id.BankStatus ='ST072' and sd.SupplierID='".$supplierid."'";
|
||||||
|
$sql.="group by id.IGRItemNo";
|
||||||
|
//echo $sql;
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
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,br.Balancetopay,br.Amountpaid,sd.SupplierName as SupplierName,sd.SupplierID,im.DeliveryChellanOrInvoiceNo,
|
||||||
|
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
|
||||||
|
where im.IGRStatus = 'ST027' and id.BankStatus ='ST072' and sd.SupplierID='".$sd."'";
|
||||||
|
|
||||||
|
|
||||||
if ($Supplierid!= ''){
|
|
||||||
|
if ($fa and $aa != ''){
|
||||||
|
|
||||||
$sql.="and sd.SupplierID = '".$Supplierid."'";
|
//$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 ($m!= ''){
|
||||||
|
|
||||||
|
//$sql.="and monthname(im.CreatedDate) = '".$m."'";
|
||||||
|
$sql.="and monthname(im.MaterialRcvdDate) = '".$m."'";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if ($fdate and $tdate != ''){
|
if ($fdate and $tdate != ''){
|
||||||
$fromd= date("Y-m-d",strtotime($fdate));
|
$fromd= date("Y-m-d",strtotime($fdate));
|
||||||
$tod=date("Y-m-d",strtotime($tdate));
|
$tod=date("Y-m-d",strtotime($tdate));
|
||||||
|
|
||||||
$sql.="and date(im.CreatedDate) >= '".$fromd."'
|
$sql.="and date(im.MaterialRcvdDate) >= '".$fromd."'
|
||||||
and date(im.CreatedDate) <= '".$tod."'";
|
and date(im.MaterialRcvdDate) <= '".$tod."'";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -533,6 +701,7 @@ $sql.="group by id.IGRItemNo";
|
|||||||
//echo $sql;
|
//echo $sql;
|
||||||
$query = $this->db->query($sql);
|
$query = $this->db->query($sql);
|
||||||
return $query->result();
|
return $query->result();
|
||||||
|
|
||||||
}
|
}
|
||||||
function bankinvoice($Customer,$fdate,$tdate)
|
function bankinvoice($Customer,$fdate,$tdate)
|
||||||
{
|
{
|
||||||
@ -619,7 +788,7 @@ function receiptdata()
|
|||||||
$this->db->join ('T_PurchaseOrder_BillUpload bu','bm.PONO=bu.PONO','left');
|
$this->db->join ('T_PurchaseOrder_BillUpload bu','bm.PONO=bu.PONO','left');
|
||||||
if($fdate!='' && $tdate!='')
|
if($fdate!='' && $tdate!='')
|
||||||
{
|
{
|
||||||
$this->db->where('bm.Podate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"');
|
$this->db->where('igrm.MaterialRcvdDate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"');
|
||||||
}
|
}
|
||||||
if($SupplierName!='')
|
if($SupplierName!='')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -97,6 +97,17 @@ if(!empty($amountpaid))
|
|||||||
|
|
||||||
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
||||||
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Bank Debit Amount Paid Reports</b></p></h3></center>
|
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Bank Debit Amount Paid Reports</b></p></h3></center>
|
||||||
|
<?php
|
||||||
|
if(!empty($bankdebit)){
|
||||||
|
foreach($bankdepit as $ap)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<center><h4 style="color:#3c8dbc"><?php echo $ap->Suppliername?></h4></center>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@ -37,10 +37,22 @@ foreach($financialyear as $item)
|
|||||||
<div class="box box-info" id="content">
|
<div class="box box-info" id="content">
|
||||||
<br>
|
<br>
|
||||||
<div class="col-md-1 col-md-offset-11">
|
<div class="col-md-1 col-md-offset-11">
|
||||||
<a href="<?php base_url() ?>Bankingstatement" class="btn btn-primary" value="Back"/>Back</a>
|
<a href="<?php base_url() ?>Bankamountunpaid" class="btn btn-primary" value="Back"/>Back</a>
|
||||||
</div>
|
</div>
|
||||||
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
||||||
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Un Paid Reports</b></p></h3></center>
|
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Un Paid Reports</b></p></h3></center>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if(!empty($bankdepit)){
|
||||||
|
foreach($bankdepit as $t)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<center><h4 style="color:#3c8dbc"><?php echo $t->SupplierName?></h4></center>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
@ -51,10 +63,9 @@ foreach($financialyear as $item)
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<!-- <div class="col-md-3" style=" border: 2px solid black;font-size:14px;background-color:#ccc;">-->
|
<!-- <div class="col-md-3" style=" border: 2px solid black;font-size:14px;background-color:#ccc;">-->
|
||||||
|
|
||||||
|
|
||||||
<input type="hidden" id="debitamount" placeholder="Debit Amount" readonly>
|
|
||||||
|
|
||||||
<input type="hidden" id="bankid" value="" placeholder="Bank Id" readonly>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -68,21 +79,68 @@ foreach($financialyear as $item)
|
|||||||
|
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
|
<div class="col-md-2">
|
||||||
<div class="col-md-3">
|
<label for="to_date">
|
||||||
<label for="from_date">
|
<?php echo 'Year'; ?>
|
||||||
<?php echo 'From Date'; ?>
|
</label>
|
||||||
</label>
|
<div class="input-group">
|
||||||
|
<select class="form-control" id="financialyear" name="financialyear">
|
||||||
|
<option value="">Select Year</option>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
foreach($finyear as $item):
|
||||||
|
|
||||||
|
{?>
|
||||||
|
|
||||||
|
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
|
||||||
|
|
||||||
|
|
||||||
|
<?php } endforeach; ?>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input type="hidden" id="supplierid" name="supplierid" value="<?php echo $t->SupplierID?>">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label for="to_date">
|
||||||
|
<?php echo 'Month'; ?>
|
||||||
|
</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<select class="form-control" id="month" name="month">
|
||||||
|
<option value="">Select Month</option>
|
||||||
|
<option value="January">January</option>
|
||||||
|
<option value="February">February</option>
|
||||||
|
<option value="March">March</option>
|
||||||
|
<option value="April">April</option>
|
||||||
|
<option value="May">May</option>
|
||||||
|
<option value="June">June</option>
|
||||||
|
<option value="July">July</option>
|
||||||
|
<option value="August">August</option>
|
||||||
|
<option value="September">September</option>
|
||||||
|
<option value="October">October</option>
|
||||||
|
<option value="November">November</option>
|
||||||
|
<option value="December">December</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label for="from_date">
|
||||||
|
<?php echo 'From Date'; ?>
|
||||||
|
</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input name="from_date" id="max-date" class="form-control datepicker">
|
<input name="from_date" id="max-date" class="form-control datepicker">
|
||||||
<span class="input-group-addon">
|
<span class="input-group-addon">
|
||||||
<i class="fa fa-calendar fa-fw"></i>
|
<i class="fa fa-calendar fa-fw"></i>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-2">
|
||||||
<label for="to_date">
|
<label for="to_date">
|
||||||
<?php echo 'To Date'; ?>
|
<?php echo 'To Date'; ?>
|
||||||
</label>
|
</label>
|
||||||
@ -94,19 +152,7 @@ foreach($financialyear as $item)
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3" >
|
|
||||||
<label for="customer">
|
|
||||||
<?php echo 'Supplier'; ?>
|
|
||||||
</label>
|
|
||||||
<select class="form-control" id="SupplierName" name="SupplierName">
|
|
||||||
<option value="">Select Supplier</option>
|
|
||||||
<?php foreach($getsupplier as $gs):
|
|
||||||
{?>
|
|
||||||
<option value="<?php echo $gs->SupplierID;?>"><?php echo $gs->SupplierName ; ?></option>
|
|
||||||
<?php } endforeach; ?>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3" style="margin-top:20px;">
|
<div class="col-md-3" style="margin-top:20px;">
|
||||||
<!-- <div class="col-md-1 col-md-offset-10" style="margin-top:20px;"> -->
|
<!-- <div class="col-md-1 col-md-offset-10" style="margin-top:20px;"> -->
|
||||||
<input type="submit" class="btn btn-success" name="btn_submit" value="View Purchase">
|
<input type="submit" class="btn btn-success" name="btn_submit" value="View Purchase">
|
||||||
@ -130,7 +176,8 @@ foreach($financialyear as $item)
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<th>Date</th>
|
<th>Invoice Date</th>
|
||||||
|
<th>Invoice No</th>
|
||||||
<th>PONO</th>
|
<th>PONO</th>
|
||||||
<th>IGRNO</th>
|
<th>IGRNO</th>
|
||||||
<th>IGR Item No</th>
|
<th>IGR Item No</th>
|
||||||
@ -141,7 +188,7 @@ foreach($financialyear as $item)
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
$i=1;
|
$tot_amount = 0;
|
||||||
$ti=0.00;
|
$ti=0.00;
|
||||||
$tvt=0.00;
|
$tvt=0.00;
|
||||||
if(!empty($bankdepit)){
|
if(!empty($bankdepit)){
|
||||||
@ -160,9 +207,23 @@ foreach($financialyear as $item)
|
|||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
|
|
||||||
<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>
|
||||||
|
<?php
|
||||||
|
if($t->DeliveryChellanOrInvoiceNo=='')
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<td>-</td>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<td align="left" id="pono"><span><?php echo $t->DeliveryChellanOrInvoiceNo?></span></a></td>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
<td align="left" id="pono"><span><?php echo $t->PONO?></span></a></td>
|
<td align="left" id="pono"><span><?php echo $t->PONO?></span></a></td>
|
||||||
<td align="left" id="igrno"><span><?php echo $t->IGRNO?></span></a></td>
|
<td align="left" id="igrno"><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="igrlineitem<?php echo $i ?>" ><span><?php echo $t->IGRItemNo?></span></td>
|
||||||
<td align="left" id="sn<?php echo $i ?>" ><span><?php echo $t->SupplierName?></span></td>
|
<td align="left" id="sn<?php echo $i ?>" ><span><?php echo $t->SupplierName?></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>
|
||||||
@ -176,6 +237,20 @@ foreach($financialyear as $item)
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
<tfoot width="100%">
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;"><strong>Total</strong></td>
|
||||||
|
<td> </td>
|
||||||
|
<td> </td>
|
||||||
|
<td> </td>
|
||||||
|
<td> </td>
|
||||||
|
<td> </td>
|
||||||
|
|
||||||
|
<td class="amount"><strong>
|
||||||
|
<?php echo $tot_amount; ?>
|
||||||
|
</strong></td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</table>
|
</table>
|
||||||
@ -200,6 +275,45 @@ foreach($financialyear as $item)
|
|||||||
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
/** jquery on ready for DataPicker. */
|
||||||
|
$( function() {
|
||||||
|
//var dateFormat = "mm/dd/yy",
|
||||||
|
from = $( "#min-date" )
|
||||||
|
.datepicker({
|
||||||
|
dateFormat: "dd-mm-yy",
|
||||||
|
defaultDate: "+0d",
|
||||||
|
changeMonth: true,
|
||||||
|
//numberOfMonths: 1
|
||||||
|
|
||||||
|
})
|
||||||
|
.on( "change", function() {
|
||||||
|
to.datepicker("option", "minDate", getDate( this ) );
|
||||||
|
}),
|
||||||
|
to = $( "#max-date" ).datepicker({
|
||||||
|
dateFormat: "dd-mm-yy",
|
||||||
|
defaultDate: "+0d",
|
||||||
|
changeMonth: true,
|
||||||
|
//numberOfMonths: 1
|
||||||
|
|
||||||
|
})
|
||||||
|
.on( "change", function() {
|
||||||
|
from.datepicker( "option", "maxDate", getDate( this ) );
|
||||||
|
});
|
||||||
|
|
||||||
|
function getDate( element ) {
|
||||||
|
var date;
|
||||||
|
|
||||||
|
try {
|
||||||
|
date = $.datepicker.parseDate( dateFormat, element.value );
|
||||||
|
|
||||||
|
} catch( error ) {
|
||||||
|
date = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return date;
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
|
||||||
@ -212,7 +326,7 @@ foreach($financialyear as $item)
|
|||||||
{
|
{
|
||||||
extend: 'excelHtml5',
|
extend: 'excelHtml5',
|
||||||
footer: 'true',
|
footer: 'true',
|
||||||
messageTop: $('h3').text(),
|
messageTop: $('h4').text(),
|
||||||
title: 'Unpaid Purchase Order Report',
|
title: 'Unpaid Purchase Order Report',
|
||||||
exportOptions: {
|
exportOptions: {
|
||||||
columns: ':visible'
|
columns: ':visible'
|
||||||
|
|||||||
157
application/views/bankunpaidsupp.php
Normal file
157
application/views/bankunpaidsupp.php
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
<?php
|
||||||
|
foreach($financialyear as $item)
|
||||||
|
{
|
||||||
|
$finyear = $item->financial_year;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
|
||||||
|
<style>
|
||||||
|
.dataTables_filter input {padding: 4px;}
|
||||||
|
|
||||||
|
.dataTables_filter {
|
||||||
|
width: 50%;
|
||||||
|
float: right;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.dataTables_paginate {
|
||||||
|
width: 50%;
|
||||||
|
float: right;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
div.dt-buttons {
|
||||||
|
position: relative;
|
||||||
|
float: right;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<section class="content">
|
||||||
|
<div class="row">
|
||||||
|
<!-- Left col -->
|
||||||
|
<div class="col-md-12">
|
||||||
|
<!-- TABLE: LATEST ORDERS -->
|
||||||
|
<div class="box box-info" id="content">
|
||||||
|
<br>
|
||||||
|
<div class="col-md-1 col-md-offset-11">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
|
||||||
|
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Sundry Creditors</b></p></h3></center>
|
||||||
|
<div class="box-body">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<input type="hidden" name="Rowid" id="Rowid" placeholder="Row Id" readonly>
|
||||||
|
<table class="table table-bordered table-hover" id="req" style="table-layout:auto;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<th>Supplier Name</th>
|
||||||
|
<th>Unpaid Amount (₹)</th>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
$tot_amount=0;
|
||||||
|
$ti=0.00;
|
||||||
|
$tvt=0.00;
|
||||||
|
if(!empty($bankdepit)){
|
||||||
|
foreach($bankdepit as $t)
|
||||||
|
{
|
||||||
|
|
||||||
|
$status=$t->Paymentstatus;
|
||||||
|
$balancetopay=$t->Balancetopay;
|
||||||
|
$ReceivedQuantity=$t->ReceivedQuantity;
|
||||||
|
$rate=$t->total;
|
||||||
|
$supplierid=$t->SupplierID;
|
||||||
|
|
||||||
|
if($status !='ST057')
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td align="left" id="sn<?php echo $i ?>" ><a href="<?= base_url() ?>cashbook/supplierwise?sid=<?php echo $supplierid;?>"><span><?php echo $t->SupplierName?></span></a></td>
|
||||||
|
<td align="left" id="tov<?php echo $i ?>" ><span><?php $tot_amount=$tot_amount+round($rate)?><?php echo round($rate,2)?></span></td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
<tfoot width="100%">
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:left;"><strong>Total</strong></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td class="amount"><strong>
|
||||||
|
<?php echo $tot_amount; ?>
|
||||||
|
</strong></td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
|
||||||
|
<?php } ?>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- /.box -->
|
||||||
|
</div><!-- /.col -->
|
||||||
|
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
|
||||||
|
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
|
||||||
|
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
|
||||||
|
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
|
|
||||||
|
$.fn.dataTable.moment( 'DD-MM-YYYY' );
|
||||||
|
table = $('#req').DataTable( {
|
||||||
|
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
||||||
|
"<'row'<'col-md-6'><'col-md-6'>>" +
|
||||||
|
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'excelHtml5',
|
||||||
|
footer: 'true',
|
||||||
|
messageTop: $('h3').text(),
|
||||||
|
title: 'Unpaid Purchase Order Report',
|
||||||
|
exportOptions: {
|
||||||
|
columns: ':visible'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'colvis'
|
||||||
|
]
|
||||||
|
} );/** datatable closed */
|
||||||
|
} );/** ready closed */
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user