req and capital align : ps

This commit is contained in:
VE10-Sanjeev 2025-03-13 11:13:06 +00:00
parent 9ffc4495f2
commit 65f5ea8c5b
4 changed files with 987 additions and 1004 deletions

View File

@ -130,19 +130,21 @@ class Requisitionform extends BaseController
// echo 'ReqType'.$ReqPOType; // echo 'ReqType'.$ReqPOType;
$data['ReqPOType'] = $ReqPOType == '' ? $ReqType : $ReqPOType; $data['ReqPOType'] = $ReqPOType == '' ? $ReqType : $ReqPOType;
$data['LineItem'] = $this->requistion_model->getEditRequistItemList($ReqNo); $data['LineItem'] = $this->requistion_model->getEditRequistItemList($ReqNo);
// print_r($data['LineItem']);die;
$data['description'] = ''; $data['description'] = '';
foreach ($data['LineItem'] as $line) { foreach ($data['LineItem'] as $key => $line) {
$description = isset($line->MaterialDescription) ? $line->MaterialDescription : null; $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['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'); $data['ServiceOption'] = $this->requistion_model->getConfigValue('C022');
$this->loadViews("editrequisitionform", $this->global, $data, NULL); $this->loadViews("editrequisitionform", $this->global, $data, NULL);
} }

View File

@ -153,18 +153,18 @@ class Requistion_model extends Model
return $query->getResultArray(); return $query->getResultArray();
} }
function EditMaterialCode($ReqNo,$ReqType) // This function also called in store req. also $reqType not removed.....
{ function EditMaterialCode($ReqNo, $ReqType = NULL){
$subQuery ='SELECT Mat.MaterialCode,Mat.MaterialName,Mat.UOM $subQuery = 'SELECT Mat.MaterialCode, Mat.MaterialName, Mat.UOM FROM t_materialmaster Mat
from t_materialmaster Mat where Mat.MaterialCode not in (select Req.MaterialCode from t_requestion_details Req WHERE Mat.MaterialCode NOT IN (
join t_requestion_master mast on Req.ReqNo = mast.ReqNo where mast.ReqNo=? and mast.ReqType=? SELECT Req.MaterialCode FROM t_requestion_details Req
) and Mat.MaterialType=?'; JOIN t_requestion_master mast ON Req.ReqNo = mast.ReqNo
WHERE mast.ReqNo = ?' . ($ReqType ? ' AND mast.ReqType = ?' : '') .')'
$query = $this->db->query($subQuery, [$ReqNo,$ReqType,$ReqType]); . ($ReqType ? ' AND Mat.MaterialType = ?' : '');
$params = $ReqType ? [$ReqNo, $ReqType, $ReqType] : [$ReqNo];
$query = $this->db->query($subQuery, $params);
return $query->getResult(); return $query->getResult();
} }
@ -583,6 +583,17 @@ class Requistion_model extends Model
return $query->getResult(); 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

View File

@ -93,6 +93,7 @@ td {
text-align:center !important; text-align:center !important;
width:10%; width:10%;
} }
.hidden-column { display: none; }
</style> </style>
<script type="text/javascript"> <script type="text/javascript">
@ -209,6 +210,7 @@ td {
<th class="th th-PoQuantity">PoQuantity</th> <th class="th th-PoQuantity">PoQuantity</th>
<th class="th th-status">Status</th> <th class="th th-status">Status</th>
<th class="th">Action</th> <th class="th">Action</th>
<th class="hidden-column">Mategory Category</th>
</tr> </tr>
</thead> </thead>
<tbody id="tempAppend"> <tbody id="tempAppend">
@ -234,6 +236,7 @@ td {
<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>&nbsp;&nbsp;&nbsp;</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> <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>&nbsp;&nbsp;&nbsp;</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>
<td class="hidden-column"><?php echo $record->CategoryName; ?></td>
</tr> </tr>
<?php $RowCount = $index; <?php $RowCount = $index;
} }
@ -403,14 +406,14 @@ td {
</div> </div>
</div> </div>
</div> </div>
<!-- <div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="form-group"> <div class="form-group">
<label for="EditCategory" class="control-label">Category</label> <label for="EditCategory" class="control-label">Category</label>
<input type ="text" id="EditCategory" readonly class="form-control"> <input type ="text" id="EditCategory" readonly class="form-control">
</div> </div>
</div> </div>
</div> --> </div>
<div class="row"> <div class="row">
<div class="col-md-12" id="EditotherDescription"> <div class="col-md-12" id="EditotherDescription">
<div class="form-group"> <div class="form-group">
@ -831,6 +834,7 @@ td {
<span class="ri-delete-bin-7-fill"></span> <span class="ri-delete-bin-7-fill"></span>
</a> </a>
</td> </td>
<td class="hidden-column">${categoryName}</td>
</tr> </tr>
`; `;
@ -929,6 +933,7 @@ td {
$('#EditDescription').val($cells.eq(2).text()); $('#EditDescription').val($cells.eq(2).text());
$('#EditUOM').val($cells.eq(3).text()); $('#EditUOM').val($cells.eq(3).text());
$('#EditQuantity').val($cells.eq(4).text()); $('#EditQuantity').val($cells.eq(4).text());
$('#EditCategory').val($cells.eq(8).text());
$('#Edituserid').val(userid); $('#Edituserid').val(userid);
}); });
}); });