Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <cffunction name="generateQuoteDocument" access="public" output="false" returntype="string" hint="I create a PDF version of an order for the customer.">
- <cfargument name="Order" required="true" type="any" hint="I'm an order which is to be quoted." />
- <!--- create a temporary local structure. --->
- <cfset var LOCAL = structNew() />
- <!--- Generate the File Name. --->
- <cfset LOCAL.FilePath = ExpandPath("/documents/") & "Quote_" & ARGUMENTS.Order.getOrder_Number() & "_" & dateFormat(now(), "dd-mm-yy") & "_" & timeFormat(now(), "HH-mm-ss") & ".pdf" />
- <!---
- We need to assemble the required elements into the
- context structure so that the template can be
- rendered with all the correct data.
- --->
- <cfset LOCAL.Context = {
- Order = ARGUMENTS.Order
- } />
- <!--- Render the PDF document. --->
- <cfset getDocumenter().generate(LOCAL.FilePath, '/views/documents/quote/index.cfm', LOCAL.Context) />
- <!--- Return the file path. --->
- <cfreturn LOCAL.FilePath />
- </cffunction>
Add Comment
Please, Sign In to add comment