req and capital align : ps
This commit is contained in:
parent
9ffc4495f2
commit
65f5ea8c5b
@ -130,19 +130,21 @@ class Requisitionform extends BaseController
|
||||
// echo 'ReqType'.$ReqPOType;
|
||||
$data['ReqPOType'] = $ReqPOType == '' ? $ReqType : $ReqPOType;
|
||||
$data['LineItem'] = $this->requistion_model->getEditRequistItemList($ReqNo);
|
||||
// print_r($data['LineItem']);die;
|
||||
|
||||
$data['description'] = '';
|
||||
foreach ($data['LineItem'] as $line) {
|
||||
|
||||
foreach ($data['LineItem'] as $key => $line) {
|
||||
$description = isset($line->MaterialDescription) ? $line->MaterialDescription : null;
|
||||
//echo $description;
|
||||
|
||||
|
||||
$data['LineItem'][$key]->CategoryName = $line->MaterialCode
|
||||
? $this->requistion_model->getCategoryName($line->MaterialCode)
|
||||
: "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$data['CostCenter'] = $this->requistion_model->getCostCenterUserID($userID);
|
||||
$data['MaterialCode'] = $this->requistion_model->EditMaterialCode($ReqNo, $ReqType);
|
||||
// $data['MaterialCode'] = $this->requistion_model->EditMaterialCode($ReqNo, $ReqType); // Old Based on Type..
|
||||
$data['MaterialCode'] = $this->requistion_model->EditMaterialCode($ReqNo);
|
||||
$data['ServiceOption'] = $this->requistion_model->getConfigValue('C022');
|
||||
$this->loadViews("editrequisitionform", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
@ -153,19 +153,19 @@ class Requistion_model extends Model
|
||||
return $query->getResultArray();
|
||||
}
|
||||
|
||||
function EditMaterialCode($ReqNo,$ReqType)
|
||||
{
|
||||
$subQuery ='SELECT Mat.MaterialCode,Mat.MaterialName,Mat.UOM
|
||||
from t_materialmaster Mat where Mat.MaterialCode not in (select Req.MaterialCode from t_requestion_details Req
|
||||
join t_requestion_master mast on Req.ReqNo = mast.ReqNo where mast.ReqNo=? and mast.ReqType=?
|
||||
) and Mat.MaterialType=?';
|
||||
|
||||
$query = $this->db->query($subQuery, [$ReqNo,$ReqType,$ReqType]);
|
||||
|
||||
|
||||
return $query->getResult();
|
||||
|
||||
}
|
||||
// This function also called in store req. also $reqType not removed.....
|
||||
function EditMaterialCode($ReqNo, $ReqType = NULL){
|
||||
$subQuery = 'SELECT Mat.MaterialCode, Mat.MaterialName, Mat.UOM FROM t_materialmaster Mat
|
||||
WHERE Mat.MaterialCode NOT IN (
|
||||
SELECT Req.MaterialCode FROM t_requestion_details Req
|
||||
JOIN t_requestion_master mast ON Req.ReqNo = mast.ReqNo
|
||||
WHERE mast.ReqNo = ?' . ($ReqType ? ' AND mast.ReqType = ?' : '') .')'
|
||||
. ($ReqType ? ' AND Mat.MaterialType = ?' : '');
|
||||
|
||||
$params = $ReqType ? [$ReqNo, $ReqType, $ReqType] : [$ReqNo];
|
||||
$query = $this->db->query($subQuery, $params);
|
||||
return $query->getResult();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -582,7 +582,18 @@ class Requistion_model extends Model
|
||||
|
||||
return $query->getResult();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getCategoryName($materialCode){
|
||||
$subQuery ='SELECT MM.MaterialCode,MM.MaterialName,MM.MaterialType,MM.Category,MM.IsActive,CD.ConfigValue
|
||||
from t_materialmaster as MM
|
||||
left join t_configdetails as CD on CD.Key = MM.Category
|
||||
where MM.MaterialCode = '.$materialCode;
|
||||
|
||||
$categoryName = $this->db->query($subQuery)->getRow()->ConfigValue;
|
||||
return $categoryName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -93,6 +93,7 @@ td {
|
||||
text-align:center !important;
|
||||
width:10%;
|
||||
}
|
||||
.hidden-column { display: none; }
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
@ -209,6 +210,7 @@ td {
|
||||
<th class="th th-PoQuantity">PoQuantity</th>
|
||||
<th class="th th-status">Status</th>
|
||||
<th class="th">Action</th>
|
||||
<th class="hidden-column">Mategory Category</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tempAppend">
|
||||
@ -234,6 +236,7 @@ td {
|
||||
<td>
|
||||
<a data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-target='#edit-req-modal' data-toggle="modal" href="#edit-req-modal"><i class="ri-pencil-fill" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->MaterialCode; ?> Material details"></i> </a> <a onclick="DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $record->MaterialCode; ?>" data-userid="<?php echo $index; ?>" id="Del"><span class="ri-delete-bin-7-fill"></span></a>
|
||||
</td>
|
||||
<td class="hidden-column"><?php echo $record->CategoryName; ?></td>
|
||||
</tr>
|
||||
<?php $RowCount = $index;
|
||||
}
|
||||
@ -403,14 +406,14 @@ td {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="row">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="EditCategory" class="control-label">Category</label>
|
||||
<input type ="text" id="EditCategory" readonly class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="EditotherDescription">
|
||||
<div class="form-group">
|
||||
@ -831,6 +834,7 @@ td {
|
||||
<span class="ri-delete-bin-7-fill"></span>
|
||||
</a>
|
||||
</td>
|
||||
<td class="hidden-column">${categoryName}</td>
|
||||
</tr>
|
||||
`;
|
||||
|
||||
@ -929,6 +933,7 @@ td {
|
||||
$('#EditDescription').val($cells.eq(2).text());
|
||||
$('#EditUOM').val($cells.eq(3).text());
|
||||
$('#EditQuantity').val($cells.eq(4).text());
|
||||
$('#EditCategory').val($cells.eq(8).text());
|
||||
$('#Edituserid').val(userid);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user