Exemplo n.º 1
0
        private IList <TransferItemLine> GetInvoiceLines(int invoiceNo)
        {
            var list = new List <TransferItemLine>();

            _lineComp.bcSetFilterRequeryStr(string.Format("{0} = {1}", _colClpInvoiceNo, invoiceNo));
            _lineComp.bcFetchFirst(0);

            do
            {
                var line = new TransferItemLine
                {
                    ArticleNo          = _lineComp.bcGetStr((int)CustomerOrderLineCopy_Properties.CLP_ArticleNo),
                    ArticleName        = _lineComp.bcGetStr((int)CustomerOrderLineCopy_Properties.CLP_Name),
                    Price              = (decimal)_lineComp.bcGetDouble((int)CustomerOrderLineCopy_Properties.CLP_ExchangeSalesPrice),
                    DiscountInPercent1 = (decimal)_lineComp.bcGetDouble((int)CustomerOrderLineCopy_Properties.CLP_DiscountI),
                    DiscountInPercent2 = (decimal)_lineComp.bcGetDouble((int)CustomerOrderLineCopy_Properties.CLP_DiscountII),
                    Quantity           = (decimal)_lineComp.bcGetDouble((int)CustomerOrderLineCopy_Properties.CLP_Invoiced),
                    StockProfileNo     = _lineComp.bcGetInt((int)CustomerOrderLineCopy_Properties.CLP_StockProfileNo),
                    WareHouseNo        = _lineComp.bcGetInt((int)CustomerOrderLineCopy_Properties.CLP_WareHouseNo)
                };

                if (line.Quantity != 0)
                {
                    list.Add(line);
                }
            } while (_lineComp.bcFetchNext(0) == 0);

            return(list);
        }
Exemplo n.º 2
0
        private bool OrderlineShouldBeExcludedWhenCalculatingPostage(TransferItemLine line)
        {
            if (line.StockProfileNo == _postageCalculationParameters.ExcludeLinesWithStockProfileNo)
            {
                return(true);
            }

            return(_postageCalculationParameters.ExcludeLinesWithWareHouseNo.Contains(line.WareHouseNo));
        }
Exemplo n.º 3
0
        public void Should_return_correct_total_value_when_transfer_item_line_has_no_discount()
        {
            // Arrange
            var line = new TransferItemLine
            {
                Price    = 1000,
                Quantity = 3
            };
            const decimal expected = 3000;

            // Act
            var actual = line.GetTotalValue();

            // Assert
            Assert.That(actual, Is.EqualTo(expected));
        }
Exemplo n.º 4
0
        public void Should_return_correct_total_value_when_transfer_item_line_has_both_discount1_and_discount2()
        {
            // Arrange
            var line = new TransferItemLine
            {
                Price              = 1000,
                Quantity           = 3,
                DiscountInPercent1 = 10.0m,
                DiscountInPercent2 = 10.0m
            };

            //
            const decimal expected = 2430;

            // Act
            var actual = line.GetTotalValue();

            // Assert
            Assert.That(actual, Is.EqualTo(expected));
        }