stock module latest today vadivel J 01-02-2025

This commit is contained in:
vadivelJ96 2025-02-01 18:02:56 +05:30
parent 66b2d51d2a
commit 2d36c76f6d
6 changed files with 187 additions and 109 deletions

View File

@ -1164,6 +1164,7 @@ class Inwardgateregister_model extends Model
t_igr_details.QuantityAsPerInvoice as Qty,
issd.*')
->whereIn('t_igr_details.MaterialCode', $materialCodes)
->where('t_igr_details.QuantityAsPerInvoice <>', 0)
->like('t_igr_details.CreatedDate', $month, 'after');
// remark needed for those who selected any remark.

View File

@ -115,7 +115,7 @@
.celda_encabezado_general {
background-color: #00a65a;
background-color:rgb(80, 187, 217); /* blue background */
border: 1px solid #ccc;
color: #ffffff;
font-weight: bold;
@ -123,6 +123,10 @@
text-align: center;
min-width: 120px;
max-width: 120px;
white-space: normal; /* Allows text to wrap */
word-wrap: break-word; /* Breaks long words if needed */
text-align: center; /* Centers text for better alignment */
max-width: 150px; /* Set a max width to control wrapping */
}
.celda_encabezado_total {
@ -191,7 +195,7 @@
position: sticky;
left: 0;
top: 0;
background-color: #00a65a;
background-color:rgb(80, 187, 217); /* blue background */
z-index: 7!important;
border-right: 2px solid #ddd;
color: #ffffff;
@ -202,10 +206,11 @@
{
position: sticky;
left: 0;
background-color: #00a65a;
background-color:rgb(80, 187, 217); /* blue background */
z-index: 2;
border-right: 2px solid #ddd;
color: #ffffff;
}
.table-responsive {
@ -474,7 +479,7 @@
<!-- Modal -->
<div class="modal fade" id="coatingMachineDetailModal" tabindex="-1" role="dialog"
aria-labelledby="coatingMachineDetailModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl" style="width:1060px !important ;" role="document">
<div class="modal-dialog modal-lg" style="width:1060px !important ;" role="document">
<div class="modal-content">
<div class="modal-header">
@ -491,16 +496,22 @@
<div class="modal-body">
<div class="form-row">
<!-- date -->
<div class="form-group col-md-3">
<label for="dateId">Date</label>
<span class="badge mandatory">*</span>
<input type="date" class="form-control" id="dateId" name="date" value="" required>
</div>
<!-- shift -->
<div class="form-group col-md-3">
<label for="shiftId">Shift</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="shiftId" name="shift" value="" required>
</div>
<!-- machine on time -->
<div class="form-group col-md-3">
<label for="machineOnTimeHrId">Machine On Time</label>
<span class="badge mandatory">*</span>
@ -538,8 +549,7 @@
</div>
<!-- machine off time -->
<div class="form-group col-md-3">
<label for="machineOffTimeHrId">Machine Off Time</label>
<span class="badge mandatory">*</span>
@ -573,42 +583,14 @@
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-3">
<label for="customerNameId">Customer Name</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="customerNameId" name="customerName" value=""
required>
</div>
<div class="form-group col-md-3">
<label for="totalCoatingId">Total Coating</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalCoatingId" name="totalCoating" value=""
required>
</div>
<div class="form-group col-md-3">
<label for="totalCoatingSandId">Total Coating Sand (in Kg)</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalCoatingSandId" name="totalCoatingSandInKg"
value="" required>
</div>
<div class="form-group col-md-3">
<label for="totalGasConsumptionId">Total Gas Consumption</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalGasConsumptionId"
name="totalGasConsumption" value="" required>
</div>
</div>
<div class="form-row">
<!-- Total hours -->
<div class="form-group col-md-3">
<label for="machineRunningInHrsId"> Machine Running In Hrs</label>
<span class="badge mandatory">*</span>
@ -617,14 +599,52 @@
</div>
<!-- customer name -->
<div class="form-group col-md-3">
<label for="perHourGasConsumptionId">Per Hour Gas Consumption </label>
<label for="customerNameId">Customer Name</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="perHourGasConsumptionId"
name="perHourGasConsumption" required>
<input type="text" class="form-control" id="customerNameId" name="customerName" value=""
required>
</div>
<!-- grade -->
<div class="form-group col-md-3">
<label for="totalCoatingId">grade</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalCoatingId" name="totalCoating" value=""
required>
</div>
<!-- total coating as renamed to total production -->
<div class="form-group col-md-3">
<label for="totalCoatingId">Total Production</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalCoatingId" name="totalCoating" value=""
required>
</div>
</div>
<div class="form-row">
<!-- total coating sand in kg -->
<div class="form-group col-md-3">
<label for="totalCoatingSandId">Total Coating Sand (in Kg)</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalCoatingSandId" name="totalCoatingSandInKg"
value="" required>
</div>
<!-- total gas consumption -->
<div class="form-group col-md-3">
<label for="totalGasConsumptionId">Total Gas Consumption</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalGasConsumptionId"
name="totalGasConsumption" value="" required>
</div>
<!-- per hour Coating sand qty -->
<div class="form-group col-md-3">
<label for="perHourCoatingSandQTY">Per Hour Coating Sand QTY</label>
<span class="badge mandatory">*</span>
@ -633,8 +653,32 @@
</div>
<!-- per hour gas consumption -->
<div class="form-group col-md-3">
<label for="perHourGasConsumptionId">Per Hour Gas Consumption </label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="perHourGasConsumptionId"
name="perHourGasConsumption" required>
</div>
</div>
<div class="form-row">
<!-- batch card file upload -->
<div class="form-group col-md-3">
<label for="totalCoatingSandId">upload batch card</label>
<span class="badge mandatory">*</span>
<input type="text" class="form-control" id="totalCoatingSandId" name="totalCoatingSandInKg"
value="" required>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>

View File

@ -854,7 +854,7 @@
let currentBalanceStock = (Number(openingStock) + Number(receiptStock)) - Number(usedStock);
document.querySelector(`td.balanceStock[data-id="${dataId}"]`).innerText = ccurrentBalanceStock == 0 ? " " : currentBalanceStock ;
document.querySelector(`td.balanceStock[data-id="${dataId}"]`).innerText = currentBalanceStock == 0 ? " " : currentBalanceStock ;
updateStockValue( date,materialCode,currentBalanceStock )

View File

@ -264,7 +264,7 @@ foreach ($period as $day) {
<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">Diesel Machine Stock Details </h4>
<h4 class="page-title">Diesel - Factory Vehicle </h4>
</li>
</ol>
</div>
@ -1021,7 +1021,7 @@ foreach ($period as $day) {
let runningHours = Math.abs(Number(closingReading) - Number(openingReading));
let mileage = consumption == 0 || runningHours == 0 ? 0 : (Number(consumption) / Number(runningHours)).toFixed(2) ;
document.querySelector(`td.runningHours[data-id="${dataId}"]`).innerText = runningHours;
document.querySelector(`td.runningHours[data-id="${dataId}"]`).innerText = (runningHours).toFixed(2);
document.querySelector(`td.mileage[data-id="${dataId}"]`).innerText = mileage;
@ -1046,7 +1046,7 @@ foreach ($period as $day) {
let runningHours = Math.abs(Number(closingReading) - Number(openingReading));
let mileage = consumption == 0 || runningHours == 0 ? 0 : (Number(consumption) / Number(runningHours)).toFixed(2) ;
document.querySelector(`td.runningHours[data-id="${dataId}"]`).innerText = runningHours;
document.querySelector(`td.runningHours[data-id="${dataId}"]`).innerText = (runningHours).toFixed(2);
document.querySelector(`td.mileage[data-id="${dataId}"]`).innerText = mileage;
updateStockValue(date, machine_id, closingReading)
@ -1071,7 +1071,7 @@ foreach ($period as $day) {
let runningHours = Math.abs(Number(closingReading) - Number(openingReading));
let mileage = consumption == 0 || runningHours == 0 ? 0 : (Number(consumption) / Number(runningHours)).toFixed(2) ;
document.querySelector(`td.runningHours[data-id="${dataId}"]`).innerText = runningHours;
document.querySelector(`td.runningHours[data-id="${dataId}"]`).innerText = (runningHours).toFixed(2);
document.querySelector(`td.mileage[data-id="${dataId}"]`).innerText = mileage;
updateStockValue(date, machine_id, closingReading)
@ -1247,7 +1247,7 @@ foreach ($period as $day) {
let mileage = consumption == 0 || runningHours == 0 ? 0 : (Number(consumption) / Number(runningHours)).toFixed(2) ;
document.querySelector(`td.runningHours[data-id="${dataId}"]`).innerText = runningHours == 0 ? " " : runningHours ;
document.querySelector(`td.runningHours[data-id="${dataId}"]`).innerText = runningHours == 0 ? " " : (runningHours).toFixed(2) ;
document.querySelector(`td.mileage[data-id="${dataId}"]`).innerText = mileage == 0 ? " " : mileage ;

View File

@ -352,14 +352,14 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<th class="celda_encabezado_general" style="padding:5px;">Running Hrs</th>
<th class="celda_encabezado_general" style="padding:5px;">Supplier Name</th>
<th class="celda_encabezado_general" style="padding:5px;">Input Sand Qty</th>
<th class="celda_encabezado_general" style="padding:5px;">Input Sand Qty (Metric Ton)</th>
<th class="celda_encabezado_general" style="padding:5px;">Input Sand Moisture(%)</th>
<th class="celda_encabezado_general" style="padding:5px;">Sand Dried Qty</th>
<th class="celda_encabezado_general" style="padding:5px;">Sand Dried Qty (Metric Ton)</th>
<th class="celda_encabezado_general" style="padding:5px;">Total Gas Consumption</th>
<th class="celda_encabezado_general" style="padding:5px;">Gas Per Ton</th>
<th class="celda_encabezado_general" style="padding:5px;">Qty Per Hrs</th>
<th class="celda_encabezado_general" style="padding:5px;">Moisture Loss Qty</th>
<th class="celda_encabezado_general" style="padding:5px;">Dust Qty</th>
<th class="celda_encabezado_general" style="padding:5px;">Qty Per Hrs (Metric Ton)</th>
<th class="celda_encabezado_general" style="padding:5px;">Moisture Loss Qty (Metric Ton)</th>
<th class="celda_encabezado_general" style="padding:5px;">Dust Qty (Metric Ton)</th>
<th class="celda_encabezado_general" style="padding:5px;">Customer Name</th>
<th class="celda_encabezado_general" style="display:none;">id</th>
@ -450,7 +450,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<td class="celda_normal" oninput="gasPerTon(this);
moistureLossQty(this);
qtyPerHrs(this)" contenteditable="true">
<?php echo $a['input_sand_qty']; ?>
<?php echo (int)$a['input_sand_qty']; ?>
</td>
<!-- td:eq(6) input_sand_moisture -->
@ -462,7 +462,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<td class="celda_normal" oninput="gasPerTon(this);
moistureLossQty(this);
qtyPerHrs(this)" contenteditable="true">
<?php echo $a['sand_dried_qty']; ?>
<?php echo (int)$a['sand_dried_qty']; ?>
</td>
<!-- td:eq(8) total_gas_consumption -->
@ -479,19 +479,19 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- td:eq(10) qty_per_hours -->
<td class="celda_normal">
<?php echo $a['qty_per_hours']; ?>
<?php echo (int)$a['qty_per_hours']; ?>
</td>
<!-- td:eq(11) moisture_loss_qty -->
<td class="celda_normal">
<?php echo $a['moisture_loss_qty']; ?>
<?php echo (int)$a['moisture_loss_qty']; ?>
</td>
<!-- td:eq(12) dust_qty -->
<td class="celda_normal" contenteditable="true">
<?php echo $a['dust_qty']; ?>
<?php echo (int)$a['dust_qty']; ?>
</td>
<!-- td:eq(13) customer_name -->
@ -548,14 +548,14 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<th class="celda_encabezado_total" style="padding:5px;">Running Hrs</th>
<th class="celda_encabezado_total" style="padding:5px;">Supplier Name </th>
<th class="celda_encabezado_total" style="padding:5px;">input Sand Qty</th>
<th class="celda_encabezado_total" style="padding:5px;">input Sand Qty (Metric Ton)</th>
<th class="celda_encabezado_total" style="padding:5px;">inputp Sand Moisture(%)</th>
<th class="celda_encabezado_total" style="padding:5px;">Sand Dried Qty</th>
<th class="celda_encabezado_total" style="padding:5px;">Sand Dried Qty (Metric Ton)</th>
<th class="celda_encabezado_total" style="padding:5px;">Total Gas Consumption</th>
<th class="celda_encabezado_total" style="padding:5px;">Gas Per Ton</th>
<th class="celda_encabezado_total" style="padding:5px;">Qty Per Hrs</th>
<th class="celda_encabezado_total" style="padding:5px;">Moisture Loss Qty</th>
<th class="celda_encabezado_total" style="padding:5px;">Dust Qty</th>
<th class="celda_encabezado_total" style="padding:5px;">Qty Per Hrs (Metric Ton)</th>
<th class="celda_encabezado_total" style="padding:5px;">Moisture Loss Qty (Metric Ton)</th>
<th class="celda_encabezado_total" style="padding:5px;">Dust Qty (Metric Ton)</th>
</tr>
</thead>
@ -697,7 +697,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- additional entries modal -->
<div class="modal fade" id="additionalEntriesModalId" tabindex="-1" role="dialog" aria-labelledby="additionalEntriesIdModalLabelId" aria-hidden="true">
<div class="modal-dialog modal-xl">
<div class="modal-dialog modal-xl" style="width:900px;">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="additionalEntriesIdModalLabelId">Additional Entries</h4>
@ -706,7 +706,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<div class="modal-body">
<form action="<?php echo base_url("/addOrEditdrierMachineDetails")?>" method="POST">
<!--14 -->
<!--first row -->
<?php $calendarStartDate = DateTime::createFromFormat('M-Y', $datefordropdown)->modify('first day of this month')->format('Y-m-d');?>
<?php $calendarEndDate = DateTime::createFromFormat('M-Y', $datefordropdown)->modify('last day of this month')->format('Y-m-d');?>
<div class="row">
@ -746,51 +746,11 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
</div>
</div>
<div class="row mt-2">
<div class="col-md-3">
<label class="form" for="additionalEntryInputSandMoistureId">Input Sand Moisture (%)</label>
<input type="text" class="form-control" id="additionalEntryInputSandMoistureId" name="input_sand_moisture" value="">
</div>
<div class="col-md-3">
<label class="form" for="additionalEntryTotalGasConsumptionId">Total Gas Consumption</label>
<input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); "
type="text" class="form-control" id="additionalEntryTotalGasConsumptionId" name="total_gas_consumption" value="">
</div>
<div class="col-md-3">
<label class="form" for="additionalEntrySandDriedQtyId">Sand Dried Qty</label>
<input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); "
type="text" class="form-control" id="additionalEntrySandDriedQtyId" name="sand_dried_qty" value="">
</div>
<div class="col-md-3">
<label class="form" for="additionalEntryGasPerTonId">Gas per Ton</label>
<input type="text" class="form-control" id="additionalEntryGasPerTonId" name="gas_per_ton" value=""
readonly>
</div>
</div>
<!-- second row -->
<div class="row mt-2">
<div class="col-md-3">
<label class="form" for="additionalEntryDustQtyId">Dust Qty</label>
<input type="text" class="form-control" id="additionalEntryDustQtyId" name="dust_qty" value="">
</div>
<div class="col-md-3">
<label class="form" for="additionalEntryInputSandQtyId">Input sand Quantity</label>
<input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); "
type="text" class="form-control" id="additionalEntryInputSandQtyId" name="input_sand_qty" value="">
</div>
<div class="col-md-3">
<label class="form" for="additionalEntryMoistureLossQtyId">Moisture Loss Qty</label>
<input type="text" class="form-control" id="additionalEntryMoistureLossQtyId" name="moisture_loss_qty" value=""
readonly>
</div>
<div class="col-md-3">
<label class="form" for="additionalEntryQtyPerHoursId">Qty per Hours</label>
<input type="text" class="form-control" id="additionalEntryQtyPerHoursId" name="qty_per_hours" value=""
readonly>
</div>
</div>
<div class="row mt-2">
<!-- supplier name -->
<div class="col-md-3">
<label class="form" for="additionalEntrySupplierNameId">Supplier Name</label>
<select class="timeDropdown supplier_name" style="width: 300px;"
@ -801,10 +761,83 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<?php } ?>
</select>
</div>
<!-- input sand qty -->
<div class="col-md-3">
<label class="form" for="additionalEntryInputSandQtyId">Input sand Quantity (Metric Ton)</label>
<input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); "
type="text" class="form-control" id="additionalEntryInputSandQtyId" name="input_sand_qty" value="">
</div>
<!-- input sand moisture -->
<div class="col-md-3">
<label class="form" for="additionalEntryInputSandMoistureId">Input Sand Moisture (%)</label>
<input type="text" class="form-control" id="additionalEntryInputSandMoistureId" name="input_sand_moisture" value="">
</div>
<!-- sand dried qty -->
<div class="col-md-3">
<label class="form" for="additionalEntrySandDriedQtyId">Sand Dried Qty (Metric Ton)</label>
<input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); "
type="text" class="form-control" id="additionalEntrySandDriedQtyId" name="sand_dried_qty" value="">
</div>
</div>
<!-- third row -->
<div class="row mt-2">
<!-- total gas consumption -->
<div class="col-md-3">
<label class="form" for="additionalEntryTotalGasConsumptionId">Total Gas Consumption</label>
<input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); "
type="text" class="form-control" id="additionalEntryTotalGasConsumptionId" name="total_gas_consumption" value="">
</div>
<!-- gas per ton -->
<div class="col-md-3">
<label class="form" for="additionalEntryGasPerTonId">Gas per Ton</label>
<input type="text" class="form-control" id="additionalEntryGasPerTonId" name="gas_per_ton" value=""
readonly>
</div>
<!-- qty per hours -->
<div class="col-md-3">
<label class="form" for="additionalEntryQtyPerHoursId">Qty per Hours</label>
<input type="text" class="form-control" id="additionalEntryQtyPerHoursId" name="qty_per_hours" value=""
readonly>
</div>
<!-- moisture loss qty -->
<div class="col-md-3">
<label class="form" for="additionalEntryMoistureLossQtyId">Moisture Loss Qty (Metric Ton)</label>
<input type="text" class="form-control" id="additionalEntryMoistureLossQtyId" name="moisture_loss_qty" value=""
readonly>
</div>
</div>
<!-- fourth row -->
<div class="row mt-2">
<!-- dust qty -->
<div class="col-md-3">
<label class="form" for="additionalEntryDustQtyId">Dust Qty (Metric Ton)</label>
<input type="text" class="form-control" id="additionalEntryDustQtyId" name="dust_qty" value="">
</div>
<!-- customer name -->
<div class="col-md-3">
<label class="form" for="additionalEntryCustomerNameId">Customer Name</label>
<input type="text" class="form-control" id="additionalEntryCustomerNameId" name="customer_name" value="">
</div>
</div>
<button type="submit" class="btn btn-primary float-right">Add</button>
@ -1090,9 +1123,9 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
hours = parseInt(hours, 10);
// Adjust hours based on AM/PM
if (modifier === "PM" && hours < 12) {
if (modifier === "pm" && hours < 12) {
hours += 12;
} else if (modifier === "AM" && hours === 12) {
} else if (modifier === "am" && hours === 12) {
hours = 0;
}

View File

@ -457,7 +457,7 @@
<!-- 'td:eq(9)' -->
<td class="celda_normal" >
<?php echo $record['Qty'] ?? 0 ; ?>
<?php echo (int)$record['Qty'] ?? 0 ; ?>
</td>
<!-- 'td:eq(10)' -->
@ -575,7 +575,7 @@
<!-- 'td:eq(32)' -->
<td class="celda_normal">
<?php echo $record['salableQty'] ?? $record['Qty'] ; ?>
<?php echo $record['salableQty'] ?? (int)$record['Qty'] ; ?>
</td>
<!-- need to check the status and select values before hand -->