gas stock module changes -vadivel J

This commit is contained in:
vadivel J 2024-11-04 16:44:20 +05:30
parent 2a9204f6fd
commit 96b90d6de7
3 changed files with 57 additions and 17 deletions

View File

@ -325,7 +325,9 @@ class StockController extends BaseController
return $this->loadViews("bagStockDetails", $this->global, $data, NULL);
}
public function updateBagStockDetails(){}
public function updateBagStockDetails(){
}

View File

@ -245,7 +245,7 @@
<th class="celda_encabezado_general" style="display:none">Date</th>
<th class="celda_encabezado_general" style="display:none"> material</th>
<th class="celda_encabezado_general" style="display:none"> customer</th>
<th class="celda_encabezado_general">Opening</th>
<th class="celda_encabezado_general">Opening Stock</th>
<th class="celda_encabezado_general">Receipt</th>
<th class="celda_encabezado_general">Used</th>
<th class="celda_encabezado_general">Balance Stock</th>
@ -260,23 +260,27 @@
<?php if(!empty($groupedBagStockDetails))
{
//dd($groupedBagStockDetails);
foreach($groupedBagStockDetails as $index => $bagStockDetails){
foreach($groupedBagStockDetails as $groupedBagStockDetailsIndex => $bagStockDetails){
?>
<tr>
<?php foreach($bagStockDetails as $index => $bagStockDetail){ ?>
<?php if ($index === 0): ?>
<td class="celda_normal"><?= $bagStockDetail['date'] ?></td>
<?php foreach($bagStockDetails as $bagStockIndex => $bagStock){ ?>
<?php if ($bagStockIndex === 0): ?>
<td class="celda_normal"><?= $bagStock['date'] ?></td>
<?php endif; ?>
<td style="display:none"><?= $bagStockDetail['date']?></td>
<td style="display:none"><?= $bagStockDetail['materialCode']?></td>
<td style="display:none"><?= $bagStockDetail['customer']?></td>
<td class="celda_normal"
contenteditable="true"><?= $bagStockDetail['opening']?></td>
<td class="celda_normal"><?= $bagStockDetail['receipt']?></td>
<td style="display:none"><?= $bagStock['date']?></td>
<td style="display:none"><?= $bagStock['materialCode']?></td>
<td style="display:none"><?= $bagStock['customer']?></td>
<td class="celda_normal"
contenteditable="true"><?= $bagStockDetail['used']?></td>
<td class="celda_normal"><?= $bagStockDetail['balanceStock']?></td>
oninput="openingStockChange(this)"
contenteditable="true"><?= $bagStock['opening']?></td>
<td class="celda_normal"><?= $bagStock['receipt']?></td>
<td class="celda_normal"
oninput="usedStockChange(this)"
contenteditable="true"><?= $bagStock['used']?></td>
<td class="celda_normal"><?= $bagStock['balanceStock']?></td>
<?php } ?>
</tr>
@ -322,7 +326,7 @@
//table to json function
var updateBagStockDetails = tableToJSON();
var updateBagStockDetails = tableToJson();
$('#loader').show();
$.ajax({
@ -340,6 +344,16 @@
}
},
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();
}
});
@ -385,4 +399,18 @@
console.log(tableToJson());
</script>
</script>
<script>
function openingStockChange(tdElement){
alert('opening stock is changed');
console.log('New value:', tdElement);
}
function usedStockChange(tdElement) {
alert('Used Stock is changed');
console.log('New value:', tdElement);
}
</script>

View File

@ -528,7 +528,17 @@
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();
}
}
});