====== pears.IQacAllocation ====== Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. ===== Description ===== Allocates payments against invoices in cash accounting. ===== Columns ===== ^ Column ^ Type ^ Null ^ Default ^ Comment ^ | **AllocationDocumentID** | char(8) | NOT NULL | | | | **AllocatedDocumentID** | char(8) | NOT NULL | | | | **AllocatedLineNumber** | smallint | NOT NULL | | | | AllocatedAmount | numeric(12,2) | NOT NULL | | | | AllocatedVAT | numeric(12,2) | NOT NULL | | | | AllocationDate | date | NOT NULL | | | ===== Primary Key ===== * AllocationDocumentID, AllocatedDocumentID, AllocatedLineNumber ===== Foreign Keys ===== ^ Constraint ^ Columns ^ References ^ Delete/update action ^ | Journal | AllocatedDocumentID, AllocatedLineNumber | [[database:tables:pears_iqacjournal|pears.IQacJournal (DocumentID, LineNumber)]] | NOT NULL; | | IQacDocument | AllocationDocumentID | [[database:tables:pears_iqacdocument|pears.IQacDocument (DocumentID)]] | NOT NULL; | ===== Referenced By ===== * No incoming foreign keys found. ===== Indexes ===== * No indexes found. ===== Triggers ===== * No triggers found. ===== Original SQL ===== -- IQX database structure split by table -- Source: IQXDatabaseStructure - with comments.sql -- Table: "pears"."IQacAllocation" -- Table comment: Allocates payments against invoices in cash accounting. -- Statement count: 4 CREATE TABLE "pears"."IQacAllocation" ( "AllocationDocumentID" char(8) NOT NULL ,"AllocatedDocumentID" char(8) NOT NULL ,"AllocatedLineNumber" smallint NOT NULL ,"AllocatedAmount" numeric(12,2) NOT NULL ,"AllocatedVAT" numeric(12,2) NOT NULL ,"AllocationDate" date NOT NULL ,PRIMARY KEY ("AllocationDocumentID" ASC,"AllocatedDocumentID" ASC,"AllocatedLineNumber" ASC) ) go COMMENT ON TABLE "pears"."IQacAllocation" IS 'Allocates payments against invoices in cash accounting.' go ALTER TABLE "pears"."IQacAllocation" ADD NOT NULL FOREIGN KEY "Journal" ("AllocatedDocumentID" ASC,"AllocatedLineNumber" ASC) REFERENCES "pears"."IQacJournal" ("DocumentID","LineNumber") go ALTER TABLE "pears"."IQacAllocation" ADD NOT NULL FOREIGN KEY "IQacDocument" ("AllocationDocumentID" ASC) REFERENCES "pears"."IQacDocument" ("DocumentID") go