コード例 #1
0
 public SubscriptionShippingNotificationPostProcessor(IUnitOfWorkFactory unitOfWorkFactory, IEmailService emailService, IEmailTemplateUtilities emailTemplateUtilities, IContentManagerUtilities contentManagerUtilities, ICurrencyFormatProvider currencyFormatProvider, IOrderLineUtilities OrderLineUtilities)
 {
     this.UnitOfWork              = unitOfWorkFactory.GetUnitOfWork();
     this.EmailService            = emailService;
     this.ContentManagerUtilities = contentManagerUtilities;
     this.EmailTemplateUtilities  = emailTemplateUtilities;
     this.CurrencyFormatProvider  = currencyFormatProvider;
     this.OrderLineUtilities      = OrderLineUtilities;
 }
コード例 #2
0
 public SmartSupplyModifiedOrdersPostProcessor(IntegrationJob integrationJob, IUnitOfWorkFactory unitOfWorkFactory, IIntegrationJobSchedulingService integrationJobSchedulingService, IEmailService emailService, ICurrencyFormatProvider currencyFormatProvider, IOrderLineUtilities OrderLineUtilities)
 {
     this.UnitOfWork = unitOfWorkFactory.GetUnitOfWork();
     this.IntegrationJobSchedulingService = integrationJobSchedulingService;
     this.EmailService           = emailService;
     this.IntegrationJob         = integrationJob;
     this.CurrencyFormatProvider = currencyFormatProvider;
     this.OrderLineUtilities     = OrderLineUtilities;
 }
コード例 #3
0
 public PricingServiceBrasselerCanada(
     IUnitOfWorkFactory unitOfWorkFactory,
     ICurrencyFormatProvider currencyFormatProvider,
     IOrderLineUtilities orderLineUtilities,
     IPricingServiceFactory pricingServiceFactory,
     PricingSettings pricingSettings,
     IPriceMatrixUtilities priceMatrixUtilities,
     IPerRequestCacheManager perRequestCacheManager
     )
     : base(unitOfWorkFactory, currencyFormatProvider, orderLineUtilities, pricingServiceFactory, perRequestCacheManager, priceMatrixUtilities, pricingSettings)
 {
     customSettings = new Lazy <CustomSettings>();
 }
コード例 #4
0
 public ChangeStatusToAwaitingApproval_Brasseler(Lazy <ICookieManager> cookieManager, ICurrencyFormatProvider currencyFormatProvider, Lazy <ICustomerOrderUtilities> customerOrderUtilities, IUnitOfWorkFactory unitOfWorkFactory, IContentManagerUtilities contentManagerUtilities, IEmailService emailService, EmailsSettings emailsSettings, IEmailTemplateUtilities emailTemplateUtilities, IOrderLineUtilities OrderLineUtilities, Lazy <ITranslationLocalizer> translationLocalizer)
 {
     this.cookieManager           = cookieManager;
     this.CurrencyFormatProvider  = currencyFormatProvider;
     this.CustomerOrderUtilities  = customerOrderUtilities;
     this.UnitOfWork              = unitOfWorkFactory.GetUnitOfWork();
     this.ContentManagerUtilities = contentManagerUtilities;
     this.EmailService            = emailService;
     customSettings              = new CustomSettings();
     this.EmailsSettings         = emailsSettings;
     this.EmailTemplateUtilities = emailTemplateUtilities;
     this.OrderLineUtilities     = OrderLineUtilities;
     this.TranslationLocalizer   = translationLocalizer;
 }
 public GetCartMapper_Brasseler(ICurrencyFormatProvider currencyFormatProvider, IGetCountryMapper getCountryMapper, IGetStateMapper getStateMapper, IGetBillToMapper getBillToMapper, IGetShipToMapper getShipToMapper, IGetCartLineCollectionMapper getCartLineCollectionMapper, IObjectToObjectMapper objectToObjectMapper, IUrlHelper urlHelper, IRouteDataProvider routeDataProvider, ITranslationLocalizer translationLocalizer, IUnitOfWorkFactory unitOfWork)
     : base(currencyFormatProvider, getBillToMapper, getShipToMapper, getCartLineCollectionMapper, objectToObjectMapper, urlHelper, routeDataProvider, translationLocalizer)
 {
     this.CurrencyFormatProvider      = currencyFormatProvider;
     this.GetBillToMapper             = getBillToMapper;
     this.GetShipToMapper             = getShipToMapper;
     this.GetCartLineCollectionMapper = getCartLineCollectionMapper;
     this.ObjectToObjectMapper        = objectToObjectMapper;
     this.UrlHelper            = urlHelper;
     this.RouteDataProvider    = routeDataProvider;
     this.TranslationLocalizer = translationLocalizer;
     this.GetCountryMapper     = getCountryMapper;
     this.GetStateMapper       = getStateMapper;
     this.UnitOfWork           = unitOfWork.GetUnitOfWork();
 }
コード例 #6
0
 public UpdateCartCreateSSOrder(ICustomerOrderUtilities customerOrderUtilities, IOrderLineUtilities orderLineUtilities, ICartPipeline cartPipeline, Lazy <IPromotionEngine> promotionEngine, IPricingPipeline pricingPipeline, OrderManagementGeneralSettings orderManagementGeneralSettings, ICurrencyFormatProvider currencyFormatProvider, Lazy <IEntityTranslationService> entityTranslationService, Lazy <IEmailService> emailService, Lazy <IProductUtilities> productUtilities, Lazy <IInventoryPipeline> inventoryPipeline, InventorySettings inventorySettings, Lazy <ITranslationLocalizer> translationLocalizer, CustomSettings customSettings)
 {
     this.CustomerOrderUtilities = customerOrderUtilities;
     OrderLineUtilities          = orderLineUtilities;
     CartPipeline         = cartPipeline;
     this.PromotionEngine = promotionEngine;
     this.PricingPipeline = pricingPipeline;
     this.OrderManagementGeneralSettings = orderManagementGeneralSettings;
     this.CurrencyFormatProvider         = currencyFormatProvider;
     this.EmailService         = emailService;
     this.ProductUtilities     = productUtilities;
     this.inventoryPipeline    = inventoryPipeline;
     this.inventorySettings    = inventorySettings;
     this.translationLocalizer = translationLocalizer;
     EntityTranslationService  = entityTranslationService;
     this.customSettings       = customSettings;
 }
コード例 #7
0
 protected void PopulateOrderLines(CustomerOrder customerOrder, dynamic emailModel)
 {
     emailModel.OrderLines = new List <ExpandoObject>();
     foreach (OrderLine orderLine in customerOrder.OrderLines)
     {
         dynamic expandoObjects = new ExpandoObject();
         expandoObjects.ProductNumber        = orderLine.Product.ErpNumber;
         expandoObjects.Description          = orderLine.Description;
         expandoObjects.QtyOrdered           = decimal.Round(orderLine.QtyOrdered, 2);
         expandoObjects.QtyOrderedDisplay    = expandoObjects.QtyOrdered.ToString("0.##");
         expandoObjects.UnitNetPrice         = orderLine.UnitNetPrice;
         expandoObjects.UnitNetPriceDisplay  = this.CurrencyFormatProvider.GetString(orderLine.UnitNetPrice, customerOrder.Currency);
         expandoObjects.ExtendedUnitNetPrice = this.OrderLineUtilities.GetTotalNetPrice(orderLine);
         dynamic currency = expandoObjects;
         ICurrencyFormatProvider currencyFormatProvider = this.CurrencyFormatProvider;
         currency.ExtendedUnitNetPriceDisplay = currencyFormatProvider.GetString(expandoObjects.ExtendedUnitNetPrice, customerOrder.Currency);
         emailModel.OrderLines.Add(expandoObjects);
     }
 }
コード例 #8
0
        public override UpdateCartResult Execute(IUnitOfWork unitOfWork, UpdateCartParameter parameter, UpdateCartResult result)
        {
            if (!parameter.Status.EqualsIgnoreCase("AwaitingApproval"))
            {
                return(this.NextHandler.Execute(unitOfWork, parameter, result));
            }
            CustomerOrder cart = result.GetCartResult.Cart;

            try
            {
                if (parameter.Status.EqualsIgnoreCase("AwaitingApproval") && result.GetCartResult.Cart != null)
                {
                    CustomerOrder  order         = result.GetCartResult.Cart;
                    string         approverEmail = string.IsNullOrEmpty(order.ApproverUserProfile.Email) ? "" : order.ApproverUserProfile.Email;
                    UserProfileDto userProfile   = SiteContext.Current.UserProfileDto;
                    dynamic        emailModel    = new ExpandoObject();
                    emailModel.OrderNumber = order.OrderNumber;
                    emailModel.Name        = order.PlacedByUserName;
                    emailModel.Approver    = order.ApproverUserProfile.FirstName;
                    emailModel.Reason      = order.ApproverMessage;
                    emailModel.totalCost   = order.ShippingCharges;
                    DateTime date = order.OrderDate.Date;
                    emailModel.OrderDate  = date.ToShortDateString();
                    emailModel.CustomerPO = order.CustomerPO;
                    emailModel.OrderLines = new List <ExpandoObject>();
                    foreach (OrderLine orderLine in order.OrderLines)
                    {
                        dynamic expandoObjects = new ExpandoObject();
                        expandoObjects.ProductNumber        = orderLine.Product.ErpNumber;
                        expandoObjects.Description          = orderLine.Description;
                        expandoObjects.QtyOrdered           = decimal.Round(orderLine.QtyOrdered, 2);
                        expandoObjects.QtyOrderedDisplay    = expandoObjects.QtyOrdered.ToString("0.##");
                        expandoObjects.UnitNetPrice         = orderLine.UnitNetPrice;
                        expandoObjects.UnitNetPriceDisplay  = this.CurrencyFormatProvider.GetString(orderLine.UnitNetPrice, order.Currency);
                        expandoObjects.ExtendedUnitNetPrice = this.OrderLineUtilities.GetTotalNetPrice(orderLine);
                        dynamic currency = expandoObjects;
                        ICurrencyFormatProvider currencyFormatProvider = this.CurrencyFormatProvider;
                        currency.ExtendedUnitNetPriceDisplay = currencyFormatProvider.GetString(expandoObjects.ExtendedUnitNetPrice, order.Currency);
                        emailModel.OrderLines.Add(expandoObjects);
                    }
                    emailModel.Shipping       = result.GetCartResult.ShippingAndHandling;
                    emailModel.SubTotal       = result.GetCartResult.OrderSubTotal;
                    emailModel.Tax            = result.GetCartResult.TotalTax;
                    emailModel.OrderTotal     = result.GetCartResult.OrderGrandTotal;
                    emailModel.CustomerNumber = order.CustomerNumber;
                    emailModel.BTCompanyName  = order.BTCompanyName;
                    emailModel.BTAddress1     = order.BTAddress1;
                    emailModel.BTAddress2     = order.BTAddress2;
                    emailModel.BTAddress3     = order.BTAddress3;
                    emailModel.BTCity         = order.BTCity;
                    emailModel.BTState        = order.BTState;
                    emailModel.BTPostalCode   = order.BTPostalCode;
                    emailModel.STCompanyName  = order.STCompanyName;
                    emailModel.STAddress1     = order.STAddress1;
                    emailModel.STAddress2     = order.STAddress2;
                    emailModel.STAddress3     = order.STAddress3;
                    emailModel.STCity         = order.STCity;
                    emailModel.STState        = order.STState;
                    emailModel.STPostalCode   = order.STPostalCode;
                    emailModel.BTDisplayName  = order.BTFirstName + " " + order.BTLastName;
                    emailModel.STDisplayName  = order.STFirstName + " " + order.STLastName;
                    emailModel.BTFirstName    = order.BTFirstName;
                    emailModel.BTLastName     = order.BTLastName;
                    emailModel.STFirstName    = order.STFirstName;
                    emailModel.STLastName     = order.STLastName;
                    if (order.ShipVia != null && order.ShipVia.Carrier != null)
                    {
                        emailModel.ShipMethod = order.ShipVia.Description;
                    }
                    else
                    {
                        emailModel.ShipMethod = string.Empty;
                    }
                    emailModel.Notes                  = order.Notes;
                    emailModel.Handling               = order.HandlingCharges;
                    emailModel.HandlingDisplay        = this.CurrencyFormatProvider.GetString(order.HandlingCharges, order.Currency);
                    emailModel.OrderSubTotalDisplay   = this.CurrencyFormatProvider.GetString(result.GetCartResult.OrderSubTotal, order.Currency);
                    emailModel.OrderGrandTotalDisplay = this.CurrencyFormatProvider.GetString(result.GetCartResult.OrderGrandTotal, order.Currency);
                    emailModel.OrderTotalDueDisplay   = this.CurrencyFormatProvider.GetString(result.GetCartResult.OrderGrandTotal, order.Currency);
                    emailModel.CustomerOrderTaxes     = new List <ExpandoObject>();
                    foreach (CustomerOrderTax customerOrderTax in
                             from o in order.CustomerOrderTaxes
                             orderby o.SortOrder
                             select o)
                    {
                        dynamic expandoObjects = new ExpandoObject();
                        expandoObjects.TaxCode          = this.TranslationLocalizer.Value.TranslateLabel(customerOrderTax.TaxCode);
                        expandoObjects.TaxDescription   = this.TranslationLocalizer.Value.TranslateLabel(customerOrderTax.TaxDescription);
                        expandoObjects.TaxRate          = customerOrderTax.TaxRate;
                        expandoObjects.TaxAmount        = customerOrderTax.TaxAmount;
                        expandoObjects.TaxAmountDisplay = this.CurrencyFormatProvider.GetString(customerOrderTax.TaxAmount, order.Currency);
                        expandoObjects.SortOrder        = customerOrderTax.SortOrder;
                        emailModel.CustomerOrderTaxes.Add(expandoObjects);
                    }
                    emailModel.CreditCardWillBeCharged = result.GetCartResult.OrderGrandTotal;
                    emailModel.TotalTaxDisplay         = this.CurrencyFormatProvider.GetString(result.GetCartResult.TotalTax, order.Currency);

                    var promotionProductDiscountTotal = this.CustomerOrderUtilities.Value.GetPromotionProductDiscountTotal(order);
                    emailModel.PromotionProductDiscountTotal        = promotionProductDiscountTotal;
                    emailModel.PromotionProductDiscountTotalDisplay = this.CurrencyFormatProvider.GetString(promotionProductDiscountTotal, order.Currency);

                    var promotionOrderDiscountTotal = this.CustomerOrderUtilities.Value.GetPromotionOrderDiscountTotal(order);
                    emailModel.PromotionOrderDiscountTotal        = promotionOrderDiscountTotal;
                    emailModel.PromotionOrderDiscountTotalDisplay = this.CurrencyFormatProvider.GetString(promotionOrderDiscountTotal, order.Currency);

                    var promotionShippingDiscountTotal = this.CustomerOrderUtilities.Value.GetPromotionShippingDiscountTotal(order);
                    emailModel.PromotionShippingDiscountTotal        = promotionShippingDiscountTotal;
                    emailModel.PromotionShippingDiscountTotalDisplay = this.CurrencyFormatProvider.GetString(promotionShippingDiscountTotal, order.Currency);

                    var giftCardTotal = this.CustomerOrderUtilities.Value.GetGiftCardTotal(order);
                    emailModel.GiftCardTotal        = giftCardTotal;
                    emailModel.GiftCardTotalDisplay = this.CurrencyFormatProvider.GetString(giftCardTotal, order.Currency);
                    //changes for BUSA-401 starts
                    //emailModel.WebsiteUrl = order.Website.DomainName;
                    //changes for BUSA-401 ends

                    emailModel.WebsiteUrl = HttpContext.Current.Request.ActualUrl().GetLeftPart(UriPartial.Authority);//BUSA-552 : Incorrect URL in Order Approve email template

                    var emailList = this.GetOrCreateEmailList("OrderApprove", "You have a new order to approve");
                    //this.EmailService.SendEmailList(emailList.Id, approverEmail, emailModel, string.Format("{0} {1}", emailList.Subject, order.OrderNumber), this.UnitOfWork);
                    //BUSA-489 - commented the above line and added the below block

                    //BUSA - 489 - start
                    emailList = unitOfWork.GetRepository <EmailList>().GetTable().Expand((EmailList x) => x.EmailTemplate).FirstOrDefault((EmailList x) => x.Id == emailList.Id);
                    if (emailList != null)
                    {
                        SendEmailParameter sendEmailParameter = new SendEmailParameter();
                        string             htmlTemplate       = GetHtmlTemplate(emailList);
                        sendEmailParameter.Body = this.EmailService.ParseTemplate(htmlTemplate, emailModel);

                        sendEmailParameter.Subject = string.Format("{0} {1}", emailList.Subject, order.OrderNumber);
                        sendEmailParameter.ToAddresses.Add(approverEmail);
                        sendEmailParameter.BccAddresses = new List <string>();

                        var emailCCAddresses = customSettings.EmailCCAddresses;
                        if (!string.IsNullOrEmpty(emailCCAddresses))
                        {
                            sendEmailParameter.CCAddresses.Add(emailCCAddresses);
                        }
                        string defaultEmailAddress = customSettings.DefaultEmailAddress;
                        sendEmailParameter.FromAddress = (emailList.FromAddress.IsBlank() ? defaultEmailAddress : emailList.FromAddress);
                        //Start BUSA - 685 :Create an ability to resend an email for Order Approve
                        var emailCCAddressOfFrom    = userProfile.Email;
                        var emailCCAddressOfSupport = sendEmailParameter.FromAddress;
                        if (!string.IsNullOrEmpty(emailCCAddressOfFrom))
                        {
                            sendEmailParameter.CCAddresses.Add(emailCCAddressOfFrom);
                        }
                        if (!string.IsNullOrEmpty(emailCCAddressOfSupport))
                        {
                            sendEmailParameter.CCAddresses.Add(emailCCAddressOfSupport);
                        }
                        //Start BUSA - 685 :Create an ability to resend an email for Order Approve
                        sendEmailParameter.ReplyToAddresses   = new List <string>();
                        sendEmailParameter.ExtendedProperties = new NameValueCollection();
                        SendEmail(sendEmailParameter, unitOfWork);
                    }
                    //BUSA - 489 - end
                }
            }
            catch (Exception ex)
            {
                LogHelper.For((object)this).Error((object)("There was a problem executing UpdateCartResult" + (object)ex.InnerException), ex.InnerException, (string)null, (object)null);
                throw ex;
            }
            return(NextHandler.Execute(unitOfWork, parameter, result));
        }
 public GetInvoiceMapper_Brasseler(ICurrencyFormatProvider currencyFormatProvider, IUrlHelper urlHelper, IObjectToObjectMapper objectToObjectMapper, ITranslationLocalizer translationLocalizer) : base(currencyFormatProvider, urlHelper, objectToObjectMapper, translationLocalizer)
 {
 }
コード例 #10
0
        protected void PopulateOrderEmailModel(dynamic emailModel, CustomerOrder customerOrder, IUnitOfWork unitOfWork)
        {
            string str;
            string str1;
            string str2;

            emailModel.OrderNumber = customerOrder.OrderNumber;
            DateTimeOffset orderDate = customerOrder.OrderDate.ToLocalTime();  //BUSA-477 Order Confirmation email contains wrong time

            emailModel.OrderDate  = orderDate.ToString(CultureInfo.InvariantCulture);
            emailModel.CustomerPO = customerOrder.CustomerPO;
            dynamic obj = emailModel;

            str = (customerOrder.BTCompanyName.IsBlank() ? string.Concat(customerOrder.BTFirstName, " ", customerOrder.BTLastName).Trim() : customerOrder.BTCompanyName);
            obj.BTDisplayName = str;

            emailModel.CustomerNumber = customerOrder.CustomerNumber;
            if (customerOrder.ShipTo != null && !string.IsNullOrEmpty(customerOrder.ShipTo.CustomerSequence))
            {
                // BUSA-472, 548, 508 : Duplicate Customers on Production Starts
                if (customerOrder.ShipTo.CustomerSequence.ToUpper().Contains("ISC"))
                {
                    emailModel.CustomerShipToNumber = SiteContext.Current.ShipTo.CustomerSequence;
                }
                else
                {
                    emailModel.CustomerShipToNumber = customerOrder.ShipTo.CustomerSequence;
                }
                // BUSA-472, 548, 508 : Duplicate Customers on Production Ends
            }
            else
            {
                emailModel.CustomerShipToNumber = string.Empty;
            }
            emailModel.BTAddress1   = customerOrder.BTAddress1;
            emailModel.BTAddress2   = customerOrder.BTAddress2;
            emailModel.BTAddress3   = customerOrder.BTAddress3;
            emailModel.BTCity       = customerOrder.BTCity;
            emailModel.BTState      = customerOrder.BTState;
            emailModel.BTZip        = customerOrder.BTPostalCode;
            emailModel.BTPostalCode = customerOrder.BTPostalCode;
            emailModel.BTCountry    = customerOrder.BTCountry;
            emailModel.BTCompany    = customerOrder.BTCompanyName;
            emailModel.BTEmail      = customerOrder.BTEmail;
            emailModel.BTPhone1     = customerOrder.BTPhone;
            dynamic obj1 = emailModel;

            str1 = (customerOrder.STCompanyName.IsBlank() ? string.Concat(customerOrder.STFirstName, " ", customerOrder.STLastName).Trim() : customerOrder.STCompanyName);
            obj1.STDisplayName      = str1;
            emailModel.STAddress1   = customerOrder.STAddress1;
            emailModel.STAddress2   = customerOrder.STAddress2;
            emailModel.STAddress3   = customerOrder.STAddress3;
            emailModel.STCity       = customerOrder.STCity;
            emailModel.STState      = customerOrder.STState;
            emailModel.STZip        = customerOrder.STPostalCode;
            emailModel.STPostalCode = customerOrder.STPostalCode;
            emailModel.STCountry    = customerOrder.STCountry;
            emailModel.STCompany    = customerOrder.STCompanyName;
            emailModel.STEmail      = customerOrder.STEmail;
            emailModel.STPhone1     = customerOrder.STPhone;
            dynamic obj2 = emailModel;

            str2             = (customerOrder.ShipVia == null ? string.Empty : this.EntityTranslationService.Value.TranslateProperty <ShipVia>(customerOrder.ShipVia, (ShipVia o) => o.Description));
            obj2.ShipMethod  = str2;
            emailModel.Notes = customerOrder.Notes;
            ICurrencyFormatProvider value = this.CurrencyFormatProvider;
            Currency currency             = null;

            if (customerOrder.CurrencyId.HasValue)
            {
                currency = unitOfWork.GetTypedRepository <ICurrencyRepository>().Get(customerOrder.CurrencyId.Value);
            }
            emailModel.PromotionProductDiscountTotal         = this.CustomerOrderUtilities.GetPromotionProductDiscountTotal(customerOrder);
            emailModel.PromotionProductDiscountTotalDisplay  = value.GetString(emailModel.PromotionProductDiscountTotal, currency);
            emailModel.PromotionOrderDiscountTotal           = this.CustomerOrderUtilities.GetPromotionOrderDiscountTotal(customerOrder);
            emailModel.PromotionOrderDiscountTotalDisplay    = value.GetString(emailModel.PromotionOrderDiscountTotal, currency);
            emailModel.PromotionShippingDiscountTotal        = this.CustomerOrderUtilities.GetPromotionShippingDiscountTotal(customerOrder);
            emailModel.PromotionShippingDiscountTotalDisplay = value.GetString(emailModel.PromotionShippingDiscountTotal, currency);
            emailModel.FullShippingCharge        = customerOrder.ShippingCharges;
            emailModel.FullShippingChargeDisplay = value.GetString(customerOrder.ShippingCharges, currency);
            emailModel.Handling                = customerOrder.HandlingCharges;
            emailModel.HandlingDisplay         = value.GetString(customerOrder.HandlingCharges, currency);
            emailModel.LocalTax                = customerOrder.LocalTax;
            emailModel.LocalTaxDisplay         = value.GetString(customerOrder.LocalTax, currency);
            emailModel.StateTax                = customerOrder.StateTax;
            emailModel.StateTaxDisplay         = value.GetString(customerOrder.StateTax, currency);
            emailModel.TotalTax                = this.CustomerOrderUtilities.GetTotalTax(customerOrder);
            emailModel.TotalTaxDisplay         = value.GetString(emailModel.TotalTax, currency);
            emailModel.CreditCardWillBeCharged = customerOrder.CreditCardTransactions.Any <CreditCardTransaction>();
            emailModel.OrderSubTotal           = this.CustomerOrderUtilities.GetOrderSubTotal(customerOrder);
            emailModel.OrderSubTotalDisplay    = value.GetString(emailModel.OrderSubTotal, currency);
            emailModel.OrderSubTotalWithOutProductDiscounts        = this.CustomerOrderUtilities.GetPromotionProductDiscountTotal(customerOrder) + this.CustomerOrderUtilities.GetOrderSubTotal(customerOrder);
            emailModel.OrderSubTotalWithOutProductDiscountsDisplay = value.GetString(emailModel.OrderSubTotalWithOutProductDiscounts, currency);
            emailModel.OrderGrandTotal        = this.CustomerOrderUtilities.GetOrderTotal(customerOrder);
            emailModel.OrderGrandTotalDisplay = value.GetString(emailModel.OrderGrandTotal, currency);
            emailModel.GiftCardTotal          = this.CustomerOrderUtilities.GetGiftCardTotal(customerOrder);
            emailModel.GiftCardTotalDisplay   = value.GetString(emailModel.GiftCardTotal, currency);
            emailModel.OrderTotalDue          = this.GetOrderTotalDue(customerOrder);
            emailModel.OrderTotalDueDisplay   = value.GetString(emailModel.OrderTotalDue, currency);
            //emailModel.CustomerOrderTaxes = this.PopulateCustomerOrderTaxEmailModel(customerOrder, unitOfWork); kkk
            this.PopulateCustomerOrderTaxes(customerOrder, emailModel);
            //emailModel.OrderLines = this.PopulateOrderLineEmailModel(customerOrder, unitOfWork); kkk
            this.PopulateOrderLines(customerOrder, emailModel);

            if (customerOrder.CustomProperties.Where(x => x.Name == "subscriptionFrequencyOpted").Count() > 0)
            {
                var frequency = customerOrder.CustomProperties.FirstOrDefault(x => x.Name == "subscriptionFrequencyOpted").Value;
                if (!string.IsNullOrEmpty(frequency))
                {
                    emailModel.SubscriptionFrequency = int.Parse(frequency) / 7;
                }
            }
        }