stock module - 20-03-2025

This commit is contained in:
vadivelJ96 2025-03-20 17:51:44 +05:30
parent 71fce65d0f
commit 6dfd459b99
4 changed files with 89 additions and 15 deletions

View File

@ -288,6 +288,7 @@ class Rawmaterialdetails extends BaseController
$data['cfUOM'] = $this->rawmaterialdetails_model->getConversionfactorUOM();
$data['assetcode'] = $this->rawmaterialdetails_model->getAssetcode();
$data['avg_price'] = $this->rawmaterialdetails_model->getMaterialAvg($RawMaterialID);
$data['materialRateHistory'] = $this->rawmaterialdetails_model->getMaterialRateHistory($RawMaterialID);
//print_r($data['avg_price']);die();
$this->global['pageTitle'] = 'Edit Material Master';

View File

@ -445,5 +445,24 @@ where (CurrentStock+OpeningStock)<reorder";
}
function getMaterialRateHistory($RawMaterialID) {
$result = $this->db->table('t_material_rate_history tmrh')
->select('
tmrh.new_value,
tmrh.old_value,
tmrh.updated_at,
te.FirstName AS name
')
->join('tbl_users tu', 'tu.userId = tmrh.updated_by', 'left')
->join('t_employee_details te', 'te.EmpID = tu.EmpID', 'left')
->where('tmrh.MaterialCode', $RawMaterialID)
->orderBy('tmrh.updated_at', 'desc')
->get()
->getResultArray();
return $result;
}
}

View File

@ -168,17 +168,15 @@ if ($total <= $reorder) {
<div class="form-group">
<label for="MaterialCategory">Material Category
<span class="badge">*</span></label>
<!-- <i type="button" class="fe-plus-circle" id="addMaterialCaterogyModalButton"
style="font-size: 16px; color:rgb(15, 155, 218);" data-toggle="modal" data-target="#addMaterialCaterogyModal"
title="Add Material Caterogy">
</i> -->
<select class="form-control select2" id="MaterialCategory" name="MaterialCategory" required>
<?php
if (!empty($materialCategoryList)) {
foreach ($materialCategoryList as $SID) {
?>
<option value="<?php echo $SID['Key'] ?>" <?php if ($MaterialCategory === $SID['Key']) echo "selected"; ?>><?php echo $SID['ConfigValue'] ?></option>
<option value="<?php echo $SID['Key'] ?>" <?php if ($MaterialCategory === $SID['Key']) echo "selected"; ?>>
<?php echo $SID['ConfigValue'] ?>
</option>
<?php
}
}
@ -288,15 +286,15 @@ if ($total <= $reorder) {
<input type="text" class="form-control" id="remarks" name="remarks" maxlength="255" value="<?php echo $remarks; ?>">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="switch">
<input type="checkbox" id="isactive" name="isactive" <?php echo $IsActive; ?> />
<span class="slider"></span>
</label>
<label class="mt-4">Is Active</label>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="switch">
<input type="checkbox" id="isactive" name="isactive" <?php echo $IsActive; ?> />
<span class="slider"></span>
</label>
<label class="mt-4">Is Active</label>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
@ -304,6 +302,61 @@ if ($total <= $reorder) {
</div>
</div>
</div>
<br>
<h3 align="center">Material Rate History</h3>
<br>
<?php
if(empty($materialRateHistory)){
echo "* No Material Rate History Available For Material Created Before April-2025";
}else{ ?>
<div class="form-row mb-3 table-responsive">
<table id="materialRateHistoryTableId" class="table table-striped">
<thead>
<th style="text-align: center !important;">Rate New Value</th>
<th style="text-align: center !important;">Rate Old Value</th>
<th style="text-align: center !important;">Rate Updated By</th>
<th style="text-align: center !important;">Rate Updated Date </th>
<th style="text-align: center !important;">Rate Updated Time</th>
</thead>
<tbody>
<?php
foreach ($materialRateHistory as $mrh) {
?>
<tr>
<td align="center"><b><?= $mrh['new_value'] ?></b></td>
<td align="center"><b><?= $mrh['old_value'] ?></b></td>
<td align="center"><b><?= $mrh['name'] ?></b></td>
<td align="center"><?= date('d-m-Y', strtotime($mrh['updated_at'])) ?></td>
<td align="center"><?= date('h:i A', strtotime($mrh['updated_at'])) ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<?php
}
?>
</div>
</div>
</div>

View File

@ -94,9 +94,10 @@
<?php
if (!empty($materialCategoryList)) {
foreach ($materialCategoryList as $record) {
if($record['isActive']){
?>
<option value="<?php echo $record['ConfigValue']?>"><?php echo $record['ConfigValue']?></option>
<?php } } ?>
<?php } } } ?>
</select>
</div>
</div>