ria/app/Views/Report_monthly_gst.php
2025-04-23 19:12:08 +05:30

362 lines
11 KiB
PHP
Executable File

<script>
$(document).ready(function() {
$("#client_name").select2();
$("#item_name").select2();
$("#purchaseorder_number").select2();
});
</script>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
table{
width:auto;
}
.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; */
}
</style>
<div class="content-page">
<div class="content">
<!-- Start Content-->
<div class="container-fluid">
<!-- start page title -->
<div>
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Reports</a></li>
<li class="breadcrumb-item"><a href="javascript: void(0);"></a></li>
<li class="breadcrumb-item active">
<h4 class="page-title"><b> Monthly GST Summary Reports </b></h4>
</li>
</ol>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<!-- <form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;"> -->
<div class="card-body">
<form method="post" action="<?php echo base_url('Report_monthly_gst'); ?>">
<div class="form-group has-feedback">
<div class="row">
<div class="col-md-3 ">
<label for="to_date">
<?php echo 'Year'; ?>
</label>
<select class="form-control" id="financialyear" name="financialyear">
<option value="">Select Year</option>
<?php
foreach($finyear as $item):
{?>
<option
<?php echo isset($ab) && $ab == $item->financial_year ? "selected" : "" ?>
value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
<?php } endforeach; ?>
</select>
</d>
</div>
<div class="col-md-3">
<label for="from_date">
<?php echo 'From Date'; ?>
</label>
<div class="input-group">
<input name="from_date" id="max-date" class="form-control datepicker"
value="<?php echo isset($frm) ? $frm : "" ?>">
</div>
</div>
<div class="col-md-3">
<label for="to_date">
<?php echo 'To Date'; ?>
</label>
<div class="input-group">
<input name="to_date" id="min-date" class="form-control datepicker"
value="<?php echo isset($t) ? $t : "" ?>">
</div>
</div>
<div class="col-md-3">
<label for="month">
<?php echo 'Month'; ?>
</label>
<div class="input-group">
<?php
$months = [
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
];
?>
<select class="form-control" id="month" name="month">
<option value="">Select Month</option>
<?php foreach ($months as $month): ?>
<option value="<?= $month ?>" <?= (isset($m) && $m == $month) ? 'selected' : '' ?>>
<?= $month ?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
<div class="row">
<div class="col text-right"><br><br>
<input type="button" class="btn btn-danger mb-4" value="Reset" onclick="window.location.href='<?= base_url('Report_monthly_gst') ?>';">
<input type="submit" class="btn btn-success" name="btn_submit" style="margin-top: -14px;margin-bottom: 26px;"
value="View Report">
</div>
</div>
</form>
<table id="cc" class="table table-bordered table-hover wrap" style="background-color:#fff;width: 100% !important;">
<!-- <table class="table table-bordered table-hover" id="asset_list_table" style="background-color:#fff;font-size:12px;"> -->
<thead>
<tr>
<th style="text-align:center">Name</th>
<th style="text-align:center">Sales &nbsp;(<i class="fa fa-rupee " ></i>)</th>
<th style="text-align:center">Purchase &nbsp;(<i class="fa fa-rupee " ></i>)</th>
<th style="text-align:center">Net &nbsp;(<i class="fa fa-rupee "></i>)</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($monthly_gst_purchase) and !empty($monthly_gst_sales)){ ?>
<tr>
<td style="text-align:center"><span>SGST</span></td>
<td style="text-align:right"><span><?php
echo round($monthly_gst_sales[0]->sgst,2);?></span></td>
<td style="text-align:right"><span><?php
echo round($monthly_gst_purchase[0]->sgst,2);?></span></td>
<td style="text-align:right"><span><?php
$sgst_net = $monthly_gst_sales[0]->sgst - $monthly_gst_purchase[0]->sgst;
echo round($sgst_net,2);?></span></td>
</tr>
<tr>
<td style="text-align:center"><span>CGST</span></td>
<td style="text-align:right"><span><?php
echo round($monthly_gst_sales[0]->cgst,2);?></span></td>
<td style="text-align:right"><span><?php
echo round($monthly_gst_purchase[0]->cgst,2);?></span></td>
<td style="text-align:right"><span><?php
$cgst_net = $monthly_gst_sales[0]->cgst - $monthly_gst_purchase[0]->cgst;
echo round($cgst_net,2);?></span></td>
</tr>
<tr>
<td style="text-align:center"><span>IGST</span></td>
<td style="text-align:right"><span><?php
echo round($monthly_gst_sales[0]->igst,2);?></span></td>
<td style="text-align:right"><span><?php
echo round($monthly_gst_purchase[0]->igst,2);?></span></td>
<td style="text-align:right"><span><?php
$igst_net = $monthly_gst_sales[0]->igst - $monthly_gst_purchase[0]->igst;
echo round($igst_net,2);?></span></td>
</tr>
<tr>
<td style="text-align:center"><span>Total GST</span></td>
<td style="text-align:right"><span><?php
echo round($monthly_gst_sales[0]->total,2);?></span></td>
<td style="text-align:right"><span><?php
echo round($monthly_gst_purchase[0]->total,2);?></span></td>
<td style="text-align:right"><span><?php
$total_net = $monthly_gst_sales[0]->total - $monthly_gst_purchase[0]->total;
echo round($total_net,2);?></span></td>
</tr>
<?php } ?>
</tbody>
<tfoot width="100%">
</tfoot>
</table>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
</div>
</div> <!-- container -->
</div> <!-- content -->
</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() {
// Initialize the DataTable with only pagination enabled
var table = $('#cc').DataTable({
dom: 'Blfrtip',
buttons: [
{
extend: 'excel',
text: 'Excel',
}
],
paging: true, // Enable pagination
searching: true, // Disable search
ordering: false, // Disable column sorting
info: false, // Disable table information
lengthChange: false, // Disable page length options
pageLength: 10, // Default rows per page
responsive: true, // Keep responsive design
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>', // Next button icon
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
}
}
});
});
</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 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( {
"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>>",
"paging": false,
"lengthChange": false,
"searching": false,
"ordering": false,
"info": false,
buttons: [
{
extend: 'excelHtml5',
footer: 'true',
//messageTop: 'Report Monthly GST',
title: $('h3').text(),
exportOptions: {
columns: ':visible'
}
},
'colvis'
]
} );
} );
$('#mySelect').on('change',function(){
table
.column(4)
.search(this.value)
.draw();
});
$( 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('');
}
</script>