stock module - 20-03-2025
This commit is contained in:
parent
71fce65d0f
commit
6dfd459b99
@ -288,6 +288,7 @@ class Rawmaterialdetails extends BaseController
|
|||||||
$data['cfUOM'] = $this->rawmaterialdetails_model->getConversionfactorUOM();
|
$data['cfUOM'] = $this->rawmaterialdetails_model->getConversionfactorUOM();
|
||||||
$data['assetcode'] = $this->rawmaterialdetails_model->getAssetcode();
|
$data['assetcode'] = $this->rawmaterialdetails_model->getAssetcode();
|
||||||
$data['avg_price'] = $this->rawmaterialdetails_model->getMaterialAvg($RawMaterialID);
|
$data['avg_price'] = $this->rawmaterialdetails_model->getMaterialAvg($RawMaterialID);
|
||||||
|
$data['materialRateHistory'] = $this->rawmaterialdetails_model->getMaterialRateHistory($RawMaterialID);
|
||||||
|
|
||||||
//print_r($data['avg_price']);die();
|
//print_r($data['avg_price']);die();
|
||||||
$this->global['pageTitle'] = 'Edit Material Master';
|
$this->global['pageTitle'] = 'Edit Material Master';
|
||||||
|
|||||||
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -168,17 +168,15 @@ if ($total <= $reorder) {
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="MaterialCategory">Material Category
|
<label for="MaterialCategory">Material Category
|
||||||
<span class="badge">*</span></label>
|
<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>
|
<select class="form-control select2" id="MaterialCategory" name="MaterialCategory" required>
|
||||||
<?php
|
<?php
|
||||||
if (!empty($materialCategoryList)) {
|
if (!empty($materialCategoryList)) {
|
||||||
foreach ($materialCategoryList as $SID) {
|
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
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -288,15 +286,15 @@ if ($total <= $reorder) {
|
|||||||
<input type="text" class="form-control" id="remarks" name="remarks" maxlength="255" value="<?php echo $remarks; ?>">
|
<input type="text" class="form-control" id="remarks" name="remarks" maxlength="255" value="<?php echo $remarks; ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="switch">
|
<label class="switch">
|
||||||
<input type="checkbox" id="isactive" name="isactive" <?php echo $IsActive; ?> />
|
<input type="checkbox" id="isactive" name="isactive" <?php echo $IsActive; ?> />
|
||||||
<span class="slider"></span>
|
<span class="slider"></span>
|
||||||
</label>
|
</label>
|
||||||
<label class="mt-4">Is Active</label>
|
<label class="mt-4">Is Active</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
||||||
@ -304,6 +302,61 @@ if ($total <= $reorder) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -94,9 +94,10 @@
|
|||||||
<?php
|
<?php
|
||||||
if (!empty($materialCategoryList)) {
|
if (!empty($materialCategoryList)) {
|
||||||
foreach ($materialCategoryList as $record) {
|
foreach ($materialCategoryList as $record) {
|
||||||
|
if($record['isActive']){
|
||||||
?>
|
?>
|
||||||
<option value="<?php echo $record['ConfigValue']?>"><?php echo $record['ConfigValue']?></option>
|
<option value="<?php echo $record['ConfigValue']?>"><?php echo $record['ConfigValue']?></option>
|
||||||
<?php } } ?>
|
<?php } } } ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user