Exemplo n.º 1
0
 public InventoryLine(InventoryDoc doc, Stock stock, decimal quantity, ISession session, bool stockIsNew = false)
 {
     Stock.Copy(stock, this);
     Id         = 0;
     Stock      = stock;
     Quantity   = quantity;
     StockIsNew = stockIsNew;
     Doc        = doc;
     if (stockIsNew)
     {
         Stock.ReservedQuantity += quantity;
         session.Save(new StockAction(ActionType.Stock, ActionTypeChange.Plus, Stock, Doc, Quantity));
     }
     else
     {
         session.Save(Stock.InventoryDoc(Doc, quantity));
     }
 }