stock module changes-1 vadivel J 11-12-2024
This commit is contained in:
parent
fb66a2468f
commit
4f4d2747e9
@ -461,7 +461,7 @@ $routes->match(['GET', 'POST', 'PUT', 'DELETE'], 'addOrEditPowerConsumptionDetai
|
||||
//incoming Silica Sand Detaails
|
||||
$routes->match(['GET', 'POST'], 'incomingSilicaSandDetails', 'StockController::loadView_incomingSilicaSandDetails');
|
||||
$routes->post('updateIncomingSilicaSandDetails', 'StockController::updateIncomingSilicaSandDetails');
|
||||
|
||||
$routes->post('updateLabReport','StockController::updateLabReport');
|
||||
|
||||
//Bag stock details
|
||||
$routes->match(['GET', 'POST'], 'bagStockDetails', 'StockController::loadView_bagStockDetails');
|
||||
|
||||
@ -334,12 +334,12 @@ class StockController extends BaseController
|
||||
|
||||
$incomingSilicaSandDetailsData = json_decode($postData['incomingSilicaSandDetailsData'], true);
|
||||
|
||||
$inserts = [];
|
||||
$updates = [];
|
||||
|
||||
foreach ($incomingSilicaSandDetailsData as $data) {
|
||||
|
||||
$IGRNO = $data['IGR No'];
|
||||
$materialCode = $data['MaterialCode'];
|
||||
|
||||
$id = $data['id'];
|
||||
|
||||
$dbData = [
|
||||
'igrNo_fk' => $data['IGR No'],
|
||||
@ -373,31 +373,81 @@ class StockController extends BaseController
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
$resultExists = $this->incomingSilicaSandDetails_model
|
||||
->where('igrNo_fk', $IGRNO)
|
||||
->where('materialCode', $materialCode)
|
||||
->where('id', $id)
|
||||
->first();
|
||||
|
||||
!empty($resultExists) ? $updates[] = $dbData : $inserts[] = $dbData;
|
||||
|
||||
|
||||
if (!empty($resultExists)) {
|
||||
}
|
||||
|
||||
$updated = $this->incomingSilicaSandDetails_model
|
||||
->where('igrNo_fk', $IGRNO)
|
||||
->where('materialCode', $materialCode)
|
||||
->set($dbData)
|
||||
->update();
|
||||
|
||||
} else {
|
||||
$inserted = $this->incomingSilicaSandDetails_model->insert($dbData);
|
||||
}
|
||||
if(!empty($updates)){
|
||||
$updated = $this->incomingSilicaSandDetails_model->updateBatch($updates,'id');
|
||||
}
|
||||
|
||||
if(!empty($inserts)){
|
||||
$inserted = $this->incomingSilicaSandDetails_model->insertBatch($inserts);
|
||||
}
|
||||
|
||||
echo "Data Saved Successfully";
|
||||
|
||||
}
|
||||
|
||||
public function updateLabReport(){
|
||||
|
||||
$postData = $this->request->getPost();
|
||||
|
||||
$id = $postData['id'];
|
||||
|
||||
$dbData = [
|
||||
'igrNo_fk' =>$postData['igrNo'],
|
||||
'materialCode' => $postData['materialCode'],
|
||||
'_10' => $postData['10Mm'],
|
||||
'_20' => $postData['20Mm'],
|
||||
'_30' => $postData['30Mm'],
|
||||
'_40' => $postData['40Mm'],
|
||||
'_50' => $postData['50Mm'],
|
||||
'_70' => $postData['70Mm'],
|
||||
'_100' => $postData['100Mm'],
|
||||
'_140' => $postData['140Mm'],
|
||||
'_200' => $postData['200Mm'],
|
||||
'_300' => $postData['300Mm'],
|
||||
'pan' => $postData['pan'],
|
||||
'total' => $postData['total'],
|
||||
'plus20loss' => $postData['plus20Loss'],
|
||||
'plus30Loss' => $postData['plus30Loss'],
|
||||
'moistureSpec' => $postData['moistureSpec'],
|
||||
'moistureActual' => $postData['moistureActual'],
|
||||
'moistureLoss' => $postData['moistureLoss'],
|
||||
'moistureLossQty'=> $postData['moistureLossQty'],
|
||||
'sieveLossQty' => $postData['sieveLossQty'],
|
||||
'salableQty' => $postData['salableQty'],
|
||||
|
||||
];
|
||||
|
||||
$resultExists = $this->incomingSilicaSandDetails_model
|
||||
->where('id', $id)
|
||||
->first();
|
||||
if($resultExists){
|
||||
$updated = $this->incomingSilicaSandDetails_model
|
||||
->update($id,$dbData);
|
||||
}else{
|
||||
$updated = $this->incomingSilicaSandDetails_model
|
||||
->insert($dbData);
|
||||
}
|
||||
|
||||
|
||||
if($updated){
|
||||
return redirect()->back()->with('success','Data Saved Successfully..!!');
|
||||
}else{
|
||||
return redirect()->back()->with('error','Error Saving Data..!!');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Bag Stock details starts
|
||||
public function loadView_bagStockDetails()
|
||||
|
||||
@ -1034,20 +1034,20 @@ class Inwardgateregister_model extends Model
|
||||
public function findIgrDetailsForIncomingSilicaSand($materialCodes, $month)
|
||||
{
|
||||
$builder = $this->db->table('t_igr_details')
|
||||
->select(
|
||||
't_igr_details.IGRNO,
|
||||
t_igr_details.Remarks,
|
||||
t_igr_details.MaterialCode,
|
||||
->select(
|
||||
't_igr_details.IGRNO,
|
||||
t_igr_details.Remarks,
|
||||
t_igr_details.MaterialCode,
|
||||
igrMast.DeliveryChellanOrInvoiceNo as invoiceNo,
|
||||
igrMast.DeliveryChellanDate as invoiceDate,
|
||||
igrMast.DeliveryChellanDate as invoiceDate,
|
||||
igrMast.MaterialRcvdDate as materialRecievedDate,
|
||||
igrMast.VehicleNo,
|
||||
supplierDetails.SupplierName,
|
||||
t_igr_details.QuantityAsPerInvoice as Qty,
|
||||
issd.* ')
|
||||
issd.*')
|
||||
->whereIn('t_igr_details.MaterialCode', $materialCodes)
|
||||
->like('t_igr_details.CreatedDate', $month, 'after')
|
||||
->groupBy('t_igr_details.IGRNO, t_igr_details.MaterialCode')
|
||||
->groupBy('t_igr_details.IGRNO, t_igr_details.MaterialCode')
|
||||
->join('t_igr_master igrMast', 'igrMast.IGRNO = t_igr_details.IGRNO')
|
||||
->join('t_incomingSilicaSandDetails issd',
|
||||
'issd.igrNo_fk = t_igr_details.IGRNO AND issd.materialCode = t_igr_details.MaterialCode','left')
|
||||
|
||||
@ -141,8 +141,7 @@ class Rawmaterialdetails_model extends Model
|
||||
function getAllSilicaRawMaterialCode(){
|
||||
|
||||
$builder = $this->db->table('t_materialmaster')
|
||||
->select('MaterialCode')
|
||||
->where('IsActive', 1)
|
||||
->select('MaterialCode')
|
||||
->like('LOWER(MaterialName)', 'silica sand')
|
||||
->orderBy('CreatedDate', 'desc');
|
||||
$query = $builder->get();
|
||||
|
||||
@ -730,7 +730,7 @@
|
||||
var row = $(this).closest('tr');
|
||||
|
||||
// Get values from the row
|
||||
|
||||
|
||||
var date = row.find('td:eq(0)').text().split('-');
|
||||
date=`${date[2]}-${date[1]}-${date[0]}`;
|
||||
var shift = row.find('td:eq(1)').text();
|
||||
|
||||
@ -155,9 +155,7 @@
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.modal {
|
||||
padding-right: 30% ! important;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
@ -185,6 +183,28 @@
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
helper('form');
|
||||
$error = session()->getFlashdata('error');
|
||||
if ($error) {
|
||||
?>
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<?php echo session()->getFlashdata('error'); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php
|
||||
$success = session()->getFlashdata('success');
|
||||
if ($success) {
|
||||
?>
|
||||
<div class="alert alert-info alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<?php echo session()->getFlashdata('success'); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@ -207,6 +227,9 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Add table-responsive for horizontal scroll -->
|
||||
@ -225,18 +248,18 @@
|
||||
<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="display:none">___10___</th>
|
||||
<th class="celda_encabezado_general" style="display:none">___20___</th>
|
||||
<th class="celda_encabezado_general" style="display:none">___30___</th>
|
||||
<th class="celda_encabezado_general" style="display:none">___40___</th>
|
||||
<th class="celda_encabezado_general" style="display:none">___50___</th>
|
||||
<th class="celda_encabezado_general" style="display:none">___70___</th>
|
||||
<th class="celda_encabezado_general" style="display:none">___100___</th>
|
||||
<th class="celda_encabezado_general" style="display:none">___140___</th>
|
||||
<th class="celda_encabezado_general" style="display:none">___200___</th>
|
||||
<th class="celda_encabezado_general" style="display:none">___300___</th>
|
||||
<th class="celda_encabezado_general" style="display:none">PAN</th>
|
||||
<th class="celda_encabezado_general" style="display:none">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>
|
||||
@ -244,11 +267,13 @@
|
||||
<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;">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>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Update Lab Report</th>
|
||||
<th class="celda_encabezado_general" style="display:none">id</th>
|
||||
|
||||
|
||||
|
||||
@ -260,6 +285,7 @@
|
||||
<?php $index = 0;
|
||||
$row = 0;
|
||||
foreach ($igrDetails as $record) {
|
||||
// dd($record);
|
||||
$row++;
|
||||
$index++; ?>
|
||||
|
||||
@ -322,80 +348,67 @@
|
||||
<!-- calculateRow() for every td change below -->
|
||||
|
||||
<!-- 'td:eq(9)' -->
|
||||
<td class="celda_normal"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td class="celda_normal">
|
||||
<?php echo $record['Qty']??'0'; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(10)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);" >
|
||||
<td style="display:none" >
|
||||
<?php echo $record['_10']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(11)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td style="display:none" >
|
||||
<?php echo $record['_20']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(12)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td style="display:none">
|
||||
<?php echo $record['_30']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(13)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td style="display:none">
|
||||
<?php echo $record['_40']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(14)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td style="display:none">
|
||||
<?php echo $record['_50']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(15)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td style="display:none">
|
||||
<?php echo $record['_70']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(16)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td style="display:none">
|
||||
<?php echo $record['_100']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(17)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td style="display:none">
|
||||
<?php echo $record['_140']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(18)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td style="display:none">
|
||||
<?php echo $record['_200']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(19)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td style="display:none">
|
||||
<?php echo $record['_300']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(20)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td style="display:none">
|
||||
<?php echo $record['pan']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(21)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td style="display:none">
|
||||
<?php echo $record['total']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
@ -410,14 +423,12 @@
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(24)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td class="celda_normal">
|
||||
<?php echo $record['plus20Loss']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(25)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td class="celda_normal">
|
||||
<?php echo $record['plus30Loss']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
@ -434,26 +445,22 @@
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(28)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td class="celda_normal">
|
||||
<?php echo $record['moistureLoss']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(29)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td class="celda_normal">
|
||||
<?php echo $record['moistureLossQty']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(30)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td class="celda_normal">
|
||||
<?php echo $record['sieveLossQty']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(31)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<td class="celda_normal">
|
||||
<?php echo $record['salableQty']??'0.00'; ?>
|
||||
</td>
|
||||
|
||||
@ -466,6 +473,17 @@
|
||||
<td style="display: none;">
|
||||
<?php echo $record['MaterialCode'] ?? ''; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(34)' -->
|
||||
<td class="celda_normal" style="color:#02d0eb; background:white;">
|
||||
<i
|
||||
class="fas fa-edit edit-lab-report" style="cursor:pointer;"></i>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(35)' -->
|
||||
<td style="display: none;">
|
||||
<?php echo $record['id'] ?? ''; ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
@ -506,9 +524,292 @@
|
||||
|
||||
|
||||
|
||||
<div class="modal fade" id="labReportModel" tabindex="-1" role="dialog" aria-labelledby="labReportModelLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-xl">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="labReportModelLabel">Sand Lab Report</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="<?php echo base_url('/updateLabReport')?>" method="POST">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="10Mm">10Mm</label>
|
||||
<input type="text" class="form-control" name="10Mm" id="10Mm" value="0.00">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="20Mm">20Mm</label>
|
||||
<input type="text" class="form-control" name="20Mm" id="20Mm" value="0.00">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="30Mm">30Mm</label>
|
||||
<input type="text" class="form-control" name="30Mm" id="30Mm" value="0.00">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="40Mm">40Mm</label>
|
||||
<input type="text" class="form-control" name="40Mm" id="40Mm" value="0.00">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="50Mm">50Mm</label>
|
||||
<input type="text" class="form-control" name="50Mm" id="50Mm" value="0.00">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="70Mm">70Mm</label>
|
||||
<input type="text" class="form-control" name="70Mm" id="70Mm" value="0.00">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="100Mm">100Mm</label>
|
||||
<input type="text" class="form-control" name="100Mm" id="100Mm" value="0.00">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="140Mm">140Mm</label>
|
||||
<input type="text" class="form-control" name="140Mm" id="140Mm" value="0.00">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="200Mm">200Mm</label>
|
||||
<input type="text" class="form-control" name="200Mm" id="200Mm" value="0.00">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="300Mm">300Mm</label>
|
||||
<input type="text" class="form-control" name="300Mm" id="300Mm" value="0.00">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="pan">Pan</label>
|
||||
<input type="text" class="form-control" name="pan" id="pan" value="0.00" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="total">Total</label>
|
||||
<input type="text" class="form-control" name="total" id="total" value="0.00" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="moistureSpec">Moisture % spec</label>
|
||||
<input type="text" class="form-control" name="moistureSpec" id="moistureSpec" value="0.00">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="moistureActual">Moisture Actual</label>
|
||||
<input type="text" class="form-control" name="moistureActual" id="moistureActual" value="0.00">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="moistureLoss">Moisture Loss </label>
|
||||
<input type="text" class="form-control" name="moistureLoss" id="moistureLoss" value="0.00" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="moistureLossQty">Moisture Loss Qty</label>
|
||||
<input type="text" class="form-control" name="moistureLossQty" id="moistureLossQty" value="0.00" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- hidden fields section -->
|
||||
<input type="hidden" name="id" id="issdId" value="">
|
||||
<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" name="plus20Loss" id="plus20Loss" value="">
|
||||
<input type="hidden" name="plus30Loss" id="plus30Loss" value="">
|
||||
<input type="hidden" name="sieveLossQty" id="sieveLossQty" value="">
|
||||
<input type="hidden" name="salableQty" id="salableQty" value="">
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="submit" class="btn btn-primary">Save changes</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('#incomingSilicaSandDetailsTable tbody').on('click', '.edit-lab-report', function () {
|
||||
|
||||
var row = $(this).closest('tr');
|
||||
|
||||
// Get values from the row
|
||||
|
||||
let igrNo = row.find('td:eq(1)').text().trim();
|
||||
let qty = row.find('td:eq(9)').text().trim();
|
||||
let _10Mm = row.find('td:eq(10)').text().trim();
|
||||
let _20Mm = row.find('td:eq(11)').text().trim();
|
||||
let _30Mm = row.find('td:eq(12)').text().trim();
|
||||
let _40Mm = row.find('td:eq(13)').text().trim();
|
||||
let _50Mm = row.find('td:eq(14)').text().trim();
|
||||
let _70Mm = row.find('td:eq(15)').text().trim();
|
||||
let _100Mm = row.find('td:eq(16)').text().trim();
|
||||
let _140Mm = row.find('td:eq(17)').text().trim();
|
||||
let _200Mm = row.find('td:eq(18)').text().trim();
|
||||
let _300Mm = row.find('td:eq(19)').text().trim();
|
||||
let total = row.find('td:eq(20)').text().trim();
|
||||
let pan = row.find('td:eq(21)').text().trim();
|
||||
let plus20loss = row.find('td:eq(24)').text().trim();
|
||||
let plus30Loss = row.find('td:eq(25)').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 moistureLossQty = row.find('td:eq(29)').text().trim();
|
||||
let sieveLossQty = row.find('td:eq(30)').text().trim();
|
||||
let salableQty = row.find('td:eq(31)').text().trim();
|
||||
let id = row.find('td:eq(35)').text().trim();
|
||||
|
||||
let materialCode = row.find('td:eq(33)').text().trim();
|
||||
|
||||
|
||||
|
||||
|
||||
// Fill the modal fields with the values
|
||||
|
||||
$('#igrNo').val(igrNo);
|
||||
$('#qty').val(qty);
|
||||
$('#10Mm').val(_10Mm);
|
||||
$('#20Mm').val(_20Mm);
|
||||
$('#30Mm').val(_30Mm);
|
||||
$('#40Mm').val(_40Mm);
|
||||
$('#50Mm').val(_50Mm);
|
||||
$('#70Mm').val(_70Mm);
|
||||
$('#100Mm').val(_100Mm);
|
||||
$('#140Mm').val(_140Mm);
|
||||
$('#200Mm').val(_200Mm);
|
||||
$('#300Mm').val(_300Mm);
|
||||
$('#pan') .val(pan);
|
||||
$('#total').val(total);
|
||||
$('#plus20loss').val(plus20loss);
|
||||
$('#plus30Loss').val(plus30Loss);
|
||||
$('#moistureSpec').val(moistureSpec);
|
||||
$('#moistureActual').val(moistureActual);
|
||||
$('#moistureLoss').val(moistureLoss);
|
||||
$('#moistureLossQty').val(moistureLossQty);
|
||||
$('#sieveLossQty').val(sieveLossQty);
|
||||
$('#salableQty').val(salableQty);
|
||||
|
||||
|
||||
$('#issdId').val(id);
|
||||
$('#materialCode').val(materialCode);
|
||||
|
||||
// Show the modal
|
||||
$('#labReportModel').modal('show');
|
||||
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('#10Mm , #20Mm, #30Mm, #40Mm, #50Mm, #70Mm, #100Mm, #1400Mm, #200Mm, #300Mm , #pan , #moistureSpec ,#moistureActual').change(function(){
|
||||
|
||||
let qty = parseFloat( $('#qty').val().trim());
|
||||
let _10Mm = parseFloat( $('#10Mm').val().trim());
|
||||
let _20Mm = parseFloat($('#20Mm').val().trim());
|
||||
let _30Mm = parseFloat($('#30Mm').val().trim());
|
||||
let _40Mm = parseFloat($('#40Mm').val().trim());
|
||||
let _50Mm = parseFloat($('#50Mm').val().trim());
|
||||
let _70Mm = parseFloat($('#70Mm').val().trim());
|
||||
let _100Mm = parseFloat($('#100Mm').val().trim());
|
||||
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 plus20Loss = parseFloat($('#plus20Loss').val().trim());
|
||||
let plus30Loss = parseFloat($('#plus30Loss').val().trim());
|
||||
let moistureSpec = parseFloat($('#moistureSpec').val().trim());
|
||||
let moistureActual = parseFloat($('#moistureActual').val().trim());
|
||||
let moistureLoss = parseFloat($('#moistureLoss').val().trim());
|
||||
let moistureLossQty = parseFloat($('#moistureLossQty').val().trim());
|
||||
let sieveLossQty = parseFloat($('#sieveLossQty').val().trim());
|
||||
let salableQty = parseFloat($('#salableQty').val().trim());
|
||||
|
||||
let newTotal = _10Mm + _20Mm + _30Mm + _40Mm + _50Mm + _70Mm + _100Mm + _140Mm + _200Mm + _300Mm + pan;
|
||||
|
||||
let newPlus20Loss = _10Mm + _20Mm ;
|
||||
|
||||
let newPlus30Loss = _10Mm + _20Mm + _30Mm ;
|
||||
|
||||
|
||||
let newSieveLossQty = Math.floor((qty * newPlus30Loss) / 100);
|
||||
|
||||
let newMoistureLoss = moistureActual - moistureSpec ;
|
||||
|
||||
let newMoistureLossQty = Math.round((qty * newMoistureLoss) / 100 ) ;
|
||||
|
||||
let newSalableQty = Math.floor(qty - newMoistureLossQty - newSieveLossQty);
|
||||
|
||||
|
||||
|
||||
|
||||
$('#total').val(newTotal);
|
||||
$('#plus20loss').val(newPlus20Loss);
|
||||
$('#plus30Loss').val(newPlus30Loss);
|
||||
$('#moistureSpec').val(moistureSpec);
|
||||
$('#moistureActual').val(moistureActual);
|
||||
$('#moistureLoss').val(newMoistureLoss);
|
||||
$('#moistureLossQty').val(newMoistureLossQty);
|
||||
$('#sieveLossQty').val(newSieveLossQty);
|
||||
$('#salableQty').val(newSalableQty);
|
||||
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
@ -536,7 +837,8 @@
|
||||
|
||||
alert(data);
|
||||
|
||||
},
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
|
||||
alert("An error occurred while processing the request. Please try again.");
|
||||
@ -548,7 +850,7 @@
|
||||
$('#loader').hide();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user