upped the tax % number size allowed
This commit is contained in:
@@ -46,7 +46,7 @@ namespace AyaNova.Util
|
|||||||
(left digits max is precision minus scale)
|
(left digits max is precision minus scale)
|
||||||
|
|
||||||
CURRENCY: DECIMAL(38,18) (to support potential of cryptocurrencies) largest Etherium value fits in this (36bytes)
|
CURRENCY: DECIMAL(38,18) (to support potential of cryptocurrencies) largest Etherium value fits in this (36bytes)
|
||||||
TAX/PERCENTAGES/PDF PAGE SCALE: DECIMAL(8,5) largest tax I could find would fit in this, that's 3 digits to left and 5 to right
|
TAX/PERCENTAGES/PDF PAGE SCALE: DECIMAL(10,5) largest tax I could find would fit in this, (was 8,5 but Joyce had an item that was 8000% so changed to allow up to 10000%)
|
||||||
Taxes are in face value not fractional value, i.e. "7" not .07 in db
|
Taxes are in face value not fractional value, i.e. "7" not .07 in db
|
||||||
Inventory/incidents/service rate quantity etc general numbers (19,5)
|
Inventory/incidents/service rate quantity etc general numbers (19,5)
|
||||||
Latitude/longitude 9,6
|
Latitude/longitude 9,6
|
||||||
@@ -540,7 +540,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
//TAXCODE
|
//TAXCODE
|
||||||
await ExecQueryAsync("CREATE TABLE ataxcode (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
await ExecQueryAsync("CREATE TABLE ataxcode (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
||||||
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, "
|
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, "
|
||||||
+ "taxapct DECIMAL(8,5) NOT NULL default 0, taxbpct DECIMAL(8,5) NOT NULL default 0, taxontax BOOL NOT NULL default false)");
|
+ "taxapct DECIMAL(10,5) NOT NULL default 0, taxbpct DECIMAL(10,5) NOT NULL default 0, taxontax BOOL NOT NULL default false)");
|
||||||
|
|
||||||
//Global tax code defaults
|
//Global tax code defaults
|
||||||
await ExecQueryAsync("ALTER TABLE aglobalbizsettings ADD column taxpartpurchaseid BIGINT REFERENCES ataxcode, "
|
await ExecQueryAsync("ALTER TABLE aglobalbizsettings ADD column taxpartpurchaseid BIGINT REFERENCES ataxcode, "
|
||||||
@@ -592,8 +592,8 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
//CONTRACT
|
//CONTRACT
|
||||||
await ExecQueryAsync("CREATE TABLE acontract (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
await ExecQueryAsync("CREATE TABLE acontract (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
||||||
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, "
|
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, "
|
||||||
+ "responsetime INTERVAL NOT NULL, contractserviceratesonly BOOL NOT NULL, contracttravelratesonly BOOL NOT NULL, partsoverridepct DECIMAL(8,5) NOT NULL, partsoverridetype INTEGER NOT NULL, "
|
+ "responsetime INTERVAL NOT NULL, contractserviceratesonly BOOL NOT NULL, contracttravelratesonly BOOL NOT NULL, partsoverridepct DECIMAL(10,5) NOT NULL, partsoverridetype INTEGER NOT NULL, "
|
||||||
+ "serviceratesoverridepct DECIMAL(8,5) NOT NULL, serviceratesoverridetype INTEGER NOT NULL, travelratesoverridepct DECIMAL(8,5) NOT NULL, travelratesoverridetype INTEGER NOT NULL, "
|
+ "serviceratesoverridepct DECIMAL(10,5) NOT NULL, serviceratesoverridetype INTEGER NOT NULL, travelratesoverridepct DECIMAL(10,5) NOT NULL, travelratesoverridetype INTEGER NOT NULL, "
|
||||||
+ "alertnotes text "
|
+ "alertnotes text "
|
||||||
+ ")");
|
+ ")");
|
||||||
|
|
||||||
@@ -624,15 +624,15 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
|
|
||||||
//CONTRACTPARTOVERRIDE
|
//CONTRACTPARTOVERRIDE
|
||||||
await ExecQueryAsync("CREATE TABLE acontractpartoverride (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, contractid BIGINT NOT NULL REFERENCES acontract ON DELETE CASCADE, "
|
await ExecQueryAsync("CREATE TABLE acontractpartoverride (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, contractid BIGINT NOT NULL REFERENCES acontract ON DELETE CASCADE, "
|
||||||
+ " overridepct DECIMAL(8,5) NOT NULL, overridetype INTEGER NOT NULL CONSTRAINT chk_overridetype_valid CHECK (overridetype > 0 AND overridetype < 3), tags VARCHAR(255) ARRAY)");
|
+ " overridepct DECIMAL(10,5) NOT NULL, overridetype INTEGER NOT NULL CONSTRAINT chk_overridetype_valid CHECK (overridetype > 0 AND overridetype < 3), tags VARCHAR(255) ARRAY)");
|
||||||
|
|
||||||
//CONTRACTSERVICERATEOVERRIDE
|
//CONTRACTSERVICERATEOVERRIDE
|
||||||
await ExecQueryAsync("CREATE TABLE acontractservicerateoverride (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, contractid BIGINT NOT NULL REFERENCES acontract ON DELETE CASCADE, "
|
await ExecQueryAsync("CREATE TABLE acontractservicerateoverride (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, contractid BIGINT NOT NULL REFERENCES acontract ON DELETE CASCADE, "
|
||||||
+ " overridepct DECIMAL(8,5) NOT NULL, overridetype INTEGER NOT NULL CONSTRAINT chk_overridetype_valid CHECK (overridetype > 0 AND overridetype < 3), tags VARCHAR(255) ARRAY)");
|
+ " overridepct DECIMAL(10,5) NOT NULL, overridetype INTEGER NOT NULL CONSTRAINT chk_overridetype_valid CHECK (overridetype > 0 AND overridetype < 3), tags VARCHAR(255) ARRAY)");
|
||||||
|
|
||||||
//CONTRACTTRAVELRATEOVERRIDE
|
//CONTRACTTRAVELRATEOVERRIDE
|
||||||
await ExecQueryAsync("CREATE TABLE acontracttravelrateoverride (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, contractid BIGINT NOT NULL REFERENCES acontract ON DELETE CASCADE, "
|
await ExecQueryAsync("CREATE TABLE acontracttravelrateoverride (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, contractid BIGINT NOT NULL REFERENCES acontract ON DELETE CASCADE, "
|
||||||
+ " overridepct DECIMAL(8,5) NOT NULL, overridetype INTEGER NOT NULL CONSTRAINT chk_overridetype_valid CHECK (overridetype > 0 AND overridetype < 3), tags VARCHAR(255) ARRAY)");
|
+ " overridepct DECIMAL(10,5) NOT NULL, overridetype INTEGER NOT NULL CONSTRAINT chk_overridetype_valid CHECK (overridetype > 0 AND overridetype < 3), tags VARCHAR(255) ARRAY)");
|
||||||
|
|
||||||
//HEADOFFICE
|
//HEADOFFICE
|
||||||
await ExecQueryAsync("CREATE TABLE aheadoffice (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
await ExecQueryAsync("CREATE TABLE aheadoffice (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
||||||
@@ -1190,7 +1190,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
await ExecQueryAsync("CREATE TABLE areport (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL, active BOOL NOT NULL, "
|
await ExecQueryAsync("CREATE TABLE areport (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL, active BOOL NOT NULL, "
|
||||||
+ "notes TEXT, roles INTEGER NOT NULL, atype INTEGER NOT NULL, includewoitemdescendants BOOL, template TEXT, style TEXT, jsprerender TEXT, jshelpers TEXT, rendertype INTEGER NOT NULL, "
|
+ "notes TEXT, roles INTEGER NOT NULL, atype INTEGER NOT NULL, includewoitemdescendants BOOL, template TEXT, style TEXT, jsprerender TEXT, jshelpers TEXT, rendertype INTEGER NOT NULL, "
|
||||||
+ "headertemplate TEXT, footertemplate TEXT, displayheaderfooter BOOL, paperformat INTEGER NOT NULL, landscape BOOL, marginoptionsbottom TEXT, "
|
+ "headertemplate TEXT, footertemplate TEXT, displayheaderfooter BOOL, paperformat INTEGER NOT NULL, landscape BOOL, marginoptionsbottom TEXT, "
|
||||||
+ "marginoptionsleft TEXT, marginoptionsright TEXT, marginoptionstop TEXT, pageranges TEXT, prefercsspagesize BOOL, printbackground BOOL, scale DECIMAL(8,5), UNIQUE(name,atype))");
|
+ "marginoptionsleft TEXT, marginoptionsright TEXT, marginoptionstop TEXT, pageranges TEXT, prefercsspagesize BOOL, printbackground BOOL, scale DECIMAL(10,5), UNIQUE(name,atype))");
|
||||||
|
|
||||||
//Global customer default workorder report default
|
//Global customer default workorder report default
|
||||||
await ExecQueryAsync("ALTER TABLE aglobalbizsettings ADD column customerdefaultworkorderreportid BIGINT REFERENCES areport(id) ");
|
await ExecQueryAsync("ALTER TABLE aglobalbizsettings ADD column customerdefaultworkorderreportid BIGINT REFERENCES areport(id) ");
|
||||||
|
|||||||
Reference in New Issue
Block a user