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)) {

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); ?> - - -
@@ -488,7 +480,7 @@ if (!empty($INRSYMBOL)) { } echo form_multiselect('RequistionNo', $options, set_value('RequistionNo', array()), 'id="RequistionNo"', 'required="true"'); ?> -
+
@@ -498,7 +490,7 @@ if (!empty($INRSYMBOL)) { echo form_input($data); ?>
-
+
-
+
@@ -522,9 +514,8 @@ if (!empty($INRSYMBOL)) { echo Form_textarea($data); ?>
-
- - + +
@@ -544,7 +535,7 @@ if (!empty($INRSYMBOL)) { ?>
-
+
Select Delivery By*
@@ -561,7 +552,7 @@ if (!empty($INRSYMBOL)) {
- +
@@ -570,7 +561,7 @@ if (!empty($INRSYMBOL)) { echo form_textarea($data); ?> -
+ + +
@@ -601,13 +592,13 @@ if (!empty($INRSYMBOL)) { echo Form_textarea($data); ?>
-
- + +
Check Today's Foreign Exchange value (Click here) -
+
@@ -617,7 +608,7 @@ if (!empty($INRSYMBOL)) { echo form_input($data); ?>
-
+
*
@@ -627,7 +618,7 @@ if (!empty($INRSYMBOL)) { ?>
-
+
@@ -638,8 +629,8 @@ if (!empty($INRSYMBOL)) { echo form_input($data); ?>
-
- + +
@@ -651,7 +642,7 @@ if (!empty($INRSYMBOL)) { echo form_input($data); ?>
-
+
@@ -661,7 +652,7 @@ if (!empty($INRSYMBOL)) { echo form_input($data); ?>
-
+
@@ -671,7 +662,7 @@ if (!empty($INRSYMBOL)) { echo form_input($data); ?>
-
+
@@ -681,8 +672,8 @@ if (!empty($INRSYMBOL)) { echo form_input($data); ?>
-
- + +
@@ -694,7 +685,7 @@ if (!empty($INRSYMBOL)) { echo form_input($data); ?>
-
+
@@ -713,7 +704,7 @@ if (!empty($INRSYMBOL)) { ?>
-
+
-
+ - - + +
-
@@ -761,7 +750,7 @@ if (!empty($INRSYMBOL)) { echo form_dropdown('insuranceStatus', $optionsInsurance, set_value('insuranceStatus'), 'id="insuranceStatus" required="true" class="form-control select2"'); ?>
-
+
@@ -770,7 +759,7 @@ if (!empty($INRSYMBOL)) { echo form_input($data); ?>
-
+
-
- + +
-
-
+
+
+
-
- - - - - - - - - - - - - - - - - +
+
SNoRequisition NoItem CodeItem DescriptionLine Item SpecsQuantityUOMRateBasic AmountTax AmountTotal Order AmountAction
+ + + + + + + + + + + + + + + + - + - -
SNoRequisition NoItem CodeItem DescriptionLine Item SpecsQuantityUOMRateBasic AmountTax AmountTotal Order AmountAction
-
-
+ + + +
@@ -829,7 +818,7 @@ if (!empty($INRSYMBOL)) { $data = array('name' => 'CapitalBasicOrder', 'value' => set_value('CapitalBasicOrder'), 'id' => 'CapitalBasicOrder', 'class' => 'form-control num', 'readonly' => 'true',); echo form_input($data); ?> -
+
@@ -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); ?> -
+ - +
@@ -974,7 +963,7 @@ if (!empty($INRSYMBOL)) { echo form_input($data); ?>
-
+
@@ -984,19 +973,19 @@ if (!empty($INRSYMBOL)) { echo form_textarea($data); ?>
-
+
-
-
+
+
-
+
- + @@ -1012,15 +1001,17 @@ if (!empty($INRSYMBOL)) {   Save as Draft   Submit -
+
- + - + + + + + +
-
- -
- + +
+
-
- +
+
'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); ?> -
+ - + - + +
- - -
+ +
@@ -1957,7 +1941,8 @@ if (!empty($INRSYMBOL)) { ?>
-
+ +
@@ -1967,14 +1952,15 @@ if (!empty($INRSYMBOL)) { ?>
-
+ + + -
- - -
+ + +
@@ -1985,7 +1971,7 @@ if (!empty($INRSYMBOL)) { ?>
-
+
@@ -1995,14 +1981,15 @@ if (!empty($INRSYMBOL)) { ?>
-
+ + + -
- - -
+ + +
@@ -2013,7 +2000,7 @@ if (!empty($INRSYMBOL)) { ?>
-
+
@@ -2023,9 +2010,10 @@ if (!empty($INRSYMBOL)) { ?>
-
+ + + -
@@ -2049,9 +2037,9 @@ if (!empty($INRSYMBOL)) { ?>
- + - +
@@ -2060,7 +2048,7 @@ if (!empty($INRSYMBOL)) {
- +
-
+
- - + +
@@ -2100,11 +2088,11 @@ if (!empty($INRSYMBOL)) { ?>
-
+
- - + +
-
+
- - + +
@@ -2144,14 +2132,11 @@ if (!empty($INRSYMBOL)) { ?>
-
- - - +
- - + +
@@ -2169,11 +2154,11 @@ if (!empty($INRSYMBOL)) { ?>
-
+
- - + +
@@ -2191,14 +2176,14 @@ if (!empty($INRSYMBOL)) { ?>
-
- + +
- -
+ +
-
+
-
- - - + +
- + + -
@@ -2241,12 +2224,11 @@ if (!empty($INRSYMBOL)) { ?>
-
- -
+
+
- - + +
@@ -2256,12 +2238,11 @@ if (!empty($INRSYMBOL)) { ?>
-
- +
- +
Freight Type
- +
Freight Rate -

Cost Of The Product Per UOM


@@ -2319,78 +2299,63 @@ if (!empty($INRSYMBOL)) { $data = array('name' => 'EditPurQuantity', 'value' => set_value('EditPurQuantity'), 'id' => 'EditPurQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();'); echo form_input($data); ?> -
-
- - - - - - - - -
-
+
+
+ +
+
- 'EditCustomDutyExpenses ', 'value' => set_value('EditCustomDutyExpenses'), 'id' => 'EditCustomDutyExpenses', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true'); - echo form_input($data); - ?> -
- + 'EditCustomDutyExpenses ', 'value' => set_value('EditCustomDutyExpenses'), 'id' => 'EditCustomDutyExpenses', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();', 'readonly' => 'true'); + echo form_input($data); + ?>
-
+
-
+
+ +
- 'EditClearingCharges', 'value' => set_value('EditClearingCharges'), 'id' => 'EditClearingCharges', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();'); - echo form_input($data); - ?> -
- -
- - 'EditNett', 'value' => set_value('EditNett'), 'id' => 'EditNett', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true'); - echo form_input($data); - ?> -
- - + 'EditClearingCharges', 'value' => set_value('EditClearingCharges'), 'id' => 'EditClearingCharges', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();'); + echo form_input($data); + ?>
+
+ + 'EditNett', 'value' => set_value('EditNett'), 'id' => 'EditNett', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'readonly' => 'true'); + echo form_input($data); + ?> +
-
+ - - -
- -
-
- +
+
+ - 'EditItemDescription', 'value' => set_value('EditItemDescription'), 'id' => 'EditItemDescription', 'class' => 'form-control', 'rows' => '3', 'cols' => '40'); - echo form_textarea($data); ?> -
-
-
- + 'EditItemDescription', 'value' => set_value('EditItemDescription'), 'id' => 'EditItemDescription', 'class' => 'form-control', 'rows' => '3', 'cols' => '40'); + echo form_textarea($data); ?> +
+ + + - +