ria/app/Views/Report_HSNCreditNoteRegister.php
2025-05-17 17:47:14 +05:30

265 lines
8.0 KiB
PHP

<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);">Purchase</a></li>
<li class="breadcrumb-item active">
<h4 class="page-title"><b> HSN - Credit Note Report </b></h4>
</li>
</ol>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<form method="post" action="<?php echo base_url('hsnCreditNoteRegister'); ?>">
<div class="row form-group has-feedback">
<div class="col-md-3">
<label for="financialyear">
Year
</label>
<div class="input-group">
<select class="form-control" id="financialyear" name="financialyear" required>
<option value="">Select Year</option>
<?php
foreach ($finyear as $fy): {; ?>
<option
<?php echo (isset($givenYear) && $fy == $givenYear) ? "selected" : ""; ?>
value="<?php echo $fy; ?>">
<?php echo $fy; ?>
</option>
<?php }
endforeach; ?>
</select>
</div>
</div>
<div class="col-md-3">
<label for="month">
<?php echo 'Month'; ?>
</label>
<div class="input-group">
<select class="form-control select2" id="month" name="month" required>
<?php $monthArray = [
'January',
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
] ?>
<option value="">Select Month</option>
<?php foreach ($monthArray as $month): ?>
<option value="<?= $month ?>" <?php if (isset($givenMonth) && $givenMonth == $month) {
echo 'selected';
} ?>>
<?= $month ?>
</option>
<?php endforeach ?>
</select>
</div>
</div>
<div class="col-md-6 text-right"><br>
<input type="button" class="btn btn-danger m-2" value="Reset" onclick="window.location.href='<?= base_url('hsnCreditNoteRegister') ?>';">
<input type="submit" class="btn btn-success" name="btn_submit"
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;">HSN NO</th>
<th style="text-align: center;">Quantity</th>
<th style="text-align: center;">Total Taxable Amount</th>
<th style="text-align: center;">CGST</th>
<th style="text-align: center;">SGST</th>
<th style="text-align: center;">IGST</th>
<th style="text-align: center;">Net Invoice Amount</th>
<th style="text-align: center;">Rate Of Tax</th>
</tr>
</thead>
<tbody>
<?php
$totalQuantity = 0;
$totalTaxableAmount = 0;
$totalCgst = 0;
$totalSgst = 0;
$totalIgst = 0;
$totalNetInvoiceAmount = 0;
?>
<?php if(!empty($hsnCreditNoteRegister)){ ?>
<?php foreach($hsnCreditNoteRegister as $index => $hcn) {
$totalQuantity += $hcn['quantity'];
$totalTaxableAmount += $hcn['totalTaxableAmount'];
$totalCgst += $hcn['cgst'];
$totalSgst += $hcn['sgst'];
$totalIgst += $hcn['igst'];
$totalNetInvoiceAmount += $hcn['netInvoiceAmount'];
?>
<tr>
<td style="text-align: center;"><?php echo $hcn['hsnOrSac']; ?></td>
<td style="text-align: right;"><?php echo $hcn['quantity']; ?></td>
<td style="text-align: right;"><?php echo $hcn['totalTaxableAmount']; ?></td>
<td style="text-align: right;"><?php echo $hcn['cgst']== 0 ? " " : $hcn['cgst']; ?></td>
<td style="text-align: right;"><?php echo $hcn['sgst']== 0 ? " " : $hcn['sgst']; ?></td>
<td style="text-align: right;"><?php echo $hcn['igst']== 0 ? " " : $hcn['igst']; ?></td>
<td style="text-align: right;"><?php echo $hcn['netInvoiceAmount']; ?></td>
<td style="text-align: center;"><?php echo $hcn['rateOfTax']; ?></td>
</tr>
<?php } ?>
<?php } ?>
</tbody>
<tfoot width="100%">
<tr>
<th colspan="1" style="text-align: right;">Total:</th>
<th colspan="1" style="text-align: right;"><?php echo $totalQuantity; ?></th>
<th colspan="1" style="text-align: right;"><?php echo $totalTaxableAmount; ?></th>
<th colspan="1" style="text-align: right;"><?php echo $totalCgst== 0 ? " " : $totalCgst; ?></th>
<th colspan="1" style="text-align: right;"><?php echo $totalSgst== 0 ? " " : $totalSgst; ?></th>
<th colspan="1" style="text-align: right;"><?php echo $totalIgst== 0 ? " " : $totalIgst; ?></th>
<th colspan="1" style="text-align: right;"><?php echo $totalNetInvoiceAmount; ?></th>
<th></th>
</tr>
</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 () {
var table = $('#cc').DataTable({
dom: 'Blfrtip',
buttons: [
{
extend: 'excel',
text: 'Excel',
footer: true // ✅ This includes the footer in the exported Excel file
}
],
paging: true,
searching: true, // You had this as 'true', so I left it unless you meant to disable it
ordering: false,
info: false,
lengthChange: false,
pageLength: 10,
responsive: true,
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>',
previous: '<i class="fas fa-angle-left"></i>'
}
}
});
});
</script>