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.IQacJournalOutstandingAmount ====== <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"."IQacJournalOutstandingAmount" IS {create function IQacJournalOutstandingAmount /* Application Maintained Function / Procedure - DO NOT EDIT*/ (in DocID char(8),in LineNo smallint) returns decimal(12,2) begin declare rv decimal(12,2); declare amt decimal(12,2); set amt=0.0; set rv=0.0; // Only makes sense for suballocatable lines select first allocamount into amt from iqacjournal where documentid = DocID and linenumber = LineNo; select sum(allocatedamount) into rv from iqacallocation where allocateddocumentid = DocID and allocatedlinenumber = LineNo; set rv=isnull(amt,0.0)-isnull(rv,0.0); return rv end } </code> database/procedures/pears_iqacjournaloutstandingamount.txt Last modified: 2026/08/07 19:24by 127.0.0.1