bank issue-bala
This commit is contained in:
parent
b1ca9e36ed
commit
23f042a909
@ -345,41 +345,195 @@ 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,
|
||||||
|
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' ";
|
||||||
|
|
||||||
|
|
||||||
|
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 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 amountunpaid($Supplierid,$fdate,$tdate)
|
||||||
{
|
{
|
||||||
$status='ST057';
|
$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,
|
||||||
//echo $tdate;
|
round(ifnull(if(POType = 'REVENUE',
|
||||||
//die();
|
(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.SGST/100)),
|
||||||
// +rt.SGST/100+rt.IGST/100))
|
(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.SGST /100))),0),2) as sgst,
|
||||||
//$Supplierid;
|
round(ifnull(if(POType = 'REVENUE',
|
||||||
$this->db->distinct();
|
(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.CGST/100)),
|
||||||
$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)+(igrli.QuantityAsPerInvoice * poli.Rate)*(rt.CGST/100)+(igrli.QuantityAsPerInvoice * poli.Rate)*(rt.SGST/100)+(igrli.QuantityAsPerInvoice * poli.Rate)*(rt.IGST/100) as finalamount');
|
(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.CGST /100))),0),2) as cgst,
|
||||||
$this->db->from ('T_IGR_Details igrli');
|
round(ifnull(if(POType = 'REVENUE',
|
||||||
$this->db->join('T_IGR_Master igr','igrli.IGRNO = igr.IGRNO','left');
|
(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(rt.IGST/100)),
|
||||||
$this->db->join('T_PurchaseOrder_LineItem poli','igr.PONO= poli.PONO and igrli.MaterialCode=poli.MaterialCode');
|
(id.QuantityAsPerInvoice * pl.Rate)+((id.QuantityAsPerInvoice * pl.Rate)*(st.IGST /100))),0),2) as igst,
|
||||||
$this->db->join('T_PurchaseOrder_Master pom','poli.PONO =pom.PONO');
|
round(ifnull(if(POType = 'REVENUE',
|
||||||
$this->db->join('T_SupplierDetailsN supp','pom.SupplierID =supp.SupplierID');
|
(id.QuantityAsPerInvoice * pl.Rate)- (rt.AfterDiscount),
|
||||||
$this->db->join('T_Revenue_Tax rt','poli.LineItemNo=rt.LineItemNo');
|
(id.QuantityAsPerInvoice * pl.Rate)- (st.Afterdiscountval)),0),2) as discount,
|
||||||
$this->db->join ('T_Bankporeport BR','igrli.IGRItemNo = BR.IGRLineItemNo','left');
|
round(ifnull(if(POType = 'REVENUE',
|
||||||
if ($fdate and $tdate != ''){
|
(id.QuantityAsPerInvoice * pl.Rate) + (rt.AfterFreightValue),
|
||||||
$fromdate= date("Y-m-d",strtotime($fdate));
|
(id.QuantityAsPerInvoice * pl.Rate) + (st.AfterFreightValue)),0),2) as freight,
|
||||||
$todate=date("Y-m-d",strtotime($tdate));
|
round(ifnull(if(POType = 'REVENUE',
|
||||||
$date = "date(igr.CreatedDate) >= '".$fromdate."'
|
(id.QuantityAsPerInvoice * pl.Rate) +(rt.AfterPackagingValue),0),0),2) as Package,
|
||||||
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','ST072');
|
|
||||||
$query = $this->db->get();
|
|
||||||
return $query->result();
|
|
||||||
|
|
||||||
}
|
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 id.IGRItemNo";
|
||||||
|
//echo $sql;
|
||||||
|
$query = $this->db->query($sql);
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
function bankinvoice($Customer,$fdate,$tdate)
|
function bankinvoice($Customer,$fdate,$tdate)
|
||||||
{
|
{
|
||||||
// $status='ST065';
|
// $status='ST065';
|
||||||
|
|||||||
@ -151,7 +151,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->finalamount;
|
$rate=$t->total;
|
||||||
|
|
||||||
|
|
||||||
if($status !='ST057')
|
if($status !='ST057')
|
||||||
|
|||||||
@ -46,11 +46,11 @@ foreach($financialyear as $item)
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<th style="text-align:center">Payment ID</th>
|
<th>Payment ID</th>
|
||||||
<th style="text-align:center">Payment Mode</th>
|
<th>Payment Mode</th>
|
||||||
<th style="text-align:center">Payment Amount (₹)</th>
|
<th>Payment Amount (₹)</th>
|
||||||
<th style="text-align:center">Payment date </th>
|
<th>Payment date </th>
|
||||||
<th style="text-align:center">Narration </th>
|
<th>Narration </th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@ -58,10 +58,10 @@ foreach($financialyear as $item)
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td><p style="margin-left:25px;" id="bid"></p></td>
|
<td><p style="margin-left:25px;" id="bid"></p></td>
|
||||||
<td style="text-align:center">Bank</td>
|
<td>Bank</td>
|
||||||
<td><p style="text-align:center" id="bamount" ></p></td>
|
<td><p style="margin-left:25px;" id="bamount" ></p></td>
|
||||||
<td><p style="margin-left:25px;" id="bdate"></p></td>
|
<td><p style="margin-left:25px;" id="bdate"></p></td>
|
||||||
<td><p style="text-align:center" id="narration"></p></td>
|
<td><p style="margin-left:25px;" id="narration"></p></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@ -175,9 +175,8 @@ foreach($financialyear as $item)
|
|||||||
$status=$t->Paymentstatus;
|
$status=$t->Paymentstatus;
|
||||||
$balancetopay=$t->Balancetopay;
|
$balancetopay=$t->Balancetopay;
|
||||||
$ReceivedQuantity=$t->ReceivedQuantity;
|
$ReceivedQuantity=$t->ReceivedQuantity;
|
||||||
$rate=$t->finalamount;
|
//$rate=$t->total;
|
||||||
|
$rate=$t->total;
|
||||||
|
|
||||||
if($status !='ST057')
|
if($status !='ST057')
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
@ -185,8 +184,8 @@ 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="pono<?php echo $i ?>"><a href="<?= base_url() ?>cashbook/mappingdebit?sid=<?php echo $t->PONO;?>"><span><?php echo $t->PONO?></span></a></td>
|
<td align="left" id="pono<?php echo $i ?>"><span><?php echo $t->PONO?></span></a></td>
|
||||||
<td align="left" id="igrno<?php echo $i ?>"><a href="<?= base_url() ?>cashbook/mappingdebit?sid=<?php echo $t->IGRNO;?>"><span><?php echo $t->IGRNO?></span></a></td>
|
<td 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="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>
|
||||||
@ -229,37 +228,25 @@ foreach($financialyear as $item)
|
|||||||
</div><!-- /.col -->
|
</div><!-- /.col -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="row">
|
<div class="col-md-12" id="HideDateDiv"></div>
|
||||||
<div class="col-md-12" id="date1"></div>
|
|
||||||
|
|
||||||
<div class="col-md-12" id="purchaseono"></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="hideigrline"></div>
|
<div class="col-md-12" id="HideIGRLineItem"></div>
|
||||||
|
|
||||||
<div class="col-md-12" id="supname"></div>
|
<div class="col-md-12" id="HideSuppDiv"></div>
|
||||||
|
|
||||||
<div class="col-md-12" id="aa1"></div>
|
<div class="col-md-12" id="aa1"></div>
|
||||||
|
|
||||||
<!--<div class="col-md-12" id="aa2"></div>-->
|
<div class="col-md-12" id="HideTtlPoAmtDiv"></div>
|
||||||
|
|
||||||
<div class="col-md-12" id="ttamnt"></div>
|
|
||||||
|
|
||||||
<div class="col-md-12" id="totala"></div>
|
|
||||||
<!--<input type="text" name="qw1" id="qw1">-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<input type="hidden" name="Recid" id="Recid" value="">
|
|
||||||
<!-- <input type="hidden" name="bankid" id="bankid" value="">-->
|
|
||||||
<input type="hidden" name="bankamount" id="bankamount" value="">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12" id="HideAmtPaidDiv"></div>
|
||||||
|
|
||||||
|
<input type="hidden" name="Recid" id="Recid" value="" readonly>
|
||||||
|
|
||||||
|
<input type="hidden" name="bankamount" id="bankamount" value="" readonly>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@ -293,432 +280,203 @@ foreach($financialyear as $item)
|
|||||||
var i;
|
var i;
|
||||||
$.each(res1, function( index, value )
|
$.each(res1, function( index, value )
|
||||||
{
|
{
|
||||||
var res2 = value.split('-');
|
var res2 = value.split('-');
|
||||||
|
var bid=res2[0];
|
||||||
|
var bam=res2[1];
|
||||||
|
|
||||||
var bid=res2[0];
|
$('#bankid').val(bid);
|
||||||
var bam=res2[1];
|
document.getElementById("bid").innerHTML=bid;
|
||||||
//alert(bid);
|
});/** foreach closed */
|
||||||
//alert(bam);
|
$.fn.dataTable.moment( 'DD-MM-YYYY' );
|
||||||
$('#bankid').val(bid);
|
table = $('#req').DataTable( {
|
||||||
document.getElementById("bid").innerHTML='Payment ID:' +bid;
|
|
||||||
});
|
|
||||||
|
|
||||||
//alert(res2);
|
|
||||||
//alert(res[1]);
|
|
||||||
//var text = $('#debitamount').text();
|
|
||||||
|
|
||||||
|
|
||||||
//alert($data['cash']);
|
|
||||||
// $('#debitamount').val('10');
|
|
||||||
table = $('#req').DataTable( {
|
|
||||||
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
||||||
"<'row'<'col-md-6'><'col-md-6'>>" +
|
"<'row'<'col-md-6'><'col-md-6'>>" +
|
||||||
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||||
buttons: [
|
buttons: [
|
||||||
|
{
|
||||||
{
|
|
||||||
extend: 'excelHtml5',
|
extend: 'excelHtml5',
|
||||||
footer: 'true',
|
footer: 'true',
|
||||||
messageTop: $('h3').text(),
|
messageTop: $('h3').text(),
|
||||||
title: 'cashbook Overall Report',
|
title: 'cashbook Overall Report',
|
||||||
exportOptions: {
|
exportOptions: {
|
||||||
columns: ':visible'
|
columns: ':visible'
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
'colvis'
|
'colvis'
|
||||||
]
|
]
|
||||||
} );
|
} );/** datatable closed */
|
||||||
} );
|
} );/** ready closed */
|
||||||
|
|
||||||
|
var temppo=[]; // temppo - This array for PO with its value.
|
||||||
|
var tempTotal = []; // tempTotal - This array for get value from "temppo" to calculate grandtotal
|
||||||
|
var intex = 1;
|
||||||
|
var row = 0;
|
||||||
|
|
||||||
//alert(pono+'array');
|
|
||||||
var temppo=[];
|
|
||||||
var tot=0;
|
|
||||||
var tot1=0;
|
|
||||||
var intex=1;
|
|
||||||
var row=0;
|
|
||||||
var j=1;
|
|
||||||
var addvalue=0;
|
|
||||||
var tott=0;
|
|
||||||
var total=0;
|
|
||||||
function GetPayment(i)
|
function GetPayment(i)
|
||||||
{
|
{
|
||||||
//alert('check');
|
|
||||||
var value=i;
|
|
||||||
var bankdebitamount=$('#debitamount').val();
|
var bankdebitamount=$('#debitamount').val();
|
||||||
var totalvalue=$('#addvalue').val();
|
var totalvalue=$('#addvalue').val();
|
||||||
var balanceamount=bankdebitamount-totalvalue;
|
var balanceamount=bankdebitamount-totalvalue;
|
||||||
|
|
||||||
var x = document.getElementById('checkboxcheckbox'+i).checked;
|
var x = document.getElementById('checkboxcheckbox'+i).checked;
|
||||||
|
|
||||||
var amount= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val())
|
var amount= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val())
|
||||||
//alert(amount+'inv');
|
|
||||||
var negative=0;
|
var negative=0;
|
||||||
if(amount<0)
|
if(amount<0)
|
||||||
{
|
{
|
||||||
negative=1;
|
negative=1;
|
||||||
alert('Invalid Amount');
|
alert('Invalid Amount');
|
||||||
// $('#invoicepaymet'+i).val('');
|
}
|
||||||
|
|
||||||
|
temp=intex;
|
||||||
|
|
||||||
}
|
|
||||||
temp=intex;
|
|
||||||
//alert(temp+'temp');success
|
|
||||||
if(x==true)
|
if(x==true)
|
||||||
{
|
{
|
||||||
//alert(x);
|
row = parseInt(row)+1;
|
||||||
var bankdebitamount=$('#debitamount').val();
|
|
||||||
var totalvalue=$('#addvalue').val();
|
|
||||||
var balanceamount=bankdebitamount-totalvalue;
|
|
||||||
|
|
||||||
if(bankdebitamount==totalvalue)
|
|
||||||
{
|
|
||||||
//alert('you have remaining'+balanceamount);
|
|
||||||
//alert('your amount is equal to debit amount');
|
|
||||||
$(".checkboxcheckbox").prop("disabled", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//document.getElementById('checkboxcheckbox'+i).checked = false;
|
|
||||||
('your checkbox is disabled beacause already mapped amount')
|
|
||||||
}
|
|
||||||
|
|
||||||
row= parseInt(row)+1;
|
|
||||||
$('#Rowid').val(row);
|
$('#Rowid').val(row);
|
||||||
var date= document.getElementById ( "date"+i ).innerText;
|
var date= document.getElementById ( "date"+i ).innerText;//value taken from table, col name : date
|
||||||
var pono =document.getElementById ( "pono"+i ).innerText;
|
var pono =document.getElementById ( "pono"+i ).innerText;//value taken from table, col name : purchase order no
|
||||||
var poamount =document.getElementById ( "qw"+i ).innerText;
|
|
||||||
var igrno =document.getElementById ( "igrno"+i ).innerText;
|
var igrno =document.getElementById ( "igrno"+i ).innerText;
|
||||||
var igrlineitem=document.getElementById ( "igrlineitem"+i ).innerText;
|
var igrlineitem=document.getElementById ( "igrlineitem"+i ).innerText;
|
||||||
var tta= $('#totala').val();
|
var supname =document.getElementById ("sn"+i ).innerText;//value taken from table col name : suppliername
|
||||||
var tempid = "debited"+value;
|
var totalordervalue =document.getElementById ("tov"+i ).innerText;//value taken from table col name : total po amount
|
||||||
//var credit=parseFloat(document.getElementById(tempid).innerText);
|
var invoicepayment =document.getElementById ( "qw"+i ).innerText;//value taken from table col name : Balance to pay
|
||||||
var t ="totala"+value;
|
$('#invoicepaymet'+i).val(invoicepayment);//to copy the value from 'balance to pay' to 'amount paid'
|
||||||
var poamount1 =$(t).val();
|
|
||||||
//alert(poamount1+'amt');
|
|
||||||
var ponovalue = igrlineitem+','+poamount;
|
|
||||||
temppo.push(ponovalue);
|
|
||||||
console.log(temppo);
|
|
||||||
var total=0;
|
|
||||||
$.each(temppo, function( index, value )
|
|
||||||
{
|
|
||||||
var res2 = value.split(',');
|
|
||||||
|
|
||||||
var pono=res2[0];
|
|
||||||
//alert(pono+'pono');
|
|
||||||
var bam=res2[1];
|
|
||||||
//alert(bam+'bam');
|
|
||||||
total=parseFloat(bam)+parseFloat(total);
|
|
||||||
$('#addvalue').val(parseFloat(total).toFixed(2));
|
|
||||||
});
|
|
||||||
|
|
||||||
//console.log(temppo);
|
|
||||||
var supname =document.getElementById ("sn"+i ).innerText;
|
|
||||||
var totalordervalue =document.getElementById ("tov"+i ).innerText;
|
|
||||||
var invoicepayment =document.getElementById ( "qw"+i ).innerText;
|
|
||||||
$('#invoicepaymet'+i).val(invoicepayment);
|
|
||||||
var RowCount= $('#Rowid').val();
|
|
||||||
|
|
||||||
$('<input>').attr({
|
$('<input>').attr({
|
||||||
type:'hidden',
|
type:'hidden',
|
||||||
name:'date1'+j,
|
name:'hidedate'+i,
|
||||||
id:'date1'+j,
|
id:'hidedate'+i,
|
||||||
value:date
|
value:date
|
||||||
}).appendTo('#date1');
|
}).appendTo('#HideDateDiv');
|
||||||
|
|
||||||
$('<input>').attr({
|
$('<input>').attr({
|
||||||
type:'hidden',
|
type:'hidden',
|
||||||
name:'purchaseono'+j,
|
name:'hidepono'+i,
|
||||||
id:'purchaseono'+j,
|
id:'hidepono'+i,
|
||||||
value:pono
|
value:pono
|
||||||
}).appendTo('#purchaseono');
|
}).appendTo('#HidePONODiv');
|
||||||
|
|
||||||
$('<input>').attr({
|
$('<input>').attr({
|
||||||
type:'hidden',
|
type:'hidden',
|
||||||
name:'hideigrno'+j,
|
name:'hideigrno'+i,
|
||||||
id:'hideigrno'+j,
|
id:'hideigrno'+i,
|
||||||
value:igrno
|
value:igrno
|
||||||
}).appendTo('#HideIGRDiv');
|
}).appendTo('#HideIGRDiv');
|
||||||
|
|
||||||
$('<input>').attr({
|
$('<input>').attr({
|
||||||
type:'hidden',
|
type:'hidden',
|
||||||
name:'hideigrline'+j,
|
name:'hideigrline'+i,
|
||||||
id:'hideigrline'+j,
|
id:'hideigrline'+i,
|
||||||
value:igrlineitem
|
value:igrlineitem
|
||||||
}).appendTo('#hideigrline');
|
}).appendTo('#HideIGRLineItem');
|
||||||
|
|
||||||
$('<input>').attr({
|
$('<input>').attr({
|
||||||
type:'hidden',
|
type:'hidden',
|
||||||
name:'supname'+j,
|
name:'hidesupname'+i,
|
||||||
id:'supname'+j,
|
id:'hidesupname'+i,
|
||||||
value:supname
|
value:supname
|
||||||
}).appendTo('#supname');
|
}).appendTo('#HideSuppDiv');
|
||||||
|
|
||||||
$('<input>').attr({
|
$('<input>').attr({
|
||||||
type:'hidden',
|
type:'hidden',
|
||||||
name:'totala'+j,
|
name:'hidettlPoamt'+i,
|
||||||
id:'totala'+j,
|
id:'hidettlPoamt'+i,
|
||||||
value:invoicepayment
|
|
||||||
}).appendTo('#totala');
|
|
||||||
|
|
||||||
|
|
||||||
$('<input>').attr({
|
|
||||||
type:'hidden',
|
|
||||||
name:'ttamnt'+j,
|
|
||||||
id:'ttamnt'+j,
|
|
||||||
value:totalordervalue
|
value:totalordervalue
|
||||||
}).appendTo('#ttamnt');
|
}).appendTo('#HideTtlPoAmtDiv');
|
||||||
|
|
||||||
|
$('<input>').attr({
|
||||||
|
type:'hidden',
|
||||||
|
name:'hideamtpaid'+i,
|
||||||
|
id:'hideamtpaid'+i,
|
||||||
|
value:invoicepayment
|
||||||
|
}).appendTo('#HideAmtPaidDiv');
|
||||||
|
|
||||||
intex = parseInt(intex)+1;
|
var poamount = $('#hideamtpaid'+i).val();
|
||||||
j=parseInt(j)+1;
|
var ponovalue = i+','+igrlineitem+','+poamount;
|
||||||
//alert(j+'j');
|
temppo.push(ponovalue);
|
||||||
var to=0;
|
//console.log(temppo);
|
||||||
// for(t=1;t<j;t++)
|
|
||||||
// {
|
|
||||||
|
|
||||||
// //var pono1 =document.getElementById ( "pono"+i ).innerText;
|
calculategrandtotal();
|
||||||
// //alert(pono1);
|
|
||||||
|
|
||||||
// var tt=parseFloat( $('#totala'+t).val() == '' ? '0.00' : $('#totala'+t).val());
|
intex = parseInt(intex)+1;
|
||||||
// to = parseFloat(to) + parseFloat (tt);
|
|
||||||
// $('#addvalue').val(parseFloat(to).toFixed(2));
|
|
||||||
// //var total= $('#addvalue').val();
|
|
||||||
// //total=addvalue;
|
|
||||||
// //alert(total);
|
|
||||||
|
|
||||||
// }
|
var bankdebitamount=$('#debitamount').val();
|
||||||
|
var totalvalue=$('#addvalue').val();
|
||||||
|
//var balanceamount=bankdebitamount-totalvalue;
|
||||||
|
// alert(bankdebitamount);
|
||||||
|
// alert(totalvalue);
|
||||||
|
|
||||||
|
// if(parseFloat(totalvalue)>=parseFloat(bankdebitamount))
|
||||||
|
// {
|
||||||
|
// alert('your checkbox is disabled beacause already mapped amount');
|
||||||
|
// $(".checkboxcheckbox").prop("disabled", true);
|
||||||
|
// }
|
||||||
// GetAmount(i);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
//alert(i)
|
|
||||||
var rr= $('#Rowid').val();
|
|
||||||
var ro= parseInt(rr)-1;
|
|
||||||
|
|
||||||
var Payment= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val());
|
var rr = $('#Rowid').val();
|
||||||
|
row = parseInt(rr)-1;
|
||||||
|
|
||||||
|
var Payment = parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val());
|
||||||
|
|
||||||
var Inid = document.getElementById ('igrlineitem'+i ).innerText
|
var Inid = document.getElementById ('igrlineitem'+i ).innerText
|
||||||
var ponovalue = Inid+','+Payment;
|
var ponovalue = i+','+Inid+','+Payment;
|
||||||
|
|
||||||
|
$.each(temppo,function(i,val){
|
||||||
|
|
||||||
var a = temppo.indexOf(ponovalue);
|
var a = temppo.indexOf(ponovalue);
|
||||||
//console.log(a);
|
var b = tempTotal.indexOf(Payment);
|
||||||
if(a!=-1)
|
//console.log(a);
|
||||||
{
|
if(a != -1){
|
||||||
|
//sconsole.log('if');
|
||||||
temppo.splice(a,1);
|
temppo.splice(a,1);
|
||||||
console.log(temppo);
|
//console.log(temppo);
|
||||||
}
|
}
|
||||||
//alert(Inid)
|
if(b!=-1)
|
||||||
for(s=1;s<=j;s++)
|
|
||||||
{
|
|
||||||
// alert(j+'else');
|
|
||||||
var ch= $('#hideigrline'+s).val();
|
|
||||||
if(Inid==ch)
|
|
||||||
{
|
|
||||||
|
|
||||||
var w=s;
|
|
||||||
delamount= $('#totala'+w).val();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// //alert(w);
|
|
||||||
var tote= $('#addvalue').val();
|
|
||||||
var afterdeltot= parseFloat(tote)- parseFloat(delamount);
|
|
||||||
tot=parseFloat(tot)- parseFloat(Payment);
|
|
||||||
$('#invoicepaymet'+i).val('');
|
|
||||||
$('#addvalue').val(parseFloat(afterdeltot).toFixed(2));
|
|
||||||
|
|
||||||
|
|
||||||
//alert(ro);
|
|
||||||
|
|
||||||
$('#Rowid').val(ro);
|
|
||||||
//$('#addvalue').val('');
|
|
||||||
$('#invoicepaymet'+i).val('');
|
|
||||||
$('#hideigrline'+i).val('');
|
|
||||||
$('#date1'+i).val('');
|
|
||||||
$('#purchaseono'+i).val('');
|
|
||||||
$('#supname'+i).val('');
|
|
||||||
$('#ttamnt'+i).val('');
|
|
||||||
$('#totala'+i).val('');
|
|
||||||
//$('#aa'+i).val('');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function GetAmount(i)
|
|
||||||
{
|
|
||||||
//alert('text');
|
|
||||||
var amount= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val())
|
|
||||||
//alert(amount);
|
|
||||||
var negative=0;
|
|
||||||
if(amount<0)
|
|
||||||
{
|
|
||||||
negative=1;
|
|
||||||
alert("Invalid Amount")
|
|
||||||
$('#invoicepaymet'+i).val('');
|
|
||||||
}
|
|
||||||
var x = document.getElementById('checkboxcheckbox'+i).checked;
|
|
||||||
|
|
||||||
|
|
||||||
if(x==true )
|
|
||||||
{
|
|
||||||
//alert(x);
|
|
||||||
var date= document.getElementById ( "date"+i ).innerText;
|
|
||||||
var pono =document.getElementById ( "pono"+i ).innerText;
|
|
||||||
var igr =document.getElementById ( "igrno"+i ).innerText;
|
|
||||||
var igrlineitem=document.getElementById ( "igrlineitem"+i ).innerText;
|
|
||||||
|
|
||||||
var supname =document.getElementById ("sn"+i ).innerText;
|
|
||||||
var totalordervalue =document.getElementById ("tov"+i ).innerText;
|
|
||||||
var balancetopay=document.getElementById ( "qw"+i ).innerText;
|
|
||||||
|
|
||||||
for(k=1;k<=j-1;k++)
|
|
||||||
{
|
|
||||||
//alert(k)
|
|
||||||
var idcheck=$('#hideigrline'+k).val();
|
|
||||||
// alert(idcheck)
|
|
||||||
|
|
||||||
if(igrlineitem==idcheck)
|
|
||||||
{
|
|
||||||
var cid=k;
|
|
||||||
//alert(cid+'if');
|
|
||||||
//die();
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(amount<=totalordervalue)
|
|
||||||
{
|
|
||||||
//alert(cid+'cid');
|
|
||||||
$('#date1').val(date);
|
|
||||||
$('#hideigrline'+cid).val(igrlineitem);
|
|
||||||
$('#supname'+cid).val(supname);
|
|
||||||
$('#ttamnt'+cid).val(totalordervalue);
|
|
||||||
$('#totala'+cid).val(amount);
|
|
||||||
var totalvalue=$('#addvalue').val();
|
|
||||||
var bid=$('#bankid').val();
|
|
||||||
//$('#inv_total'+cid).val(invoicepayment);
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
alert('You are exceeding the payment get!!');
|
|
||||||
$('#invoicepaymet'+i).val(amount)
|
|
||||||
location.reload();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
var tot11=0
|
|
||||||
for(l=1;l<j;l++)
|
|
||||||
{
|
|
||||||
var Payingamount=parseFloat( $('#totala'+l).val() == '' ? '0.00' : $('#totala'+l).val());
|
|
||||||
tot11= parseFloat(tot11)+parseFloat(Payingamount);
|
|
||||||
$('#addvalue').val(parseFloat(tot11).toFixed(2));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// //document.getElementById('checkboxcheckbox'+i).checked = false;
|
|
||||||
// $('#invoicepaymet'+i).val('');
|
|
||||||
// $('#addvalue').val('');
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
function Save()
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
$('#content').loader('show');
|
|
||||||
var rowCount= $('#Rowid').val();
|
|
||||||
var check= 0;
|
|
||||||
var rw= 0;
|
|
||||||
for(i=1;i<=rowCount;i++)
|
|
||||||
{
|
|
||||||
//alert(i);
|
|
||||||
rw= parseFloat(rw)+1;
|
|
||||||
check = parseFloat(check)+1;
|
|
||||||
var bankdebitamount=$('#debitamount').val();
|
|
||||||
|
|
||||||
var bid=$('#bankid').val();
|
|
||||||
var date =$('#date1'+i).val();
|
|
||||||
var pono =$('#purchaseono'+i).val();
|
|
||||||
var igrno =$('#hideigrno'+i).val();
|
|
||||||
|
|
||||||
var igrlineitem =$('#hideigrline'+i).val();
|
|
||||||
var suppliername=$('#supname'+i).val();
|
|
||||||
//alert(suppliername);
|
|
||||||
var totalordervalue=$('#ttamnt'+i).val();
|
|
||||||
var amountpaid=$('#totala'+i).val();
|
|
||||||
//alert(amountpaid+'qw1');
|
|
||||||
var invoicepaymet=$('#invoicepaymet'+i).text();
|
|
||||||
// alert(invoicepaymet);
|
|
||||||
var totalvalue=$('#addvalue').val();
|
|
||||||
//alert(totalvalue);
|
|
||||||
if(totalvalue!=0)
|
|
||||||
{
|
|
||||||
var payment = parseFloat(amountpaid);
|
|
||||||
var balnceamount=bankdebitamount-totalvalue;
|
|
||||||
|
|
||||||
if(parseFloat(bankdebitamount)>=parseFloat(totalvalue))
|
|
||||||
{
|
{
|
||||||
//alert(date+'date');
|
tempTotal.splice(ponovalue,1);
|
||||||
//die();
|
//console.log(tempTotal);
|
||||||
//alert('you have remainining'+balnceamount);
|
}
|
||||||
$.ajax(
|
});
|
||||||
{
|
|
||||||
data:{podate:date,pono:pono,igrno:igrno,igrlineitem:igrlineitem,sname:suppliername,tot:totalordervalue,aa:amountpaid,ip:invoicepaymet,rc:rowCount,tpv:totalvalue,bda:bankdebitamount,bi:bid,check:check,rw:rw},
|
|
||||||
type:"POST",
|
|
||||||
url:"<?php echo base_url() ?>cashbook/receipt",
|
|
||||||
success:function(data)
|
|
||||||
{
|
|
||||||
if(data)
|
|
||||||
{
|
|
||||||
window.location.href ="Bankingstatement";
|
|
||||||
//location.reload();
|
|
||||||
|
|
||||||
}
|
calculategrandtotal();
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
$('#invoicepaymet'+i).val('');
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#Rowid').val(row);
|
||||||
|
|
||||||
else{
|
$('#invoicepaymet'+i).val('');
|
||||||
|
$('#hidedate'+i).val('');
|
||||||
|
$('#hidepono'+i).val('');
|
||||||
|
$('#hideigrno'+i).val('');
|
||||||
|
$('#hideigrline'+i).val('');
|
||||||
|
$('#hidesupname'+i).val('');
|
||||||
|
$('#hidettlPoamt'+i).val('');
|
||||||
|
$('#hideamtpaid'+i).val('');
|
||||||
|
|
||||||
alert('You are payment exceeding');
|
//$('#invoicepaymet'+i).remove();
|
||||||
location.reload();
|
$('#hidedate'+i).remove();
|
||||||
}
|
$('#hidepono'+i).remove();
|
||||||
|
$('#hideigrno'+i).remove();
|
||||||
|
$('#hideigrline'+i).remove();
|
||||||
|
$('#hidesupname'+i).remove();
|
||||||
|
$('#hidettlPoamt'+i).remove();
|
||||||
|
$('#hideamtpaid'+i).remove();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function isNumberKey(evt)
|
function isNumberKey(evt)
|
||||||
{
|
{
|
||||||
var charCode = (evt.which) ? evt.which : evt.keyCode;
|
var charCode = (evt.which) ? evt.which : evt.keyCode;
|
||||||
@ -731,6 +489,194 @@ function isNumberKey(evt)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
function GetAmount(i)
|
||||||
|
{
|
||||||
|
//alert("onchnage function getamount"+i);
|
||||||
|
var amount = parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val())
|
||||||
|
|
||||||
|
var negative=0;
|
||||||
|
if(amount<0)
|
||||||
|
{
|
||||||
|
negative=1;
|
||||||
|
alert("Invalid Amount")
|
||||||
|
$('#invoicepaymet'+i).val('');
|
||||||
|
}
|
||||||
|
|
||||||
|
var x = document.getElementById('checkboxcheckbox'+i).checked;
|
||||||
|
|
||||||
|
|
||||||
|
if(x==true )
|
||||||
|
{
|
||||||
|
|
||||||
|
var date= document.getElementById ( "date"+i ).innerText;
|
||||||
|
var pono =document.getElementById ( "pono"+i ).innerText;
|
||||||
|
var igr =document.getElementById ( "igrno"+i ).innerText;
|
||||||
|
var igrlineitem=document.getElementById ( "igrlineitem"+i ).innerText;
|
||||||
|
var supname =document.getElementById ("sn"+i ).innerText;
|
||||||
|
var totalordervalue =document.getElementById ("tov"+i ).innerText;
|
||||||
|
var balancetopay =document.getElementById ( "qw"+i ).innerText;
|
||||||
|
|
||||||
|
for(k=1;k<=i;k++)
|
||||||
|
{
|
||||||
|
//alert(k);
|
||||||
|
var idcheck=$('#igrlineitem'+k).val();
|
||||||
|
|
||||||
|
if(igrlineitem == idcheck)
|
||||||
|
{
|
||||||
|
var cid=k;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(amount<=balancetopay)//amount paid value is less than or equal to total amount paid value means
|
||||||
|
{
|
||||||
|
|
||||||
|
$('#hidedate'+cid).val(date);
|
||||||
|
$('#hidepono'+cid).val(pono);
|
||||||
|
$('#hidesupname'+cid).val(supname);
|
||||||
|
$('#hidettlPoamt'+cid).val(totalordervalue);
|
||||||
|
$('#hideamtpaid'+cid).val(amount);
|
||||||
|
$('#hideigrno'+cid).val(igr);
|
||||||
|
$('#hideigrline'+cid).val(igrlineitem);
|
||||||
|
|
||||||
|
var totalvalue=$('#addvalue').val();
|
||||||
|
var bid=$('#bankid').val();
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
alert('You are exceeding the payment get!!');
|
||||||
|
$('#invoicepaymet'+i).val(amount)
|
||||||
|
// location.reload();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$.each(temppo, function( index, value )
|
||||||
|
{
|
||||||
|
var res2 = value.split(',');
|
||||||
|
if(res2[1] == igrlineitem){
|
||||||
|
|
||||||
|
temppo[index] = i+','+igrlineitem+','+amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
calculategrandtotal()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** To calculate the overall total and store the value in table's footer */
|
||||||
|
function calculategrandtotal(){
|
||||||
|
|
||||||
|
$.each(temppo, function( index, value )
|
||||||
|
{
|
||||||
|
|
||||||
|
var res2 = value.split(',');
|
||||||
|
tempTotal[index]=parseFloat(res2[2]);
|
||||||
|
//alert(tempTotal[index]);
|
||||||
|
});
|
||||||
|
|
||||||
|
var sum = 0;
|
||||||
|
|
||||||
|
for (var i = 0; i < tempTotal.length; i++) {
|
||||||
|
|
||||||
|
sum += tempTotal[i];
|
||||||
|
|
||||||
|
}
|
||||||
|
$('#addvalue').val(parseFloat(sum).toFixed(2));
|
||||||
|
// console.log(tempTotal);
|
||||||
|
}
|
||||||
|
|
||||||
|
function Save()
|
||||||
|
{
|
||||||
|
|
||||||
|
$('#content').loader('show');
|
||||||
|
var rowCount= $('#Rowid').val();
|
||||||
|
var check= 0;
|
||||||
|
var rw= 0;
|
||||||
|
for(i=1;i<=rowCount;i++)
|
||||||
|
{
|
||||||
|
var arrval = temppo[i-1];
|
||||||
|
var number = arrval.split(',');
|
||||||
|
number = number[0];
|
||||||
|
//alert('rowcount'+i+'selectedcheckboxnumber'+number+'tempinvoice'+arrval);
|
||||||
|
rw= parseFloat(rw)+1;
|
||||||
|
// alert('rwval'+'-'+rw);
|
||||||
|
check = parseFloat(check)+1;
|
||||||
|
var bankdebitamount=$('#debitamount').val();
|
||||||
|
// alert('bankdebitamountval'+'-'+bankdebitamount);
|
||||||
|
var bid =$('#bankid').val();
|
||||||
|
|
||||||
|
// alert('bidval'+'-'+bid);
|
||||||
|
var date =$('#hidedate'+number).val();
|
||||||
|
// alert('dateval'+'-'+date);
|
||||||
|
var pono =$('#hidepono'+number).val();
|
||||||
|
//alert('ponoval'+'-'+pono);
|
||||||
|
var igrno =$('#hideigrno'+number).val();
|
||||||
|
// alert('igrnoval'+'-'+igrno);
|
||||||
|
|
||||||
|
var igrlineitem =$('#hideigrline'+number).val();
|
||||||
|
// alert('igrlineitemval'+'-'+igrlineitem);
|
||||||
|
|
||||||
|
var suppliername=$('#hidesupname'+number).val();
|
||||||
|
// alert('suppliernameval'+'-'+suppliername);
|
||||||
|
|
||||||
|
var totalordervalue=$('#hidettlPoamt'+number).val();
|
||||||
|
// alert('totalordervalueval'+'-'+totalordervalue);
|
||||||
|
|
||||||
|
var amountpaid=$('#hideamtpaid'+number).val();
|
||||||
|
// alert('amountpaidval'+'-'+amountpaid);
|
||||||
|
|
||||||
|
var invoicepaymet=$('#invoicepaymet'+number).val();
|
||||||
|
//alert(invoicepaymet);
|
||||||
|
|
||||||
|
|
||||||
|
var totalvalue=$('#addvalue').val();
|
||||||
|
// alert('totalvalueval'+'-'+totalvalue);
|
||||||
|
|
||||||
|
var payment = parseFloat(amountpaid);
|
||||||
|
//alert('paymentval'+'-'+payment);
|
||||||
|
|
||||||
|
var balnceamount=bankdebitamount-totalvalue;
|
||||||
|
// alert('balnceamountval'+'-'+balnceamount);
|
||||||
|
|
||||||
|
|
||||||
|
if(parseFloat(bankdebitamount)>=parseFloat(totalvalue))
|
||||||
|
{
|
||||||
|
|
||||||
|
$.ajax(
|
||||||
|
{
|
||||||
|
data:{podate:date,pono:pono,igrno:igrno,igrlineitem:igrlineitem,sname:suppliername,tot:totalordervalue,aa:invoicepaymet,rc:rowCount,tpv:totalvalue,bda:bankdebitamount,bi:bid,check:check,rw:rw},
|
||||||
|
type:"POST",
|
||||||
|
url:"<?php echo base_url() ?>cashbook/receipt",
|
||||||
|
success:function(data)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(data)
|
||||||
|
{
|
||||||
|
//$('#content').loader('hide');
|
||||||
|
//alert(data);
|
||||||
|
window.location.href ="Bankingstatement";
|
||||||
|
//location.reload();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
|
||||||
|
alert('Your payment exceeding ');
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
@ -771,6 +717,6 @@ $( function() {
|
|||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -307,7 +307,7 @@ $Bankname = $t->Bankname;
|
|||||||
{
|
{
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<td align="left" id="btc<?php echo $i ?>"><span><?php echo ($t->Debit) - $clearbalance;?></span></td>
|
<td align="left" id="btc<?php echo $i ?>"><span><?php echo ($t->Debit) - ($t->Clearbalance);?></span></td>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -337,10 +337,10 @@ $Bankname = $t->Bankname;
|
|||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<td align="left" id="credit2<?php echo $i ?>"><a href="<?php echo base_url() ?>MappingInvoice?d=<?php echo $t->ID?>&cb=<?php echo $clearbalance?>&btc=<?php echo $t->cbalancetocleared;?>"><span><?php echo $clearbalance?></a></span></td>
|
<td align="left" id="credit2<?php echo $i ?>"><a href="<?php echo base_url() ?>MappingInvoice?d=<?php echo $t->ID?>&cb=<?php echo $clearbalance?>&btc=<?php echo $balanctoclear?>"><span><?php echo $clearbalance?></a></span></td>
|
||||||
|
|
||||||
|
|
||||||
<td align="left" id="credited<?php echo $i ?>"><span><?php echo $t->cbalancetocleared;?></span></td>
|
<td align="left" id="credited<?php echo $i ?>"><span><?php echo ($t->Credit)-($t->cclearbalance);?></span></td>
|
||||||
|
|
||||||
<td align="left" id="csta<?php echo $i ?>"><span><?php echo $t->cstatus?><?php echo $t->Status?></span></td>
|
<td align="left" id="csta<?php echo $i ?>"><span><?php echo $t->cstatus?><?php echo $t->Status?></span></td>
|
||||||
<!-- <td align="left" id="dsta<?php echo $i ?>"><span><?php echo $t->Status?></span></td> -->
|
<!-- <td align="left" id="dsta<?php echo $i ?>"><span><?php echo $t->Status?></span></td> -->
|
||||||
@ -630,8 +630,6 @@ if (x==true)
|
|||||||
var date=$('#date'+i).text();
|
var date=$('#date'+i).text();
|
||||||
var debit=$('#debit'+i).text();
|
var debit=$('#debit'+i).text();
|
||||||
var alreadypaid=$('#totalpaid'+i).text();
|
var alreadypaid=$('#totalpaid'+i).text();
|
||||||
|
|
||||||
|
|
||||||
var credit=$('#credit1'+i).text();
|
var credit=$('#credit1'+i).text();
|
||||||
|
|
||||||
localStorage.setItem('totcredit', credit);
|
localStorage.setItem('totcredit', credit);
|
||||||
@ -640,7 +638,6 @@ if (x==true)
|
|||||||
localStorage.setItem('narr',narration);
|
localStorage.setItem('narr',narration);
|
||||||
|
|
||||||
var alreadycredit=$('#credit2'+i).text();
|
var alreadycredit=$('#credit2'+i).text();
|
||||||
|
|
||||||
localStorage.setItem('alreadyreceived',alreadycredit);
|
localStorage.setItem('alreadyreceived',alreadycredit);
|
||||||
localStorage.setItem('paidedamount',alreadypaid);
|
localStorage.setItem('paidedamount',alreadypaid);
|
||||||
var RowCount= $('#Rowid').val();
|
var RowCount= $('#Rowid').val();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user