Files
raven/server/AyaNova/models/QuoteItemTravel.cs
2021-07-23 22:09:58 +00:00

88 lines
3.6 KiB
C#

using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
using AyaNova.Biz;
using System.Collections.Generic;
namespace AyaNova.Models
{
public class QuoteItemTravel : ICoreBizObjectModel
{
public long Id { get; set; }
public uint Concurrency { get; set; }
public long? UserId { get; set; }
[NotMapped]
public string UserViz { get; set; }
public DateTime? TravelStartDate { get; set; }
public DateTime? TravelStopDate { get; set; }
public long? TravelRateId { get; set; }
[NotMapped]
public string TravelRateViz { get; set; }
public string TravelDetails { get; set; }
public decimal TravelRateQuantity { get; set; }
public decimal NoChargeQuantity { get; set; }
//public long? ServiceBankId { get; set; }
public long? TaxCodeSaleId { get; set; }
[NotMapped]
public string TaxCodeViz { get; set; }
public decimal Distance { 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
//workaround for notification
[NotMapped, JsonIgnore]
public List<string> Tags { get; set; } = new List<string>();
[NotMapped, JsonIgnore]
public string Name { get; set; }
[Required]
public long QuoteItemId { get; set; }
[JsonIgnore]
public QuoteItem QuoteItem { get; set; }
[NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.QuoteItemTravel; }
}//eoc
}//eons
/*
CREATE TABLE [dbo].[AQuoteITEMTRAVEL](
[AID] [uniqueidentifier] NOT NULL,
[AQuoteITEMID] [uniqueidentifier] NOT NULL,
[ACREATOR] [uniqueidentifier] NOT NULL,
[AMODIFIER] [uniqueidentifier] NOT NULL,
[ACREATED] [datetime] NOT NULL,
[AMODIFIED] [datetime] NOT NULL,
[ANOTES] [ntext] NULL,
[AUSERID] [uniqueidentifier] NULL,
[ATRAVELSTARTDATE] [datetime] NULL,
[ATRAVELSTOPDATE] [datetime] NULL,
[ATRAVELRATEID] [uniqueidentifier] NULL,
[ATRAVELDETAILS] [nvarchar](255) NULL,
[ATRAVELRATEQUANTITY] [decimal](19, 5) NULL,
[ANOCHARGEQUANTITY] [decimal](19, 5) NULL,
[ADISTANCE] [decimal](19, 5) NULL,
[ATAXRATESALEID] [uniqueidentifier] NULL,
[ASERVICEBANKID] [uniqueidentifier] NULL
*/