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.iqacPostJournalLine ====== <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> create procedure "pears"."iqacPostJournalLine"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ in "pdocid" char(8),in "pnominalcode" char(12),in "pdescription" long varchar,in "pVATCode" char(3),in "pTimesheetLineID" char(20),in "pAccountCode" char(12),in "punitamount" double, in "pVatRate" double,in "pquantity" double,in "pDocDate" date,in "pUnitDesc" char(20),in "pXRef" char(1),in "pclass" char(20),in "Ledger" char(8) default 'Sales' ) begin declare "gamount" double; declare "Vamount" double; set "gamount" = "round"(-"pquantity"*"punitamount",2); set "Vamount" = "round"("gamount"*"pVATrate"/100.0,2); insert into "IQacJournal"( "DocumentID","LineNumber","NominalCode","AccountingDate", "LedgerID","AccountCode","XRefID","XRef","Description","Amount","JournalClass","GoodsAmount", "VATAmount","VATRate","VATCode","PriceEach","Quantity","ProductCode", "UnitDescription","XRefDocumentID","XRefLineNumber","CashVATCode","CashVATAmount" ) values( "pdocid", 1+"isnull"((select "max"("LineNumber") from "iqacjournal" where "documentid" = "pdocid"),0),"pnominalcode","pdocdate", if "pclass" = 'InvoiceControl' then "Ledger" endif, "pAccountCode","pTimesheetLineID","pXRef", "pdescription","GAmount","pclass", if("pclass" = 'InvoiceControl') or("pclass" = 'InvoiceVAT') then 0 else "GAmount" endif, "VAmount","pVatRate","pVATCode", if("pclass" = 'InvoiceControl') or("pclass" = 'InvoiceVAT') then 0 else if "Ledger" = 'Purchase' then-"punitamount" else "punitamount" endif endif, if("pclass" = 'InvoiceControl') or("pclass" = 'InvoiceVAT') then 0 else "pQuantity" endif, "pTimesheetLineID","pUnitDesc",'',0,"pVATCode",0 ) exception when others then resignal end go COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."iqacPostJournalLine" IS {create procedure iqacPostJournalLine /* Application Maintained Function / Procedure - DO NOT EDIT*/ (in pdocid char(8),in pnominalcode char(12),in pdescription long varchar,in pVATCode char(3),in pTimesheetLineID char(20),in pAccountCode char(12),in punitamount double, in pVatRate double,in pquantity double,in pDocDate date,in pUnitDesc char(20),in pXRef char(1),in pclass char(20), in Ledger char(8) default 'Sales') begin declare gamount double; declare Vamount double; set gamount=round(-pquantity*punitamount,2); set Vamount=round(gamount*pVATrate/100.0,2); insert into IQacJournal( DocumentID,LineNumber,NominalCode,AccountingDate, LedgerID,AccountCode,XRefID,XRef,Description,Amount,JournalClass,GoodsAmount, VATAmount,VATRate,VATCode,PriceEach,Quantity,ProductCode, UnitDescription,XRefDocumentID,XRefLineNumber,CashVATCode,CashVATAmount) values( pdocid, 1+isnull((select max(LineNumber) from iqacjournal where documentid = pdocid),0),pnominalcode,pdocdate, if pclass = 'InvoiceControl' then Ledger endif,pAccountCode,pTimesheetLineID,pXRef, pdescription,GAmount,pclass, if(pclass = 'InvoiceControl') or(pclass = 'InvoiceVAT') then 0 else GAmount endif, VAmount,pVatRate,pVATCode, if(pclass = 'InvoiceControl') or(pclass = 'InvoiceVAT') then 0 else if Ledger = 'Purchase' then -punitamount else punitamount endif endif, if(pclass = 'InvoiceControl') or(pclass = 'InvoiceVAT') then 0 else pQuantity endif, pTimesheetLineID,pUnitDesc,'',0,pVATCode,0) exception when others then resignal end } </code> database/procedures/pears_iqacpostjournalline.txt Last modified: 2026/08/07 19:24by 127.0.0.1