Files
raven/server/AyaNova/models/WorkOrderItemPart.cs
2021-05-13 15:49:42 +00:00

83 lines
3.0 KiB
C#

using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
using AyaNova.Biz;
namespace AyaNova.Models
{
public class WorkOrderItemPart : ICoreBizObjectModel
{
public long Id { get; set; }
public uint Concurrency { get; set; }
public string Description { get; set; }
public string Serials { get; set; }
[Required]
public long PartId { get; set; }
[Required]
public long PartWarehouseId { get; set; }
[Required]
public decimal Quantity { get; set; }
public long? TaxPartSaleId { get; set; }
//PRICE FIELDS
[Required]
public decimal Cost { get; set; }
[Required]
public decimal ListPrice { get; set; }
[Required]
public decimal Price { get; set; }
[Required]
public string TaxName { get; set; }
[Required]
public decimal TaxAPct { get; set; }
[Required]
public decimal TaxBPct { get; set; }
[Required]
public bool TaxOnTax { get; set; }
[NotMapped]
public decimal TaxAViz { get; set; }
[NotMapped]
public decimal TaxBViz { get; set; }
[NotMapped]
public decimal LineTotalViz { get; set; }
//UTILITY FIELDS
[NotMapped]
public bool IsDirty { get; set; } = false;//never dirty coming from the server
[Required]
public long WorkOrderItemId { get; set; }
[JsonIgnore]
public WorkOrderItem WorkOrderItem { get; set; }
[NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.WorkOrderItemPart; }
}//eoc
}//eons
/*
CREATE TABLE [dbo].[AWORKORDERITEMPART](
[AID] [uniqueidentifier] NOT NULL,
[AWORKORDERITEMID] [uniqueidentifier] NOT NULL,
[ACREATOR] [uniqueidentifier] NOT NULL,
[AMODIFIER] [uniqueidentifier] NOT NULL,
[ACREATED] [datetime] NOT NULL,
[AMODIFIED] [datetime] NOT NULL,
[APARTSERIALID] [uniqueidentifier] NULL,//DROP REPLACE WITH SERIALS text field same as whatever is done with POITEM
[APARTID] [uniqueidentifier] NULL,
[AQUANTITY] [decimal](19, 5) NULL,//CHANGE TO NOT NULL DEFAULT 0
[ACOST] [decimal](19, 5) NULL,
[APRICE] [decimal](19, 5) NULL,
[ADISCOUNT] [decimal](19, 5) NULL,
[ADISCOUNTTYPE] [smallint] NULL,//DROP WAS NEVER USED IN V7
[APARTWAREHOUSEID] [uniqueidentifier] NULL,
[ADESCRIPTION] [nvarchar](255) NULL,
[AUSED] [bit] NOT NULL,//DROP True = Part has been consumed False = Part is only "suggested", not actually consumed yet (used with quantityreserved)
[AHASAFFECTEDINVENTORY] [bit] NOT NULL,//DROP, now every save will affect inventory immediately
[ATAXPARTSALEID] [uniqueidentifier] NULL,
[AQUANTITYRESERVED] [decimal](19, 5) NULL //DROP, case 3789 due to immediately affecting inventory changes before would reserve separately, now will remove from inventory immediately or generate a request if insufficient
*/