pears.GetInvoiceCompanyID

Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.

CREATE FUNCTION "pears"."GetInvoiceCompanyID"( 
  /* Application Maintained Function / Procedure - DO NOT EDIT*/
  IN "sclientcode" CHAR(12) ) 
RETURNS CHAR(20)
BEGIN
  DECLARE "rv" CHAR(20);
  SELECT FIRST "companyid" INTO "rv" FROM "company" WHERE "sclientcode" IS NOT NULL AND "clientcode" = "sclientcode" ORDER BY "isnull"("invoiceaddress",0) DESC;
  RETURN("rv")
END
  • database/functions/pears_getinvoicecompanyid.txt
  • Last modified: 2026/08/07 19:24
  • by 127.0.0.1