Пример #1
0
 private void ExtractDetails(
     ICollection <CalculationValueModel> values,
     ImportBook impbook,
     ImportBookOrderDetail orderDetail)
 {
     values.Add(
         new CalculationValueModel
     {
         RowId       = $"{impbook.Id.ToString()}/{orderDetail.LineNumber}",
         ColumnId    = "RsnNo",
         TextDisplay = orderDetail.RsnNumber?.ToString(),
         RowTitle    = impbook.Id.ToString()
     });
     values.Add(
         new CalculationValueModel
     {
         RowId       = $"{impbook.Id.ToString()}/{orderDetail.LineNumber}",
         ColumnId    = "Currency",
         TextDisplay = impbook.Currency,
         RowTitle    = impbook.Id.ToString()
     });
     values.Add(
         new CalculationValueModel
     {
         RowId       = $"{impbook.Id.ToString()}/{orderDetail.LineNumber}",
         ColumnId    = "CustomsEntryCodeDate",
         TextDisplay = impbook.CustomsEntryCodeDate?.ToString("o"),
         RowTitle    = impbook.Id.ToString()
     });
     values.Add(
         new CalculationValueModel
     {
         RowId       = $"{impbook.Id.ToString()}/{orderDetail.LineNumber}",
         ColumnId    = "TariffCode",
         TextDisplay = orderDetail.TariffCode,
         RowTitle    = impbook.Id.ToString()
     });
 }
Пример #2
0
        public void SetUp()
        {
            var firstOrderDetail = new ImportBookOrderDetail
            {
                ImportBookId     = this.impbookId,
                LineNumber       = 1,
                OrderNumber      = null,
                RsnNumber        = null,
                OrderDescription = "kylo ren first order",
                Qty          = 1,
                DutyValue    = 21.12m,
                FreightValue = 22.12m,
                VatValue     = 3.12m,
                OrderValue   = 44.1m,
                Weight       = 55.2m,
                LoanNumber   = null,
                LineType     = "typea",
                CpcNumber    = null,
                TariffCode   = "121213",
                InsNumber    = null,
                VatRate      = null
            };

            var secondOrderDetail = new ImportBookOrderDetail
            {
                ImportBookId     = this.impbookId,
                LineNumber       = 2,
                OrderNumber      = 13,
                RsnNumber        = 2,
                OrderDescription = "palpatine final order",
                Qty          = 1,
                DutyValue    = 21.12m,
                FreightValue = 22.12m,
                VatValue     = 3.12m,
                OrderValue   = 44.1m,
                Weight       = 55.2m,
                LoanNumber   = null,
                LineType     = "TYpe B",
                CpcNumber    = null,
                TariffCode   = "121213",
                InsNumber    = null,
                VatRate      = null
            };

            var updatedFirstOrderDetail = new ImportBookOrderDetail
            {
                ImportBookId     = this.impbookId,
                LineNumber       = 1,
                OrderNumber      = 111,
                RsnNumber        = 222,
                OrderDescription = "kylo ren first order",
                Qty          = 3,
                DutyValue    = 91.12m,
                FreightValue = 92.12m,
                VatValue     = 93.12m,
                OrderValue   = 944.1m,
                Weight       = 955.2m,
                LoanNumber   = 999,
                LineType     = "Type C",
                CpcNumber    = 91,
                TariffCode   = "121213",
                InsNumber    = 92,
                VatRate      = 93
            };

            this.impbook = new ImportBook
            {
                Id               = this.impbookId,
                DateCreated      = DateTime.Now.AddDays(-5),
                SupplierId       = 555,
                CarrierId        = 678,
                TransportId      = 1,
                TransactionId    = 44,
                TotalImportValue = 123.4m,
                InvoiceDetails   = new List <ImportBookInvoiceDetail>(),
                OrderDetails     = new List <ImportBookOrderDetail> {
                    firstOrderDetail
                },
                PostEntries = new List <ImportBookPostEntry>()
            };

            var newImportBook = new ImportBook
            {
                Id               = this.impbookId,
                DateCreated      = DateTime.Now.AddDays(-5),
                SupplierId       = 555,
                CarrierId        = 678,
                TransactionId    = 44,
                TotalImportValue = 123.4m,
                InvoiceDetails   = new List <ImportBookInvoiceDetail>(),
                OrderDetails     =
                    new List <ImportBookOrderDetail> {
                    updatedFirstOrderDetail, secondOrderDetail
                },
                PostEntries = new List <ImportBookPostEntry>()
            };

            this.Sut.Update(this.impbook, newImportBook);
        }