bank model chenge suitable year month

This commit is contained in:
gayathri1990 2018-10-24 15:00:12 +05:30
parent 050597c824
commit 2d1a0f813d
4 changed files with 2096 additions and 19 deletions

View File

@ -1389,9 +1389,9 @@ class cashbook extends BaseController
$tdate = $this->input->post('to_date');
$supplierID= $this->input->post('supplier');
$data['supplierid']= $supplierID;
$suppliername= $this->input->post('supplier');
$suppliername= $this->input->post('suppliername');
$data['suppliername']=$suppliername;
// echo "FROM CON".$suppliername;
$data['suppliername']= $suppliername;
$data['bankdebit'] = $this->cashbook_model->debitpolistfilter($supplierID,$fa,$aa,$m,$fdate,$tdate);
@ -1404,10 +1404,7 @@ class cashbook extends BaseController
$data['suppliername']=$suppliername;
$data['bankdebit'] = $this->cashbook_model->paided($supplierid);
}
$data['finyear']=$this->cashbook_model->report_finyear();
//$data['supplier'] = $this->cashbook_model->getsupplier();
// $this->loadViews("bankpaidsupp", $this->global,$data, NULL);
//print_r($data);
$data['finyear']=$this->cashbook_model->report_amountpaid();
$this->loadViews("bankamountpaid", $this->global,$data, NULL);
}
@ -1455,7 +1452,7 @@ class cashbook extends BaseController
$data['bankdebitsupp'] = $this->cashbook_model->amountpaidsupplierwise();
//$data['bankcashbook'] =$this->cashbook_model->amountpaidcashbook();
}
$data['finyear']=$this->cashbook_model->report_finyear();
$data['finyear']=$this->cashbook_model->report_amountpaid();
$data['supplier'] = $this->cashbook_model->getsupplier();
$this->loadViews("bankpaidsupp", $this->global,$data, NULL);
//$this->loadViews("bankamountpaid", $this->global,$data, NULL);

File diff suppressed because it is too large Load Diff

View File

@ -304,6 +304,21 @@ GROUP BY financial_year";
}
function report_amountpaid(){
$sql="SELECT
CASE WHEN MONTH(Podate)>=4 THEN
concat(YEAR(Podate), '-',YEAR(Podate)+1)
ELSE concat(YEAR(Podate)-1,'-', YEAR(Podate)) END AS financial_year
FROM T_Bankporeport
GROUP BY financial_year";
$query = $this->db->query($sql);
return $query->result();
}
function report_finyearunpaid(){
@ -668,6 +683,8 @@ $sql.="group by sd.SupplierName";
}
function suppliertotalfilter($fa,$aa,$m,$fdate,$tdate)
{
$sql="select sd.SupplierName as SupplierName,sd.SupplierID,
round(ifnull(if(POType = 'REVENUE',
(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.SGST/100)),
@ -719,11 +736,7 @@ 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 ($fa and $aa != ''){
//$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
@ -871,14 +884,14 @@ where im.IGRStatus = 'ST027' and id.BankStatus ='ST072' and sd.SupplierID='".$s
if ($fa and $aa != ''){
//$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
$sql.=" and (im.DeliveryChellanDate >= '".$fa."-04-01' and im.DeliveryChellanDate <= '".$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.DeliveryChellanDate) = '".$m."'";
$sql.="and monthname(im.MaterialRcvdDate) = '".$m."'";
}
@ -886,8 +899,8 @@ where im.IGRStatus = 'ST027' and id.BankStatus ='ST072' and sd.SupplierID='".$s
$fromd= date("Y-m-d",strtotime($fdate));
$tod=date("Y-m-d",strtotime($tdate));
$sql.="and date(im.DeliveryChellanDate) >= '".$fromd."'
and date(im.DeliveryChellanDate) <= '".$tod."'";
$sql.="and date(im.MaterialRcvdDate) >= '".$fromd."'
and date(im.MaterialRcvdDate) <= '".$tod."'";
}

View File

@ -203,7 +203,7 @@ if(!empty($amountpaid))
<th>PONO</th>
<th>IGR NO</th>
<th>IGRItemNo</th>
<th>Supplier Name</th>
<!--<th>Supplier Name</th>
<th>Total PO Amount (&#8377;)</th>
<!--<th>Advance PO Amount (&#8377;)</th>-->
<th>Balance To Pay (&#8377;)</th>
@ -242,7 +242,7 @@ if(!empty($amountpaid))
<!--<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="igritemno<?php echo $i ?>"><a href="<?= base_url() ?>cashbook/mappingdebit?sid=<?php echo $ap->IGRLineItemNo;?>"><span><?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="btp<?php echo $i ?>"><span><?php echo $ap->Balancetopay?></span></td>
<td align="left" id="ap<?php echo $i ?>"><span><?php $tot_amount=$tot_amount+round($rate)?> <?php echo round($rate,2)?></span></td>
@ -315,7 +315,7 @@ if(!empty($amountpaid))
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td class="amount"><strong>
<?php echo $tot_amount; ?>
</strong></td>