stock module latest today vadivel J 17-01-2025
This commit is contained in:
parent
fa40905de9
commit
0078d8471e
@ -899,7 +899,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
|||||||
var totalGasConsumption = $('#additionalEntryTotalGasConsumptionId').val();
|
var totalGasConsumption = $('#additionalEntryTotalGasConsumptionId').val();
|
||||||
var sandDriedQty = $('#additionalEntrySandDriedQtyId').val();
|
var sandDriedQty = $('#additionalEntrySandDriedQtyId').val();
|
||||||
if (totalGasConsumption != '' && sandDriedQty != '') {
|
if (totalGasConsumption != '' && sandDriedQty != '') {
|
||||||
var gasPerTon = parseFloat(totalGasConsumption) / parseFloat(sandDriedQty);
|
var gasPerTon = (parseFloat(totalGasConsumption) / parseFloat(sandDriedQty)).toFixed(2);
|
||||||
|
|
||||||
if (gasPerTon && gasPerTon != NaN && gasPerTon != Infinity)
|
if (gasPerTon && gasPerTon != NaN && gasPerTon != Infinity)
|
||||||
$('#additionalEntryGasPerTonId').val(gasPerTon);
|
$('#additionalEntryGasPerTonId').val(gasPerTon);
|
||||||
|
|||||||
@ -659,6 +659,14 @@ td {
|
|||||||
alert("Error");
|
alert("Error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
error : function (error){
|
||||||
|
console.log("Error occured ");
|
||||||
|
console.error(error);
|
||||||
|
},
|
||||||
|
complete(){
|
||||||
|
$('#loader').hide();
|
||||||
|
console.log("ajax call is completed..!!")
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@ -319,13 +319,29 @@
|
|||||||
<td class="celda_normal balanceStock"
|
<td class="celda_normal balanceStock"
|
||||||
data-id="<?=$gasStockDetail['date']?>"
|
data-id="<?=$gasStockDetail['date']?>"
|
||||||
><?=$gasStockDetail['balanceStock']??'0'?></td>
|
><?=$gasStockDetail['balanceStock']??'0'?></td>
|
||||||
<td class="celda_normal"><?=$gasStockDetail['drierMachineGasConsumption']??'0'?></td>
|
<td class="celda_normal tenTonGasConsumption"
|
||||||
<td class="celda_normal"><?=$gasStockDetail['sandDried']??'0'?></td>
|
data-id="<?=$gasStockDetail['date']?>"
|
||||||
<td class="celda_normal"><?=$gasStockDetail['coatingMachineGasconsumption']??'0'?></td>
|
><?=$gasStockDetail['drierMachineGasConsumption']??'0'?></td>
|
||||||
<td class="celda_normal"><?=$gasStockDetail['coatedSand']??'0'?></td>
|
<td class="celda_normal">
|
||||||
<td class="celda_normal"><?=$gasStockDetail['trpMachineGasconsumption']??'0'?></td>
|
<?=$gasStockDetail['sandDried']??'0'?></td>
|
||||||
<td class="celda_normal"><?=$gasStockDetail['sandTrp']??'0'?></td>
|
<td class="celda_normal coatingGasConsumption"
|
||||||
<td class="celda_normal"><?=$gasStockDetail['rotaryDrierMachineGasconsumption']??'0'?></td>
|
data-id="<?=$gasStockDetail['date']?>" >
|
||||||
|
<?=$gasStockDetail['coatingMachineGasconsumption']??'0'?></td>
|
||||||
|
<td class="celda_normal">
|
||||||
|
<?=$gasStockDetail['coatedSand']??'0'?></td>
|
||||||
|
<td class="celda_normal trpGasConsumption"
|
||||||
|
data-id="<?=$gasStockDetail['date']?>"
|
||||||
|
contenteditable="true" >
|
||||||
|
<?=$gasStockDetail['trpMachineGasconsumption']??'0'?></td>
|
||||||
|
<td class="celda_normal"
|
||||||
|
contenteditable="true" >
|
||||||
|
<?=$gasStockDetail['sandTrp']??'0'?>
|
||||||
|
</td>
|
||||||
|
<td class="celda_normal rotaryGasConsumption"
|
||||||
|
data-id="<?=$gasStockDetail['date']?>"
|
||||||
|
contenteditable="true" >
|
||||||
|
<?=$gasStockDetail['rotaryDrierMachineGasconsumption']??'0'?>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php }
|
<?php }
|
||||||
}else{
|
}else{
|
||||||
@ -390,13 +406,26 @@
|
|||||||
<td class="celda_normal balanceStock"
|
<td class="celda_normal balanceStock"
|
||||||
data-id="<?=$dateInMonth?>"
|
data-id="<?=$dateInMonth?>"
|
||||||
><?= $previousMonthGasStockDetails[0]['balanceStock'] ??'0' ?></td>
|
><?= $previousMonthGasStockDetails[0]['balanceStock'] ??'0' ?></td>
|
||||||
|
|
||||||
|
<td class="celda_normal tenTonGasConsumption"
|
||||||
|
data-id="<?=$dateInMonth?>"
|
||||||
|
>0</td>
|
||||||
<td class="celda_normal">0</td>
|
<td class="celda_normal">0</td>
|
||||||
|
<td class="celda_normal coatingGasConsumption"
|
||||||
|
data-id="<?=$dateInMonth?>"
|
||||||
|
>0</td>
|
||||||
<td class="celda_normal">0</td>
|
<td class="celda_normal">0</td>
|
||||||
<td class="celda_normal">0</td>
|
<td class="celda_normal trpGasConsumption"
|
||||||
<td class="celda_normal">0</td>
|
data-id="<?=$dateInMonth?>"
|
||||||
<td class="celda_normal">0</td>
|
contenteditable="true"
|
||||||
<td class="celda_normal">0</td>
|
>0</td>
|
||||||
<td class="celda_normal">0</td>
|
<td class="celda_normal"
|
||||||
|
contenteditable="true"
|
||||||
|
>0</td>
|
||||||
|
<td class="celda_normal rotaryGasConsumption"
|
||||||
|
data-id="<?=$dateInMonth?>"
|
||||||
|
contenteditable="true"
|
||||||
|
>0</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php }
|
<?php }
|
||||||
}?>
|
}?>
|
||||||
@ -660,6 +689,46 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function gasConsumptionChange(tdElement) {
|
||||||
|
|
||||||
|
try{
|
||||||
|
let dataId = tdElement.getAttribute('data-id');
|
||||||
|
let date = dataId;
|
||||||
|
|
||||||
|
//total gas consumption
|
||||||
|
let tenTonGasConsumption = document.querySelector(`td.tenTonGasConsumption[data-id="${dataId}"]`).innerText;
|
||||||
|
let coatingGasConsumption = document.querySelector(`td.coatingGasConsumption[data-id="${dataId}"]`).innerText;
|
||||||
|
let trpGasConsumption = document.querySelector(`td.trpGasConsumption[data-id="${dataId}"]`).innerText;
|
||||||
|
let rotaryGasConsumption = document.querySelector(`td.rotaryGasConsumption[data-id="${dataId}"]`).innerText;
|
||||||
|
|
||||||
|
let toatalGasConsumption = Number(tenTonGasConsumption) + Number (coatingGasConsumption) + Number(trpGasConsumption) + Number(rotaryGasConsumption) ;
|
||||||
|
|
||||||
|
|
||||||
|
//total gas purchase and opening addition
|
||||||
|
let openingStock = document.querySelector(`td.openingStock[data-id="${dataId}"]`).innerText;
|
||||||
|
let purchaseBharathStock = document.querySelector(`td.purchaseBharath[data-id="${dataId}"]`).innerText;
|
||||||
|
let purchaseIndianStock = document.querySelector(`td.purchaseIndian[data-id="${dataId}"]`).innerText;
|
||||||
|
|
||||||
|
let totalGas = (Number(openingStock) + Number(purchaseBharathStock)) + Number(purchaseIndianStock);
|
||||||
|
|
||||||
|
let currentBalanceStock = Number(totalGas) - ( Number(toatalGasConsumption) );
|
||||||
|
|
||||||
|
document.querySelector(`td.total[data-id="${dataId}"]`).innerText = totalGas;
|
||||||
|
document.querySelector(`td.balanceStock[data-id="${dataId}"]`).innerText = currentBalanceStock;
|
||||||
|
|
||||||
|
updateStockValue( date,currentBalanceStock )
|
||||||
|
|
||||||
|
} catch(error){
|
||||||
|
console.error("There is an error updating stock ..!!" + error);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@ -526,6 +526,9 @@ if (!empty($Emp)) {
|
|||||||
<script>
|
<script>
|
||||||
function Save() {
|
function Save() {
|
||||||
|
|
||||||
|
|
||||||
|
$('#loader').show();
|
||||||
|
|
||||||
var id = '<?php echo REQ_DRAFT; ?>'
|
var id = '<?php echo REQ_DRAFT; ?>'
|
||||||
if (validate()) {
|
if (validate()) {
|
||||||
if (document.getElementById('Items').rows.length < 0) {
|
if (document.getElementById('Items').rows.length < 0) {
|
||||||
@ -570,6 +573,14 @@ if (!empty($Emp)) {
|
|||||||
alert("Error");
|
alert("Error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function(error){
|
||||||
|
console.log("error occurred..!!")
|
||||||
|
console.error(error);
|
||||||
|
},
|
||||||
|
complete : function (){
|
||||||
|
$('#loader').hide();
|
||||||
|
console.log(" addNewRequisition - ajax call completed")
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -762,10 +773,14 @@ if (!empty($Emp)) {
|
|||||||
<script>
|
<script>
|
||||||
$(".requistion").submit(function(e) {
|
$(".requistion").submit(function(e) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// var id = '<?php //echo REQ_PENDING_APPROVAL;
|
// var id = '<?php //echo REQ_PENDING_APPROVAL;
|
||||||
?>' // don't delete 22/04/2022
|
?>' // don't delete 22/04/2022
|
||||||
var id = '<?php echo REQ_APPROVED; ?>'
|
var id = '<?php echo REQ_APPROVED; ?>'
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
|
||||||
if (validate()) {
|
if (validate()) {
|
||||||
if (document.getElementById('Items').rows.length < 0) {
|
if (document.getElementById('Items').rows.length < 0) {
|
||||||
alert('Please Select Line item to Create Requisition');
|
alert('Please Select Line item to Create Requisition');
|
||||||
@ -791,7 +806,10 @@ if (!empty($Emp)) {
|
|||||||
var servicePeriod = '';
|
var servicePeriod = '';
|
||||||
var noOfService = '';
|
var noOfService = '';
|
||||||
}
|
}
|
||||||
// $('#content').loader('show');
|
|
||||||
|
|
||||||
|
$('#loader').show();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: $('.requistion').serialize() + "&serviceSchedule=" + serviceSchedule + "&servicePeriod=" + servicePeriod + "&noOfService=" + noOfService + "&ID=" + id,
|
data: $('.requistion').serialize() + "&serviceSchedule=" + serviceSchedule + "&servicePeriod=" + servicePeriod + "&noOfService=" + noOfService + "&ID=" + id,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
@ -809,6 +827,14 @@ if (!empty($Emp)) {
|
|||||||
alert("Error");
|
alert("Error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function(error){
|
||||||
|
console.log("error occurred..!!");
|
||||||
|
console.error(error);
|
||||||
|
},
|
||||||
|
complete : function (){
|
||||||
|
$('#loader').hide();
|
||||||
|
console.log(" addNewRequisition - ajax call completed")
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user