diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 62981559..c9d80757 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -250,6 +250,35 @@ class purchaseorder extends BaseController } } + + function CreateMRIRPOPrint() + { + $PONO = $_GET['PONO']; + $POType = $_GET['POType']; + + if($POType == SERVICE) + { + $this ->mrirservicepoprint($PONO); + + } + else if($POType == REVENUE) + { + $this ->mrirrevenuepoprint($PONO); + + } + + else if($POType == IMPORT) + { + $this ->mririmportpoprint($PONO); + + } + else if($POType == CAPITAL) + { + $this ->mrirCapitalPoPrint($PONO); + + } + } + function CreaterevenuePOPrint() { $this->load->View("revenuepopdf", NULL); @@ -956,6 +985,53 @@ class purchaseorder extends BaseController $this->dompdf->stream("RevenuePOReport.pdf",$data,$php); } + + + +public function mrirrevenuepoprint($PONO) + { + // Load all views as normal + + + //$PONO = $_GET['PO']; + + $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); + $data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetailsForPDF($PONO); + $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); + $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR'); + + $Currencycode=''; + + $TotalOrderValue=$data['POItem'][0]->TotalOrderValue; + + $totalAmt=sprintf("%.2f", $TotalOrderValue); + + $data['TotalAmountInWords']= $this->convertNumber($totalAmt); + $data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO); + // Add header to pdf + //$this->load->view('includes/pdfheader'); + + // Load the pdf page with multiviews + $this->load->View("revenuepopdf", $data); + + // Add header to pdf + //$this->load->view('includes/pdffooter'); + + // Get output html + $php = $this->output->get_output(); + + // Load library + $this->load->library('dompdf_gen'); + + // Convert to PDF + $this->dompdf->load_html($php); + $this->dompdf->render(); + $data['Attachment'] = FALSE; + $this->dompdf->stream("RevenuePOReport.pdf",$data,$php); + +} + + public function servicepoprint($PONO) { @@ -1010,6 +1086,61 @@ class purchaseorder extends BaseController } + +public function mrirservicepoprint($PONO) + { + + // $this->load->view('includes/pdfheader'); + + // Load the pdf page with multiviews + $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); + $data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetailsForPrint($PONO); + + + $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); + + $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR'); + + //print_r( $data['CurrencySymbol']); + + $TotalOrderValue=0; + $Currencycode=''; + foreach ($data['POItem'] as $POValue) + { + + $TotalOrderValue=$TotalOrderValue + $POValue->TotalValue; + + + } + + + + $totalAmt=sprintf("%.2f", $TotalOrderValue); + + $data['TotalAmountInWords']= $this->convertNumber($totalAmt); + + $data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO); + + $this->load->View("servicepopdf", $data); + + // Add header to pdf + //$this->load->view('includes/pdffooter'); + + // Get output html + $php = $this->output->get_output(); + + // Load library + $this->load->library('dompdf_gen'); + + // Convert to PDF + $this->dompdf->load_html($php); + $this->dompdf->render(); + $data['Attachment'] = FALSE; + $this->dompdf->stream("ServicePOReport.pdf",$data,$php); + +} + + public function importpoprint($PONO) { @@ -1099,7 +1230,9 @@ public function importpoprint($PONO) $data['TotalAmountInWords']= $this->convertNumberSymbol($totalAmt,$SymbolCurrency,$SymbolCurrencyName,$PaiseVal); - $this->load->View("importpopdf", $data); + $this->load->View("importpopdf", $data); + + // $this->load->View("mririmportpopdf", $data); // Add header to pdf @@ -1121,6 +1254,120 @@ public function importpoprint($PONO) } + +public function mririmportpoprint($PONO) + { + + //$this->load->view('includes/pdfheader'); + + // Load the pdf page with multiviews + $Requester=''; + $Depcode=''; + $Currencycode=''; + $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); + $data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetailsForPDF($PONO); + $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); + //print_r( $data['releasedetails']); + foreach ($data['POItem'] as $Reqdby) + { + $Requester=$Reqdby->Requestedby; + + } + + foreach ($data['POItem'] as $CURTYPE) + { + $Currencycode=$CURTYPE->CurrencyType; + } + + $data['Requestername']=$this->purchaseorder_model->GerRequesterName($Requester); + + foreach ($data['Requestername'] as $ReqDep) + { + $Depcode=$ReqDep->Departmentcode; + } + + $data['DEPCODE']=$this->purchaseorder_model->GerRequesterDep($Depcode); + //print_r($data['Requestername']); + $data['Currencytype']=$this->purchaseorder_model->GerCurrencyCodeName($Currencycode); + $ProductPrice=''; + $TotalOrderValue = ''; + foreach ($data['POItem'] as $PO ) + { + $TotalOrderValue=$PO->TotalOrderValue; + } + + //$totalAmt=sprintf("%.2f", $ProductPrice); + //$data['TotalAmountInWords']= $this->convertNumber($totalAmt); + //print_r($data['TotalAmountInWords']); + + //$this->load->View("importpopdf", $data); + + + $CurrencyType=''; + if(!empty($data['POItem'])){ + $CurrencyType=$data['POItem'][0]->CurrencyType; + } + //echo $CurrencyType; + + if($CurrencyType=='') + { + $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR'); + } + else + { + $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName($CurrencyType); + } + + // $TotalOrderValue=$data['POItem'][0]->$TotalOrderValue; + //print_r($data['POItem'][0]); + + $totalAmt=sprintf("%.2f", $TotalOrderValue); + + $data['TotalAmountInWords']= $this->convertNumber($totalAmt); + + + + + $SymbolCurrency = ''; + $SymbolCurrencyName =''; + $PaiseVal = ''; + if(!empty($data['CurrencySymbol']) >0) + { + $SymbolCurrency=$data['CurrencySymbol'][0]->FontCode2000; + $SymbolCurrencyName=$data['CurrencySymbol'][0]->Currency; + $PaiseVal=$data['CurrencySymbol'][0]->PaiseVal; + } + $TotalOrderValue=$data['POItem'][0]->TotalOrderValue; + + $totalAmt=sprintf("%.2f", $TotalOrderValue); + + $data['TotalAmountInWords']= $this->convertNumberSymbol($totalAmt,$SymbolCurrency,$SymbolCurrencyName,$PaiseVal); + + + // $this->load->View("importpopdf", $data); + + $this->load->View("mririmportpopdf", $data); + + + // Add header to pdf + //s $this->load->view('includes/pdffooter'); + + // Get output html + $php = $this->output->get_output(); + + // Load library + $this->load->library('dompdf_gen'); + + // Convert to PDF + //$this->dompdf->set_paper(array(0, 0, 841.89, 1190.55), 'landscape'); + $this->dompdf->load_html($php); + $this->dompdf->render(); + $data['Attachment'] = FALSE; + ///$this->dompdf->stream("ImportPOReport.pdf",$data,$php); + +} + + /** * This function used to load the Delete the Requistion Items */ @@ -1423,7 +1670,7 @@ function addNewImportPurchaseOrder() //$TotalOrder = $this->input->post('txtToatlOrder'); $TotalOrder = $this->input->post('txttot'); echo $TotalOrder; - die(); + //die(); $POStatus = $this->input->post('txtStatus'); $CreateBy = $this->session->userdata ( 'userId' ); @@ -2236,6 +2483,81 @@ function addNewImportPurchaseOrder() } + + + + public function mrirCapitalPoPrint($PONO) + { + + + // Load the pdf page with multiviews + $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); + + $data['POItem'] = $this->purchaseorder_model->GetCapitalPurchaseOrderDetailsForPDF($PONO); + + $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); + + $CurrencyType=''; + if(!empty($data['POItem'])){ + $CurrencyType=$data['POItem'][0]->CurrencyType; + } + + + if($CurrencyType=='' OR $CurrencyType=='0'){ + $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR'); + + $TotalOrderValue=$data['POItem'][0]->TotalOrderValue; + + $totalAmt=sprintf("%.2f", $TotalOrderValue); + + $data['TotalAmountInWords']= $this->convertNumber($totalAmt); + } + + + else{ + $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName($CurrencyType); + $SymbolCurrency=$data['CurrencySymbol'][0]->FontCode2000; + $SymbolCurrencyName=$data['CurrencySymbol'][0]->Currency; + $PaiseVal=$data['CurrencySymbol'][0]->PaiseVal; + + $TotalOrderValue=$data['POItem'][0]->TotalOrderValue; + + $totalAmt=sprintf("%.2f", $TotalOrderValue); + + $data['TotalAmountInWords']= $this->convertNumberSymbol($totalAmt,$SymbolCurrency,$SymbolCurrencyName,$PaiseVal); + } + + + + + + + $data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO); + + + + $this->load->View("capitalpopdf", $data); + + // Add header to pdf + //$this->load->view('includes/pdffooter'); + + // Get output html + $php = $this->output->get_output(); + + // Load library + $this->load->library('dompdf_gen'); + + // Convert to PDF + $this->dompdf->load_html($php); + $this->dompdf->render(); + $data['Attachment'] = FALSE; + $this->dompdf->stream("CapitalPOReport.pdf",$data,$php); + +} + + + + /*This function is used to convert amount(digit) into words*/ public function convertNumber($number) diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index 6fabc042..6256f6e4 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -737,9 +737,11 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode join T_Import_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo join T_PurchaseOrder_Master POMaster on POMaster.PONO = LineItem.PONO join T_SupplierDetailsN sup on sup.SupplierID = POMaster.SupplierID +left join T_PurchaseOrder_AdvanceRequest PurAdv on POMaster.PONO=PurAdv.PONO where LineItem.PONO =?'; - $query = $this->db->query($subQuery,array($PONO)); + $query = $this->db->query($subQuery,array($PONO)); + //print_r($this->db->last_query()); return $query->result(); diff --git a/application/views/editimportpo.php b/application/views/editimportpo.php index 6a154809..4d77879e 100644 --- a/application/views/editimportpo.php +++ b/application/views/editimportpo.php @@ -2642,7 +2642,7 @@ if($PONOStatus == PO_RELEASED) - +
|
+ + + |
+||
|
+ Vendor Address : + |
+
+ Delivery To : + + |
+|
| PO DATE : | +DELIVERY DATE / SCHEDULE BY : | +PLACE OF ORIGIN: | +
| 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),2) ; ?> | +Quantity*$record->Rate); + echo number_format($BasicValue,2) ; ?> | + +Quantity*$record->Rate); + echo number_format($BasicValue,2) ; ?> | + +
+
| Total Amount In Words |
+ Total Amount In | + +Advance Amount : | +
|
+ Payment Terms + + |
+
+ Certified that the particulars given above are true and correct + ++ Authorized Signatory + |
+ |
+ +
+