629 lines
28 KiB
PHP
629 lines
28 KiB
PHP
|
|
<style type="text/css">
|
|
.num {
|
|
text-align: right;
|
|
}
|
|
|
|
.fht-table,
|
|
.fht-table thead,
|
|
.fht-table tfoot,
|
|
.fht-table tbody,
|
|
.fht-table tr,
|
|
.fht-table th,
|
|
.fht-table td {
|
|
margin: 0;
|
|
}
|
|
|
|
.fht-table td {
|
|
text-align: center;
|
|
}
|
|
|
|
.fht-table td:hover {
|
|
background-color: #00a65a;
|
|
color: #ffffff;
|
|
}
|
|
|
|
.fht-table {
|
|
border: 0 none;
|
|
height: auto;
|
|
width: auto;
|
|
border-collapse: collapse;
|
|
border-spacing: 0;
|
|
/*table-layout: fixed; Algoritmo de distribucion fijo */
|
|
white-space:nowrap;
|
|
}
|
|
|
|
.fht-table th,
|
|
.fht-table td {
|
|
overflow: hidden;
|
|
}
|
|
|
|
.fht-table-wrapper,
|
|
.fht-table-wrapper .fht-thead,
|
|
.fht-table-wrapper .fht-tfoot,
|
|
.fht-table-wrapper .fht-fixed-column .fht-tbody,
|
|
.fht-table-wrapper .fht-fixed-body .fht-tbody,
|
|
.fht-table-wrapper .fht-tbody {
|
|
overflow: hidden;
|
|
position: relative;
|
|
}
|
|
|
|
.fht-table-wrapper .fht-fixed-body .fht-tbody,
|
|
.fht-table-wrapper .fht-tbody {
|
|
overflow: auto;
|
|
}
|
|
|
|
.fht-table-wrapper .fht-table .fht-cell {
|
|
overflow: hidden;
|
|
height: 1px;
|
|
}
|
|
|
|
.fht-table-wrapper .fht-fixed-column,
|
|
.fht-table-wrapper .fht-fixed-body {
|
|
top: 0;
|
|
left: 0;
|
|
position: absolute;
|
|
}
|
|
|
|
.fht-table-wrapper .fht-fixed-column {
|
|
z-index: 1;
|
|
}
|
|
|
|
.fht-fixed-body .fht-thead table {
|
|
margin-right: 20px;
|
|
border: 0 none;
|
|
}
|
|
|
|
/*For Examples*/
|
|
|
|
.ContenedorTabla {
|
|
height: 500px;
|
|
margin: 0 auto;
|
|
overflow: auto;
|
|
width: auto;
|
|
position: relative;
|
|
}
|
|
|
|
.header,
|
|
.main {
|
|
display: inline-block;
|
|
height: auto;
|
|
width: 100%;
|
|
}
|
|
|
|
.titulosHeader {
|
|
border-bottom: 1px solid #e8bb25;
|
|
height: auto;
|
|
margin-bottom: 10px;
|
|
padding-bottom: 8px;
|
|
padding-top: 8px;
|
|
width: 100%;
|
|
}
|
|
|
|
|
|
.celda_encabezado_general {
|
|
background-color: #00a65a;
|
|
border: 1px solid #ccc;
|
|
color: #ffffff;
|
|
font-weight: bold;
|
|
padding: 2px 4px;
|
|
text-align: center;
|
|
}
|
|
|
|
._Separador {
|
|
background-color: #fff;
|
|
height: 12px;
|
|
border-left: 1px solid #ccc;
|
|
border-right: 1px solid #ccc;
|
|
width: 7px;
|
|
}
|
|
|
|
._Separador div {
|
|
width: 4px;
|
|
}
|
|
|
|
.celda_normal {
|
|
/*background-color: #fff;*/
|
|
/* <!-- ad9271 into ffffff brown-light to green-light --> */
|
|
border: 1px solid #ccc;
|
|
padding: 2px 4px;
|
|
}
|
|
|
|
/*style excel*/
|
|
.excel_cell {
|
|
border: 1px solid #CCC;
|
|
color: #222;
|
|
text-align: center;
|
|
font-size: 13px;
|
|
font-weight: normal;
|
|
padding: 4px;
|
|
white-space: pre-line;
|
|
empty-cells: show;
|
|
}
|
|
|
|
._cell_header {
|
|
background-color: #EEE;
|
|
}
|
|
|
|
._cell_Default {
|
|
background-color: #FFF;
|
|
text-align: left;
|
|
}
|
|
|
|
.excel_cell div {
|
|
width: 30px;
|
|
height: 20px;
|
|
}
|
|
|
|
.modal {
|
|
padding-right: 30% ! important;
|
|
}
|
|
</style>
|
|
<div class="content-page">
|
|
<div class="content">
|
|
<!-- Start Content-->
|
|
<div class="container-fluid">
|
|
<!-- start page title -->
|
|
<div>
|
|
<div class="row">
|
|
<div class="col-6">
|
|
<div class="page-title-box page-title-box-alt">
|
|
<div class="page-title-right">
|
|
<ol class="breadcrumb m-0">
|
|
<li class="breadcrumb-item"><a href="javascript: void(0);">Stocks</a></li>
|
|
<li class="breadcrumb-item active">
|
|
<h4 class="page-title">Incoming Silica Sand Details </h4>
|
|
</li>
|
|
</ol>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-6 text-right">
|
|
<!-- Right-aligned buttons or links can be added here -->
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
|
|
|
|
<form action="<?= base_url('incomingSilicaSandDetails'); ?>" method="post">
|
|
<div class="row">
|
|
|
|
<div class="col-3">
|
|
<?php $today = date('M-Y'); ?>
|
|
|
|
<input type="text" name="month" id="month" value="<?php echo "$month" ?>" class="form-control mt-2" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1">
|
|
|
|
</div>
|
|
<div class="form-group col-md-2">
|
|
<button type="submit" class="btn btn-success"> Change Month </button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
|
|
|
|
<!-- Add table-responsive for horizontal scroll -->
|
|
<div class="table-responsive">
|
|
<table id="incomingSilicaSandDetailsTable" class="fht-table table table-striped " >
|
|
<thead>
|
|
<tr>
|
|
|
|
<th class="celda_encabezado_general" style="padding: 10px;">S.NO </th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">IGR No </th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Invoice No</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Invoice Date</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Received Date</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Supplier Name</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Grade </th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Grade Condition</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Vehicle No</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Qty</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">___10___</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">___20___</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">___30___</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">___40___</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">___50___</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">___70___</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">___100___</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">___140___</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">___200___</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">___300___</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">PAN</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Total</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">AFS Spec</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">AFS Actual</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Plus 20 loss%</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Plus 30 Loss %</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Moisture % Spec</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Moisture Actual</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Moisture Loss</th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Moisture loss Qty </th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Sieve Loss Qty </th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Salable Qty </th>
|
|
<th class="celda_encabezado_general" style="padding: 10px;">Remark</th>
|
|
<th class="celda_encabezado_general" style="display:none;">MaterialCode</th>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
<tbody style="background-color: #fff;">
|
|
|
|
<?php $index = 0;
|
|
$row = 0;
|
|
foreach ($igrDetails as $record) {
|
|
$row++;
|
|
$index++; ?>
|
|
|
|
<tr id="<?php echo $row; ?>">
|
|
|
|
<!-- 'td:eq(0)' -->
|
|
<td class="celda_normal"><?php echo $index; ?></td>
|
|
|
|
<!-- 'td:eq(1)' -->
|
|
<td class="celda_normal">
|
|
<?php echo $record['IGRNO']??''; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(2)' -->
|
|
<td class="celda_normal" >
|
|
<?php echo $record['invoiceNo']??''; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(3)' -->
|
|
<td class="celda_normal" >
|
|
<?php
|
|
$dateString = $record['invoiceDate'];
|
|
$date = new DateTime($dateString);
|
|
$record['invoiceDate'] = $date->format('d-m-Y');
|
|
?>
|
|
<?php echo $record['invoiceDate']??''; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(4)' -->
|
|
<td class="celda_normal" >
|
|
<?php
|
|
$dateString = $record['materialRecievedDate'];
|
|
$date = new DateTime($dateString);
|
|
$record['materialRecievedDate'] = $date->format('d-m-Y');
|
|
?>
|
|
|
|
<?php echo $record['materialRecievedDate']??''; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(5)' -->
|
|
<td class="celda_normal">
|
|
<?php echo $record['SupplierName']??''; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(6)' -->
|
|
<td class="celda_normal" contenteditable="true" >
|
|
<?php echo $record['grade']??''; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(7)' -->
|
|
<td class="celda_normal" contenteditable="true" >
|
|
<?php echo $record['gradeCondition']??''; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(8)' -->
|
|
<td class="celda_normal" >
|
|
<?php echo $record['VehicleNo']??''; ?>
|
|
</td>
|
|
|
|
<!-- calculateRow() for every td change below -->
|
|
|
|
<!-- 'td:eq(9)' -->
|
|
<td class="celda_normal"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['Qty']??'0'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(10)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);" >
|
|
<?php echo $record['_10']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(11)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['_20']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(12)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['_30']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(13)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['_40']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(14)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['_50']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(15)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['_70']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(16)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['_100']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(17)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['_140']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(18)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['_200']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(19)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['_300']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(20)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['pan']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(21)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['total']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(22)' -->
|
|
<td class="celda_normal" contenteditable="true">
|
|
<?php echo $record['afsSpec']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(23)' -->
|
|
<td class="celda_normal" contenteditable="true">
|
|
<?php echo $record['afsActual']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(24)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['plus20Loss']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(25)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['plus30Loss']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(26)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['moistureSpec']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(27)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['moistureActual']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(28)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['moistureLoss']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(29)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['moistureLossQty']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(30)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['sieveLossQty']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(31)' -->
|
|
<td class="celda_normal" contenteditable="true"
|
|
onkeyup="calculateRow(this.parentNode.id);">
|
|
<?php echo $record['salableQty']??'0.00'; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(32)' -->
|
|
<td class="celda_normal" contenteditable="true">
|
|
<?php echo $record['Remarks']??''; ?>
|
|
</td>
|
|
|
|
<!-- 'td:eq(33)' -->
|
|
<td style="display: none;">
|
|
<?php echo $record['MaterialCode'] ?? ''; ?>
|
|
</td>
|
|
|
|
</tr>
|
|
<?php } ?>
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
<br>
|
|
|
|
|
|
</div><!-- End table-responsive -->
|
|
|
|
<br>
|
|
<?php if(empty($igrDetails)){ ?>
|
|
<h5 align="center" style="color:grey;">
|
|
No Inward Gate Registry created for incoming silica sand in this month
|
|
</h5>
|
|
<?php }?>
|
|
|
|
<div class="row">
|
|
<div class="col-md-12 text-right">
|
|
<input type="button" class="btn btn-success" id="save" value="save">
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div> <!-- End card-body -->
|
|
</div> <!-- End card -->
|
|
</div> <!-- End col -->
|
|
</div> <!-- End row -->
|
|
</div>
|
|
</div> <!-- End container-fluid -->
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
$(document).ready(function()
|
|
{
|
|
|
|
|
|
$('#save').click(function() {
|
|
|
|
var incomingSilicaSandDetailsData = $("#incomingSilicaSandDetailsTable").tableToJSON();
|
|
|
|
incomingSilicaSandDetailsData = JSON.stringify(incomingSilicaSandDetailsData);
|
|
|
|
$('#loader').show();
|
|
$.ajax({
|
|
data: {
|
|
incomingSilicaSandDetailsData
|
|
},
|
|
type: "POST",
|
|
url: "<?php echo base_url() ?>updateIncomingSilicaSandDetails",
|
|
|
|
success: function(data) {
|
|
if (data) {
|
|
$('#loader').hide();
|
|
|
|
alert(data);
|
|
|
|
},
|
|
error: function(xhr, status, error) {
|
|
|
|
alert("An error occurred while processing the request. Please try again.");
|
|
console.error("Error Code:", xhr.status);
|
|
console.error("Error Message:", error);
|
|
console.error("Response Text:", xhr.responseText);
|
|
},
|
|
complete: function() {
|
|
$('#loader').hide();
|
|
}
|
|
|
|
}
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
<script>
|
|
|
|
function calculateRow(rowId){
|
|
var tr=$(`#`+rowId);
|
|
var qty=tr.find('td:eq(9)').text();
|
|
var _10 = tr.find('td:eq(10)').text();
|
|
var _20 = tr.find('td:eq(11)').text();
|
|
var _30 = tr.find('td:eq(12)').text();
|
|
var _40 = tr.find('td:eq(13)').text();
|
|
var _50 = tr.find('td:eq(14)').text();
|
|
var _70 = tr.find('td:eq(15)').text();
|
|
var _100 = tr.find('td:eq(16)').text();
|
|
var _140 = tr.find('td:eq(17)').text();
|
|
var _200 = tr.find('td:eq(18)').text();
|
|
var _300 = tr.find('td:eq(19)').text();
|
|
var pan = tr.find('td:eq(20)').text();
|
|
var total = tr.find('td:eq(21)').text();
|
|
var afsSpec = tr.find('td:eq(22)').text();
|
|
var afsActual = tr.find('td:eq(23)').text();
|
|
var plus20Loss = tr.find('td:eq(24)').text();
|
|
var plus30Loss = tr.find('td:eq(25)').text();
|
|
var moistureSpec = tr.find('td:eq(26)').text();
|
|
var moistureActual = tr.find('td:eq(27)').text();
|
|
var moistureLoss = tr.find('td:eq(28)').text();
|
|
var moistureLossQty = tr.find('td:eq(29)').text();
|
|
var sieveLossQty = tr.find('td:eq(30)').text();
|
|
var salableQty = tr.find('td:eq(31)').text();
|
|
|
|
let newTotal =parseFloat(_10) +parseFloat(_20) +parseFloat(_30) +parseFloat(_40) +parseFloat(_50) +parseFloat(_70) +parseFloat(_100) +
|
|
parseFloat(_140) +parseFloat(_200) +parseFloat(_300) +parseFloat(pan);
|
|
//total td
|
|
tr.find('td:eq(21)').text(newTotal);
|
|
|
|
let newPlus20Loss = parseFloat(_10) +parseFloat(_20) ;
|
|
//plus20Loss td
|
|
tr.find('td:eq(24)').text(newPlus20Loss);
|
|
|
|
let newPlus30Loss = parseFloat(_10) +parseFloat(_20) + parseFloat(_30) ;
|
|
//plus30Loss td
|
|
tr.find('td:eq(25)').text(newPlus30Loss);
|
|
|
|
let newMoistureLoss = parseFloat(moistureActual) - parseFloat(moistureSpec) ;
|
|
//moistureLoss td
|
|
tr.find('td:eq(28)').text(newMoistureLoss);
|
|
|
|
let newMoistureLossQty = Math.round((parseFloat(qty) * newMoistureLoss) / 100 ) ;
|
|
//moistureLossqty td
|
|
tr.find('td:eq(29)').text(newMoistureLossQty.toLocaleString());
|
|
|
|
let newSieveLossQty = Math.floor((parseFloat(qty) * newPlus30Loss) / 100) ;
|
|
//sieveLossQty td
|
|
tr.find('td:eq(30)').text(newSieveLossQty.toLocaleString());
|
|
|
|
let newSalableQty = Math.floor(parseFloat(qty) - newMoistureLossQty - newSieveLossQty) ;
|
|
//salableQty td
|
|
tr.find('td:eq(31)').text(newSalableQty.toLocaleString());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|