case 4610
This commit is contained in:
@@ -32,20 +32,20 @@
|
||||
<PackageReference Include="Asp.Versioning.Mvc" Version="8.1.0" />
|
||||
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
|
||||
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.Extensions.ApiDescription.Server" Version="8.0.4">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
||||
|
||||
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.4" />
|
||||
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.8" />
|
||||
<PackageReference Include="Microsoft.OpenApi" Version="1.6.14" />
|
||||
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.3.8" />
|
||||
<PackageReference Include="MiniProfiler.EntityFrameworkCore" Version="4.3.8" />
|
||||
<PackageReference Include="NLog" Version="5.3.2" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.11" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
|
||||
<PackageReference Include="PuppeteerSharp" Version="17.0.0" />
|
||||
<PackageReference Include="QRCoder" Version="1.5.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
||||
|
||||
@@ -44,6 +44,12 @@ namespace AyaNova.Util
|
||||
(left digits max is precision minus scale)
|
||||
|
||||
CURRENCY: DECIMAL(38,18) (to support potential of cryptocurrencies) largest Etherium value fits in this (36bytes)
|
||||
Whups: case 4610 - this is too large to fit in a c# decimal and bombs on retrieval because it pads zeros to the right in postgres
|
||||
so in reality it needs to be 28 total characters, not 38, that's a fuckup on my part somehow, vicom found it.
|
||||
So as of this case downgrading it to 28,8 which means still works for crypto which is 8 digits after decimal (sats) and still larger than can enter in the
|
||||
ui so in theory should be no issues as of now. thankfully I did the inventory values as 19,5 so nothing to try to fix there with the whole blockchain and all
|
||||
getting in the way of that.
|
||||
|
||||
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
|
||||
Inventory/incidents/service rate quantity etc general numbers (19,5)
|
||||
@@ -544,12 +550,12 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
//SERVICERATE
|
||||
await ExecQueryAsync("CREATE TABLE aservicerate (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, "
|
||||
+ "accountnumber TEXT, unit TEXT, contractonly BOOL NOT NULL, cost DECIMAL(38,18) NOT NULL default 0, charge DECIMAL(38,18) NOT NULL default 0)");
|
||||
+ "accountnumber TEXT, unit TEXT, contractonly BOOL NOT NULL, cost DECIMAL(28,8) NOT NULL default 0, charge DECIMAL(28,8) NOT NULL default 0)");
|
||||
|
||||
//TRAVELRATE
|
||||
await ExecQueryAsync("CREATE TABLE atravelrate (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, "
|
||||
+ "accountnumber TEXT, unit TEXT, contractonly BOOL NOT NULL, cost DECIMAL(38,18) NOT NULL default 0, charge DECIMAL(38,18) NOT NULL default 0)");
|
||||
+ "accountnumber TEXT, unit TEXT, contractonly BOOL NOT NULL, cost DECIMAL(28,8) NOT NULL default 0, charge DECIMAL(28,8) NOT NULL default 0)");
|
||||
|
||||
//TAXCODE
|
||||
await ExecQueryAsync("CREATE TABLE ataxcode (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
||||
@@ -590,7 +596,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
// await ExecQueryAsync("CREATE TABLE aservicebank (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL, "
|
||||
// + "entrydate TIMESTAMPTZ NOT NULL, lastentrydate TIMESTAMPTZ NULL, atype INTEGER NOT NULL, objectid BIGINT NOT NULL, sourcetype INTEGER NOT NULL, sourceid BIGINT NOT NULL, "
|
||||
// + "incidents DECIMAL(19,5) NOT NULL, incidentsbalance DECIMAL(19,5) NOT NULL, lastincidentsbalance DECIMAL(19,5) NULL, "
|
||||
// + "currency DECIMAL(38,18) NOT NULL, currencybalance DECIMAL(38,18) NOT NULL, lastcurrencybalance DECIMAL(38,18) NULL, "
|
||||
// + "currency DECIMAL(28,8) NOT NULL, currencybalance DECIMAL(28,8) NOT NULL, lastcurrencybalance DECIMAL(28,8) NULL, "
|
||||
// + "hours DECIMAL(19,5) NOT NULL, hoursbalance DECIMAL(19,5) NOT NULL, lasthoursbalance DECIMAL(19,5) NULL, "
|
||||
// + "CONSTRAINT unq_servicebank UNIQUE (entrydate, objectid, atype, incidentsbalance, hoursbalance, currencybalance), "
|
||||
// + "CONSTRAINT unq_servicebank_previous_values UNIQUE (lastentrydate, objectid, atype, lastincidentsbalance, lasthoursbalance, lastcurrencybalance), "
|
||||
@@ -671,7 +677,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, "
|
||||
+ "description TEXT, manufacturerid BIGINT REFERENCES avendor, manufacturernumber TEXT, "
|
||||
+ "wholesalerid BIGINT REFERENCES avendor, wholesalernumber TEXT, alternativewholesalerid BIGINT REFERENCES avendor, alternativewholesalernumber TEXT, "
|
||||
+ "cost DECIMAL(38,18) NOT NULL, retail DECIMAL(38,18) NOT NULL, unitofmeasure TEXT, upc TEXT "
|
||||
+ "cost DECIMAL(28,8) NOT NULL, retail DECIMAL(28,8) NOT NULL, unitofmeasure TEXT, upc TEXT "
|
||||
+ " )");
|
||||
|
||||
//PARTWAREHOUSE
|
||||
@@ -736,7 +742,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
//PURCHASEORDERITEM
|
||||
await ExecQueryAsync("CREATE TABLE apurchaseorderitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, purchaseorderid BIGINT NOT NULL REFERENCES apurchaseorder ON DELETE CASCADE, "
|
||||
+ "partid BIGINT NOT NULL REFERENCES apart, partwarehouseid BIGINT NOT NULL REFERENCES apartwarehouse, quantityordered DECIMAL(19,5) NOT NULL default 0, "
|
||||
+ "quantityreceived DECIMAL(19,5) NOT NULL default 0, purchaseordercost DECIMAL(38,18) NOT NULL default 0, receivedcost DECIMAL(38,18) NOT NULL default 0, "
|
||||
+ "quantityreceived DECIMAL(19,5) NOT NULL default 0, purchaseordercost DECIMAL(28,8) NOT NULL default 0, receivedcost DECIMAL(28,8) NOT NULL default 0, "
|
||||
+ "receiveddate TIMESTAMPTZ, partrequestedbyid BIGINT REFERENCES auser, purchasetaxcodeid BIGINT REFERENCES ataxcode, vendorpartnumber TEXT, serials TEXT "
|
||||
+ ")");
|
||||
|
||||
@@ -774,8 +780,8 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
await ExecQueryAsync("CREATE TABLE aloanunit (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, "
|
||||
+ "serial TEXT, unitid BIGINT NULL REFERENCES aunit(id), defaultrate INTEGER NOT NULL, "
|
||||
+ "ratehourcost DECIMAL(38,18) NOT NULL DEFAULT 0, ratehalfdaycost DECIMAL(38,18) NOT NULL DEFAULT 0, ratedaycost DECIMAL(38,18) NOT NULL DEFAULT 0, rateweekcost DECIMAL(38,18) NOT NULL DEFAULT 0, ratemonthcost DECIMAL(38,18) NOT NULL DEFAULT 0, rateyearcost DECIMAL(38,18) NOT NULL DEFAULT 0, "
|
||||
+ "ratehour DECIMAL(38,18) NOT NULL, ratehalfday DECIMAL(38,18) NOT NULL, rateday DECIMAL(38,18) NOT NULL, rateweek DECIMAL(38,18) NOT NULL, ratemonth DECIMAL(38,18) NOT NULL, rateyear DECIMAL(38,18) NOT NULL "
|
||||
+ "ratehourcost DECIMAL(28,8) NOT NULL DEFAULT 0, ratehalfdaycost DECIMAL(28,8) NOT NULL DEFAULT 0, ratedaycost DECIMAL(28,8) NOT NULL DEFAULT 0, rateweekcost DECIMAL(28,8) NOT NULL DEFAULT 0, ratemonthcost DECIMAL(28,8) NOT NULL DEFAULT 0, rateyearcost DECIMAL(28,8) NOT NULL DEFAULT 0, "
|
||||
+ "ratehour DECIMAL(28,8) NOT NULL, ratehalfday DECIMAL(28,8) NOT NULL, rateday DECIMAL(28,8) NOT NULL, rateweek DECIMAL(28,8) NOT NULL, ratemonth DECIMAL(28,8) NOT NULL, rateyear DECIMAL(28,8) NOT NULL "
|
||||
+ ")");
|
||||
|
||||
//----------
|
||||
@@ -833,7 +839,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
|
||||
//WORKORDERITEM EXPENSE
|
||||
await ExecQueryAsync("CREATE TABLE aworkorderitemexpense (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||
+ "description TEXT, name TEXT, totalcost DECIMAL(38,18) NOT NULL default 0, chargeamount DECIMAL(38,18) NOT NULL default 0, taxpaid DECIMAL(38,18) NOT NULL default 0, "
|
||||
+ "description TEXT, name TEXT, totalcost DECIMAL(28,8) NOT NULL default 0, chargeamount DECIMAL(28,8) NOT NULL default 0, taxpaid DECIMAL(28,8) NOT NULL default 0, "
|
||||
+ "chargetaxcodeid BIGINT REFERENCES ataxcode, reimburseuser BOOL NOT NULL, userid BIGINT REFERENCES auser, chargetocustomer BOOL NOT NULL "
|
||||
+ ")");
|
||||
|
||||
@@ -841,12 +847,12 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
await ExecQueryAsync("CREATE TABLE aworkorderitemlabor (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||
+ "userid BIGINT REFERENCES auser, servicestartdate TIMESTAMPTZ, servicestopdate TIMESTAMPTZ, servicerateid BIGINT REFERENCES aservicerate, servicedetails text, "
|
||||
+ "serviceratequantity DECIMAL(19,5) NOT NULL default 0, nochargequantity DECIMAL(19,5) NOT NULL default 0, "
|
||||
+ "taxcodesaleid BIGINT REFERENCES ataxcode, priceoverride DECIMAL(38,18) "
|
||||
+ "taxcodesaleid BIGINT REFERENCES ataxcode, priceoverride DECIMAL(28,8) "
|
||||
+ ")");
|
||||
|
||||
//WORKORDERITEM LOAN
|
||||
await ExecQueryAsync("CREATE TABLE aworkorderitemloan (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||
+ "notes TEXT, outdate TIMESTAMPTZ, duedate TIMESTAMPTZ, returndate TIMESTAMPTZ,cost DECIMAL(38,18) NOT NULL default 0, listprice DECIMAL(38,18) NOT NULL default 0, priceoverride DECIMAL(38,18), "
|
||||
+ "notes TEXT, outdate TIMESTAMPTZ, duedate TIMESTAMPTZ, returndate TIMESTAMPTZ,cost DECIMAL(28,8) NOT NULL default 0, listprice DECIMAL(28,8) NOT NULL default 0, priceoverride DECIMAL(28,8), "
|
||||
+ "taxcodeid BIGINT REFERENCES ataxcode, loanunitid BIGINT NOT NULL REFERENCES aloanunit, quantity DECIMAL(19,5) NOT NULL default 0, rate INTEGER NOT NULL"
|
||||
+ ")");
|
||||
await ExecQueryAsync("ALTER TABLE aloanunit ADD column workorderitemloanid BIGINT NULL REFERENCES aworkorderitemloan");
|
||||
@@ -854,7 +860,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
//WORKORDERITEM PART
|
||||
await ExecQueryAsync("CREATE TABLE aworkorderitempart (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||
+ "description TEXT, serials TEXT, partid BIGINT NOT NULL REFERENCES apart, partwarehouseid BIGINT NOT NULL REFERENCES apartwarehouse, quantity DECIMAL(19,5) NOT NULL default 0, "
|
||||
+ "suggestedquantity DECIMAL(19,5) NOT NULL default 0, cost DECIMAL(38,18) NOT NULL default 0, listprice DECIMAL(38,18) NOT NULL default 0, taxpartsaleid BIGINT REFERENCES ataxcode, priceoverride DECIMAL(38,18) "
|
||||
+ "suggestedquantity DECIMAL(19,5) NOT NULL default 0, cost DECIMAL(28,8) NOT NULL default 0, listprice DECIMAL(28,8) NOT NULL default 0, taxpartsaleid BIGINT REFERENCES ataxcode, priceoverride DECIMAL(28,8) "
|
||||
+ ")");
|
||||
|
||||
//WORKORDERITEM PART REQUEST
|
||||
@@ -883,7 +889,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
await ExecQueryAsync("CREATE TABLE aworkorderitemtravel (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||
+ "userid BIGINT REFERENCES auser, travelstartdate TIMESTAMPTZ, travelstopdate TIMESTAMPTZ, travelrateid BIGINT REFERENCES atravelrate, traveldetails text, "
|
||||
+ "travelratequantity DECIMAL(19,5) NOT NULL default 0, nochargequantity DECIMAL(19,5) NOT NULL default 0, "
|
||||
+ "taxcodesaleid BIGINT REFERENCES ataxcode, distance DECIMAL(19,5) NOT NULL default 0, priceoverride DECIMAL(38,18) "
|
||||
+ "taxcodesaleid BIGINT REFERENCES ataxcode, distance DECIMAL(19,5) NOT NULL default 0, priceoverride DECIMAL(28,8) "
|
||||
+ ")");
|
||||
|
||||
//WORKORDERITEM UNIT
|
||||
@@ -897,7 +903,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
//WORKORDERITEM OUTSIDE SERVICE
|
||||
await ExecQueryAsync("CREATE TABLE aworkorderitemoutsideservice (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||
+ "notes TEXT, unitid BIGINT NOT NULL REFERENCES aunit, vendorsenttoid BIGINT REFERENCES avendor, vendorsentviaid BIGINT REFERENCES avendor, rmanumber text, trackingnumber text, "
|
||||
+ "taxcodeid BIGINT REFERENCES ataxcode, repaircost DECIMAL(38,18) NOT NULL default 0, repairprice DECIMAL(38,18) NOT NULL default 0, shippingcost DECIMAL(38,18) NOT NULL default 0, shippingprice DECIMAL(38,18) NOT NULL default 0, "
|
||||
+ "taxcodeid BIGINT REFERENCES ataxcode, repaircost DECIMAL(28,8) NOT NULL default 0, repairprice DECIMAL(28,8) NOT NULL default 0, shippingcost DECIMAL(28,8) NOT NULL default 0, shippingprice DECIMAL(28,8) NOT NULL default 0, "
|
||||
+ "SentDate TIMESTAMPTZ, etadate TIMESTAMPTZ, returndate TIMESTAMPTZ"
|
||||
+ ")");
|
||||
|
||||
@@ -1021,7 +1027,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
|
||||
//QUOTEITEM EXPENSE
|
||||
await ExecQueryAsync("CREATE TABLE aquoteitemexpense (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, quoteitemid BIGINT NOT NULL REFERENCES aquoteitem (id), "
|
||||
+ "description TEXT, name TEXT, totalcost DECIMAL(38,18) NOT NULL default 0, chargeamount DECIMAL(38,18) NOT NULL default 0, taxpaid DECIMAL(38,18) NOT NULL default 0, "
|
||||
+ "description TEXT, name TEXT, totalcost DECIMAL(28,8) NOT NULL default 0, chargeamount DECIMAL(28,8) NOT NULL default 0, taxpaid DECIMAL(28,8) NOT NULL default 0, "
|
||||
+ "chargetaxcodeid BIGINT REFERENCES ataxcode, reimburseuser BOOL NOT NULL, userid BIGINT REFERENCES auser, chargetocustomer BOOL NOT NULL "
|
||||
+ ")");
|
||||
|
||||
@@ -1029,19 +1035,19 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
await ExecQueryAsync("CREATE TABLE aquoteitemlabor (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, quoteitemid BIGINT NOT NULL REFERENCES aquoteitem (id), "
|
||||
+ "userid BIGINT REFERENCES auser, servicestartdate TIMESTAMPTZ, servicestopdate TIMESTAMPTZ, servicerateid BIGINT REFERENCES aservicerate, servicedetails text, "
|
||||
+ "serviceratequantity DECIMAL(19,5) NOT NULL default 0, nochargequantity DECIMAL(19,5) NOT NULL default 0, "
|
||||
+ "taxcodesaleid BIGINT REFERENCES ataxcode, priceoverride DECIMAL(38,18) "
|
||||
+ "taxcodesaleid BIGINT REFERENCES ataxcode, priceoverride DECIMAL(28,8) "
|
||||
+ ")");
|
||||
|
||||
//QUOTEITEM LOAN
|
||||
await ExecQueryAsync("CREATE TABLE aquoteitemloan (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, quoteitemid BIGINT NOT NULL REFERENCES aquoteitem (id), "
|
||||
+ "notes TEXT, outdate TIMESTAMPTZ, duedate TIMESTAMPTZ, returndate TIMESTAMPTZ,cost DECIMAL(38,18) NOT NULL default 0, listprice DECIMAL(38,18) NOT NULL default 0, priceoverride DECIMAL(38,18), "
|
||||
+ "notes TEXT, outdate TIMESTAMPTZ, duedate TIMESTAMPTZ, returndate TIMESTAMPTZ,cost DECIMAL(28,8) NOT NULL default 0, listprice DECIMAL(28,8) NOT NULL default 0, priceoverride DECIMAL(28,8), "
|
||||
+ "taxcodeid BIGINT REFERENCES ataxcode, loanunitid BIGINT NOT NULL REFERENCES aloanunit, quantity DECIMAL(19,5) NOT NULL default 0, rate INTEGER NOT NULL"
|
||||
+ ")");
|
||||
|
||||
//QUOTEITEM PART
|
||||
await ExecQueryAsync("CREATE TABLE aquoteitempart (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, quoteitemid BIGINT NOT NULL REFERENCES aquoteitem (id), "
|
||||
+ "description TEXT, serials TEXT, partid BIGINT NOT NULL REFERENCES apart, partwarehouseid BIGINT NOT NULL REFERENCES apartwarehouse, quantity DECIMAL(19,5) NOT NULL default 0, "
|
||||
+ "cost DECIMAL(38,18) NOT NULL default 0, listprice DECIMAL(38,18) NOT NULL default 0, taxpartsaleid BIGINT REFERENCES ataxcode, priceoverride DECIMAL(38,18) "
|
||||
+ "cost DECIMAL(28,8) NOT NULL default 0, listprice DECIMAL(28,8) NOT NULL default 0, taxpartsaleid BIGINT REFERENCES ataxcode, priceoverride DECIMAL(28,8) "
|
||||
+ ")");
|
||||
|
||||
//QUOTEITEM SCHEDULED USER
|
||||
@@ -1059,7 +1065,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
await ExecQueryAsync("CREATE TABLE aquoteitemtravel (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, quoteitemid BIGINT NOT NULL REFERENCES aquoteitem (id), "
|
||||
+ "userid BIGINT REFERENCES auser, travelstartdate TIMESTAMPTZ, travelstopdate TIMESTAMPTZ, travelrateid BIGINT REFERENCES atravelrate, traveldetails text, "
|
||||
+ "travelratequantity DECIMAL(19,5) NOT NULL default 0, nochargequantity DECIMAL(19,5) NOT NULL default 0, "
|
||||
+ "taxcodesaleid BIGINT REFERENCES ataxcode, distance DECIMAL(19,5) NOT NULL default 0, priceoverride DECIMAL(38,18) "
|
||||
+ "taxcodesaleid BIGINT REFERENCES ataxcode, distance DECIMAL(19,5) NOT NULL default 0, priceoverride DECIMAL(28,8) "
|
||||
+ ")");
|
||||
|
||||
//QUOTEITEM UNIT
|
||||
@@ -1070,7 +1076,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
//QUOTEITEM OUTSIDE SERVICE
|
||||
await ExecQueryAsync("CREATE TABLE aquoteitemoutsideservice (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, quoteitemid BIGINT NOT NULL REFERENCES aquoteitem (id), "
|
||||
+ "notes TEXT, unitid BIGINT NOT NULL REFERENCES aunit, vendorsenttoid BIGINT REFERENCES avendor, vendorsentviaid BIGINT REFERENCES avendor, rmanumber text, trackingnumber text, "
|
||||
+ "taxcodeid BIGINT REFERENCES ataxcode, repaircost DECIMAL(38,18) NOT NULL default 0, repairprice DECIMAL(38,18) NOT NULL default 0, shippingcost DECIMAL(38,18) NOT NULL default 0, shippingprice DECIMAL(38,18) NOT NULL default 0, "
|
||||
+ "taxcodeid BIGINT REFERENCES ataxcode, repaircost DECIMAL(28,8) NOT NULL default 0, repairprice DECIMAL(28,8) NOT NULL default 0, shippingcost DECIMAL(28,8) NOT NULL default 0, shippingprice DECIMAL(28,8) NOT NULL default 0, "
|
||||
+ "SentDate TIMESTAMPTZ, etadate TIMESTAMPTZ, returndate TIMESTAMPTZ"
|
||||
+ ")");
|
||||
|
||||
@@ -1110,7 +1116,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
|
||||
//PMITEM EXPENSE
|
||||
await ExecQueryAsync("CREATE TABLE apmitemexpense (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, pmitemid BIGINT NOT NULL REFERENCES apmitem (id), "
|
||||
+ "description TEXT, name TEXT, totalcost DECIMAL(38,18) NOT NULL default 0, chargeamount DECIMAL(38,18) NOT NULL default 0, taxpaid DECIMAL(38,18) NOT NULL default 0, "
|
||||
+ "description TEXT, name TEXT, totalcost DECIMAL(28,8) NOT NULL default 0, chargeamount DECIMAL(28,8) NOT NULL default 0, taxpaid DECIMAL(28,8) NOT NULL default 0, "
|
||||
+ "chargetaxcodeid BIGINT REFERENCES ataxcode, reimburseuser BOOL NOT NULL, userid BIGINT REFERENCES auser, chargetocustomer BOOL NOT NULL "
|
||||
+ ")");
|
||||
|
||||
@@ -1118,19 +1124,19 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
await ExecQueryAsync("CREATE TABLE apmitemlabor (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, pmitemid BIGINT NOT NULL REFERENCES apmitem (id), "
|
||||
+ "userid BIGINT REFERENCES auser, servicestartdate TIMESTAMPTZ, servicestopdate TIMESTAMPTZ, servicerateid BIGINT REFERENCES aservicerate, servicedetails text, "
|
||||
+ "serviceratequantity DECIMAL(19,5) NOT NULL default 0, nochargequantity DECIMAL(19,5) NOT NULL default 0, "
|
||||
+ "taxcodesaleid BIGINT REFERENCES ataxcode, priceoverride DECIMAL(38,18) "
|
||||
+ "taxcodesaleid BIGINT REFERENCES ataxcode, priceoverride DECIMAL(28,8) "
|
||||
+ ")");
|
||||
|
||||
//PMITEM LOAN
|
||||
await ExecQueryAsync("CREATE TABLE apmitemloan (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, pmitemid BIGINT NOT NULL REFERENCES apmitem (id), "
|
||||
+ "notes TEXT, outdate TIMESTAMPTZ, duedate TIMESTAMPTZ, returndate TIMESTAMPTZ,cost DECIMAL(38,18) NOT NULL default 0, listprice DECIMAL(38,18) NOT NULL default 0, priceoverride DECIMAL(38,18), "
|
||||
+ "notes TEXT, outdate TIMESTAMPTZ, duedate TIMESTAMPTZ, returndate TIMESTAMPTZ,cost DECIMAL(28,8) NOT NULL default 0, listprice DECIMAL(28,8) NOT NULL default 0, priceoverride DECIMAL(28,8), "
|
||||
+ "taxcodeid BIGINT REFERENCES ataxcode, loanunitid BIGINT NOT NULL REFERENCES aloanunit, quantity DECIMAL(19,5) NOT NULL default 0, rate INTEGER NOT NULL"
|
||||
+ ")");
|
||||
|
||||
//PMITEM PART
|
||||
await ExecQueryAsync("CREATE TABLE apmitempart (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, pmitemid BIGINT NOT NULL REFERENCES apmitem (id), "
|
||||
+ "description TEXT, serials TEXT, partid BIGINT NOT NULL REFERENCES apart, partwarehouseid BIGINT NOT NULL REFERENCES apartwarehouse, quantity DECIMAL(19,5) NOT NULL default 0, "
|
||||
+ "cost DECIMAL(38,18) NOT NULL default 0, listprice DECIMAL(38,18) NOT NULL default 0, taxpartsaleid BIGINT REFERENCES ataxcode, priceoverride DECIMAL(38,18) "
|
||||
+ "cost DECIMAL(28,8) NOT NULL default 0, listprice DECIMAL(28,8) NOT NULL default 0, taxpartsaleid BIGINT REFERENCES ataxcode, priceoverride DECIMAL(28,8) "
|
||||
+ ")");
|
||||
|
||||
//PMITEM SCHEDULED USER
|
||||
@@ -1148,7 +1154,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
await ExecQueryAsync("CREATE TABLE apmitemtravel (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, pmitemid BIGINT NOT NULL REFERENCES apmitem (id), "
|
||||
+ "userid BIGINT REFERENCES auser, travelstartdate TIMESTAMPTZ, travelstopdate TIMESTAMPTZ, travelrateid BIGINT REFERENCES atravelrate, traveldetails text, "
|
||||
+ "travelratequantity DECIMAL(19,5) NOT NULL default 0, nochargequantity DECIMAL(19,5) NOT NULL default 0, "
|
||||
+ "taxcodesaleid BIGINT REFERENCES ataxcode, distance DECIMAL(19,5) NOT NULL default 0, priceoverride DECIMAL(38,18) "
|
||||
+ "taxcodesaleid BIGINT REFERENCES ataxcode, distance DECIMAL(19,5) NOT NULL default 0, priceoverride DECIMAL(28,8) "
|
||||
+ ")");
|
||||
|
||||
//PMITEM UNIT
|
||||
@@ -1159,7 +1165,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
//PMITEM OUTSIDE SERVICE
|
||||
await ExecQueryAsync("CREATE TABLE apmitemoutsideservice (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, pmitemid BIGINT NOT NULL REFERENCES apmitem (id), "
|
||||
+ "notes TEXT, unitid BIGINT NOT NULL REFERENCES aunit, vendorsenttoid BIGINT REFERENCES avendor, vendorsentviaid BIGINT REFERENCES avendor, rmanumber text, trackingnumber text, "
|
||||
+ "taxcodeid BIGINT REFERENCES ataxcode, repaircost DECIMAL(38,18) NOT NULL default 0, repairprice DECIMAL(38,18) NOT NULL default 0, shippingcost DECIMAL(38,18) NOT NULL default 0, shippingprice DECIMAL(38,18) NOT NULL default 0, "
|
||||
+ "taxcodeid BIGINT REFERENCES ataxcode, repaircost DECIMAL(28,8) NOT NULL default 0, repairprice DECIMAL(28,8) NOT NULL default 0, shippingcost DECIMAL(28,8) NOT NULL default 0, shippingprice DECIMAL(28,8) NOT NULL default 0, "
|
||||
+ "SentDate TIMESTAMPTZ, etadate TIMESTAMPTZ, returndate TIMESTAMPTZ"
|
||||
+ ")");
|
||||
|
||||
@@ -1187,17 +1193,17 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
//NOTIFICATION
|
||||
await ExecQueryAsync("CREATE TABLE anotifysubscription (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, "
|
||||
+ "userid BIGINT NOT NULL REFERENCES auser (id) ON DELETE CASCADE, ayatype INTEGER NOT NULL, eventtype INTEGER NOT NULL, advancenotice INTERVAL NOT NULL, "
|
||||
+ "idvalue BIGINT NOT NULL, decvalue DECIMAL(38,18) NOT NULL, agevalue INTERVAL NOT NULL, deliverymethod INTEGER NOT NULL, "
|
||||
+ "idvalue BIGINT NOT NULL, decvalue DECIMAL(28,8) NOT NULL, agevalue INTERVAL NOT NULL, deliverymethod INTEGER NOT NULL, "
|
||||
+ "deliveryaddress TEXT, linkreportid BIGINT, tags VARCHAR(255) ARRAY)");
|
||||
|
||||
await ExecQueryAsync("CREATE TABLE anotifyevent (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, created TIMESTAMPTZ NOT NULL, "
|
||||
+ "ayatype INTEGER NOT NULL, objectid BIGINT NOT NULL, name TEXT NOT NULL, eventtype INTEGER NOT NULL, notifysubscriptionid BIGINT NOT NULL REFERENCES anotifysubscription(id) ON DELETE CASCADE, "
|
||||
+ "userid BIGINT NOT NULL REFERENCES auser (id) ON DELETE CASCADE, eventdate TIMESTAMPTZ NOT NULL, decvalue DECIMAL(38,18) NULL, message TEXT)");
|
||||
+ "userid BIGINT NOT NULL REFERENCES auser (id) ON DELETE CASCADE, eventdate TIMESTAMPTZ NOT NULL, decvalue DECIMAL(28,8) NULL, message TEXT)");
|
||||
|
||||
|
||||
await ExecQueryAsync("CREATE TABLE ainappnotification (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, userid BIGINT NOT NULL REFERENCES auser (id) ON DELETE CASCADE, "
|
||||
+ "created TIMESTAMPTZ NOT NULL, ayatype INTEGER NOT NULL, objectid BIGINT NOT NULL, name TEXT NOT NULL, agevalue INTERVAL, eventtype INTEGER NOT NULL, "
|
||||
+ "decvalue DECIMAL(38,18) NULL, notifysubscriptionid BIGINT NOT NULL REFERENCES anotifysubscription(id) ON DELETE CASCADE, message TEXT, fetched BOOL NOT NULL)");
|
||||
+ "decvalue DECIMAL(28,8) NULL, notifysubscriptionid BIGINT NOT NULL REFERENCES anotifysubscription(id) ON DELETE CASCADE, message TEXT, fetched BOOL NOT NULL)");
|
||||
|
||||
await ExecQueryAsync("CREATE TABLE anotifydeliverylog (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, processed TIMESTAMPTZ NOT NULL, "
|
||||
+ "objectid BIGINT NOT NULL, notifysubscriptionid BIGINT NOT NULL, fail BOOL NOT NULL, error TEXT)");
|
||||
@@ -1208,12 +1214,12 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
+ "translationid BIGINT NOT NULL REFERENCES atranslation (id) NOT NULL, languageoverride TEXT NOT NULL, timezoneoverride TEXT NOT NULL, "
|
||||
+ "currencyname TEXT NOT NULL, hour12 BOOL NOT NULL, "
|
||||
+ "customertags VARCHAR(255) ARRAY, ayatype INTEGER NOT NULL, eventtype INTEGER NOT NULL, advancenotice INTERVAL NOT NULL, "
|
||||
+ "idvalue BIGINT NOT NULL, decvalue DECIMAL(38,18) NOT NULL, agevalue INTERVAL NOT NULL, "
|
||||
+ "idvalue BIGINT NOT NULL, decvalue DECIMAL(28,8) NOT NULL, agevalue INTERVAL NOT NULL, "
|
||||
+ "linkreportid BIGINT, template TEXT NOT NULL, subject TEXT NOT NULL, tags VARCHAR(255) ARRAY)");
|
||||
|
||||
await ExecQueryAsync("CREATE TABLE acustomernotifyevent (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, created TIMESTAMPTZ NOT NULL, "
|
||||
+ "ayatype INTEGER NOT NULL, objectid BIGINT NOT NULL, name TEXT NOT NULL, eventtype INTEGER NOT NULL, customernotifysubscriptionid BIGINT NOT NULL REFERENCES acustomernotifysubscription(id) ON DELETE CASCADE, "
|
||||
+ "customerid BIGINT NOT NULL REFERENCES acustomer (id) ON DELETE CASCADE, eventdate TIMESTAMPTZ NOT NULL, decvalue DECIMAL(38,18) NULL)");
|
||||
+ "customerid BIGINT NOT NULL REFERENCES acustomer (id) ON DELETE CASCADE, eventdate TIMESTAMPTZ NOT NULL, decvalue DECIMAL(28,8) NULL)");
|
||||
|
||||
await ExecQueryAsync("CREATE TABLE acustomernotifydeliverylog (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, processed TIMESTAMPTZ NOT NULL, "
|
||||
+ "objectid BIGINT NOT NULL, customernotifysubscriptionid BIGINT NOT NULL, fail BOOL NOT NULL, error TEXT)");
|
||||
|
||||
Reference in New Issue
Block a user