diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index b2413823..e16b0ee6 100644 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -116,7 +116,9 @@ class purchaseorder extends BaseController $this->global['pageTitle'] = 'Siddharth : Purchase order' ; $data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006'); $data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018'); - $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); + $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); + //$data['Suplist'] = $this->purchaseorder_model->getSupplierName(); + $data['Payment']=$this->purchaseorder_model->getSupplierPayment(); $SelectedReq = json_decode($this->input->post('txtReqNo')); $Req = $SelectedReq->Req; @@ -237,6 +239,7 @@ class purchaseorder extends BaseController endforeach; $data['MaterialList'] = $result;//$this->purchaseorder_model->getRawMaterialList($ReqType,$ReqArray); $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); + $data['Payment']=$this->purchaseorder_model->getSupplierPayment(); /* Cost code from Requisition - Client Review Fix Start here */ $ReqDetails = $this->purchaseorder_model->getRequistDetails($ReqArray); @@ -266,6 +269,11 @@ class purchaseorder extends BaseController $exRate=$Exc->ExchangeRate; } + foreach ($data['POMaster'] as $TER) + { + $PAYTERM=$TER->PaymentTerms; + } + //print_r($exRate); //$data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate(); $data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate(); @@ -300,19 +308,25 @@ class purchaseorder extends BaseController // print_r($data); $data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetails($PONO); $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); - - // foreach($data['POMaster'] as $CUR) - // { - - // //print_r($CUR->CurrencyType); - // $Currency=$CUR->Currency_Code; - // // $data[$Rate->ExchangeRate]=$Rate->ExchangeRate; - // } - // $data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency); - // //print_r($data['CurrencyDetail']); - + foreach($data['POMaster'] as $CUR) + { + + //print_r($CUR->CurrencyType); + $Currency=$CUR->CurrencyType; + + } + // $data[$Rate->ExchangeRate]=$Rate->ExchangeRate; + $data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency); + $data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO); + //print_r($data['PaymentTerms']); + foreach ($data['CurrencyDetail'] as $Detail) + { + $unicode=$Detail->FontCode2000; + } + //print_r($unicode); + $data['unicode']=$unicode; $this->global['pageTitle'] = 'Siddharth : Edit Import Purchase order form'; $this->loadViews("editimportpo", $this->global, $data, NULL); } @@ -920,8 +934,7 @@ public function importpoprint($PONO) - - function addNewImportPurchaseOrder() +function addNewImportPurchaseOrder() {//echo ("ggh"); $POdt =$this->input->post('PODate'); @@ -961,9 +974,12 @@ public function importpoprint($PONO) $Exchangerate=$this->input->post('ExchangeRate'); $ExchangeRateCalculatedon=$this->input->post('Exchangerateon'); $CurrencyType=$this->input->post('currencytype'); + $PaymentTerms=$this->input->post('PaymentTerms'); + $Payableat=$this->input->post('PayableAT'); + - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat); //print_r($POList); //die(); @@ -1117,9 +1133,12 @@ $createddt=''; $comma_separated = explode(':', $DeletedRow); $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $updateddt = $dt->format('Y-m-d H:i:s'); + + $PaymentTerms=$this->input->post('PaymentTerms'); + $Payableat=$this->input->post('PayableAT'); // PO Master // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType ); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat); //echo $PONO; //echo $TotalOrder; //print_r($POList); diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index c87873c9..94d84359 100644 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -439,11 +439,11 @@ function purchaseorderListing() } // This Method to get the Service PO Details for Edit the Item - function GetServicePurchaseOrder($PONO = '') + + function GetServicePurchaseOrder($PONO = '') { $this->db->distinct(); - $this->db->select('ReqNo,POMast.PONO,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,Stat.StatusCode,POMast.ExchangeRateCalculatedon,POMast.ExchangeRate,POMast.CurrencyType'); - + $this->db->select('ReqNo,POMast.PONO,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,Stat.StatusCode,POMast.ExchangeRateCalculatedon,POMast.ExchangeRate,POMast.CurrencyType,POMast.PaymentTerms,POMast.PayableAT'); $this->db->from('T_PurchaseOrder_Master POMast'); $this->db->join('T_SupplierDetailsN supp', 'supp.SupplierID = POMast.SupplierID'); $this->db->join('T_Status Stat', 'Stat.StatusCode = POMast.Status'); @@ -563,8 +563,29 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '') function GetCurrencyDetail($Currency='') { - $subQuery='SELECT * from T_Currency_Details where CurrencyCode=?'; + $subQuery='SELECT Currency_Code,Country_and_Currency,FontCode2000 from T_Currency_Details where Currency_Code=?'; $query=$this->db->query($subQuery,array($Currency)); + //print_r($query); + return $query->result(); + + } + + + function GetPaymentTerms($PONO='') + { + $subQuery='SELECT PaymentTerms from T_PurchaseOrder_Master where PONO=?'; + $query=$this->db->query($subQuery,array($PONO)); + //print_r($query); + return $query->result(); + + } + + function getSupplierPayment($Currency='') + { + + $subQuery='select distinct PaymentTerms from T_SupplierDetailsN'; + $query=$this->db->query($subQuery,array($Currency)); + //print_r($this->db->last_query()); return $query->result(); } diff --git a/application/views/editimportpo.php b/application/views/editimportpo.php index e2e714b6..9fd87470 100644 --- a/application/views/editimportpo.php +++ b/application/views/editimportpo.php @@ -3,14 +3,24 @@ $AvlAmount = 0; $ReqType =''; $Value=''; $EXCRATE=0; +//$Value="$"; //echo $ExchangeRate; //echo $Currency; +//echo $unicode; +$Value=$unicode; +//echo $Value; -// foreach ($CurrencyDetail as $Detail) -// { -// $Cur=$Detail->Currency_Code.' '.' - '.' '.$Detail->Country_and_Currency; -// } +foreach ($CurrencyDetail as $Detail) +{ + $Cur=$Detail->Currency_Code.' '.' - '.' '.$Detail->Country_and_Currency; +} + + +foreach ($PaymentTerms as $TER) +{ + $Terms=$TER->PaymentTerms; +} $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $CurrentDate = $dt->format('Y-m-d'); @@ -30,7 +40,7 @@ if(!empty($AvlBudAmt)) $AvlAmount = $AvlBudAmt; } -//echo $AvlAmount; +//echo $AvlBudAmt;; $CompanyAddress = ''; if(!empty($CompanyDetails)) @@ -93,7 +103,10 @@ if(!empty($POMaster)) $PONO = $Req->PONO; $ServiceDescription = $Req->ServiceDescription; $ExchangeRate=$Req->ExchangeRate; + //echo "$ExchangeRate"; $ExchangeRateCalculatedon=$Req->ExchangeRateCalculatedon; + $PaymentTerms=$Req->PaymentTerms; + $PayableAT=$Req->PayableAT; } } @@ -144,7 +157,12 @@ if(!empty($POMaster)) minDate : 'now', dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '0:+10' }); - + + $("#Requeston").datepicker({ + //minDate : d, + maxDate : 'now', + dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' + }); $("#Exchangerateon").datepicker({ minDate : m, @@ -206,8 +224,8 @@ if(!empty($POMaster)) $Cur); - $options = array("0"=>'Select Currency'); + $options = array("0"=>$Cur); + //$options = array("0"=>'Select Currency'); //print_r( $options); if(!empty($Currency)) @@ -239,10 +257,7 @@ if(!empty($POMaster)) ?> --> -
- + @@ -286,15 +301,7 @@ if(!empty($POMaster)) ?> -+
-
| - | -- | - Delivery Date :
-
- |
| # | -Item and Description | -Qty | -Rate per unit | -Basic Price | -Landing Charge | -High Seas Sales charge | -Custom duty (A) | -Excise duty (b) | -Excise duty ED_cess (C) | -Excise duty S & H cess (d) | -Custom ED_cess (e) | -Custom S & H cess (f) | -Additional Excise duty (g) | -Gross duty payable | -Available Modvat-set-off on import(b + c + d + g) | -Gross expenses due to custom duty | -purchase rate | -Quantity | -Custom Duty Expenses | -RMC Including Customers | -Total Amount | -
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| - | MaterialName ; ?> | -Quantity ; ?> | -Rate ; ?> | -Quantity*$record->Rate); - echo number_format($BasicValue,2) ; ?> | -AfterLandingCharge; ?> | -AfterHighSeasSalesCharge ; ?> | -AfterCustomDuty ; ?> | -AfterExciseDuty ; ?> | -AfterExciseDutyEdCess ; ?> | -AfterExciseDutySHCess ; ?> | -AfterCustomEdCess ; ?> | -AfterCustomSHCess ; ?> | -AfterAddlExciseDuty ; ?> | -Grossdutypayable ; ?> | -AvailableModvat ; ?> | -Grossexpensesduetocustomduty ; ?> | -purchaseratePerKG ; ?> | -CustomDutyExpensesPerKG ; ?> | -RMCIncludingCustomersPerKG ; ?> | -QuantityKG ; ?> | -TotalOrderValue; ?> | -
| Landing charge : | -- |
| High seas sales charge: | -- |
| Custom duty : | -- |
| Excise duty : | -- |
| Excise duty ED_cess : | -- |
| Excise duty S & H cess : | -- |
| Custom ED_cess : | -- |
| Custom S & H cess : | -- |
| Additional Excise duty : | -- |
| Gross duty payable : | -- |
| Available Modvat set-off on import : | -- |
| Gross expenses due to custom duty : | -- |
| Purchase Rate : | -- |
| Custom Duty Expenses : | -- |
| RMC Including Customers : | -- |
Total Order Amount : |
-- |
+
|
+ Vendor Address : + |
+
+ Delivery To : + |
+
+ Delivery Date : + |
| # | +Item and Description | +Qty | +Rate per unit | +Basic Price | +Total Amount | + +
|---|---|---|---|---|---|
| + | MaterialName ; ?> | +Quantity ; ?> | +Rate ; ?> | +Quantity*$record->Rate); + echo number_format($BasicValue,2) ; ?> | +TotalOrderValue; ?> | + +
Total Order Amount |
+ + |
| Requition Number : |
+ Requested by : |
+
+ Cost center : |
+