Exemplo n.º 1
0
        private void CombineSalesReturnLineWithNewEntry(SalesReturnTransactionLineVM salesReturnTransactionLine)
        {
            var salesReturnNewEntryQuantity = _salesReturnNewEntryQuantity;

            salesReturnTransactionLine.Quantity       += salesReturnNewEntryQuantity;
            salesReturnTransactionLine.Total          += salesReturnNewEntryQuantity * _salesReturnNewEntryPrice;
            salesReturnTransactionLine.CostOfGoodsSold =
                SalesReturnTransactionLineHelper.GetSalesReturnTransactionLineCOGS(salesReturnTransactionLine.Model);
            _parentVM.SalesReturnTransactionNetTotal += salesReturnNewEntryQuantity *
                                                        salesReturnTransactionLine.Model.SalesPrice;
        }
Exemplo n.º 2
0
        private void AddEntryToDisplayedSalesReturnTransactionLines()
        {
            foreach (
                var salesReturnTransactionLine in
                _parentVM.DisplayedSalesReturnTransactionLines.Where(IsSalesReturnLineAbleToCombineWithNewEntry))
            {
                CombineSalesReturnLineWithNewEntry(salesReturnTransactionLine);
                return;
            }

            var newEntrySalesReturnLineVM = MakeNewEntrySalesReturnTransactionLine();

            newEntrySalesReturnLineVM.CostOfGoodsSold =
                SalesReturnTransactionLineHelper.GetSalesReturnTransactionLineCOGS(newEntrySalesReturnLineVM.Model);
            _parentVM.DisplayedSalesReturnTransactionLines.Add(newEntrySalesReturnLineVM);
            _parentVM.SalesReturnTransactionNetTotal += newEntrySalesReturnLineVM.Total;
        }