diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 07dd895d..1a89c03f 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -103,105 +103,130 @@ class purchaseorder extends BaseController /** * This function used to show the Purchase Order Screen */ - function CreatePurchaseOrder() + function CreatePurchaseOrder() { - - $this->form_validation->set_rules('txtReqNo', 'txtReqNo', 'callback_Req_validate'); - - if($this->form_validation->run() == FALSE) + + $this->form_validation->set_rules('txtReqNo', 'txtReqNo', 'callback_Req_validate'); + + if($this->form_validation->run() == FALSE) { $this->requisition(); - + } else { - + $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['Payment']=$this->purchaseorder_model->getSupplierPayment('C009'); - $data['Payment']=$this->purchaseorder_model->getPaymentTermsDetails(); - //$data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019'); - $data['WorkStatus']=$this->purchaseorder_model->getStatus(7); - + $data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006'); + $data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018'); + $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); + $data['Payment']=$this->purchaseorder_model->getSupplierPayment('C009'); + $data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019'); + + + foreach ($data['WorkStatus'] as $WST) + { + + $WStatus=$WST->ConfigValue; + //print_r($WStatus); - - - $SelectedReq = json_decode($this->input->post('txtReqNo')); - - $Req = $SelectedReq->Req; - $data['ReqList'] = $Req ; - $ReqArray = array(); - $ReqType = $this->input->post('txtReqType'); - $result = array(); - - foreach ($Req as $SID): - $ReqArray[] = $SID->ReqNo ; - $result[] = $this->purchaseorder_model->getRawPOMaterialList($SID->ReqNo); - if($ReqType == '') - { - $ReqType = $SID->ReqType; - } - - endforeach; - - - $data['MaterialList'] = $result; - //print_r($data['MaterialList']); - /* Cost code from Requisition - Client Review Fix - Start here */ - $ReqDetails = $this->purchaseorder_model->getRequistDetails($ReqArray); - $data['RequistionDetails'] = $ReqDetails; - - $CostCode = ''; - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - - $Year = $dt->format('Y'); - - foreach ($ReqDetails as $Rs): - $CostCode = $Rs->CostCenterCode; - endforeach; - - $AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType); - - - if(count($AvlBudget)>0) - { - $data['AvlBudAmt'] = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['Totalvalue']; - } - /* End Here */ - - $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); - // $data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate(); - $data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate(); - $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); - $data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR'); - //print_r($data['INRSYMBOL']); + } + + + //print_r($data['WorkStatus']); + // foreach ($data['Suplist'] as $SUP) + // { + // $Detail=$SUP->PaymentTerms; + // } + + //print_r($data['Payment']); + //print_r($data['Suplist']); + $SelectedReq = json_decode($this->input->post('txtReqNo')); + + $Req = $SelectedReq->Req; + $data['ReqList'] = $Req ; + $ReqArray = array(); + $ReqType = $this->input->post('txtReqType'); + $result = array(); + + foreach ($Req as $SID): + $ReqArray[] = $SID->ReqNo ; + $result[] = $this->purchaseorder_model->getRawPOMaterialList($SID->ReqNo); + if($ReqType == '') + { + $ReqType = $SID->ReqType; + } + + endforeach; + + + $data['MaterialList'] = $result; + //print_r($data['MaterialList']); + /* Cost code from Requisition - Client Review Fix + Start here */ + $ReqDetails = $this->purchaseorder_model->getRequistDetails($ReqArray); + $data['RequistionDetails'] = $ReqDetails; + $CostCode = ''; + $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); + + $Year = $dt->format('Y'); + + foreach ($ReqDetails as $Rs): + $CostCode = $Rs->CostCenterCode; + endforeach; + + $AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$Year,$ReqType); + + + if(count($AvlBudget)>0) + { + $data['AvlBudAmt'] = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['Totalvalue']; + } + /* End Here */ + + $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); + //print_r($data['CompanyDetails']); + // $data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate(); + $data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate(); + $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); + $data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR'); + //print_r($data['INRSYMBOL']); + + $AvlimportBudget = $this->purchaseorder_model->GetAvailableImportBudgetAmount($CostCode,$Year,$ReqType); + + //print_r($AvlimportBudget); + + + if(count($AvlimportBudget)>0) + { + $data['AvlimportBudAmt'] = $AvlimportBudget[0]['BudgetAmount'] - $AvlimportBudget[0]['TotalValue']; + } + + //print_r($data['AvlimportBudAmt']); // $data[$Rate->ExchangeRate]=$Rate->ExchangeRate; //$data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency); - - $ViewName = ''; - if($ReqType == REVENUE) - { - $ViewName = 'purchaseorder'; - } + + $ViewName = ''; + if($ReqType == REVENUE) + { + $ViewName = 'purchaseorder'; + } else if($ReqType == SERVICE) - { - $ViewName = 'servicePurchaseorder'; - } - else if($ReqType == IMPORT) - { - $ViewName = 'importpo'; - } - else if($ReqType == CAPITAL) - { - $ViewName = 'capitalpurchaseorder'; - } + { + $ViewName = 'servicePurchaseorder'; + } + else if($ReqType == IMPORT) + { + $ViewName = 'importpo'; + } + else if($ReqType == CAPITAL) + { + $ViewName = 'capitalpurchaseorder'; + } $this->loadViews($ViewName, $this->global,$data, NULL); - } + } } function CreatePOPrint() { diff --git a/application/views/Amendedimportpopdf.php b/application/views/Amendedimportpopdf.php new file mode 100644 index 00000000..3f9db5e8 --- /dev/null +++ b/application/views/Amendedimportpopdf.php @@ -0,0 +1,397 @@ +CompanyName; + $CompanyAddress = $CO->Address; + } + } + + + if(!empty($POItem)) + { + + foreach ($POItem as $PO) + { + $ReqNo=$PO->ReqNo; + $PONO = $PO->PONO; + $postatus= $PO->Status; + $SuplierName = $PO->SupplierName; + $SuplierAddress = $PO->Address; + $DeliveryAddress = $PO->DeliveryAddress; + + $dt = new DateTime($PO->PODate, new DateTimeZone('Asia/Kolkata')); + $Podt = $dt->format('d-m-Y'); + $dtDe = new DateTime($PO->DeliveryDate, new DateTimeZone('Asia/Kolkata')); + $DeliveryDate = $dtDe->format('d-m-Y'); + $ServiceDescription =$PO->ServiceDescription; + $CostCenterCode=$PO->CostCenterCode; + //$ReqBy=$PO->Requestedby; + + $PaymentTerms = $PO->PaymentTerms; + $PaymentDays=$PO->PaymentDays; + $PayableAT=$PO->PayableAT; + } + } + + + if(!empty($Requestername)) + + { + foreach ($Requestername as $Reqname) + { + $ReqBy=$Reqname->FirstName; + } + } + + $CurrencyCode=''; + $CurrencyName=''; + + if(!empty($Currencytype)) + { + foreach ($Currencytype as $CURRE) + { + $CurrencyCode=$CURRE->Currency_Code; + $CurrencyName=$CURRE->FontCode2000; + } + + } + + // echo $CurrencyCode; + + $DEPNAME=''; + + if(!empty($DEPCODE)) + { + foreach ($DEPCODE as $DEP) + { + $DEPNAME=$DEP->DepartmentName; + } + } + + + + + +?> + +
+ +|
+ + + |
+||
|
+ Vendor Address : + |
+
+ Delivery To : + + |
+|
| PO DATE : | +DELIVERY DATE / SCHEDULE BY : | +PLACE OF ORIGIN: UAE | +
| Requistion Number | +Requested By | +Requested Department | +Cost Center | +
| + | + | + | + |
| # | +Item and Description | +Qty | +UOM + | Rate per unit in | +Basic Price in | +Total Amount in | + +
|---|---|---|---|---|---|---|
| + | MaterialName ; ?> | +Quantity ; ?> | +UOM ; ?> | +Rate ; ?> | +Quantity*$record->Rate); + echo number_format($BasicValue,2) ; ?> | +TotalOrderValue; ?> | + +
+ + +
+ + +
|
+ Amended Details + |
+ |||
| +" . $v->AmendedDetails . ""; + break; + } + + +}?> + | +|||
| Item Description | +previous Details | + +||
| MaterialName ; ?> | +AmendedDetails ?> | + +||
+
| Total Amount In Words |
+ Total Amount In | +
|
+ Payment Terms + + |
+
+ Certified that the particulars given above are true and correct + ++ Authorized Signatory + |
+
+ +
+
|
- - |
-
|
+ + + |
+||
|
+ Vendor Address : + |
+
+ Delivery To : + + |
+|
| PO DATE : | +DELIVERY DATE / SCHEDULE BY : | +PLACE OF ORIGIN: | +
| Vendor Address : |
- Delivery To : |
-
| PO DATE : | -DELIVERY DATE / SCHEDULE BY : | -PLACE OF ORIGIN : | -
| - | - | - | + | + | + | + |
| # | Item and Description | Qty | +UOM | Rate per unit in | Basic Price in | Total Amount in | - +MaterialName ; ?> | Quantity ; ?> | -Rate ; ?> | +UOM ; ?> | +Rate),2) ; ?> | Quantity*$record->Rate); echo number_format($BasicValue,2) ; ?> | -BasicPriceInMTon; ?> | - +TotalOrderValue),2); ?> | + @@ -289,34 +259,32 @@ ?>
|---|
|
- - |
-
- - |
-
| Total Amount In Words |
+ Total Amount In | +
|
+ Payment Terms + + |
+
+ Certified that the particulars given above are true and correct + ++ Authorized Signatory + |
+
| Payment Terms
- |
- Certified that the particulars given above are true and correct Authorized Signatory |
-
+ +
| Released By: | -Released On: | -
| FirstName;?> | -format('d-m-Y');?> | -
+