GWM : header scroller code

This commit is contained in:
bitbucket 2024-08-30 09:26:33 +05:30
commit fffc1f0b26
27 changed files with 14927 additions and 14094 deletions

View File

@ -270,6 +270,7 @@ $routes->post('editExpense', 'Expense::editExpense');
$routes->post('getExpenseDetails', 'Expense::getExpenseDetails'); $routes->post('getExpenseDetails', 'Expense::getExpenseDetails');
$routes->get('uploads/(:any)', 'Expense::downloads/$1'); $routes->get('uploads/(:any)', 'Expense::downloads/$1');
$routes->post('deleteFile', 'Expense::deleteFile'); $routes->post('deleteFile', 'Expense::deleteFile');
$routes->get('downloadFile/(:any)', 'Expense::downloads/$1');
// Application OGR Page // Application OGR Page

View File

@ -39,18 +39,21 @@ class Expense extends BaseController
$file->move(WRITEPATH . 'uploads', $fileName); $file->move(WRITEPATH . 'uploads', $fileName);
} }
$status = $this->request->getPost('status');
$paymentMethod = $status === 'Paid' ? $this->request->getPost('payment_method') : 0;
$data = [ $data = [
'transporter_file' => $fileName, 'transporter_file' => $fileName,
'supplier_id' => $this->request->getPost('supplierid'), 'supplier_id' => $this->request->getPost('supplierid'),
'remarks' => $this->request->getPost('remarks'), 'remarks' => $this->request->getPost('remarks'),
'cost' => $this->request->getPost('cost'), 'cost' => $this->request->getPost('cost'),
'gst' => $this->request->getPost('gst'), 'gst' => $this->request->getPost('gst'),
'total' => $this->request->getPost('total'), 'total' => (int)$this->request->getPost('gst') + (int)$this->request->getPost('cost'),
'status' => $this->request->getPost('status'), 'status' => $status,
'payment_method' => $this->request->getPost('payment_method') 'payment_method' => $paymentMethod
]; ];
$insert_id = $this->expense_model->insertExpense($data);
$insert_id = $this->expense_model->insertExpense($data);
if ($insert_id) { if ($insert_id) {
return json_encode('true'); return json_encode('true');
} else { } else {
@ -83,18 +86,23 @@ class Expense extends BaseController
$fileName = $this->request->getPost('existing_file'); // Use existing file if no new file is uploaded $fileName = $this->request->getPost('existing_file'); // Use existing file if no new file is uploaded
} }
$status = $this->request->getPost('status');
$paymentMethod = $status === 'Paid' ? $this->request->getPost('payment_method') : 0;
$data = [ $data = [
'supplier_id' => $this->request->getPost('supplierid'), 'supplier_id' => $this->request->getPost('supplierid'),
'remarks' => $this->request->getPost('remarks'), 'remarks' => $this->request->getPost('remarks'),
'cost' => $this->request->getPost('cost'), 'cost' => $this->request->getPost('cost'),
'gst' => $this->request->getPost('gst'), 'gst' => $this->request->getPost('gst'),
'total' => $this->request->getPost('total'), 'total' => (int)$this->request->getPost('gst') + (int)$this->request->getPost('cost'),
'status' => $this->request->getPost('status'), 'status' => $status,
'payment_method' => $this->request->getPost('payment_method') 'payment_method' => $paymentMethod
]; ];
if(!empty($fileName)){ if(!empty($fileName)){
$data['transporter_file'] = $fileName; $data['transporter_file'] = $fileName;
} }
$data['payment_method'] = $this->request->getPost('payment_method');
if ($id) { if ($id) {
$result = $this->expense_model->updateExpense($id, $data); $result = $this->expense_model->updateExpense($id, $data);

File diff suppressed because it is too large Load Diff

View File

@ -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>

View File

@ -465,7 +465,7 @@ legend {
</b> </b>
</div> </div>
<div class="col-md-5" style="margin-top: 20px;margin-bottom: 10px;text-align:right;"> <div class="col-md-5" style="margin-top: 20px;margin-bottom: 10px;text-align:right;">
<a href="<?php echo base_url() ?>employeeListing" class="btn btn-cancel" value="Back">Back</a> <a href="<?php echo base_url() ?>employeeListing" class="btn btn-dark waves-effect waves-light" value="Back">Back</a>
</div> </div>
<div class="col-md-1"></div> <div class="col-md-1"></div>
</div> </div>

View File

@ -46,7 +46,7 @@
</div> </div>
<div class="col-6 text-right"> <div class="col-6 text-right">
<a class="btn btn-cancel" href="<?php echo base_url(); ?>supplierlisting"><span class="bold">Back</span></a> <a class="btn btn-dark waves-effect waves-light" href="<?php echo base_url(); ?>supplierlisting"><span class="bold">Back</span></a>
</div> </div>
</div> </div>
<!-- end page title --> <!-- end page title -->

View File

@ -10,7 +10,7 @@
</div> </div>
</div> </div>
<div class="col-6 text-right"> <div class="col-6 text-right">
<a class="btn btn-cancel" href="<?php echo base_url(); ?>assetListing"><span class="bold">Back</span></a> <a class="btn btn-dark waves-effect waves-light" href="<?php echo base_url(); ?>assetListing"><span class="bold">Back</span></a>
</div> </div>
</div> </div>
<!-- end page title --> <!-- end page title -->

View File

@ -16,7 +16,7 @@
</div> </div>
</div> </div>
<div class="col-6 text-right"> <div class="col-6 text-right">
<a class="btn btn-cancel" href="<?php echo base_url(); ?>configlisting"><span class="bold">Back</span></a> <a class="btn btn-dark waves-effect waves-light" href="<?php echo base_url(); ?>configlisting"><span class="bold">Back</span></a>
</div> </div>
</div> </div>
<?php <?php

View File

@ -20,7 +20,7 @@
</div> </div>
</div> </div>
<div class="col-6 text-right"> <div class="col-6 text-right">
<a class="btn btn-cancel" href="<?php echo base_url(); ?>departmentListing"><span class="bold">Back</span></a> <a class="btn btn-dark waves-effect waves-light" href="<?php echo base_url(); ?>departmentListing"><span class="bold">Back</span></a>
</div> </div>
</div> </div>
<!-- end page title --> <!-- end page title -->

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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">&times;</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>&nbsp;<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">&times;</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">&times;</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>&nbsp;<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; ?>)" />&nbsp;</td> <td><input type="checkbox" name="chk<?php echo $index; ?>" id="chk<?php echo $index; ?>" onclick="selectReqNo(<?php echo $index; ?>)" />&nbsp;</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">&times;</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>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -233,11 +233,6 @@ if (!empty($RequistionDetails)) {
margin: 0 5px; margin: 0 5px;
} }
.mandatory {
color: red;
text-align: right;
background-color: white;
}
</style> </style>
<script src="<?php echo base_url(); ?>public/assets/js/CreatePOValidation.js" type="text/javascript"> <script src="<?php echo base_url(); ?>public/assets/js/CreatePOValidation.js" type="text/javascript">
@ -319,7 +314,8 @@ if (!empty($RequistionDetails)) {
<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><?= "Purchase Order - $PONO "; ?></h4> <h4><?= "Amended Import Purchase Order - $PONO "; ?></h4>
<a href="<?php echo base_url() ?>amendmentpurchaseorder" class="btn btn-cancel" id="back" value="Back">Back</a>
</div> </div>
</div> </div>
</div> </div>
@ -329,33 +325,17 @@ if (!empty($RequistionDetails)) {
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<?php
<div class="content-wrapper"> $attributes = array('class' => 'form-label-left ImportPO ', 'name' => 'ImportPO', 'id' => 'ImportPO', 'enctype' => 'multipart/form-data');
echo form_open(base_url() . '/purchaseorder/addPO/', $attributes); ?>
<section class="content">
<div id="content"></div>
<?php
$attributes = array('class' => 'form-label-left ImportPO ', 'name' => 'ImportPO', 'id' => 'ImportPO', 'enctype' => 'multipart/form-data');
echo form_open(base_url() . '/purchaseorder/addPO/', $attributes); ?>
<!-- <section class="content"> -->
<div style="border:2px solid #333;"> <div style="border:2px solid #333;">
<div class="col-md-12">
<div class="header-container">
<h2> Amended Import Purchase Order-<?php echo "$PONO" ?></h2>
<a href="<?php echo base_url() ?>amendmentpurchaseorder" class="btn btn-cancel" id="back" value="Back">Back</a>
</div>
<!--<div class="col-md-1"><br/>
<a class="btn btn-info" href="<?php echo base_url(); ?>purchaseorder/CreateimportPOPrint" target="_blank">Print</a>
</div> -->
</div>
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Requistion No</label> <label>Requistion No</label>
<?php <?php
$options = array("0" => 'Selected Requisition Numbers'); $options = array("0" => 'Selected Requisition Numbers');
@ -367,7 +347,7 @@ if (!empty($RequistionDetails)) {
echo form_multiselect('RequistionNo', $options, set_value('RequistionNo', array()), 'id="RequistionNo"', 'required="true"', 'height="400px"'); echo form_multiselect('RequistionNo', $options, set_value('RequistionNo', array()), 'id="RequistionNo"', 'required="true"', 'height="400px"');
?> ?>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Purchase Order Type</label> <label>Purchase Order Type</label>
<div class="form-group"> <div class="form-group">
@ -377,8 +357,8 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Supplier<span class="badge mandatory">*</span></label> <label>Supplier<span class="text-danger">*</span></label>
<?php <?php
$options = array("0" => 'Select Supplier'); $options = array("0" => 'Select Supplier');
@ -395,7 +375,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Address</label> <label>Address</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -406,9 +386,9 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Currency Type<span class="badge mandatory">*</span></label> <label>Currency Type<span class="text-danger">*</span></label>
<?php <?php
$options = array($CurCode => $Cur); $options = array($CurCode => $Cur);
@ -422,8 +402,8 @@ if (!empty($RequistionDetails)) {
echo form_dropdown('currencytype', $options, set_value('currencytype'), 'id="currencytype"', 'required="true"', 'class="form-control select2'); ?> echo form_dropdown('currencytype', $options, set_value('currencytype'), 'id="currencytype"', 'required="true"', 'class="form-control select2'); ?>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<b><u>Select Delivery By<span class="badge mandatory">*</span></u></b><br /> <b><u>Select Delivery By<span class="text-danger">*</span></u></b><br />
<!-- <?php echo form_label('Date', 'Date') . "&nbsp;&nbsp;" . form_radio(array("name" => "DateRange", "id" => "Date", "value" => "0", 'checked' => 'checked')); ?>&nbsp;&nbsp;&nbsp;&nbsp;</td> --> <!-- <?php echo form_label('Date', 'Date') . "&nbsp;&nbsp;" . form_radio(array("name" => "DateRange", "id" => "Date", "value" => "0", 'checked' => 'checked')); ?>&nbsp;&nbsp;&nbsp;&nbsp;</td> -->
@ -433,7 +413,7 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
<div class="col-md-3" id="Schedulediv" style="display:none;"> <br /> <div class="form-group col-md-3" id="Schedulediv" style="display:none;"> <br />
<!-- <label >Schedule </label> <!-- <label >Schedule </label>
<?php <?php
@ -441,7 +421,7 @@ if (!empty($RequistionDetails)) {
echo Form_textarea($data); echo Form_textarea($data);
?> --> ?> -->
<label>Schedule By<span class="badge mandatory">*</span></label> <label>Schedule By<span class="text-danger">*</span></label>
<?php <?php
$data = array('name' => 'Scheduleby', 'value' => set_value('Scheduleby', $DeliverySchedule), 'id' => 'Scheduleby', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40', 'maxlength' => '110'); $data = array('name' => 'Scheduleby', 'value' => set_value('Scheduleby', $DeliverySchedule), 'id' => 'Scheduleby', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40', 'maxlength' => '110');
@ -449,7 +429,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
<div class="col-md-3" id="Deliverydtdiv"> <div class="form-group col-md-3" id="Deliverydtdiv">
<!-- <label>Delivery Date</label> <!-- <label>Delivery Date</label>
<?php <?php
@ -458,7 +438,7 @@ if (!empty($RequistionDetails)) {
?> --> ?> -->
<label>Dispatch Instruction<span class="badge mandatory">*</span></label> <label>Dispatch Instruction<span class="text-danger">*</span></label>
<?php <?php
// $data = array('name' => 'Dispatch','value' => set_value('Dispatch',$Import_DispatchDetails),'id'=>'Dispatch', 'class' => 'form-control' ,'required' => 'true'); // $data = array('name' => 'Dispatch','value' => set_value('Dispatch',$Import_DispatchDetails),'id'=>'Dispatch', 'class' => 'form-control' ,'required' => 'true');
@ -469,7 +449,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Delivery Address</label> <label>Delivery Address</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -481,11 +461,11 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3"> <div class="form-group col-md-3">
Check Today's Foreign Exchange value <a href="http://www.xe.com/" target="_blank"><u>(Click here)</u></a> Check Today's Foreign Exchange value <a href="http://www.xe.com/" target="_blank"><u>(Click here)</u></a>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Exchange Rate On</label> <label>Exchange Rate On</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -494,10 +474,10 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<!-- <label>Exchange Rate </label> --> <!-- <label>Exchange Rate </label> -->
<label id=label1><b><?php echo "Exchange Rate in $Currencycode ($Value)" ?><span class="badge mandatory">*</span></label> <label id=label1><b><?php echo "Exchange Rate in $Currencycode ($Value)" ?><span class="text-danger">*</span></label>
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'ExchangeRate', 'value' => set_value('ExchangeRate', $ExchangeRate), 'id' => 'ExchangeRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'USRate()'); $data = array('name' => 'ExchangeRate', 'value' => set_value('ExchangeRate', $ExchangeRate), 'id' => 'ExchangeRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'USRate()');
@ -505,8 +485,8 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Place of Origin<span class="badge mandatory">*</span></label> <label>Place of Origin<span class="text-danger">*</span></label>
<div class="form-group"> <div class="form-group">
<?php <?php
// $data = array('name' => 'PODate','value' => set_value('PODate',$CurrentDate),'id'=>'PODate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;'); // $data = array('name' => 'PODate','value' => set_value('PODate',$CurrentDate),'id'=>'PODate', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
@ -539,8 +519,8 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Purchase Order Date</label> <label>Purchase Order Date</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -549,7 +529,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Mode Of Shipment</label> <label>Mode Of Shipment</label>
<div class="form-group"> <div class="form-group">
@ -559,7 +539,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Contact Reference</label> <label>Contact Reference</label>
<div class="form-group"> <div class="form-group">
@ -569,7 +549,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Supplier's Offer No</label> <label>Supplier's Offer No</label>
<div class="form-group"> <div class="form-group">
@ -582,8 +562,8 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Our Reference(S)</label> <label>Our Reference(S)</label>
<div class="form-group"> <div class="form-group">
@ -593,8 +573,8 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label for="payablefrom">Import Type Options<span class="badge mandatory">*</span></label> <label for="payablefrom">Import Type Options<span class="text-danger">*</span></label>
<?php <?php
//$options1 = array("0"=>'Select Import Option'); //$options1 = array("0"=>'Select Import Option');
@ -619,8 +599,8 @@ if (!empty($RequistionDetails)) {
echo form_dropdown('Importoption', $options2, set_value('Importoption'), 'id="Importoption"', 'class="form-control"'); ?> echo form_dropdown('Importoption', $options2, set_value('Importoption'), 'id="Importoption"', 'class="form-control"'); ?>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label for="payablefrom">Payable Terms<span class="badge mandatory">*</span></label> <label for="payablefrom">Payable Terms<span class="text-danger">*</span></label>
<input type="hidden" name="beforePaymentTerms" value="<?php echo $Terms; ?>"> <input type="hidden" name="beforePaymentTerms" value="<?php echo $Terms; ?>">
@ -654,8 +634,8 @@ if (!empty($RequistionDetails)) {
echo form_dropdown('PaymentTerms', $optionsPay, set_value('PaymentTerms'), 'id="PaymentTerms"', 'required="true"', 'class="form-control select2'); ?> echo form_dropdown('PaymentTerms', $optionsPay, set_value('PaymentTerms'), 'id="PaymentTerms"', 'required="true"', 'class="form-control select2'); ?>
</div> </div>
<div class="col-md-3" id="otheroptiondiv" style="display:none;"> <div class="form-group col-md-3" id="otheroptiondiv" style="display:none;">
<label>Description of Payable Terms<span class="badge mandatory">*</span></label> <label>Description of Payable Terms<span class="text-danger">*</span></label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -667,9 +647,9 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3"> <div class="form-group col-md-3">
<label for="payablefrom">Insurance<span class="badge mandatory">*</span></label> <label for="payablefrom">Insurance<span class="text-danger">*</span></label>
@ -702,8 +682,8 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
<div class="col-md-3" id="insurancenum" style="display:none;"> <div class="form-group col-md-3" id="insurancenum" style="display:none;">
<label>Insurance No / Insurance Details<span class="badge mandatory">*</span></label> <label>Insurance No / Insurance Details<span class="text-danger">*</span></label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -712,8 +692,8 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label for="BudgetType">Budget Type<span class="badge mandatory">*</span></label> <label for="BudgetType">Budget Type<span class="text-danger">*</span></label>
<select id='BudgetType' name='BudgetType'> <select id='BudgetType' name='BudgetType'>
<?php if ($BudgetType == 'CAPITAL') { <?php if ($BudgetType == 'CAPITAL') {
$opt1 = 'CAPITAL'; $opt1 = 'CAPITAL';
@ -728,7 +708,7 @@ if (!empty($RequistionDetails)) {
<option value=<?php echo $opt2; ?>><?php echo $opt2; ?></option> <option value=<?php echo $opt2; ?>><?php echo $opt2; ?></option>
</select> </select>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
</div> </div>
</div> </div>
</div> </div>
@ -759,9 +739,9 @@ if (!empty($RequistionDetails)) {
</div> </div>
<div align="left"> <div align="left">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Req No<span class="badge mandatory">*</span></label> <label>Req No<span class="text-danger">*</span></label>
<div> <div>
<?php <?php
@ -770,7 +750,7 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Department Name</label> <label>Department Name</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -779,7 +759,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Cost Center Code</label> <label>Cost Center Code</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -793,7 +773,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3" style="padding-right: 0px;"> <div class="form-group col-md-3" style="padding-right: 0px;">
<label>Available Budget Amount (<?php echo $INR ?>)</label> <label>Available Budget Amount (<?php echo $INR ?>)</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -808,9 +788,9 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-2"> <div class="form-group col-md-2">
<label>Item Code<span class="badge mandatory">*</span></label> <label>Item Code<span class="text-danger">*</span></label>
<!--In this item code the value should come from DB , so it getting error , so i am disabling this div , once get the data from DB uncommand this div--> <!--In this item code the value should come from DB , so it getting error , so i am disabling this div , once get the data from DB uncommand this div-->
<div> <div>
@ -828,7 +808,7 @@ if (!empty($RequistionDetails)) {
</div> </div>
<div class="col-md-2"> <div class="form-group col-md-2">
<label>Item Name</label> <label>Item Name</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -837,7 +817,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-2"> <div class="form-group col-md-2">
<label>UOM</label> <label>UOM</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -846,9 +826,9 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-6" style="padding: 0px;"> <div class="form-group col-md-6" style="padding: 0px;">
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Quantity<span class="badge mandatory">*</span></label> <label>Quantity<span class="text-danger">*</span></label>
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange(),ExceedEditQuantityCheck()'); $data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange(),ExceedEditQuantityCheck()');
@ -857,11 +837,11 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3" style="padding-left: 0px;"> <div class="form-group col-md-3" style="padding-left: 0px;">
<!-- <label>Rate </label> --> <!-- <label>Rate </label> -->
<label id=labelEditRate><?php echo "Rate in $Currencycode ($Value)"; ?><span class="badge mandatory">*</span> </label> <label id=labelEditRate><?php echo "Rate in $Currencycode ($Value)"; ?><span class="text-danger">*</span> </label>
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditRate', 'value' => set_value('EditRate'), 'id' => 'EditRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange()'); $data = array('name' => 'EditRate', 'value' => set_value('EditRate'), 'id' => 'EditRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange()');
@ -869,12 +849,12 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Per</label> <?php <label>Per</label> <?php
$data = array('name' => 'EditAmendPer', 'value' => set_value('EditAmendPer'), 'id' => 'EditAmendPer', 'class' => 'form-control'); $data = array('name' => 'EditAmendPer', 'value' => set_value('EditAmendPer'), 'id' => 'EditAmendPer', 'class' => 'form-control');
echo form_input($data); ?> echo form_input($data); ?>
</div> </div>
<div class="col-md-3" style="padding: 0px;"> <div class="form-group col-md-3" style="padding: 0px;">
<!-- <label><?php echo "Basic Value In"; ?></label>--> <!-- <label><?php echo "Basic Value In"; ?></label>-->
<label id="label3"><?php echo "Basic Value In $Currencycode ($Value)"; ?></label> <label id="label3"><?php echo "Basic Value In $Currencycode ($Value)"; ?></label>
<div class="form-group"> <div class="form-group">
@ -888,9 +868,9 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3"> <div class="form-group col-md-3">
<!-- Basic Price in US $ per Ton : --> <!-- Basic Price in US $ per Ton : -->
@ -905,7 +885,7 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<?php echo "Exchange Rate ($Currencycode ($Value))" ?> <?php echo "Exchange Rate ($Currencycode ($Value))" ?>
@ -918,7 +898,7 @@ if (!empty($RequistionDetails)) {
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<!-- Basic value in INR : --> <!-- Basic value in INR : -->
@ -931,19 +911,19 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<!--<div class="col-md-3"> <!--<div class="form-group col-md-3">
<a href="http://www.xe.com/" target="_blank"><u>Click nere to check Today's Foreign Exchange value</u></a> <a href="http://www.xe.com/" target="_blank"><u>Click nere to check Today's Foreign Exchange value</u></a>
</div>--> </div>-->
<div class="col-md-12" style="border:1px solid #000;padding:0px;"> <div class="form-group col-md-12" style="border:1px solid #000;padding:0px;">
<br /> <br />
<div class="col-md-6" style="padding:0px;"> <div class="form-group col-md-6" style="padding:0px;">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-4"> <div class="form-group col-md-4">
<!-- Basic Price: --> <!-- Basic Price: -->
<label><?php echo "Basic Price ($INR)"; ?></label> <label><?php echo "Basic Price ($INR)"; ?></label>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group" style="display:none;"> <div class="form-group" style="display:none;">
<?php <?php
$data = array('name' => 'EditBasicPriceTax', 'value' => set_value('EditBasicPriceTax'), 'id' => 'EditBasicPriceTax', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);'); $data = array('name' => 'EditBasicPriceTax', 'value' => set_value('EditBasicPriceTax'), 'id' => 'EditBasicPriceTax', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
@ -951,7 +931,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditAfterBasicPriceTax', 'value' => set_value('EditAfterBasicPriceTax'), 'id' => 'EditAfterBasicPriceTax', 'class' => 'form-control num', 'readonly' => 'true'); $data = array('name' => 'EditAfterBasicPriceTax', 'value' => set_value('EditAfterBasicPriceTax'), 'id' => 'EditAfterBasicPriceTax', 'class' => 'form-control num', 'readonly' => 'true');
@ -960,12 +940,12 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-4"> <div class="form-group col-md-4">
<!-- Landing charge --> <!-- Landing charge -->
<label><?php echo "Landing charge ($INR)"; ?></label> <label><?php echo "Landing charge ($INR)"; ?></label>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditLandingCharge', 'value' => set_value('EditLandingCharge'), 'id' => 'EditLandingCharge', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateloadingcharge()'); $data = array('name' => 'EditLandingCharge', 'value' => set_value('EditLandingCharge'), 'id' => 'EditLandingCharge', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateloadingcharge()');
@ -976,7 +956,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditAfterLandingCharge', 'value' => set_value('EditAfterLandingCharge'), 'id' => 'EditAfterLandingCharge', 'class' => 'form-control num', 'readonly' => 'true'); $data = array('name' => 'EditAfterLandingCharge', 'value' => set_value('EditAfterLandingCharge'), 'id' => 'EditAfterLandingCharge', 'class' => 'form-control num', 'readonly' => 'true');
@ -985,12 +965,12 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-4"> <div class="form-group col-md-4">
<!-- High seas sales charge --> <!-- High seas sales charge -->
<label><?php echo "Assessable Value (A) ($INR)"; ?></label> <label><?php echo "Assessable Value (A) ($INR)"; ?></label>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group" style="display: none"> <div class="form-group" style="display: none">
<?php <?php
$data = array('name' => 'EditHighseas ', 'value' => set_value('EditHighseas'), 'id' => 'EditHighseas', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateHighseassalescharge()'); $data = array('name' => 'EditHighseas ', 'value' => set_value('EditHighseas'), 'id' => 'EditHighseas', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateHighseassalescharge()');
@ -998,7 +978,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditAfterAssessable', 'value' => set_value('EditAfterAssessable'), 'id' => 'EditAfterAssessable', 'class' => 'form-control num', 'readonly' => 'true'); $data = array('name' => 'EditAfterAssessable', 'value' => set_value('EditAfterAssessable'), 'id' => 'EditAfterAssessable', 'class' => 'form-control num', 'readonly' => 'true');
@ -1007,12 +987,12 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-4"> <div class="form-group col-md-4">
<!-- Custom duty : (a) --> <!-- Custom duty : (a) -->
<label><?php echo "Custom duty (B)($INR)"; ?></label> <label><?php echo "Custom duty (B)($INR)"; ?></label>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditCustomduty', 'value' => set_value('EditCustomduty'), 'id' => 'EditCustomduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateCustomduty()'); $data = array('name' => 'EditCustomduty', 'value' => set_value('EditCustomduty'), 'id' => 'EditCustomduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateCustomduty()');
@ -1020,7 +1000,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditAfterCustomduty', 'value' => set_value('EditAfterCustomduty'), 'id' => 'EditAfterCustomduty', 'class' => 'form-control num', 'readonly' => 'true'); $data = array('name' => 'EditAfterCustomduty', 'value' => set_value('EditAfterCustomduty'), 'id' => 'EditAfterCustomduty', 'class' => 'form-control num', 'readonly' => 'true');
@ -1032,12 +1012,12 @@ if (!empty($RequistionDetails)) {
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-4"> <div class="form-group col-md-4">
<!-- Custom ED_cess : (e) --> <!-- Custom ED_cess : (e) -->
<label><?php echo "Custom ED_cess (C) ($INR)"; ?></label> <label><?php echo "Custom ED_cess (C) ($INR)"; ?></label>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditCustomEDcess', 'value' => set_value('EditCustomEDcess'), 'id' => 'EditCustomEDcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateCustomEdcess()'); $data = array('name' => 'EditCustomEDcess', 'value' => set_value('EditCustomEDcess'), 'id' => 'EditCustomEDcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateCustomEdcess()');
@ -1045,7 +1025,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditAfterCustomEDcess', 'value' => set_value('EditAfterCustomEDcess'), 'id' => 'EditAfterCustomEDcess', 'class' => 'form-control num', 'readonly' => 'true'); $data = array('name' => 'EditAfterCustomEDcess', 'value' => set_value('EditAfterCustomEDcess'), 'id' => 'EditAfterCustomEDcess', 'class' => 'form-control num', 'readonly' => 'true');
@ -1054,12 +1034,12 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-4"> <div class="form-group col-md-4">
<!-- Custom S & H cess : (f) --> <!-- Custom S & H cess : (f) -->
<label><?php echo "Custom S & H cess (D)($INR)"; ?></label> <label><?php echo "Custom S & H cess (D)($INR)"; ?></label>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditCustomSHcess', 'value' => set_value('EditCustomSHcess'), 'id' => 'EditCustomSHcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateCustomSHcess()'); $data = array('name' => 'EditCustomSHcess', 'value' => set_value('EditCustomSHcess'), 'id' => 'EditCustomSHcess', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateCustomSHcess()');
@ -1067,7 +1047,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditAfterCustomSHcess', 'value' => set_value('EditAfterCustomSHcess'), 'id' => 'EditAfterCustomSHcess', 'class' => 'form-control num', 'readonly' => 'true'); $data = array('name' => 'EditAfterCustomSHcess', 'value' => set_value('EditAfterCustomSHcess'), 'id' => 'EditAfterCustomSHcess', 'class' => 'form-control num', 'readonly' => 'true');
@ -1077,13 +1057,13 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-6" style="padding:0px;"> <div class="form-group col-md-6" style="padding:0px;">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-4"> <div class="form-group col-md-4">
<!-- Additional Excise duty : (g) --> <!-- Additional Excise duty : (g) -->
<label><?php echo "Subtotal (E)($INR) (A+B+C+D)"; ?></label> <label><?php echo "Subtotal (E)($INR) (A+B+C+D)"; ?></label>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group" style="display: none"> <div class="form-group" style="display: none">
<?php <?php
$data = array('name' => 'EditAdditionalExciseduty ', 'value' => set_value('EditAdditionalExciseduty'), 'id' => 'EditAdditionalExciseduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateaddlExciseDuty(),EditCalculateAvlModvat(),EditCalculateGrossExpense()'); $data = array('name' => 'EditAdditionalExciseduty ', 'value' => set_value('EditAdditionalExciseduty'), 'id' => 'EditAdditionalExciseduty', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateaddlExciseDuty(),EditCalculateAvlModvat(),EditCalculateGrossExpense()');
@ -1091,7 +1071,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditSubtotal', 'value' => set_value('EditSubtotal'), 'id' => 'EditSubtotal', 'class' => 'form-control num', 'readonly' => 'true'); $data = array('name' => 'EditSubtotal', 'value' => set_value('EditSubtotal'), 'id' => 'EditSubtotal', 'class' => 'form-control num', 'readonly' => 'true');
@ -1105,12 +1085,12 @@ if (!empty($RequistionDetails)) {
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-4"> <div class="form-group col-md-4">
<!-- Additional Excise duty : (g) --> <!-- Additional Excise duty : (g) -->
<label><?php echo "IGST on (E): (F) ($INR)"; ?></label> <label><?php echo "IGST on (E): (F) ($INR)"; ?></label>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditIgst ', 'value' => set_value('EditIgst', 0), 'id' => 'EditIgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateIgst()'); $data = array('name' => 'EditIgst ', 'value' => set_value('EditIgst', 0), 'id' => 'EditIgst', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateIgst()');
@ -1118,7 +1098,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditAfterIgst', 'value' => set_value('EditAfterIgst', 0), 'id' => 'EditAfterIgst', 'class' => 'form-control num', 'readonly' => 'true'); $data = array('name' => 'EditAfterIgst', 'value' => set_value('EditAfterIgst', 0), 'id' => 'EditAfterIgst', 'class' => 'form-control num', 'readonly' => 'true');
@ -1135,12 +1115,12 @@ if (!empty($RequistionDetails)) {
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-8"> <div class="col-md-8">
<!-- Gross duty payable --> <!-- Gross duty payable -->
<label><?php echo "Total Duty (G)($INR) (B+C+D+E)"; ?></label> <label><?php echo "Total Duty (G)($INR) (B+C+D+E)"; ?></label>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditGrossdutypayable ', 'value' => set_value('EditGrossdutypayable'), 'id' => 'EditGrossdutypayable', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);'); $data = array('name' => 'EditGrossdutypayable ', 'value' => set_value('EditGrossdutypayable'), 'id' => 'EditGrossdutypayable', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
@ -1152,8 +1132,8 @@ if (!empty($RequistionDetails)) {
<!--Start of Adding of Frieght model--> <!--Start of Adding of Frieght model-->
<div class="col-md-12" style="padding:0px;"> <div class="form-group col-md-12" style="padding:0px;">
<div class="col-md-3"> <div class="form-group col-md-3">
<span>Freight Type </span> <span>Freight Type </span>
<div> <div>
<?php <?php
@ -1174,7 +1154,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3" id="AmendTripsValue" style="display:block;"> <div class="form-group col-md-3" id="AmendTripsValue" style="display:block;">
<span>NO Of Trips</span> <span>NO Of Trips</span>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1183,7 +1163,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<span>Freight Rate </span> <span>Freight Rate </span>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1193,7 +1173,7 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
<div class="col-md-3" style="padding-left: 0px;"> <div class="form-group col-md-3" style="padding-left: 0px;">
<span>Freight Amt In <?php echo $INR; ?></span> <span>Freight Amt In <?php echo $INR; ?></span>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1206,15 +1186,15 @@ if (!empty($RequistionDetails)) {
</div> </div>
<!--End of Adding of freight in edit model --> <!--End of Adding of freight in edit model -->
<div class="col-md-12"> <div class="form-group col-md-12">
<center> <label>Cost of the product Per UOM</label></center> <center> <label>Cost of the product Per UOM</label></center>
<hr /> <hr />
</div> </div>
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-4"> <div class="form-group col-md-4">
Duty Impact Duty Impact
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditDutyImpact', 'value' => set_value('EditDutyImpact'), 'id' => 'EditDutyImpact', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true'); $data = array('name' => 'EditDutyImpact', 'value' => set_value('EditDutyImpact'), 'id' => 'EditDutyImpact', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
@ -1222,7 +1202,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-4" style="margin-top: -4.8%"> <div class="form-group col-md-4" style="margin-top: -4.8%">
<span>Quantity</span> <span>Quantity</span>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1233,13 +1213,13 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-4"> <div class="form-group col-md-4">
<!-- Custom Duty Expenses --> <!-- Custom Duty Expenses -->
<label><?php echo "Custom Duty($INR) /UOM"; ?></label> <label><?php echo "Custom Duty($INR) /UOM"; ?></label>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditCustomDutyExpenses ', 'value' => set_value('EditCustomDutyExpenses'), 'id' => 'EditCustomDutyExpenses', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true'); $data = array('name' => 'EditCustomDutyExpenses ', 'value' => set_value('EditCustomDutyExpenses'), 'id' => 'EditCustomDutyExpenses', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
@ -1249,12 +1229,12 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-4"> <div class="form-group col-md-4">
<!-- RMC Including Customers --> <!-- RMC Including Customers -->
<label><?php echo "Clearing Charges ($INR)"; ?></label> <label><?php echo "Clearing Charges ($INR)"; ?></label>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditClearingCharges', 'value' => set_value('EditClearingCharges'), 'id' => 'EditClearingCharges', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);'); $data = array('name' => 'EditClearingCharges', 'value' => set_value('EditClearingCharges'), 'id' => 'EditClearingCharges', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);');
@ -1265,11 +1245,11 @@ if (!empty($RequistionDetails)) {
<div class="col-md-4"> <div class="form-group col-md-4">
<!-- RMC Including Customers --> <!-- RMC Including Customers -->
<label><?php echo "Nett per UOM($INR)"; ?></label> <label><?php echo "Nett per UOM($INR)"; ?></label>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditNett', 'value' => set_value('EditNett'), 'id' => 'EditNett', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true'); $data = array('name' => 'EditNett', 'value' => set_value('EditNett'), 'id' => 'EditNett', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
@ -1283,10 +1263,10 @@ if (!empty($RequistionDetails)) {
<div class="col-md-4" style="display:none;"> <div class="form-group col-md-4" style="display:none;">
<!-- Total Amount: --> <!-- Total Amount: -->
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<div class="form-group" style="display:none;"> <div class="form-group" style="display:none;">
<?php <?php
$data = array('name' => 'EditTotalExp', 'value' => set_value('EditTotalExp'), 'id' => 'EditTotalExp', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true'); $data = array('name' => 'EditTotalExp', 'value' => set_value('EditTotalExp'), 'id' => 'EditTotalExp', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true');
@ -1301,8 +1281,8 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-12"> <div class="form-group col-md-12">
<label>Import Description :</label> <label>Import Description :</label>
<?php <?php
$data = array('name' => 'edittxtInstruction', 'value' => set_value('edittxtInstruction'), 'id' => 'edittxtInstruction', 'class' => 'form-control', 'rows' => '10', 'cols' => '40'); $data = array('name' => 'edittxtInstruction', 'value' => set_value('edittxtInstruction'), 'id' => 'edittxtInstruction', 'class' => 'form-control', 'rows' => '10', 'cols' => '40');
@ -1606,7 +1586,7 @@ if (!empty($RequistionDetails)) {
// if($PONOStatus == PO_DRAFT) // if($PONOStatus == PO_DRAFT)
// { // {
?> ?>
<td> <a data-target='#editimportpomodel' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#editimportpomodel"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->ReqNo; ?> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> <!-- <a href='#' onclick = "DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>--> <td> <a data-target='#editimportpomodel' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#editimportpomodel"><i class="fas fa-pencil-alt" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->ReqNo; ?> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> <!-- <a href='#' onclick = "DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a>-->
<?php <?php
// } else { // } else {
?> ?>
@ -1674,10 +1654,10 @@ if (!empty($RequistionDetails)) {
</table> </table>
</div> </div>
<div class="col-md-12" style="border: 1px solid;"> <div class="form-group col-md-12" style="border: 1px solid;">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-4"> <div class="form-group col-md-4">
<label>Total Landing Charge <?php echo "($INR)" ?></label> <label>Total Landing Charge <?php echo "($INR)" ?></label>
<?php <?php
@ -1686,7 +1666,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<label>Total Assessable Value <?php echo "($INR)" ?></label> <label>Total Assessable Value <?php echo "($INR)" ?></label>
<?php <?php
@ -1695,7 +1675,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<label>Total Custom Duty Charge <?php echo "($INR)" ?></label> <label>Total Custom Duty Charge <?php echo "($INR)" ?></label>
<?php <?php
@ -1705,7 +1685,7 @@ if (!empty($RequistionDetails)) {
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<label>Total Subtotal Charge <?php echo "($INR)" ?></label> <label>Total Subtotal Charge <?php echo "($INR)" ?></label>
<?php <?php
@ -1715,7 +1695,7 @@ if (!empty($RequistionDetails)) {
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<label>Total IGST <?php echo "($INR)" ?></label> <label>Total IGST <?php echo "($INR)" ?></label>
<?php <?php
@ -1725,7 +1705,7 @@ if (!empty($RequistionDetails)) {
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<label>Total Custom ED_cess Charge <?php echo "($INR)" ?></label> <label>Total Custom ED_cess Charge <?php echo "($INR)" ?></label>
<?php <?php
@ -1734,7 +1714,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<label>Total Custom S & H cess Charge <?php echo "($INR)" ?></label> <label>Total Custom S & H cess Charge <?php echo "($INR)" ?></label>
<?php <?php
@ -1743,7 +1723,7 @@ if (!empty($RequistionDetails)) {
?> ?>
</div> </div>
<div class="col-md-4"> <div class="form-group col-md-4">
<label>Total Gross duty payable Charge <?php echo "($INR)" ?></label> <label>Total Gross duty payable Charge <?php echo "($INR)" ?></label>
<?php <?php
@ -1755,7 +1735,7 @@ if (!empty($RequistionDetails)) {
<div class="col-md-4"> <div class="form-group col-md-4">
<label>Total Freight Value </label> <?php <label>Total Freight Value </label> <?php
$data = array('name' => 'txtTotalFreight', 'value' => set_value('txtTotalFreight', $totfreight), 'id' => 'txtTotalFreight', 'class' => 'form-control', 'required' => 'true', 'readonly' => 'true', 'style' => 'text-align:right;'); $data = array('name' => 'txtTotalFreight', 'value' => set_value('txtTotalFreight', $totfreight), 'id' => 'txtTotalFreight', 'class' => 'form-control', 'required' => 'true', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data); echo form_input($data);
@ -1765,7 +1745,7 @@ if (!empty($RequistionDetails)) {
<input type="hidden" name="txttotamend" id="txttotamed" value=<?php echo $totorder; ?>> <input type="hidden" name="txttotamend" id="txttotamed" value=<?php echo $totorder; ?>>
<div class="col-md-4"> <div class="form-group col-md-4">
<label>Total Order Value <?php echo "($Value)" ?></label> <?php <label>Total Order Value <?php echo "($Value)" ?></label> <?php
$data = array('name' => 'txtToatlOrder', 'value' => set_value('txtToatlOrder', $totorder), 'id' => 'txtToatlOrder', 'class' => 'form-control', 'required' => 'true', 'readonly' => 'true', 'style' => 'text-align:right;'); $data = array('name' => 'txtToatlOrder', 'value' => set_value('txtToatlOrder', $totorder), 'id' => 'txtToatlOrder', 'class' => 'form-control', 'required' => 'true', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data); echo form_input($data);
@ -1777,8 +1757,8 @@ if (!empty($RequistionDetails)) {
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-12"> <div class="form-group col-md-12">
<label>Special Instructions </label> <?php <label>Special Instructions </label> <?php
$data = array('name' => 'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction', strip_tags($ServiceDescription)), 'id' => 'txtSpcialInstruction', 'class' => 'form-control', 'rows' => '10', 'cols' => '40'); $data = array('name' => 'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction', strip_tags($ServiceDescription)), 'id' => 'txtSpcialInstruction', 'class' => 'form-control', 'rows' => '10', 'cols' => '40');
echo form_textarea($data); echo form_textarea($data);
@ -1850,9 +1830,7 @@ if (!empty($RequistionDetails)) {
</div> </div>
</div> </div>
</section>
</div>
</div> <!-- end card body--> </div> <!-- end card body-->

View File

@ -929,11 +929,7 @@ if (!empty($INRSYMBOL)) {
margin: 0 5px; margin: 0 5px;
} }
.mandatory {
color: red;
text-align: right;
background-color: white;
}
</style> </style>
<div class="content-page"> <div class="content-page">
@ -961,8 +957,8 @@ if (!empty($INRSYMBOL)) {
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Requistion No</label> <label>Requistion No</label>
<?php <?php
$options = array("0" => 'Selected Requisition Numbers'); $options = array("0" => 'Selected Requisition Numbers');
@ -976,7 +972,7 @@ if (!empty($INRSYMBOL)) {
echo form_multiselect('RequistionNo', $options, set_value('RequistionNo', array()), 'id="RequistionNo"', 'required="true"', 'height="400px"'); echo form_multiselect('RequistionNo', $options, set_value('RequistionNo', array()), 'id="RequistionNo"', 'required="true"', 'height="400px"');
?> ?>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Purchase Order Type</label> <label>Purchase Order Type</label>
<div class="form-group"> <div class="form-group">
@ -986,8 +982,8 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Select Supplier<span class="badge mandatory">*</span></label> <label>Select Supplier<span class="text-danger">*</span></label>
<?php <?php
$options = array("0" => 'Select Supplier'); $options = array("0" => 'Select Supplier');
//print_r( $options); //print_r( $options);
@ -1002,7 +998,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Supplier Address</label> <label>Supplier Address</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1014,8 +1010,8 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3"> <div class="form-group col-md-3">
<div id="div1" style="display:block;"> <div id="div1" style="display:block;">
<b><u>Select Tax Range</u></b><br /> <b><u>Select Tax Range</u></b><br />
<div class="centered"> <div class="centered">
@ -1024,21 +1020,21 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<b><u>Select Delivery By<span class="badge mandatory">*</span></u></b><br /> <b><u>Select Delivery By<span class="text-danger">*</span></u></b><br />
<input type="hidden" name="beforeDelivery" value="<?php echo $DeliverOption; ?>"> <input type="hidden" name="beforeDelivery" value="<?php echo $DeliverOption; ?>">
<div class="centered"> <div class="centered">
<?php echo form_label('Date', 'Date') . "&nbsp;&nbsp;" . form_radio(array('name' => 'DateRange', 'value' => '0', 'checked' => ('0' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Date')); ?> <?php echo form_label('Date', 'Date') . "&nbsp;&nbsp;" . form_radio(array('name' => 'DateRange', 'value' => '0', 'checked' => ('0' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Date')); ?>
<?php echo form_label('Schedule', 'Schedule') . form_radio(array('name' => 'DateRange', 'value' => '1', 'checked' => ('1' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Schedule')); ?> <?php echo form_label('Schedule', 'Schedule') . form_radio(array('name' => 'DateRange', 'value' => '1', 'checked' => ('1' == $DeliverOption) ? TRUE : FALSE, 'id' => 'Schedule')); ?>
</div> </div>
</div> </div>
<div class="col-md-3" id="Deliverydtdiv"> <div class="form-group col-md-3" id="Deliverydtdiv">
<?php if ($DeliverOption == 1) { <?php if ($DeliverOption == 1) {
$Deliverydt = null; $Deliverydt = null;
} }
?> ?>
<input type="hidden" name="beforeDeliverydt" value="<?php echo $Deliverydt; ?>"> <input type="hidden" name="beforeDeliverydt" value="<?php echo $Deliverydt; ?>">
<label>Delivery Date<span class="badge mandatory">*</span></label> <label>Delivery Date<span class="text-danger">*</span></label>
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'Deliverydt', 'value' => set_value('Deliverydt', $Deliverydt), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;'); $data = array('name' => 'Deliverydt', 'value' => set_value('Deliverydt', $Deliverydt), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
@ -1046,15 +1042,15 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3" id="Schedulediv" style="display:none;"> <div class="form-group col-md-3" id="Schedulediv" style="display:none;">
<input type="hidden" name="beforeScheduleby" value="<?php echo $DeliverSchedule; ?>"> <input type="hidden" name="beforeScheduleby" value="<?php echo $DeliverSchedule; ?>">
<label>Schedule By<span class="badge mandatory">*</span></label> <label>Schedule By<span class="text-danger">*</span></label>
<?php <?php
$data = array('name' => 'Scheduleby', 'value' => set_value('Scheduleby', $DeliverSchedule), 'id' => 'Scheduleby', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40', 'maxlength' => '110'); $data = array('name' => 'Scheduleby', 'value' => set_value('Scheduleby', $DeliverSchedule), 'id' => 'Scheduleby', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40', 'maxlength' => '110');
echo Form_textarea($data); echo Form_textarea($data);
?> ?>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Delivery Address</label> <label>Delivery Address</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1066,8 +1062,8 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Purchase Order Date</label> <label>Purchase Order Date</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1076,7 +1072,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Mode Of Shipment</label> <label>Mode Of Shipment</label>
<div class="form-group"> <div class="form-group">
@ -1089,7 +1085,7 @@ if (!empty($INRSYMBOL)) {
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Contact Reference</label> <label>Contact Reference</label>
<div class="form-group"> <div class="form-group">
@ -1099,7 +1095,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Supplier's Offer No</label> <label>Supplier's Offer No</label>
<div class="form-group"> <div class="form-group">
@ -1113,8 +1109,8 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Other Reference(S)</label> <label>Other Reference(S)</label>
<div class="form-group"> <div class="form-group">
@ -1124,8 +1120,8 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Revenue Type Options<span class="badge mandatory">*</span></label> <label>Revenue Type Options<span class="text-danger">*</span></label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1151,8 +1147,8 @@ if (!empty($INRSYMBOL)) {
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label for="payablefrom">Payable Terms<span class="badge mandatory">*</span></label> <label for="payablefrom">Payable Terms<span class="text-danger">*</span></label>
<input type="hidden" name="beforePaymentTerms" value="<?php echo $Terms; ?>"> <input type="hidden" name="beforePaymentTerms" value="<?php echo $Terms; ?>">
@ -1189,8 +1185,8 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
<div class="col-md-3" id="otheroptiondiv" style="display:none;"> <div class="form-group col-md-3" id="otheroptiondiv" style="display:none;">
<label>Description of Payable Terms<span class="badge mandatory">*</span></label> <label>Description of Payable Terms<span class="text-danger">*</span></label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1202,16 +1198,16 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3"> <div class="form-group col-md-3">
<label for="insurance">Insurance<span class="badge mandatory">*</span></label> <label for="insurance">Insurance<span class="text-danger">*</span></label>
<?php <?php
$optionsnew = array('1' => 'Yes', '0' => 'No'); $optionsnew = array('1' => 'Yes', '0' => 'No');
echo form_dropdown('insurancestatus', $optionsnew, set_value('insurancestatus'), 'id="insurancestatus"', 'required="true"', 'class="form-control select2', 'readonly ="true"'); echo form_dropdown('insurancestatus', $optionsnew, set_value('insurancestatus'), 'id="insurancestatus"', 'required="true"', 'class="form-control select2', 'readonly ="true"');
?> ?>
</div> </div>
<div class="col-md-3" id="InsuranceNumberdiv" style="display:block;"> <div class="form-group col-md-3" id="InsuranceNumberdiv" style="display:block;">
<label>Insurance No / Insurance Details<span class="badge mandatory">*</span></label> <label>Insurance No / Insurance Details<span class="text-danger">*</span></label>
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'InsuranceNumber', 'InsuranceNumber' => set_value('InsuranceNumber', $insurenceno), 'id' => 'InsuranceNumber', 'class' => 'form-control', 'required' => 'true'); $data = array('name' => 'InsuranceNumber', 'InsuranceNumber' => set_value('InsuranceNumber', $insurenceno), 'id' => 'InsuranceNumber', 'class' => 'form-control', 'required' => 'true');
@ -1219,8 +1215,8 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label for="BudgetType">Budget Type<span class="badge mandatory">*</span></label> <label for="BudgetType">Budget Type<span class="text-danger">*</span></label>
<select id='BudgetType' name='BudgetType'> <select id='BudgetType' name='BudgetType'>
<?php if ($BudgetType == 'CAPITAL') { <?php if ($BudgetType == 'CAPITAL') {
$opt1 = 'CAPITAL'; $opt1 = 'CAPITAL';
@ -1237,7 +1233,7 @@ if (!empty($INRSYMBOL)) {
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
</div> </div>
</div> </div>
</div> </div>
@ -1411,9 +1407,9 @@ if (!empty($INRSYMBOL)) {
</div> </div>
<div align="left"> <div align="left">
<div> <div>
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Req No<span class="badge mandatory">*</span></label> <label>Req No<span class="text-danger">*</span></label>
<div> <div>
<?php <?php
@ -1424,7 +1420,7 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Department Name</label> <label>Department Name</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1433,7 +1429,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Cost Center Code</label> <label>Cost Center Code</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1443,7 +1439,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Avl Bud Amt</label> <label>Avl Bud Amt</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1453,9 +1449,9 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-2"> <div class="form-group col-md-2">
<label>Item Code<span class="badge mandatory">*</span></label> <label>Item Code<span class="text-danger">*</span></label>
<div> <div>
<?php <?php
@ -1469,7 +1465,7 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="col-md-2"> <div class="form-group col-md-2">
<label>Item Name</label> <label>Item Name</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1478,7 +1474,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-2"> <div class="form-group col-md-2">
<label>UOM</label> <label>UOM</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1487,9 +1483,9 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-6" style="padding:0px;"> <div class="form-group col-md-6" style="padding:0px;">
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Quantity<span class="badge mandatory">*</span></label> <label>Quantity<span class="text-danger">*</span></label>
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange()', 'style' => 'text-align:right;'); $data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange()', 'style' => 'text-align:right;');
@ -1498,8 +1494,8 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Rate <?php echo "($INRSYM)" ?><span class="badge mandatory">*</span></label> <label>Rate <?php echo "($INRSYM)" ?><span class="text-danger">*</span></label>
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'EditRate', 'value' => set_value('EditRate'), 'id' => 'EditRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange()', 'style' => 'text-align:right;'); $data = array('name' => 'EditRate', 'value' => set_value('EditRate'), 'id' => 'EditRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange()', 'style' => 'text-align:right;');
@ -1507,12 +1503,12 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Per</label> <?php <label>Per</label> <?php
$data = array('name' => 'EditAmendPer', 'value' => set_value('EditAmendPer'), 'id' => 'EditAmendPer', 'class' => 'form-control'); $data = array('name' => 'EditAmendPer', 'value' => set_value('EditAmendPer'), 'id' => 'EditAmendPer', 'class' => 'form-control');
echo form_input($data); ?> echo form_input($data); ?>
</div> </div>
<div class="col-md-3" style="padding-left: 0px;"> <div class="form-group col-md-3" style="padding-left: 0px;">
<label>Basic Amt <?php echo "($INRSYM)" ?></label> <label>Basic Amt <?php echo "($INRSYM)" ?></label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1524,9 +1520,9 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
</div><br /> </div><br />
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-4"></div> <div class="form-group col-md-4"></div>
<div class="col-md-4"> <div class="form-group col-md-4">
<label>Discount Type </label> <label>Discount Type </label>
<div> <div>
<?php <?php
@ -1547,7 +1543,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-2"> <div class="form-group col-md-2">
<label>Discount Rate </label> <label>Discount Rate </label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1556,7 +1552,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-2"> <div class="form-group col-md-2">
<label>Discounted Amt <?php echo "($INRSYM)" ?></label> <label>Discounted Amt <?php echo "($INRSYM)" ?></label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1567,8 +1563,8 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="col-md-12 "> <div class="col-md-12 ">
<div class="col-md-4"></div> <div class="form-group col-md-4"></div>
<div class="col-md-4"> <div class="form-group col-md-4">
<label>Freight Type </label> <label>Freight Type </label>
<div> <div>
<?php <?php
@ -1589,7 +1585,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-2" id="EditTripsValue" style="display:none;"> <div class="form-group col-md-2" id="EditTripsValue" style="display:none;">
<label>NO Of Trips</label> <label>NO Of Trips</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1598,7 +1594,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-2"> <div class="form-group col-md-2">
<label>Freight Rate </label> <label>Freight Rate </label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1607,7 +1603,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-2"> <div class="form-group col-md-2">
<label>Freight Amt <?php echo "($INRSYM)" ?></label> <label>Freight Amt <?php echo "($INRSYM)" ?></label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1617,9 +1613,9 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12" style="text-align:left;"> <div class="form-group col-md-12" style="text-align:left;">
<div class="col-md-4"></div> <div class="form-group col-md-4"></div>
<div class="col-md-4"> <div class="form-group col-md-4">
<label>Packaging Type </label> <label>Packaging Type </label>
<div> <div>
<?php <?php
@ -1640,7 +1636,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-2"> <div class="form-group col-md-2">
<label>Packaging Rate </label> <label>Packaging Rate </label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1649,7 +1645,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-2"> <div class="form-group col-md-2">
<label>Packaging Amt <?php echo "($INRSYM)" ?></label> <label>Packaging Amt <?php echo "($INRSYM)" ?></label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1659,9 +1655,9 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12" id="CGSTArea"> <div class="form-group col-md-12" id="CGSTArea">
<div class="col-md-8"></div> <div class="form-group col-md-8"></div>
<div class="col-md-2"> <div class="form-group col-md-2">
<label>CGST in %</label> <label>CGST in %</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1670,7 +1666,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-2"> <div class="form-group col-md-2">
<label>CGST Amt <?php echo "($INRSYM)" ?></label> <label>CGST Amt <?php echo "($INRSYM)" ?></label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1680,9 +1676,9 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12" id="SGSTModel"> <div class="form-group col-md-12" id="SGSTModel">
<div class="col-md-8"></div> <div class="form-group col-md-8"></div>
<div class="col-md-2"> <div class="form-group col-md-2">
<label>SGST in %</label> <label>SGST in %</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1692,7 +1688,7 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="col-md-2"> <div class="form-group col-md-2">
<label>SGST Amt <?php echo "($INRSYM)" ?></label> <label>SGST Amt <?php echo "($INRSYM)" ?></label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1703,9 +1699,9 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="col-md-12" id="IGSTModel" style="display:none;"> <div class="form-group col-md-12" id="IGSTModel" style="display:none;">
<div class="col-md-8"></div> <div class="form-group col-md-8"></div>
<div class="col-md-2"> <div class="form-group col-md-2">
<label>IGST in %</label> <label>IGST in %</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1714,7 +1710,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-2"> <div class="form-group col-md-2">
<label>IGST Amt <?php echo "($INRSYM)" ?></label> <label>IGST Amt <?php echo "($INRSYM)" ?></label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1727,9 +1723,9 @@ if (!empty($INRSYMBOL)) {
</div> </div>
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-8"></div> <div class="form-group col-md-8"></div>
<div class="col-md-4"> <div class="form-group col-md-4">
<label> Insurance Amt <?php echo "($INRSYM)" ?>(if Any)</label> <label> Insurance Amt <?php echo "($INRSYM)" ?>(if Any)</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -1739,7 +1735,7 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-4 col-md-offset-8"> <div class="col-md-4 col-md-offset-8">
<label>Total Order Amt <?php echo "($INRSYM)" ?></label> <label>Total Order Amt <?php echo "($INRSYM)" ?></label>
@ -1751,7 +1747,7 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="form-group col-md-12">
<label><?php echo "Revenue Description"; ?></label> <label><?php echo "Revenue Description"; ?></label>
<div class="form-group"> <div class="form-group">
@ -1765,7 +1761,7 @@ if (!empty($INRSYMBOL)) {
</div> </div>
<hr /> <hr />
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3 col-md-offset-9"> <div class="col-md-3 col-md-offset-9">
<a class="btn btn-cancel" data-dismiss="modal" value="Cancel">Cancel</a> <a class="btn btn-cancel" data-dismiss="modal" value="Cancel">Cancel</a>
<a class="btn btn-success EditRevenue" ID="EditRevenue">&nbsp;&nbsp;<span class="bold">Edit Revenue</span></a> <a class="btn btn-success EditRevenue" ID="EditRevenue">&nbsp;&nbsp;<span class="bold">Edit Revenue</span></a>
@ -1879,9 +1875,9 @@ if (!empty($INRSYMBOL)) {
<td> <a data-target='#EDITREVENUE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#EDITREVENUE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to Amend the <?php echo $record->ReqNo; ?> Requisition details"></i></a> <td> <a data-target='#EDITREVENUE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#EDITREVENUE"><i class="fas fa-pencil-alt" data-toggle="tooltip" title="Click here to Amend the <?php echo $record->ReqNo; ?> Requisition details"></i></a>
<!-- <td> <a data-toggle="tooltip" href="#"><i class="fa fa-pencil" data-toggle="tooltip" title="<?php //echo $record->ReqNo; <!-- <td> <a data-toggle="tooltip" href="#"><i class="fas fa-pencil-alt" data-toggle="tooltip" title="<?php //echo $record->ReqNo;
?> - Click here to view Requistion details"></i>&nbsp;&nbsp;&nbsp;</a> </td> --> ?> - Click here to view Requistion details"></i>&nbsp;&nbsp;&nbsp;</a> </td> -->
</td> </td>
@ -1913,8 +1909,8 @@ if (!empty($INRSYMBOL)) {
<!-- /.box-body --> <!-- /.box-body -->
<br> <br>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Basic Amount <?php echo "($INRSYM)" ?> </label> <label>Basic Amount <?php echo "($INRSYM)" ?> </label>
<?php <?php
@ -1924,7 +1920,7 @@ if (!empty($INRSYMBOL)) {
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Total Discount Amount <?php echo "($INRSYM)" ?> </label> <label>Total Discount Amount <?php echo "($INRSYM)" ?> </label>
<?php <?php
@ -1933,7 +1929,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
<div class="col-md-3" id="SGSTShow"> <div class="form-group col-md-3" id="SGSTShow">
<label>Total SGST Amount <?php echo "($INRSYM)" ?></label> <label>Total SGST Amount <?php echo "($INRSYM)" ?></label>
<?php <?php
@ -1942,7 +1938,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
<div class="col-md-3" id="IGSTShow" style="display:none;"> <div class="form-group col-md-3" id="IGSTShow" style="display:none;">
<label>Total IGST Amount In INR </label> <label>Total IGST Amount In INR </label>
<?php <?php
@ -1951,7 +1947,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
<div class="col-md-3" id="CGSTshow"> <div class="form-group col-md-3" id="CGSTshow">
<label>Total CGST Amount <?php echo "($INRSYM)" ?> </label> <label>Total CGST Amount <?php echo "($INRSYM)" ?> </label>
<?php <?php
@ -1962,10 +1958,10 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Total Packaging Amount <?php echo "($INRSYM)" ?></label> <label>Total Packaging Amount <?php echo "($INRSYM)" ?></label>
<?php <?php
@ -1974,7 +1970,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Total Insurance Amount <?php echo "($INRSYM)" ?> </label> <label>Total Insurance Amount <?php echo "($INRSYM)" ?> </label>
<?php <?php
@ -1983,7 +1979,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Total Freight Amount <?php echo "($INRSYM)" ?></label> <label>Total Freight Amount <?php echo "($INRSYM)" ?></label>
<?php <?php
@ -1992,7 +1988,7 @@ if (!empty($INRSYMBOL)) {
?> ?>
</div> </div>
<div class="col-md-3"> <div class="form-group col-md-3">
<label>Total Order Amount <?php echo "($INRSYM)" ?> </label> <label>Total Order Amount <?php echo "($INRSYM)" ?> </label>
<input type="hidden" name="preTotalOdervalue" value="<?php echo $totOrderSummaryAmt; ?>"> <input type="hidden" name="preTotalOdervalue" value="<?php echo $totOrderSummaryAmt; ?>">
<?php <?php
@ -2002,8 +1998,8 @@ if (!empty($INRSYMBOL)) {
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="form-group col-md-12">
<div class="col-md-12"> <div class="form-group col-md-12">
<label>Special Instructions </label> <?php <label>Special Instructions </label> <?php
$data = array('name' => 'txtSpcialInstruction', 'id' => 'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction', strip_tags($ServiceDescription)), 'rows' => '8', 'class' => 'form-control'); $data = array('name' => 'txtSpcialInstruction', 'id' => 'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction', strip_tags($ServiceDescription)), 'rows' => '8', 'class' => 'form-control');
echo form_textarea($data); echo form_textarea($data);
@ -2093,7 +2089,7 @@ if (!empty($INRSYMBOL)) {
<td align="left"><%=TotalValue%></td> <td align="left"><%=TotalValue%></td>
<td> <td>
<a data-target='#EDITREVENUE' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITREVENUE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick="DeleteRow('<%=index%>')" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a> <a data-target='#EDITREVENUE' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITREVENUE"><i class="fas fa-pencil-alt" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick="DeleteRow('<%=index%>')" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a>
</td> </td>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -34,6 +34,19 @@ if (!empty($ReqPOType)) {
$strReqPOType = $ReqPOType; $strReqPOType = $ReqPOType;
} }
?> ?>
<style>
.btn-soft-primary {
color: white;
background-color: rgb(42, 206, 150);
border-color: rgb(42, 206, 150);
}
.btn-soft-primary:hover {
background-color: rgb(32, 176, 130); /* Slightly darker shade for hover */
border-color: rgb(32, 176, 130);
}
</style>
<script type="text/javascript"> <script type="text/javascript">
window.onload = function() { window.onload = function() {
var serviceScheduleType = '<?php echo $serviceSchedule; ?>'; var serviceScheduleType = '<?php echo $serviceSchedule; ?>';
@ -216,13 +229,13 @@ if (!empty($ReqPOType)) {
<div class="form-row float-right"> <div class="form-row float-right">
<?php if ($Status == REQ_DRAFT) { ?> <?php if ($Status == REQ_DRAFT) { ?>
<input type="reset" value="Reset" class="btn btn-secondary waves-effect" onclick="window.location.reload();">&nbsp;&nbsp; <input type="reset" value="Reset" class="btn btn-secondary waves-effect" onclick="window.location.reload();">&nbsp;&nbsp;
<button type="button" class="btn btn-primary waves-effect Save" onclick="Save(0)" id="Save">Save As Draft</button>&nbsp;&nbsp; <button type="button" class="btn btn-primary waves-effect Save" " id="Save">Save As Draft</button>&nbsp;&nbsp;
<button type="button" class="btn btn-primary waves-effect submit" onclick="Save(1)" id="submit">Submit</button>&nbsp;&nbsp; <button type="button" class="btn btn-primary waves-effect submit" id="submit1">Submit</button>&nbsp;&nbsp;
<button type="button" class="btn btn-soft-primary waves-effect waves-light submit" onclick="Save(2)" id="submit">Approve</button>&nbsp;&nbsp; <button type="button" class="btn btn-soft-primary waves-effect waves-light submit" id="submit2">Approve</button>&nbsp;&nbsp;
<?php } else if ($Status == REQ_PENDING_APPROVAL) { ?> <?php } else if ($Status == REQ_PENDING_APPROVAL) { ?>
<input type="reset" value="Reset" class="btn btn-secondary waves-effect" onclick="window.location.reload();">&nbsp;&nbsp; <input type="reset" value="Reset" class="btn btn-secondary waves-effect" onclick="window.location.reload();">&nbsp;&nbsp;
<button type="button" class="btn btn-primary waves-effect submit" onclick="Save(1)" id="submit">Submit</button>&nbsp;&nbsp; <button type="button" class="btn btn-primary waves-effect submit" id="submit1">Submit</button>&nbsp;&nbsp;
<button type="button" class="btn btn-soft-primary waves-effect waves-light submit" onclick="Save(2)" id="submit">Approve</button>&nbsp;&nbsp; <button type="button" class="btn btn-soft-primary waves-effect waves-light submit" id="submit2">Approve</button>&nbsp;&nbsp;
<?php } ?> <?php } ?>
</div> </div>
<?php echo form_close(); ?> <?php echo form_close(); ?>
@ -518,72 +531,82 @@ if (!empty($ReqPOType)) {
userid = ''; userid = '';
} }
} }
$(document).ready(function() {
$('#submit2').on('click', function() {
Save(2);
});
$('#submit1').on('click', function() {
Save(1);
});
$('#Save').on('click', function() {
Save(0);
});
function Save(status) {
if (status == '0') {
stat = '<?php echo REQ_DRAFT; ?>';
}
if (status == '1') {
stat = '<?php echo REQ_PENDING_APPROVAL; ?>';
}
if (status == '2') {
stat = '<?php echo REQ_APPROVED; ?>'
}
//alert($('#MaterialCode4').val());
function Save(status) { if (validate()) {
if (status == '0') { if (document.getElementById('Items').rows.length < 2) {
stat = '<?php echo REQ_DRAFT; ?>'; alert('Please Select Line item to update the Requisition');
} $('#Deliverydt').focus();
if (status == '1') { return false;
stat = '<?php echo REQ_PENDING_APPROVAL; ?>';
}
if (status == '2') {
stat = '<?php echo REQ_APPROVED; ?>'
}
//alert($('#MaterialCode4').val());
if (validate()) {
if (document.getElementById('Items').rows.length < 2) {
alert('Please Select Line item to update the Requisition');
$('#Deliverydt').focus();
return false;
} else {
//alert(document.getElementById('Items').rows.length);
// $('#content').loader('show');
$('#txtStatus').val(stat);
var serviceSchedule = '';
var servicePeriod = '';
var noOfService = '';
if ($('#RequestType').val() == 'SERVICE') {
if ($('#ScheduleType').val() == 'Recurring') {
serviceSchedule = $('#ScheduleType').val();
servicePeriod = $('#ServiceOptions').val();
noOfService = $('#ServiceNo').val();
} else {
serviceSchedule = $('#ScheduleType').val();
servicePeriod = '';
noOfService = 0;
}
} else { } else {
//alert(document.getElementById('Items').rows.length);
// $('#content').loader('show');
$('#txtStatus').val(stat);
var serviceSchedule = ''; var serviceSchedule = '';
var servicePeriod = ''; var servicePeriod = '';
var noOfService = ''; var noOfService = '';
} if ($('#RequestType').val() == 'SERVICE') {
$.ajax({ if ($('#ScheduleType').val() == 'Recurring') {
data: $('.requistion').serialize() + "&serviceSchedule=" + serviceSchedule + "&servicePeriod=" + servicePeriod + "&noOfService=" + noOfService, serviceSchedule = $('#ScheduleType').val();
type: "POST", servicePeriod = $('#ServiceOptions').val();
url: "<?php echo base_url() ?>EditRequisition", noOfService = $('#ServiceNo').val();
success: function(data) {
if (data) {
// $('#content').loader('hide');
alert(data);
$('#txtRowCount').val('');
$('#txtDeletedRow').val('');
window.location = "Requisition";
} else { } else {
alert("Error"); serviceSchedule = $('#ScheduleType').val();
servicePeriod = '';
noOfService = 0;
} }
} else {
var serviceSchedule = '';
var servicePeriod = '';
var noOfService = '';
} }
$.ajax({
data: $('.requistion').serialize() + "&serviceSchedule=" + serviceSchedule + "&servicePeriod=" + servicePeriod + "&noOfService=" + noOfService,
type: "POST",
url: "<?php echo base_url() ?>EditRequisition",
success: function(data) {
if (data) {
// $('#content').loader('hide');
alert(data);
$('#txtRowCount').val('');
$('#txtDeletedRow').val('');
}); window.location = "Requisition";
} else {
alert("Error");
}
}
});
}
} }
} }
}
});
function validate() { function validate() {
if ($("option:selected", $("#RequestType")).val() == '-1') { if ($("option:selected", $("#RequestType")).val() == '-1') {

View File

@ -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

View File

@ -1,3 +1,9 @@
<!-- Include jQuery first -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Include jQuery Validation plugin -->
<script src="https://cdn.jsdelivr.net/jquery.validation/1.19.3/jquery.validate.min.js"></script>
<style> <style>
.form-group { .form-group {
padding-bottom: 0%; padding-bottom: 0%;
@ -79,34 +85,55 @@
<thead style="background-color: #ddd;"> <thead style="background-color: #ddd;">
<tr> <tr>
<th align="right">Created Date</th> <th align="right">Created Date</th>
<th align="right">Expense Id</th> <!-- <th align="right">Expense Id</th> -->
<th align="right">Supplier Name</th> <th align="right">Supplier Name</th>
<th align="right">Cost</th>
<th align="right">GST</th> <th align="right">GST</th>
<th align="right">Cost</th>
<th align="right">Total</th> <th align="right">Total</th>
<th align="right">Status</th> <th align="right">Status</th>
<th align="right">Payment Method</th> <th align="right">Payment Method</th>
<th>Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
if (!empty($expense_list)) { if (!empty($expense_list)) {
foreach ($expense_list as $record) { foreach ($expense_list as $record) {
?> $fileExists = 0;
$fileUrl = '';
if ($record['transporter_file']) {
$fileExists = 1;
$fileUrl = base_url('uploads/') . $record['transporter_file'];
}
// Create download link and delete button
?>
<tr> <tr>
<?php if (date('d-m-Y', strtotime($record['created_on'])) == "30-11--0001") { <?php if (date('d-m-Y', strtotime($record['created_on'])) == "30-11--0001") {
$cdate = '00-00-0000'; $cdate = '00-00-0000';
} else { } else {
$cdate = date('d-m-Y', strtotime($record['created_on'])); $cdate = date('d-m-Y', strtotime($record['created_on']));
} ?> }
?>
<td><?php echo $cdate; ?></td> <td><?php echo $cdate; ?></td>
<td class="edit-button" data-id="<?php echo $record['id']; ?>"><a href="#" data-toggle="modal" data-target="#expenseModal"><?php echo $record['id']; ?></a></td> <!-- <td><?php echo $record['id']; ?></td> -->
<td><?php echo $record['SupplierName']; ?></td> <td><?php echo $record['SupplierName']; ?></td>
<td><?php echo $record['cost']; ?></td>
<td><?php echo $record['gst']; ?></td> <td><?php echo $record['gst']; ?></td>
<td><?php echo $record['cost']; ?></td>
<td><?php echo $record['total']; ?></td> <td><?php echo $record['total']; ?></td>
<td><?php echo $record['status']; ?></td> <td><?php echo $record['status']; ?></td>
<td><?php echo $record['payment_method']; ?></td> <td><?php echo $record['payment_method']; ?></td>
<td>
<?php if($fileExists == 1){ ?>
<button title="Download FIle" class="download_button" onclick="downloadFile('<?php echo $record['id']; ?>', '<?php echo $record['transporter_file']; ?>')" style="border: none;background-color: white;color: #02a8b5;">
<i class="fas fa-file-download"></i>
</button>
<button title="Delete File" id="deleteFile" class="delete_button" data-value="<?php echo $record['id'] ?>" data-id="<?php echo $record['id'] ?>" data-file="<?php echo $record['transporter_file'] ?>"><i class="fas fa-trash"></i></button>
<?php } ?>
<button title="Edit" class="edit-button" data-toggle="modal" data-target="#expenseModal" data-id="<?php echo $record['id']; ?>" style="border: none;background-color: white;color: #02a8b5;" >
<i class="fas fa-pencil-alt"></i>
</button>
</td>
</tr> </tr>
<?php <?php
} }
@ -149,15 +176,15 @@
</div> </div>
<div class="col-md-5"> <div class="col-md-5">
<label for="supplierid" class="col-form-label">Supplier :</label> <label for="supplierid" class="col-form-label">Supplier :</label>
<select name="supplierid" id="supplierid" class="form-control"> <select name="supplierid" id="supplierid" class="form-control" required>
<option value="">Select Supplier</option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<div class="col-md-5"> <div class="col-md-5">
<label for="remarks" class="col-form-label">Remarks:</label> <label for="gst" class="col-form-label">Tax:</label>
<input type="text" name="remarks" id="remarks" class="form-control"> <input type="number" name="gst" id="gst" class="form-control" >
</div> </div>
<div class="col-md-1"> <div class="col-md-1">
</div> </div>
@ -165,26 +192,16 @@
<label for="cost" class="col-form-label">Cost:</label> <label for="cost" class="col-form-label">Cost:</label>
<input type="number" name="cost" id="cost" class="form-control"> <input type="number" name="cost" id="cost" class="form-control">
</div> </div>
</div>
<div class="form-group row">
<div class="col-md-5">
<label for="gst" class="col-form-label">GST:</label>
<input type="number" name="gst" id="gst" class="form-control">
</div>
<div class="col-md-1">
</div>
<div class="col-md-5">
<label for="total" class="col-form-label">Total:</label>
<input type="number" name="total" id="total" class="form-control">
</div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<div class="col-md-5"> <div class="col-md-5">
<label for="status" class="col-form-label">Status:</label> <label for="status" class="col-form-label">Status:</label>
<select name="status" id="status_id" class="form-control" required> <select name="status" id="status_id" class="form-control" required>
<option >Select Status</option> <option>Select Status</option>
<option value="1">Pending</option> <option value="Payment Pending">Payment Pending</option>
<option value="2">Complete</option> <option value="Paid">Paid</option>
</select> </select>
</div> </div>
<div class="col-md-1"> <div class="col-md-1">
@ -192,12 +209,20 @@
<div class="col-md-5"> <div class="col-md-5">
<label for="payment_method" class="col-form-label">Payment Method:</label> <label for="payment_method" class="col-form-label">Payment Method:</label>
<select name="payment_method" id="payment_method" class="form-control" required> <select name="payment_method" id="payment_method" class="form-control" required>
<option >Select Payment Method</option> <option>Select Payment Method</option>
<option value="1">Cash</option> <option value="Cash">Cash</option>
<option value="2">Online</option> <option value="Online">Online</option>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group row">
<div class="col-md-12">
<label for="remarks" class="col-form-label">Remarks:</label>
<!-- <input type="text" name="remarks" id="remarks" class="form-control"> -->
<textarea name="remarks" id="remarks" class="form-control"></textarea>
</div>
</div>
</form> </form>
</div> </div>
@ -210,7 +235,33 @@
</div><!-- /.modal --> </div><!-- /.modal -->
<script> <script>
function downloadFile(fileId, fileName) {
window.location.href = 'downloadFile/' + fileName;
}
$(document).ready(function() { $(document).ready(function() {
// Function to toggle payment method based on status
function togglePaymentMethod() {
var status = $('#status_id').val();
console.log(status);
if (status === 'Paid') {
$('#payment_method').prop('disabled', false); // Enable payment method
} else {
$('#payment_method').prop('disabled', true).val(''); // Disable payment method and clear value
}
}
// Trigger the toggle function on page load
togglePaymentMethod();
// Trigger the toggle function whenever the status changes
$('#status_id').on('change', function() {
togglePaymentMethod();
});
});
$(document).ready(function() {
$('#supplierid').select2();
var formActionUrl = ''; var formActionUrl = '';
// Event handler for file input change // Event handler for file input change
@ -218,67 +269,70 @@
var fileName = $(this).val().split('\\').pop(); // Get the file name var fileName = $(this).val().split('\\').pop(); // Get the file name
$('#file-name-display').text(fileName); // Display the file name $('#file-name-display').text(fileName); // Display the file name
}); });
function togglePaymentMethodEdit() {
$(document).on('click', '.edit-button', function() { var status = $('#status_id').val();
$('.modal-title').html('Edit Expense'); console.log(status);
var expenseId = $(this).data('id');
var supplier_list = [<?php echo $supplier_list; ?>]; if (status === 'Paid') {
$('#supplierid').empty(); // Clear the supplier dropdown $('#payment_method').prop('disabled', false); // Enable payment method
$('#supplierid').append('<option >Select Supplier</option>');
supplier_list[0].forEach(function(supplier) {
$('#supplierid').append('<option value="' + supplier.SupplierID + '">' + supplier.SupplierName + '</option>');
});
formActionUrl = '<?php echo base_url().'editExpense' ?>'; // Set action URL for adding
$.ajax({
url: '<?php echo base_url().'getExpenseDetails'; ?>',
type: 'POST',
data: { id: expenseId },
success: function(response) {
var expense = JSON.parse(response);
$('#id').val(expense.id);
$('#transporterfile').val(''); // Clear the file input
$('#currentFileName').text(''); // Clear the file name display
$('#supplierid').val(expense.supplier_id);
$('#remarks').val(expense.remarks);
$('#cost').val(expense.cost);
$('#gst').val(expense.gst);
$('#total').val(expense.total);
if(expense.status == 1){
$('#status_id').val("Pending");
}else if(expense.status == 2){
$('#status_id').val("Completed");
}
if(expense.payment_method == 1){
$('#payment_method').val("Cash");
}else if(expense.payment_method == 2){
$('#payment_method').val("Online");
}
// Clear any existing file link and delete button
$('#transporterfile').next('.download_button').remove();
$('#transporterfile').next('.delete_button').remove();
if (expense.transporter_file) {
$('#transporterfile_name').val(expense.transporter_file); // Set the hidden input value
$('#currentFileName').text(expense.transporter_file); // Display the existing file name
// Construct the full URL to the file
var fileUrl = '<?php echo base_url('uploads/'); ?>' + expense.transporter_file;
// Create download link and delete button
var fileLink = '<a class="download_button" href="' + fileUrl + '" target="_blank" download="' + expense.transporter_file + '">Download Current File</a>';
var deleteButton = '<button id="deleteFile" class="delete_button" data-value="' + expense.id +'" data-id="' + expense.id + '" data-file="' + expense.transporter_file + '"><i class="fas fa-trash"></i></button>';
// Add the file link and delete button
$('#transporterfile').after(fileLink + ' ' + deleteButton);
} else { } else {
$('#transporterfile_name').val(''); // Clear hidden input if no file $('#payment_method').prop('disabled', true).val(''); // Disable payment method and clear value
} }
} }
}); $(document).on('click', '.edit-button', function() {
}); $('.modal-title').html('Edit Expense');
var expenseId = $(this).data('id');
var supplier_list = [<?php echo $supplier_list; ?>];
$('#supplierid').empty(); // Clear the supplier dropdown
$('#supplierid').append('<option>Select Supplier</option>');
supplier_list[0].forEach(function(supplier) {
$('#supplierid').append('<option value="' + supplier.SupplierID + '">' + supplier.SupplierName + '</option>');
});
formActionUrl = '<?php echo base_url().'editExpense' ?>'; // Set action URL for adding
$.ajax({
url: '<?php echo base_url().'getExpenseDetails'; ?>',
type: 'POST',
data: { id: expenseId },
success: function(response) {
var expense = JSON.parse(response);
$('#id').val(expense.id);
$('#transporterfile').val(''); // Clear the file input
$('#currentFileName').text(''); // Clear the file name display
$('#supplierid').val(expense.supplier_id).trigger('change');
$('#remarks').val(expense.remarks);
$('#cost').val(expense.cost);
$('#gst').val(expense.gst);
$('#total').val(expense.total);
$('#status_id').val(expense.status);
$('#payment_method').val(expense.payment_method);
// Clear any existing file link and delete button
$('#transporterfile').next('.download_button').remove();
$('#transporterfile').next('.delete_button').remove();
if (expense.transporter_file) {
$('#transporterfile_name').val(expense.transporter_file); // Set the hidden input value
$('#currentFileName').text(expense.transporter_file); // Display the existing file name
// Construct the full URL to the file
var fileUrl = '<?php echo base_url('uploads/'); ?>' + expense.transporter_file;
// Create download link and delete button
var fileLink = '<a class="download_button" href="' + fileUrl + '" target="_blank" download="' + expense.transporter_file + '"><i class=" fas fa-file-download"></i></a>';
var deleteButton = '<button id="deleteFile" class="delete_button" data-value="' + expense.id +'" data-id="' + expense.id + '" data-file="' + expense.transporter_file + '"><i class="fas fa-trash"></i></button>';
// Add the file link and delete button
$('#transporterfile').after(fileLink + ' ' + deleteButton);
} else {
$('#transporterfile_name').val(''); // Clear hidden input if no file
}
togglePaymentMethodEdit();
}
});
});
$(document).on('click', '#addExpense', function () { $(document).on('click', '#addExpense', function () {
@ -287,7 +341,7 @@
$('.modal-title').html('Add Expense'); $('.modal-title').html('Add Expense');
$('#transporterfile').val(''); // Clear the file input $('#transporterfile').val(''); // Clear the file input
$('#currentFileName').text(''); // Clear the file name display $('#currentFileName').text(''); // Clear the file name display
$('#supplierid').val(''); $('#supplierid').val('').trigger('change');
$('#remarks').val(''); $('#remarks').val('');
$('#cost').val(''); $('#cost').val('');
$('#gst').val(''); $('#gst').val('');
@ -296,22 +350,26 @@
$('#payment_method').val(''); $('#payment_method').val('');
var supplier_list = [<?php echo $supplier_list; ?>]; var supplier_list = [<?php echo $supplier_list; ?>];
$('#supplierid').empty(); // Clear the supplier dropdown $('#supplierid').empty(); // Clear the supplier dropdown
$('#supplierid').append('<option >Select Supplier</option>'); $('#supplierid').append('<option>Select Supplier</option>');
supplier_list[0].forEach(function(supplier) { supplier_list[0].forEach(function(supplier) {
$('#supplierid').append('<option value="' + supplier.SupplierID + '">' + supplier.SupplierName + '</option>'); $('#supplierid').append('<option value="' + supplier.SupplierID + '">' + supplier.SupplierName + '</option>');
}); });
formActionUrl = '<?php echo base_url().'addExpense' ?>'; // Set action URL for adding formActionUrl = '<?php echo base_url().'addExpense' ?>'; // Set action URL for adding
togglePaymentMethodEdit();
}); });
// Handle form submission // Handle form submission
$('#tempClick').on('click', function(e) { $('#tempClick').on('click', function(e) {
e.preventDefault(); e.preventDefault();
// Native HTML5 form validation
if ($('#expenseForm')[0].checkValidity()) {
var formData = new FormData($('#expenseForm')[0]); // Use FormData to handle file upload var formData = new FormData($('#expenseForm')[0]); // Use FormData to handle file upload
console.log(formActionUrl); console.log(formActionUrl);
$.ajax({ $.ajax({
url: formActionUrl, // Use the correct URL based on the button clicked url: formActionUrl,
type: 'POST', type: 'POST',
data: formData, data: formData,
processData: false, processData: false,
@ -332,7 +390,12 @@
alert('An error occurred: ' + error); alert('An error occurred: ' + error);
} }
}); });
}); } else {
// If form is invalid, show native validation messages
$('#expenseForm')[0].reportValidity();
}
});
// DataTable initialization and date range filter logic (unchanged) // DataTable initialization and date range filter logic (unchanged)
var table = $('#expense_list_table').DataTable({ var table = $('#expense_list_table').DataTable({

View File

@ -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>
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 5px; width: 5px;
@ -72,6 +76,18 @@
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background-color: #f5f5f5; background-color: #f5f5f5;
} }
/* Select2 Input Hight Set */
.select2-selection.select2-selection--single{
height: calc(1.5em + .9rem + 2px);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height: 37px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
top: 7px;
}
/* Select2 Height End */
/* .navbar-custom{ /* .navbar-custom{
height: 55px; height: 55px;
} }
@ -101,17 +117,15 @@
border: 1px solid grey; border: 1px solid grey;
border-radius: 4px !important; border-radius: 4px !important;
} }
legend { legend {
border-bottom: 2px solid #FFF !important; border-bottom: 2px solid #FFF !important;
margin-left: -2%; margin-left: -2%;
} }
.form-group {
padding-bottom: 4%; .badge {
} color: red;
.badge { background-color: #fff;
color: red; }
background-color: #fff;
}
.btn-cancel { .btn-cancel {
background-color: grey; /* Red color */ background-color: grey; /* Red color */
color: white; color: white;

View File

@ -2,9 +2,11 @@
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/Autocomplete/jquery.autocomplete.js"></script> <script type="text/javascript" src="<?php echo base_url(); ?>public/assets/Autocomplete/jquery.autocomplete.js"></script>
<style> <style>
#MaterialRcvdDate, #InvoiceDate { #MaterialRcvdDate,
#InvoiceDate {
text-align: left; text-align: left;
} }
.autocomplete-suggestion { .autocomplete-suggestion {
cursor: pointer; cursor: pointer;
background-color: skyblue; background-color: skyblue;
@ -113,7 +115,7 @@
'PONO', 'PONO',
$options, $options,
set_value('PONO'), set_value('PONO'),
'class="form-control searchabledropdown" id="PONO" data-toggle="select2" required="true"' 'class="form-control searchabledropdown" id="PONO" data-toggle="select2" required="true" onchange="yourFunctionName()"'
); );
?> ?>
<span class="help-block"></span> <span class="help-block"></span>
@ -137,12 +139,13 @@
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label class="col-form-label">Invoice Date<span class="text-danger">*</span></label> <label class="col-form-label">Invoice Date<span class="text-danger">*</span></label>
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="InvoiceDate" name="InvoiceDate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off"> <input type="date" class="form-control" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="InvoiceDate" name="InvoiceDate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off">
<div class="input-group-append"> <!-- <input type="text" class="form-control" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="InvoiceDate" name="InvoiceDate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off"> -->
<!-- <div class="input-group-append">
<span class="input-group-text"> <span class="input-group-text">
<i class="ri-calendar-event-fill"></i> <i class="ri-calendar-event-fill"></i>
</span> </span>
</div> </div> -->
</div><!-- input-group --> </div><!-- input-group -->
<!-- <input type="date" class="form-control" id="invoiceDate" name="invoice_date" value="<?= isset($invoice_details['invoice_date']) ? $invoice_details['invoice_date'] : '' ?>" max="<?= date('d/m/Y'); ?>" required> --> <!-- <input type="date" class="form-control" id="invoiceDate" name="invoice_date" value="<?= isset($invoice_details['invoice_date']) ? $invoice_details['invoice_date'] : '' ?>" max="<?= date('d/m/Y'); ?>" required> -->
@ -158,12 +161,13 @@
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label class="col-form-label">Material Received Date<span class="text-danger">*</span></label> <label class="col-form-label">Material Received Date<span class="text-danger">*</span></label>
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="MaterialRcvdDate" name="MaterialRcvdDate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off"> <input type="date" class="form-control" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="MaterialRcvdDate" name="MaterialRcvdDate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off">
<!-- <input type="text" class="form-control" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="MaterialRcvdDate" name="MaterialRcvdDate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off">
<div class="input-group-append"> <div class="input-group-append">
<span class="input-group-text"> <span class="input-group-text">
<i class="ri-calendar-event-fill"></i> <i class="ri-calendar-event-fill"></i>
</span> </span>
</div> </div> -->
</div> </div>
<?php <?php
// $data = array('name' => 'MaterialRcvdDate', 'value' => set_value('MaterialRcvdDate'), 'id' => 'MaterialRcvdDate', 'class' => 'form-control num', 'required' => 'true', 'autocomplete' => 'off'); // $data = array('name' => 'MaterialRcvdDate', 'value' => set_value('MaterialRcvdDate'), 'id' => 'MaterialRcvdDate', 'class' => 'form-control num', 'required' => 'true', 'autocomplete' => 'off');
@ -172,7 +176,7 @@
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label class="col-form-label">Vechicle Number</label> <label class="col-form-label">Vechicle Number</label>
<?php <?php
@ -180,7 +184,7 @@
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label class="col-form-label">Transporter Name</label> <label class="col-form-label">Transporter Name</label>
<?php <?php
$option = array(0 => 'Transporter Name'); $option = array(0 => 'Transporter Name');
@ -193,14 +197,14 @@
?> ?>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label class="col-form-label">Driver Name</label> <label class="col-form-label">Driver Name</label>
<?php <?php
$data = array('name' => 'DriverName', 'value' => set_value('DriverName'), 'id' => 'DriverName', 'class' => 'form-control', 'maxlength' => '50', 'autocomplete' => 'off'); $data = array('name' => 'DriverName', 'value' => set_value('DriverName'), 'id' => 'DriverName', 'class' => 'form-control', 'maxlength' => '50', 'autocomplete' => 'off');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
<div class="form-group col-md-3"> <div class="form-group col-md-4">
<label class="col-form-label">Driver Mobile Number</label> <label class="col-form-label">Driver Mobile Number</label>
<?php <?php
$data = array('name' => 'DriverMobileNumber', 'value' => set_value('DriverMobileNumber'), 'id' => 'DriverMobileNumber', 'class' => 'form-control', 'maxlength' => '50', 'autocomplete' => 'off'); $data = array('name' => 'DriverMobileNumber', 'value' => set_value('DriverMobileNumber'), 'id' => 'DriverMobileNumber', 'class' => 'form-control', 'maxlength' => '50', 'autocomplete' => 'off');
@ -270,7 +274,7 @@
</div> </div>
<div id="weight-calc-modal" class="modal fade" tabindex="-1" role="dialog" <div id="weight-calc-modal" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;"> aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog"> <div class="modal-dialog modal-lg">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Weight Calculator<span id="WeightTitle"></span></h4> <h4 class="modal-title">Weight Calculator<span id="WeightTitle"></span></h4>
@ -722,75 +726,41 @@
} }
</script> </script>
<script> <script>
$("#weight-calc-modal").on("shown.bs.modal", function(e) { $(document).ready(function() {
var inx = $(e.relatedTarget).data('index'); $("#weight-calc-modal").on("shown.bs.modal", function(e) {
var material = $(e.relatedTarget).data('material'); var inx = $(e.relatedTarget).data('index');
var material = $(e.relatedTarget).data('material');
$('#WeightTitle').text(" ( " + material + " )"); $('#WeightTitle').text(" ( " + material + " )");
// Clear the modal inputs // Clear the modal inputs
$("#GrossWeight").val(''); $("#GrossWeight").val('');
$("#GrossWeightDate").val(''); $("#GrossWeightDate").val('');
$("#TareWeight").val(''); $("#TareWeight").val('');
$("#TareWeightDate").val(''); $("#TareWeightDate").val('');
$("#NetWeight").val(''); $("#NetWeight").val('');
// Retrieve values from hidden inputs // Retrieve values from hidden inputs
var v1 = $("#txtGrossWeight" + inx).val(); var v1 = $("#txtGrossWeight" + inx).val();
var v2 = $("#txtGrossWeightDate" + inx).val(); var v2 = $("#txtGrossWeightDate" + inx).val();
var v3 = $("#txtTareWeight" + inx).val(); var v3 = $("#txtTareWeight" + inx).val();
var v4 = $("#txtTareWeightDate" + inx).val(); var v4 = $("#txtTareWeightDate" + inx).val();
var v5 = $("#txtNetWeight" + inx).val(); var v5 = $("#txtNetWeight" + inx).val();
var fileInput = $("#txtWeightFile" + inx)[0]; var fileInput = $("#txtWeightFile" + inx)[0];
console.log("Selected values for index:", typeof inx, inx); console.log("Selected values for index:", typeof inx, inx);
// Set modal inputs with the retrieved values
$("#GrossWeight").val(v1);
$("#GrossWeightDate").val(v2);
$("#TareWeight").val(v3);
$("#TareWeightDate").val(v4);
$("#NetWeight").val(v5);
$("#CurrentInx").val(inx);
if (fileInput && fileInput.files.length > 0) {
var targetInput = $("#WeightFile")[0];
var file = fileInput.files[0];
// Create a new DataTransfer object
var dataTransfer = new DataTransfer();
dataTransfer.items.add(file);
// Set the file to the target input
targetInput.files = dataTransfer.files;
} else {
console.log("No file selected or file input not found.");
}
});
function modalSave() {
var v1 = $("#GrossWeight").val();
var v2 = $("#GrossWeightDate").val();
var v3 = $("#TareWeight").val();
var v4 = $("#TareWeightDate").val();
var v5 = $("#NetWeight").val();
var inx = $("#CurrentInx").val();
var fileInput = $("#WeightFile")[0]; // Get the file input element
if (inx !== undefined && inx !== '') {
console.log("Saving values for index:", inx);
// Set the values back to the hidden inputs
$("#txtGrossWeight" + inx).val(v1);
$("#txtGrossWeightDate" + inx).val(v2);
$("#txtTareWeight" + inx).val(v3);
$("#txtTareWeightDate" + inx).val(v4);
$("#txtNetWeight" + inx).val(v5);
// Set modal inputs with the retrieved values
$("#GrossWeight").val(v1);
$("#GrossWeightDate").val(v2);
$("#TareWeight").val(v3);
$("#TareWeightDate").val(v4);
$("#NetWeight").val(v5);
$("#CurrentInx").val(inx);
if (fileInput && fileInput.files.length > 0) { if (fileInput && fileInput.files.length > 0) {
var targetInput = $("#txtWeightFile" + inx)[0]; var targetInput = $("#WeightFile")[0];
var file = fileInput.files[0]; var file = fileInput.files[0];
// Create a new DataTransfer object // Create a new DataTransfer object
@ -803,22 +773,61 @@
} else { } else {
console.log("No file selected or file input not found."); console.log("No file selected or file input not found.");
} }
});
});
function modalSave() {
var v1 = $("#GrossWeight").val();
var v2 = $("#GrossWeightDate").val();
var v3 = $("#TareWeight").val();
var v4 = $("#TareWeightDate").val();
var v5 = $("#NetWeight").val();
var inx = $("#CurrentInx").val();
var fileInput = $("#WeightFile")[0]; // Get the file input element
console.log("inx");
console.log(inx);
if (inx !== undefined && inx !== '') {
console.log("Saving values for index:", inx);
// Set the values back to the hidden inputs
$("#txtGrossWeight" + inx).val(v1);
$("#txtGrossWeightDate" + inx).val(v2);
$("#txtTareWeight" + inx).val(v3);
$("#txtTareWeightDate" + inx).val(v4);
$("#txtNetWeight" + inx).val(v5);
if (fileInput && fileInput.files.length > 0) {
var targetInput = $("#txtWeightFile" + inx)[0];
var file = fileInput.files[0];
// Create a new DataTransfer object
var dataTransfer = new DataTransfer();
dataTransfer.items.add(file);
// Set the file to the target input
targetInput.files = dataTransfer.files;
} else {
console.log("No file selected or file input not found.");
}
// Clear modal inputs // Clear modal inputs
$("#GrossWeight").val(''); $("#GrossWeight").val('');
$("#GrossWeightDate").val(''); $("#GrossWeightDate").val('');
$("#TareWeight").val(''); $("#TareWeight").val('');
$("#TareWeightDate").val(''); $("#TareWeightDate").val('');
$("#NetWeight").val(''); $("#NetWeight").val('');
$("#WeightFile").val(''); $("#WeightFile").val('');
// Close the modal // Close the modal
$("#weight-calc-modal").modal('hide'); $("#weight-calc-modal").modal('hide');
} else { } else {
console.log("Saving values for index: " + inx + " undefined"); console.log("Saving values for index: " + inx + " undefined");
}
} }
}
</script> </script>
<script> <script>
function appendFilesFileds(data) { function appendFilesFileds(data) {
@ -867,4 +876,191 @@
"autoWidth": false "autoWidth": false
}); });
}); });
function yourFunctionName() {
removeHidden();
$("#IGRappend").empty();
$('#txtRowCount').val('');
var id = $('#PONO').val();
var status = '';
var isOpenOrder = 0;
if (id != '-1') {
// $('#content').loader('show');
var y = <?php echo json_encode($PO_NO, JSON_PRETTY_PRINT) ?>;
$.each(y, function(idx, obj) {
if (id == obj.PONO) {
var baseUrl = '<?php echo base_url(); ?>purchaseorder/CreatePOPrint';
var newUrl = baseUrl + '?PONO=' + obj.PONO + '&ReqType=' + obj.POType;
$('#printLink').attr('href', newUrl);
$("#po").val(obj.PONO);
$("#Sup").val(obj.SupplierName);
$("#hiddenIsOpenOrder").val(obj.IsOpenOrder);
isOpenOrder = parseInt(obj.IsOpenOrder ? obj.IsOpenOrder : "0", 2);
var formatted_IsOpenOrder = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? "" : "Open";
$('.help-block').text(formatted_IsOpenOrder);
var button_text_for_IGRDraftLink = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? "Save as Draft IGR" : "Save as Open IGR";
$('#IGRDraftLink').text(button_text_for_IGRDraftLink);
//$("#Add").val(obj.Address);
$("#del").val(obj.DeliveryDate);
//$("#ser").val(obj.ServiceDescription);
status = obj.status;
ostatus = obj.OGR_Status;
formatted_PODate = obj.formatted_PODate;
formatted_IsOpenOrder = obj.formatted_IsOpenOrder;
}
});
$.ajax({
data: {
id: id
},
type: "POST",
url: "<?php echo base_url() ?>GetIGRLineItemDetails",
success: function(data) {
// console.log(data);
// $('#content').loader('hide');
// alert(data);
var trHTML = '';
var j = 0;
var showTable = false;
$.each(JSON.parse(data), function(i, item) {
showTable = true;
if (showTable) {
i = i + 1;
j = j + 1;
trHTML += '<tr>' +
'<td align="right">' + j + '</td>' +
'<td name="MaterialName" id="MaterialCode" >' + item.MaterialCode + '</td>' +
'<td>' + item.MaterialName + '</td>' +
'<td name="UOM">' + item.UOM + '</td>' +
'<td name="Quantity1' + i + '" id="Quantity_1' + i + '">' + item.Quantity + '</td>' +
'<td name="ReceivedQuantity' + i + '" id="ReceivedQuantity' + i + '">' + item.ReceivedQuantity + '</td>' +
'<td name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + ((isOpenOrder === 0 || isNaN(isOpenOrder)) ? item.PendingQty : 0) + '</td>' +
'<td data-name="sel" ><input type="text" onchange="validateReceivedQuantity(' + i + ')"id="QuantityAsPerInvoice' + i + '" name="QuantityAsPerInvoice' + i + '" value="" onkeypress="return isNumberKey(event);" autocomplete="off"></td>' +
'<td><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" autocomplete="off"> </td>' +
'<td><a target="_blank" data-toggle="modal" data-target="#weight-calc-modal" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
'</tr>';
$('#txtRowCount').val(i);
$('<input>').attr({
type: 'hidden',
id: 'MaterialCode' + i,
value: item.MaterialCode,
name: 'MaterialCode' + i
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'txtQuantityAsPerInvoice' + i,
name: 'txtQuantityAsPerInvoice' + i
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'OrderedQuantity' + i,
value: item.Quantity,
name: 'OrderedQuantity' + i
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'txtReceivedQuantity' + i,
name: 'txtReceivedQuantity' + i,
value: item.ReceivedQuantity
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'txtRemarks' + i,
name: 'txtRemarks' + i
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'txtPendingQty' + i,
name: 'txtPendingQty' + i,
value: ((isOpenOrder === 0 || isNaN(isOpenOrder)) ? item.PendingQty : 0)
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'txtGrossWeight' + i,
value: item.GrossWeight,
name: 'txtGrossWeight' + i
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'txtGrossWeightDate' + i,
value: item.GrossWeightDate,
name: 'txtGrossWeightDate' + i
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'txtTareWeight' + i,
value: item.TareWeight,
name: 'txtTareWeight' + i
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'txtTareWeightDate' + i,
value: item.TareWeightDate,
name: 'txtTareWeightDate' + i
}).appendTo('form');
$('<input>').attr({
type: 'hidden',
id: 'txtNetWeight' + i,
value: item.NetWeight,
name: 'txtNetWeight' + i
}).appendTo('form');
$('<input>').attr({
type: 'file',
id: 'txtWeightFile' + i,
value: item.WeightFile,
name: 'txtWeightFile' + i,
style: 'display:none;' // This makes the input hidden
}).appendTo('form'); // Make sure the form has the id 'IGR'
if (item.PendingQty == 0.00) {
$('#QuantityAsPerInvoice' + i).attr('readonly', 'true');
}
$("#IGRLink").show();
} else {
if (JSON.parse(data).length == 1 && item.PendingQty == 0) {
$("#IGRLink").hide();
//alert('The Order is new completed!!');
}
}
});
$("#IGRappend").empty();
$('#IGRappend').append(trHTML);
}
});
if ((status == '<?php echo IGR_CREATED ?>' || status == '<?php echo MRIR_CREATED ?>' || status == '<?php echo MRIR_APPROVED ?>')) {
alert('The Order is completed!!');
$("#IGRLink").hide();
} else {
$("#IGRLink").show();
}
} else {
alert('Please Select the Purchase Order Number to Create IGR');
}
}
</script> </script>

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,19 @@ if (!empty($Emp)) {
} }
} }
?> ?>
<style>
.btn-soft-primary {
color: white;
background-color: rgb(42, 206, 150);
border-color: rgb(42, 206, 150);
}
.btn-soft-primary:hover {
background-color: rgb(32, 176, 130); /* Slightly darker shade for hover */
border-color: rgb(32, 176, 130);
}
</style>
<div class="content-page"> <div class="content-page">
<div class="content"> <div class="content">
<!-- Start Content--> <!-- Start Content-->

View File

@ -1,6 +1,6 @@
<style> <style>
.modal { .modal {
padding-right: 25% ! important; /* padding-right: 25% ! important; */
} }
.num { .num {
@ -8,7 +8,7 @@
} }
.modal-content { .modal-content {
width: 800px ! important; /* width: 800px ! important; */
} }
th { th {
@ -250,7 +250,7 @@
<!-- box closed here --> <!-- box closed here -->
<!-- Igr modal fade --> <!-- Igr modal fade -->
<div id="Igrshow" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div id="Igrshow" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog modal-xl">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -443,8 +443,8 @@
<!-- WeightCalculator modal fade --> <!-- WeightCalculator modal fade -->
<div id="WeightCalculator" class="modal fade" tabindex="-1" role="dialog" <div id="WeightCalculator" class="modal fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;"> aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog"> <div class="modal-dialog modal-lg">
<div class="modal-content"> <div class="modal-content" style="border: 1px solid #ddd; margin-top: 73px; box-shadow: 0 0 40px rgb(0 0 0 / 43%);">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Weight Calculator <span id="WeightTitle"></span></h4> <h4 class="modal-title">Weight Calculator <span id="WeightTitle"></span></h4>
<button type="button" class="close" data-dismiss="modal" <button type="button" class="close" data-dismiss="modal"
@ -570,189 +570,157 @@
<script> <script>
$("#Igrshow").on("shown.bs.modal", function(e) { $(document).ready(function() {
var inx = $(e.relatedTarget).data('id'); $("#Igrshow").on("shown.bs.modal", function(e) {
var igr = $(e.relatedTarget).data('userid'); console.log("hello");
var igrstatus = $(e.relatedTarget).data('igrstatus');
var inx = $(e.relatedTarget).data('id');
var igr = $(e.relatedTarget).data('userid');
var igrstatus = $(e.relatedTarget).data('igrstatus');
// alert(igrstatus); // alert(igrstatus);
var buttonContainer = $(".buttonContainer"); var buttonContainer = $(".buttonContainer");
var modal = $(this); // Reference to the modal itself var modal = $(this); // Reference to the modal itself
var invoiceDateInput = modal.find('#Invoice_Date'); var invoiceDateInput = modal.find('#Invoice_Date');
var invoiceNoInput = modal.find('#Invoice_No'); var invoiceNoInput = modal.find('#Invoice_No');
var MaterialRcvdDateInput = modal.find('#MaterialRcvdDate'); var MaterialRcvdDateInput = modal.find('#MaterialRcvdDate');
var VehicleNoInput = modal.find('#Vehicle_No'); var VehicleNoInput = modal.find('#Vehicle_No');
var TransporterIdInput = modal.find('#Transporter_Id'); var TransporterIdInput = modal.find('#Transporter_Id');
var DriverInput = modal.find('#Driver_Name'); var DriverInput = modal.find('#Driver_Name');
var DriverMobileNumberInput = modal.find('#DriverMobileNumber'); var DriverMobileNumberInput = modal.find('#DriverMobileNumber');
var MasterFileInput = modal.find('#MasterFile'); var MasterFileInput = modal.find('#MasterFile');
modal.find('#MasterFileLabel').hide(); modal.find('#MasterFileLabel').hide();
var userRole = "<?php echo (int)$userRole; ?>"; var userRole = "<?php echo (int)$userRole; ?>";
if (userRole != 1) { if (userRole != 1) {
if (igrstatus == "ST074") { if (igrstatus == "ST074") {
buttonContainer.find("#draftIGR, #generateIGR").css("display", "inline-block"); buttonContainer.find("#draftIGR, #generateIGR").css("display", "inline-block");
$(".a_tag_for_mrir").css("display", "block"); $(".a_tag_for_mrir").css("display", "block");
VehicleNoInput.prop('readonly', false); VehicleNoInput.prop('readonly', false);
DriverInput.prop('readonly', false); DriverInput.prop('readonly', false);
DriverMobileNumberInput.prop('readonly', false); DriverMobileNumberInput.prop('readonly', false);
MaterialRcvdDateInput.prop('readonly', false); MaterialRcvdDateInput.prop('readonly', false);
invoiceDateInput.prop('readonly', false); invoiceDateInput.prop('readonly', false);
invoiceNoInput.prop('readonly', false); invoiceNoInput.prop('readonly', false);
} else { } else {
buttonContainer.find("#draftIGR, #generateIGR").css("display", "none"); buttonContainer.find("#draftIGR, #generateIGR").css("display", "none");
$(".a_tag_for_mrir").css("display", "none"); $(".a_tag_for_mrir").css("display", "none");
VehicleNoInput.prop('readonly', true); VehicleNoInput.prop('readonly', true);
DriverInput.prop('readonly', true); DriverInput.prop('readonly', true);
DriverMobileNumberInput.prop('readonly', true); DriverMobileNumberInput.prop('readonly', true);
MaterialRcvdDateInput.prop('readonly', true); MaterialRcvdDateInput.prop('readonly', true);
invoiceDateInput.prop('readonly', true); invoiceDateInput.prop('readonly', true);
invoiceNoInput.prop('readonly', true); invoiceNoInput.prop('readonly', true);
}
} else {
$(".a_tag_for_mrir").css("display", "none");
if (igrstatus == "ST074") {
buttonContainer.find("#draftIGR, #generateIGR").css("display", "inline-block");
} else {
buttonContainer.find("#draftIGR").css("display", "none");
}
}
$("#tbleIGRAppend").empty();
$('#content').loader('show');
$.ajax({
data: {
id: igr
},
type: "POST",
url: "<?php echo base_url() ?>ViewIGRDetails",
success: function(data) {
// success:function(data) {
$('#content').loader('hide');
var parsedData = JSON.parse(data);
console.log(parsedData);
if (parsedData['details'].length === 0) {
console.log("No data available");
// Reset all relevant fields and table
$('#IgrshowTitle').text('');
$("#IGRNO1").val('');
$("#PONO1").val('');
$("#txtIGRLineItem").val('');
$('#printLink').attr('href', '#');
$('.help-block').text('');
$("#Vehicle_No").val('');
$("#Transporter_Id").val('');
$("#Driver_Name").val('');
$("#DriverMobileNumber").val('');
$("#IGRStatus").val('');
$("#PONo").val('');
$("#Supplier").val('');
$("#Add1").val('');
$("#Invoice_No").val('');
$("#Invoice_Date").val('');
$("#MaterialRcvdDate").val('');
$("#ser").val('');
$("#tbleIGRAppend").empty(); // Clear the table
// Hide the MasterFileLabel if no data
modal.find('#MasterFileLabel').hide();
return; // Exit the function early
} }
} else {
$(".a_tag_for_mrir").css("display", "none");
if (igrstatus == "ST074") {
buttonContainer.find("#draftIGR, #generateIGR").css("display", "inline-block");
} else {
buttonContainer.find("#draftIGR").css("display", "none");
}
}
var trIGRHTML = ''; $("#tbleIGRAppend").empty();
// $('#content').loader('show');
$.each(parsedData['details'], function(i, item) { $.ajax({
if (igr == item.IGRNO) { data: {
console.log(item); id: igr
$('#IgrshowTitle').text(" ( " + item.IGRNO + " ) "); },
$("#IGRNO1").val(item.IGRNO); type: "POST",
$("#PONO1").val(item.PONO); url: "<?php echo base_url() ?>ViewIGRDetails",
$("#txtIGRLineItem").val(item.IGRItemNo); success: function(data) {
var baseUrl = '<?php echo base_url(); ?>purchaseorder/CreatePOPrint'; // success:function(data) {
var newUrl = baseUrl + '?PONO=' + item.PONO + '&ReqType=' + item.POType; // $('#content').loader('hide');
$('#printLink').attr('href', newUrl); var parsedData = JSON.parse(data);
var isOpenOrder = parseInt(item.IsOpenOrder ? item.IsOpenOrder : "0", 2); console.log(parsedData);
console.log(item.IsOpenOrder); if (parsedData['details'].length === 0) {
console.log(isOpenOrder); console.log("No data available");
var formatted_IsOpenOrder = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? "" : "Open"; // Reset all relevant fields and table
$('.help-block').text(formatted_IsOpenOrder); $('#IgrshowTitle').text('');
var button_text_for_IGRDraft = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? "Save as Draft IGR" : "Save as Open IGR"; $("#IGRNO1").val('');
$('#draftIGR').text(button_text_for_IGRDraft); $("#PONO1").val('');
$("#hiddenIsOpenOrder").val(isOpenOrder); $("#txtIGRLineItem").val('');
$("#Vehicle_No").val(item.VehicleNo); $('#printLink').attr('href', '#');
$("#Transporter_Id").val(item.TransporterId); $('.help-block').text('');
$("#Driver_Name").val(item.DriverName); $("#Vehicle_No").val('');
$("#DriverMobileNumber").val(item.DriverMobileNumber); $("#Transporter_Id").val('');
$("#IGRStatus").val(item.IGRStatus); $("#Driver_Name").val('');
$("#PONo").val(item.PONO); $("#DriverMobileNumber").val('');
$("#Supplier").val(item.SupplierName); $("#IGRStatus").val('');
$("#Add1").val(item.Address); $("#PONo").val('');
$("#Invoice_No").val(item.DeliveryChellanOrInvoiceNo); $("#Supplier").val('');
console.log(typeof item.MasterFile); $("#Add1").val('');
$("#Invoice_No").val('');
$("#Invoice_Date").val('');
$("#MaterialRcvdDate").val('');
$("#ser").val('');
$("#tbleIGRAppend").empty(); // Clear the table
// Hide the MasterFileLabel if no data
modal.find('#MasterFileLabel').hide(); modal.find('#MasterFileLabel').hide();
if (typeof item.MasterFile == 'string') {
if (item.MasterFile !== null && item.MasterFile !== undefined && item.MasterFile.trim() !== "") { return; // Exit the function early
modal.find('#MasterFileLabel a').attr('href', '<?php echo base_url() ?>' + 'public/uploads/Igrfiles/' + item.MasterFile); }
modal.find('#MasterFileLabel a').attr('title', 'previously uploaded IGR Master File');
modal.find('#MasterFileLabel a').attr('target', '_blank'); var trIGRHTML = '';
modal.find('#MasterFileLabel a span').text('previously uploaded - ');
modal.find('#MasterFileLabel a small').text(item.MasterFile); $.each(parsedData['details'], function(i, item) {
modal.find('#MasterFileLabel').show(); if (igr == item.IGRNO) {
} console.log(item);
} else { $('#IgrshowTitle').text(" ( " + item.IGRNO + " ) ");
$("#IGRNO1").val(item.IGRNO);
$("#PONO1").val(item.PONO);
$("#txtIGRLineItem").val(item.IGRItemNo);
var baseUrl = '<?php echo base_url(); ?>purchaseorder/CreatePOPrint';
var newUrl = baseUrl + '?PONO=' + item.PONO + '&ReqType=' + item.POType;
$('#printLink').attr('href', newUrl);
var isOpenOrder = parseInt(item.IsOpenOrder ? item.IsOpenOrder : "0", 2);
console.log(item.IsOpenOrder);
console.log(isOpenOrder);
var formatted_IsOpenOrder = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? "" : "Open";
$('.help-block').text(formatted_IsOpenOrder);
var button_text_for_IGRDraft = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? "Save as Draft IGR" : "Save as Open IGR";
$('#draftIGR').text(button_text_for_IGRDraft);
$("#hiddenIsOpenOrder").val(isOpenOrder);
$("#Vehicle_No").val(item.VehicleNo);
$("#Transporter_Id").val(item.TransporterId);
$("#Driver_Name").val(item.DriverName);
$("#DriverMobileNumber").val(item.DriverMobileNumber);
$("#IGRStatus").val(item.IGRStatus);
$("#PONo").val(item.PONO);
$("#Supplier").val(item.SupplierName);
$("#Add1").val(item.Address);
$("#Invoice_No").val(item.DeliveryChellanOrInvoiceNo);
console.log(typeof item.MasterFile);
modal.find('#MasterFileLabel').hide(); modal.find('#MasterFileLabel').hide();
} if (typeof item.MasterFile == 'string') {
if (item.MasterFile !== null && item.MasterFile !== undefined && item.MasterFile.trim() !== "") {
// Format dates modal.find('#MasterFileLabel a').attr('href', '<?php echo base_url() ?>' + 'public/uploads/Igrfiles/' + item.MasterFile);
var dcd = new Date(item.DeliveryChellanDate); modal.find('#MasterFileLabel a').attr('title', 'previously uploaded IGR Master File');
var dcd2 = (String(dcd.getDate()).padStart(2, '0') + '-' + (String(dcd.getMonth() + 1).padStart(2, '0')) + '-' + dcd.getFullYear()); modal.find('#MasterFileLabel a').attr('target', '_blank');
$("#Invoice_Date").val(dcd2); modal.find('#MasterFileLabel a span').text('previously uploaded - ');
console.log(item.MaterialRcvdDate) modal.find('#MasterFileLabel a small').text(item.MasterFile);
var Mat_rcv_date = (item.MaterialRcvdDate == 'null') ? ' ' : formatDateTime(item.MaterialRcvdDate, 1); modal.find('#MasterFileLabel').show();
$("#MaterialRcvdDate").val(Mat_rcv_date); }
console.log(item.MaterialRcvdDate) } else {
var gross_rcv_date = (item.GrossWeightDate == 'null') ? ' ' : formatDateTime(item.GrossWeightDate, 2); modal.find('#MasterFileLabel').hide();
$("#ser").val(item.ServiceDescription);
i = i + 1;
// userrole is system admin also know as admin (if)
if (userRole == 1) {
$("#pendingQuantityHeader").css("display", "table-cell");
trIGRHTML += '<tr>' +
'<td style="width: 50px;" align="right">' + i + '</td>' +
'<td style="width: 100px;" name="MaterialName" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
'<td style="width: 200px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' +
'<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' +
'<td style="width: 100px;" align="right" id="Quantity' + i + '" name="Quantity">' + parseInt(item.Quantity) + '</td>' +
'<td style="width: 100px;" align="right" data-name="sel" ><input type="text" onchange="validateReceivedQuantity(' + i + ',' + isOpenOrder + ')"id="QuantityAsPerInvoice' + i + '" name="QuantityAsPerInvoice' + i + '" value="' + parseInt(item.QuantityAsPerInvoice) + '" onkeypress="return isNumberKey(event);" style="width: 75px;"></td>' +
'<td style="width: 100px;" name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + ((isOpenOrder) ? 0 : parseInt(item.Quantity - item.QuantityAsPerInvoice)) + '</td>' +
'<td style="width: 150px;"><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" style="width: 75px;"> </td>' +
'<td style="width: 50px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
'<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
'<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' +
'<input type="hidden" id="txtOrderedQuantity' + i + '" name="txtOrderedQuantity' + i + '" value="' + item.Quantity + '">' +
'<input type="hidden" id="txtGrossWeight' + i + '" name="txtGrossWeight' + i + '" value="' + item.GrossWeight + '">' +
'<input type="hidden" id="txtGrossWeightDate' + i + '" name="txtGrossWeightDate' + i + '" value="' + item.GrossWeightDate + '">' +
'<input type="hidden" id="txtTareWeight' + i + '" name="txtTareWeight' + i + '" value="' + item.TareWeight + '">' +
'<input type="hidden" id="txtTareWeightDate' + i + '" name="txtTareWeightDate' + i + '" value="' + item.TareWeightDate + '">' +
'<input type="hidden" id="txtNetWeight' + i + '" name="txtNetWeight' + i + '"value="' + item.NetWeight + '">' +
'<input type="hidden" id="txtRemarks' + i + '" name="txtRemarks' + i + '"value="' + item.Remarks + '">' +
'<input type="hidden" id="txtIGRLineItem' + i + '" name="txtIGRLineItem' + i + '"value="' + item.IGRItemNo + '">' +
'<input type="file" id="txtWeightFile' + i + '" name="txtWeightFile' + i + '"value="' + item.WeightFile + '" style="display:none;">' +
'<input type="hidden" id="txtWeightFileName' + i + '" name="txtWeightFileName' + i + '"value="' + item.WeightFile + '">' +
'</tr>';
if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) {
$('#QuantityAsPerInvoice' + i).attr('readonly', 'true');
} }
} // Format dates
// userrole is security based on status we show and here (else if) var dcd = new Date(item.DeliveryChellanDate);
else if (userRole !== 1) { var dcd2 = (String(dcd.getDate()).padStart(2, '0') + '-' + (String(dcd.getMonth() + 1).padStart(2, '0')) + '-' + dcd.getFullYear());
if (igrstatus === "ST074") { $("#Invoice_Date").val(dcd2);
console.log(item.MaterialRcvdDate)
var Mat_rcv_date = (item.MaterialRcvdDate == 'null') ? ' ' : formatDateTime(item.MaterialRcvdDate, 1);
$("#MaterialRcvdDate").val(Mat_rcv_date);
console.log(item.MaterialRcvdDate)
var gross_rcv_date = (item.GrossWeightDate == 'null') ? ' ' : formatDateTime(item.GrossWeightDate, 2);
$("#ser").val(item.ServiceDescription);
i = i + 1;
// userrole is system admin also know as admin (if)
if (userRole == 1) {
$("#pendingQuantityHeader").css("display", "table-cell"); $("#pendingQuantityHeader").css("display", "table-cell");
trIGRHTML += '<tr>' + trIGRHTML += '<tr>' +
@ -784,52 +752,88 @@
$('#QuantityAsPerInvoice' + i).attr('readonly', 'true'); $('#QuantityAsPerInvoice' + i).attr('readonly', 'true');
} }
} else { }
$("#pendingQuantityHeader").css("display", "none"); // userrole is security based on status we show and here (else if)
trIGRHTML += '<tr>' + else if (userRole !== 1) {
'<td style="width: 50px;" align="right">' + i + '</td>' + if (igrstatus === "ST074") {
'<td style="width: 100px;" name="MaterialName" id="MaterialCode" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' + $("#pendingQuantityHeader").css("display", "table-cell");
'<td style="width: 200px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' +
'<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' +
'<td style="width: 100px;" align="right" name="Quantity">' + item.Quantity + '</td>' +
'<td style="width: 100px;" align="right" data-name="sel" >' + item.QuantityAsPerInvoice + '</td>' +
'<td style="width: 150px;">' + item.Remarks + '</td>' +
'<td style="width: 50px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
'<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
'<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' +
'<input type="hidden" id="txtOrderedQuantity' + i + '" name="txtOrderedQuantity' + i + '" value="' + item.Quantity + '">' +
'<input type="hidden" id="txtGrossWeight' + i + '" name="txtGrossWeight' + i + '" value="' + item.GrossWeight + '">' +
'<input type="hidden" id="txtGrossWeightDate' + i + '" name="txtGrossWeightDate' + i + '" value="' + item.GrossWeightDate + '">' +
'<input type="hidden" id="txtTareWeight' + i + '" name="txtTareWeight' + i + '" value="' + item.TareWeight + '">' +
'<input type="hidden" id="txtTareWeightDate' + i + '" name="txtTareWeightDate' + i + '" value="' + item.TareWeightDate + '">' +
'<input type="hidden" id="txtNetWeight' + i + '" name="txtNetWeight' + i + '"value="' + item.NetWeight + '">' +
'<input type="hidden" id="txtRemarks' + i + '" name="txtRemarks' + i + '"value="' + item.Remarks + '">' +
'<input type="hidden" id="txtIGRLineItem' + i + '" name="txtIGRLineItem' + i + '"value="' + item.IGRItemNo + '">' +
'<input type="file" id="txtWeightFile' + i + '" name="txtWeightFile' + i + '"value="' + item.WeightFile + '">' +
'<input type="hidden" id="txtWeightFileName' + i + '" name="txtWeightFileName' + i + '"value="' + item.WeightFile + '">' +
'</tr>';
trIGRHTML += '<tr>' +
'<td style="width: 50px;" align="right">' + i + '</td>' +
'<td style="width: 100px;" name="MaterialName" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
'<td style="width: 200px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' +
'<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' +
'<td style="width: 100px;" align="right" id="Quantity' + i + '" name="Quantity">' + parseInt(item.Quantity) + '</td>' +
'<td style="width: 100px;" align="right" data-name="sel" ><input type="text" onchange="validateReceivedQuantity(' + i + ',' + isOpenOrder + ')"id="QuantityAsPerInvoice' + i + '" name="QuantityAsPerInvoice' + i + '" value="' + parseInt(item.QuantityAsPerInvoice) + '" onkeypress="return isNumberKey(event);" style="width: 75px;"></td>' +
'<td style="width: 100px;" name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + ((isOpenOrder) ? 0 : parseInt(item.Quantity - item.QuantityAsPerInvoice)) + '</td>' +
'<td style="width: 150px;"><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" style="width: 75px;"> </td>' +
'<td style="width: 50px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
'<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
'<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' +
'<input type="hidden" id="txtOrderedQuantity' + i + '" name="txtOrderedQuantity' + i + '" value="' + item.Quantity + '">' +
'<input type="hidden" id="txtGrossWeight' + i + '" name="txtGrossWeight' + i + '" value="' + item.GrossWeight + '">' +
'<input type="hidden" id="txtGrossWeightDate' + i + '" name="txtGrossWeightDate' + i + '" value="' + item.GrossWeightDate + '">' +
'<input type="hidden" id="txtTareWeight' + i + '" name="txtTareWeight' + i + '" value="' + item.TareWeight + '">' +
'<input type="hidden" id="txtTareWeightDate' + i + '" name="txtTareWeightDate' + i + '" value="' + item.TareWeightDate + '">' +
'<input type="hidden" id="txtNetWeight' + i + '" name="txtNetWeight' + i + '"value="' + item.NetWeight + '">' +
'<input type="hidden" id="txtRemarks' + i + '" name="txtRemarks' + i + '"value="' + item.Remarks + '">' +
'<input type="hidden" id="txtIGRLineItem' + i + '" name="txtIGRLineItem' + i + '"value="' + item.IGRItemNo + '">' +
'<input type="file" id="txtWeightFile' + i + '" name="txtWeightFile' + i + '"value="' + item.WeightFile + '" style="display:none;">' +
'<input type="hidden" id="txtWeightFileName' + i + '" name="txtWeightFileName' + i + '"value="' + item.WeightFile + '">' +
'</tr>';
if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) {
$('#QuantityAsPerInvoice' + i).attr('readonly', 'true');
}
} else {
$("#pendingQuantityHeader").css("display", "none");
trIGRHTML += '<tr>' +
'<td style="width: 50px;" align="right">' + i + '</td>' +
'<td style="width: 100px;" name="MaterialName" id="MaterialCode" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
'<td style="width: 200px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' +
'<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' +
'<td style="width: 100px;" align="right" name="Quantity">' + item.Quantity + '</td>' +
'<td style="width: 100px;" align="right" data-name="sel" >' + item.QuantityAsPerInvoice + '</td>' +
'<td style="width: 150px;">' + item.Remarks + '</td>' +
'<td style="width: 50px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
'<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
'<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' +
'<input type="hidden" id="txtOrderedQuantity' + i + '" name="txtOrderedQuantity' + i + '" value="' + item.Quantity + '">' +
'<input type="hidden" id="txtGrossWeight' + i + '" name="txtGrossWeight' + i + '" value="' + item.GrossWeight + '">' +
'<input type="hidden" id="txtGrossWeightDate' + i + '" name="txtGrossWeightDate' + i + '" value="' + item.GrossWeightDate + '">' +
'<input type="hidden" id="txtTareWeight' + i + '" name="txtTareWeight' + i + '" value="' + item.TareWeight + '">' +
'<input type="hidden" id="txtTareWeightDate' + i + '" name="txtTareWeightDate' + i + '" value="' + item.TareWeightDate + '">' +
'<input type="hidden" id="txtNetWeight' + i + '" name="txtNetWeight' + i + '"value="' + item.NetWeight + '">' +
'<input type="hidden" id="txtRemarks' + i + '" name="txtRemarks' + i + '"value="' + item.Remarks + '">' +
'<input type="hidden" id="txtIGRLineItem' + i + '" name="txtIGRLineItem' + i + '"value="' + item.IGRItemNo + '">' +
'<input type="file" id="txtWeightFile' + i + '" name="txtWeightFile' + i + '"value="' + item.WeightFile + '">' +
'<input type="hidden" id="txtWeightFileName' + i + '" name="txtWeightFileName' + i + '"value="' + item.WeightFile + '">' +
'</tr>';
}
} }
} }
}
});
$("#tbleIGRAppend").empty();
$("#tbleIGRAppend").append(trIGRHTML);
if (parsedData['files'].length !== 0) {
$.each(parsedData['files'], function(i, item) {
appendExistingFilesFileds(item)
}); });
$("#tbleIGRAppend").empty();
$("#tbleIGRAppend").append(trIGRHTML);
if (parsedData['files'].length !== 0) {
$.each(parsedData['files'], function(i, item) {
appendExistingFilesFileds(item)
});
}
} }
} });
}); });
}); });
</script> </script>
<script> <script>
$('#update').click(function() { $('#update').click(function() {
$('#content').loader('show'); // $('#content').loader('show');
var igrno = $("#IGRNO1").val(); var igrno = $("#IGRNO1").val();
var materialrcv_date = $("#MaterialRcvdDate").val(); var materialrcv_date = $("#MaterialRcvdDate").val();
var inv_date = $("#Invoice_Date").val(); var inv_date = $("#Invoice_Date").val();
@ -843,13 +847,13 @@
type: "POST", type: "POST",
url: "<?php echo base_url() ?>UpdateIGR", url: "<?php echo base_url() ?>UpdateIGR",
success: function(data) { success: function(data) {
$('#content').loader('hide'); // $('#content').loader('hide');
alert(data); alert(data);
} }
}); });
}); });
$('#draftIGR').click(function() { $('#draftIGR').click(function() {
$('#content').loader('show'); // $('#content').loader('show');
var igrno = $("#IGRNO1").val(); var igrno = $("#IGRNO1").val();
var pono = $("#PONO1").val(); var pono = $("#PONO1").val();
var status = 0; var status = 0;
@ -905,14 +909,14 @@
processData: false, processData: false,
contentType: false, contentType: false,
success: function(data) { success: function(data) {
$('#content').loader('hide'); // $('#content').loader('hide');
alert(data); alert(data);
location.reload(); location.reload();
} }
}); });
}); });
$('#generateIGR').click(function() { $('#generateIGR').click(function() {
$('#content').loader('show'); // $('#content').loader('show');
var igrno = $("#IGRNO1").val(); var igrno = $("#IGRNO1").val();
var pono = $("#PONO1").val(); var pono = $("#PONO1").val();
var status = 1; var status = 1;
@ -965,7 +969,7 @@
processData: false, processData: false,
contentType: false, contentType: false,
success: function(data) { success: function(data) {
$('#content').loader('hide'); // $('#content').loader('hide');
alert(data); alert(data);
location.reload(); location.reload();
} }
@ -1122,71 +1126,72 @@
$("#TareWeightDate").val($("#clock").text()); $("#TareWeightDate").val($("#clock").text());
} }
} }
$("#WeightCalculator").on("shown.bs.modal", function(e) { $(document).ready(function() {
var inx = $(e.relatedTarget).data('index'); $("#WeightCalculator").on("shown.bs.modal", function(e) {
console.log(inx); var inx = $(e.relatedTarget).data('index');
var material = $(e.relatedTarget).data('material'); console.log(inx);
var modal = $(this); var material = $(e.relatedTarget).data('material');
var modal = $(this);
$('#WeightTitle').text(" ( " + material + " )"); $('#WeightTitle').text(" ( " + material + " )");
// Clear the modal inputs // Clear the modal inputs
$("#GrossWeight").val(''); $("#GrossWeight").val('');
$("#GrossWeightDate").val(''); $("#GrossWeightDate").val('');
$("#TareWeight").val(''); $("#TareWeight").val('');
$("#TareWeightDate").val(''); $("#TareWeightDate").val('');
$("#NetWeight").val(''); $("#NetWeight").val('');
$("#WeightFile").val(''); $("#WeightFile").val('');
// Retrieve values from hidden inputs // Retrieve values from hidden inputs
var v1 = $("#txtGrossWeight" + inx).val(); var v1 = $("#txtGrossWeight" + inx).val();
var v2 = $("#txtGrossWeightDate" + inx).val(); var v2 = $("#txtGrossWeightDate" + inx).val();
var v3 = $("#txtTareWeight" + inx).val(); var v3 = $("#txtTareWeight" + inx).val();
var v4 = $("#txtTareWeightDate" + inx).val(); var v4 = $("#txtTareWeightDate" + inx).val();
var v5 = $("#txtNetWeight" + inx).val(); var v5 = $("#txtNetWeight" + inx).val();
var fileInput = $("#txtWeightFile" + inx)[0]; var fileInput = $("#txtWeightFile" + inx)[0];
var fileName = $("#txtWeightFileName" + inx).val(); var fileName = $("#txtWeightFileName" + inx).val();
modal.find('#WeightFileLabel').hide(); modal.find('#WeightFileLabel').hide();
console.log(typeof fileName); console.log(typeof fileName);
if (fileName !== 'null' && fileName !== undefined && fileName.trim() !== "") { if (fileName !== 'null' && fileName !== undefined && fileName.trim() !== "") {
modal.find('#WeightFileLabel a').attr('title', 'previously uploaded IGR Weight File'); modal.find('#WeightFileLabel a').attr('title', 'previously uploaded IGR Weight File');
modal.find('#WeightFileLabel a').attr('href', '<?php echo base_url() ?>' + 'public/uploads/Igrfiles/' + fileName); modal.find('#WeightFileLabel a').attr('href', '<?php echo base_url() ?>' + 'public/uploads/Igrfiles/' + fileName);
modal.find('#WeightFileLabel a').attr('target', '_blank'); modal.find('#WeightFileLabel a').attr('target', '_blank');
modal.find('#WeightFileLabel a span').text('previously uploaded - '); modal.find('#WeightFileLabel a span').text('previously uploaded - ');
modal.find('#WeightFileLabel a small').text(fileName); modal.find('#WeightFileLabel a small').text(fileName);
modal.find('#WeightFileLabel').show(); modal.find('#WeightFileLabel').show();
} }
console.log(fileInput); console.log(fileInput);
console.log("Selected values for index:", typeof inx, inx); console.log("Selected values for index:", typeof inx, inx);
// Set modal inputs with the retrieved values // Set modal inputs with the retrieved values
$("#GrossWeight").val(v1); $("#GrossWeight").val(v1);
$("#GrossWeightDate").val(v2); $("#GrossWeightDate").val(v2);
$("#TareWeight").val(v3); $("#TareWeight").val(v3);
$("#TareWeightDate").val(v4); $("#TareWeightDate").val(v4);
$("#NetWeight").val(v5); $("#NetWeight").val(v5);
$("#CurrentInx").val(inx); $("#CurrentInx").val(inx);
fileName fileName
if (fileInput && fileInput.files.length > 0) { if (fileInput && fileInput.files.length > 0) {
var targetInput = $("#WeightFile")[0]; var targetInput = $("#WeightFile")[0];
var file = fileInput.files[0]; var file = fileInput.files[0];
// Create a new DataTransfer object // Create a new DataTransfer object
var dataTransfer = new DataTransfer(); var dataTransfer = new DataTransfer();
dataTransfer.items.add(file); dataTransfer.items.add(file);
// Set the file to the target input // Set the file to the target input
targetInput.files = dataTransfer.files; targetInput.files = dataTransfer.files;
} else { } else {
console.log("No file selected or file input not found."); console.log("No file selected or file input not found.");
} }
});
}); });
function modalSave() { function modalSave() {
var v1 = $("#GrossWeight").val(); var v1 = $("#GrossWeight").val();
var v2 = $("#GrossWeightDate").val(); var v2 = $("#GrossWeightDate").val();
@ -1427,7 +1432,7 @@
formData.append('count', counter); formData.append('count', counter);
formData.append('igr', igr); formData.append('igr', igr);
$('.content').loader('show'); // $('.content').loader('show');
$.ajax({ $.ajax({
data: formData, data: formData,
type: "POST", type: "POST",
@ -1441,7 +1446,7 @@
billNo = chars[1] != undefined ? chars[1] : ""; billNo = chars[1] != undefined ? chars[1] : "";
alert('File uploaded successfully.'); alert('File uploaded successfully.');
addToTable(counter, billNo, file.name); addToTable(counter, billNo, file.name);
$('.content').loader('hide'); // $('.content').loader('hide');
$('#billModel').modal('hide'); $('#billModel').modal('hide');
} }
} }
@ -1600,6 +1605,7 @@ function appendExistingFilesFileds(data){
[10, 20, 30, 50, "All"] [10, 20, 30, 50, "All"]
], // Rows per page options ], // Rows per page options
responsive: true, // Responsive table responsive: true, // Responsive table
order: [ order: [
[0, 'desc'] [0, 'desc']
], // Default ordering (column index 0, ascending) ], // Default ordering (column index 0, ascending)