Show pageOld revisionsBacklinksExport to PDFFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== pears.GetInvoicePDF ====== <WRAP center round info> Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. </WRAP> ===== Original SQL ===== <code sql> COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."GetInvoicePDF" IS {create function GetInvoicePDF /* Application Maintained Function / Procedure - DO NOT EDIT*/ (in @InvoiceNumber char(20),in @DocumentID char(20)) returns long varchar begin declare @rootpath char(250); declare @AccountCode char(12); declare @InvoiceDate date; if isnull(@InvoiceNumber,'') = '' and isnull(@DocumentID,'') = '' then return null end if; set @RootPath=WPKMaintainGetSwitchValue('PDFINDB','GLOBAL','LITERAL'); if "right"(@rootpath,1) <> '\\' then set @rootpath=string(@rootpath,'\\') end if; case when isnull(@InvoiceNumber,'') <> '' then select AccountCode,DocumentDate into @AccountCode,@InvoiceDate from IQACDocument where OurRef = @InvoiceNumber and DocumentClass = 'Invoice' when isnull(@DocumentID,'') <> '' then select AccountCode,DocumentDate,OurRef into @AccountCode,@InvoiceDate,@InvoiceNumber from IQACDocument where DocumentID = @DocumentID end case ; return(string(@rootpath,@AccountCode,'\\',dateformat(@InvoiceDate,'yyyymmdd'),'\\',@InvoiceNumber,'.pdf')) end } </code> database/procedures/pears_getinvoicepdf.txt Last modified: 2026/08/07 19:24by 127.0.0.1