banking issues and igr file issues fixes
@ -1168,6 +1168,7 @@ class cashbook extends BaseController
|
|||||||
{
|
{
|
||||||
$data['dropdownvalues'] = $this->cashbook_model->getAccounTypes();
|
$data['dropdownvalues'] = $this->cashbook_model->getAccounTypes();
|
||||||
$data['cashbanking'] = $this->cashbook_model->newcashbook();
|
$data['cashbanking'] = $this->cashbook_model->newcashbook();
|
||||||
|
$data['getsupplier'] = $this->cashbook_model->getsupplier();
|
||||||
$this->global['pageTitle'] ='Siddharth :bankcashbook';
|
$this->global['pageTitle'] ='Siddharth :bankcashbook';
|
||||||
$this->loadViews("bankcashnew", $this->global,$data,NULL);
|
$this->loadViews("bankcashnew", $this->global,$data,NULL);
|
||||||
|
|
||||||
|
|||||||
@ -1438,7 +1438,7 @@ ifnull(sum(id.QuantityAsPerInvoice * pl.Rate),0)))
|
|||||||
- round(ifnull(if(POType = 'REVENUE',
|
- round(ifnull(if(POType = 'REVENUE',
|
||||||
sum(id.QuantityAsPerInvoice * rt.AfterDiscount / pl.Quantity),
|
sum(id.QuantityAsPerInvoice * rt.AfterDiscount / pl.Quantity),
|
||||||
sum(id.QuantityAsPerInvoice * st.Afterdiscountval / pl.Quantity)),0),2)),2) as total,
|
sum(id.QuantityAsPerInvoice * st.Afterdiscountval / pl.Quantity)),0),2)),2) as total,
|
||||||
pb.FilePath as file
|
im.file as ifile,pb.FilePath as file
|
||||||
from T_IGR_Master im
|
from T_IGR_Master im
|
||||||
join T_PurchaseOrder_LineItem pl on pl.PONO = im.PONO
|
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_IGR_Details id on id.IGRNO = im.IGRNO and id.MaterialCode = pl.MaterialCode
|
||||||
@ -1538,7 +1538,7 @@ ifnull(sum(id.QuantityAsPerInvoice * pl.Rate),0)))
|
|||||||
- round(ifnull(if(POType = 'REVENUE',
|
- round(ifnull(if(POType = 'REVENUE',
|
||||||
sum(id.QuantityAsPerInvoice * rt.AfterDiscount / pl.Quantity),
|
sum(id.QuantityAsPerInvoice * rt.AfterDiscount / pl.Quantity),
|
||||||
sum(id.QuantityAsPerInvoice * st.Afterdiscountval / pl.Quantity)),0),2)),2) as total,
|
sum(id.QuantityAsPerInvoice * st.Afterdiscountval / pl.Quantity)),0),2)),2) as total,
|
||||||
pb.FilePath as file
|
im.file as ifile,pb.FilePath as file
|
||||||
from T_IGR_Master im
|
from T_IGR_Master im
|
||||||
join T_PurchaseOrder_LineItem pl on pl.PONO = im.PONO
|
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_IGR_Details id on id.IGRNO = im.IGRNO and id.MaterialCode = pl.MaterialCode
|
||||||
@ -1626,7 +1626,7 @@ $sql.="group by pono,material_name,category,supplier_name";
|
|||||||
|
|
||||||
|
|
||||||
$sql="select pono,potype,date_format(created_date,'%d-%m-%Y') as created_date,supplier_name,
|
$sql="select pono,potype,date_format(created_date,'%d-%m-%Y') as created_date,supplier_name,
|
||||||
sum(total) as total,file
|
sum(total) as total,file,ifile
|
||||||
from igr
|
from igr
|
||||||
where status != 'ST030'
|
where status != 'ST030'
|
||||||
";
|
";
|
||||||
@ -2165,7 +2165,7 @@ if ($cname!= ''){
|
|||||||
|
|
||||||
$sql="select tinex.account_code as AccountCode,date_format(tinex.date,'%d-%m-%Y') as Date,ac.name as AccountName,
|
$sql="select tinex.account_code as AccountCode,date_format(tinex.date,'%d-%m-%Y') as Date,ac.name as AccountName,
|
||||||
tinex.type as type,tinex.cashtype as category ,tinex.merchant as merchantname,tinex.Supplier_id as Supplierid,sup.SupplierName as Suppliername, tinex.sgst as sgst,
|
tinex.type as type,tinex.cashtype as category ,tinex.merchant as merchantname,tinex.Supplier_id as Supplierid,sup.SupplierName as Suppliername, tinex.sgst as sgst,
|
||||||
tinex.value_before_gst as Value,tinex.cgst as cgst,tinex.igst as igst,
|
tinex.value_before_gst as Value,tinex.cgst as cgst,tinex.igst as igst,tinex.document as cashbookfile,
|
||||||
tinex.total as Total
|
tinex.total as Total
|
||||||
FROM t_income_expense tinex
|
FROM t_income_expense tinex
|
||||||
join t_accountcode ac on ac.code = tinex.account_code
|
join t_accountcode ac on ac.code = tinex.account_code
|
||||||
|
|||||||
@ -227,10 +227,12 @@ if(!empty($mms))
|
|||||||
<?php
|
<?php
|
||||||
if(!empty($rel->file)){ ?>
|
if(!empty($rel->file)){ ?>
|
||||||
<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button>File Available</button></a>
|
<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button>File Available</button></a>
|
||||||
|
<?php }else if(!empty($rel->ifile)) { ?>
|
||||||
|
<a target="_blank" href="<?php echo base_url().''. $rel->ifile ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><button>File Available</button></a>
|
||||||
<?php
|
<?php
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
echo 'Not Available';
|
echo 'No Attachments';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</span></td>
|
</span></td>
|
||||||
|
|||||||
@ -313,15 +313,11 @@ table.dataTable thead > tr > td.sorting {
|
|||||||
$tot_tot= $tot_tot + round($rel->total,2);
|
$tot_tot= $tot_tot + round($rel->total,2);
|
||||||
?>
|
?>
|
||||||
<?php
|
<?php
|
||||||
if(!empty($rel->file)){ ?>
|
if(!empty($rel->file)){ ?><!-- if for Inward po file -->
|
||||||
<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><?php echo number_format($rel->total,2,'.','');?></a>
|
<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><?php echo number_format($rel->total,2,'.','');?></a>
|
||||||
<?php
|
<?php }else if(!empty($rel->ifile)) { ?><!-- else if for igr file -->
|
||||||
}else
|
<a target="_blank" href="<?php echo base_url().''. $rel->igrfile ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><?php echo number_format($rel->total,2,'.','');?></a>
|
||||||
{
|
<?php } else { echo number_format($rel->total,2,'.',''); } ?><!-- both inwardpo file and Igr file empty means -->
|
||||||
echo number_format($rel->total,2,'.','');
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
</span></td>
|
</span></td>
|
||||||
|
|
||||||
|
|
||||||
@ -368,8 +364,8 @@ table.dataTable thead > tr > td.sorting {
|
|||||||
$tot_tot= $tot_tot + round($cb->Total,2);
|
$tot_tot= $tot_tot + round($cb->Total,2);
|
||||||
?>
|
?>
|
||||||
<?php
|
<?php
|
||||||
if(!empty($rel->file)){ ?>
|
if(!empty($cb->cashbookfile)){ ?>
|
||||||
<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><?php echo number_format($cb->Total,2,'.','');?></a>
|
<a target="_blank" href="<?php echo base_url().''. $cb->cashbookfile ?>" data-toggle="tooltip" data-placement="left" title="Attachment Available for Download/View"><?php echo number_format($cb->Total,2,'.','');?></a>
|
||||||
<?php
|
<?php
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,18 +1,19 @@
|
|||||||
<script type="text/javascript" src="<?php echo base_url();?>assets/Autocomplete/jquery.autocomplete.js"></script>
|
<script type="text/javascript" src="<?php echo base_url();?>assets/Autocomplete/jquery.autocomplete.js"></script>
|
||||||
<?php
|
<!-- <?php
|
||||||
foreach($dropdownvalues as $type)
|
// foreach($dropdownvalues as $type)
|
||||||
{
|
// {
|
||||||
$atype =$type->type;
|
// $atype =$type->type;
|
||||||
//print_r($atype);
|
// //print_r($atype);
|
||||||
}
|
// }
|
||||||
|
|
||||||
?>
|
?> -->
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
var t = [];
|
var t = [];
|
||||||
var ex = [];
|
var ex = [];
|
||||||
var inc = [];
|
var inc = [];
|
||||||
|
var supp = [];
|
||||||
t= <?php echo json_encode($dropdownvalues)?>;
|
t= <?php echo json_encode($dropdownvalues)?>;
|
||||||
|
|
||||||
//alert(t+'t');
|
//alert(t+'t');
|
||||||
@ -26,6 +27,10 @@ $(function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
supp = <?php echo json_encode($getsupplier)?>;
|
||||||
|
$.each(supp,function(s,supp){
|
||||||
|
$("#supplier").append( $('<option></option>').val(supp.SupplierID).html(supp.SupplierID+' - '+supp.SupplierName));
|
||||||
|
});
|
||||||
|
|
||||||
$('#gst').click(function(){
|
$('#gst').click(function(){
|
||||||
$('#gstarea').toggle();
|
$('#gstarea').toggle();
|
||||||
@ -329,6 +334,18 @@ else
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<b><span for="Suppliername">Select Supplier:</span> </b><span style="color:red">*</span></br></br>
|
||||||
|
<select class="form-control select2 required" id="supplier" name="supplier">
|
||||||
|
<option value="-1">Select Supplier</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@ -1,39 +1,10 @@
|
|||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
foreach($financialyear as $item)
|
||||||
|
{
|
||||||
|
|
||||||
foreach($cash as $c)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
foreach($bankid as $i)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$inrsymbol='';
|
|
||||||
if(!empty($Indiancurrency))
|
|
||||||
{
|
|
||||||
foreach ($Indiancurrency as $inr)
|
|
||||||
{
|
|
||||||
$inrsymbol = $inr->FontCode2000;
|
|
||||||
}}
|
|
||||||
foreach($financialyear as $item)
|
|
||||||
|
|
||||||
{
|
|
||||||
$finyear = $item->financial_year;
|
$finyear = $item->financial_year;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
} ?>
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
|
|
||||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
|
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
|
||||||
<style>
|
<style>
|
||||||
.dataTables_filter input {padding: 4px;}
|
.dataTables_filter input {padding: 4px;}
|
||||||
@ -54,36 +25,23 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
</style>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<section class="content">
|
<section class="content">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Left col -->
|
<!-- Left col -->
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<!-- TABLE: LATEST ORDERS -->
|
<!-- TABLE: LATEST ORDERS -->
|
||||||
<div class="box box-info" id="content">
|
<div class="box box-info" id="content">
|
||||||
|
|
||||||
<!--<div class="box-header with-border">-->
|
|
||||||
<!--<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Cashbook Reports</b></p></h3></center>-->
|
|
||||||
<!--</div>-->
|
|
||||||
<!-- /.box-header -->
|
|
||||||
|
|
||||||
|
|
||||||
<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 Report</b></p></h3></center>
|
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Bank Debit Report</b></p></h3></center>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label for="from_date">
|
<label for="from_date">
|
||||||
<?php echo 'From Date'; ?>
|
<?php echo 'From Date'; ?>
|
||||||
@ -108,28 +66,23 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3" >
|
<div class="col-md-3" >
|
||||||
<label for="customer">
|
<label for="customer">
|
||||||
<?php echo 'Customer'; ?>
|
<?php echo 'Customer'; ?>
|
||||||
</label>
|
</label>
|
||||||
<select class="form-control" id="SupplierName" name="SupplierName">
|
<select class="form-control" id="SupplierName" name="SupplierName">
|
||||||
<option value="">Select Supplier</option>
|
<option value="">Select Supplier</option>
|
||||||
<?php
|
<?php foreach($getsupplier as $gs):
|
||||||
foreach($getsupplier as $gs):
|
|
||||||
|
|
||||||
{?>
|
{?>
|
||||||
|
|
||||||
<option value="<?php echo $gs->SupplierID;?>"><?php echo $gs->SupplierName ; ?></option>
|
<option value="<?php echo $gs->SupplierID;?>"><?php echo $gs->SupplierName ; ?></option>
|
||||||
|
|
||||||
|
|
||||||
<?php } endforeach; ?>
|
<?php } endforeach; ?>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-1" style="margin-top:24px;">
|
|
||||||
<input type="submit" class="btn btn-success" name="btn_submit"
|
|
||||||
value="View Report">
|
|
||||||
|
|
||||||
|
<div class="col-md-1" style="margin-top:24px;">
|
||||||
|
<input type="submit" class="btn btn-success" name="btn_submit" value="View Report">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -140,10 +93,9 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<input type="hidden" id="debitamount" readonly>
|
<input type="hidden" id="debitamount" placeholder="Debit Amount" readonly>
|
||||||
|
|
||||||
|
<input type="hidden" id="bankid" value="" placeholder="Bank Id" readonly>
|
||||||
<input type="hidden" id="bankid" value="" readonly>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-md-3 col-md-offset-9">
|
<div class="col-md-3 col-md-offset-9">
|
||||||
@ -152,32 +104,23 @@
|
|||||||
<!--<p style="margin-left:25px;" id="debit1amount" value="">Total Amount: </p>-->
|
<!--<p style="margin-left:25px;" id="debit1amount" value="">Total Amount: </p>-->
|
||||||
<p style="margin-left:25px;">Payment Mode: Bank</p>
|
<p style="margin-left:25px;">Payment Mode: Bank</p>
|
||||||
<p style="margin-left:25px;" id="bamount" value="">Payment Amount: </p>
|
<p style="margin-left:25px;" id="bamount" value="">Payment Amount: </p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<input type="hidden" name="Rowid" id="Rowid">
|
<input type="hidden" name="Rowid" id="Rowid" placeholder="Row Id" readonly>
|
||||||
<table class="table table-bordered table-hover" id="req" style="table-layout:auto;">
|
<table class="table table-bordered table-hover" id="req" style="table-layout:auto;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Select</th>
|
<th>Select</th>
|
||||||
<th>Date</th>
|
<th>Date</th>
|
||||||
<!--<th>Account Code</th>-->
|
|
||||||
<th>PONO</th>
|
<th>PONO</th>
|
||||||
<th>Supplier Name</th>
|
<th>Supplier Name</th>
|
||||||
<th>Total PO Amount<?php echo '('.$inrsymbol.')' ?></th>
|
<th>Total PO Amount (₹)</th>
|
||||||
<!--<th>Advance PO Amount<?php echo '('.$inrsymbol.')' ?></th>-->
|
<th>Balance To Pay (₹)</th>
|
||||||
<th>Balance To Pay<?php echo '('.$inrsymbol.')' ?></th>
|
<th>Amount Paid (₹)</th>
|
||||||
<!--<th>Description</th>-->
|
|
||||||
<th>Amount Paid<?php echo '('.$inrsymbol.')' ?></th>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -188,48 +131,27 @@
|
|||||||
if(!empty($bankdepit)){
|
if(!empty($bankdepit)){
|
||||||
foreach($bankdepit as $t)
|
foreach($bankdepit as $t)
|
||||||
{
|
{
|
||||||
//print_r($bankdepit);
|
|
||||||
$status=$t->Paymentstatus;
|
$status=$t->Paymentstatus;
|
||||||
$balancetopay=$t->Balancetopay;
|
$balancetopay=$t->Balancetopay;
|
||||||
//print_r($$status);
|
|
||||||
if($status !='ST057')
|
if($status !='ST057')
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<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->PODate),'d-m-Y');?></span></td>
|
<td align="left" id="date<?php echo $i ?>"><span><?php echo date_format(date_create($t->PODate),'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 ?>"><a href="<?= base_url() ?>cashbook/mappingdebit?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="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 $t->TotalOrderValue?></span></td>
|
<td align="left" id="tov<?php echo $i ?>" ><span><?php echo $t->TotalOrderValue?></span></td>
|
||||||
<!--<td align="left" id="aa<?php echo $i ?>"><span><?php echo (($t->AdvanceAmount)+($t->Amountpaid))?></span></td>-->
|
<td align="left" id="qw<?php echo $i ?>" ><span><?php echo ($t->TotalOrderValue-$t->Amountpaid)?></span></td>
|
||||||
|
|
||||||
<td id="qw<?php echo $i ?>" align="left"><span><?php echo ($t->TotalOrderValue-$t->Amountpaid)?></span></td>
|
|
||||||
|
|
||||||
<!--<td id="<?php echo $i ?>" align="left"><span><?php echo $t->Balancetopay?></span></td>-->
|
|
||||||
|
|
||||||
<td data-name="sel"><input type="text" onkeypress="return isNumberKey(event)" onchange="GetAmount(<?php echo $i ?>)" id="invoicepaymet<?php echo $i ?>"></td>
|
<td data-name="sel"><input type="text" onkeypress="return isNumberKey(event)" onchange="GetAmount(<?php echo $i ?>)" id="invoicepaymet<?php echo $i ?>"></td>
|
||||||
<!--<td align="left"><span><?php echo $t->ServiceDescription?></span></td>-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot width="100%">
|
<tfoot width="100%">
|
||||||
@ -240,59 +162,46 @@
|
|||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td class="amount"><strong>
|
<td class="amount">
|
||||||
<!-- 4545 -->
|
<strong><input type="text" id="addvalue" name="addvalue">
|
||||||
|
|
||||||
<input type="text" id="addvalue" name="addvalue">
|
|
||||||
|
|
||||||
</strong>
|
</strong>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</tfoot>
|
</tfoot>
|
||||||
|
<?php } ?>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="col-md-2 col-md-offset-10">
|
<div class="col-md-2 col-md-offset-10">
|
||||||
<a style="float:right;" class="btn btn-success ajax-loader" ID="Save" onclick="Save()" > <span class="bold">Save</span></a>
|
<a style="float:right;" class="btn btn-success ajax-loader" ID="Save" onclick="Save()" > <span class="bold">Save</span></a>
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box -->
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</div><!-- /.box -->
|
||||||
</div>
|
</div><!-- /.col -->
|
||||||
<!-- /.col -->
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12" id="date1"></div>
|
|
||||||
|
|
||||||
<div class="col-md-12" id="purchaseono"></div>
|
<div class="col-md-12" id="HideDateDiv"></div>
|
||||||
|
|
||||||
<div class="col-md-12" id="supname"></div>
|
<div class="col-md-12" id="HidePONODiv"></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="HideAmtPaidDiv"></div>
|
||||||
|
|
||||||
<div class="col-md-12" id="totala"></div>
|
<input type="hidden" name="Recid" id="Recid" value="" readonly>
|
||||||
<!--<input type="text" name="qw1" id="qw1">-->
|
|
||||||
|
<input type="hidden" name="bankamount" id="bankamount" value="" readonly>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<input type="hidden" name="Recid" id="Recid" value="">
|
|
||||||
<!-- <input type="hidden" name="bankid" id="bankid" value="">-->
|
|
||||||
<input type="hidden" name="bankamount" id="bankamount" value="">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
|
|
||||||
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
|
<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/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/pdfmake.min.js"></script>
|
||||||
@ -306,38 +215,24 @@
|
|||||||
var amount=localStorage.getItem('test');
|
var amount=localStorage.getItem('test');
|
||||||
var debamount=localStorage.getItem('damount');
|
var debamount=localStorage.getItem('damount');
|
||||||
$('#debitamount').val(localStorage.getItem('test'));
|
$('#debitamount').val(localStorage.getItem('test'));
|
||||||
//$('#bamount').val(localStorage.getItem('test'));
|
|
||||||
document.getElementById("bamount").innerHTML='Payment Amount:'+amount;
|
document.getElementById("bamount").innerHTML='Payment Amount:'+amount;
|
||||||
//document.getElementById("debit1amount").innerHTML='Total Amount:'+debamount;
|
|
||||||
//alert(res.length);
|
|
||||||
//alert(localStorage.getItem('test1'));
|
|
||||||
var res1 = res.split(',');
|
var res1 = res.split(',');
|
||||||
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 bid=res2[0];
|
||||||
var bam=res2[1];
|
var bam=res2[1];
|
||||||
//alert(bid);
|
|
||||||
//alert(bam);
|
|
||||||
$('#bankid').val(bid);
|
$('#bankid').val(bid);
|
||||||
document.getElementById("bid").innerHTML='Payment ID:' +bid;
|
document.getElementById("bid").innerHTML='Payment ID:' +bid;
|
||||||
});
|
});/** foreach closed */
|
||||||
|
|
||||||
//alert(res2);
|
|
||||||
//alert(res[1]);
|
|
||||||
//var text = $('#debitamount').text();
|
|
||||||
|
|
||||||
|
|
||||||
//alert($data['cash']);
|
|
||||||
// $('#debitamount').val('10');
|
|
||||||
table = $('#req').DataTable( {
|
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',
|
||||||
@ -345,29 +240,22 @@
|
|||||||
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;
|
||||||
@ -375,191 +263,131 @@ function GetPayment(i)
|
|||||||
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 tta= $('#totala').val();
|
|
||||||
//alert(tta+'tta');
|
|
||||||
var tempid = "debited"+value;
|
|
||||||
//var credit=parseFloat(document.getElementById(tempid).innerText);
|
|
||||||
var t ="totala"+value;
|
|
||||||
var poamount1 =$(t).val();
|
|
||||||
//alert(poamount1+'amt');
|
|
||||||
var ponovalue = pono+','+poamount;
|
|
||||||
temppo.push(ponovalue);
|
|
||||||
console.log(temppo);
|
|
||||||
var total=0;
|
|
||||||
$.each(temppo, function( index, value )
|
|
||||||
{
|
|
||||||
var res2 = value.split(',');
|
|
||||||
|
|
||||||
var pono=res2[0];
|
var supname =document.getElementById ("sn"+i ).innerText;//value taken from table col name : suppliername
|
||||||
//alert(pono+'pono');
|
var totalordervalue =document.getElementById ("tov"+i ).innerText;//value taken from table col name : total po amount
|
||||||
var bam=res2[1];
|
var invoicepayment =document.getElementById ( "qw"+i ).innerText;//value taken from table col name : Balance to pay
|
||||||
//alert(bam+'bam');
|
$('#invoicepaymet'+i).val(invoicepayment);//to copy the value from 'balance to pay' to 'amount paid'
|
||||||
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:'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');
|
||||||
|
|
||||||
|
var poamount = $('#hideamtpaid'+i).val();
|
||||||
|
var ponovalue = i+','+pono+','+poamount;
|
||||||
|
temppo.push(ponovalue);
|
||||||
|
//console.log(temppo);
|
||||||
|
|
||||||
|
calculategrandtotal();
|
||||||
|
|
||||||
intex = parseInt(intex)+1;
|
intex = parseInt(intex)+1;
|
||||||
j=parseInt(j)+1;
|
|
||||||
//alert(j+'j');
|
var bankdebitamount=$('#debitamount').val();
|
||||||
var to=0;
|
var totalvalue=$('#addvalue').val();
|
||||||
// for(t=1;t<j;t++)
|
//var balanceamount=bankdebitamount-totalvalue;
|
||||||
|
// alert(bankdebitamount);
|
||||||
|
// alert(totalvalue);
|
||||||
|
|
||||||
|
// if(parseFloat(totalvalue)>=parseFloat(bankdebitamount))
|
||||||
// {
|
// {
|
||||||
|
// alert('your checkbox is disabled beacause already mapped amount');
|
||||||
// //var pono1 =document.getElementById ( "pono"+i ).innerText;
|
// $(".checkboxcheckbox").prop("disabled", true);
|
||||||
// //alert(pono1);
|
|
||||||
|
|
||||||
// var tt=parseFloat( $('#totala'+t).val() == '' ? '0.00' : $('#totala'+t).val());
|
|
||||||
// to = parseFloat(to) + parseFloat (tt);
|
|
||||||
// $('#addvalue').val(parseFloat(to).toFixed(2));
|
|
||||||
// //var total= $('#addvalue').val();
|
|
||||||
// //total=addvalue;
|
|
||||||
// //alert(total);
|
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 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 ('pono'+i ).innerText
|
var Inid = document.getElementById ('pono'+i ).innerText
|
||||||
var ponovalue = Inid+','+Payment;
|
var ponovalue = i+','+Inid+','+Payment;
|
||||||
var a = temppo.indexOf(ponovalue);
|
var a = temppo.indexOf(ponovalue);
|
||||||
//console.log(a);
|
var b = tempTotal.indexOf(Payment);
|
||||||
|
|
||||||
if(a!=-1)
|
if(a!=-1)
|
||||||
{
|
{
|
||||||
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');
|
tempTotal.splice(a,1);
|
||||||
var ch= $('#purchaseono'+s).val();
|
//console.log(tempTotal);
|
||||||
//alert(ch);
|
|
||||||
if(Inid==ch)
|
|
||||||
{
|
|
||||||
|
|
||||||
var w=s;
|
|
||||||
delamount= $('#totala'+w).val();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
calculategrandtotal();
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// //alert(w);
|
|
||||||
var tote= $('#addvalue').val();
|
|
||||||
var afterdeltot= parseFloat(tote)- parseFloat(delamount);
|
|
||||||
tot=parseFloat(tot)- parseFloat(Payment);
|
|
||||||
$('#invoicepaymet'+i).val('');
|
$('#invoicepaymet'+i).val('');
|
||||||
$('#addvalue').val(parseFloat(afterdeltot).toFixed(2));
|
|
||||||
|
|
||||||
|
|
||||||
//alert(ro);
|
$('#Rowid').val(row);
|
||||||
|
|
||||||
$('#Rowid').val(ro);
|
|
||||||
//$('#addvalue').val('');
|
|
||||||
$('#invoicepaymet'+i).val('');
|
$('#invoicepaymet'+i).val('');
|
||||||
$('#date1'+i).val('');
|
$('#hidedate'+i).val('');
|
||||||
$('#purchaseono'+i).val('');
|
$('#hidepono'+i).val('');
|
||||||
$('#supname'+i).val('');
|
$('#hidesupname'+i).val('');
|
||||||
$('#ttamnt'+i).val('');
|
$('#hidettlPoamt'+i).val('');
|
||||||
$('#totala'+i).val('');
|
$('#hideamtpaid'+i).val('');
|
||||||
//$('#aa'+i).val('');
|
|
||||||
|
//$('#invoicepaymet'+i).remove();
|
||||||
|
$('#hidedate'+i).remove();
|
||||||
|
$('#hidepono'+i).remove();
|
||||||
|
$('#hidesupname'+i).remove();
|
||||||
|
$('#hidettlPoamt'+i).remove();
|
||||||
|
$('#hideamtpaid'+i).remove();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -578,9 +406,9 @@ function isNumberKey(evt)
|
|||||||
}
|
}
|
||||||
function GetAmount(i)
|
function GetAmount(i)
|
||||||
{
|
{
|
||||||
//alert('text');
|
//alert("onchnage function getamount"+i);
|
||||||
var amount= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val())
|
var amount = parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val())
|
||||||
//alert(amount);
|
|
||||||
var negative=0;
|
var negative=0;
|
||||||
if(amount<0)
|
if(amount<0)
|
||||||
{
|
{
|
||||||
@ -588,51 +416,46 @@ function GetAmount(i)
|
|||||||
alert("Invalid Amount")
|
alert("Invalid Amount")
|
||||||
$('#invoicepaymet'+i).val('');
|
$('#invoicepaymet'+i).val('');
|
||||||
}
|
}
|
||||||
|
|
||||||
var x = document.getElementById('checkboxcheckbox'+i).checked;
|
var x = document.getElementById('checkboxcheckbox'+i).checked;
|
||||||
|
|
||||||
|
|
||||||
if(x==true )
|
if(x==true )
|
||||||
{
|
{
|
||||||
//alert(x);
|
|
||||||
var date= document.getElementById ( "date"+i ).innerText;
|
var date= document.getElementById ( "date"+i ).innerText;
|
||||||
var pono =document.getElementById ( "pono"+i ).innerText;
|
var pono =document.getElementById ( "pono"+i ).innerText;
|
||||||
//alert(pono);
|
|
||||||
var supname =document.getElementById ("sn"+i ).innerText;
|
var supname =document.getElementById ("sn"+i ).innerText;
|
||||||
var totalordervalue =document.getElementById ("tov"+i ).innerText;
|
var totalordervalue =document.getElementById ("tov"+i ).innerText;
|
||||||
//var advanceamount =document.getElementById ( "aa"+i ).innerText;
|
var balancetopay =document.getElementById ( "qw"+i ).innerText;
|
||||||
var balancetopay=document.getElementById ( "qw"+i ).innerText;
|
|
||||||
|
|
||||||
for(k=1;k<=j-1;k++)
|
for(k=1;k<=i;k++)
|
||||||
{
|
{
|
||||||
//alert(k)
|
//alert(k);
|
||||||
var idcheck=$('#purchaseono'+k).val();
|
var idcheck=$('#hidepono'+k).val();
|
||||||
// alert(idcheck)
|
|
||||||
|
|
||||||
if(pono==idcheck)
|
if(pono == idcheck)
|
||||||
{
|
{
|
||||||
var cid=k;
|
var cid=k;
|
||||||
//alert(cid+'if');
|
|
||||||
//die();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(amount<=totalordervalue)
|
if(amount<=balancetopay)//amount paid value is less than or equal to total amount paid value means
|
||||||
{
|
{
|
||||||
//alert(cid+'cid');
|
|
||||||
$('#date1').val(date);
|
$('#hidedate'+cid).val(date);
|
||||||
$('#purchaseono'+cid).val(pono);
|
$('#hidepono'+cid).val(pono);
|
||||||
$('#supname'+cid).val(supname);
|
$('#hidesupname'+cid).val(supname);
|
||||||
$('#ttamnt'+cid).val(totalordervalue);
|
$('#hidettlPoamt'+cid).val(totalordervalue);
|
||||||
$('#totala'+cid).val(amount);
|
$('#hideamtpaid'+cid).val(amount);
|
||||||
|
|
||||||
var totalvalue=$('#addvalue').val();
|
var totalvalue=$('#addvalue').val();
|
||||||
var bid=$('#bankid').val();
|
var bid=$('#bankid').val();
|
||||||
//$('#inv_total'+cid).val(invoicepayment);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
alert('You are exceeding the payment get!!');
|
alert('You are exceeding the payment get!!');
|
||||||
@ -641,27 +464,38 @@ function GetAmount(i)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var tot11=0
|
$.each(temppo, function( index, value )
|
||||||
for(l=1;l<j;l++)
|
|
||||||
{
|
{
|
||||||
var Payingamount=parseFloat( $('#totala'+l).val() == '' ? '0.00' : $('#totala'+l).val());
|
var res2 = value.split(',');
|
||||||
tot11= parseFloat(tot11)+parseFloat(Payingamount);
|
if(res2[1] == pono){
|
||||||
$('#addvalue').val(parseFloat(tot11).toFixed(2));
|
|
||||||
|
temppo[index] = i+','+pono+','+amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
calculategrandtotal()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// else
|
|
||||||
// {
|
}
|
||||||
// //document.getElementById('checkboxcheckbox'+i).checked = false;
|
|
||||||
// $('#invoicepaymet'+i).val('');
|
|
||||||
// $('#addvalue').val('');
|
/** 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]);
|
||||||
|
});
|
||||||
|
|
||||||
|
var sum = 0;
|
||||||
|
|
||||||
|
for (var i = 0; i < tempTotal.length; i++) {
|
||||||
|
sum += tempTotal[i] << 0;
|
||||||
|
}
|
||||||
|
$('#addvalue').val(parseFloat(sum).toFixed(2));
|
||||||
|
// console.log(tempTotal);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Save()
|
function Save()
|
||||||
@ -673,32 +507,38 @@ function Save()
|
|||||||
var rw= 0;
|
var rw= 0;
|
||||||
for(i=1;i<=rowCount;i++)
|
for(i=1;i<=rowCount;i++)
|
||||||
{
|
{
|
||||||
//alert(i);
|
var arrval = temppo[i-1];
|
||||||
|
var number = arrval.split(',');
|
||||||
|
number = number[0];
|
||||||
|
//alert('rowcount'+i+'selectedcheckboxnumber'+number+'tempinvoice'+arrval);
|
||||||
rw= parseFloat(rw)+1;
|
rw= parseFloat(rw)+1;
|
||||||
check = parseFloat(check)+1;
|
check = parseFloat(check)+1;
|
||||||
var bankdebitamount=$('#debitamount').val();
|
var bankdebitamount=$('#debitamount').val();
|
||||||
|
|
||||||
var bid=$('#bankid').val();
|
var bid =$('#bankid').val();
|
||||||
var date =$('#date1'+i).val();
|
|
||||||
var pono =$('#purchaseono'+i).val();
|
var date =$('#hidedate'+number).val();
|
||||||
var suppliername=$('#supname'+i).val();
|
|
||||||
//alert(suppliername);
|
var pono =$('#hidepono'+number).val();
|
||||||
var totalordervalue=$('#ttamnt'+i).val();
|
|
||||||
var amountpaid=$('#totala'+i).val();
|
var suppliername=$('#hidesupname'+number).val();
|
||||||
//alert(amountpaid+'qw1');
|
|
||||||
var invoicepaymet=$('#invoicepaymet'+i).text();
|
var totalordervalue=$('#hidettlPoamt'+number).val();
|
||||||
// alert(invoicepaymet);
|
|
||||||
|
var amountpaid=$('#hideamtpaid'+number).val();
|
||||||
|
|
||||||
|
var invoicepaymet=$('#invoicepaymet'+number).val();
|
||||||
|
|
||||||
var totalvalue=$('#addvalue').val();
|
var totalvalue=$('#addvalue').val();
|
||||||
//alert(totalvalue);
|
|
||||||
|
|
||||||
var payment = parseFloat(amountpaid);
|
var payment = parseFloat(amountpaid);
|
||||||
|
|
||||||
var balnceamount=bankdebitamount-totalvalue;
|
var balnceamount=bankdebitamount-totalvalue;
|
||||||
|
|
||||||
|
|
||||||
if(parseFloat(bankdebitamount)>=parseFloat(totalvalue))
|
if(parseFloat(bankdebitamount)>=parseFloat(totalvalue))
|
||||||
{
|
{
|
||||||
//alert(date+'date');
|
|
||||||
//die();
|
|
||||||
//alert('you have remainining'+balnceamount);
|
|
||||||
$.ajax(
|
$.ajax(
|
||||||
{
|
{
|
||||||
data:{podate:date,pono:pono,sname:suppliername,tot:totalordervalue,aa:amountpaid,ip:invoicepaymet,rc:rowCount,tpv:totalvalue,bda:bankdebitamount,bi:bid,check:check,rw:rw},
|
data:{podate:date,pono:pono,sname:suppliername,tot:totalordervalue,aa:amountpaid,ip:invoicepaymet,rc:rowCount,tpv:totalvalue,bda:bankdebitamount,bi:bid,check:check,rw:rw},
|
||||||
@ -706,8 +546,11 @@ function Save()
|
|||||||
url:"<?php echo base_url() ?>cashbook/receipt",
|
url:"<?php echo base_url() ?>cashbook/receipt",
|
||||||
success:function(data)
|
success:function(data)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(data)
|
if(data)
|
||||||
{
|
{
|
||||||
|
//$('#content').loader('hide');
|
||||||
|
//alert(data);
|
||||||
window.location.href ="Bankingstatement";
|
window.location.href ="Bankingstatement";
|
||||||
//location.reload();
|
//location.reload();
|
||||||
|
|
||||||
@ -716,50 +559,16 @@ function Save()
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
else{
|
else{
|
||||||
|
|
||||||
alert('You are payment exceeding ');
|
alert('Your payment exceeding ');
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// alert('i'+i);
|
|
||||||
// if(rowCount<=i)
|
|
||||||
// {
|
|
||||||
// if(data)
|
|
||||||
// {
|
|
||||||
// alert(data);
|
|
||||||
|
|
||||||
// location.reload();
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
//alert("Error");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// alert(i);
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
|
|
||||||
// alert('You are payment exceeding');
|
|
||||||
// location.reload();
|
|
||||||
// }
|
|
||||||
// j=j+1;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
$( function() {
|
$( function() {
|
||||||
@ -799,6 +608,6 @@ $( function() {
|
|||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
$tiapr=0.00;$timay=0.00;$tijun=0.00;$tijul=0.00;$tiaug=0.00;$tisep=0.00;$tioct=0.00;$tinov=0.00;$tidec=0.00;$tijan=0.00;$tifeb=0.00;$timar=0.00;
|
$tiapr=0.00;$timay=0.00;$tijun=0.00;$tijul=0.00;$tiaug=0.00;$tisep=0.00;$tioct=0.00;$tinov=0.00;$tidec=0.00;
|
||||||
$teapr=0.00;$temay=0.00;$tejun=0.00;$tejul=0.00;$teaug=0.00;$tesep=0.00;$teoct=0.00;$tenov=0.00;$tedec=0.00;$tejan=0.00;$tefeb=0.00;$temar=0.00;
|
$teapr=0.00;$temay=0.00;$tejun=0.00;$tejul=0.00;$teaug=0.00;$tesep=0.00;$teoct=0.00;$tenov=0.00;$tedec=0.00;
|
||||||
|
$tinjan=0.00;$tinfeb=0.00;$tinmar=0.00;
|
||||||
|
$texjan=0.00;$texfeb=0.00;$texmar=0.00;
|
||||||
$rowwise = 0.00;
|
$rowwise = 0.00;
|
||||||
if (date('m') >= 4) {
|
if (date('m') >= 4) {
|
||||||
$yearl = date('Y').'-'.(date('Y')+1);
|
$yearl = date('Y').'-'.(date('Y')+1);
|
||||||
@ -171,8 +173,6 @@ if (date('m') >= 4) {
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(!empty($datas)){
|
if(!empty($datas)){
|
||||||
//print_r($datas);
|
|
||||||
//die();
|
|
||||||
foreach($datas as $d)
|
foreach($datas as $d)
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -198,12 +198,12 @@ if (date('m') >= 4) {
|
|||||||
<td><?php $tenov= $tenov + number_format($d->NovExpense,2,'.',''); echo number_format($d->NovExpense,2,'.',''); ?></td>
|
<td><?php $tenov= $tenov + number_format($d->NovExpense,2,'.',''); echo number_format($d->NovExpense,2,'.',''); ?></td>
|
||||||
<td><?php $tidec= $tidec + number_format($d->DecIncome,2,'.',''); echo number_format($d->DecIncome,2,'.',''); ?></td>
|
<td><?php $tidec= $tidec + number_format($d->DecIncome,2,'.',''); echo number_format($d->DecIncome,2,'.',''); ?></td>
|
||||||
<td><?php $tedec= $tedec + number_format($d->DecExpense,2,'.',''); echo number_format($d->DecExpense,2,'.',''); ?></td>
|
<td><?php $tedec= $tedec + number_format($d->DecExpense,2,'.',''); echo number_format($d->DecExpense,2,'.',''); ?></td>
|
||||||
<td><?php $tijan= $tijan + number_format($d->JanIncome,2,'.',''); echo number_format($d->JanIncome,2,'.',''); ?></td>
|
<td><?php $tinjan= $tinjan + number_format($d->JanIncome,2,'.',''); echo number_format($d->JanIncome,2,'.',''); ?></td>
|
||||||
<td><?php $tejan= $tejan + number_format($d->JanExpense,2,'.',''); echo number_format($d->JanExpense,2,'.',''); ?></td>
|
<td><?php $texjan= $texjan + number_format($d->JanExpense,2,'.',''); echo number_format($d->JanExpense,2,'.',''); ?></td>
|
||||||
<td><?php $tifeb= $tifeb + number_format($d->FebIncome,2,'.',''); echo number_format($d->FebIncome,2,'.',''); ?></td>
|
<td><?php $tinfeb= $tinfeb + number_format($d->FebIncome,2,'.',''); echo number_format($d->FebIncome,2,'.',''); ?></td>
|
||||||
<td><?php $tefeb= $tefeb + number_format($d->FebExpense,2,'.',''); echo number_format($d->FebExpense,2,'.',''); ?></td>
|
<td><?php $texfeb= $texfeb + number_format($d->FebExpense,2,'.',''); echo number_format($d->FebExpense,2,'.',''); ?></td>
|
||||||
<td><?php $timar= $timar + number_format($d->MarIncome,2,'.',''); echo number_format($d->MarIncome,2,'.',''); ?></td>
|
<td><?php $tinmar= $tinmar + number_format($d->MarIncome,2,'.',''); echo number_format($d->MarIncome,2,'.',''); ?></td>
|
||||||
<td><?php $timar= $temar + number_format($d->MarExpense,2,'.',''); echo number_format($d->MarExpense,2,'.',''); ?></td>
|
<td><?php $texmar= $texmar + number_format($d->MarExpense,2,'.',''); echo number_format($d->MarExpense,2,'.',''); ?></td>
|
||||||
<td><?php $rowwise = $rowwise + number_format($d->overalltotal,2,'.',''); echo number_format($d->overalltotal,2,'.',''); ?></td>
|
<td><?php $rowwise = $rowwise + number_format($d->overalltotal,2,'.',''); echo number_format($d->overalltotal,2,'.',''); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@ -229,12 +229,12 @@ if (date('m') >= 4) {
|
|||||||
<td><b><?php echo number_format($tenov,2,'.',''); ?></b></td>
|
<td><b><?php echo number_format($tenov,2,'.',''); ?></b></td>
|
||||||
<td><b><?php echo number_format($tidec,2,'.',''); ?></b></td>
|
<td><b><?php echo number_format($tidec,2,'.',''); ?></b></td>
|
||||||
<td><b><?php echo number_format($tedec,2,'.',''); ?></b></td>
|
<td><b><?php echo number_format($tedec,2,'.',''); ?></b></td>
|
||||||
<td><b><?php echo number_format($tijan,2,'.',''); ?></b></td>
|
<td><b><?php echo number_format($tinjan,2,'.',''); ?></b></td>
|
||||||
<td><b><?php echo number_format($tejan,2,'.',''); ?></b></td>
|
<td><b><?php echo number_format($texjan,2,'.',''); ?></b></td>
|
||||||
<td><b><?php echo number_format($tifeb,2,'.',''); ?></b></td>
|
<td><b><?php echo number_format($tinfeb,2,'.',''); ?></b></td>
|
||||||
<td><b><?php echo number_format($tifeb,2,'.',''); ?></b></td>
|
<td><b><?php echo number_format($texfeb,2,'.',''); ?></b></td>
|
||||||
<td><b><?php echo number_format($timar,2,'.',''); ?></b></td>
|
<td><b><?php echo number_format($tinmar,2,'.',''); ?></b></td>
|
||||||
<td><b><?php echo number_format($timar,2,'.',''); ?></b></td>
|
<td><b><?php echo number_format($texmar,2,'.',''); ?></b></td>
|
||||||
<td><b><?php echo number_format($rowwise,2,'.',''); ?></b></td>
|
<td><b><?php echo number_format($rowwise,2,'.',''); ?></b></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
|
|||||||
@ -53,7 +53,7 @@
|
|||||||
<td style="text-align:right;"><?php echo $l->total;?></td>
|
<td style="text-align:right;"><?php echo $l->total;?></td>
|
||||||
<td><?php echo $l->description;?></td>
|
<td><?php echo $l->description;?></td>
|
||||||
<td>
|
<td>
|
||||||
<a href="<?php echo base_url(); ?>cashbook/editcashbook?sid=<?php echo $l->id;?>"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the "></i> </a>
|
<a href="<?php echo base_url(); ?>cashbook/editcashbook?sid=<?php echo $l->id;?>"><i class="fa fa-pencil" data-toggle="tooltip" data-placement="left" title="Click here to view/Edit the ".<?php echo $l->type; ?>." Details "></i> </a>
|
||||||
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
@ -92,13 +92,9 @@ $(function () {
|
|||||||
"searching": true,
|
"searching": true,
|
||||||
"aaSorting": [[ 0, "desc" ]],
|
"aaSorting": [[ 0, "desc" ]],
|
||||||
"ordering": true,
|
"ordering": true,
|
||||||
"columnDefs" : [{"targets":1, "type":"date-eu"}],
|
|
||||||
|
|
||||||
"info": true,
|
"info": true,
|
||||||
"autoWidth": true
|
"autoWidth": true
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script>
|
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 194 KiB |
|
Before Width: | Height: | Size: 172 KiB |
|
Before Width: | Height: | Size: 172 KiB |
|
Before Width: | Height: | Size: 179 KiB |
|
Before Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 886 KiB |
|
Before Width: | Height: | Size: 886 KiB |
|
Before Width: | Height: | Size: 886 KiB |
|
Before Width: | Height: | Size: 886 KiB |
|
Before Width: | Height: | Size: 886 KiB |
|
Before Width: | Height: | Size: 886 KiB |
|
Before Width: | Height: | Size: 886 KiB |
|
Before Width: | Height: | Size: 886 KiB |
|
Before Width: | Height: | Size: 886 KiB |
|
Before Width: | Height: | Size: 886 KiB |
|
Before Width: | Height: | Size: 886 KiB |
|
Before Width: | Height: | Size: 886 KiB |
|
Before Width: | Height: | Size: 886 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 770 KiB |
|
Before Width: | Height: | Size: 770 KiB |
|
Before Width: | Height: | Size: 770 KiB |