Files
raven/server/AyaNova/models/PurchaseOrder.cs
2021-02-16 00:14:55 +00:00

90 lines
3.1 KiB
C#

using System;
using System.Collections.Generic;
using AyaNova.Biz;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
namespace AyaNova.Models
{
//NOTE: Any non required field (nullable in DB) sb nullable here, i.e. decimal? not decimal,
//otherwise the server will call it an invalid record if the field isn't sent from client
public class PurchaseOrder : ICoreBizObjectModel
{
public long Id { get; set; }
public uint Concurrency { get; set; }
[Required]
public long Serial { get; set; }//WAS PO NUMBER
public string Notes { get; set; }
public string Wiki { get; set; }
public string CustomFields { get; set; }
public List<string> Tags { get; set; }
public string VendorMemo { get; set; }
public long DropShipToCustomerId { get; set; }
public string ReferenceNumber { get; set; }
public long VendorId { get; set; }
public DateTime? OrderedDate { get; set; }
public DateTime? ExpectedReceiveDate { get; set; }
public PurchaseOrderStatus Status { get; set; }
public long ProjectId { get; set; }
public string Text1 { get; set; }
public string Text2 { get; set; }
public List<PurchaseOrderItem> Items { get; set; } = new List<PurchaseOrderItem>();
public PurchaseOrder()
{
Tags = new List<string>();
}
[NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.PurchaseOrder; }
}//eoc
}//eons
/*
CREATE TABLE [dbo].[APURCHASEORDER](
[AID] [uniqueidentifier] NOT NULL,
[AVENDORMEMO] [nvarchar](255) NULL,
[ADROPSHIPTOCLIENTID] [uniqueidentifier] NULL,
[ACREATED] [datetime] NOT NULL,
[AMODIFIED] [datetime] NOT NULL,
[ACREATOR] [uniqueidentifier] NOT NULL,
[AMODIFIER] [uniqueidentifier] NOT NULL,
[APONUMBER] [int] IDENTITY(1,1) NOT NULL,
[AREFERENCENUMBER] [nvarchar](255) NULL,
[AVENDORID] [uniqueidentifier] NOT NULL,
[AORDEREDDATE] [datetime] NULL,
[AEXPECTEDRECEIVEDATE] [datetime] NULL,
[ANOTES] [ntext] NULL,
[ASTATUS] [smallint] NOT NULL, <---Allow NULL
[ACUSTOM1] [ntext] NULL,
[ACUSTOM2] [ntext] NULL,
[ACUSTOM3] [ntext] NULL,
[ACUSTOM4] [ntext] NULL,
[ACUSTOM5] [ntext] NULL,
[ACUSTOM6] [ntext] NULL,
[ACUSTOM7] [ntext] NULL,
[ACUSTOM8] [ntext] NULL,
[ACUSTOM9] [ntext] NULL,
[ACUSTOM0] [ntext] NULL,
[APROJECTID] [uniqueidentifier] NULL,
CREATE TABLE [dbo].[APURCHASEORDERRECEIPT](<---- DROP
[AID] [uniqueidentifier] NOT NULL,<---- DROP
[ACREATED] [datetime] NOT NULL,<---- DROP
[AMODIFIED] [datetime] NOT NULL,<---- DROP
[ACREATOR] [uniqueidentifier] NOT NULL,<---- DROP
[AMODIFIER] [uniqueidentifier] NOT NULL,<---- DROP
[ARECEIVEDDATE] [datetime] NOT NULL, <---- DROP BUT MIGRATES INTO LINE ITEM RECEIVE DATE
[AVENDORID] [uniqueidentifier] NOT NULL, <---- DROP
[ATEXT1] [nvarchar](255) NULL, <----KEEP MOVE INTO PO HEADER
[ATEXT2] [nvarchar](255) NULL, <----KEEP MOVE INTO PO HEADER
*/