diff --git a/app/Controllers/Requisitionform.php b/app/Controllers/Requisitionform.php
index a81be6c8..03557737 100755
--- a/app/Controllers/Requisitionform.php
+++ b/app/Controllers/Requisitionform.php
@@ -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);
}
diff --git a/app/Models/Requistion_model.php b/app/Models/Requistion_model.php
index 28af2c0d..b5d7879d 100755
--- a/app/Models/Requistion_model.php
+++ b/app/Models/Requistion_model.php
@@ -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;
+ }
+
}
\ No newline at end of file
diff --git a/app/Views/capitalpurchaseorder.php b/app/Views/capitalpurchaseorder.php
index ed37acfd..3aa2f7ad 100755
--- a/app/Views/capitalpurchaseorder.php
+++ b/app/Views/capitalpurchaseorder.php
@@ -1,5 +1,5 @@
@@ -456,9 +451,9 @@ if (!empty($INRSYMBOL)) {
= "Capital Purchase Order"; ?>
Back
-
-
-
+
+
+
@@ -469,9 +464,6 @@ if (!empty($INRSYMBOL)) {
$attributes = array('class' => 'form-label-left CapitalPO ', 'name' => 'CapitalPO', 'id' => 'ImportPO', 'enctype' => 'multipart/form-data');
echo form_open(base_url() . '/purchaseorder/addPO/', $attributes); ?>
-
-
-
+
-
+
-
-
+
+
+
-
+
@@ -570,7 +561,7 @@ if (!empty($INRSYMBOL)) {
echo form_textarea($data);
?>
-
+
@@ -582,7 +573,7 @@ if (!empty($INRSYMBOL)) {
?>
-
+
+
-
+
+
+
+
-
+
+
+
+
+
-
+
+
+
+
-
+
-
-
+
+
+
-
-
+
+
+
+
@@ -839,28 +828,28 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
-
+
'txtTotCgst', 'value' => set_value('txtTotCgst'), 'id' => 'txtTotCgst', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
-
+
'txtTotSgst', 'value' => set_value('txtTotSgst'), 'id' => 'txtTotSgst', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
-
+
'txtTotIgst', 'value' => set_value('txtTotIgst'), 'id' => 'txtTotIgst', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
-
+
-
+
-
-
+
+
@@ -888,7 +877,7 @@ if (!empty($INRSYMBOL)) {
$data = array('name' => 'txttotallanding', 'value' => set_value('txttotallanding'), 'id' => 'txttotallanding', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
-
+
@@ -897,7 +886,7 @@ if (!empty($INRSYMBOL)) {
$data = array('name' => 'txttotalAssessable', 'value' => set_value('txttotalAssessable'), 'id' => 'txttotalAssessable', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
-
+
@@ -906,7 +895,7 @@ if (!empty($INRSYMBOL)) {
$data = array('name' => 'txttotalcustom', 'value' => set_value('txttotalcustom'), 'id' => 'txttotalcustom', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
-
+
@@ -915,7 +904,7 @@ if (!empty($INRSYMBOL)) {
$data = array('name' => 'txttotalSubtotal', 'value' => set_value('txttotalSubtotal'), 'id' => 'txttotalSubtotal', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
-
+
@@ -924,7 +913,7 @@ if (!empty($INRSYMBOL)) {
$data = array('name' => 'txttotalIgst', 'value' => set_value('txttotalIgst'), 'id' => 'txttotalIgst', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
-
+
@@ -933,7 +922,7 @@ if (!empty($INRSYMBOL)) {
$data = array('name' => 'txttotalcustomED', 'value' => set_value('txttotalcustomED'), 'id' => 'txttotalcustomED', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
-
+
@@ -942,7 +931,7 @@ if (!empty($INRSYMBOL)) {
$data = array('name' => 'txttotalcustomSH', 'value' => set_value('txttotalcustomSH'), 'id' => 'txttotalcustomSH', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
-
+
@@ -951,7 +940,7 @@ if (!empty($INRSYMBOL)) {
$data = array('name' => 'txttotalgrossduty', 'value' => set_value('txttotalgrossduty'), 'id' => 'txttotalgrossduty', 'class' => 'form-control', 'readonly' => 'true', 'style' => 'text-align:right;');
echo form_input($data);
?>
-
+
@@ -961,9 +950,9 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
-
+
-
+
+
+
+
+
-
+
-
+
+
+
@@ -1049,6 +1040,8 @@ if (!empty($INRSYMBOL)) {
+
+
@@ -1077,121 +1070,122 @@ if (!empty($INRSYMBOL)) {
+
-
+
'txtFreightlocedit', 'value' => set_value('txtFreightlocedit'), 'id' => 'txtFreightlocedit', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateFreightloceditper();');
echo form_input($data);
?>
-
+
@@ -1926,9 +1911,9 @@ if (!empty($INRSYMBOL)) {
$data = array('name' => 'txtAfterFreightlocedit', 'value' => set_value('txtAfterFreightlocedit'), 'id' => 'txtAfterFreightlocedit', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
-
+
-
+
-
+
+
+
+
+
+
+
-
+
+
+
+
-
+
+
+
+
-
-
+
-
+
+
+
-
-
-
+
+
-
+
+
-
-
-
+
+
-
-
+
+
-
+
-
-
-
-
-
-
-
-
-
+
+
-
+
-
+
-
-
-
-
-
+
+
+
-
+
@@ -2729,11 +2694,11 @@ if (!empty($INRSYMBOL)) {
RequistQuantity = obj.Quantity;
$('#RateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + CPUOMDisplay + ')');
$('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/Ton)');
- if(obj.material_rate != 0){
+ if (obj.material_rate != 0) {
Ratechange();
calculateFreight(3);
- calculateFreightlocaddper();
- }
+ calculateFreightlocaddper();
+ }
}
@@ -3523,7 +3488,7 @@ if (!empty($INRSYMBOL)) {
// Taxvalue: TotalTaxValue,
// TotalValue: Total
// }));
- var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
+ var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
var rowHtml = `
| ${temp} |
@@ -3637,7 +3602,7 @@ if (!empty($INRSYMBOL)) {
addHidden(theForm, "NoofTriploc" + temp, Nooftriploc);
addHidden(theForm, "FreightRateloc" + temp, Freightrateloc);
addHidden(theForm, "AfterFreightRateloc" + temp, AfterFreightAmountloc);
- addHidden(theForm, "LineItemNoteForAuditor" + temp, '-');
+ addHidden(theForm, "LineItemNoteForAuditor" + temp, '-');
// var a=parseFloat($('#NoofTriploc'+temp).val());
// console.log(Nooftriploc);
@@ -4387,10 +4352,10 @@ if (!empty($INRSYMBOL)) {
if (FreightTypeloc == '') {
$('#TripsValuelocedit').show();
-
+
} else {
$('#TripsValuelocedit').hide();
-
+
}
@@ -4546,50 +4511,50 @@ if (!empty($INRSYMBOL)) {
// return false;
// } else {
- // $('#content').loader('show');
- var formData = new FormData($('.CapitalPO')[0]);
- formData.append('ExchangeRateOn', ExchangeRateOn);
- formData.append('PaymentMethod', PaymentMethod);
- $('#loader').show();
- // disableButtons();
- $.ajax({
- data: formData,
- processData: false,
- contentType: false,
- // data:$('.CapitalPO').serialize()+"&ExchangeRateOn="+ExchangeRateOn+"&PaymentMethod="+PaymentMethod,
- type: "POST",
- url: "purchaseorder/addNewCapitalPurchaseOrder",
- success: function(data) {
- alert(data);
+ // $('#content').loader('show');
+ var formData = new FormData($('.CapitalPO')[0]);
+ formData.append('ExchangeRateOn', ExchangeRateOn);
+ formData.append('PaymentMethod', PaymentMethod);
+ $('#loader').show();
+ // disableButtons();
+ $.ajax({
+ data: formData,
+ processData: false,
+ contentType: false,
+ // data:$('.CapitalPO').serialize()+"&ExchangeRateOn="+ExchangeRateOn+"&PaymentMethod="+PaymentMethod,
+ type: "POST",
+ url: "purchaseorder/addNewCapitalPurchaseOrder",
+ success: function(data) {
+ alert(data);
+ $('#loader').hide();
+ if (data) {
+ // $('#content').loader('hide');
+
+ $('#txtRowCount').val('');
+ $('#txtDeletedRow').val('');
+ $('#SpcialInstruction').val('');
+ $('#txtDeliveryAddress').val('');
+ $('#CapitalToatlOrder').val('');
+
+ clearAfterAddLineItemAdd();
+ window.location = "purchaseorderListing";
+ // setTimeout(function() { enableButtons(); }, 2000);
+ } else {
$('#loader').hide();
- if (data) {
- // $('#content').loader('hide');
+ // $('#content').loader('hide');
+ alert("Error");
+ // setTimeout(function() { enableButtons(); }, 2000);
+ }
- $('#txtRowCount').val('');
- $('#txtDeletedRow').val('');
- $('#SpcialInstruction').val('');
- $('#txtDeliveryAddress').val('');
- $('#CapitalToatlOrder').val('');
+ },
+ error: function(jqXHR, textStatus, errorThrown) {
+ $('#loader').hide();
+ console.error("AJAX Error: " + textStatus + ": " + errorThrown);
+ alert("Error: " + textStatus);
+ // setTimeout(function() { enableButtons(); }, 2000);
+ }
- clearAfterAddLineItemAdd();
- window.location = "purchaseorderListing";
- // setTimeout(function() { enableButtons(); }, 2000);
- } else {
- $('#loader').hide();
- // $('#content').loader('hide');
- alert("Error");
- // setTimeout(function() { enableButtons(); }, 2000);
- }
-
- },
- error: function(jqXHR, textStatus, errorThrown) {
- $('#loader').hide();
- console.error("AJAX Error: " + textStatus + ": " + errorThrown);
- alert("Error: " + textStatus);
- // setTimeout(function() { enableButtons(); }, 2000);
- }
-
- });
+ });
// }
}
@@ -5424,12 +5389,12 @@ if (!empty($INRSYMBOL)) {
function Reset() {
- // disableButtons();
- location.reload();
- // setTimeout(function() {
- // enableButtons();
- // }, 2000);
- }
+ // disableButtons();
+ location.reload();
+ // setTimeout(function() {
+ // enableButtons();
+ // }, 2000);
+ }
$('#insuranceTxtDiv').hide();
$("#insuranceStatus").change(function() {
@@ -5957,7 +5922,7 @@ if (!empty($INRSYMBOL)) {
$('#editpackagingcalmodel').on('hidden.bs.modal', function() {
$('#EDITCAPITAL').modal('show');
- // $('.modal-backdrop').remove();
+ // $('.modal-backdrop').remove();
// console.log($('#edit'+tempUserId));
@@ -6054,14 +6019,14 @@ if (!empty($INRSYMBOL)) {
if (FreightType == "PER TRIP") {
$('#TripsValuelocedit').show();
-
+
// $(this).parent().removeClass('col-md-3').addClass('col-md-2');
// $('#NOOfTripslocedit').parent().removeClass('col-md-3').addClass('col-md-2');
// $('#txtFreightlocedit').parent().removeClass('col-md-3').addClass('col-md-2');
// $('#txtAfterFreightlocedit').parent().removeClass('col-md-3').addClass('col-md-2');
} else {
$('#TripsValuelocedit').hide();
-
+
// $(this).parent().removeClass('col-md-2').addClass('col-md-3');
// $('#NOOfTripslocedit').parent().removeClass('col-md-2').addClass('col-md-3');
// $('#txtFreightlocedit').parent().removeClass('col-md-2').addClass('col-md-3');
@@ -6113,25 +6078,25 @@ if (!empty($INRSYMBOL)) {
var Calculation = document.querySelector('input[name = "editoptPackaging"]:checked').value;
var FreightType = $("#drpFreighteditloc").val();
$('#editpackagingcalmodel').modal('hide');
- // $('.modal-backdrop').remove();
+ // $('.modal-backdrop').remove();
$('#EDITCAPITAL').modal('show');
$('#EDITCAPITAL').modal({
backdrop: 'static',
keyboard: false
});
- // if (!document.getElementById('modalScrollCSS')) {
- // var style = document.createElement('style');
- // style.id = 'modalScrollCSS'; // Assign an ID to the style tag to avoid duplicates
- // style.innerHTML = `
- // /* Force scroll by setting a max height */
- // .modal-body {
- // max-height: 540px;
- // overflow-y: auto;
- // }
- // `;
- // document.head.appendChild(style); // Append the CSS to the head
- // }
+ // if (!document.getElementById('modalScrollCSS')) {
+ // var style = document.createElement('style');
+ // style.id = 'modalScrollCSS'; // Assign an ID to the style tag to avoid duplicates
+ // style.innerHTML = `
+ // /* Force scroll by setting a max height */
+ // .modal-body {
+ // max-height: 540px;
+ // overflow-y: auto;
+ // }
+ // `;
+ // document.head.appendChild(style); // Append the CSS to the head
+ // }
if (FreightType == '') {
$('#txtAfterFreightlocedit').val('');
diff --git a/app/Views/editrequisitionform.php b/app/Views/editrequisitionform.php
index 1762c5ee..edcadf06 100755
--- a/app/Views/editrequisitionform.php
+++ b/app/Views/editrequisitionform.php
@@ -93,6 +93,7 @@ td {
text-align:center !important;
width:10%;
}
+.hidden-column { display: none; }