Add Amazon revenue accounting

This commit is contained in:
ZeroIchiro
2026-09-23 19:56:19 +00:00
parent ecc602831a
commit dbeb86dd6c
8 changed files with 182 additions and 95 deletions
+2
View File
@@ -30,6 +30,7 @@ CREATE TABLE IF NOT EXISTS books (
printing_costs DECIMAL(10,2) NOT NULL DEFAULT 0.00,
selling_price DECIMAL(10,2) NOT NULL DEFAULT 0.00,
ebook_price DECIMAL(10,2) NOT NULL DEFAULT 0.00,
amazon_gross DECIMAL(10,2) NOT NULL DEFAULT 0.00,
isbn_print VARCHAR(20) NULL,
isbn_ebook VARCHAR(20) NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -55,6 +56,7 @@ CREATE TABLE IF NOT EXISTS book_sales (
wholesale_quantity INT UNSIGNED NOT NULL DEFAULT 0,
bookseller_quantity INT UNSIGNED NOT NULL DEFAULT 0,
direct_quantity INT UNSIGNED NOT NULL DEFAULT 0,
amazon_quantity INT UNSIGNED NOT NULL DEFAULT 0,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (book_id),
CONSTRAINT fk_book_sales_book FOREIGN KEY (book_id) REFERENCES books (id) ON DELETE CASCADE