diff --git a/server/AyaNova/biz/AyaType.cs b/server/AyaNova/biz/AyaType.cs index f7d2e8de..96555738 100644 --- a/server/AyaNova/biz/AyaType.cs +++ b/server/AyaNova/biz/AyaType.cs @@ -121,7 +121,11 @@ namespace AyaNova.Biz [CoreBizObject] Memo = 60, [CoreBizObject] - Review = 61 + Review = 61, + [CoreBizObject] + ServiceRate = 62, + [CoreBizObject] + TravelRate = 63 diff --git a/server/AyaNova/models/AyContext.cs b/server/AyaNova/models/AyContext.cs index 1ef972d5..ffa31736 100644 --- a/server/AyaNova/models/AyContext.cs +++ b/server/AyaNova/models/AyContext.cs @@ -53,6 +53,10 @@ namespace AyaNova.Models public virtual DbSet Unit { get; set; } public virtual DbSet UnitModel { get; set; } public virtual DbSet Vendor { get; set; } + public virtual DbSet ServiceRate { get; set; } + public virtual DbSet TravelRate { get; set; } + + //WorkOrder public virtual DbSet WorkOrder { get; set; } public virtual DbSet WorkOrderItem { get; set; } diff --git a/server/AyaNova/models/LaborRate.cs b/server/AyaNova/models/LaborRate.cs new file mode 100644 index 00000000..f4bd14f1 --- /dev/null +++ b/server/AyaNova/models/LaborRate.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Newtonsoft.Json; + +namespace AyaNova.Models +{ + //NOTE: Any non required field (nullable in DB) sb nullable here, i.e. decimal? not decimal, + //otherwise the server will call it an invalid record if the field isn't sent from client + + public class ServiceRate : ICoreBizObjectModel + { + public long Id { get; set; } + public uint Concurrency { get; set; } + + [Required] + public string Name { get; set; } + public bool Active { get; set; } + public string Notes { get; set; } + public string Wiki { get; set; } + public string CustomFields { get; set; } + public List Tags { get; set; } + + public string AccountNumber { get; set; } + [Required] + public decimal Cost { get; set; } + [Required] + public decimal Charge { get; set; } + public string Unit { get; set; } + + + + public ServiceRate() + { + Tags = new List(); + } + + [NotMapped, JsonIgnore] + public AyaType AyaType { get => AyaType.ServiceRate; } + + }//eoc + +}//eons +/* + CREATE TABLE [dbo].[ARATE]( + [AID] [uniqueidentifier] NOT NULL, + [ACREATED] [datetime] NOT NULL, + [AMODIFIED] [datetime] NOT NULL, + [AACTIVE] [bit] NOT NULL, + [ACREATOR] [uniqueidentifier] NOT NULL, + [AMODIFIER] [uniqueidentifier] NOT NULL, + [ANAME] [nvarchar](255) NOT NULL, + [ADESCRIPTION] [nvarchar](255) NULL,//NOW NOTES + [AACCOUNTNUMBER] [nvarchar](255) NULL, + [ACOST] [decimal](19, 5) NULL, + [ACHARGE] [decimal](19, 5) NULL, + [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 + [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 new file mode 100644 index 00000000..5adf2e4e --- /dev/null +++ b/server/AyaNova/models/TravelRate.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using AyaNova.Biz; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Newtonsoft.Json; + +namespace AyaNova.Models +{ + //NOTE: Any non required field (nullable in DB) sb nullable here, i.e. decimal? not decimal, + //otherwise the server will call it an invalid record if the field isn't sent from client + + public class TravelRate : ICoreBizObjectModel + { + public long Id { get; set; } + public uint Concurrency { get; set; } + + [Required] + public string Name { get; set; } + public bool Active { get; set; } + public string Notes { get; set; } + public string Wiki { get; set; } + public string CustomFields { get; set; } + public List Tags { get; set; } + + public string AccountNumber { get; set; } + [Required] + public decimal Cost { get; set; } + [Required] + public decimal Charge { get; set; } + public string Unit { get; set; } + + + + public TravelRate() + { + Tags = new List(); + } + + [NotMapped, JsonIgnore] + public AyaType AyaType { get => AyaType.TravelRate; } + + }//eoc + +}//eons +/* + CREATE TABLE [dbo].[ARATE]( + [AID] [uniqueidentifier] NOT NULL, + [ACREATED] [datetime] NOT NULL, + [AMODIFIED] [datetime] NOT NULL, + [AACTIVE] [bit] NOT NULL, + [ACREATOR] [uniqueidentifier] NOT NULL, + [AMODIFIER] [uniqueidentifier] NOT NULL, + [ANAME] [nvarchar](255) NOT NULL, + [ADESCRIPTION] [nvarchar](255) NULL,//NOW NOTES + [AACCOUNTNUMBER] [nvarchar](255) NULL, + [ACOST] [decimal](19, 5) NULL, + [ACHARGE] [decimal](19, 5) NULL, + [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 + [AREGIONID] [uniqueidentifier] NULL,//tag, remove +*/ \ No newline at end of file diff --git a/server/AyaNova/resource/de.json b/server/AyaNova/resource/de.json index 4917e81c..c53a5f8f 100644 --- a/server/AyaNova/resource/de.json +++ b/server/AyaNova/resource/de.json @@ -2025,5 +2025,9 @@ "Failed": "Fehlgeschlagen", "ProcessingJob": "Serverjob verarbeiten", "TimedOut": "Zeitüberschreitung", - "Now": "Jetzt" + "Now": "Jetzt", + "ServiceRate": "Service-Rate", + "TravelRate": "Reiserate", + "ServiceRateList": "Serviceraten", + "TravelRateList": "Reiseratenliste" } \ No newline at end of file diff --git a/server/AyaNova/resource/en.json b/server/AyaNova/resource/en.json index f56538df..27855799 100644 --- a/server/AyaNova/resource/en.json +++ b/server/AyaNova/resource/en.json @@ -2025,5 +2025,9 @@ "Failed": "Failed", "ProcessingJob": "Processing server job", "TimedOut": "Timed out", - "Now": "Now" + "Now": "Now", + "ServiceRate": "Service rate", + "TravelRate": "Travel rate", + "ServiceRateList": "Service rates", + "TravelRateList": "Travel rates" } \ No newline at end of file diff --git a/server/AyaNova/resource/es.json b/server/AyaNova/resource/es.json index e2fcee29..460cfd6d 100644 --- a/server/AyaNova/resource/es.json +++ b/server/AyaNova/resource/es.json @@ -2025,5 +2025,9 @@ "Failed": "Fallido", "ProcessingJob": "Procesando trabajo del servidor", "TimedOut": "Tiempo de espera agotado", - "Now": "Ahora" + "Now": "Ahora", + "ServiceRate": "Tasa de trabajo", + "TravelRate": "Tasa de viaje", + "ServiceRateList": "Tasas laborales", + "TravelRateList": "Tarifas de viaje" } \ No newline at end of file diff --git a/server/AyaNova/resource/fr.json b/server/AyaNova/resource/fr.json index 7c7edce3..33879cff 100644 --- a/server/AyaNova/resource/fr.json +++ b/server/AyaNova/resource/fr.json @@ -2025,5 +2025,9 @@ "Failed": "Échec", "ProcessingJob": "Traitement du travail du serveur", "TimedOut": "Délai dépassé", - "Now": "Maintenant" + "Now": "Maintenant", + "ServiceRate": "Taux de service", + "TravelRate": "Tarif voyage", + "ServiceRateList": "Tarifs de service", + "TravelRateList": "Tarifs de voyage" } \ No newline at end of file diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index 1d6ffe2b..ef5f9b53 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -565,6 +565,20 @@ $BODY$ LANGUAGE PLPGSQL STABLE"); { LogUpdateMessage(log); + //SERVICERATE + await ExecQueryAsync("CREATE TABLE aservicerate (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, active bool, " + + "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)"); + await ExecQueryAsync("CREATE UNIQUE INDEX aservicerate_name_id_idx ON aservicerate (id, name);"); + await ExecQueryAsync("CREATE INDEX aservicerate_tags ON aservicerate using GIN(tags)"); + + //TRAVELRATE + await ExecQueryAsync("CREATE TABLE atravelrate (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null unique, active bool, " + + "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)"); + await ExecQueryAsync("CREATE UNIQUE INDEX atravelrate_name_id_idx ON atravelrate (id, name);"); + await ExecQueryAsync("CREATE INDEX atravelrate_tags ON atravelrate using GIN(tags)"); + //MEMO await ExecQueryAsync("CREATE TABLE amemo (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name text not null, " + "notes text, wiki text, customfields text, tags varchar(255) ARRAY, " +