public virtual QuoteRequestTotals ToQuoteTotals(quoteDto.QuoteRequestTotals totalsDto, Currency currency) { var result = ServiceLocator.Current.GetInstance <QuoteFactory>().CreateTotals(currency); result.AdjustmentQuoteExlTax = new Money(totalsDto.AdjustmentQuoteExlTax ?? 0, currency); result.DiscountTotal = new Money(totalsDto.DiscountTotal ?? 0, currency); result.GrandTotalExlTax = new Money(totalsDto.GrandTotalExlTax ?? 0, currency); result.GrandTotalInclTax = new Money(totalsDto.GrandTotalInclTax ?? 0, currency); result.OriginalSubTotalExlTax = new Money(totalsDto.OriginalSubTotalExlTax ?? 0, currency); result.ShippingTotal = new Money(totalsDto.ShippingTotal ?? 0, currency); result.SubTotalExlTax = new Money(totalsDto.SubTotalExlTax ?? 0, currency); result.TaxTotal = new Money(totalsDto.TaxTotal ?? 0, currency); return(result); }
public virtual QuoteRequestTotals ToQuoteTotals(quoteDto.QuoteRequestTotals totalsDto, Currency currency) { var result = new QuoteRequestTotals(currency); result.AdjustmentQuoteExlTax = new Money(totalsDto.AdjustmentQuoteExlTax ?? 0, currency); result.DiscountTotal = new Money(totalsDto.DiscountTotal ?? 0, currency); result.GrandTotalExlTax = new Money(totalsDto.GrandTotalExlTax ?? 0, currency); result.GrandTotalInclTax = new Money(totalsDto.GrandTotalInclTax ?? 0, currency); result.OriginalSubTotalExlTax = new Money(totalsDto.OriginalSubTotalExlTax ?? 0, currency); result.ShippingTotal = new Money(totalsDto.ShippingTotal ?? 0, currency); result.SubTotalExlTax = new Money(totalsDto.SubTotalExlTax ?? 0, currency); result.TaxTotal = new Money(totalsDto.TaxTotal ?? 0, currency); return(result); }
public virtual quoteDto.QuoteRequestTotals ToQuoteTotalsDto(QuoteRequestTotals totals) { var result = new quoteDto.QuoteRequestTotals { AdjustmentQuoteExlTax = (double)totals.AdjustmentQuoteExlTax.Amount, DiscountTotal = (double)totals.DiscountTotal.Amount, GrandTotalExlTax = (double)totals.GrandTotalExlTax.Amount, GrandTotalInclTax = (double)totals.GrandTotalInclTax.Amount, OriginalSubTotalExlTax = (double)totals.OriginalSubTotalExlTax.Amount, ShippingTotal = (double)totals.ShippingTotal.Amount, SubTotalExlTax = (double)totals.SubTotalExlTax.Amount, TaxTotal = (double)totals.TaxTotal.Amount }; return(result); }
public static QuoteRequestTotals ToQuoteTotals(this quoteDto.QuoteRequestTotals totalsDto, Currency currency) { return(QuoteConverterInstance.ToQuoteTotals(totalsDto, currency)); }