Guest User

Untitled

a guest
May 15th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     <cffunction name="generateQuoteDocument" access="public" output="false" returntype="string" hint="I create a PDF version of an order for the customer.">
  2.         <cfargument name="Order" required="true" type="any" hint="I'm an order which is to be quoted." />
  3.        
  4.             <!--- create a temporary local structure. --->
  5.             <cfset var LOCAL = structNew() />
  6.            
  7.             <!--- Generate the File Name. --->
  8.             <cfset LOCAL.FilePath = ExpandPath("/documents/") & "Quote_" & ARGUMENTS.Order.getOrder_Number() & "_" & dateFormat(now(), "dd-mm-yy") & "_" & timeFormat(now(), "HH-mm-ss") & ".pdf" />           
  9.  
  10.             <!---
  11.                 We need to assemble the required elements into the
  12.                 context structure so that the template can be
  13.                 rendered with all the correct data.
  14.             --->
  15.             <cfset LOCAL.Context = {
  16.                 Order = ARGUMENTS.Order
  17.             } />
  18.                        
  19.             <!--- Render the PDF document. --->        
  20.             <cfset getDocumenter().generate(LOCAL.FilePath, '/views/documents/quote/index.cfm', LOCAL.Context) />
  21.            
  22.         <!--- Return the file path. --->
  23.         <cfreturn LOCAL.FilePath />
  24.     </cffunction>
Add Comment
Please, Sign In to add comment