步步为盈
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.

188 lines
5.1 KiB

3 years ago
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>
3 years ago
public decimal UnitCost { get => unitCost; private set { Set(ref unitCost, value); } }
3 years ago
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); }
}
3 years ago
///// <summary>
///// 单间操作成本
///// </summary>
//public decimal SingleOperationAmount
//{
// get => singleOperationAmount;
// set
// {
// if (Set(ref singleOperationAmount, value))
// RefreshUnitCost();
// }
//}
3 years ago
/// <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();
}
}
2 years ago
///// <summary>
///// 单件仓储费
///// </summary>
//public decimal SingleStorageAmount
//{
// get => singleStorageAmount;
// set
// {
// if (Set(ref singleStorageAmount, value))
// RefreshUnitCost();
// }
//}
3 years ago
3 years ago
public decimal SingleInStorageAmount
{
get => singleInStorageAmount;
set
{
if (Set(ref singleInStorageAmount, value))
RefreshUnitCost();
}
}
public decimal SingleOutStorageAmount
{
get => singleOutStorageAmount;
set
{
if (Set(ref singleOutStorageAmount, value))
RefreshUnitCost();
}
}
public decimal SingleRefundInStorageAmount { get => singleRefundInStorageAmount; set { Set(ref singleRefundInStorageAmount, value); } }
3 years ago
2 years ago
public decimal SinglePackagingLaborAmount
{
get => singlePackagingLaborAmount;
set
{
if (Set(ref singlePackagingLaborAmount, value))
RefreshUnitCost();
}
}
3 years ago
public void RefreshUnitCost()
{
2 years ago
UnitCost = SingleSkuAmount + SingleFreight + SingleFirstFreight + SingleInStorageAmount + SingleOutStorageAmount + SingleConsumableAmount + SinglePackagingLaborAmount;
3 years ago
}
private bool isEdit;
private decimal unitCost;
private int purchaseQuantity;
private int remainingQuantity;
private decimal singleSkuAmount;
private decimal singleFreight;
private decimal singleFirstFreight;
private decimal singleDeliveryFreight;
3 years ago
//private decimal singleOperationAmount;
3 years ago
private decimal singleConsumableAmount;
2 years ago
//private decimal singleStorageAmount;
private decimal singlePackagingLaborAmount;
3 years ago
private decimal singleInStorageAmount;
private decimal singleOutStorageAmount;
3 years ago
private decimal singleRefundInStorageAmount;
3 years ago
}
}