コード例 #1
0
 public StockAction(ActionType action, ActionTypeChange typechange, Stock stock,
                    IStockDocument doc, decimal quantity, decimal?discountsum = null)
 {
     ActionType         = action;
     TypeChange         = typechange;
     ClientStockId      = stock.Id;
     SourceStockId      = stock.ServerId;
     SourceStockVersion = stock.ServerVersion;
     Quantity           = quantity;
     SrcStock           = stock;
     Timestamp          = DateTime.Now;
     DisplayDoc         = doc.DisplayName;
     NumberDoc          = doc.NumberDoc;
     FromIn             = doc.FromIn;
     OutTo        = doc.OutTo;
     RetailCost   = stock.RetailCost;
     RetailMarkup = stock.RetailMarkup;
     DiscountSum  = TypeChange == ActionTypeChange.Minus &&
                    discountsum != null ? -discountsum : discountsum;
 }
コード例 #2
0
 // отмена перемещения между складами. С поставки наружу на др. склад
 public virtual StockAction CancelDisplacementFrom(IStockDocument doc, decimal quantity)
 {
     ReservedQuantity -= quantity;
     return(new StockAction(ActionType.CancelDisplacementFrom, ActionTypeChange.Minus, this, doc, quantity));
 }
コード例 #3
0
 // отмена возврат поставщику, снаружи в резерв
 public virtual StockAction CancelReturnToSupplier(IStockDocument doc, decimal quantity)
 {
     ReservedQuantity += quantity;
     return(new StockAction(ActionType.CancelReturnToSupplier, ActionTypeChange.Plus, this, doc, quantity));
 }
コード例 #4
0
 // отмена инвентаризации, с поставки наружу
 public virtual StockAction CancelInventoryDoc(IStockDocument doc, decimal quantity)
 {
     ReservedQuantity -= quantity;
     return(new StockAction(ActionType.CancelInventoryDoc, ActionTypeChange.Minus, this, doc, quantity));
 }
コード例 #5
0
 // продажа, из резерва наружу
 public virtual StockAction ApplyReserved(IStockDocument doc, decimal quantity)
 {
     ReservedQuantity -= quantity;
     return(new StockAction(ActionType.Sale, ActionTypeChange.Minus, this, doc, quantity));
 }