protected void Page_Load(object sender, EventArgs e) { var PLControl = loadPurchasingLimitsControl(false) as PurchasingLimits_IT; if (PLControl != null) { if (ShoppingCart.IsSavedCart || ShoppingCart.IsFromCopy) { PLControl.HideEmptyListItem = false; } pnlPurchaseLimits.Controls.Add(PLControl); } _shoppingCart = (Page as ProductsBase).ShoppingCart; //purchasingLimits = HL.MyHerbalife.Providers.PurchasingLimitProvider.GetPurchasingLimits(DistributorID, user.Value.DSSubType); OrderMonth.RegisterOrderMonthControls(pnlOrderMonth, lblOrderMonthChanged, ProductsBase.IsEventTicketMode, pnlOrderMonthLabel); BindTotals(); if (_shoppingCart.OrderCategory == ServiceProvider.CatalogSvc.OrderCategoryType.ETO || !HLConfigManager.Configurations.CheckoutConfiguration.HasEarnBase) { trEarnBase.Visible = false; } string levelDSType = (Page as ProductsBase).Level; if (levelDSType == "DS") { imgOrderMonth.Visible = true; } else { imgOrderMonth.Visible = false; } if (imgEarnBase != null) { imgEarnBase.Visible = CheckoutTotalsDetailed.ShowEarnBaseHelpInfo(); } }
private void BindTotals() { decimal earnBase = 0.00M; var lstShoppingCartItems = (Page as ProductsBase).ShoppingCart.ShoppingCartItems; try { if (lstShoppingCartItems.Count > 0 && _shoppingCart.Totals != null) { OrderTotals_V01 totals = _shoppingCart.Totals as OrderTotals_V01; foreach (DistributorShoppingCartItem shoppingCartItem in lstShoppingCartItems) { earnBase += shoppingCartItem.EarnBase; } lblDiscountRate.Text = _shoppingCart.Totals == null ? "0%" : (totals.DiscountPercentage).ToString() + "%"; lblEarnBase.Text = getAmountString(CheckoutTotalsDetailed.GetTotalEarnBase(lstShoppingCartItems)); lblOrderMonthVolume.Text = (Page as ProductsBase).CurrentMonthVolume; lblRetailPrice.Text = getAmountString(totals.ItemsTotal); lblSubtotal.Text = getAmountString(totals.DiscountedItemsTotal); lblVolumePoints.Text = totals.VolumePoints.ToString("N2"); } else { DisplayEmptyTotals(); } } catch (Exception ex) { //Log Exception LoggerHelper.Error("Exception while displaying totals - " + ex); DisplayEmptyTotals(); } }
protected override void BindTotals() { var lstShoppingCartItems = (Page as ProductsBase).ShoppingCart.ShoppingCartItems; try { if ((HLConfigManager.Configurations.DOConfiguration.CalculateWithoutItems && _shoppingCart.Totals != null && (_shoppingCart.Totals as OrderTotals_V01).AmountDue != decimal.Zero) || (lstShoppingCartItems.Count > 0 && ShoppingCart.Totals != null)) // if (lstShoppingCartItems.Count > 0 && ShoppingCart.Totals != null) { OrderTotals_V01 totals = ShoppingCart.Totals as OrderTotals_V01; lblDiscountRate.Text = _shoppingCart.Totals == null ? "0%" : ((_shoppingCart.Totals as OrderTotals_V01).DiscountPercentage).ToString() + "%"; _shoppingCart.EmailValues.DistributorSubTotal = OrderProvider.GetDistributorSubTotal(_shoppingCart.Totals as OrderTotals_V01); _shoppingCart.EmailValues.DistributorSubTotalFormatted = getAmountString(_shoppingCart.EmailValues.DistributorSubTotal); lblDistributorSubtotal.Text = _shoppingCart.EmailValues.DistributorSubTotalFormatted; lblEarnBase.Text = getAmountString(GetTotalEarnBase(lstShoppingCartItems)); if (lblDiscountTotal != null) { lblDiscountTotal.Text = getAmountString(CheckoutTotalsDetailed.GetDiscountTotal(lstShoppingCartItems)); } // added for China DO if (HLConfigManager.Configurations.CheckoutConfiguration.HasDiscountAmount) { OrderTotals_V02 totals_V02 = ShoppingCart.Totals as OrderTotals_V02; if (totals_V02 != null) { HLRulesManager.Manager.PerformDiscountRules(_shoppingCart, null, Locale, ShoppingCartRuleReason.CartCalculated); lblDiscountAmount.Text = getAmountString(totals_V02.DiscountAmount); trDiscountRate.Visible = false; } } if (HLConfigManager.Configurations.DOConfiguration.DonationWithoutSKU) { if (trDonationAmount != null) { trDonationAmount.Visible = true; OrderTotals_V02 totals_V02 = ShoppingCart.Totals as OrderTotals_V02; if (totals_V02 != null) { lblDonationAmount.Text = getAmountString(totals_V02.Donation); } } } lblOrderMonth.Text = GetOrderMonthString(); decimal currentMonthVolume = 0; if (HLConfigManager.Configurations.CheckoutConfiguration.DisplayFormatNeedsDecimal) { lblOrderMonthVolume.Text = decimal.TryParse(ProductsBase.CurrentMonthVolume, NumberStyles.Any, CultureInfo.InstalledUICulture, out currentMonthVolume) ? ProductsBase.GetVolumePointsFormat(currentMonthVolume) : (Page as ProductsBase).CurrentMonthVolume; } else if (decimal.TryParse((Page as ProductsBase).CurrentMonthVolume, out currentMonthVolume)) { lblOrderMonthVolume.Text = ProductsBase.GetVolumePointsFormat(currentMonthVolume); } else { lblOrderMonthVolume.Text = (Page as ProductsBase).CurrentMonthVolume; } Charge_V01 otherCharges = totals.ChargeList.Find( delegate(Charge p) { return(((Charge_V01)p).ChargeType == ChargeTypes.OTHER); }) as Charge_V01 ?? new Charge_V01(ChargeTypes.OTHER, (decimal)0.0); Charge_V01 pHCharge = totals.ChargeList.Find( delegate(Charge p) { return(((Charge_V01)p).ChargeType == ChargeTypes.PH); }) as Charge_V01 ?? new Charge_V01(ChargeTypes.PH, (decimal)0.0); Charge_V01 freightCharge = totals.ChargeList.Find( delegate(Charge p) { return(((Charge_V01)p).ChargeType == ChargeTypes.FREIGHT); }) as Charge_V01 ?? new Charge_V01(ChargeTypes.FREIGHT, (decimal)0.0); Charge_V01 localTaxCharge = totals.ChargeList.Find( delegate(Charge p) { return(((Charge_V01)p).ChargeType == ChargeTypes.LOCALTAX); }) as Charge_V01 ?? new Charge_V01(ChargeTypes.LOCALTAX, (decimal)0.0); lblOtherCharges.Text = getAmountString(otherCharges.Amount); lblLocalTax.Text = getAmountString(localTaxCharge.Amount); Charge_V01 logisticCharge = totals.ChargeList.Find( delegate(Charge p) { return(((Charge_V01)p).ChargeType == ChargeTypes.LOGISTICS_CHARGE); }) as Charge_V01 ?? new Charge_V01(ChargeTypes.LOGISTICS_CHARGE, (decimal)0.0); lblLogisticCharges.Text = getAmountString(logisticCharge.Amount); lblPackageHandling.Text = getAmountString(pHCharge.Amount + totals.MarketingFundAmount); lblShippingCharges.Text = getAmountString(freightCharge.Amount); lblRetailPrice.Text = getAmountString(totals.ItemsTotal); decimal vatTax = totals.VatTax != null ? (decimal)totals.VatTax : decimal.Zero; lblTaxVAT.Text = getAmountString(vatTax); //Changes as per User Story 235045 bool hideLabels = RemovePHCharge(); decimal serviceTax = totals.ServiceTax != null ? (decimal)totals.ServiceTax: decimal.Zero; lblServiceTax.Text = getAmountString(serviceTax); if (serviceTax == 0) { serviceTAX.Visible = hideLabels ? false : true; } decimal bharatTax = totals.SwachhBharatCess != null ? (decimal)totals.SwachhBharatCess : decimal.Zero; lblBharatCessTax.Text = getAmountString(bharatTax); if (bharatTax == 0) { bharatCessTAX.Visible = hideLabels ? false : true; } var kkcEnabled = HL.Common.Configuration.Settings.GetRequiredAppSetting("KKCEnabled", false); if (kkcEnabled) { decimal krishiTax = totals.KrishiKalyanCess != null ? (decimal)totals.KrishiKalyanCess : decimal.Zero; lblKKCTax.Text = getAmountString(krishiTax); if (krishiTax == 0) { kkcTax.Visible = hideLabels ? false : true; } } else { kkcTax.Visible = false; } //User Story 251995:GDO[PRODUCTION SUPPORT]: IN: For fixing the Tax display issue on GDO Checkout page for Additional/Exceptional Tax applicable states decimal AdditionalTax = totals.AdditionalTaxCess != null ? (decimal)totals.AdditionalTaxCess : decimal.Zero; lblAdditionalTax.Text = getAmountString(AdditionalTax); if (AdditionalTax == 0) { additionalTax.Visible = hideLabels ? false : true; } decimal CSTTax = totals.CstTax != null ? (decimal)totals.CstTax : decimal.Zero; lblCSTTax.Text = getAmountString(CSTTax); if (CSTTax == 0) { cstTax.Visible = hideLabels ? false : true; } // if (lblSubtotal != null) { lblSubtotal.Text = getAmountString(logisticCharge.Amount); } if (lblAdditionalDiscount != null) { lblAdditionalDiscount.Text = getAmountString(otherCharges.Amount); } lblVolumePoints.Text = ProductsBase.GetVolumePointsFormat(totals.VolumePoints); } else { if (HLConfigManager.Configurations.DOConfiguration.DonationWithoutSKU) { if (trDonationAmount != null) { trDonationAmount.Visible = true; OrderTotals_V02 totals_V02 = ShoppingCart.Totals as OrderTotals_V02; if (totals_V02 != null) { lblDonationAmount.Text = getAmountString(totals_V02.Donation); } } } DisplayEmptyLabels(); } } catch (Exception ex) { //Log Exception LoggerHelper.Error("Exception while displaying totals - " + ex); DisplayEmptyLabels(); } }
protected virtual void BindTotals() { List <DistributorShoppingCartItem> lstShoppingCartItems = (Page as ProductsBase).ShoppingCart.ShoppingCartItems; try { if ((HLConfigManager.Configurations.DOConfiguration.CalculateWithoutItems && _shoppingCart.Totals != null && (_shoppingCart.Totals as OrderTotals_V01).AmountDue != decimal.Zero) || (lstShoppingCartItems.Count > 0 && ShoppingCart.Totals != null)) { OrderTotals_V01 totals = ShoppingCart.Totals as OrderTotals_V01; lblDiscountRate.Text = _shoppingCart.Totals == null ? "0%" : ((_shoppingCart.Totals as OrderTotals_V01).DiscountPercentage).ToString() + "%"; _shoppingCart.EmailValues.DistributorSubTotal = OrderProvider.GetDistributorSubTotal(_shoppingCart.Totals as OrderTotals_V01); _shoppingCart.EmailValues.DistributorSubTotalFormatted = getAmountString(_shoppingCart.EmailValues.DistributorSubTotal); lblDistributorSubtotal.Text = _shoppingCart.EmailValues.DistributorSubTotalFormatted; lblEarnBase.Text = getAmountString(GetTotalEarnBase(lstShoppingCartItems)); if (lblDiscountTotal != null) { lblDiscountTotal.Text = getAmountString(CheckoutTotalsDetailed.GetDiscountTotal(lstShoppingCartItems)); } if (IsChina && (DistributorOrderingProfile.IsPC || (ShoppingCart.OrderCategory == OrderCategoryType.ETO && SessionInfo != null && !SessionInfo.IsReplacedPcOrder))) { lblPCLearningPointAmount.Text = getAmountString(_shoppingCart.pcLearningPointOffSet); } // added for China DO if (HLConfigManager.Configurations.CheckoutConfiguration.HasDiscountAmount) { OrderTotals_V02 totals_V02 = ShoppingCart.Totals as OrderTotals_V02; if (totals_V02 != null) { HLRulesManager.Manager.PerformDiscountRules(_shoppingCart, null, Locale, ShoppingCartRuleReason.CartCalculated); lblDiscountAmount.Text = getAmountString(totals_V02.DiscountAmount); trDiscountRate.Visible = false; } } if (HLConfigManager.Configurations.DOConfiguration.DonationWithoutSKU) { if (trDonationAmount != null) { trDonationAmount.Visible = true; OrderTotals_V02 totals_V02 = ShoppingCart.Totals as OrderTotals_V02; if (totals_V02 != null) { lblDonationAmount.Text = getAmountString(totals_V02.Donation); } } } if (ProductsBase.IsEventTicketMode) { var orderMonthShortString = string.Empty; var ordermonth = OrderMonth.DualOrderMonthForEventTicket(true, out orderMonthShortString); // dual ordermonth should be desable for ETO lblOrderMonth.Text = string.IsNullOrWhiteSpace(ordermonth) ? GetOrderMonthString() : ordermonth; var currentSession = SessionInfo; if (null != currentSession && !string.IsNullOrWhiteSpace(orderMonthShortString)) { currentSession.OrderMonthString = ordermonth; currentSession.OrderMonthShortString = orderMonthShortString; } } else { lblOrderMonth.Text = GetOrderMonthString(); } decimal currentMonthVolume = 0; if (HLConfigManager.Configurations.CheckoutConfiguration.DisplayFormatNeedsDecimal) { lblOrderMonthVolume.Text = decimal.TryParse(ProductsBase.CurrentMonthVolume, NumberStyles.Any, CultureInfo.InstalledUICulture, out currentMonthVolume) ? ProductsBase.GetVolumePointsFormat(currentMonthVolume) : (Page as ProductsBase).CurrentMonthVolume; } else { lblOrderMonthVolume.Text = (Page as ProductsBase).CurrentMonthVolume; } Charge_V01 otherCharges = totals.ChargeList.Find( delegate(Charge p) { return(((Charge_V01)p).ChargeType == ChargeTypes.OTHER); }) as Charge_V01 ?? new Charge_V01(ChargeTypes.OTHER, (decimal)0.0); Charge_V01 pHCharge = totals.ChargeList.Find( delegate(Charge p) { return(((Charge_V01)p).ChargeType == ChargeTypes.PH); }) as Charge_V01 ?? new Charge_V01(ChargeTypes.PH, (decimal)0.0); Charge_V01 freightCharge = totals.ChargeList.Find( delegate(Charge p) { return(((Charge_V01)p).ChargeType == ChargeTypes.FREIGHT); }) as Charge_V01 ?? new Charge_V01(ChargeTypes.FREIGHT, (decimal)0.0); Charge_V01 localTaxCharge = totals.ChargeList.Find( delegate(Charge p) { return(((Charge_V01)p).ChargeType == ChargeTypes.LOCALTAX); }) as Charge_V01 ?? new Charge_V01(ChargeTypes.LOCALTAX, (decimal)0.0); lblOtherCharges.Text = getAmountString(otherCharges.Amount); lblLocalTax.Text = getAmountString(localTaxCharge.Amount); Charge_V01 logisticCharge = totals.ChargeList.Find( delegate(Charge p) { return(((Charge_V01)p).ChargeType == ChargeTypes.LOGISTICS_CHARGE); }) as Charge_V01 ?? new Charge_V01(ChargeTypes.LOGISTICS_CHARGE, (decimal)0.0); lblLogisticCharges.Text = getAmountString(logisticCharge.Amount); lblPackageHandling.Text = getAmountString(pHCharge.Amount); lblShippingCharges.Text = getAmountString(freightCharge.Amount); lblRetailPrice.Text = getAmountString(totals.ItemsTotal); lblTaxVAT.Text = getAmountString(totals.TaxAmount); if (lblSubtotal != null) { lblSubtotal.Text = getAmountString(logisticCharge.Amount); } if (lblAdditionalDiscount != null) { lblAdditionalDiscount.Text = getAmountString(otherCharges.Amount); } lblVolumePoints.Text = ProductsBase.GetVolumePointsFormat(totals.VolumePoints); //added for HR if (HLConfigManager.Configurations.CheckoutConfiguration.MergePHAndShippingCharges) { decimal phShippingCharges = pHCharge.Amount + freightCharge.Amount; lblPackageHandling.Text = getAmountString(phShippingCharges); } if (HLConfigManager.Configurations.CheckoutConfiguration.DisplayWeight && !SessionInfo.IsEventTicketMode && lblWeight != null) { lblWeight.Text = ShoppingCartProvider.GetWeight(ShoppingCart); } } else { if (HLConfigManager.Configurations.DOConfiguration.DonationWithoutSKU) { if (trDonationAmount != null) { trDonationAmount.Visible = true; OrderTotals_V02 totals_V02 = ShoppingCart.Totals as OrderTotals_V02; if (totals_V02 != null) { lblDonationAmount.Text = getAmountString(totals_V02.Donation); } } } DisplayEmptyLabels(); } } catch (Exception ex) { //Log Exception LoggerHelper.Error("Exception while displaying totals - " + ex); DisplayEmptyLabels(); } }
private void BindTotals() { //init etosku InitEtoPanel(); try { if (ShoppingCart != null) { var lstShoppingCartItems = ShoppingCart.ShoppingCartItems; if (lstShoppingCartItems.Count > 0 && ShoppingCart.Totals != null) { MyHLShoppingCart shoppingCart = ProductsBase.ShoppingCart; OrderTotals_V01 totals = shoppingCart.Totals as OrderTotals_V01; lblDiscountRate.Text = HLConfigManager.Configurations.CheckoutConfiguration.ShowVolumePointRange ? HLRulesManager.Manager.PerformDiscountRangeRules(shoppingCart, Locale, ProductsBase.DistributorDiscount) : (totals.DiscountPercentage).ToString() + "%"; trDiscountRate.Visible = !string.IsNullOrEmpty(lblDiscountRate.Text); if (HLConfigManager.Configurations.DOConfiguration.IsChina) { if (ShoppingCart.OrderCategory == OrderCategoryType.ETO && SessionInfo != null && !SessionInfo.IsReplacedPcOrder) { GetEligibleUseETOPoints(); } else { GetEligibleUsePoint(); } if (shoppingCart != null && shoppingCart.pcLearningPointOffSet > 0) { txtPCLearningPoint.Text = shoppingCart.pcLearningPointOffSet.ToString(); } else { txtPCLearningPoint.Text = "0"; } // added for China DO if (HLConfigManager.Configurations.CheckoutConfiguration.HasDiscountAmount) { OrderTotals_V02 totals_V02 = ShoppingCart.Totals as OrderTotals_V02; if (totals_V02 != null) { HLRulesManager.Manager.PerformDiscountRules(ShoppingCart, null, Locale, ShoppingCartRuleReason.CartCalculated); trDiscountTotal.Visible = totals_V02.DiscountAmount > 0; lblDiscountTotal.Text = getAmountString(totals_V02.DiscountAmount); trDiscountRate.Visible = false; } } if ((HLConfigManager.Configurations.DOConfiguration.CalculateWithoutItems && ShoppingCart.Totals != null && (ShoppingCart.Totals as OrderTotals_V01).AmountDue != decimal.Zero) || (ShoppingCart.CartItems.Count > 0 && ShoppingCart.Totals != null)) { if (HLConfigManager.Configurations.CheckoutConfiguration.ConvertAmountDue) { decimal amountDue = OrderProvider.GetConvertedAmount(totals.AmountDue, CountryCode); if (HLConfigManager.Configurations.PaymentsConfiguration.RoundAmountDue == "Standard") { amountDue = Math.Round(amountDue); } if (DistributorOrderingProfile.IsPC) { if (HttpContext.Current.Request.UrlReferrer != null && HttpContext.Current.Request.UrlReferrer.ToString().Contains("Checkout.aspx")) { totals.AmountDue = ShoppingCart.AmountduepriorpcLearningoffset; lblGrandTotal.Text = getAmountString(shoppingCart.AmountduepriorpcLearningoffset, true); } else { lblGrandTotal.Text = getAmountString(amountDue, true); } } else { lblGrandTotal.Text = getAmountString(amountDue, true); } } else { if (HLConfigManager.Configurations.PaymentsConfiguration.RoundAmountDue == "Standard") { totals.AmountDue = Math.Round(totals.AmountDue); } if (DistributorOrderingProfile.IsPC) { if (HttpContext.Current.Request.UrlReferrer != null && HttpContext.Current.Request.UrlReferrer.ToString().Contains("Checkout.aspx")) { totals.AmountDue = ShoppingCart.AmountduepriorpcLearningoffset; lblGrandTotal.Text = getAmountString(ShoppingCart.AmountduepriorpcLearningoffset); } else { lblGrandTotal.Text = getAmountString(ShoppingCart.Totals != null ? totals.AmountDue : (decimal)0.00); } } else { lblGrandTotal.Text = getAmountString(ShoppingCart.Totals != null ? totals.AmountDue : (decimal)0.00); } } } if (IsReturnFromCheckout && ShoppingCart.OrderCategory == OrderCategoryType.ETO) { lblGrandTotal.Text = getAmountString(totals != null ? totals.ItemsTotal : 0M); lblDisplayPCLearningPoint.ForeColor = System.Drawing.Color.Green; lblDisplayPCLearningPoint.Font.Bold = true; } } else { if (lblDiscountTotal != null) { lblDiscountTotal.Text = getAmountString(CheckoutTotalsDetailed.GetDiscountTotal(lstShoppingCartItems)); } } lblEarnBase.Text = getAmountString(CheckoutTotalsDetailed.GetTotalEarnBase(lstShoppingCartItems)); decimal currentMonthVolume = 0.00M; if (HLConfigManager.Configurations.CheckoutConfiguration.DisplayFormatNeedsDecimal) { lblOrderMonthVolume.Text = decimal.TryParse(ProductsBase.CurrentMonthVolume, NumberStyles.Any, CultureInfo.InstalledUICulture, out currentMonthVolume) ? ProductsBase.GetVolumePointsFormat(currentMonthVolume) : (Page as ProductsBase).CurrentMonthVolume; } else { lblOrderMonthVolume.Text = (Page as ProductsBase).CurrentMonthVolume; } lblRetailPrice.Text = getAmountString(totals.ItemsTotal); lblSubtotal.Text = getAmountString(totals.DiscountedItemsTotal); lblVolumePoints.Text = ProductsBase.GetVolumePointsFormat(totals.VolumePoints); if (HLConfigManager.Configurations.DOConfiguration.IsChina) { if (totals.ChargeList != null) { Charge_V01 otherCharges = totals.ChargeList.Find( delegate(Charge p) { return(((Charge_V01)p).ChargeType == ChargeTypes.OTHER); }) as Charge_V01 ?? new Charge_V01(ChargeTypes.OTHER, (decimal)0.0); Charge_V01 pHCharge = totals.ChargeList.Find( delegate(Charge p) { return(((Charge_V01)p).ChargeType == ChargeTypes.PH); }) as Charge_V01 ?? new Charge_V01(ChargeTypes.PH, (decimal)0.0); Charge_V01 freightCharge = totals.ChargeList.Find( delegate(Charge p) { return(((Charge_V01)p).ChargeType == ChargeTypes.FREIGHT); }) as Charge_V01 ?? new Charge_V01(ChargeTypes.FREIGHT, (decimal)0.0); Charge_V01 localTaxCharge = totals.ChargeList.Find( delegate(Charge p) { return(((Charge_V01)p).ChargeType == ChargeTypes.LOCALTAX); }) as Charge_V01 ?? new Charge_V01(ChargeTypes.LOCALTAX, (decimal)0.0); lblOtherCharges.Text = getAmountString(otherCharges.Amount); lblLocalTax.Text = getAmountString(localTaxCharge.Amount); Charge_V01 logisticCharge = totals.ChargeList.Find( delegate(Charge p) { return(((Charge_V01)p).ChargeType == ChargeTypes.LOGISTICS_CHARGE); }) as Charge_V01 ?? new Charge_V01(ChargeTypes.LOGISTICS_CHARGE, (decimal)0.0); lblLogisticCharges.Text = getAmountString(logisticCharge.Amount); lblPackageHandling.Text = getAmountString(pHCharge.Amount); lblShippingCharges.Text = getAmountString(freightCharge.Amount); //added for HR if (HLConfigManager.Configurations.CheckoutConfiguration.MergePHAndShippingCharges) { decimal phShippingCharges = pHCharge.Amount + freightCharge.Amount; lblPackageHandling.Text = getAmountString(phShippingCharges); } } lblTaxVAT.Text = getAmountString(totals.TaxAmount); } else { lblRetailPrice.Text = getAmountString((ShoppingCart.Totals as OrderTotals_V01).ItemsTotal); lblSubtotal.Text = getAmountString(OrderProvider.GetDistributorSubTotal(ShoppingCart.Totals as OrderTotals_V01)); } if (HLConfigManager.Configurations.DOConfiguration.ShowFreightChrageonCOP1) { if (totals.ChargeList != null) { Charge_V01 freightCharge = totals.ChargeList.Find( delegate(Charge p) { return(((Charge_V01)p).ChargeType == ChargeTypes.FREIGHT); }) as Charge_V01 ?? new Charge_V01(ChargeTypes.FREIGHT, (decimal)0.0); lblShippingCharges.Text = getAmountString(freightCharge.Amount); trShippingCharge.Visible = !string.IsNullOrEmpty(lblShippingCharges.Text) && HLConfigManager.Configurations.DOConfiguration.ShowFreightChrageonCOP1 && shoppingCart.DeliveryInfo != null && shoppingCart.DeliveryInfo.Option == DeliveryOptionType.Shipping; } } if (HLConfigManager.Configurations.CheckoutConfiguration.DisplayWeight && !SessionInfo.IsEventTicketMode && lblWeight != null) { lblWeight.Text = ShoppingCartProvider.GetWeight(ShoppingCart); } } else { if (HLConfigManager.Configurations.DOConfiguration.IsChina) { if ((ShoppingCart.Totals == null || (ShoppingCart.Totals as OrderTotals_V01).AmountDue == 0.0M) && !(ShoppingCart.OrderCategory == OrderCategoryType.ETO && HLConfigManager.Configurations.DOConfiguration.AllowZeroPricingEventTicket) && (ShoppingCart.ShoppingCartItems != null && ShoppingCart.ShoppingCartItems.Any())) { OnQuoteError(null, null); } if (trDonationTotal != null) { trDonationTotal.Visible = true; OrderTotals_V02 totals_V02 = ShoppingCart.Totals as OrderTotals_V02; if (totals_V02 != null) { lblDonationTotal.Text = getAmountString(totals_V02.Donation); } } //trDiscountRate.Visible = false; lblGrandTotal.Text = getAmountString(ShoppingCart.Totals != null ? (ShoppingCart.Totals as OrderTotals_V01).AmountDue : (decimal)0.00); } DisplayEmptyTotals(); } if (ShoppingCart.Totals != null && HLConfigManager.Configurations.DOConfiguration.DonationWithoutSKU) { if (trDonationTotal != null) { trDonationTotal.Visible = true; OrderTotals_V02 totals_V02 = ShoppingCart.Totals as OrderTotals_V02; if (totals_V02 != null) { lblDonationTotal.Text = getAmountString(totals_V02.Donation); } } } } else { if (trDonationTotal != null) { trDonationTotal.Visible = true; OrderTotals_V02 totals_V02 = ShoppingCart.Totals as OrderTotals_V02; if (totals_V02 != null) { lblDonationTotal.Text = getAmountString(totals_V02.Donation); } } lblGrandTotal.Text = getAmountString(ShoppingCart.Totals != null ? (ShoppingCart.Totals as OrderTotals_V01).AmountDue : (decimal)0.00); DisplayEmptyTotals(); } } catch (Exception ex) { //Log Exception LoggerHelper.Error(string.Format("Exception while displaying totals. Message: {0}, StackTrace: {1}, TargetSite:{2}, DistributorID: {3}", ex.Message, ex.StackTrace, ex.TargetSite, DistributorID)); if (HLConfigManager.Configurations.DOConfiguration.IsChina) { if (trDonationTotal != null) { trDonationTotal.Visible = true; OrderTotals_V02 totals_V02 = ShoppingCart.Totals as OrderTotals_V02; if (totals_V02 != null) { lblDonationTotal.Text = getAmountString(totals_V02.Donation); } } } DisplayEmptyTotals(); } }
protected void Page_Load(object sender, EventArgs e) { if (HLConfigManager.Configurations.DOConfiguration.IsChina && HLConfigManager.Configurations.PaymentsConfiguration.ShowBigGrandTotal) { lblGrandTotal.Attributes.Add("class", "Title"); lblDisplayGrandTotal.Attributes.Add("class", "Title"); } if (IsChina) { blErrors.Items.Clear(); } MyHLShoppingCart shoppingCart = (Page as ProductsBase).ShoppingCart; OrderMonth.RegisterOrderMonthControls(pnlOrderMonth, lblOrderMonthChanged, ProductsBase.IsEventTicketMode, pnlOrderMonthLabel); var control = loadPurchasingLimitsControl(false); if (control != null) { pnlPurchaseLimits.Visible = true; pnlPurchaseLimits.Controls.Add(control); } if (HLConfigManager.Configurations.CheckoutConfiguration.YourPriceWithAllCharges) { shoppingCart.Calculate(); } BindTotals(); if (trYourLevel != null) { trYourLevel.Visible = false; // Hide row by default } if (shoppingCart.OrderCategory == OrderCategoryType.ETO || !HLConfigManager.Configurations.CheckoutConfiguration.HasEarnBase) { if (shoppingCart.OrderCategory == OrderCategoryType.ETO || !HLConfigManager.Configurations.CheckoutConfiguration.HasSummaryEarnBase) { trEarnBase.Visible = false; } } if (!HLConfigManager.Configurations.CheckoutConfiguration.HasSubTotal) { divDistributorSubtotal.Visible = false; } if (HLConfigManager.Configurations.CheckoutConfiguration.HidePHShippingForETO) { if (SessionInfo.IsEventTicketMode) { trPackingHandling.Visible = false; if (HLConfigManager.Configurations.CheckoutConfiguration.ShowDistributorSubTotalForETO) { divDistributorSubtotal.Visible = true; } else { divDistributorSubtotal.Visible = false; } if (HLConfigManager.Configurations.CheckoutConfiguration.ShowVolumePoinsForETO) { trVolumePoints.Visible = true; } else { trVolumePoints.Visible = false; } } } if (!HLConfigManager.Configurations.CheckoutConfiguration.HasOrderMonthVolumePoints) { trOrderMonthVP.Visible = false; } string levelDSType = (Page as ProductsBase).Level; if (levelDSType == "DS") { imgOrderMonth.Visible = true; } else { imgOrderMonth.Visible = false; } if (imgEarnBase != null) { imgEarnBase.Visible = CheckoutTotalsDetailed.ShowEarnBaseHelpInfo(); } if (HLConfigManager.Configurations.DOConfiguration.IsChina) { if (HLConfigManager.Configurations.CheckoutConfiguration.HasOtherCharges) { trOtherCharges.Visible = true; } // Conditioning tax vat row visibility. if (trTaxVat != null) { trTaxVat.Visible = HLConfigManager.Configurations.CheckoutConfiguration.HasTaxVat; } if (HLConfigManager.Configurations.CheckoutConfiguration.HasLocalTax) { trLocalTax.Visible = true; } if (HLConfigManager.Configurations.CheckoutConfiguration.HideFreightCharges && ShoppingCart.DeliveryInfo.Option == DeliveryOptionType.Pickup) { trShippingCharge.Visible = false; } if (HLConfigManager.Configurations.CheckoutConfiguration.HideShippingCharges) { trShippingCharge.Visible = false; } if (!HLConfigManager.Configurations.CheckoutConfiguration.HasRetailPrice) { if (trRetailPrice != null) { trRetailPrice.Visible = false; } } else if (SessionInfo.IsEventTicketMode && trRetailPrice != null) { trRetailPrice.Visible = HLConfigManager.Configurations.CheckoutConfiguration.HasRetailPriceForETO; } if (trPackingHandling != null) { trPackingHandling.Visible = false; } if (HLConfigManager.Configurations.CheckoutConfiguration.HasLogisticCharges) { if (trLogisticCharge != null) { trLogisticCharge.Visible = true; } } if (ShoppingCart.DeliveryInfo != null) { if (ShoppingCart.DeliveryInfo.Option == DeliveryOptionType.Pickup) { if (HLConfigManager.Configurations.CheckoutConfiguration.HasPickupCharge) { if (lblDisplayShippingCharges != null) { lblDisplayShippingCharges.Text = (string)GetLocalResourceObject("lblDisplayPickupCharges"); } } else { trShippingCharge.Visible = false; } } } if (DistributorOrderingProfile != null && DistributorOrderingProfile.IsPC) { if ((ShoppingCart.PcLearningDeliveryoption == ServiceProvider.CatalogSvc.DeliveryOptionType.Unknown && shoppingCart.DeliveryOption == ServiceProvider.CatalogSvc.DeliveryOptionType.Shipping) || ShoppingCart.PcLearningDeliveryoption == ServiceProvider.CatalogSvc.DeliveryOptionType.Shipping) { trPCLearningPoint.Visible = true; trPCLearningPointLimit.Visible = true; GetEligibleUsePoint(); } else { trPCLearningPoint.Visible = false; trPCLearningPointLimit.Visible = false; } } else if (ShoppingCart.OrderCategory == OrderCategoryType.ETO && SessionInfo != null && !SessionInfo.IsReplacedPcOrder) { trPCLearningPoint.Visible = true; trPCLearningPointLimit.Visible = true; GetEligibleUseETOPoints(); } else { trPCLearningPoint.Visible = false; trPCLearningPointLimit.Visible = false; } } else { if (trDiscountTotal != null) { trDiscountTotal.Visible = HLConfigManager.Configurations.CheckoutConfiguration.ShowDisocuntTotal; } } if (DistributorOrderingProfile != null && DistributorOrderingProfile.IsPC) { trVolumePoints.Visible = false; } if (!HLConfigManager.Configurations.CheckoutConfiguration.HasRetailPrice) { if (trRetailPrice != null) { trRetailPrice.Visible = false; } } else if (SessionInfo.IsEventTicketMode && trRetailPrice != null) { trRetailPrice.Visible = HLConfigManager.Configurations.CheckoutConfiguration.HasRetailPriceForETO; } if (HLConfigManager.Configurations.DOConfiguration.IsChina) { if (!HLConfigManager.Configurations.CheckoutConfiguration.HasRetailPrice) { if (trRetailPrice != null) { trRetailPrice.Visible = false; } } else if (SessionInfo.IsEventTicketMode && trRetailPrice != null) { trRetailPrice.Visible = HLConfigManager.Configurations.CheckoutConfiguration.HasRetailPriceForETO; } trWeight.Visible = false; } else { trGrandTotal.Visible = false; trPackingHandling.Visible = false; lblDisplayPackageHandling.Visible = false; lblPackageHandling.Visible = false; trOtherCharges.Visible = false; trLogisticCharge.Visible = false; trShippingCharge.Visible = !string.IsNullOrEmpty(lblShippingCharges.Text) && HLConfigManager.Configurations.DOConfiguration.ShowFreightChrageonCOP1 && shoppingCart.DeliveryInfo != null && shoppingCart.DeliveryInfo.Option == DeliveryOptionType.Shipping; trTaxVat.Visible = false; trLocalTax.Visible = false; trPCLearningPoint.Visible = false; trPCLearningPointLimit.Visible = false; } if (HLConfigManager.Configurations.DOConfiguration.AllowHAP && ShoppingCart.OrderCategory == OrderCategoryType.HSO) { trOrderMonth.Visible = false; trOrderMonthVP.Visible = false; if (ShoppingCart.DsType != null && ShoppingCart.DsType == ServiceProvider.DistributorSvc.Scheme.Member) { trEarnBase.Visible = trDiscountRate.Visible = false; if (trYourLevel != null) { trYourLevel.Visible = true; } lblYourLevel.Text = GetGlobalResourceString(string.Format("DisplayLevel_{0}", ProductsBase.LevelSubType), defaultValue: string.Empty); } } if (trWeight != null) { trWeight.Visible = HLConfigManager.Configurations.CheckoutConfiguration.DisplayWeight && !SessionInfo.IsEventTicketMode; } if (HLConfigManager.Configurations.DOConfiguration.DisplayBifurcationKeys && ShoppingCart.DsType != null && ShoppingCart.DsType == ServiceProvider.DistributorSvc.Scheme.Member) { lblDisplayVolumePoints.Text = (string)GetLocalResourceObject("lblDisplayVolumePointsResource1MB.Text"); } }