using System; using System.ComponentModel.DataAnnotations; using Newtonsoft.Json; using System.ComponentModel.DataAnnotations.Schema; namespace AyaNova.Models { public class PurchaseOrderItem { public long Id { get; set; } public uint Concurrency { get; set; } [Required] public long PurchaseOrderId { get; set; } [Required] public long PartId { get; set; } [Required] public long PartWarehouseId { get; set; } [Required] public decimal QuantityOrdered { get; set; } [Required] public decimal QuantityReceived { get; set; } [Required] public decimal PurchaseOrderCost { get; set; } [Required] public decimal ReceivedCost { get; set; } public DateTime? ReceivedDate { get; set; } public long? PartRequestedById { get; set; } public long? WorkOrderItemPartRequestId { get; set; } public long? PurchaseTaxCodeId { get; set; } public string VendorPartNumber { get; set; } public string Serials { get; set; } [JsonIgnore] public PurchaseOrder PurchaseOrder { get; set; } //server populated fields not db fields [NotMapped] public string PartNameViz { get; set; } [NotMapped] public string PartDescriptionViz { get; set; } [NotMapped] public string UpcViz { get; set; } [NotMapped] public string PartManufacturerNumberViz { get; set; } [NotMapped] public string PartUnitOfMeasureViz { get; set; } [NotMapped] public string WarehouseViz { get; set; } [NotMapped] public string PartRequestedByViz { get; set; }//DisplayRequestUser [NotMapped] public string WorkOrderItemPartRequestViz { get; set; }//DisplayRequestWorkorder [NotMapped] public string PurchaseTaxCodeViz { get; set; }//DisplayTaxCode [NotMapped] public decimal NetTotalViz { get; set; }//DisplayNetTotal [NotMapped] public decimal TaxAViz { get; set; }//DisplayTaxA [NotMapped] public decimal TaxBViz { get; set; }//DisplayTaxB [NotMapped] public decimal LineTotalViz { get; set; }//DisplayLineTotal }//eoc }//eons /* ** Also add receiveddate as a line item field CREATE TABLE [dbo].[APURCHASEORDERITEM]( [AID] [uniqueidentifier] NOT NULL, [APURCHASEORDERID] [uniqueidentifier] NOT NULL, [ACREATOR] [uniqueidentifier] NOT NULL, [AMODIFIER] [uniqueidentifier] NOT NULL, [ACREATED] [datetime] NOT NULL, [AMODIFIED] [datetime] NOT NULL, [APARTID] [uniqueidentifier] NOT NULL, [AQUANTITYORDERED] [decimal](19, 5) NULL, [APURCHASEORDERCOST] [decimal](19, 5) NULL, [AQUANTITYRECEIVED] [decimal](19, 5) NULL, [ACLOSED] [bit] NOT NULL, <---??? DROP? WTF [AWORKORDERITEMPARTREQUESTID] [uniqueidentifier] NULL, [APARTREQUESTEDBYID] [uniqueidentifier] NULL, [APARTWAREHOUSEID] [uniqueidentifier] NULL, [APURCHASETAXCODEID] [uniqueidentifier] NULL, CREATE TABLE [dbo].[APURCHASEORDERRECEIPTITEM]( [AID] [uniqueidentifier] NOT NULL, [APURCHASEORDERRECEIPTID] [uniqueidentifier] NOT NULL, [ACREATED] [datetime] NOT NULL, [AMODIFIED] [datetime] NOT NULL, [ACREATOR] [uniqueidentifier] NOT NULL, [AMODIFIER] [uniqueidentifier] NOT NULL, [APARTID] [uniqueidentifier] NOT NULL, [APARTWAREHOUSEID] [uniqueidentifier] NOT NULL, [APURCHASEORDERID] [uniqueidentifier] NOT NULL, [APURCHASEORDERITEMID] [uniqueidentifier] NOT NULL, [ARECEIPTCOST] [decimal](19, 5) NOT NULL, [AQUANTITYRECEIVED] [decimal](19, 5) NOT NULL, PRIMARY KEY NONCLUSTERED */