using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Newtonsoft.Json; using AyaNova.Biz; namespace AyaNova.Models { public class WorkOrderItemLabor : ICoreBizObjectModel { public long Id { get; set; } public uint Concurrency { get; set; } public long? UserId { get; set; } [NotMapped] public string UserViz { get; set; } public DateTime? ServiceStartDate { get; set; } public DateTime? ServiceStopDate { get; set; } public long? ServiceRateId { get; set; } [NotMapped] public string ServiceRateViz { get; set; } public string ServiceDetails { get; set; } [Required] public decimal ServiceRateQuantity { get; set; } [Required] public decimal NoChargeQuantity { get; set; } //public long? ServiceBankId { get; set; } public long? TaxCodeSaleId { get; set; } [NotMapped] public string TaxCodeViz { get; set; } //Standard pricing fields (mostly to support printed reports though some show in UI) //some not to be sent with record depending on role (i.e. cost and charge in some cases) public decimal? PriceOverride { get; set; }//user entered manually overridden price, if null then ignored in calcs otherwise this *is* the price even if zero [NotMapped] public decimal CostViz { get; set; }//cost from source record (e.g. serviceRate) or zero if no cost entered [NotMapped] public decimal ListPriceViz { get; set; }//List price from source record (e.g. serviceRate) or zero if no cost entered [NotMapped] public string UnitOfMeasureViz { get; set; }//"each", "hour" etc [NotMapped] public decimal PriceViz { get; set; }//per unit price used in calcs after discounts or manual price if non-null or just ListPrice if no discount or manual override [NotMapped] public decimal NetViz { get; set; }//quantity * price (before taxes line total essentially) [NotMapped] public decimal TaxAViz { get; set; }//total amount of taxA [NotMapped] public decimal TaxBViz { get; set; }//total amount of taxB [NotMapped] public decimal LineTotalViz { get; set; }//line total netViz + taxes [Required] public long WorkOrderItemId { get; set; } [JsonIgnore] public WorkOrderItem WorkOrderItem { get; set; } [NotMapped, JsonIgnore] public AyaType AyaType { get => AyaType.WorkOrderItemLabor; } //workaround for notification [NotMapped, JsonIgnore] public List Tags { get; set; } = new List(); [NotMapped, JsonIgnore] public string Name { get; set; } }//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 */