stock module-3 vadivel J 21-12-2024
This commit is contained in:
parent
7d4de6792f
commit
28cf1f49e6
@ -408,7 +408,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
<p><h4 style="color:grey;">No Drier machine details present for this month..!!</h4> </p>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
</div><!-- End table-responsive -->
|
||||
|
||||
@ -370,7 +370,7 @@
|
||||
<!-- calculateRow() for every td change below -->
|
||||
|
||||
<!-- 'td:eq(9)' -->
|
||||
<td class="celda_normal" id="totalSandQty">
|
||||
<td class="celda_normal" >
|
||||
<?php echo $record['Qty']??'0'; ?>
|
||||
</td>
|
||||
|
||||
@ -455,13 +455,14 @@
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(26)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<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"
|
||||
<td class="celda_normal" contenteditable="true" id="moistureActualId"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<?php echo $record['moistureActual']??'0.00'; ?>
|
||||
</td>
|
||||
@ -683,8 +684,15 @@
|
||||
<tr>
|
||||
<td style="text-align: left !important; width:25%;"><b>Moisture %</b></td>
|
||||
<td contenteditable="true" oninput="calculateRow()"
|
||||
id="dwnldMoistureId">10</td>
|
||||
id="dwnldMoistureActualId">10</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left !important; width:25%;"><b>Moisture Spec %</b></td>
|
||||
<td contenteditable="true" oninput="calculateRow()"
|
||||
id="dwnldMoistureSpecId">10</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@ -811,7 +819,7 @@
|
||||
<tr>
|
||||
<td style="text-align: right;" colspan="3"><strong> TOTAL </strong></td>
|
||||
<td class="text-right" id="dwnldWeighOfSand"></td>
|
||||
<td class="text-right" id="dwnldTotalId" colspan="2"><b></b></td>
|
||||
<td class="text-right" id="dwnldFtotalId" colspan="2"><b></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-right" colspan="4"><b>AFS </b></td>
|
||||
@ -871,22 +879,22 @@
|
||||
<input type="hidden" name="igrNo" id="igrNo" value="">
|
||||
<input type="hidden" name="materialCode" id="materialCode" value="">
|
||||
<input type="hidden" name="qty" id="qty" value="">
|
||||
<input type="hidden" class="form-control" name="10Mm" id="10Mm" value="0.00">
|
||||
<input type="hidden" class="form-control" name="20Mm" id="20Mm" value="0.00">
|
||||
<input type="hidden" class="form-control" name="30Mm" id="30Mm" value="0.00">
|
||||
<input type="hidden" class="form-control" name="40Mm" id="40Mm" value="0.00">
|
||||
<input type="hidden" class="form-control" name="50Mm" id="50Mm" value="0.00">
|
||||
<input type="hidden" class="form-control" name="70Mm" id="70Mm" value="0.00">
|
||||
<input type="hidden" class="form-control" name="100Mm" id="100Mm" value="0.00">
|
||||
<input type="hidden" class="form-control" name="140Mm" id="140Mm" value="0.00">
|
||||
<input type="hidden" class="form-control" name="200Mm" id="200Mm" value="0.00">
|
||||
<input type="hidden" class="form-control" name="300Mm" id="300Mm" value="0.00">
|
||||
<input type="hidden" class="form-control" name="pan" id="pan" value="0.00" >
|
||||
<input type="hidden" class="form-control" name="total" id="total" value="0.00" readonly>
|
||||
<input type="hidden" class="form-control" name="moistureSpec" id="moistureSpec" value="0.00">
|
||||
<input type="hidden" class="form-control" name="moistureActual" id="moistureActual" value="0.00">
|
||||
<input type="hidden" class="form-control" name="moistureLoss" id="moistureLoss" value="0.00" readonly>
|
||||
<input type="hidden" class="form-control" name="moistureLossQty" id="moistureLossQty" value="0.00" readonly>
|
||||
<input type="hidden" name="10Mm" id="10Mm" value="0.00">
|
||||
<input type="hidden" name="20Mm" id="20Mm" value="0.00">
|
||||
<input type="hidden" name="30Mm" id="30Mm" value="0.00">
|
||||
<input type="hidden" name="40Mm" id="40Mm" value="0.00">
|
||||
<input type="hidden" name="50Mm" id="50Mm" value="0.00">
|
||||
<input type="hidden" name="70Mm" id="70Mm" value="0.00">
|
||||
<input type="hidden" name="100Mm" id="100Mm" value="0.00">
|
||||
<input type="hidden" name="140Mm" id="140Mm" value="0.00">
|
||||
<input type="hidden" name="200Mm" id="200Mm" value="0.00">
|
||||
<input type="hidden" name="300Mm" id="300Mm" value="0.00">
|
||||
<input type="hidden" name="pan" id="pan" value="0.00" >
|
||||
<input type="hidden" name="total" id="total" value="0.00" >
|
||||
<input type="hidden" name="moistureSpec" id="moistureSpec" value="0.00">
|
||||
<input type="hidden" name="moistureActual" id="moistureActual" value="0.00">
|
||||
<input type="hidden" name="moistureLoss" id="moistureLoss" value="0.00" >
|
||||
<input type="hidden" name="moistureLossQty" id="moistureLossQty" value="0.00">
|
||||
<input type="hidden" name="plus20Loss" id="plus20Loss" value="">
|
||||
<input type="hidden" name="plus30Loss" id="plus30Loss" value="">
|
||||
<input type="hidden" name="sieveLossQty" id="sieveLossQty" value="">
|
||||
@ -908,8 +916,6 @@
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
|
||||
document.getElementById('pdfGenerateId').addEventListener('click', function () {
|
||||
// Get the content
|
||||
const content = document.getElementById("content").innerHTML;
|
||||
@ -934,7 +940,6 @@
|
||||
$('#downloadLabReportModel').modal('hide');
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@ -1040,12 +1045,14 @@
|
||||
let _300Mm = row.find('td:eq(19)').text().trim();
|
||||
let pan = row.find('td:eq(20)').text().trim();
|
||||
let total = row.find('td:eq(21)').text().trim();
|
||||
|
||||
let moistureSpec = row.find('td:eq(26)').text().trim();
|
||||
let moistureActual = row.find('td:eq(27)').text().trim();
|
||||
let moistureLoss = row.find('td:eq(28)').text().trim();
|
||||
let remark = row.find('.sand-status').val();
|
||||
|
||||
let materialCode = row.find('td:eq(33)').text().trim();
|
||||
|
||||
|
||||
|
||||
|
||||
// Fill the modal fields with the values
|
||||
@ -1125,11 +1132,12 @@
|
||||
|
||||
|
||||
$('#dwnldWeighOfSand').text(total);
|
||||
$('#dwnldMoistureId').text(moistureLoss);
|
||||
$('#dwnldMoistureActualId').text(moistureActual);
|
||||
$('#dwnldMoistureSpecId').text(moistureSpec);
|
||||
$('#dwnldAcceptedId').text("");
|
||||
$('#dwnldAcceptedUnderDeviationId').text("");
|
||||
$('#dwnldRejectedId').text("");
|
||||
$('#dwnldTotalId').text(fTotal);
|
||||
$('#dwnldFtotalId').text(fTotal);
|
||||
$('#dwnldAfsId').text(dwnldAfsId);
|
||||
|
||||
if(remark == "accepted"){
|
||||
@ -1175,8 +1183,8 @@
|
||||
let _140Mm = parseFloat($('#140Mm').val().trim());
|
||||
let _200Mm = parseFloat($('#200Mm').val().trim());
|
||||
let _300Mm = parseFloat($('#300Mm').val().trim());
|
||||
let pan = parseFloat($('#pan').val().trim());
|
||||
let total = parseFloat($('#total').val().trim());
|
||||
let pan = parseFloat($('#pan').val().trim());
|
||||
let total = parseFloat($('#total').val().trim());
|
||||
let plus20Loss = parseFloat($('#plus20Loss').val().trim());
|
||||
let plus30Loss = parseFloat($('#plus30Loss').val().trim());
|
||||
let moistureSpec = parseFloat($('#moistureSpec').val().trim());
|
||||
@ -1245,7 +1253,6 @@
|
||||
|
||||
let row = incomingSilicaSandDetailsData[index];
|
||||
|
||||
// Get the selected values from dropdowns
|
||||
row['Remark'] = $(this).find('.sand-status').val();
|
||||
row['Grade Condition'] = $(this).find('.grade-condition').val()
|
||||
|
||||
@ -1305,12 +1312,14 @@ function calculateRow(value){
|
||||
var tr = $(value).closest('tr');
|
||||
var weighOfSand = tr.find('td:eq(3)').text();
|
||||
var factor = tr.find('td:eq(4)').text();
|
||||
tr.find('td:eq(5)').text(weighOfSand * factor);
|
||||
tr.find('td:eq(5)').text(parseFloat((weighOfSand * factor).toFixed(2)));
|
||||
|
||||
|
||||
let result = table.tableToJSON();
|
||||
|
||||
let qty = $('#totalSandQty').val();
|
||||
let qty = parseFloat($('#dwnldQtyId').text());
|
||||
let moistureSpec = $('#dwnldMoistureSpecId').text();
|
||||
let moistureActual = $('#dwnldMoistureActualId').text();
|
||||
let totalWeighOfSand = 0;
|
||||
let totalFactoredValue = 0;
|
||||
let afs = 0 ;
|
||||
@ -1328,7 +1337,7 @@ function calculateRow(value){
|
||||
|
||||
newPlus30Loss += Number(result[i]['WEIGH OF SAND']) ;
|
||||
|
||||
newSieveLossQty = Math.floor((parseFloat(qty) * newPlus30Loss) / 100) ;
|
||||
newSieveLossQty = (parseFloat(qty) * newPlus30Loss) / 100 ;
|
||||
|
||||
}
|
||||
|
||||
@ -1336,33 +1345,58 @@ function calculateRow(value){
|
||||
totalFactoredValue += Number(result[i]['TOTAL']) ;
|
||||
afs = (Number(totalFactoredValue) / Number(totalWeighOfSand)).toFixed(2) ;
|
||||
|
||||
$('#dwnldWeighOfSand').text(totalWeighOfSand);
|
||||
$('#dwnldTotalId').text(totalFactoredValue);
|
||||
|
||||
|
||||
$('#dwnldWeighOfSand').text((totalWeighOfSand.toFixed(2)));
|
||||
$('#dwnldFtotalId').text((totalFactoredValue).toFixed(2));
|
||||
$('#dwnldAfsId').text(afs);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
let newMoistureLoss = parseFloat(moistureActual) - parseFloat(moistureSpec) ;
|
||||
let newMoistureLoss = parseFloat(moistureActual) - parseFloat(moistureSpec) ;
|
||||
|
||||
let newMoistureLossQty = Math.round((parseFloat(qty) * newMoistureLoss) / 100 ) ;
|
||||
let newMoistureLossQty = ((parseFloat(qty) * newMoistureLoss) / 100 ).toFixed(2) ;
|
||||
|
||||
let newSalableQty = Math.floor(parseFloat(qty) - newMoistureLossQty - newSieveLossQty) ;
|
||||
let newSalableQty = (parseFloat(qty) - newMoistureLossQty - newSieveLossQty).toFixed(2) ;
|
||||
|
||||
newSieveLossQty = (newSieveLossQty).toFixed(2);
|
||||
|
||||
console.log(totalWeighOfSand); //total
|
||||
console.log(totalFactoredValue);
|
||||
console.log(afs);
|
||||
console.log(newMoistureLoss);
|
||||
console.log("qty");
|
||||
console.log(qty);
|
||||
console.log(newMoistureLossQty);
|
||||
console.log(newSieveLossQty);
|
||||
console.log(newSalableQty);
|
||||
|
||||
$('#10Mm').val(result[0]['WEIGH OF SAND']);
|
||||
$('#20Mm').val(result[1]['WEIGH OF SAND']);
|
||||
$('#30Mm').val(result[2]['WEIGH OF SAND']);
|
||||
$('#40Mm').val(result[3]['WEIGH OF SAND']);
|
||||
$('#50Mm').val(result[4]['WEIGH OF SAND']);
|
||||
$('#70Mm').val(result[5]['WEIGH OF SAND']);
|
||||
$('#100Mm').val(result[6]['WEIGH OF SAND']);
|
||||
$('#140Mm').val(result[7]['WEIGH OF SAND']);
|
||||
$('#200Mm').val(result[8]['WEIGH OF SAND']);
|
||||
$('#300Mm').val(result[9]['WEIGH OF SAND']);
|
||||
$('#pan') .val(result[10]['WEIGH OF SAND']);
|
||||
$('#total').val(totalWeighOfSand);
|
||||
$('#plus20Loss').val(newPlus20Loss);
|
||||
$('#plus30Loss').val(newPlus30Loss);
|
||||
$('#moistureSpec').val(moistureSpec);
|
||||
$('#moistureActual').val(moistureActual);
|
||||
$('#moistureLoss').val(newMoistureLoss);
|
||||
$('#moistureLossQty').val(newMoistureLossQty);
|
||||
$('#sieveLossQty').val(newSieveLossQty);
|
||||
$('#salableQty').val(newSalableQty);
|
||||
|
||||
|
||||
|
||||
|
||||
return;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user