Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
fc22fed3ff
@ -1,485 +1,478 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$("#client_name").select2();
|
$("#client_name").select2();
|
||||||
$("#item_name").select2();
|
$("#item_name").select2();
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
|
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
|
||||||
<style>
|
<style>
|
||||||
.dataTables_filter input {padding: 4px;}
|
th{
|
||||||
.dataTables_filter {
|
width:auto !important;
|
||||||
width: 50%;
|
}
|
||||||
float: right;
|
.dataTables_filter input {
|
||||||
text-align: right;
|
padding: 4px;
|
||||||
}
|
}
|
||||||
.dataTables_paginate {
|
|
||||||
width: 50%;
|
|
||||||
float: right;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
div.dt-buttons {
|
|
||||||
position: relative;
|
|
||||||
float: right;
|
|
||||||
|
|
||||||
}
|
.dataTables_filter {
|
||||||
.btn-success {
|
width: 50%;
|
||||||
background-color: #00d976;;
|
float: right;
|
||||||
border-color: #00d976;;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</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><b>Report - Pending Purchase Order </b><br><br><?php echo $headline ?></p>
|
|
||||||
</h3>
|
|
||||||
</center>
|
|
||||||
</div>
|
|
||||||
<!-- /.box-header -->
|
|
||||||
<div class="panel-body">
|
|
||||||
|
|
||||||
<form method="post" action="<?php echo base_url("Report_pending_purchase"); ?>">
|
.dataTables_paginate {
|
||||||
|
width: 50%;
|
||||||
|
float: right;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
<div class="form-group has-feedback">
|
div.dt-buttons {
|
||||||
<div class="col-md-4">
|
position: relative;
|
||||||
<label for="client_name">
|
/* float: right; */
|
||||||
<?php echo 'Supplier'; ?>
|
|
||||||
</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<select class="form-control" id="client_name" name="client_name">
|
|
||||||
<option value="">Select Supplier</option>
|
|
||||||
<?php
|
|
||||||
foreach($cust as $item):
|
|
||||||
|
|
||||||
{?>
|
|
||||||
|
|
||||||
<option value="<?php echo $item->SupplierName;?>"><?php echo $item->SupplierName ; ?></option>
|
|
||||||
|
|
||||||
|
|
||||||
<?php } endforeach; ?>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</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 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 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">January</option>
|
|
||||||
<option value="February">February</option>
|
|
||||||
<option value="March">March</option>
|
|
||||||
<option value="April">April</option>
|
|
||||||
<option value="May">May</option>
|
|
||||||
<option value="June">June</option>
|
|
||||||
<option value="July">July</option>
|
|
||||||
<option value="August">August</option>
|
|
||||||
<option value="September">September</option>
|
|
||||||
<option value="October">October</option>
|
|
||||||
<option value="November">November</option>
|
|
||||||
<option value="December">December</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-4">
|
|
||||||
<label for="from_date">
|
|
||||||
<?php echo 'From Date'; ?>
|
|
||||||
</label>
|
|
||||||
<div class="input-group">
|
|
||||||
<input name="from_date" id="max-date" class="form-control datepicker">
|
|
||||||
<span class="input-group-addon">
|
|
||||||
<i class="fa fa-calendar fa-fw"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
}
|
||||||
<div class="col-md-4">
|
</style>
|
||||||
<label for="to_date">
|
|
||||||
<?php echo 'To Date'; ?>
|
<div class="content-page">
|
||||||
</label>
|
<div class="content">
|
||||||
<div class="input-group">
|
<!-- Start Content-->
|
||||||
<input name="to_date" id="min-date" class="form-control datepicker">
|
<div class="container-fluid">
|
||||||
<span class="input-group-addon">
|
<!-- start page title -->
|
||||||
<i class="fa fa-calendar fa-fw"></i>
|
<div>
|
||||||
</span>
|
<div class="row">
|
||||||
</div>
|
<div class="col-6">
|
||||||
|
<div class="page-title-box page-title-box-alt">
|
||||||
|
<h4 class="page-title"><b>Report - Pending Purchase Order </b><br><br><?php echo $headline ?></h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2 col-md-offset-2"><br>
|
</div>
|
||||||
<input type="submit" class="btn btn-success" name="btn_submit"
|
<div class="col-6 text-right">
|
||||||
value="View Report">
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
<div class="row">
|
||||||
</div>
|
<div class="col-12">
|
||||||
</form>
|
<div class="card">
|
||||||
|
<!-- <form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;"> -->
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
</div>
|
|
||||||
<div class="box-body">
|
<form method="post" action="<?php echo base_url("Report_pending_purchase"); ?>">
|
||||||
<div>
|
<div class="form-group">
|
||||||
<table id="cc" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;" >
|
<div class="row">
|
||||||
<thead style="background-color: #ddd;">
|
<div class="col-4">
|
||||||
<tr>
|
<label for="client_name">
|
||||||
<th style="text-align:center">PO Date</th>
|
<?php echo 'Supplier'; ?>
|
||||||
<th style="text-align:center">PO No</th>
|
</label>
|
||||||
<th style="text-align:center">Supplier Name</th>
|
<select class="form-control" id="client_name" name="client_name">
|
||||||
<th style="text-align:center">Material Name</th>
|
<option value="">Select Supplier</option>
|
||||||
<th style="text-align:center">Category</th>
|
<?php
|
||||||
<th style="text-align:center">Ordered Quantity</th>
|
foreach ($cust as $item): { ?>
|
||||||
<th style="text-align:center">Received Quantity</th>
|
<option value="<?php echo $item->SupplierName; ?>"><?php echo $item->SupplierName; ?></option>
|
||||||
<th style="text-align:center">Pending Quantity</th>
|
<?php }
|
||||||
</tr>
|
endforeach; ?>
|
||||||
|
</select>
|
||||||
</thead>
|
</div>
|
||||||
<tbody>
|
<div class="col-4">
|
||||||
<?php if(!empty($ppurchse)){
|
<label for="client_name">
|
||||||
|
<?php echo 'Material'; ?>
|
||||||
$mvt=0.00;
|
</label>
|
||||||
$yqt=0.00;
|
<select class="form-control" id="item_name" name="item_name">
|
||||||
$yvt=0.00;
|
<option value="">Select Material</option>
|
||||||
|
<?php
|
||||||
|
foreach ($material as $it): { ?>
|
||||||
|
<option value="<?php echo $it->MaterialName; ?>"><?php echo $it->MaterialName; ?></option>
|
||||||
|
<?php }
|
||||||
foreach($ppurchse as $rel)
|
endforeach; ?>
|
||||||
{
|
</select>
|
||||||
$cat = $rel->category;
|
</div>
|
||||||
?>
|
<div class="col-2">
|
||||||
<tr>
|
<label for="to_date">
|
||||||
<!-- <td><span>
|
<?php echo 'Year'; ?>
|
||||||
<a href="<?= base_url() ?>report/link_purchase?sid=<?php //echo $rel->sid;?>&ab=<?php //echo $ab;?>&mid=<?php //echo $rel->mid;?>"><?php //echo $rel->supplier_name;?></a>
|
</label>
|
||||||
</span></td>-->
|
<select class="form-control" id="financialyear" name="financialyear">
|
||||||
<td><span>
|
<option value="">Select Year</option>
|
||||||
<?php echo $rel->pdate;?>
|
<?php
|
||||||
</span></td>
|
foreach ($finyear as $item): { ?>
|
||||||
<td><span>
|
<option value="<?php echo $item->financial_year; ?>"><?php echo $item->financial_year; ?></option>
|
||||||
<?php echo $rel->po;?>
|
<?php }
|
||||||
</span></td>
|
endforeach; ?>
|
||||||
|
</select>
|
||||||
<td><span>
|
</div>
|
||||||
|
<div class="col-2">
|
||||||
<?php echo $rel->supplier;?>
|
<label for="to_date">
|
||||||
</span></td>
|
<?php echo 'Month'; ?>
|
||||||
<td><span>
|
</label>
|
||||||
<?php echo $rel->material;?>
|
<div class="input-group">
|
||||||
</span></td>
|
<select class="form-control" id="month" name="month">
|
||||||
<td><span>
|
<option value="">Select Month</option>
|
||||||
<?php echo $rel->category;?>
|
<option value="January">January</option>
|
||||||
</span></td>
|
<option value="February">February</option>
|
||||||
<td style="text-align:right"><span><?php
|
<option value="March">March</option>
|
||||||
$mvt= $mvt + round($rel->quantity);
|
<option value="April">April</option>
|
||||||
?>
|
<option value="May">May</option>
|
||||||
<?php echo round($rel->quantity);?>
|
<option value="June">June</option>
|
||||||
</span></td>
|
<option value="July">July</option>
|
||||||
<td style="text-align:right"><span><?php
|
<option value="August">August</option>
|
||||||
$yqt= $yqt + round($rel->received);
|
<option value="September">September</option>
|
||||||
?>
|
<option value="October">October</option>
|
||||||
<?php echo round($rel->received);?>
|
<option value="November">November</option>
|
||||||
</span></td>
|
<option value="December">December</option>
|
||||||
<td style="text-align:right"><span><?php
|
</select>
|
||||||
$yvt= $yvt + round($rel->pending);
|
</div>
|
||||||
?>
|
</div>
|
||||||
<?php echo round($rel->pending);?>
|
</div>
|
||||||
</span></td>
|
<div class="row">
|
||||||
|
<div class="col-4">
|
||||||
|
<label for="from_date">
|
||||||
|
<?php echo 'From Date'; ?>
|
||||||
</tr>
|
</label>
|
||||||
<?php
|
<div class="input-group">
|
||||||
}
|
<input type="date" name="from_date" id="max-date" class="form-control datepicker">
|
||||||
|
|
||||||
?>
|
</div>
|
||||||
</tbody>
|
</div>
|
||||||
<tfoot width="100%">
|
<div class="col-4">
|
||||||
<tr>
|
<label for="to_date">
|
||||||
<td style="text-align:center;"><strong>Total</strong></td>
|
<?php echo 'To Date'; ?>
|
||||||
|
</label>
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="date" name="to_date" id="min-date" class="form-control datepicker">
|
||||||
<td style="text-align:right">
|
</div>
|
||||||
<strong>
|
|
||||||
<?php
|
</div>
|
||||||
{
|
<div class="col-md-2"></div>
|
||||||
echo '';
|
<div class="col-md-2 text-right"><br>
|
||||||
|
<input type="submit" class="btn btn-success" name="btn_submit"
|
||||||
}
|
value="View Report">
|
||||||
?>
|
</div>
|
||||||
</strong>
|
|
||||||
</td>
|
</div>
|
||||||
<td style="text-align:right">
|
</div>
|
||||||
<strong>
|
<div class="form-group has-feedback">
|
||||||
<?php
|
|
||||||
{
|
</div>
|
||||||
echo '';
|
|
||||||
|
<!-- </form> -->
|
||||||
}
|
|
||||||
?>
|
<!-- <input type="hidden" name="table" value="requisition">
|
||||||
</strong>
|
<label for="fromDate">From:</label>
|
||||||
</td>
|
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
<td style="text-align:right">
|
|
||||||
<strong>
|
<label for="toDate">To:</label>
|
||||||
<?php
|
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
{
|
|
||||||
echo '';
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
}
|
<div class="error" id="error"></div> -->
|
||||||
?>
|
</form>
|
||||||
</strong>
|
<table id="cc" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||||
</td>
|
|
||||||
<td style="text-align:right">
|
<!-- <table class="table table-bordered table-hover" id="asset_list_table" style="background-color:#fff;font-size:12px;"> -->
|
||||||
<strong>
|
<thead style="background-color: #ddd;">
|
||||||
<?php
|
<tr>
|
||||||
{
|
<th style="text-align:center" >PO Date</th>
|
||||||
echo '';
|
<th style="text-align:center">PO No</th>
|
||||||
|
<th style="text-align:center">Supplier Name</th>
|
||||||
}
|
<th style="text-align:center">Material Name</th>
|
||||||
?>
|
<th style="text-align:center">Category</th>
|
||||||
</strong>
|
<th style="text-align:center">Ordered Quantity</th>
|
||||||
</td>
|
<th style="text-align:center">Received Quantity</th>
|
||||||
<td style="text-align:right">
|
<th style="text-align:center">Pending Quantity</th>
|
||||||
<strong>
|
</tr>
|
||||||
<?php
|
</thead>
|
||||||
{
|
<tbody>
|
||||||
echo $mvt;
|
<?php if (!empty($ppurchse)) {
|
||||||
|
|
||||||
}
|
$mvt = 0.00;
|
||||||
?>
|
$yqt = 0.00;
|
||||||
</strong>
|
$yvt = 0.00;
|
||||||
</td>
|
|
||||||
<td style="text-align:right">
|
|
||||||
<strong>
|
|
||||||
<?php
|
|
||||||
{
|
foreach ($ppurchse as $rel) {
|
||||||
echo $yqt;
|
$cat = $rel->category;
|
||||||
|
?>
|
||||||
}
|
<tr>
|
||||||
?>
|
<!-- <td><span>
|
||||||
</strong>
|
<a href="<?= base_url() ?>report/link_purchase?sid=<?php //echo $rel->sid;
|
||||||
</td>
|
?>&ab=<?php //echo $ab;
|
||||||
<td style="text-align:right">
|
?>&mid=<?php //echo $rel->mid;
|
||||||
<strong>
|
?>"><?php //echo $rel->supplier_name;
|
||||||
<?php
|
?></a>
|
||||||
{
|
</span></td>-->
|
||||||
echo $yvt;
|
<td><span>
|
||||||
|
<?php echo $rel->pdate; ?>
|
||||||
}
|
</span></td>
|
||||||
?>
|
<td><span>
|
||||||
</strong>
|
<?php echo $rel->po; ?>
|
||||||
</td>
|
</span></td>
|
||||||
|
|
||||||
|
<td><span>
|
||||||
</tr>
|
|
||||||
|
<?php echo $rel->supplier; ?>
|
||||||
</tfoot>
|
</span></td>
|
||||||
<?php
|
<td><span>
|
||||||
}
|
<?php echo $rel->material; ?>
|
||||||
|
</span></td>
|
||||||
?>
|
<td><span>
|
||||||
</table>
|
<?php echo $rel->category; ?>
|
||||||
|
</span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$mvt = $mvt + round($rel->quantity);
|
||||||
|
?>
|
||||||
|
<?php echo round($rel->quantity); ?>
|
||||||
|
</span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$yqt = $yqt + round($rel->received);
|
||||||
|
?>
|
||||||
|
<?php echo round($rel->received); ?>
|
||||||
|
</span></td>
|
||||||
|
<td style="text-align:right"><span><?php
|
||||||
|
$yvt = $yvt + round($rel->pending);
|
||||||
|
?>
|
||||||
|
<?php echo round($rel->pending); ?>
|
||||||
|
</span></td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
<tfoot width="100%">
|
||||||
|
<tr>
|
||||||
|
<td style="text-align:center;"><strong>Total</strong></td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<td style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php {
|
||||||
|
echo '';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</strong>
|
||||||
|
</td>
|
||||||
|
<td style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php {
|
||||||
|
echo '';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</strong>
|
||||||
|
</td>
|
||||||
|
<td style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php {
|
||||||
|
echo '';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</strong>
|
||||||
|
</td>
|
||||||
|
<td style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php {
|
||||||
|
echo '';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</strong>
|
||||||
|
</td>
|
||||||
|
<td style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php {
|
||||||
|
echo $mvt;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</strong>
|
||||||
|
</td>
|
||||||
|
<td style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php {
|
||||||
|
echo $yqt;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</strong>
|
||||||
|
</td>
|
||||||
|
<td style="text-align:right">
|
||||||
|
<strong>
|
||||||
|
<?php {
|
||||||
|
echo $yvt;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</strong>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</tfoot>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</table>
|
||||||
|
</div> <!-- end card body-->
|
||||||
|
</div> <!-- end card -->
|
||||||
|
</div><!-- end col-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box -->
|
</div> <!-- container -->
|
||||||
</div>
|
</div> <!-- content -->
|
||||||
<!-- /.col -->
|
</div>
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></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/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/pdfmake.min.js"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.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.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/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 src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||||
<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"]
|
||||||
|
// ],
|
||||||
|
// "pageLength": 10,
|
||||||
|
// "lengthMenu": [10, 25, 50, 100],
|
||||||
|
// "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: [
|
||||||
|
|
||||||
// Bootstrap datepicker
|
// // {
|
||||||
// Set up your table
|
// // extend: 'excelHtml5',
|
||||||
$(document).ready(function() {
|
// // footer: 'true',
|
||||||
$.fn.dataTable.moment( 'DD-MM-YYYY' );
|
// // //messageTop: $('h3').text(),
|
||||||
table = $('#cc').DataTable( {
|
// // title: $('h3').text(),
|
||||||
"language": {
|
// // exportOptions: {
|
||||||
"emptyTable": "<center> Data Not Found ! </center>"
|
// // columns: ':visible'
|
||||||
},
|
// // }
|
||||||
"aaSorting": [[ 0, "desc" ]],
|
// // },
|
||||||
"pageLength": 10,
|
|
||||||
"lengthMenu": [10, 25, 50, 100],
|
|
||||||
"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',
|
|
||||||
// //messageTop: $('h3').text(),
|
|
||||||
// title: $('h3').text(),
|
|
||||||
// exportOptions: {
|
|
||||||
// columns: ':visible'
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
|
|
||||||
'colvis'
|
|
||||||
],
|
|
||||||
"footerCallback": function ( row, data, start, end, display ) {
|
|
||||||
var api = this.api(), data;
|
|
||||||
|
|
||||||
// Remove the formatting to get integer data for summation
|
|
||||||
var intVal = function ( i ) {
|
|
||||||
return typeof i === 'string' ?
|
|
||||||
parseFloat(i.replace(/[^0-9]+/g,"")*1) :
|
|
||||||
typeof i === 'number' ?
|
|
||||||
parseFloat(i) : 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
TotalOrderedQTY = api
|
// 'colvis'
|
||||||
.column( 5, { search:'applied' } )
|
// ],
|
||||||
.data()
|
// "footerCallback": function(row, data, start, end, display) {
|
||||||
.reduce( function (a, b) {
|
// var api = this.api(),
|
||||||
return intVal(a) + intVal(b);
|
// data;
|
||||||
}, 0 );
|
|
||||||
|
|
||||||
$( api.column( 5 ).footer() ).html( TotalOrderedQTY.toFixed().bold() );
|
// // Remove the formatting to get integer data for summation
|
||||||
|
// var intVal = function(i) {
|
||||||
TotalRcvdQTY = api
|
// return typeof i === 'string' ?
|
||||||
.column( 6, { search:'applied' } )
|
// parseFloat(i.replace(/[^0-9]+/g, "") * 1) :
|
||||||
.data()
|
// typeof i === 'number' ?
|
||||||
.reduce( function (a, b) {
|
// parseFloat(i) : 0;
|
||||||
return intVal(a) + intVal(b);
|
// };
|
||||||
}, 0 );
|
|
||||||
|
|
||||||
$( api.column( 6 ).footer() ).html( TotalRcvdQTY.toFixed().bold() );
|
|
||||||
|
|
||||||
TotalPendingQTY = api
|
// TotalOrderedQTY = api
|
||||||
.column( 7, { search:'applied' } )
|
// .column(5, {
|
||||||
.data()
|
// search: 'applied'
|
||||||
.reduce( function (a, b) {
|
// })
|
||||||
return intVal(a) + intVal(b);
|
// .data()
|
||||||
}, 0 );
|
// .reduce(function(a, b) {
|
||||||
|
// return intVal(a) + intVal(b);
|
||||||
$( api.column( 7 ).footer() ).html( TotalPendingQTY.toFixed().bold() );
|
// }, 0);
|
||||||
}
|
|
||||||
} );
|
// $(api.column(5).footer()).html(TotalOrderedQTY.toFixed().bold());
|
||||||
} );
|
|
||||||
$('#mySelect').on('change',function(){
|
// TotalRcvdQTY = api
|
||||||
|
// .column(6, {
|
||||||
table
|
// search: 'applied'
|
||||||
.column(4)
|
// })
|
||||||
.search(this.value)
|
// .data()
|
||||||
.draw();
|
// .reduce(function(a, b) {
|
||||||
});
|
// return intVal(a) + intVal(b);
|
||||||
|
// }, 0);
|
||||||
$( function() {
|
|
||||||
|
// $(api.column(6).footer()).html(TotalRcvdQTY.toFixed().bold());
|
||||||
|
|
||||||
|
// TotalPendingQTY = api
|
||||||
|
// .column(7, {
|
||||||
|
// search: 'applied'
|
||||||
|
// })
|
||||||
|
// .data()
|
||||||
|
// .reduce(function(a, b) {
|
||||||
|
// return intVal(a) + intVal(b);
|
||||||
|
// }, 0);
|
||||||
|
|
||||||
|
// $(api.column(7).footer()).html(TotalPendingQTY.toFixed().bold());
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
// Initialize the DataTable
|
||||||
|
var table = $('#cc').DataTable({
|
||||||
|
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
||||||
|
buttons: [
|
||||||
|
'copy', 'csv', 'excel', 'pdf', 'print' // 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
|
||||||
|
order: [[0, 'desc']], // Default ordering (column index 0, descending)
|
||||||
|
language: {
|
||||||
|
paginate: {
|
||||||
|
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||||
|
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$('#mySelect').on('change', function() {
|
||||||
|
|
||||||
|
table
|
||||||
|
.column(4)
|
||||||
|
.search(this.value)
|
||||||
|
.draw();
|
||||||
|
});
|
||||||
|
|
||||||
|
$(function() {
|
||||||
//var dateFormat = "mm/dd/yy",
|
//var dateFormat = "mm/dd/yy",
|
||||||
from = $( "#min-date" )
|
from = $("#min-date")
|
||||||
.datepicker({
|
.datepicker({
|
||||||
dateFormat: "dd-mm-yy",
|
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",
|
defaultDate: "+0d",
|
||||||
changeMonth: true,
|
changeMonth: true,
|
||||||
//numberOfMonths: 1
|
//numberOfMonths: 1
|
||||||
|
|
||||||
})
|
})
|
||||||
.on( "change", function() {
|
.on("change", function() {
|
||||||
from.datepicker( "option", "maxDate", getDate( this ) );
|
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 ) {
|
function getDate(element) {
|
||||||
var date;
|
var date;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
date = $.datepicker.parseDate( dateFormat, element.value );
|
date = $.datepicker.parseDate(dateFormat, element.value);
|
||||||
|
|
||||||
} catch( error ) {
|
} catch (error) {
|
||||||
date = null;
|
date = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
} );
|
});
|
||||||
|
</script>
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,14 +1,16 @@
|
|||||||
<?php $defaultDate = ''; ?>
|
<?php $defaultDate = ''; ?>
|
||||||
<style>
|
<style>
|
||||||
.modal-dialog-centered {
|
.modal-dialog-centered {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
.modal-content-custom-width {
|
|
||||||
width: 75%; /* Adjust the width as needed */
|
.modal-content-custom-width {
|
||||||
}
|
width: 75%;
|
||||||
|
/* Adjust the width as needed */
|
||||||
|
}
|
||||||
|
|
||||||
.dataTables_paginate {
|
.dataTables_paginate {
|
||||||
margin-top: -5%;
|
margin-top: -5%;
|
||||||
@ -38,251 +40,301 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style>
|
<style>
|
||||||
#Requisition_filter {
|
#Requisition_filter {
|
||||||
float: inline-end;
|
float: inline-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
#Requisition_wrapper .row .col-sm-4 {
|
#Requisition_wrapper .row .col-sm-4 {
|
||||||
flex-basis: 50%;
|
flex-basis: 50%;
|
||||||
float: inline-end;
|
float: inline-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
#Requisition_paginate .pagination {
|
#Requisition_paginate .pagination {
|
||||||
flex-basis: 50%;
|
flex-basis: 50%;
|
||||||
float: inline-end;
|
float: inline-end;
|
||||||
margin: 0 0 15px;
|
margin: 0 0 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#Requisition_wrapper .row:nth-child(3),
|
#Requisition_wrapper .row:nth-child(3),
|
||||||
#Requisition_wrapper .row:nth-child(1) {
|
#Requisition_wrapper .row:nth-child(1) {
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#Requisition_info {
|
#Requisition_info {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dataTables_wrapper {
|
.dataTables_wrapper {
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
span.highlight {
|
span.highlight {
|
||||||
background-color: yellow;
|
background-color: yellow;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.Date-filter-form {
|
.Date-filter-form {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px; /* Adjust the gap as needed */
|
gap: 10px;
|
||||||
}
|
/* Adjust the gap as needed */
|
||||||
.Date-filter-form input, .Date-filter-form button {
|
}
|
||||||
padding: 5px;
|
|
||||||
font-size: 14px;
|
.Date-filter-form input,
|
||||||
}
|
.Date-filter-form button {
|
||||||
.Date-filter-form button {
|
padding: 5px;
|
||||||
background-color: #007bff;
|
font-size: 14px;
|
||||||
color: white;
|
}
|
||||||
border: none;
|
|
||||||
cursor: pointer;
|
.Date-filter-form button {
|
||||||
}
|
background-color: #007bff;
|
||||||
.Date-filter-form button:hover {
|
color: white;
|
||||||
background-color: #0056b3;
|
border: none;
|
||||||
}
|
cursor: pointer;
|
||||||
.icon-button {
|
}
|
||||||
background: none;
|
|
||||||
border: none;
|
.Date-filter-form button:hover {
|
||||||
cursor: pointer;
|
background-color: #0056b3;
|
||||||
color: #007bff;
|
}
|
||||||
font-size: 18px;
|
|
||||||
}
|
.icon-button {
|
||||||
.icon-button:hover {
|
background: none;
|
||||||
color: #0056b3;
|
border: none;
|
||||||
}
|
cursor: pointer;
|
||||||
</style>
|
color: #007bff;
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-button:hover {
|
||||||
|
color: #0056b3;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<div class="content-page">
|
<div class="content-page">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<?php $attributes = array('class' => 'form-label-left CreatePO ', 'name' => 'CreatePO', 'id' => 'CreatePO', 'method' => 'post', 'role' => 'form');
|
<?php $attributes = array('class' => 'form-label-left CreatePO ', 'name' => 'CreatePO', 'id' => 'CreatePO', 'method' => 'post', 'role' => 'form');
|
||||||
echo form_open(base_url() . 'purchaseOrder', $attributes); ?>
|
echo form_open(base_url() . 'purchaseOrder', $attributes); ?>
|
||||||
<!-- Start Content-->
|
|
||||||
<div class="container-fluid">
|
<!-- Start Content-->
|
||||||
<!-- start page title -->
|
<div class="container-fluid">
|
||||||
|
<div class="modal fade" id="RequisitionDtlsModal" role="dialog">
|
||||||
|
<div class="modal-dialog modal-lg">
|
||||||
|
<!-- Modal content-->
|
||||||
|
<form>
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<center>
|
||||||
|
<h4> Requisition Details - <label id="SelReqNo" name="SelReqNo"></label> </h4>
|
||||||
|
</center>
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label>Request Type</label>
|
||||||
|
<div class="form-group">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'ReqType', 'value' => set_value('ReqType'), 'id' => 'ReqType', 'class' => 'form-control', 'readonly' => 'true');
|
||||||
|
echo form_input($data);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label>Requested By</label>
|
||||||
|
<div class="form-group">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'ReqBy', 'value' => set_value('ReqBy'), 'id' => 'ReqBy', 'class' => 'form-control', 'readonly' => 'true');
|
||||||
|
echo form_input($data);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label>Designation</label>
|
||||||
|
<div class="form-group">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'Desigination', 'value' => set_value('Desigination'), 'id' => 'Desigination', 'class' => 'form-control', 'readonly' => 'true');
|
||||||
|
echo form_input($data);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label>Requested Date</label>
|
||||||
|
<div class="form-group">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'RequistionDate', 'value' => set_value('RequistionDate'), 'id' => 'RequistionDate', 'class' => 'form-control', 'readonly' => 'true');
|
||||||
|
echo form_input($data);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label>Cost Center Code</label>
|
||||||
|
<div class="form-group">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'CostCenter', 'value' => set_value('CostCenter'), 'id' => 'CostCenter', 'class' => 'form-control', 'readonly' => 'true');
|
||||||
|
echo form_input($data); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label>Avl Budget Amt</label> <img id="AlertImg" src="<?php echo base_url(); ?>public/assets/dist/img/red.png" alt="your image" width="25px" style="display:none" />
|
||||||
|
<div class="form-group">
|
||||||
|
<?php
|
||||||
|
$data = array('name' => 'AvlBudgetAmount', 'value' => set_value('AvlBudgetAmount'), 'id' => 'AvlBudgetAmount', 'class' => 'form-control', 'readonly' => 'true');
|
||||||
|
echo form_input($data);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<table class="table table-bordered editableTable" style="border:1px solid #fff">
|
||||||
|
<thead style="background-color: #ddd !important;">
|
||||||
|
<tr>
|
||||||
|
<th style="white-space: nowrap;">SNo</th>
|
||||||
|
<th style="white-space: nowrap;">Item Code</th>
|
||||||
|
<th style="white-space: nowrap;">Item Description</th>
|
||||||
|
<th style="white-space: nowrap;">UOM</th>
|
||||||
|
<th style="white-space: nowrap;">Requested Quantity</th>
|
||||||
|
<th style="white-space: nowrap;">Ordered Quantity</th>
|
||||||
|
<th style="white-space: nowrap;">Status</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="tbleAppend"></tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<a class="btn btn-info" data-dismiss="modal" value="Cancel">Ok</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="ImportPOCheck" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<!-- Modal content-->
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<center>
|
||||||
|
<h4>Do you want to create an Import PO for this Requisition?</h4>
|
||||||
|
</center>
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="row text-center">
|
||||||
|
<div class="col-md-3">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input class="form-check-input" type="radio" name="optImport" id="optImportYes" value="0">
|
||||||
|
<label class="form-check-label" for="optImportYes">YES</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input class="form-check-input" type="radio" name="optImport" id="optImportNo" value="1" checked>
|
||||||
|
<label class="form-check-label" for="optImportNo">NO</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<div class="col-md-12 text-center">
|
||||||
|
<a class="btn btn-dark waves-effect waves-light" data-dismiss="modal" style="background-color: gray;border-color: gray;margin-right: 10px;">Cancel</a>
|
||||||
|
<input type="button" class="btn btn-success" onclick="SetImportPO();" value="OK" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- start page title -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="page-title-box page-title-box-alt">
|
<div class="page-title-box page-title-box-alt">
|
||||||
<h4 class="page-title">Create Purchase Order from Requistion</h4>
|
<h4 class="page-title">Create Purchase Order from Requistion</h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<?php
|
<?php
|
||||||
helper('form');
|
helper('form');
|
||||||
$error = session()->getFlashdata('error');
|
$error = session()->getFlashdata('error');
|
||||||
if ($error) {
|
if ($error) {
|
||||||
?>
|
?>
|
||||||
<div class="alert alert-danger alert-dismissable">
|
<div class="alert alert-danger alert-dismissable">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
<?php echo session()->getFlashdata('error'); ?>
|
<?php echo session()->getFlashdata('error'); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php
|
<?php
|
||||||
$success = session()->getFlashdata('success');
|
$success = session()->getFlashdata('success');
|
||||||
if ($success) {
|
if ($success) {
|
||||||
?>
|
?>
|
||||||
<div class="alert alert-success alert-dismissable">
|
<div class="alert alert-success alert-dismissable">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
<?php echo session()->getFlashdata('success'); ?>
|
<?php echo session()->getFlashdata('success'); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<?php // \Config\Services::validation()->listErrors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>');
|
<?php // \Config\Services::validation()->listErrors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>');
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
$listErrors = session()->getFlashdata('listErrors');
|
$listErrors = session()->getFlashdata('listErrors');
|
||||||
if ($listErrors) { ?>
|
if ($listErrors) { ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="alert alert-danger alert-dismissable">
|
<div class="alert alert-danger alert-dismissable">
|
||||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
<?php echo session()->getFlashdata('listErrors'); ?>
|
<?php echo session()->getFlashdata('listErrors'); ?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<div class="col-md-12" style="margin-top: -79px;">
|
<div class="col-md-12" style="margin-top: -79px;">
|
||||||
<!-- <div class="col-md-3 col-md-offset-9"> -->
|
<!-- <div class="col-md-3 col-md-offset-9"> -->
|
||||||
<p>
|
<p>
|
||||||
<div align="right" style="padding-right:0px">
|
<div align="right" style="padding-right:0px">
|
||||||
<!--<a href="<?php echo base_url(); ?>purchaseorderform/purchaseorder"> -->
|
<!--<a href="<?php echo base_url(); ?>purchaseorderform/purchaseorder"> -->
|
||||||
<!--<button type="button" class="btn btn-success">Create PO</button></a> -->
|
<!--<button type="button" class="btn btn-success">Create PO</button></a> -->
|
||||||
<!--<input type="submit" class="btn btn-success" onclick="return Validate();" value="Create Purchase Order"> -->
|
<!--<input type="submit" class="btn btn-success" onclick="return Validate();" value="Create Purchase Order"> -->
|
||||||
<a class="btn btn-success" onclick="Validate();">Create Purchase Order</a>
|
<a class="btn btn-success" onclick="Validate();">Create Purchase Order</a>
|
||||||
<input type="hidden" name="txtReqNo" id="txtReqNo" />
|
<input type="hidden" name="txtReqNo" id="txtReqNo" />
|
||||||
<input type="hidden" name="txtReqType" id="txtReqType" />
|
<input type="hidden" name="txtReqType" id="txtReqType" />
|
||||||
</div>
|
</div>
|
||||||
</p>
|
</p>
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<span class="Date-filter-form" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
|
||||||
<input type="hidden" name="table" value="requisition">
|
|
||||||
<label for="fromDate">From:</label>
|
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<div class="card">
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<span class="Date-filter-form" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
|
<input type="hidden" name="table" value="requisition">
|
||||||
|
<label for="fromDate">From:</label>
|
||||||
|
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
|
<label for="toDate">To:</label>
|
||||||
|
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
|
<button type="button" class="range_search_button" id="DateRangeFilter"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
|
<div class="error" id="error"></div>
|
||||||
|
</span>
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
<button type="button" class="range_search_button" id="DateRangeFilter"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
|
||||||
<div class="error" id="error"></div>
|
|
||||||
</span>
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="modal fade" id="RequisitionDtlsModal" role="dialog">
|
|
||||||
<div class="modal-dialog" style="vertical-align: middle;width: fit-content">
|
|
||||||
<!-- Modal content-->
|
|
||||||
<form>
|
|
||||||
<div class="modal-content" style="width:800px">
|
|
||||||
<div class="modal-header">
|
|
||||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
||||||
<center>
|
|
||||||
<h4> Requisition Details - <label id="SelReqNo" name="SelReqNo"></label> </h4>
|
|
||||||
</center>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-4">
|
|
||||||
<label>Request Type</label>
|
|
||||||
<div class="form-group">
|
|
||||||
<?php
|
|
||||||
$data = array('name' => 'ReqType', 'value' => set_value('ReqType'), 'id' => 'ReqType', 'class' => 'form-control', 'readonly' => 'true');
|
|
||||||
echo form_input($data);
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-4">
|
|
||||||
<label>Requested By</label>
|
|
||||||
<div class="form-group">
|
|
||||||
<?php
|
|
||||||
$data = array('name' => 'ReqBy', 'value' => set_value('ReqBy'), 'id' => 'ReqBy', 'class' => 'form-control', 'readonly' => 'true');
|
|
||||||
echo form_input($data);
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-4">
|
|
||||||
<label>Designation</label>
|
|
||||||
<div class="form-group">
|
|
||||||
<?php
|
|
||||||
$data = array('name' => 'Desigination', 'value' => set_value('Desigination'), 'id' => 'Desigination', 'class' => 'form-control', 'readonly' => 'true');
|
|
||||||
echo form_input($data);
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-4">
|
|
||||||
<label>Requested Date</label>
|
|
||||||
<div class="form-group">
|
|
||||||
<?php
|
|
||||||
$data = array('name' => 'RequistionDate', 'value' => set_value('RequistionDate'), 'id' => 'RequistionDate', 'class' => 'form-control', 'readonly' => 'true');
|
|
||||||
echo form_input($data);
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-4">
|
|
||||||
<label>Cost Center Code</label>
|
|
||||||
<div class="form-group">
|
|
||||||
<?php
|
|
||||||
$data = array('name' => 'CostCenter', 'value' => set_value('CostCenter'), 'id' => 'CostCenter', 'class' => 'form-control', 'readonly' => 'true');
|
|
||||||
echo form_input($data); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-4">
|
|
||||||
<label>Avl Budget Amt</label> <img id="AlertImg" src="<?php echo base_url(); ?>public/assets/dist/img/red.png" alt="your image" width="25px" style="display:none" />
|
|
||||||
<div class="form-group">
|
|
||||||
<?php
|
|
||||||
$data = array('name' => 'AvlBudgetAmount', 'value' => set_value('AvlBudgetAmount'), 'id' => 'AvlBudgetAmount', 'class' => 'form-control', 'readonly' => 'true');
|
|
||||||
echo form_input($data);
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<table class="table table-bordered editableTable" style="border:1px solid #fff">
|
|
||||||
<thead style="background-color: #ddd !important;">
|
|
||||||
<tr>
|
|
||||||
<th style="white-space: nowrap;">SNo</th>
|
|
||||||
<th style="white-space: nowrap;">Item Code</th>
|
|
||||||
<th style="white-space: nowrap;">Item Description</th>
|
|
||||||
<th style="white-space: nowrap;">UOM</th>
|
|
||||||
<th style="white-space: nowrap;">Requested Quantity</th>
|
|
||||||
<th style="white-space: nowrap;">Ordered Quantity</th>
|
|
||||||
<th style="white-space: nowrap;">Status</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody id="tbleAppend"></tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<a class="btn btn-info" data-dismiss="modal" value="Cancel">Ok</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<table id="create_po_from_requistion" class="table dt-responsive nowrap w-100">
|
<table id="create_po_from_requistion" class="table dt-responsive nowrap w-100">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -291,9 +343,9 @@ span.highlight {
|
|||||||
<th>Requistion Number</th>
|
<th>Requistion Number</th>
|
||||||
<th>Requistion Type </th>
|
<th>Requistion Type </th>
|
||||||
<th>Requested By</th>
|
<th>Requested By</th>
|
||||||
<th>Tot. No. Of Line Items</th>
|
<th>Tot Line Items</th>
|
||||||
<th>Po Created Line Items</th>
|
<th>Po Line Items</th>
|
||||||
<th>Partial PO Created Line Items</th>
|
<th>Partial PO Line Items</th>
|
||||||
<th>New Line Items</th>
|
<th>New Line Items</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Department</th>
|
<th>Department</th>
|
||||||
@ -305,85 +357,179 @@ span.highlight {
|
|||||||
$index = 1;
|
$index = 1;
|
||||||
foreach ($ReqList as $record) {
|
foreach ($ReqList as $record) {
|
||||||
?>
|
?>
|
||||||
<tr id="<?php echo $index; ?>">
|
<tr id="<?php echo $index; ?>">
|
||||||
<td><input type="checkbox" name="chk<?php echo $index; ?>" id="chk<?php echo $index; ?>" onclick="selectReqNo(<?php echo $index; ?>)" /> </td>
|
<td><input type="checkbox" name="chk<?php echo $index; ?>" id="chk<?php echo $index; ?>" onclick="selectReqNo(<?php echo $index; ?>)" /> </td>
|
||||||
<td align="right">
|
<td align="right">
|
||||||
<?php
|
<?php
|
||||||
$dt = new DateTime($record->ReqDate);
|
$dt = new DateTime($record->ReqDate);
|
||||||
$RequestedDate = $dt->format('d-m-Y');
|
$RequestedDate = $dt->format('d-m-Y');
|
||||||
echo $RequestedDate;
|
echo $RequestedDate;
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
<td><a data-toggle="modal" data-target="#RequisitionDtlsModal" data-id="<%=index%>" data-userid="<?php echo $record->ReqNo ?>"><u><?php echo $record->ReqNo; ?> </u></a></td>
|
<td><a data-toggle="modal" data-target="#RequisitionDtlsModal" data-id="<%=index%>" data-userid="<?php echo $record->ReqNo ?>"><u><?php echo $record->ReqNo; ?> </u></a></td>
|
||||||
<td><?php echo $record->ReqType; ?></td>
|
<td><?php echo $record->ReqType; ?></td>
|
||||||
<td><?php echo $record->FirstName; ?></td>
|
<td><?php echo $record->FirstName; ?></td>
|
||||||
<td align="right"><?php echo $record->TotalNoofLineItems; ?></td>
|
<td align="right"><?php echo $record->TotalNoofLineItems; ?></td>
|
||||||
<td align="right"><?php echo $record->PolineItems; ?></td>
|
<td align="right"><?php echo $record->PolineItems; ?></td>
|
||||||
<td align="right"><?php echo $record->PartilallyLineItems; ?></td>
|
<td align="right"><?php echo $record->PartilallyLineItems; ?></td>
|
||||||
<td align="right"><?php echo $record->newLineItem; ?></td>
|
<td align="right"><?php echo $record->newLineItem; ?></td>
|
||||||
<td><?php echo $record->StatusName; ?></td>
|
<td><?php echo $record->StatusName; ?></td>
|
||||||
<td><?php echo $record->DepartmentName; ?></td>
|
<td><?php echo $record->DepartmentName; ?></td>
|
||||||
<td><?php echo $record->Designation; ?></td>
|
<td><?php echo $record->Designation; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php $index = $index + 1;
|
<?php $index = $index + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="modal fade" id="ImportPOCheck" role="dialog">
|
|
||||||
<div class="modal-dialog modal-dialog-centered">
|
|
||||||
<!-- Modal content-->
|
|
||||||
<div class="modal-content modal-content-custom-width">
|
|
||||||
<div class="modal-header">
|
|
||||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
||||||
<h4 class="modal-title">Do You want to create Import PO for this Requistion?</h4>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<form>
|
|
||||||
<div class="radio">
|
|
||||||
<label><input type="radio" name="optImport" value="0" id="optImport">YES</label>
|
|
||||||
</div>
|
|
||||||
<div class="radio">
|
|
||||||
<label><input type="radio" name="optImport" value="1" id="optImport" checked="checked">NO</label>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<!--<a class="btn btn-success" ID="Import" onclick="SetImportPO();" style="margin-top: -24px;">-->
|
|
||||||
<a class="btn btn-cancel" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
||||||
<input type="submit" class="btn btn-success" onclick="SetImportPO();" value="OK" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div> <!-- end card body-->
|
</div> <!-- end card body-->
|
||||||
</div> <!-- end card -->
|
</div> <!-- end card -->
|
||||||
</div><!-- end col-->
|
</div><!-- end col-->
|
||||||
</div>
|
</div>
|
||||||
</div> <!-- container -->
|
</div> <!-- container -->
|
||||||
</div> <!-- content -->
|
</div> <!-- content -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$("#RequisitionDtlsModal").on("shown.bs.modal", function(e) {
|
||||||
|
var ReqId = $(e.relatedTarget).data('userid');
|
||||||
|
$('#SelReqNo').html(ReqId);
|
||||||
|
// $('#content').loader('show');
|
||||||
|
$.ajax({
|
||||||
|
data: {
|
||||||
|
id: ReqId
|
||||||
|
},
|
||||||
|
type: "POST",
|
||||||
|
dataType: 'json',
|
||||||
|
url: "<?php echo base_url() ?>requisitionform/ViewRequest",
|
||||||
|
success: function(json) {
|
||||||
|
// $('#content').loader('hide');
|
||||||
|
var getAvalAmt = json.AvilBudAmount;
|
||||||
|
getAvalAmt = getAvalAmt.replace(/\,/g, '');
|
||||||
|
$("#ReqType").val(json.Requist[0]['ReqType']);
|
||||||
|
$("#ReqBy").val(json.Requist[0]['FirstName']);
|
||||||
|
$("#RequistionDate").val(json.Requist[0]['ReqDate']);
|
||||||
|
$("#Desigination").val(json.Requist[0]['Designation']);
|
||||||
|
$("#CostCenter").val(json.Requist[0]['CostCenterCode']);
|
||||||
|
$("#AvlBudgetAmount").val(parseFloat(getAvalAmt).toFixed(2));
|
||||||
|
$("#tbleAppend").empty();
|
||||||
|
$("#tbleAppend").append(json.Items);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
var table = $('#create_po_from_requistion').DataTable({
|
||||||
|
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
||||||
|
buttons: [
|
||||||
|
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
|
||||||
|
],
|
||||||
|
pageLength: 10, // Default rows per page
|
||||||
|
lengthMenu: [
|
||||||
|
[10, 20, 30, 50, -1],
|
||||||
|
[10, 20, 30, 50, "All"]
|
||||||
|
], // Rows per page options
|
||||||
|
responsive: false, // Responsive table
|
||||||
|
order: [
|
||||||
|
// [0, 'desc']
|
||||||
|
], // Default ordering (column index 0, descending)
|
||||||
|
scrollX: true,
|
||||||
|
language: {
|
||||||
|
paginate: {
|
||||||
|
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||||
|
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('#create_po_from_requistion_wrapper .dataTables_scrollBody').on('mousewheel', function(e) {
|
||||||
|
if (e.originalEvent.deltaY !== 0) {
|
||||||
|
this.scrollLeft += e.originalEvent.deltaY; // Use the vertical scroll to scroll horizontally
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Date range filter function
|
||||||
|
$.fn.dataTable.ext.search.push(
|
||||||
|
function(settings, data, dataIndex) {
|
||||||
|
var fromDate = $('#fromDate').val();
|
||||||
|
var toDate = $('#toDate').val();
|
||||||
|
|
||||||
|
if (!fromDate || !toDate) {
|
||||||
|
return true; // If no dates selected, don't filter
|
||||||
|
}
|
||||||
|
|
||||||
|
var dateStr = data[1]; // Assuming the date is in the first column
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
||||||
|
|
||||||
|
var startDate = new Date(fromDate);
|
||||||
|
var endDate = new Date(toDate);
|
||||||
|
|
||||||
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
|
|
||||||
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
|
// Return true if the date is within the range
|
||||||
|
return date >= startDate && date <= endDate;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// Handle form submission for the date range filter
|
||||||
|
$("#DateRangeFilter").click(function(e) {
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
|
table.draw(); // Redraw the table to apply the filter
|
||||||
|
});
|
||||||
|
|
||||||
|
// Reset button functionality
|
||||||
|
$("#resetButton").click(function() {
|
||||||
|
$("#fromDate").val('');
|
||||||
|
$("#toDate").val('');
|
||||||
|
table.draw(); // Redraw the table to clear the filter
|
||||||
|
});
|
||||||
|
|
||||||
|
// Automatically focus and open the To Date picker when From Date is selected
|
||||||
|
document.getElementById('fromDate').addEventListener('change', function() {
|
||||||
|
var fromDate = this.value;
|
||||||
|
var toDateInput = document.getElementById('toDate');
|
||||||
|
|
||||||
|
// Set the min attribute of the To Date input to the selected From Date
|
||||||
|
toDateInput.min = fromDate;
|
||||||
|
|
||||||
|
// Optionally reset the To Date input if the current value is before the new min date
|
||||||
|
if (toDateInput.value < fromDate) {
|
||||||
|
toDateInput.value = fromDate;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
var POType = '';
|
var POType = '';
|
||||||
|
|
||||||
function SetImportPO() {
|
function SetImportPO() {
|
||||||
POType = $("input:radio[name='optImport']:checked").val();
|
POType = $("input:radio[name='optImport']:checked").val();
|
||||||
$('#ImportPOCheck').modal('hide');
|
$('#ImportPOCheck').modal('hide');
|
||||||
$('#txtReqType').val(POType == 0 ? 'IMPORT' : '');
|
$('#txtReqType').val(POType == 0 ? 'IMPORT' : '');
|
||||||
|
$('#CreatePO').submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#ReqDate').val('');
|
$('#ReqDate').val('');
|
||||||
var Fromdt = '';
|
var Fromdt = '';
|
||||||
var Todt = '';
|
var Todt = '';
|
||||||
var baseurl = "<?php print base_url(); ?>";
|
var baseurl = "<?php print base_url(); ?>";
|
||||||
|
|
||||||
//Date range picker
|
//Date range picker
|
||||||
$('#ReqDate').daterangepicker({
|
// $('#ReqDate').daterangepicker({
|
||||||
locale: {
|
// locale: {
|
||||||
format: 'YYYY/MM/DD'
|
// format: 'YYYY/MM/DD'
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
var coll = [];
|
var coll = [];
|
||||||
var RequistionList = {
|
var RequistionList = {
|
||||||
@ -395,9 +541,6 @@ span.highlight {
|
|||||||
|
|
||||||
|
|
||||||
function selectReqNo(rowId) {
|
function selectReqNo(rowId) {
|
||||||
|
|
||||||
console.log("entered");
|
|
||||||
|
|
||||||
ckb = $('#chk' + rowId).is(':checked');
|
ckb = $('#chk' + rowId).is(':checked');
|
||||||
var tr = document.getElementById(rowId);
|
var tr = document.getElementById(rowId);
|
||||||
var cellval = tr.cells;
|
var cellval = tr.cells;
|
||||||
@ -413,75 +556,38 @@ span.highlight {
|
|||||||
} else {
|
} else {
|
||||||
var tr = document.getElementById(rowId);
|
var tr = document.getElementById(rowId);
|
||||||
var cellval = tr.cells;
|
var cellval = tr.cells;
|
||||||
|
|
||||||
|
|
||||||
//alert(RequistionList.Req.length);
|
|
||||||
if (RequistionList.Req.length > 0) {
|
|
||||||
console.log("111111111");
|
|
||||||
|
|
||||||
if (Type == cellval[3].innerText) {
|
|
||||||
|
|
||||||
|
//alert(RequistionList.Req.length);
|
||||||
|
console.log(RequistionList);
|
||||||
|
|
||||||
|
if (RequistionList.Req.length > 0) {
|
||||||
|
if (Type == cellval[3].innerText) {
|
||||||
RequistionList.Req.push({
|
RequistionList.Req.push({
|
||||||
"ReqNo": cellval[2].innerText,
|
"ReqNo": cellval[2].innerText,
|
||||||
"ReqType": cellval[3].innerText,
|
"ReqType": cellval[3].innerText,
|
||||||
"ReqBy": cellval[4].innerText,
|
"ReqBy": cellval[4].innerText,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log("333333333");
|
alert('Same type of Requistion only can be together.');
|
||||||
|
$('#chk' + rowId).prop('checked', false); // Properly uncheck the checkbox
|
||||||
alert('Same type of Requistion only can be together.')
|
|
||||||
$('#chk' + rowId).attr('checked', false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
RequistionList.Req.push({
|
RequistionList.Req.push({
|
||||||
"ReqNo": cellval[2].innerText,
|
"ReqNo": cellval[2].innerText,
|
||||||
"ReqType": cellval[3].innerText,
|
"ReqType": cellval[3].innerText,
|
||||||
"ReqBy": cellval[4].innerText,
|
"ReqBy": cellval[4].innerText,
|
||||||
});
|
});
|
||||||
Type = cellval[3].innerText;
|
Type = cellval[3].innerText;
|
||||||
|
|
||||||
}
|
}
|
||||||
i = i + 1;
|
i = i + 1;
|
||||||
}
|
}
|
||||||
|
// console.log(JSON.stringify(RequistionList));
|
||||||
console.log(JSON.stringify(RequistionList));
|
|
||||||
|
|
||||||
$('#txtReqNo').val(JSON.stringify(RequistionList));
|
$('#txtReqNo').val(JSON.stringify(RequistionList));
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#RequisitionDtlsModal").on("shown.bs.modal", function(e) {
|
|
||||||
var ReqId = $(e.relatedTarget).data('userid');
|
|
||||||
$('#SelReqNo').html(ReqId);
|
|
||||||
$('#content').loader('show');
|
|
||||||
$.ajax({
|
|
||||||
data: { id: ReqId },
|
|
||||||
type: "POST",
|
|
||||||
dataType: 'json',
|
|
||||||
url: "<?php echo base_url() ?>requisitionform/ViewRequest",
|
|
||||||
success: function(json) {
|
|
||||||
$('#content').loader('hide');
|
|
||||||
var getAvalAmt = json.AvilBudAmount;
|
|
||||||
getAvalAmt = getAvalAmt.replace(/\,/g, '');
|
|
||||||
$("#ReqType").val(json.Requist[0]['ReqType']);
|
|
||||||
$("#ReqBy").val(json.Requist[0]['FirstName']);
|
|
||||||
$("#RequistionDate").val(json.Requist[0]['ReqDate']);
|
|
||||||
$("#Desigination").val(json.Requist[0]['Designation']);
|
|
||||||
$("#CostCenter").val(json.Requist[0]['CostCenterCode']);
|
|
||||||
$("#AvlBudgetAmount").val(parseFloat(getAvalAmt).toFixed(2));
|
|
||||||
$("#tbleAppend").empty();
|
|
||||||
$("#tbleAppend").append(json.Items);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
function Validate() {
|
function Validate() {
|
||||||
var ReqNo = $('#txtReqNo').val();
|
var ReqNo = $('#txtReqNo').val();
|
||||||
console.log("--------------");
|
// console.log(ReqNo);
|
||||||
|
|
||||||
console.log(ReqNo);
|
|
||||||
|
|
||||||
if (ReqNo.length <= 0) {
|
if (ReqNo.length <= 0) {
|
||||||
alert('Please select the Requisition Number to Create Purchase Order');
|
alert('Please select the Requisition Number to Create Purchase Order');
|
||||||
return false;
|
return false;
|
||||||
@ -489,104 +595,4 @@ span.highlight {
|
|||||||
$('#ImportPOCheck').modal('show');
|
$('#ImportPOCheck').modal('show');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function() {
|
|
||||||
$('#REQLIST').DataTable({
|
|
||||||
"paging": true,
|
|
||||||
"lengthChange": true,
|
|
||||||
"searching": true,
|
|
||||||
"columnDefs": [{
|
|
||||||
"targets": 1,
|
|
||||||
"type": "date-eu"
|
|
||||||
}],
|
|
||||||
"aaSorting": [
|
|
||||||
[2, "desc"]
|
|
||||||
],
|
|
||||||
"ordering": true,
|
|
||||||
"info": true,
|
|
||||||
"autoWidth": true,
|
|
||||||
"pageLength": 10,
|
|
||||||
"lengthMenu": [10, 25, 50, 100]
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script>
|
|
||||||
<script>
|
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
|
||||||
// Initialize the DataTable
|
|
||||||
var table = $('#create_po_from_requistion').DataTable({
|
|
||||||
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
|
||||||
buttons: [
|
|
||||||
'copy', 'csv', 'excel', 'pdf', 'print' // 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
|
|
||||||
order: [[0, 'desc']], // Default ordering (column index 0, descending)
|
|
||||||
language: {
|
|
||||||
paginate: {
|
|
||||||
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
|
||||||
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Date range filter function
|
|
||||||
$.fn.dataTable.ext.search.push(
|
|
||||||
function(settings, data, dataIndex) {
|
|
||||||
var fromDate = $('#fromDate').val();
|
|
||||||
var toDate = $('#toDate').val();
|
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
|
||||||
return true; // If no dates selected, don't filter
|
|
||||||
}
|
|
||||||
|
|
||||||
var dateStr = data[1]; // Assuming the date is in the first column
|
|
||||||
var dateParts = dateStr.split("-");
|
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
|
||||||
var endDate = new Date(toDate);
|
|
||||||
|
|
||||||
// Adjust startDate to include the day before the selected fromDate
|
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
|
||||||
|
|
||||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
|
||||||
endDate.setHours(23, 59, 59, 999);
|
|
||||||
|
|
||||||
// Return true if the date is within the range
|
|
||||||
return date >= startDate && date <= endDate;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// Handle form submission for the date range filter
|
|
||||||
$("#DateRangeFilter").click(function(e) {
|
|
||||||
|
|
||||||
e.preventDefault();
|
|
||||||
table.draw(); // Redraw the table to apply the filter
|
|
||||||
});
|
|
||||||
|
|
||||||
// Reset button functionality
|
|
||||||
$("#resetButton").click(function() {
|
|
||||||
$("#fromDate").val('');
|
|
||||||
$("#toDate").val('');
|
|
||||||
table.draw(); // Redraw the table to clear the filter
|
|
||||||
});
|
|
||||||
|
|
||||||
// Automatically focus and open the To Date picker when From Date is selected
|
|
||||||
document.getElementById('fromDate').addEventListener('change', function() {
|
|
||||||
var fromDate = this.value;
|
|
||||||
var toDateInput = document.getElementById('toDate');
|
|
||||||
|
|
||||||
// Set the min attribute of the To Date input to the selected From Date
|
|
||||||
toDateInput.min = fromDate;
|
|
||||||
|
|
||||||
// Optionally reset the To Date input if the current value is before the new min date
|
|
||||||
if (toDateInput.value < fromDate) {
|
|
||||||
toDateInput.value = fromDate;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
@ -63,12 +63,18 @@
|
|||||||
color: #0056b3;
|
color: #0056b3;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="content-wrapper">
|
|
||||||
|
|
||||||
<section class="content">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<?php
|
|
||||||
|
<div class="content-page">
|
||||||
|
<div class="content">
|
||||||
|
<!-- Start Content-->
|
||||||
|
<div class="container-fluid">
|
||||||
|
<!-- start page title -->
|
||||||
|
<div>
|
||||||
|
<?php
|
||||||
helper('form');
|
helper('form');
|
||||||
$error = session()->getFlashdata('error');
|
$error = session()->getFlashdata('error');
|
||||||
if ($error) {
|
if ($error) {
|
||||||
@ -81,50 +87,39 @@
|
|||||||
echo show_alert($type, $success);
|
echo show_alert($type, $success);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-6">
|
||||||
<?php // \Config\Services::validation()->listErrors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>');
|
<div class="page-title-box page-title-box-alt">
|
||||||
?> </div>
|
<h4 class="page-title">Employee Details</h4>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="box">
|
|
||||||
<div class="box-header">
|
|
||||||
<CENTER>
|
|
||||||
<h3 class="box-title"> Employee Details</h3>
|
|
||||||
</CENTER>
|
|
||||||
</div>
|
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-12 col-md-6">
|
|
||||||
<form class="Date-filter-form" id="DateRangeFilter">
|
|
||||||
<input type="hidden" name="table" value="requisition">
|
|
||||||
<label for="fromDate">From:</label>
|
|
||||||
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
|
||||||
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
|
||||||
|
|
||||||
<button type="submit">Search</button>
|
|
||||||
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
|
||||||
<div class="error" id="error"></div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div class="col-xs-12 col-md-6 text-right">
|
|
||||||
<div class="form-group">
|
|
||||||
<a class="btn btn-success" href="<?php echo base_url(); ?>addemployee">Add New Employee</a>
|
|
||||||
<a class="btn btn-success" href="<?php echo base_url(); ?>exportemployee">Export Employee Details <i class="fa fa-download" aira-hidden="true"></i></a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col-6 text-right">
|
||||||
|
<a class="btn btn-success" href="<?php echo base_url(); ?>addemployee">Add New Employee</a>
|
||||||
|
<a class="btn btn-success" href="<?php echo base_url(); ?>exportemployee">Export Employee Details <i class="fa fa-download" aira-hidden="true"></i></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-12">
|
||||||
<table id="datatable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;">
|
<div class="card">
|
||||||
|
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
|
<input type="hidden" name="table" value="requisition">
|
||||||
|
<label for="fromDate">From:</label>
|
||||||
|
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
|
<label for="toDate">To:</label>
|
||||||
|
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
|
<div class="error" id="error"></div>
|
||||||
|
</form>
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
<table id="datatable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;">
|
||||||
<thead style="background-color: #ddd;">
|
<thead style="background-color: #ddd;">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Created Date</th>
|
<th>Created Date</th>
|
||||||
<th>Emp ID</th>
|
<th >Emp ID</th>
|
||||||
<th>Employee Name</th>
|
<th>Employee Name</th>
|
||||||
<th>Contact Number</th>
|
<th>Contact Number</th>
|
||||||
<th>Designation</th>
|
<th>Designation</th>
|
||||||
@ -155,18 +150,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div> <!-- end card body-->
|
||||||
|
</div> <!-- end card -->
|
||||||
|
</div><!-- end col-->
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> <!-- container -->
|
||||||
</section>
|
</div> <!-- content -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
||||||
<!-- <script type="text/javascript">
|
<!-- <script type="text/javascript">
|
||||||
|
|
||||||
@ -193,23 +188,22 @@
|
|||||||
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
||||||
};
|
};
|
||||||
// Initialize the DataTable
|
// Initialize the DataTable
|
||||||
|
|
||||||
var table = $('#datatable').DataTable({
|
var table = $('#datatable').DataTable({
|
||||||
"paging": true,
|
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
||||||
"lengthChange": true,
|
buttons: [
|
||||||
"searching": true,
|
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
|
||||||
"ordering": true,
|
|
||||||
"columnDefs": [{
|
|
||||||
"targets": 0,
|
|
||||||
"type": "date-eu"
|
|
||||||
}],
|
|
||||||
"aaSorting": [
|
|
||||||
[0, "desc"]
|
|
||||||
],
|
],
|
||||||
"info": true,
|
pageLength: 10, // Default rows per page
|
||||||
"autoWidth": true,
|
lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ], // Rows per page options
|
||||||
"pageLength": 10,
|
responsive: true, // Responsive table
|
||||||
"lengthMenu": [10, 25, 50, 100],
|
order: [[0, 'desc']], // Default ordering (column index 0, descending)
|
||||||
|
language: {
|
||||||
|
paginate: {
|
||||||
|
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||||
|
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Initialize the datepickers
|
// Initialize the datepickers
|
||||||
|
|||||||
@ -39,25 +39,29 @@
|
|||||||
|
|
||||||
|
|
||||||
<link href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css" rel="stylesheet">
|
<link href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css" rel="stylesheet">
|
||||||
<!-- DataTables Buttons CSS -->
|
<!-- DataTables Buttons CSS -->
|
||||||
<link href="https://cdn.datatables.net/buttons/2.3.6/css/buttons.dataTables.min.css" rel="stylesheet">
|
<link href="https://cdn.datatables.net/buttons/2.3.6/css/buttons.dataTables.min.css" rel="stylesheet">
|
||||||
|
|
||||||
<!-- jQuery -->
|
<!-- jQuery -->
|
||||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
<!-- DataTables JS -->
|
<!-- DataTables JS -->
|
||||||
<script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
|
<script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
|
||||||
<!-- DataTables Buttons JS -->
|
<!-- DataTables Buttons JS -->
|
||||||
<script src="https://cdn.datatables.net/buttons/2.3.6/js/dataTables.buttons.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.3.6/js/dataTables.buttons.min.js"></script>
|
||||||
<script src="https://cdn.datatables.net/buttons/2.3.6/js/buttons.html5.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.3.6/js/buttons.html5.min.js"></script>
|
||||||
<script src="https://cdn.datatables.net/buttons/2.3.6/js/buttons.print.min.js"></script>
|
<script src="https://cdn.datatables.net/buttons/2.3.6/js/buttons.print.min.js"></script>
|
||||||
|
|
||||||
|
<!-- JSZip for Excel export -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
||||||
|
<!-- pdfmake for PDF export -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css" rel="stylesheet">
|
||||||
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">
|
||||||
|
|
||||||
|
<!-- Scroll the table left to right -->
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js"></script>
|
||||||
|
|
||||||
<!-- JSZip for Excel export -->
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
|
||||||
<!-- pdfmake for PDF export -->
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css" rel="stylesheet">
|
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
/* Select2 Input Hight Set */
|
/* Select2 Input Hight Set */
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user