pears.IQacDocumentTemplate

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

Templates for Financial Documents. By the default the system uses two templates with IDs 'SalesInvoice' and 'Receipt' and Class 'Invoice' and 'Payment' respectively.

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
  • DocumentTemplateID
Constraint Columns References Delete/update action
IQacNominal VATNominalCode pears.IQacNominal (NominalCode)
ConLedger ControlLedgerID pears.IQacLedger (LedgerID)
PayLedger PaymentLedgerID pears.IQacLedger (LedgerID)
PayAccount PaymentLedgerID, PaymentAccountCode pears.IQacAccount (LedgerID, AccountCode)
Table Constraint Columns Referenced columns
pears.CompanyAccount iqacdocumenttemplate documenttemplateid DocumentTemplateID
pears.Division iqacdocumenttemplate documenttemplateid DocumentTemplateID
pears.IQacAccountSettings iqacdocumenttemplate documenttemplateid DocumentTemplateID
pears.IQacDocument IQacDocumentTemplate DocumentTemplateID DocumentTemplateID
pears.IQacPaymentMethod IQacDocumentTemplate DocumentTemplateID DocumentTemplateID
pears.Placement iqacdocumenttemplate documenttemplateid DocumentTemplateID
pears.vacancy iqacdocumenttemplate documenttemplateid DocumentTemplateID
Name Type Columns Detail
IQacDoc_Name Unique index Name
Name Timing Event
WPK_iqacdocumenttemplate_INVOICEFORMATS after insert,delete,update order 1
-- 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
  • database/tables/pears_iqacdocumenttemplate.txt
  • Last modified: 2026/08/07 19:24
  • by 127.0.0.1