Added support for VAT calculations.

This commit is contained in:
2016-05-27 16:47:40 +02:00
parent 7b9bc06c52
commit 4ebfae307a
22 changed files with 500 additions and 59 deletions
+49 -35
View File
@@ -11,45 +11,59 @@
"schemaVersion" : 1,
"sql" : [
"CREATE TABLE \"VoucherItem\" (
\"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
\"name\" TEXT NULL,
\"count\" INTEGER NOT NULL,
\"unitPrice\" INTEGER NOT NULL,
\"price\" INTEGER NOT NULL,
\"refId\" INTEGER NOT NULL,
\"itemPlugin\" TEXT NULL,
\"vatType\" INTEGER NOT NULL);
\"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
\"name\" TEXT NULL,
\"count\" INTEGER NOT NULL,
\"unitPrice\" INTEGER NOT NULL,
\"vatRate\" INTEGER NOT NULL,
\"priceWitouthVat\" INTEGER NOT NULL,
\"price\" INTEGER NOT NULL,
\"refId\" INTEGER NOT NULL,
\"itemPlugin\" TEXT NULL,
\"vatType\" INTEGER NOT NULL);
CREATE TABLE \"Voucher\" (
\"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
\"name\" TEXT NULL,
\"description\" TEXT NULL,
\"contact\" INTEGER NULL,
\"totalPrice\" INTEGER NOT NULL,
\"status\" INTEGER NOT NULL,
CONSTRAINT \"contact_fk\"
FOREIGN KEY (\"contact\")
REFERENCES \"AddressbookData\" (\"id\")
DEFERRABLE INITIALLY DEFERRED);
CREATE TABLE \"Voucher\" (
\"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
\"name\" TEXT NULL,
\"description\" TEXT NULL,
\"contact\" INTEGER NULL,
\"vatRateHigh\" INTEGER NOT NULL,
\"vatRateFirstLower\" INTEGER NOT NULL,
\"vatRateSecondLower\" INTEGER NOT NULL,
\"priceNoVat\" INTEGER NOT NULL,
\"priceVatHigh\" INTEGER NOT NULL,
\"priceVatFirstLower\" INTEGER NOT NULL,
\"priceVatSecondLower\" INTEGER NOT NULL,
\"priceWitouthVat\" INTEGER NOT NULL,
\"totalPriceVatHigh\" INTEGER NOT NULL,
\"totalPriceVatFirstLower\" INTEGER NOT NULL,
\"totalPriceVatSecondLower\" INTEGER NOT NULL,
\"totalPrice\" INTEGER NOT NULL,
\"status\" INTEGER NOT NULL,
CONSTRAINT \"contact_fk\"
FOREIGN KEY (\"contact\")
REFERENCES \"AddressbookData\" (\"id\")
DEFERRABLE INITIALLY DEFERRED);
CREATE TABLE \"Voucher_items\" (
\"object_id\" INTEGER NOT NULL,
\"index\" INTEGER NOT NULL,
\"value\" INTEGER NULL,
CONSTRAINT \"object_id_fk\"
FOREIGN KEY (\"object_id\")
REFERENCES \"Voucher\" (\"id\")
ON DELETE CASCADE,
CONSTRAINT \"value_fk\"
FOREIGN KEY (\"value\")
REFERENCES \"VoucherItem\" (\"id\")
DEFERRABLE INITIALLY DEFERRED);
CREATE TABLE \"Voucher_items\" (
\"object_id\" INTEGER NOT NULL,
\"index\" INTEGER NOT NULL,
\"value\" INTEGER NULL,
CONSTRAINT \"object_id_fk\"
FOREIGN KEY (\"object_id\")
REFERENCES \"Voucher\" (\"id\")
ON DELETE CASCADE,
CONSTRAINT \"value_fk\"
FOREIGN KEY (\"value\")
REFERENCES \"VoucherItem\" (\"id\")
DEFERRABLE INITIALLY DEFERRED);
CREATE INDEX \"Voucher_items_object_id_i\"
ON \"Voucher_items\" (\"object_id\");
CREATE INDEX \"Voucher_items_object_id_i\"
ON \"Voucher_items\" (\"object_id\");
CREATE INDEX \"Voucher_items_index_i\"
ON \"Voucher_items\" (\"index\");"
CREATE INDEX \"Voucher_items_index_i\"
ON \"Voucher_items\" (\"index\");
"
],
"dependencies" : [ "ADDRESSBOOK" ]
}