This commit is contained in:
2021-01-20 19:53:25 +00:00
parent fd586468b9
commit dd243bc943
3 changed files with 91 additions and 3 deletions

View File

@@ -0,0 +1,69 @@
using System;
using AyaNova.Biz;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
namespace AyaNova.Models
{
//PARTINVENTORY LEDGER
//NOTE: following pattern outlined here:
//https://dba.stackexchange.com/a/19368
public class PartInventory
{
public long Id { get; set; }
public uint Concurrency { get; set; }
[Required]
public string Description { get; set; }
[Required]
public DateTime EntryDate { get; set; }
public DateTime? LastEntryDate { get; set; }
[Required]
public long PartId { get; set; }
[Required]
public long PartWarehouseId { get; set; }
[Required]
public long SourceId { get; set; }
[Required]
public AyaType SourceType { get; set; }
[Required]
public decimal Quantity { get; set; }
[Required]
public decimal Balance { get; set; }
public decimal? LastBalance { get; set; }
public PartInventory()
{
EntryDate = DateTime.UtcNow;
SourceId=0;
SourceType=AyaType.NoType;
}
}//eoc
}//eons
/*
CREATE TABLE [dbo].[APARTBYWAREHOUSEINVENTORY](
[AID] [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,
[AQUANTITYONHAND] [decimal](19, 5) NOT NULL,
[AQUANTITYONORDER] [decimal](19, 5) NOT NULL,//calculated on teh fly from active PO's
[AMINSTOCKLEVEL] [decimal](19, 5) NOT NULL,//New table / feature PartRestock (partid/warhouseid/stocklevel)
[AQTYONORDERCOMMITTED] [decimal](19, 5) NOT NULL, //Calculated on the fly from po and partrequests
*/

View File

@@ -6,8 +6,7 @@ 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
//SERVICEBANK LEDGER
//NOTE: following pattern outlined here:
//https://dba.stackexchange.com/a/19368