You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
152 lines
4.0 KiB
152 lines
4.0 KiB
using System;
|
|
|
|
namespace BBWY.Client.Models
|
|
{
|
|
public class PurchaseOrder : NotifyObject
|
|
{
|
|
public long Id { get; set; }
|
|
public DateTime? CreateTime { get; set; }
|
|
|
|
public string ProductId { get; set; }
|
|
|
|
public PurchaseMethod? PurchaseMethod { get; set; }
|
|
|
|
public string PurchaseOrderId { get; set; }
|
|
|
|
|
|
public Platform? PurchasePlatform { get; set; }
|
|
|
|
|
|
public string SkuId { get; set; }
|
|
|
|
public StorageType? StorageType { get; set; }
|
|
|
|
public long? UserId { get; set; }
|
|
|
|
public bool IsEdit { get => isEdit; set { Set(ref isEdit, value); } }
|
|
|
|
/// <summary>
|
|
/// 单件均摊成本
|
|
/// </summary>
|
|
public decimal UnitCost { get => unitCost;private set { Set(ref unitCost, value); } }
|
|
|
|
public int PurchaseQuantity
|
|
{
|
|
get => purchaseQuantity; set
|
|
{
|
|
Set(ref purchaseQuantity, value);
|
|
RefreshUnitCost();
|
|
if (IsEdit)
|
|
RemainingQuantity = value;
|
|
}
|
|
}
|
|
|
|
public int RemainingQuantity { get => remainingQuantity; set { Set(ref remainingQuantity, value); } }
|
|
|
|
|
|
public long ShopId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 单件发货预估运费(不参与单件均摊成本计算)
|
|
/// </summary>
|
|
public decimal SingleDeliveryFreight
|
|
{
|
|
get => singleDeliveryFreight; set { Set(ref singleDeliveryFreight, value); }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 单间操作成本
|
|
/// </summary>
|
|
public decimal SingleOperationAmount
|
|
{
|
|
get => singleOperationAmount;
|
|
set
|
|
{
|
|
if (Set(ref singleOperationAmount, value))
|
|
RefreshUnitCost();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 单件耗材成本
|
|
/// </summary>
|
|
public decimal SingleConsumableAmount
|
|
{
|
|
get => singleConsumableAmount;
|
|
set
|
|
{
|
|
if (Set(ref singleConsumableAmount, value))
|
|
RefreshUnitCost();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 单件SKU成本
|
|
/// </summary>
|
|
public decimal SingleSkuAmount
|
|
{
|
|
get => singleSkuAmount;
|
|
set
|
|
{
|
|
if (Set(ref singleSkuAmount, value))
|
|
RefreshUnitCost();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 单件采购运费
|
|
/// </summary>
|
|
public decimal SingleFreight
|
|
{
|
|
get => singleFreight;
|
|
set
|
|
{
|
|
if (Set(ref singleFreight, value))
|
|
RefreshUnitCost();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 单件头程费
|
|
/// </summary>
|
|
public decimal SingleFirstFreight
|
|
{
|
|
get => singleFirstFreight;
|
|
set
|
|
{
|
|
if (Set(ref singleFirstFreight, value))
|
|
RefreshUnitCost();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 单件仓储费
|
|
/// </summary>
|
|
public decimal SingleStorageAmount
|
|
{
|
|
get => singleStorageAmount;
|
|
set
|
|
{
|
|
if (Set(ref singleStorageAmount, value))
|
|
RefreshUnitCost();
|
|
}
|
|
}
|
|
|
|
public void RefreshUnitCost()
|
|
{
|
|
UnitCost = SingleSkuAmount + SingleFreight + SingleFirstFreight + SingleOperationAmount + SingleConsumableAmount + SingleStorageAmount;
|
|
}
|
|
|
|
private bool isEdit;
|
|
private decimal unitCost;
|
|
private int purchaseQuantity;
|
|
private int remainingQuantity;
|
|
private decimal singleSkuAmount;
|
|
private decimal singleFreight;
|
|
private decimal singleFirstFreight;
|
|
private decimal singleDeliveryFreight;
|
|
private decimal singleOperationAmount;
|
|
private decimal singleConsumableAmount;
|
|
private decimal singleStorageAmount;
|
|
}
|
|
}
|
|
|