diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 9433bc14..cf89af0f 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -303,6 +303,19 @@ class purchaseorder extends BaseController // $data[$Rate->ExchangeRate]=$Rate->ExchangeRate; } + + foreach($data['POItem'] as $CUR) + { + + //print_r($CUR->CurrencyType); + $Currency=$CUR->CurrencyType; + + + // $data[$Rate->ExchangeRate]=$Rate->ExchangeRate; + } + //echo "$Currency"; + $data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency); + //print_r($data); $data['ExchangeRate']=$exRate; $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index f9277f25..0490175c 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -550,6 +550,16 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '') } + + function GetCurrencyDetail($Currency='') + { + + $subQuery='SELECT CurrencyCode,CurrencyName from T_Currency_Details where CurrencyCode=?'; + $query=$this->db->query($subQuery,array($Currency)); + return $query->result(); + + } + @@ -559,7 +569,7 @@ function GetImportPurchaseOrderDetails($PONO = '') $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName, Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue , - ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,ExchangeRate,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((Quantity *Rate)+(RMCIncludingCustomersPerKG*Quantity),2)as TotalOrderValue,ROUND((ExchangeRate*BasicPriceInMTon),2) as BasicINRValue,TotalValue, + ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,ExchangeRate,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((Quantity *Rate)+(RMCIncludingCustomersPerKG*Quantity),2)as TotalOrderValue,ROUND((ExchangeRate*BasicPriceInMTon),2) as BasicINRValue,TotalValue,CurrencyType, Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode diff --git a/application/views/editimportpo.php b/application/views/editimportpo.php index 4474d8c1..83e5558e 100755 --- a/application/views/editimportpo.php +++ b/application/views/editimportpo.php @@ -3,6 +3,7 @@ $AvlAmount = 0; $ReqType =''; //echo $ExchangeRate; +//echo $Currency; @@ -180,7 +181,8 @@ if(!empty($POMaster)) 'Select Currency'); + $options = array("0"=>'Select Currency'); + //print_r( $options); if(!empty($Currency)) { @@ -196,6 +198,10 @@ if(!empty($POMaster)) echo form_dropdown('currencytype', $options,set_value('currencytype'),'id="currencytype"' ,'required="true"' ,'class="form-control select2'); + + + + ?> -" /> +" /> + @@ -1789,7 +1796,10 @@ var NilType = ''; }; $('#ExchangeRate').val(); -$('#AvlBudAmt').val(); +$('#EditAvlBudAmt').val(); + + + var txtexchangerate=parseFloat($('#ExchangeRate').val()); $('#EditExchangeRt').val(txtexchangerate); @@ -3119,7 +3129,7 @@ $("#editimportpomodel").on("shown.bs.modal", function(e) { //alert($('#Reqnumber'+userid).val()); $('#EditdeptName').val($('#departmentName'+userid).val()); $("#EditCostCenter").val($('#costCode'+userid).val()); - $('#EditAvlBudAmt').val($('#AvilBudget'+userid).val()); + // $('#EditAvlBudAmt').val($('#AvilBudget'+userid).val()); $('#EditItemName').val($('#materialName'+userid).val()); $('#EditUOM').val($('#uom'+userid).val()); diff --git a/application/views/importpo.php b/application/views/importpo.php index 69851c7a..c7c7b778 100755 --- a/application/views/importpo.php +++ b/application/views/importpo.php @@ -377,7 +377,7 @@ if(!empty($AvlBudAmt))