ria/app/Views/Report_monthly_gst_table.php
2024-09-11 08:54:25 +05:30

487 lines
13 KiB
PHP
Executable File

<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
.dataTables_filter input {padding: 4px;}
.dataTables_filter {
width: 50%;
float: right;
text-align: right;
}
.dataTables_paginate {
width: 50%;
float: right;
text-align: right;
}
div.dt-buttons {
position: relative;
float: right;
}
.btn-success {
background-color: #00d976;;
border-color: #00d976;;
}
</style>
<div class="content-wrapper">
<section class="content">
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<center><h3 class="box-title"><p style="color: #00d976;"><b>Monthly GST Summary Report</b><br><br>
<div>
<br>
<label><input type="radio" name="colorRadio" id="value" onclick="toggleTables('2')" value="tab" checked> Sales</label>
<label><input type="radio" name="colorRadio" id="qty" onclick="toggleTables('1')" value="ta"> Purchase</label>
</div>
</p></h3></center>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="box-body" style="display:block" id="a">
<table class="table table-bordered table-hover" id="cc" >
<thead>
<tr>
<th style="text-align:center">Date</th>
<th style="text-align:center">Document Number</th>
<th style="text-align:center">Document Type</th>
<th style="text-align:center">HSN CODE</th>
<th style="text-align:center">Value &nbsp;(&#8377;)</th>
<th style="text-align:center">Others &nbsp;(&#8377;)</th>
<th style="text-align:center">SGST &nbsp;(&#8377;)</th>
<th style="text-align:center">CGST &nbsp;(&#8377;)</th>
<th style="text-align:center">IGST &nbsp;(&#8377;)</th>
<th style="text-align:center">Total &nbsp;(&#8377;)</th>
</tr>
</thead>
<tbody>
<?php
$tot_val = 0;
$tot_oth = 0;
$tot_sgst = 0;
$tot_cgst = 0;
$tot_igst = 0;
$tot_tot = 0;
?>
<?php
if(!empty($monthly_gst_sales)){
foreach($monthly_gst_sales as $rel)
{
?>
<tr>
<td style="text-align:center"><span><?php echo $rel->date;?></span></td>
<td style="text-align:center"><span><?php echo $rel->doc_no;?></span></td>
<td style="text-align:center"><span><?php echo $rel->doc_type;?></span></td>
<td style="text-align:center"><span><?php echo $rel->hsn_code;?></span></td>
<td style="text-align:right"><span><?php
$tot_val= $tot_val + round($rel->value,2);
echo round($rel->value,2);
?></span></td>
<td></td>
<td style="text-align:right"><span><?php
$tot_sgst= $tot_sgst + round($rel->sgst,2);
echo round($rel->sgst,2);
?></span></td>
<td style="text-align:right"><span><?php
$tot_cgst= $tot_cgst + round($rel->cgst,2);
echo round($rel->cgst,2);
?></span></td>
<td style="text-align:right"><span><?php
$tot_igst= $tot_igst + round($rel->igst,2);
echo round($rel->igst,2);
?></span></td>
<td style="text-align:right"><span><?php
$tot_tot= $tot_tot + round($rel->total,2);
echo round($rel->total,2);
?></span></td>
</tr>
<?php
}
}
?>
</tbody>
<tfoot width="100%">
<tr>
<td style="text-align:center;"><strong>Total</strong></td>
<td><strong>&nbsp</strong></td>
<td><strong>&nbsp</strong></td>
<td><strong>&nbsp</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_val,2,'.','');
}
?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_oth,2,'.','');
}
?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_sgst,2,'.','');
}
?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_cgst,2,'.','');
}
?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_igst,2,'.','');
}
?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_tot,2,'.','');
}
?>
</strong></td>
</tr>
</tfoot>
</table>
</div>
<!-- second table -->
<div class="box-body" style="display:none" id="b">
<table class="table table-bordered table-hover" id="cc1" >
<thead>
<tr>
<th style="text-align:center">Date</th>
<th style="text-align:center">Document Number</th>
<th style="text-align:center">Document Type</th>
<th style="text-align:center">HSN CODE</th>
<th style="text-align:center">Value &nbsp;(&#8377;)</th>
<th style="text-align:center">Others &nbsp;(&#8377;)</th>
<th style="text-align:center">SGST &nbsp;(&#8377;)</th>
<th style="text-align:center">CGST &nbsp;(&#8377;)</th>
<th style="text-align:center">IGST &nbsp;(&#8377;)</th>
<th style="text-align:center">Total &nbsp;(&#8377;)</th>
</tr>
</thead>
<tbody>
<?php
$tot_val = 0;
$tot_oth = 0;
$tot_sgst = 0;
$tot_cgst = 0;
$tot_igst = 0;
$tot_tot = 0;
if(!empty($monthly_gst_purchase)){
foreach($monthly_gst_purchase as $rel)
{
?>
<tr>
<td style="text-align:center"><span><?php echo $rel->date;?></span></td>
<td style="text-align:center"><span><?php echo $rel->doc_no;?></span></td>
<td style="text-align:center"><span><?php echo $rel->doc_type;?></span></td>
<td style="text-align:center"><span><?php echo $rel->hsn_code;?></span></td>
<td style="text-align:right"><span><?php
$tot_val= $tot_val + $rel->value;
echo $rel->value;
?></span></td>
<td style="text-align:right"><span><?php
$tot_oth= $tot_oth + $rel->others;
echo $rel->others;
?></span></td>
<td style="text-align:right"><span><?php
$tot_sgst= $tot_sgst + $rel->sgst;
echo $rel->sgst;
?></span></td>
<td style="text-align:right"><span><?php
$tot_cgst= $tot_cgst + $rel->cgst;
echo $rel->cgst;
?></span></td>
<td style="text-align:right"><span><?php
$tot_igst= $tot_igst + $rel->igst;
echo $rel->igst;
?></span></td>
<td style="text-align:right"><span><?php
$tot_tot= $tot_tot + $rel->total;
echo $rel->total;
?></span></td>
</tr>
<?php
}
}
?>
</tbody>
<tfoot width="100%">
<tr>
<td style="text-align:center;"><strong>Total</strong></td>
<td><strong>&nbsp</strong></td>
<td><strong>&nbsp</strong></td>
<td><strong>&nbsp</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_val,2,'.','');
}
?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_oth,2,'.','');
}
?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo $tot_sgst;
}
?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_cgst,2,'.','');
}
?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_igst,2,'.','');
}
?>
</strong></td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_tot,2,'.','');
}
?>
</strong></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
</section>
</div>
<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 src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<script>
// Bootstrap datepicker
// Set up your table
$(document).ready(function() {
$.fn.dataTable.moment( 'DD-MM-YYYY' );
table = $('#cc').DataTable( {
"language": {
"emptyTable":"<center> Data Not Found ! </center>"
},
"aaSorting": [[ 0, "desc" ]],
"autoWidth": false,
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-4'i><'col-md-8'p>>",
buttons: [
{
extend: 'excelHtml5',
footer: 'true',
title: $('h3').text(),
exportOptions: {
columns: ':visible'
}
},
'colvis'
]
} );
} );
//second table
$(document).ready(function() {
$.fn.dataTable.moment( 'DD-MM-YYYY' );
table = $('#cc1').DataTable( {
"language": {
"emptyTable":"<center> Data Not Found ! </center>"
},
"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-4'i><'col-md-8'p>>",
buttons: [
{
extend: 'excelHtml5',
footer: 'true',
title: $('h3').text(),
exportOptions: {
columns: ':visible'
}
},
'colvis'
],
} );
} );
$( 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 ) );
});
function getDate( element ) {
var date;
try {
date = $.datepicker.parseDate( dateFormat, element.value );
} catch( error ) {
date = null;
}
return date;
}
} );
function Reset()
{
$('#mySelect').val('');
}
$(document).ready(function(){
$('[data-toggle="tooltip"]').tooltip();
});
function toggleTables(which)
{
if(which == "2") {
document.getElementById('a').style.display = "block";
document.getElementById('b').style.display = "none";
}
if(which == "1") {
document.getElementById('b').style.display = "block";
document.getElementById('a').style.display = "none";
}
}
</script>