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

286 lines
9.0 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);">Purchase</a></li>
<li class="breadcrumb-item active">
<h4 class="page-title"><b> Report - Purchase supplier wise </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_supplier'); ?>">
<div class="form-group">
<div class="row">
<div class="col-3">
<label for="client_name">
<?php echo 'Supplier'; ?>
</label>
<select class="form-control" id="client_name" name="client_name">
<option value="">Select Supplier</option>
<?php
foreach ($cust as $item): { ?>
<option <?php if(isset($cname) && ($cname == $item->SupplierName)){ echo 'selected'; } ?> value="<?php echo $item->SupplierName; ?>"><?php echo $item->SupplierName; ?></option>
<?php }
endforeach; ?>
</select>
</div>
<div class="col-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 if(isset($ab) && ($ab == $item->financial_year)){ echo 'selected'; } ?> value="<?php echo $item->financial_year; ?>"><?php echo $item->financial_year; ?></option>
<?php }
endforeach; ?>
</select>
</div>
<div class="col-3">
<label for="to_date">
<?php echo 'Month'; ?>
</label>
<div class="input-group">
<select class="form-control" id="month" name="month">
<option value="">Select Month</option>
<?php $months = ["January", "February", "March", "April", "May", "June","July", "August", "September", "October", "November", "December"]; ?>
<?php foreach ($months as $month): { ?>
<option <?php if(isset($m) && ($m == $month)){ echo 'selected'; } ?> value="<?php echo $month; ?>"><?php echo $month; ?></option>
<?php } endforeach; ?>
</select>
</div>
</div>
<div class="col-3">
<label for="from_date">
<?php echo 'From Date'; ?>
</label>
<div class="input-group">
<input type="date" class="form-control" name="from_date" id="max-date" value="<?php if(isset($frm)){ echo $frm; } ?>">
</div>
</div>
</div>
<br>
<div class="row">
<div class="col-3">
<label for="to_date">
<?php echo 'To Date'; ?>
</label>
<div class="input-group">
<input type="date" class="form-control" name="to_date" id="min-date" value="<?php if(isset($t)){ echo $t; } ?>">
</div>
</div>
<div class="col-6"></div>
<div class="col-3 text-right"><br>
<input type="button" class="btn btn-danger m-2" value="Reset" onclick="window.location.href='<?= base_url('Report_supplier') ?>';">
<input type="submit" class="btn btn-success" name="btn_submit"
value="View Report">
</div>
</div>
</div>
<div class="form-group has-feedback">
</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">Supplier Name</th>
<th style="text-align:center">PO Count</th>
<th style="text-align:center">Quantity</th>
<th style="text-align:center">Value &nbsp;(&#8377;)</th>
</tr>
</thead>
<tbody>
<?php if(!empty($spurchse)){
$tot_rate = 0;
$tot_qty = 0;
$tot_value = 0;
$tot_tot = 0;
foreach($spurchse as $rel)
{
?>
<tr>
<td><span>
<?= $rel->supplier_name?>
</span></td>
<td style="text-align:right"><span><?php
$tot_rate= $tot_rate + round($rel->counts);
echo round($rel->counts);?></span></td>
<td style="text-align:right"><span><?php
$tot_qty= $tot_qty + round($rel->quantity);
echo round($rel->quantity);?></span></td>
<td style="text-align:right"><span><?php
$tot_value= $tot_value + $rel->value;
echo number_format($rel->value,2,'.','');?></span></td>
</tr>
<?php
}
}
?>
</tbody>
<tfoot width="100%">
<tr>
<td style="text-align:center;"><strong>Total</strong></td>
<td class="amount" style="text-align:right"><strong>
<?php
{
echo $tot_rate??0;
}
?>
</strong>
</td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo $tot_qty??0;
}
?>
</strong>
</td>
<td class="amount" style="text-align:right">
<strong>
<?php
{
echo number_format($tot_value??0,2,'.','');
}
?>
</strong>
</td>
</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() {
// 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>