From d57c6261e59929231ccae6d8927a7355aba40eaf Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Thu, 21 Sep 2017 15:44:26 +0530 Subject: [PATCH] import pdf --- application/controllers/purchaseorder.php | 5 +- application/models/purchaseorder_model.php | 4 +- application/views/capitalpopdf.php | 10 +- application/views/importpopdf.php | 582 ++++++++++++--------- application/views/poapproval_view.php | 2 +- application/views/porelease_view.php | 2 +- 6 files changed, 347 insertions(+), 258 deletions(-) mode change 100755 => 100644 application/views/importpopdf.php diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 23022790..c00ce4a7 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -1341,9 +1341,12 @@ public function importpoprint($PONO) $Depcode=''; $Currencycode=''; $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformationforPDF(); + $data['GetPoFormat'] = $this->purchaseorder_model->GetPoFormat($PONO); $data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetailsForPDF($PONO); $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); - //print_r( $data['releasedetails']); + + $data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO); + //print_r( $data['RequistionDetails']); foreach ($data['POItem'] as $Reqdby) { $Requester=$Reqdby->Requestedby; diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index 0a639cc0..dd28cd13 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -784,9 +784,9 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '') // join T_SupplierDetailsN sup on sup.SupplierID = POMaster.SupplierID // where LineItem.PONO =?'; - $subQuery='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,Mat.MaterialCode,Mat.MaterialName,Import_DispatchDetails, + $subQuery='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,Mat.MaterialCode,Mat.MaterialName,Import_DispatchDetails,LineItem.Per, Mat.UOM,Quantity,ReqMas.Requestedby,Rate,ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount , -ProductPrice,Tax.*,LineItem.CostCenterCode ,Date(ReqMast.ReqDate) as ReqDate,POMaster.*,sup.SupplierName,sup.Address,LineItem.AmendedDetails as LineAmend,AdvanceAmount, Pay.PaymentTerms as Pay,ROUND((Quantity *Rate),2 ) as BasicValue,HSNCODE +ProductPrice,Tax.*,LineItem.CostCenterCode ,Date(ReqMast.ReqDate) as ReqDate,POMaster.*,sup.SupplierName,sup.Address,LineItem.AmendedDetails as LineAmend,AdvanceAmount, Pay.PaymentTerms as Pay,ROUND((Quantity *Rate),2 ) as BasicValue,HSNCODE,sup.EmailAddress,sup.SupplierID,sup.PAN,sup.ContactNumber,sup.GSTNO FROM T_PurchaseOrder_LineItem LineItem join T_Requestion_Master ReqMas on ReqMas.ReqNo=LineItem.ReqNo join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode diff --git a/application/views/capitalpopdf.php b/application/views/capitalpopdf.php index d5fadc3e..786cbb01 100755 --- a/application/views/capitalpopdf.php +++ b/application/views/capitalpopdf.php @@ -49,11 +49,11 @@ { $CompanyName = $CO->CompanyName; $CompanyAddress = $CO->Address; - $companyEmail=$CO->EmailAddress; - $companyGst=$CO->GSTNO; - $companyPan=$CO->PAN; - $companyWebsit=$CO->companyWebsite; - $CompanyStateCode=$CO->StateCode; + $companyEmail=$CO->EmailAddress; + $companyGst=$CO->GSTNO; + $companyPan=$CO->PAN; + $companyWebsit=$CO->companyWebsite; + $CompanyStateCode=$CO->StateCode; } } foreach ($GetPoFormat[0] as $For) diff --git a/application/views/importpopdf.php b/application/views/importpopdf.php old mode 100755 new mode 100644 index b84195ba..132f3aa1 --- a/application/views/importpopdf.php +++ b/application/views/importpopdf.php @@ -13,8 +13,13 @@ $DeliverySchedule=''; $ServiceDescription = ''; $ReqBy=''; - $PaymentTerms=''; - $advance=0; + $PaymentTerms=''; + $advance=0; + $SupEmail=''; + $supplierPAN=''; + $InsuranceNo=''; + $InsuranceStatus=''; + $InsureOpt=''; $index=0; @@ -24,18 +29,33 @@ { $CompanyName = $CO->CompanyName; $CompanyAddress = $CO->Address; + $companyEmail=$CO->EmailAddress; + $companyGst=$CO->GSTNO; + $companyPan=$CO->PAN; + $companyWebsit=$CO->companyWebsite; + $CompanyStateCode=$CO->StateCode; } } + + + + foreach ($GetPoFormat[0] as $For) + { + $PONO = $For; + + } + $TotalOrderValue1=''; $PlaceofOrigin=''; + if(!empty($POItem)) { foreach ($POItem as $PO) { $ReqNo=$PO->ReqNo; - $PONO = $PO->PONO; + // $PONO = $PO->PONO; $postatus= $PO->Status; $SuplierName = $PO->SupplierName; $SuplierAddress = $PO->Address; @@ -62,10 +82,39 @@ } else{ $dtDe = new DateTime($PO->DeliveryDate, new DateTimeZone('Asia/Kolkata')); - $DeliveryDate = $dtDe->format('d-m-Y'); - $DeliverySchedule = ''; - $Import_DispatchDetails=$PO->Import_DispatchDetails; + $DeliveryDate = $dtDe->format('d-m-Y'); + $DeliverySchedule = ''; + $Import_DispatchDetails=$PO->Import_DispatchDetails; + + } + + + $supOfferNo=$PO->Supplier_Offer_No; + + $ourRef=$PO->Other_Reference; + $SupEmail=$PO->EmailAddress; + $supplierVendor=$PO->SupplierID; + $supplierPAN=$PO->PAN; + $SupplierContact=$PO->ContactNumber; + $supplierGST=$PO->GSTNO; + $finCap=$PO->Fincap; + $ModeOfShipment=$PO->Mode_Of_Shipment; + + if($PO->InsuranceStatus=='1') + { + $InsuranceStatus='YES'; + $InsuranceNo=$PO->InsuranceNumber; + } + + else + { + $InsuranceStatus='NO'; + $InsuranceNo=''; + } + + + } } //echo $SuplierName; @@ -105,19 +154,68 @@ } ?> - - - -
-
+ + + + + + + +
+
'; + } else { echo '
DRAFT
'; @@ -126,83 +224,111 @@ ?>
-
 
-
PURCHASE ORDER - PO NO:/I
+

 

- - - + + + + + + + + + + + + + +
PURCHASE ORDER
+
+
+ + + + - - - - - - - - -
+ web: + + PAN: - -

-

-
-

PO No:

-

Date:

-
-

Supplier :

- -

DISPATCH INSTRUCTION / SCHEDULE BY:

- - +
+ Email: + + GSTIN: +
+ + + Purchase Order No:
+ + + + PO Date :
+ + - -
- - - -

Indent ref: / dept: / ccd:

- - - -

Please arrange to deliver the materials listed below as per schedule to our works

- - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + +
#Item and DescriptionHSN CodeUOMQtyRate per unit in Basic Price in
Shipped From: +



Email :
Vendor code: PAN:
Contact : GSTIN:
Shipped To:

State code:
Dispatch Instruction:
Place of Orgin:
Indent :format("d-m-Y"); echo $date; ?>Dept: CCD: Fin cap:
+
+ + + +
+
+

Mode of Shipment :

+

Insurance :

+

Please arrange to deliver the material /services listed below as per schedule to our works

+ + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + AfterLandingCharge; $AfterHighSeasSalesCharge=$AfterHighSeasSalesCharge+$record->AfterHighSeasSalesCharge ; @@ -277,144 +402,105 @@ ?> -
SNoItem CodeITEM DESCRIPTIONHSNUOMQTYRate PER
MaterialName ; ?>HSNCODE;?>UOM ; ?>Quantity ; ?>Rate ; ?>Quantity*$record->Rate); - echo number_format($BasicValue,2,'.','') ; ?>
MaterialCode ; ?>MaterialName ; ?>HSNCODE;?>UOM ; ?>Quantity ; ?>Rate ; ?>Per ; ?>
-

 

- -

Payment Terms: 

- -
Special Instructions :
- ParentPO != ''){ - $i++; - } - } - } - if($i>0){ - ?> - - - - - - - - - - - - - - - - - LineAmend ; - } - } ?> - -
-

Amended Details

-
-" . $v->AmendedDetails . ""; - break; - } -}?> -
Item DescriptionPrevious DetailsCurrent Details
- - - -

 

- - - - - - - - - - - + + + + + + + + + + -

 

-
 Released By : FirstName;?>
-
 Released On : format('d-m-Y');?>
- - - - - - - - +
Total Amount In Words

Total Amount In   
Advance Paid In    
Balance amount needs to pay   
- - - - ReleasedOn, new DateTimeZone('Asia/Kolkata')); - - - ?> - + +


- -

 

-

Authorized Signatory

-
-   -

Note: Please acknowledge receipt of this order for acceptance

-

          Material to be delivered to our stores before 3pm  

-

          Please refer order number and item code in your challan/invoice       

-

 

-
+ + ParentPO != ''){ + $i++; + } + } + } + if($i>0){ + ?> + + + + + + + + + + + + + + + + + LineAmend ; + } + } ?> + +
+

Amended Details

+
+ " . $v->AmendedDetails . ""; + break; + } + }?> +
Item DescriptionPrevious DetailsCurrent Details
+ +   +

Special instructions:

+

+ + + + + + + + + + + + + + + + + + +
+

Payment terms:

+

+
Total Amount InOrder Value
  
Order value in words:
+
+ \ No newline at end of file diff --git a/application/views/poapproval_view.php b/application/views/poapproval_view.php index 8d23a310..78d43431 100755 --- a/application/views/poapproval_view.php +++ b/application/views/poapproval_view.php @@ -58,7 +58,7 @@ if(empty($Status)) - PONO ?>     + PONO ?>     RType=='IMPORT' || $record->RType=='CAPITAL')&&($record->StatusCode!='ST015')) diff --git a/application/views/porelease_view.php b/application/views/porelease_view.php index 9a5b1564..e162584b 100755 --- a/application/views/porelease_view.php +++ b/application/views/porelease_view.php @@ -67,7 +67,7 @@ if(empty($Status)) - PONO ?> + PONO ?>