435 lines
15 KiB
PHP
Executable File
435 lines
15 KiB
PHP
Executable File
<!-- Report_purchase_inward.php -->
|
|
<script>
|
|
$(document).ready(function() {
|
|
$("#financialyear").select2();
|
|
$("#month").select2();
|
|
$("#client_name").select2();
|
|
$("#item_name").select2();
|
|
});
|
|
</script>
|
|
|
|
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
|
|
|
|
<style>
|
|
table {
|
|
width: auto;
|
|
}
|
|
</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);">Report</a></li>
|
|
<li class="breadcrumb-item"><a href="javascript: void(0);">Inward</a></li>
|
|
<li class="breadcrumb-item active">
|
|
<h4 class="page-title"><b>Inward Details</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_purchase_inward"); ?>">
|
|
<div class="row">
|
|
<div class="col-md-4">
|
|
<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($client_name) && ($client_name == $item->SupplierName)) {
|
|
echo 'selected';
|
|
} ?>
|
|
value="<?php echo $item->SupplierName; ?>"><?php echo $item->SupplierName; ?></option>
|
|
|
|
|
|
<?php }
|
|
endforeach; ?>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label for="client_name">
|
|
<?php echo 'Material'; ?>
|
|
</label>
|
|
<div class="input-group">
|
|
<select class="form-control" id="item_name" name="item_name">
|
|
<option value="">Select Material</option>
|
|
<?php
|
|
|
|
|
|
foreach ($material as $it): { ?>
|
|
|
|
<option value="<?php echo $it->MaterialName; ?>"
|
|
<?php if (isset($item_name) && ($item_name == $it->MaterialName)) {
|
|
echo 'selected';
|
|
} ?>><?php echo $it->MaterialName; ?></option>
|
|
|
|
|
|
<?php }
|
|
endforeach; ?>
|
|
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label for="to_date">
|
|
<?php echo 'Year'; ?>
|
|
</label>
|
|
<div class="input-group">
|
|
<select class="form-control" id="financialyear" name="financialyear">
|
|
<option value="">Select Year</option>
|
|
<?php
|
|
|
|
|
|
foreach ($finyear as $item): { ?>
|
|
|
|
<option value="<?php echo $item->financial_year; ?>" <?php if (isset($financialyear) && ($financialyear == $item->financial_year)) {
|
|
echo 'selected';
|
|
} ?>><?php echo $item->financial_year; ?></option>
|
|
|
|
|
|
<?php }
|
|
endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<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>
|
|
<option value="January" <?php if (isset($month) && ($month == "January")) {
|
|
echo 'selected';
|
|
} ?>>January</option>
|
|
<option value="February" <?php if (isset($month) && ($month == "February")) {
|
|
echo 'selected';
|
|
} ?>>February</option>
|
|
<option value="March" <?php if (isset($month) && ($month == "March")) {
|
|
echo 'selected';
|
|
} ?>>March</option>
|
|
<option value="April" <?php if (isset($month) && ($month == "April")) {
|
|
echo 'selected';
|
|
} ?>>April</option>
|
|
<option value="May" <?php if (isset($month) && ($month == "May")) {
|
|
echo 'selected';
|
|
} ?>>May</option>
|
|
<option value="June" <?php if (isset($month) && ($month == "June")) {
|
|
echo 'selected';
|
|
} ?>>June</option>
|
|
<option value="July" <?php if (isset($month) && ($month == "July")) {
|
|
echo 'selected';
|
|
} ?>>July</option>
|
|
<option value="August" <?php if (isset($month) && ($month == "August")) {
|
|
echo 'selected';
|
|
} ?>>August</option>
|
|
<option value="September" <?php if (isset($month) && ($month == "September")) {
|
|
echo 'selected';
|
|
} ?>>September</option>
|
|
<option value="October" <?php if (isset($month) && ($month == "October")) {
|
|
echo 'selected';
|
|
} ?>>October</option>
|
|
<option value="November" <?php if (isset($month) && ($month == "November")) {
|
|
echo 'selected';
|
|
} ?>>November</option>
|
|
<option value="December" <?php if (isset($month) && ($month == "December")) {
|
|
echo 'selected';
|
|
} ?>>December</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row mt-2">
|
|
<div class="col-md-2 ">
|
|
<label for="from_date">
|
|
<?php echo 'From Date'; ?>
|
|
</label>
|
|
<div class="input-group">
|
|
<input name="from_date" id="max-date" class="form-control" autocomplete="off" value="<?php if (isset($from_date)) {
|
|
echo $from_date;
|
|
} ?>">
|
|
</div>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<label for="to_date">
|
|
<?php echo 'To Date'; ?>
|
|
</label>
|
|
<div class="input-group">
|
|
<input name="to_date" id="min-date" class="form-control datepicker" autocomplete="off" value="<?php if (isset($to_date)) {
|
|
echo $to_date;
|
|
} ?>">
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-md-8 mt-2 text-right">
|
|
<input type="button" class="btn btn-danger" value="Reset" onclick="window.location.href='<?= base_url('Report_purchase_inward') ?>';">
|
|
|
|
|
|
<input type="submit" class="btn btn-success ml-2" name="btn_submit" value="View Report">
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="form-group has-feedback">
|
|
|
|
</div>
|
|
|
|
|
|
</form>
|
|
<span style="color:red;">*Insurance field not included </span>
|
|
<div class="table-responsive">
|
|
<table id="cc" class="table table-bordered" cellspacing="0" style="font-size:12px !important;">
|
|
<thead>
|
|
<tr>
|
|
<th>PO No</th>
|
|
<th>IGR Created Date</th>
|
|
<th>Time</th>
|
|
<th>Material Received Date</th>
|
|
<th>Material Name</th>
|
|
<th>Category</th>
|
|
<th>Supplier Name</th>
|
|
<th>Qty</th>
|
|
<th>UOM</th>
|
|
<th>Rate (₹)</th>
|
|
<th>Value (₹)</th>
|
|
<th>Exchange Rate</th>
|
|
<th>SGST (₹)</th>
|
|
<th>CGST (₹)</th>
|
|
<th>IGST (₹)</th>
|
|
<th>Discount (₹)</th>
|
|
<th>Freight (₹)</th>
|
|
<th>Package (₹)</th>
|
|
<th>Total (₹)</th>
|
|
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$tot_qty = 0;
|
|
$tot_rate = 0;
|
|
$tot_value = 0;
|
|
$tot_ex = 0;
|
|
$tot_CGST = 0;
|
|
$tot_SCGT = 0.0000;
|
|
$tot_ICGT = 0;
|
|
$tot_dis = 0;
|
|
$tot_frg = 0;
|
|
$tot_pac = 0;
|
|
//$tot_inc = 0;
|
|
$tot_tot = 0;
|
|
if (!empty($purchase)) {
|
|
foreach ($purchase as $key => $rel)
|
|
//print_r($rel);
|
|
{
|
|
?>
|
|
<tr id="lastvalue">
|
|
<td id="pono<?php echo $key ?>"><span>
|
|
<a href="<?php echo base_url() . 'purchaseorder/CreatePOPrint?PONO=' . $rel->pono . '&ReqType=' . $rel->potype; ?>"><?php echo $rel->pono; ?></a>
|
|
</span></td>
|
|
<td style="text-align:center"><span><?php echo $rel->created_date; ?></span></td>
|
|
<td style="text-align:right"><span><?php echo $rel->created_time; ?></span></td>
|
|
<td style="text-align:center"><span><?php echo $rel->materialrcvddate; ?></span></td>
|
|
<td><span><?php echo $rel->material_name; ?></span></td>
|
|
<td><span><?php echo $rel->category; ?></span></td>
|
|
<td><span><?php echo $rel->supplier_name; ?></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:left"><span><?php
|
|
echo $rel->UOM; ?></span></td>
|
|
<td style="text-align:right"><span><?php
|
|
$tot_rate = $tot_rate + $rel->rate;
|
|
echo $rel->rate; ?></span></td>
|
|
<td style="text-align:right"><span><?php
|
|
$tot_value = $tot_value + $rel->value;
|
|
echo $rel->value; ?></span></td>
|
|
<td style="text-align:right"><span><?php
|
|
$tot_ex = $tot_ex + (int)$rel->exchange_rate;
|
|
echo $rel->exchange_rate; ?></span></td>
|
|
<td style="text-align:right"><span><?php
|
|
$tot_SCGT = $tot_SCGT + $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_ICGT = $tot_ICGT + $rel->igst;
|
|
echo $rel->igst; ?></span></td>
|
|
<td style="text-align:right"><span><?php
|
|
$tot_dis = $tot_dis + $rel->discount;
|
|
echo $rel->discount; ?></span></td>
|
|
<td style="text-align:right"><span><?php
|
|
$tot_frg = $tot_frg + $rel->freight;
|
|
echo $rel->freight; ?></span></td>
|
|
<td style="text-align:right"><span><?php
|
|
$tot_pac = $tot_pac + $rel->Package;
|
|
echo $rel->Package; ?></span></td>
|
|
<td style="text-align:right"><span><?php
|
|
$tot_tot = $tot_tot + round($rel->total, 2);
|
|
echo number_format($rel->total, 2, '.', '');
|
|
?></span></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
</tbody>
|
|
<tfoot width="100%">
|
|
<tr>
|
|
<td style="text-align:center;"><strong>Total</strong></td>
|
|
<td><strong> </strong></td>
|
|
<td><strong> </strong></td>
|
|
<td><strong> </strong></td>
|
|
<td><strong> </strong></td>
|
|
<td><strong> </strong></td>
|
|
<td><strong> </strong></td>
|
|
|
|
<td class="amount" style="text-align:right"><strong>
|
|
<?php echo $tot_qty; ?>
|
|
</strong></td>
|
|
|
|
<td class="amount"><strong>
|
|
<?php //echo format_currency($tot_rate,2,'.','');
|
|
?>
|
|
</strong></td>
|
|
|
|
<td class="amount"><strong>
|
|
<?php //echo format_currency($tot_rate,2,'.','');
|
|
?>
|
|
</strong></td>
|
|
|
|
<td class="amount" style="text-align:right">
|
|
<strong>
|
|
<?php echo number_format($tot_value, 2, '.', ''); ?>
|
|
</strong>
|
|
</td>
|
|
|
|
<td class="amount" style="text-align:right">
|
|
<strong>
|
|
<?php echo $tot_ex; ?>
|
|
</strong>
|
|
</td>
|
|
|
|
<td class="amount" style="text-align:right">
|
|
<strong>
|
|
<?php echo number_format($tot_SCGT, 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_ICGT, 2, '.', ''); ?>
|
|
</strong>
|
|
</td>
|
|
|
|
<td class="amount" style="text-align:right">
|
|
<strong>
|
|
<?php echo number_format($tot_dis, 2, '.', ''); ?>
|
|
</strong>
|
|
</td>
|
|
|
|
<td class="amount" style="text-align:right">
|
|
<strong>
|
|
<?php echo number_format($tot_frg, 2, '.', ''); ?>
|
|
</strong>
|
|
</td>
|
|
|
|
<td class="amount" style="text-align:right">
|
|
<strong>
|
|
<?php echo number_format($tot_pac, 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> <!-- 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
|
|
var table = $('#cc').DataTable({
|
|
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
|
buttons: [
|
|
'excel' // Export buttons
|
|
],
|
|
pageLength: 10, // Default rows per page
|
|
lengthMenu: [
|
|
[10, 20, 30, 50, -1],
|
|
[10, 20, 30, 50, "All"]
|
|
], // Rows per page options
|
|
responsive: true, // Responsive table
|
|
ordering: false,
|
|
language: {
|
|
paginate: {
|
|
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
|
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
|
|
},
|
|
emptyTable: '<div style="text-align:center;">Data Not Found!</div>'
|
|
}
|
|
});
|
|
});
|
|
</script>
|