/// <summary> /// Gets the backoffice order summary. /// </summary> /// <param name="salesPreparation">The sales preparation.</param> /// <returns></returns> private static BackofficeOrderSummary GetBackofficeOrderSummary(BackofficeSalePreparation salesPreparation) { var summary = new BackofficeOrderSummary(); if (!salesPreparation.IsReadyToInvoice()) { return(summary); } var invoice = salesPreparation.PrepareInvoice(); // item total summary.ItemTotal = invoice.TotalItemPrice(); // shipping total summary.ShippingTotal = invoice.TotalShipping(); // tax total summary.TaxTotal = invoice.TotalTax(); // invoice total summary.InvoiceTotal = invoice.Total; return(summary); }
/// <summary> /// Gets the <see cref="IBackofficeSalePreparation"/> /// </summary> /// <param name="backoffice">The backoffice with items use in the checkout</param> /// <param name="merchelloContext">The <see cref="IMerchelloContext"/></param> /// <returns>A <see cref="IBackofficeSalePreparation"/></returns> internal static BackofficeSalePreparation SalePreparation(this IBackoffice backoffice, IMerchelloContext merchelloContext) { return(BackofficeSalePreparation.GetBackofficeCheckoutPreparation(merchelloContext, backoffice)); }