riainvoice/application/modules/reports/views/all_invoice.php
2021-10-01 23:34:16 +05:30

364 lines
12 KiB
PHP

<div id="headerbar">
<!-- <center> --> <!-- <h1><?php _trans('ALL-GST-Report'); ?></h1> -->
<h1 class="headerbar-title"><?php _trans('ALL-Invoices'); ?></h1>
<!-- <p> <?php
if($this->input->post('financialyear')){
$ab=$this->input->post('financialyear');
echo '('.$ab.')';
echo ' ';
}
if($this->input->post('month')){
$m=$this->input->post('month');
echo '('.$m.')';
echo ' ';
}
?></p> -->
<!-- </center> -->
</div>
<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">
<div id="content">
<!-- <div class="row">
<div class="col-xs-12 col-md-6 col-md-offset-3">
<?php $this->layout->load_view('layout/alerts'); ?>
</div>
</div> -->
<div class="col-xs-12 col-md-12">
<?php $this->layout->load_view('layout/alerts'); ?>
<div id="report_options" class="panel panel-default">
<a href="#" style="float:right; font-size:30px; margin-right:17px;" class="show_hide">+</a>
<div class="panel-heading">
<i class="fa fa-print"></i>
<?php _trans('report_options'); ?>
</div>
<div class="slidingDiv">
<div class="panel-body">
<form method="post" action="">
<input type="hidden" name="_ip_csrf" value="<?= $this->security->get_csrf_hash() ?>">
<div class="form-group has-feedback">
<div class="col-md-2">
<label for="to_date">
<?php _trans('Year'); ?>
</label>
<div class="input-group">
<select class="form-control" id="financialyear" name="financialyear">
<option value="">Select Year</option>
<?php
foreach($fin as $item):
{?>
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
<?php } endforeach; ?>
</select>
</div>
</div>
<div class="col-md-2">
<label for="to_date">
<?php _trans('Month'); ?>
</label>
<div class="input-group">
<select class="form-control" id="month" name="month">
<option value="">Select Month</option>
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
</div>
</div>
<div class="col-md-2" >
<label for="to_date">
<?php _trans('&nbsp;'); ?>
</label><div>
<input type="submit" class="btn btn-success" name="btn_submit"
value="View Report" onclick="JavaScript:window.location.hash = ">
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div id="table">
<?php
if(!empty($results))
{
?>
<center><h3 class="report_title">
<?php echo trans('ALL-Invoices'); ?>
<small>&nbsp;<?php
if($this->input->post('client_name')){
$cid=$this->input->post('client_name');
echo '('.$cid.')';
}
if($this->input->post('financialyear')){
$ab=$this->input->post('financialyear');
echo '('.$ab.')';
}
if($this->input->post('month')){
$month = $this->input->post('month');
echo '('.$month.')';
}
?></small>
</h3>
</center>
<div class="table-responsive">
<div id="panel-recent-invoices" class="panel panel-default">
<body>
<table class="table table-striped table-condensed no-margin" id="tab">
<thead>
<tr>
<th style="text-align:center;"><?php echo trans('Date'); ?></th>
<th style="text-align:center;"><?php echo trans('Invoice-No'); ?></th>
<th style="text-align:center;"><?php echo trans('Receiver Details'); ?></th>
<!-- <th><?php echo trans('Customer Name'); ?></th> -->
<th style="text-align:center;"><?php echo trans('HSN/SAC'); ?></th>
<th style="text-align:center;"><?php echo trans('Tax Percentage');?></th>
<th style="text-align:center;"><?php echo trans('Taxable Value'); ?></th>
<th style="text-align:center;"><?php echo trans('CGST'); ?></th>
<th style="text-align:center;"><?php echo trans('SGST'); ?></th>
<th style="text-align:center;"><?php echo trans('IGST'); ?></th>
<th style="text-align:center;"><?php echo trans('Tax Value'); ?></th>
<th style="text-align:center;"><?php echo trans('Total Invoice Value'); ?></th>
</tr>
</thead>
<tbody>
<?php
$tr1=0;
$tr2=0;
$tr3=0;
$tr4=0;
$tr5=0;
$trb=0;
foreach ($results as $result) { ?>
<tr>
<!-- <td><?php _htmlsc(format_client($result)); ?></td> -->
<td ><?php
$d=date("d-m-Y",strtotime($result->invoice_date_created));
echo $d;
?>
</td>
<td style="text-align:right;"><?php echo ($result->invoice_number); ?></td>
<td style="text-align:right;"><?php echo ($result->client_tax_code); ?></td>
<!-- <td ><?php echo ($result->client_name); ?></td> -->
<!-- <td style="text-align:left;"><?php
if(!empty($result->client_name)) { echo anchor('clients/view/' . $result->client_id,$result->client_name); } else {echo "-";}
?></td> -->
<td style="text-align:right;"><?php echo ($result->product_sku); ?></td>
<td style="text-align:right;"><?php echo ($result->percentage.'%');?></td>
<td class="amount"><?php
$tr1= $tr1 + round($result->item_subtotal);
echo format_currency(round($result->item_subtotal));
//echo ($result->item_subtotal); ?></td>
<td class="amount"><?php
$tr2= $tr2 + round($result->cgst);
echo format_currency(round($result->cgst));
//echo ($result->sgst); ?></td>
<td class="amount"><?php
$tr3= $tr3 + round($result->sgst);
echo format_currency(round($result->sgst));
//echo ($result->cgst); ?></td>
<td class="amount"><?php
$tr4= $tr4 + round($result->igst);
echo format_currency(round($result->igst));
//echo ($result->igst); ?></td>
<td class="amount"><?php
$tr5= $tr5 + round($result->item_tax_total);
echo format_currency(round($result->item_tax_total));
//echo ($result->item_tax_total); ?></td>
<td class="amount"><?php
$trb= $trb + round($result->total);
echo format_currency(round($result->total));
//echo ($result->total); ?></td>
</tr>
<?php } ?>
</tbody>
<tfoot width="100%">
<tr>
<td style="text-align:center;"><strong>Total</strong></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="amount"><strong>
<?php
{
echo format_currency($tr1);
}
?>
</strong>
</td>
<td class="amount"><strong>
<?php
{
echo format_currency($tr2);
}
?>
</strong>
</td>
<td class="amount">
<strong>
<?php
{
echo format_currency($tr3);
}
?>
</strong>
</td>
<td class="amount">
<strong>
<?php
{
echo format_currency($tr4);
}
?>
</strong>
</td>
<td class="amount">
<strong>
<?php
{
echo format_currency($tr5);
}
?>
</strong>
</td>
<td class="amount">
<strong>
<?php
{
echo format_currency($trb);
}
?>
</strong>
</td>
</tr>
</tfoot>
</table>
<?php }
if(empty($results))
{
echo "<center><h3>No Records Found</h3></center>";
}
?>
</body>
</div>
</div></div>
</div>
<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://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
<script>
$(document).ready(function() {
$('#tab').DataTable( {
"pageLength": 30,
dom: 'Bfrtip',
"order": [[0, "asc"]],
buttons: [
{
extend: 'excelHtml5',
footer: 'true',
title: $('center').text(),
exportOptions: {
columns: ':visible'
}
},
'colvis'
]
} );
} );
$(document).ready(function () {
$(".slidingDiv").show();
$('.show_hide').click(function (e) {
$(".slidingDiv").slideToggle("fast");
var val = $(this).text() == "-" ? "+" : "-";
$(this).hide().text(val).fadeIn("fast");
e.preventDefault();
});
});
</script>