Added invoices page

This commit is contained in:
Pinga 2023-11-17 01:10:10 +02:00
parent ac61a4c3ad
commit 94053d17ca
8 changed files with 181 additions and 130 deletions

View file

@ -178,6 +178,23 @@ CREATE TABLE registry.statement (
primary key ("id")
);
CREATE TABLE registry.invoices (
id SERIAL PRIMARY KEY,
invoice_number VARCHAR(20),
registrar_id INT,
billing_contact_id INT,
issue_date TIMESTAMP(3),
due_date TIMESTAMP(3) DEFAULT NULL,
total_amount NUMERIC(10,2),
payment_status VARCHAR(10) DEFAULT 'unpaid' CHECK (payment_status IN ('unpaid', 'paid', 'overdue', 'cancelled')),
notes TEXT DEFAULT NULL,
created_at TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (registrar_id) REFERENCES registrar(id),
FOREIGN KEY (billing_contact_id) REFERENCES registrar_contact(id)
);
CREATE TABLE registry.contact (
"id" serial8,
"identifier" varchar(255) NOT NULL,