/// <summary> /// A collection of the tokens and the replaceable content for email templates. /// </summary> /// <param name="context">An instance of the Hotcakes Request context.</param> /// <returns>List of HtmlTemplateTag</returns> public List <HtmlTemplateTag> GetReplaceableTags(HccRequestContext context) { var result = new List <HtmlTemplateTag>(); var culture = context.MainContentCulture; result.Add(new HtmlTemplateTag("[[LineItem.AdjustedPrice]]", AdjustedPricePerItem.ToString("c"))); result.Add(new HtmlTemplateTag("[[LineItem.BasePrice]]", BasePricePerItem.ToString("c"))); result.Add(new HtmlTemplateTag("[[LineItem.LineTotalBeforeVAT]]", (LineTotal - TaxPortion).ToString("c"))); result.Add(new HtmlTemplateTag("[[LineItem.Discounts]]", DiscountDetailsAsHtml())); result.Add(new HtmlTemplateTag("[[LineItem.LineTotal]]", LineTotal.ToString("c"))); result.Add(new HtmlTemplateTag("[[LineItem.ProductId]]", ProductId)); result.Add(new HtmlTemplateTag("[[LineItem.VariantId]]", VariantId)); result.Add(new HtmlTemplateTag("[[LineItem.ProductName]]", ProductName)); result.Add(new HtmlTemplateTag("[[LineItem.ProductSku]]", ProductSku)); result.Add(new HtmlTemplateTag("[[LineItem.Sku]]", "Obsolete. Please use [[LineItem.ProductSku]] instead.", true)); result.Add(new HtmlTemplateTag("[[LineItem.ProductDescription]]", ProductShortDescription)); result.Add(new HtmlTemplateTag("[[LineItem.Quantity]]", Quantity.ToString("#"))); result.Add(new HtmlTemplateTag("[[LineItem.QuantityShipped]]", QuantityShipped.ToString("#"))); result.Add(new HtmlTemplateTag("[[LineItem.QuantityReturned]]", QuantityReturned.ToString("#"))); result.Add(new HtmlTemplateTag("[[LineItem.ShippingStatus]]", LocalizationUtils.GetOrderShippingStatus(ShippingStatus, culture))); result.Add(new HtmlTemplateTag("[[LineItem.TaxRate]]", decimal.Parse(TaxRate.ToString("p3").Replace("%", "")).ToString("G29") + " %")); result.Add(new HtmlTemplateTag("[[LineItem.ShippingPortion]]", ShippingPortion.ToString("c"))); result.Add(new HtmlTemplateTag("[[LineItem.TaxPortion]]", TaxPortion.ToString("c"))); result.Add(new HtmlTemplateTag("[[LineItem.ExtraShipCharge]]", ExtraShipCharge.ToString("c"))); result.Add(new HtmlTemplateTag("[[LineItem.ShipFromAddress]]", ShipFromAddress.ToHtmlString())); result.Add(new HtmlTemplateTag("[[LineItem.ShipSeparately]]", ShipSeparately ? "Yes" : "No")); return(result); }
public async Task TestGetRateObjectByZipAsync() { string strZip = "30301"; TaxRate taxRate = await taxjarClient.GetTaxRateObjectAsync(strZip); string strExpected = "The tax rate is: zip=30301, country=US, city rate=0.019, combined rate=0.089"; Assert.Equal(strExpected, taxRate.ToString()); }
public async Task TestGetRateObjectByZipAddressAsync() { string strZip = "30024"; var address = new Address { Country = "US", City = "Suwanee", Street = "3620 Peachtree Pkwy" }; TaxRate taxRate = await taxjarClient.GetTaxRateObjectAsync(strZip, address); string strExpected = "The tax rate is: zip=30024-1029, country=US, city rate=0.0, combined rate=0.07"; Assert.Equal(strExpected, taxRate.ToString()); }
public override bool StoreToXml(XmlNode node) { if (!base.StoreToXml(node)) { return(false); } XmlDocument doc = node.OwnerDocument; XmlAttribute attribute = doc.CreateAttribute("taxRate"); NumberFormatInfo numberFormat = CultureInfo.CurrentCulture.NumberFormat; numberFormat.NumberDecimalSeparator = "."; attribute.Value = TaxRate.ToString(numberFormat); return(true); }
public override void FillCongressVotingArguments(CongressVoting voting) { voting.Argument1 = TaxRate.ToString(); }
protected override string StoreCustomFields() { CultureInfo culture = CultureInfo.InvariantCulture; return(";" + TaxRate.ToString(culture.NumberFormat)); }
// Override ToString method using | as delimter public override string ToString() { return(ProvinceCode + "|" + Name + "|" + CountryCode + "|" + TaxCode + "|" + TaxRate.ToString() + "|" + IncludesFederalTax.ToString()); }