1 -- @tag: periodic_invoices
2 -- @description: Neue Tabellen und Spalten für Wiederkehrende Rechnungen
3 -- @depends: release_2_6_1
4 CREATE TABLE periodic_invoices_configs (
5 id integer NOT NULL DEFAULT nextval('id'),
6 oe_id integer NOT NULL,
7 periodicity varchar(10) NOT NULL,
8 print boolean DEFAULT 'f',
11 active boolean DEFAULT 't',
13 ar_chart_id integer NOT NULL,
16 FOREIGN KEY (oe_id) REFERENCES oe (id),
17 FOREIGN KEY (printer_id) REFERENCES printers (id),
18 FOREIGN KEY (ar_chart_id) REFERENCES chart (id)
21 CREATE TABLE periodic_invoices (
22 id integer NOT NULL DEFAULT nextval('id'),
23 config_id integer NOT NULL,
24 ar_id integer NOT NULL,
25 period_start_date date NOT NULL,
26 itime timestamp DEFAULT now(),
29 FOREIGN KEY (config_id) REFERENCES periodic_invoices_configs (id),
30 FOREIGN KEY (ar_id) REFERENCES ar (id)