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.IQacDocumentTemplate ====== <WRAP center round info> Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. </WRAP> ===== Description ===== Templates for Financial Documents. By the default the system uses two templates with IDs 'SalesInvoice' and 'Receipt' and Class 'Invoice' and 'Payment' respectively. ===== Columns ===== ^ Column ^ Type ^ Null ^ Default ^ Comment ^ | **DocumentTemplateID** | char(12) | NOT NULL | | | | Name | char(50) | NOT NULL | | | | DocumentClass | char(30) | NOT NULL | | Name of the Java class | | ControlLedgerID | char(12) | NULL | | | | PaymentLedgerID | char(12) | NULL | | | | PaymentAccountCode | char(12) | NULL | | | | VATNominalCode | char(12) | NULL | | | | ReportFile | char(100) | NULL | | | | DaysToPay | smallint | NULL | | | | Sign | smallint | NOT NULL | 1 | -1 for e.g. Credit Notes | | AutoNumberType | char(12) | NULL | | StartDoc, SaveDoc, PrintDoc, LinkTemplate, None | | AutoNumberNext | integer | NULL | | | | AutoNumberPrefix | char(12) | NULL | | | | DocumentType | char(30) | NULL | | Optional descriptive term e.g. Credit Note | | Defunct | smallint | NULL | | | ===== Primary Key ===== * DocumentTemplateID ===== Foreign Keys ===== ^ Constraint ^ Columns ^ References ^ Delete/update action ^ | IQacNominal | VATNominalCode | [[database:tables:pears_iqacnominal|pears.IQacNominal (NominalCode)]] | | | ConLedger | ControlLedgerID | [[database:tables:pears_iqacledger|pears.IQacLedger (LedgerID)]] | | | PayLedger | PaymentLedgerID | [[database:tables:pears_iqacledger|pears.IQacLedger (LedgerID)]] | | | PayAccount | PaymentLedgerID, PaymentAccountCode | [[database:tables:pears_iqacaccount|pears.IQacAccount (LedgerID, AccountCode)]] | | ===== Referenced By ===== ^ Table ^ Constraint ^ Columns ^ Referenced columns ^ | [[database:tables:pears_companyaccount|pears.CompanyAccount]] | iqacdocumenttemplate | documenttemplateid | DocumentTemplateID | | [[database:tables:pears_division|pears.Division]] | iqacdocumenttemplate | documenttemplateid | DocumentTemplateID | | [[database:tables:pears_iqacaccountsettings|pears.IQacAccountSettings]] | iqacdocumenttemplate | documenttemplateid | DocumentTemplateID | | [[database:tables:pears_iqacdocument|pears.IQacDocument]] | IQacDocumentTemplate | DocumentTemplateID | DocumentTemplateID | | [[database:tables:pears_iqacpaymentmethod|pears.IQacPaymentMethod]] | IQacDocumentTemplate | DocumentTemplateID | DocumentTemplateID | | [[database:tables:pears_placement|pears.Placement]] | iqacdocumenttemplate | documenttemplateid | DocumentTemplateID | | [[database:tables:pears_vacancy|pears.vacancy]] | iqacdocumenttemplate | documenttemplateid | DocumentTemplateID | ===== Indexes ===== ^ Name ^ Type ^ Columns ^ Detail ^ | IQacDoc_Name | Unique index | Name | | ===== Triggers ===== ^ Name ^ Timing ^ Event ^ | WPK_iqacdocumenttemplate_INVOICEFORMATS | after | insert,delete,update order 1 | ===== Original SQL ===== <code sql> -- IQX database structure split by table -- Source: IQXDatabaseStructure - with comments.sql -- Table: "pears"."IQacDocumentTemplate" -- Table comment: Templates for Financial Documents. By the default the system uses two templates with IDs 'SalesInvoice' and 'Receipt' and Class 'Invoice' and 'Payment' respectively. -- Statement count: 13 CREATE TABLE "pears"."IQacDocumentTemplate" ( "DocumentTemplateID" char(12) NOT NULL ,"Name" char(50) NOT NULL ,"DocumentClass" char(30) NOT NULL ,"ControlLedgerID" char(12) NULL ,"PaymentLedgerID" char(12) NULL ,"PaymentAccountCode" char(12) NULL ,"VATNominalCode" char(12) NULL ,"ReportFile" char(100) NULL ,"DaysToPay" smallint NULL ,"Sign" smallint NOT NULL DEFAULT 1 ,"AutoNumberType" char(12) NULL ,"AutoNumberNext" integer NULL ,"AutoNumberPrefix" char(12) NULL ,"DocumentType" char(30) NULL ,"Defunct" smallint NULL ,PRIMARY KEY ("DocumentTemplateID" ASC) ) go COMMENT ON COLUMN "pears"."IQacDocumentTemplate"."DocumentClass" IS 'Name of the Java class' go COMMENT ON COLUMN "pears"."IQacDocumentTemplate"."Sign" IS '-1 for e.g. Credit Notes' go COMMENT ON COLUMN "pears"."IQacDocumentTemplate"."AutoNumberType" IS 'StartDoc, SaveDoc, PrintDoc, LinkTemplate, None' go COMMENT ON COLUMN "pears"."IQacDocumentTemplate"."DocumentType" IS 'Optional descriptive term e.g. Credit Note' go COMMENT ON TABLE "pears"."IQacDocumentTemplate" IS 'Templates for Financial Documents. By the default the system uses two templates with IDs ''SalesInvoice'' and ''Receipt'' and Class ''Invoice'' and ''Payment'' respectively.' go ALTER TABLE "pears"."IQacDocumentTemplate" ADD FOREIGN KEY "IQacNominal" ("VATNominalCode" ASC) REFERENCES "pears"."IQacNominal" ("NominalCode") go ALTER TABLE "pears"."IQacDocumentTemplate" ADD FOREIGN KEY "ConLedger" ("ControlLedgerID" ASC) REFERENCES "pears"."IQacLedger" ("LedgerID") go ALTER TABLE "pears"."IQacDocumentTemplate" ADD FOREIGN KEY "PayLedger" ("PaymentLedgerID" ASC) REFERENCES "pears"."IQacLedger" ("LedgerID") go ALTER TABLE "pears"."IQacDocumentTemplate" ADD FOREIGN KEY "PayAccount" ("PaymentLedgerID" ASC,"PaymentAccountCode" ASC) REFERENCES "pears"."IQacAccount" ("LedgerID","AccountCode") go CREATE UNIQUE INDEX "IQacDoc_Name" ON "pears"."IQacDocumentTemplate" ( "Name" ) go create trigger "WPK_iqacdocumenttemplate_INVOICEFORMATS" after insert,delete,update order 1 on "pears"."iqacdocumenttemplate" for each statement begin call "WPKTrackChange"('P','INVOICEFORMATS') end go COMMENT TO PRESERVE FORMAT ON TRIGGER "pears"."IQacDocumentTemplate"."WPK_iqacdocumenttemplate_INVOICEFORMATS" IS {create trigger WPK_iqacdocumenttemplate_INVOICEFORMATS after insert,delete,update order 1 on iqacdocumenttemplate for each statement begin call WPKTrackChange('P','INVOICEFORMATS') end } go </code> database/tables/pears_iqacdocumenttemplate.txt Last modified: 2026/08/07 19:24by 127.0.0.1