mirror of
https://github.com/stokebob/bnhtrade.git
synced 2026-03-19 14:37:16 +00:00
Stock SKU transaction reconciliation
This commit is contained in:
@@ -16,6 +16,8 @@ namespace bnhtrade.Core.Model.Stock
|
||||
private int? skuTransactionId = null;
|
||||
private int? skuTransactionTypeId = null;
|
||||
private int? foreignKey = null;
|
||||
private string skuTransactionTypeCode;
|
||||
private Model.Stock.SkuTransactionType skuTransactionType;
|
||||
|
||||
public int SkuTransactionId
|
||||
{
|
||||
@@ -41,22 +43,60 @@ namespace bnhtrade.Core.Model.Stock
|
||||
}
|
||||
|
||||
[Required()]
|
||||
public int SkuTransactionTypeId
|
||||
public string SkuTransactionTypeCode
|
||||
{
|
||||
get { return skuTransactionTypeId.GetValueOrDefault(); }
|
||||
private set { skuTransactionTypeId = value; }
|
||||
get
|
||||
{
|
||||
if (IsSetSkuTransactionType)
|
||||
{
|
||||
return SkuTransactionType.TypeCode;
|
||||
}
|
||||
else
|
||||
{
|
||||
return skuTransactionTypeCode;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
if (IsSetSkuTransactionType)
|
||||
{
|
||||
if (SkuTransactionType.TypeCode != value)
|
||||
{
|
||||
SkuTransactionType = null;
|
||||
skuTransactionTypeCode = value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
skuTransactionTypeCode = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsSetSkuTransactionTypeId
|
||||
public bool IsSetSkuTransactionTypeCode
|
||||
{
|
||||
get { return skuTransactionTypeId != null; }
|
||||
get { return SkuTransactionTypeCode != null; }
|
||||
}
|
||||
|
||||
public string SkuTransactionTypeName { get; private set; }
|
||||
|
||||
public bool IsSetReconcileSkuTypeName
|
||||
public Model.Stock.SkuTransactionType SkuTransactionType
|
||||
{
|
||||
get { return SkuTransactionTypeName != null; }
|
||||
get
|
||||
{
|
||||
return skuTransactionType;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (IsSetSkuTransactionTypeCode)
|
||||
{
|
||||
skuTransactionTypeCode = null;
|
||||
}
|
||||
skuTransactionType = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsSetSkuTransactionType
|
||||
{
|
||||
get { return SkuTransactionType != null; }
|
||||
}
|
||||
|
||||
public int ForeignKey
|
||||
@@ -126,15 +166,6 @@ namespace bnhtrade.Core.Model.Stock
|
||||
get { return stockjournalId != null; }
|
||||
}
|
||||
|
||||
public void SetReconcileSkuType(int reconcileSkuTypeId, string reconcileSkuTypeName)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(reconcileSkuTypeName) || reconcileSkuTypeId == 0)
|
||||
{
|
||||
SkuTransactionTypeId = reconcileSkuTypeId;
|
||||
SkuTransactionTypeName = reconcileSkuTypeName;
|
||||
}
|
||||
}
|
||||
|
||||
public SkuTransaction Clone()
|
||||
{
|
||||
var clone = new SkuTransaction();
|
||||
@@ -145,11 +176,11 @@ namespace bnhtrade.Core.Model.Stock
|
||||
if (IsSetQuantity) { clone.Quantity = this.Quantity; }
|
||||
if (IsSetReference) { clone.Reference = string.Copy(this.Reference); }
|
||||
if (IsSetSkuNumber) { clone.SkuNumber = string.Copy(this.SkuNumber); }
|
||||
if (IsSetReconcileSkuTypeName) { clone.SkuTransactionTypeName = string.Copy(this.SkuTransactionTypeName); }
|
||||
if (IsSetStockJournalId) { clone.StockJournalId = this.StockJournalId; }
|
||||
if (IsSetSkuTransactionId) { clone.SkuTransactionId = this.SkuTransactionId; }
|
||||
if (IsSetSkuTransactionTypeId) { clone.SkuTransactionTypeId = this.SkuTransactionTypeId; }
|
||||
if (IsSetTransactionDate) { clone.TransactionDate = this.TransactionDate; }
|
||||
if (IsSetSkuTransactionType) { clone.SkuTransactionType = this.SkuTransactionType; }
|
||||
else if (IsSetSkuTransactionTypeCode) { clone.SkuTransactionTypeCode = string.Copy(this.SkuTransactionTypeCode); }
|
||||
|
||||
return clone;
|
||||
}
|
||||
@@ -174,10 +205,6 @@ namespace bnhtrade.Core.Model.Stock
|
||||
{
|
||||
result.Add(new ValidationResult("Stock Transaction Id is not set"));
|
||||
}
|
||||
if (!IsSetSkuTransactionTypeId)
|
||||
{
|
||||
result.Add(new ValidationResult("Stock Transaction TypeId is not set"));
|
||||
}
|
||||
if (IsSetStockJournalId && (!IsSetIsProcessed || IsProcessed == false))
|
||||
{
|
||||
result.Add(new ValidationResult("Stock Journal Id is set, IsProcessed must be set to true"));
|
||||
|
||||
Reference in New Issue
Block a user