From c042162daf6ddbc2ca966c1efb9db65cb3dabb24 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 26 Mar 2021 16:52:54 +0000 Subject: [PATCH] --- server/AyaNova/models/WorkOrderItemLabor.cs | 42 +++++++++++++++++---- server/AyaNova/util/AySchema.cs | 6 ++- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/server/AyaNova/models/WorkOrderItemLabor.cs b/server/AyaNova/models/WorkOrderItemLabor.cs index 9fe4c2be..2673e922 100644 --- a/server/AyaNova/models/WorkOrderItemLabor.cs +++ b/server/AyaNova/models/WorkOrderItemLabor.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Newtonsoft.Json; @@ -8,15 +8,22 @@ namespace AyaNova.Models { public class WorkOrderItemLabor : ICoreBizObjectModel { - public WorkOrderItemLabor() - { - Tags = new List(); - } + public long Id { get; set; } public uint Concurrency { get; set; } - public string Notes { get; set; } - public string CustomFields { get; set; } - public List Tags { get; set; } + + public long? UserId { get; set; } + public DateTime? ServiceStartDate { get; set; } + public DateTime? ServiceStopDate { get; set; } + public long? ServiceRateId { get; set; } + public string ServiceDetails { get; set; } + public decimal ServiceRateQuantity { get; set; } + public decimal NoChargeQuantity { get; set; } + public long? ServiceBankId { get; set; } + public long? TaxCodeSaleId { get; set; } + + + [Required] public long WorkOrderItemId { get; set; } [JsonIgnore] @@ -27,3 +34,22 @@ namespace AyaNova.Models }//eoc }//eons + +/* +CREATE TABLE [dbo].[AWORKORDERITEMLABOR]( + [AID] [uniqueidentifier] NOT NULL, + [AWORKORDERITEMID] [uniqueidentifier] NOT NULL, + [ACREATOR] [uniqueidentifier] NOT NULL, + [AMODIFIER] [uniqueidentifier] NOT NULL, + [ACREATED] [datetime] NOT NULL, + [AMODIFIED] [datetime] NOT NULL, + [AUSERID] [uniqueidentifier] NULL, + [ASERVICESTARTDATE] [datetime] NULL, + [ASERVICESTOPDATE] [datetime] NULL, + [ASERVICERATEID] [uniqueidentifier] NULL, + [ASERVICEDETAILS] [ntext] NULL, + [ASERVICERATEQUANTITY] [decimal](19, 5) NULL, + [ANOCHARGEQUANTITY] [decimal](19, 5) NULL, + [ASERVICEBANKID] [uniqueidentifier] NULL, + [ATAXRATESALEID] [uniqueidentifier] NULL +*/ \ No newline at end of file diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index 803f2fd2..f77d5781 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -48,7 +48,7 @@ namespace AyaNova.Util 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 Taxes are in face value not fractional value, i.e. "7" not .07 in db - Inventory/incidents general numbers (19,5) + Inventory/incidents/service rate quantity etc general numbers (19,5) Latitude/longitude 9,6 @@ -775,9 +775,11 @@ $BODY$ LANGUAGE PLPGSQL STABLE"); //WORKORDERITEM LABOR 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 TIMESTAMP, servicestopdate TIMESTAMP, servicerateid BIGINT REFERENCES aservicerate, servicedetails text, " + + "serviceratequantity DECIMAL(19,5) NOT NULL default 0, nochargequantity DECIMAL(19,5) NOT NULL default 0, servicebankid BIGINT REFERENCES aservicebank, taxcodesaleid BIGINT REFERENCES ataxcode" + ")"); + //WORKORDERITEM LOAN await ExecQueryAsync("CREATE TABLE aworkorderitemloan (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), " + "notes TEXT, customfields TEXT, tags VARCHAR(255) ARRAY)");