From b7d546ef02ae20dd86f375fdff77654ae230629a Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 4 Mar 2021 22:24:40 +0000 Subject: [PATCH] --- server/AyaNova/models/Contract.cs | 39 ++++++++++++++++++++++++++++ server/AyaNova/models/ServiceRate.cs | 3 ++- server/AyaNova/models/TravelRate.cs | 6 ++--- server/AyaNova/util/AySchema.cs | 4 +-- 4 files changed, 46 insertions(+), 6 deletions(-) diff --git a/server/AyaNova/models/Contract.cs b/server/AyaNova/models/Contract.cs index 9420c5c9..be036649 100644 --- a/server/AyaNova/models/Contract.cs +++ b/server/AyaNova/models/Contract.cs @@ -22,6 +22,12 @@ namespace AyaNova.Models public string CustomFields { get; set; } public List Tags { get; set; } +//new for v8 +//response +//discountservicerate (all service rates) +//discounttravelrate (all travel) + + public Contract() { @@ -34,3 +40,36 @@ namespace AyaNova.Models }//eoc }//eons + +/* +CREATE TABLE [dbo].[ACONTRACT]( + [AID] [uniqueidentifier] NOT NULL, + [ACREATOR] [uniqueidentifier] NULL, + [AMODIFIER] [uniqueidentifier] NULL, + [ACREATED] [datetime] NULL, + [AMODIFIED] [datetime] NULL, + [ADISCOUNTPARTS] [decimal](19, 5) NULL, + [ANAME] [nvarchar](255) NULL, + [AACTIVE] [bit] NOT NULL, + [ANOTES] [ntext] NULL, + [ACONTRACTRATESONLY] [bit] NOT NULL, + [ACUSTOM1] [ntext] NULL, + [ACUSTOM2] [ntext] NULL, + [ACUSTOM3] [ntext] NULL, + [ACUSTOM4] [ntext] NULL, + [ACUSTOM5] [ntext] NULL, + [ACUSTOM6] [ntext] NULL, + [ACUSTOM7] [ntext] NULL, + [ACUSTOM8] [ntext] NULL, + [ACUSTOM9] [ntext] NULL, + [ACUSTOM0] [ntext] NULL, + [AREGIONID] [uniqueidentifier] NULL, + + + CHILDREN + ContractRate - specific contract rates available to contract holding entities only + ContractTravel - specific contract travel rates only '' + ContractRateTagOverride - tags and discount / markup to apply collection + ContractTravelTagOverride - '' + ContractPartTagOverride - '' +*/ \ No newline at end of file diff --git a/server/AyaNova/models/ServiceRate.cs b/server/AyaNova/models/ServiceRate.cs index f4bd14f1..060fae77 100644 --- a/server/AyaNova/models/ServiceRate.cs +++ b/server/AyaNova/models/ServiceRate.cs @@ -29,6 +29,7 @@ namespace AyaNova.Models [Required] public decimal Charge { get; set; } public string Unit { get; set; } + public bool ContractOnly { get; set; } @@ -59,6 +60,6 @@ namespace AyaNova.Models [ARATETYPE] [smallint] NOT NULL,//REMOVE SPLITTING INTO TRAVEL AND LABOR SEPERATELY [ARATEUNITCHARGEDESCRIPTIONID] [uniqueidentifier] //TURN THIS INTO TEXT PLAIN AND SIMPLE, [ACLIENTGROUPID] [uniqueidentifier] NULL, //TAG remove - [ACONTRACTRATE] [bit] NOT NULL,//THIS IS ONLY FOR THE UI, REMOVE IT + [ACONTRACTRATE] [bit] NOT NULL, [AREGIONID] [uniqueidentifier] NULL,//tag, remove */ \ No newline at end of file diff --git a/server/AyaNova/models/TravelRate.cs b/server/AyaNova/models/TravelRate.cs index 5adf2e4e..15de7b40 100644 --- a/server/AyaNova/models/TravelRate.cs +++ b/server/AyaNova/models/TravelRate.cs @@ -29,12 +29,12 @@ namespace AyaNova.Models [Required] public decimal Charge { get; set; } public string Unit { get; set; } - + public bool ContractOnly { get; set; } public TravelRate() { - Tags = new List(); + Tags = new List(); } [NotMapped, JsonIgnore] @@ -59,6 +59,6 @@ namespace AyaNova.Models [ARATETYPE] [smallint] NOT NULL,//REMOVE SPLITTING INTO TRAVEL AND Travel SEPERATELY [ARATEUNITCHARGEDESCRIPTIONID] [uniqueidentifier] //TURN THIS INTO TEXT PLAIN AND SIMPLE, [ACLIENTGROUPID] [uniqueidentifier] NULL, //TAG remove - [ACONTRACTRATE] [bit] NOT NULL,//THIS IS ONLY FOR THE UI, REMOVE IT + [ACONTRACTRATE] [bit] NOT NULL, [AREGIONID] [uniqueidentifier] NULL,//tag, remove */ \ No newline at end of file diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index 6ec7bdb2..6ce70ad0 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -573,12 +573,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, cost DECIMAL(19,4) NOT NULL default 0, charge DECIMAL(19,4) NOT NULL default 0)"); + + "accountnumber TEXT, unit TEXT, contractonly BOOL NOT NULL, cost DECIMAL(19,4) NOT NULL default 0, charge DECIMAL(19,4) 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, cost DECIMAL(19,4) NOT NULL default 0, charge DECIMAL(19,4) NOT NULL default 0)"); + + "accountnumber TEXT, unit TEXT, contractonly BOOL NOT NULL, cost DECIMAL(19,4) NOT NULL default 0, charge DECIMAL(19,4) 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, "