ria/application/views/income_expense_list.php
2018-06-29 17:26:02 +05:30

290 lines
9.6 KiB
PHP
Executable File

<?php//print_r($list); ?>
<div class="content-wrapper">
<section class="content">
<div class="box">
<div class="box-header">
<center><strong><h3 class="box-title"><?php echo $pageTitle; ?></h3></strong></center>
<div align="right" style="padding-right:10px">
<a href="<?php echo base_url(); ?>cashbook/addNewIncomeExpenseLoad" class="btn btn-primary" align="right"style="padding-right:10px" >Add New</a>
</div>
</div>
<div class="box-body">
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<b><label for="From Date">From Date:</label></b>
<div class="input-group">
<input name="from_date" id="max-date" class="form-control datepicker">
<span class="input-group-addon">
<i class="fa fa-calendar fa-fw"></i>
</span>
</div>
</div>
<div class="col-md-3">
<b><label for="To Date">To Date:</label></b>
<div class="input-group">
<input name="to_date" id="min-date" class="form-control datepicker">
<span class="input-group-addon">
<i class="fa fa-calendar fa-fw"></i>
</span>
</div>
</div>
<div class="col-md-3">
<b><label for="year">Year:</label></b>
<select class="form-control" id="financialyear" name="financialyear">
<option value="">Select Year</option>
<?php
foreach($finyear as $item):
{?>
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
<?php } endforeach; ?>
</select>
</div>
<div class="col-md-3">
<div style="padding-right:10px;padding-top: 20px;" align="right">
<input type="submit" class="btn btn-success" name="btn_submit" value="View Report">
</div>
</div>
</div>
</div>
</form>
</div>
<table id="inexlist" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<div align="right" style="padding-right:10px">
<div id="content" > </div>
<div class="modal fade" role="dialog">
<thead style="background-color:#ddf">
<tr>
<th>Account Type</th>
<th>DATE</th>
<th>Account Name</th>
<th>Amount(&#8377;)</th>
<th>Details</th>
<th>Action</th>
</tr>
</thead>
<tbody id="inexlistbody">
<?php if(!empty($list))
{
$base = base_url();
foreach($list as $l)
{
?>
<tr>
<td><?php echo '<a href="'.$base.'cashbook/incomeExpenseList/'.$l->id.'">'.$l->type.'</a>';?></td>
<td style="text-align:right;"><?php echo date_format(date_create($l->date),'d-m-Y');?></td>
<td><?php if($l->type == 'PAYMENT' && $l->account_code == '999') { echo $l->description; } else {echo $l->name;}?></td>
<td style="text-align:right;"><?php echo $l->total;?></td>
<td><?php echo $l->description;?></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 RECEIPT OR PAYMENT"></i>&nbsp;&nbsp;&nbsp;</a>
<!-- <span data-toggle="modal" data-target="#myModal" data-id="<?php echo $l->id; ?>" >
<a data-toggle="tooltip" title="Click here to view multiple payment details"><i class="fa fa-clone"></i></a></span> -->
<?php if($l->type == 'PAYMENT' && $l->account_code == '999') { ?>
<span data-toggle="tooltip" title="Click here to view multiple payment details">
<a data-toggle="modal" onclick="inex(<?php echo $l->id; ?>)" data-id="<?php echo $l->id; ?>"><i class="fa fa-clone"></i></a></span>
<?php } ?>
</td>
</tr>
<?php
}
}
?>
</tbody>
</div>
</div>
</table>
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header" style="background-color: #5d0411;color:#fff;">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Multiple Payment List</h4>
</div>
<div class="modal-body">
<div>
<table class="table table-bordered table-hover" id="paymentdetails">
<thead>
<th>Account Type</th>
<th>Account Name</th>
<th>Sub Description</th>
<th>Amount(&#8377;)</th>
<th>Tax value(&#8377;)(sgst+cgst+igst)</th>
<th>Total amount(&#8377;)</th>
</thead>
<tbody id="tbleAppend"></tbody>
</table>
</div>
</div>
<div class="modal-footer" style="background-color: #5d0411;">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
<br>
<!-- </div>
</div> -->
</div>
</section>
</div>
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<script>
$(document).ready(function() {
$.fn.dataTable.moment( 'DD-MM-YYYY' );
table = $('#inexlist').DataTable( {
"aaSorting": [[ 1, "desc" ]],
"autoWidth": false,
//"columnDefs" : [{"targets":1, "type":"date-eu"}],
orderCellsTop: true,
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
"<'row'<'col-md-6'><'col-md-6'>>" +
"<'row'<'col-md-12't>><'row'<'col-md-2'i><'col-md-10'p>>",
buttons: [
// {
// extend: 'excelHtml5',
// footer: 'true',
// messageTop: 'Cashbook Report',
// title: $('h3').text(),
// exportOptions: {
// columns: ':visible'
// }
// },
// 'colvis'
]
} );
} );
// $(function () {
// $.fn.dataTable.moment( 'DD-MM-YYYY' );
// $('#inexlist').DataTable({
// "paging": true,
// "lengthChange": true,
// "searching": true,
// "aaSorting": [[ 1, "desc" ]],
// "ordering": true,
// "info": true,
// "autoWidth": true
// });
// });
function inex(input){
$.ajax({
data:{id:input},
type:"POST",
//dataType: 'json',
url:"<?php echo base_url() ?>cashbook/ViewPaymentDetails",
success:function(data) {
$('#myModal').modal('show');
var trHTML = '';
$.each(JSON.parse(data), function (i, item) {
if(input == item.Payment_id)
{
var tax = (+item.sgst+ +item.cgst+ +item.igst);
trHTML += '<tr>' +
'<td>' + item.type + '</td>' +
'<td>' + item.name + '</td>' +
'<td align="right" >' + item.Account_description + '</td>' +
'<td>'+ item.Amount+ '</td>' +
'<td align="right" >'+ tax +'</td>' +
'<td align="right" >'+item.total+'</td>' +
'</tr>';
}
});
$("#tbleAppend").empty();
$('#paymentdetails > tbody').append(trHTML);
}
});
}
$( function() {
//var dateFormat = "mm/dd/yy",
from = $( "#min-date" )
.datepicker({
dateFormat: "dd-mm-yy",
defaultDate: "+0d",
changeMonth: true,
//numberOfMonths: 1
})
.on( "change", function() {
to.datepicker("option", "minDate", getDate( this ) );
}),
to = $( "#max-date" ).datepicker({
dateFormat: "dd-mm-yy",
defaultDate: "+0d",
changeMonth: true,
//numberOfMonths: 1
})
.on( "change", function() {
from.datepicker( "option", "maxDate", getDate( this ) );
});
} );
</script>