Lines 823-847
CREATE TABLE `import_items` (
Link Here
|
823 |
KEY `branchcode` (`branchcode`) |
823 |
KEY `branchcode` (`branchcode`) |
824 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
824 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
825 |
|
825 |
|
826 |
-- |
|
|
827 |
-- Table structure for table 'invoice_adjustments' |
828 |
-- |
829 |
|
830 |
DROP TABLE IF EXISTS invoice_adjustments; |
831 |
CREATE TABLE IF NOT EXISTS invoice_adjustments ( |
832 |
adjustment_id int(11) NOT NULL AUTO_INCREMENT, -- primary key for adjustments |
833 |
invoiceid int(11) NOT NULL, -- foreign key to link an adjustment to an invoice |
834 |
adjustment decimal(28,6), -- amount of adjustment |
835 |
reason varchar(80) default NULL, -- reason for adjustment defined by authorised values in ADJ_REASON category |
836 |
note mediumtext default NULL, -- text to explain adjustment |
837 |
budget_id int(11) default NULL, -- optional link to budget to apply adjustment to |
838 |
encumber_open smallint(1) NOT NULL default 1, -- whether or not to encumber the finds when invoice is still open, 1 = yes, 0 = no |
839 |
timestamp timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- timestamp of last adjustment to adjustment |
840 |
PRIMARY KEY (adjustment_id), |
841 |
CONSTRAINT invoice_adjustments_fk_invoiceid FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE CASCADE ON UPDATE CASCADE, |
842 |
CONSTRAINT invoice_adjustments_fk_budget_id FOREIGN KEY (budget_id) REFERENCES aqbudgets (budget_id) ON DELETE SET NULL ON UPDATE CASCADE |
843 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
844 |
|
845 |
-- |
826 |
-- |
846 |
-- Table structure for table `issuingrules` |
827 |
-- Table structure for table `issuingrules` |
847 |
-- |
828 |
-- |
Lines 3159-3164
CREATE TABLE aqinvoices (
Link Here
|
3159 |
CONSTRAINT aqinvoices_fk_shipmentcost_budgetid FOREIGN KEY (shipmentcost_budgetid) REFERENCES aqbudgets (budget_id) ON DELETE SET NULL ON UPDATE CASCADE |
3140 |
CONSTRAINT aqinvoices_fk_shipmentcost_budgetid FOREIGN KEY (shipmentcost_budgetid) REFERENCES aqbudgets (budget_id) ON DELETE SET NULL ON UPDATE CASCADE |
3160 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
3141 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
3161 |
|
3142 |
|
|
|
3143 |
-- |
3144 |
-- Table structure for table 'aqinvoice_adjustments' |
3145 |
-- |
3146 |
|
3147 |
DROP TABLE IF EXISTS aqinvoice_adjustments; |
3148 |
CREATE TABLE IF NOT EXISTS aqinvoice_adjustments ( |
3149 |
adjustment_id int(11) NOT NULL AUTO_INCREMENT, -- primary key for adjustments |
3150 |
invoiceid int(11) NOT NULL, -- foreign key to link an adjustment to an invoice |
3151 |
adjustment decimal(28,6), -- amount of adjustment |
3152 |
reason varchar(80) default NULL, -- reason for adjustment defined by authorised values in ADJ_REASON category |
3153 |
note mediumtext default NULL, -- text to explain adjustment |
3154 |
budget_id int(11) default NULL, -- optional link to budget to apply adjustment to |
3155 |
encumber_open smallint(1) NOT NULL default 1, -- whether or not to encumber the finds when invoice is still open, 1 = yes, 0 = no |
3156 |
timestamp timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- timestamp of last adjustment to adjustment |
3157 |
PRIMARY KEY (adjustment_id), |
3158 |
CONSTRAINT aqinvoice_adjustments_fk_invoiceid FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE CASCADE ON UPDATE CASCADE, |
3159 |
CONSTRAINT aqinvoice_adjustments_fk_budget_id FOREIGN KEY (budget_id) REFERENCES aqbudgets (budget_id) ON DELETE SET NULL ON UPDATE CASCADE |
3160 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
3161 |
|
3162 |
-- |
3162 |
-- |
3163 |
-- Table structure for table `aqorders` |
3163 |
-- Table structure for table `aqorders` |
3164 |
-- |
3164 |
-- |