Ejemplo n.º 1
0
        public void AddStockToItems(Entities.Stock.Stock stock, decimal defaultDutyPercentage = 12m)
        {
            StockInvoiceItem item = null;

            if (Items == null)
            {
                Items = new List <StockInvoiceItem>();
            }
            else
            {
                item = Items.Find(m => m.StockModelId == stock.Model.ModelId);
            }
            if (item == null)
            {
                item = new StockInvoiceItem
                {
                    Invoice = this,
                    //StockInvoiceItemId = (_tempItemsIndex--),
                    DutyPct          = defaultDutyPercentage,
                    StockItems       = new List <Entities.Stock.Stock>(),
                    UnitCost         = new ForeignCurrency().UpdateDenomination(this.InvoiceCurrency),
                    RetailPrice      = stock.Model.RetailPrice,
                    RentalPrice      = stock.Model.RentalPrice,
                    SpainRetailPrice = stock.Model.SpainRetailPrice
                };
                Items.Add(item);
            }
            item.StockItems.Add(stock);
            stock.InvoiceStatusId = (int)InvoiceStatusEnum.Attached;
            UpdateItemFreightApportionment();
        }
Ejemplo n.º 2
0
 public void RemoveItem(StockInvoiceItem item)
 {
     Items.Remove(item);
     UpdateItemFreightApportionment();
 }