94 lines
3.0 KiB
C#
94 lines
3.0 KiB
C#
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; }
|
|
|
|
[JsonIgnore]
|
|
public PurchaseOrder PurchaseOrder { get; set; }
|
|
|
|
|
|
//mirror fields to save a roundtrip to the UI, not persisted
|
|
[NotMapped]
|
|
public string DisplayPartNumber { get; set; }
|
|
[NotMapped]
|
|
public string DisplayWarehouse { get; set; }
|
|
[NotMapped]
|
|
public string DisplayRequestUser { get; set; }
|
|
[NotMapped]
|
|
public string DisplayRequestWorkorder { get; set; }
|
|
[NotMapped]
|
|
public string DisplayTaxCode { get; set; }
|
|
|
|
|
|
|
|
|
|
}//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
|
|
|
|
|
|
*/ |