Files
raven/server/AyaNova/models/ViewRestockRequired.cs
2021-02-27 20:42:47 +00:00

34 lines
1.7 KiB
C#

namespace AyaNova.Models
{
//Note this is how to define a View backed model with no key (id)
[Microsoft.EntityFrameworkCore.Keyless]
public class ViewRestockRequired
{
public long PartId { get; set; }
public long PartWarehouseId { get; set; }
public string PartNumber { get; set; }
public string DisplayWarehouse { get; set; }
public long ManufacturerId { get; set; }
public string DisplayManufacturer { get; set; }
public long WholesalerId { get; set; }
public string DisplayWholesaler { get; set; }
public long AlternativeWholesalerId { get; set; }
public string DisplayAlternativeWholesaler { get; set; }
public decimal MinimumQuantity { get; set; }
public decimal Balance { get; set; }
public decimal OnOrderQuantity { get; set; }
public decimal RequiredQuantity { get; set; }
}//eoc
}//eons
/*
SELECT apart.id AS partid, apartwarehouse.id AS partwarehouseid, apart.partnumber, apartwarehouse.name AS displaywarehouse, "
+ "amanufacturer.id AS manufacturerid, amanufacturer.name AS displaymanufacturer, awholesaler.id AS wholesalerid, awholesaler.name AS displaywholesaler, "
+ "aalternativewholesaler.id AS alternativewholesalerid, aalternativewholesaler.name AS displayalternativewholesaler,"
+ "apartstocklevel.minimumquantity, vpartinventorynow.balance, COALESCE(vpartsonorderuncommitted.quantityonorder,0) AS onorderquantity, "
+ "apartstocklevel.minimumquantity - (COALESCE(vpartinventorynow.balance, 0) + COALESCE(vpartsonorderuncommitted.quantityonorder, 0)) AS requiredquantity "
*/