stock changes 08-04-2025

This commit is contained in:
vadivelJ96 2025-04-08 11:02:13 +05:30
parent bdcd16944b
commit 1f81b6e1dd
2 changed files with 112 additions and 79 deletions

View File

@ -1344,21 +1344,6 @@ class StockController extends BaseController
'machine_category' => "diesel",
'machine_id' => $customisedMachineCode
];
//checking filtered material code present in table , if not create dummy one for whole month
$findMachineCode = $this->factoryVehicleDieselDetails_model
->where('date >=', $startDate)
->where('date <=', $endDate)
->where('machine_id',$customisedMachineCode)
->findAll();
//check any material code is not present in stock table but applied in filter
if(empty($findMachineCode)){
//create dummy entry for this
$this->createDummyEntryForDieselMachine($customisedMachineCode,$startDate,$endDate);
}
}
@ -1396,6 +1381,24 @@ class StockController extends BaseController
$machineCodeList = array_column($existingCustomMachineCodes, 'id');
foreach($machineCodeList as $index => $machineCode){
//checking filtered present in table , if not create dummy one for whole month
$findMachineCode = $this->factoryVehicleDieselDetails_model
->where('date >=', $startDate)
->where('date <=', $endDate)
->where('machine_id',$machineCode)
->findAll();
//check any material code is not present in stock table but applied in filter
if(empty($findMachineCode)){
//create dummy entry for this
$this->createDummyEntryForDieselMachine($machineCode,$startDate,$endDate);
}
}
$dieselMachines = $existingCustomMachineCodes;
$data['activeDieselMachines'] = $this->factoryMachine_model->getAllActiveDieselMachines();
@ -1761,23 +1764,6 @@ class StockController extends BaseController
'machine_category' => "electric",
'machine_id' => $customisedMachineCode
];
//checking filtered material code present in table , if not create dummy one for whole month
$findMachineCode = $this->powerConsumptionDetails_model
->where('date >=', $startDate)
->where('date <=', $endDate)
->where('machine_id',$customisedMachineCode)
->findAll();
//check any material code is not present in stock table but applied in filter
if(empty($findMachineCode)){
//create dummy entry for this
$this->createDummyEntryForElectricMachine($customisedMachineCode,$startDate,$endDate);
}
}
@ -1811,9 +1797,28 @@ class StockController extends BaseController
//this existingCustomMachineCodes gets its machine after visiting factory machine master table
$machineCodeList = array_column($existingCustomMachineCodes, 'id');
foreach($machineCodeList as $index => $machineCode){
//checking filtered material code present in table , if not create dummy one for whole month
$findMachineCode = $this->powerConsumptionDetails_model
->where('date >=', $startDate)
->where('date <=', $endDate)
->where('machine_id',$machineCode)
->findAll();
//check any material code is not present in stock table but applied in filter
if(empty($findMachineCode)){
//create dummy entry for this
$this->createDummyEntryForElectricMachine($machineCode,$startDate,$endDate);
}
}
$electricMachines = $existingCustomMachineCodes;
$data['activeElectricMachines'] = $this->factoryMachine_model->getAllActiveElectricMachines();
@ -2284,19 +2289,6 @@ class StockController extends BaseController
'stock_category' => "resin",
'materialCode' => $customisedMaterialCode
];
//checking filtered material code present in table , if not create dummy one for whole month
$findMaterialCode = $this->resinStockDetails_model
->where('date >=', $startDate)
->where('date <=', $endDate)
->where('materialCode',$customisedMaterialCode)
->findAll();
//check any material code is not present in stock table but applied in filter
if(empty($findMaterialCode)){
//create dummy entry for that
$this->createDummyEntryForResin($customisedMaterialCode,$startDate,$endDate);
}
}
@ -2329,6 +2321,25 @@ class StockController extends BaseController
$materialCodeList = array_column($existingCustomMaterialCodes, 'MaterialCode');
foreach($materialCodeList as $index => $materialCode){
//checking filtered material code present in table , if not create dummy one for whole month
$findMachineCode = $this->resinStockDetails_model
->where('date >=', $startDate)
->where('date <=', $endDate)
->where('materialCode',$materialCode)
->findAll();
//check any material code is not present in stock table but applied in filter
if(empty($findMachineCode)){
//create dummy entry for this
$this->createDummyEntryForResin($materialCode,$startDate,$endDate);
}
}
$resinMaterials = $existingCustomMaterialCodes ;
$data['activeResinMaterials'] = $this->rawmaterialdetails_model->getAllResinMaterialCode();
@ -2663,19 +2674,6 @@ class StockController extends BaseController
'stock_category' => "packing_material",
'materialCode' => $customisedMaterialCode
];
//checking filtered material code present in table , if not create dummy one for whole month
$findMaterialCode = $this->bagStockDetails_model
->where('date >=', $startDate)
->where('date <=', $endDate)
->where('materialCode',$customisedMaterialCode)
->findAll();
//check any material code is not present in stock table but applied in filter
if(empty($findMaterialCode)){
//create dummy entry for that
$this->createDummyEntryForBag($customisedMaterialCode,$startDate,$endDate);
}
}
@ -2709,6 +2707,25 @@ class StockController extends BaseController
$materialCodeList = array_column($existingCustomMaterialCodes, 'MaterialCode');
foreach($materialCodeList as $index => $materialCode){
//checking filtered material code present in table , if not create dummy one for whole month
$findMachineCode = $this->bagStockDetails_model
->where('date >=', $startDate)
->where('date <=', $endDate)
->where('materialCode',$materialCode)
->findAll();
//check any material code is not present in stock table but applied in filter
if(empty($findMachineCode)){
//create dummy entry for this
$this->createDummyEntryForBag($materialCode,$startDate,$endDate);
}
}
$bagMaterials = $existingCustomMaterialCodes ;
$data['activeBagMaterials'] = $this->rawmaterialdetails_model->getAllBagMaterialCode();

View File

@ -471,12 +471,13 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<div class="row">
<div class="col-md-3">
<label class="form" for="additionalEntryDateId">Date</label>
<span class="text-danger">*</span>
<input type="date" class="form-control" id="additionalEntryDateId" name="date" value="<?= $calendarCurrentDate ?>"
min="<?= $calendarStartDate ?>" max="<?= $calendarEndDate ?>" required>
</div>
<div class="col-md-3">
<label class="form" for="additionalEntryDrierOnTimeId">Drier On Time</label>
<span class="text-danger">*</span>
<select onchange="calculateMachineRunningHrs()" required
class="timeDropdown select2" style="width: 100px;"
id="additionalEntryDrierOnTimeId" name="drier_on_time">
@ -488,7 +489,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
</div>
<div class="col-md-3">
<label class="form" for="additionalEntryDrierOffTimeId">Drier Off Time</label>
<span class="text-danger">*</span>
<select onchange="calculateMachineRunningHrs()" required
class="timeDropdown select2" style="width: 100px;"
id="additionalEntryDrierOffTimeId" name="drier_off_time">
@ -512,6 +513,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- supplier name -->
<div class="col-md-3">
<label class="form" for="additionalEntrySupplierNameId">Supplier Name</label>
<span class="text-danger">*</span>
<select class="timeDropdown supplier_name select2" style="width: 300px;" required
id="additionalEntrySupplierNameId" name="supplier_name">
<option value="">Select</option>
@ -523,7 +525,8 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- input sand qty -->
<div class="col-md-3">
<label class="form" for="additionalEntryInputSandQtyId">Input sand Quantity (Metric Ton)</label>
<label class="form" for="additionalEntryInputSandQtyId">Input Sand Quantity (Metric Ton)</label>
<span class="text-danger">*</span>
<input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); "
type="text" class="form-control" id="additionalEntryInputSandQtyId" name="input_sand_qty" value="" required>
</div>
@ -531,6 +534,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- input sand moisture -->
<div class="col-md-3">
<label class="form" for="additionalEntryInputSandMoistureId">Input Sand Moisture (%)</label>
<span class="text-danger">*</span>
<input type="text" class="form-control" id="additionalEntryInputSandMoistureId" name="input_sand_moisture" value="" required>
</div>
@ -539,6 +543,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- sand dried qty -->
<div class="col-md-3">
<label class="form" for="additionalEntrySandDriedQtyId">Sand Dried Qty (Metric Ton)</label>
<span class="text-danger">*</span>
<input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); "
type="text" class="form-control" id="additionalEntrySandDriedQtyId" name="sand_dried_qty" value="" required>
</div>
@ -552,13 +557,14 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- total gas consumption -->
<div class="col-md-3">
<label class="form" for="additionalEntryTotalGasConsumptionId">Total Gas Consumption</label>
<span class="text-danger">*</span>
<input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); "
type="text" class="form-control" id="additionalEntryTotalGasConsumptionId" name="total_gas_consumption" value="" required>
</div>
<!-- gas per ton -->
<div class="col-md-3">
<label class="form" for="additionalEntryGasPerTonId">Gas per Ton</label>
<label class="form" for="additionalEntryGasPerTonId">Gas / Ton</label>
<input type="text" class="form-control" id="additionalEntryGasPerTonId" name="gas_per_ton" value="" required
readonly>
</div>
@ -566,7 +572,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- qty per hours -->
<div class="col-md-3">
<label class="form" for="additionalEntryQtyPerHoursId">Qty per Hours</label>
<label class="form" for="additionalEntryQtyPerHoursId">Qty / Hours</label>
<input type="text" class="form-control" id="additionalEntryQtyPerHoursId" name="qty_per_hours" value="" required
readonly>
</div>
@ -587,6 +593,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- dust qty -->
<div class="col-md-3">
<label class="form" for="additionalEntryDustQtyId">Dust Qty (Metric Ton)</label>
<span class="text-danger">*</span>
<input type="text" class="form-control" id="additionalEntryDustQtyId" name="dust_qty" value="" required>
</div>
@ -594,6 +601,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- customer name -->
<div class="col-md-3">
<label class="form" for="additionalEntryCustomerNameId">Customer Name</label>
<span class="text-danger">*</span>
<input type="text" class="form-control" id="additionalEntryCustomerNameId" name="customer_name" value="" required>
</div>
@ -627,13 +635,14 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<div class="row">
<div class="col-md-3">
<label class="form" for="editEntryDateId">Date</label>
<span class="text-danger">*</span>
<input type="date" class="form-control" id="editEntryDateId" name="date" value=""
required readonly>
</div>
<div class="col-md-3">
<label class="form" for="editEntryDrierOnTimeId">Drier On Time</label>
<select onchange="editEntryCalculateMachineRunningHrs()"
<span class="text-danger">*</span>
<select onchange="editEntryCalculateMachineRunningHrs()" required
class="timeDropdown select2" style="width: 100px;"
id="editEntryDrierOnTimeId" name="drier_on_time">
<option value="">Select</option>
@ -644,8 +653,8 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
</div>
<div class="col-md-3">
<label class="form" for="editEntryDrierOffTimeId">Drier Off Time</label>
<select onchange="editEntryCalculateMachineRunningHrs()"
<span class="text-danger">*</span>
<select onchange="editEntryCalculateMachineRunningHrs()" required
class="timeDropdown select2" style="width: 100px;"
id="editEntryDrierOffTimeId" name="drier_off_time">
<option value="">Select</option>
@ -668,7 +677,8 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- supplier name -->
<div class="col-md-3">
<label class="form" for="editEntrySupplierNameId">Supplier Name</label>
<select class="timeDropdown supplier_name select2" style="width: 300px;"
<span class="text-danger">*</span>
<select class="timeDropdown supplier_name select2" style="width: 300px;" required
id="editEntrySupplierNameId" name="supplier_name" value="">
<option value="">Select</option>
<?php foreach ($supplierData as $key => $value) { ?>
@ -679,15 +689,17 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- input sand qty -->
<div class="col-md-3">
<label class="form" for="editEntryInputSandQtyId">Input sand Quantity (Metric Ton)</label>
<label class="form" for="editEntryInputSandQtyId">Input Sand Quantity (Metric Ton)</label>
<span class="text-danger">*</span>
<input onchange="editEntryGasPerTon(); editEntryMoistureLossQty(); editEntryQtyPerHrs(); "
type="text" class="form-control" id="editEntryInputSandQtyId" name="input_sand_qty" value="">
type="text" class="form-control" id="editEntryInputSandQtyId" name="input_sand_qty" value="" required>
</div>
<!-- input sand moisture -->
<div class="col-md-3">
<label class="form" for="editEntryInputSandMoistureId">Input Sand Moisture (%)</label>
<input type="text" class="form-control" id="editEntryInputSandMoistureId" name="input_sand_moisture" value="">
<span class="text-danger">*</span>
<input type="text" class="form-control" id="editEntryInputSandMoistureId" name="input_sand_moisture" value="" required>
</div>
@ -695,8 +707,9 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- sand dried qty -->
<div class="col-md-3">
<label class="form" for="editEntrySandDriedQtyId">Sand Dried Qty (Metric Ton)</label>
<span class="text-danger">*</span>
<input onchange="editEntryGasPerTon(); editEntryMoistureLossQty(); editEntryQtyPerHrs(); "
type="text" class="form-control" id="editEntrySandDriedQtyId" name="sand_dried_qty" value="">
type="text" class="form-control" id="editEntrySandDriedQtyId" name="sand_dried_qty" value="" required>
</div>
@ -708,21 +721,22 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- total gas consumption -->
<div class="col-md-3">
<label class="form" for="editEntryTotalGasConsumptionId">Total Gas Consumption</label>
<span class="text-danger">*</span>
<input onchange="editEntryGasPerTon(); editEntryMoistureLossQty(); editEntryQtyPerHrs(); "
type="text" class="form-control" id="editEntryTotalGasConsumptionId" name="total_gas_consumption" value="">
type="text" class="form-control" id="editEntryTotalGasConsumptionId" name="total_gas_consumption" value="" required>
</div>
<!-- gas per ton -->
<div class="col-md-3">
<label class="form" for="editEntryGasPerTonId">Gas per Ton</label>
<input type="text" class="form-control" id="editEntryGasPerTonId" name="gas_per_ton" value=""
<label class="form" for="editEntryGasPerTonId">Gas / Ton</label>
<input type="text" class="form-control" id="editEntryGasPerTonId" name="gas_per_ton" value=""
readonly>
</div>
<!-- qty per hours -->
<div class="col-md-3">
<label class="form" for="editEntryQtyPerHoursId">Qty per Hours</label>
<label class="form" for="editEntryQtyPerHoursId">Qty / Hours</label>
<input type="text" class="form-control" id="editEntryQtyPerHoursId" name="qty_per_hours" value=""
readonly>
</div>
@ -731,7 +745,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- moisture loss qty -->
<div class="col-md-3">
<label class="form" for="editEntryMoistureLossQtyId">Moisture Loss Qty (Metric Ton)</label>
<input type="text" class="form-control" id="editEntryMoistureLossQtyId" name="moisture_loss_qty" value=""
<input type="text" class="form-control" id="editEntryMoistureLossQtyId" name="moisture_loss_qty" value=""
readonly>
</div>
</div>
@ -743,14 +757,16 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<!-- dust qty -->
<div class="col-md-3">
<label class="form" for="editEntryDustQtyId">Dust Qty (Metric Ton)</label>
<input type="text" class="form-control" id="editEntryDustQtyId" name="dust_qty" value="">
<span class="text-danger">*</span>
<input type="text" class="form-control" id="editEntryDustQtyId" name="dust_qty" value="" required>
</div>
<!-- customer name -->
<div class="col-md-3">
<label class="form" for="editEntryCustomerNameId">Customer Name</label>
<input type="text" class="form-control" id="editEntryCustomerNameId" name="customer_name" value="">
<span class="text-danger">*</span>
<input type="text" class="form-control" id="editEntryCustomerNameId" name="customer_name" value="" required>
</div>
</div>