private void butLoadResult_Click(object sender, EventArgs e)
        {
            getTaxRequest.Lines.Clear();
            ReturnValue_Line = SetLineDetails();

            getTaxResult = _taxService.GetTax(getTaxRequest);
            bool FinalResultValue;

            if (ReturnValue_Company == false || ReturnValue_Line == false || ReturnValue_Address == false)
            {
                FinalResultValue = false;
            }
            else
            {
                txtResultCode.Text       = Convert.ToString(getTaxResult.ResultCode);
                txtResultDocCode.Text    = getTaxResult.DocCode;
                txtResultDocDate.Text    = Convert.ToString(getTaxResult.DocDate);
                txtResultTotTaxable.Text = Convert.ToString(getTaxResult.TotalTaxable);
                txtResultTotAmt.Text     = Convert.ToString(getTaxResult.TotalAmount);
                txtTotalTax.Text         = Convert.ToString(getTaxResult.TotalTax);
                txtResultTotDisc.Text    = Convert.ToString(getTaxResult.TotalDiscount);
                txtResultTransId.Text    = getTaxResult.TransactionId;
                FinalResultValue         = true;
            }
            if (FinalResultValue == false)
            {
                MessageBox.Show(getTaxResult.Messages[0].Summary.ToString());
            }
        }
Exemplo n.º 2
0
 public IHttpActionResult CartTotal(ShoppingCart cart)
 {
     if (!string.IsNullOrEmpty(_taxSettings.Username) && !string.IsNullOrEmpty(_taxSettings.Password) &&
         !string.IsNullOrEmpty(_taxSettings.ServiceUrl) &&
         !string.IsNullOrEmpty(_taxSettings.CompanyCode) && _taxSettings.IsEnabled)
     {
         var taxSvc       = new TaxSvc(_taxSettings.Username, _taxSettings.Password, _taxSettings.ServiceUrl);
         var request      = cart.ToAvaTaxRequest(_taxSettings.CompanyCode);
         var getTaxResult = taxSvc.GetTax(request);
         if (!getTaxResult.ResultCode.Equals(SeverityLevel.Success))
         {
             var error = string.Join(Environment.NewLine, getTaxResult.Messages.Select(m => m.Details));
             return(BadRequest(error));
         }
         else
         {
             foreach (TaxLine taxLine in getTaxResult.TaxLines ?? Enumerable.Empty <TaxLine>())
             {
                 cart.Items.ToArray()[Int32.Parse(taxLine.LineNo)].TaxTotal = taxLine.Tax;
                 //foreach (TaxDetail taxDetail in taxLine.TaxDetails ?? Enumerable.Empty<TaxDetail>())
                 //{
                 //}
             }
             cart.TaxTotal = getTaxResult.TotalTax;
         }
     }
     else
     {
         return(BadRequest());
     }
     return(Ok(cart));
 }
Exemplo n.º 3
0
        public static void CalculateAvalaraTax(OpportunityMaint rg, CROpportunity order)
        {
            TaxSvc service = new TaxSvc();

            AvalaraMaint.SetupService(rg, service);

            AddressSvc addressService = new AddressSvc();

            AvalaraMaint.SetupService(rg, addressService);

            GetTaxRequest getRequest       = null;
            bool          isValidByDefault = true;

            if (order.IsTaxValid != true)
            {
                getRequest = BuildGetTaxRequest(rg, order);

                if (getRequest.Lines.Count > 0)
                {
                    isValidByDefault = false;
                }
                else
                {
                    getRequest = null;
                }
            }

            if (isValidByDefault)
            {
                PXDatabase.Update <CROpportunity>(
                    new PXDataFieldAssign("IsTaxValid", true),
                    new PXDataFieldRestrict("OpportunityID", PXDbType.NVarChar, CROpportunity.OpportunityIDLength, order.OpportunityID, PXComp.EQ)
                    );
                return;
            }

            GetTaxResult result = service.GetTax(getRequest);

            if (result.ResultCode == SeverityLevel.Success)
            {
                try
                {
                    ApplyAvalaraTax(rg, order, result);
                    PXDatabase.Update <CROpportunity>(
                        new PXDataFieldAssign("IsTaxValid", true),
                        new PXDataFieldRestrict("OpportunityID", PXDbType.NVarChar, CROpportunity.OpportunityIDLength, order.OpportunityID, PXComp.EQ)
                        );
                }
                catch (Exception ex)
                {
                    throw new PXException(ex, TX.Messages.FailedToApplyTaxes);
                }
            }
            else
            {
                LogMessages(result);

                throw new PXException(TX.Messages.FailedToGetTaxes);
            }
        }
        public void PostTax(OriginAddress originAddress, CustomerOrder customerOrder)
        {
            if (!this.AvalaraSettings.PostTaxes)  // Added condition to check post taxes setting
            {
                return;
            }
            string str = string.Empty;

            if (ValidateOrderAddressForAvalara(customerOrder))
            {
                try
                {
                    GetTaxRequest  requestFromOrder1    = GetCalcTaxRequestFromOrder(originAddress, customerOrder, DocumentType.SalesInvoice);
                    PostTaxRequest requestFromOrder2    = GetPostTaxRequestFromOrder(customerOrder);
                    TaxSvc         configuredTaxService = GetConfiguredTaxService();
                    configuredTaxService.GetTax(requestFromOrder1);
                    str = this.ProcessAvalaraResponseMessage(configuredTaxService.PostTax(requestFromOrder2));
                }
                catch (Exception ex)
                {
                    LogHelper.For(this).Error("Error running Avalara PostTax method: " + ex.Message, "TaxCalculator_Avalara");
                    throw;
                }
            }
            else
            {
                LogHelper.For(this).Debug("The billto/shipto customer does not have an address specified. In order to calculate tax this must be set up.", "TaxCalculator_Avalara");
                return;
            }
            if (string.IsNullOrEmpty(str))
            {
                return;
            }
            LogHelper.For(this).Debug(str, "Avalara Result, PostTax: ");
        }
Exemplo n.º 5
0
        public void OrderPlaced(Order order)
        {
            if (!Enabled)
            {
                throw new InvalidOperationException("AvalaraInactiveException");
            }

            var customer     = new Customer(order.CustomerID);
            var cartItems    = order.CartItems;
            var orderOptions = GetOrderOptions(order);

            // Create line items for all cart items and shipping selections
            var cartItemAddressGroups = GroupCartItemsByShippingAddress(cartItems, customer.PrimaryShippingAddressID);
            var lineItems             = CreateItemAndShippingLineItems(cartItemAddressGroups, (shipmentAddressId, shipmentAddress, shipmentCartItems) => CreateOrderShippingLineItem(shipmentAddress, shipmentCartItems, order, shipmentAddressId));

            // Create line items for order options using the first shipping address as the destination
            var firstShippingAddress = LoadAvalaraAddress(cartItemAddressGroups.First().Key);

            lineItems = lineItems.Concat(CreateOrderOptionLineItems(orderOptions, firstShippingAddress));

            // Calculate the discount from the promotion usages for this order
            decimal discountAmount;

            using (var promotionsDataContext = new AspDotNetStorefront.Promotions.Data.EntityContextDataContext())
            {
                discountAmount = promotionsDataContext.PromotionUsages
                                 .Where(pu => pu.OrderId == order.OrderNumber)
                                 .Where(pu => pu.Complete)
                                 .Sum(pu => - pu.OrderDiscountAmount)           // Avalara expects a positive number
                                 .GetValueOrDefault(0);
            }

            // Build and submit the tax request
            GetTaxRequest taxRequest = BuildTaxRequest(customer, GetOriginAddress(), DocumentType.SalesInvoice);

            taxRequest.Discount            = discountAmount;
            taxRequest.DocCode             = order.OrderNumber.ToString();
            taxRequest.TaxOverride.TaxDate = order.OrderDate;

            // Add each line to the request, setting the line number sequentially
            int lineItemIndex = 0;

            foreach (var line in lineItems)
            {
                line.No = (++lineItemIndex).ToString();
                taxRequest.Lines.Add(line);
            }

            TaxSvc       taxService = CreateTaxService();
            GetTaxResult taxResult  = taxService.GetTax(taxRequest);

            foreach (Message message in taxResult.Messages)
            {
                LogErrorMessage(message);                 //this throws an exception
            }
            //not used currently
            //decimal taxAmount = taxResult.TotalTax;
        }
Exemplo n.º 6
0
        private void CalculateCustomerOrderTaxes(OrderChangeEvent context)
        {
            var order = context.ModifiedOrder;

            if (order.Items.Any())
            {
                order.Items.ForEach(x =>
                {
                    x.Tax        = 0;
                    x.TaxDetails = null;
                });
            }

            order.Tax = 0;

            if (_taxSettings.IsEnabled && !string.IsNullOrEmpty(_taxSettings.Username) && !string.IsNullOrEmpty(_taxSettings.Password) &&
                !string.IsNullOrEmpty(_taxSettings.ServiceUrl) &&
                !string.IsNullOrEmpty(_taxSettings.CompanyCode))
            {
                var taxSvc   = new TaxSvc(_taxSettings.Username, _taxSettings.Password, _taxSettings.ServiceUrl);
                var isCommit = order.InPayments != null && order.InPayments.Any() && order.InPayments.All(pi => pi.IsApproved);
                var request  = order.ToAvaTaxRequest(_taxSettings.CompanyCode, isCommit);
                if (request != null)
                {
                    var getTaxResult = taxSvc.GetTax(request);
                    if (!getTaxResult.ResultCode.Equals(SeverityLevel.Success))
                    {
                        var error = string.Join(Environment.NewLine, getTaxResult.Messages.Select(m => m.Details));
                        OnError(new Exception(error));
                    }
                    else
                    {
                        foreach (TaxLine taxLine in getTaxResult.TaxLines ?? Enumerable.Empty <TaxLine>())
                        {
                            order.Items.ToArray()[Int32.Parse(taxLine.LineNo)].Tax = taxLine.Tax;
                            //foreach (TaxDetail taxDetail in taxLine.TaxDetails ?? Enumerable.Empty<TaxDetail>())
                            //{
                            //    order.Items.ToArray()[Int32.Parse(taxLine.LineNo)].TaxDetails = new[]
                            //    {
                            //        new VirtoCommerce.Domain.Commerce.Model.TaxDetail
                            //        {
                            //            Amount = taxDetail.Tax,
                            //            Name = taxDetail.TaxName,
                            //            Rate = taxDetail.Rate
                            //        }
                            //    };
                            //}
                        }
                        order.Tax = getTaxResult.TotalTax;
                    }
                }
            }
            else
            {
                OnError(new Exception("AvaTax credentials not provided"));
            }
        }
Exemplo n.º 7
0
        public static decimal GetTax(int orderId, bool UpdateOrderTax, bool CartTax, ClientCartContext clientData)
        {
            decimal taxAmount = 0M;

            try
            {
                XmlNode config = null;
                config = GetTax_AvalaraConfig();
                string accountNumber = config.Attributes["accountNumber"].Value;
                string licenseKey    = config.Attributes["licenseKey"].Value;
                string serviceURL    = config.Attributes["serviceURL"].Value;

                TaxSvc taxSvc = new TaxSvc(accountNumber, licenseKey, serviceURL);

                GetTaxRequest           getTaxRequest = GetTax_Request(orderId, UpdateOrderTax, CartTax, clientData);
                XmlSerializerNamespaces namesp        = new XmlSerializerNamespaces();
                namesp.Add(string.Empty, string.Empty);
                XmlWriterSettings settings = new XmlWriterSettings();
                settings.OmitXmlDeclaration = true;
                XmlSerializer x1 = new XmlSerializer(getTaxRequest.GetType());
                StringBuilder sb = new StringBuilder();
                x1.Serialize(XmlTextWriter.Create(sb, settings), getTaxRequest, namesp);
                string       req          = sb.ToString();
                int          timeout      = getTimeOutTax(); // This is for Request TimeOut
                GetTaxResult getTaxResult = taxSvc.GetTax(getTaxRequest, timeout);

                XmlSerializer x2  = new XmlSerializer(getTaxResult.GetType());
                StringBuilder sb2 = new StringBuilder();
                x2.Serialize(XmlTextWriter.Create(sb2, settings), getTaxResult, namesp);
                string res = sb2.ToString();

                if (getTaxResult.ResultCode.Equals(SeverityLevel.Success))
                {
                    taxAmount = getTaxResult.TotalTax;
                }

                if (UpdateOrderTax && orderId > 0)
                {
                    CSResolve.Resolve <IOrderService>().UpdateOrderTax(orderId, taxAmount);
                    Dictionary <string, AttributeValue> orderAttributes = new Dictionary <string, AttributeValue>();
                    orderAttributes.Add("TaxRequest", new CSBusiness.Attributes.AttributeValue(req));
                    orderAttributes.Add("TaxResponse", new CSBusiness.Attributes.AttributeValue(res));
                    CSResolve.Resolve <IOrderService>().UpdateOrderAttributes(orderId, orderAttributes, null);
                }
            }
            catch
            {
            }
            return(taxAmount);
        }
Exemplo n.º 8
0
        public static GetTaxResult Execute(CustomerOrder order, out string summary)
        {
            summary = "";
            TaxServiceWrapper taxSvcWrapper = new TaxServiceWrapper();
            TaxSvc            taxSvc        = taxSvcWrapper.GetTaxSvcInstance(order.InProduction);

            PostTaxRequest postTaxRequest = new PostTaxRequest();

            GetTaxRequest getTaxRequest = BuildGetTaxRequest(order);

            GetTaxResult getTaxResult = taxSvc.GetTax(getTaxRequest);

            if (!getTaxResult.ResultCode.Equals(SeverityLevel.Success))
            {
                foreach (Message message in getTaxResult.Messages)
                {
                    summary = message.Summary;
                }
            }

            return(getTaxResult);
        }
Exemplo n.º 9
0
        public void IssueRefund(Order order, Address originAddress, decimal refundTotal)
        {
            if (!Enabled)
            {
                throw new InvalidOperationException("AvalaraInactiveException");
            }

            var customer     = new Customer(order.CustomerID);
            var cartItems    = order.CartItems;
            var orderOptions = GetOrderOptions(order);
            int numberOfRefundTransactions = (order.ChildOrderNumbers ?? String.Empty).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Length;

            decimal discountAmount = -cartItems.DiscountResults.Sum(dr => dr.OrderTotal);               // This value is returned as negative, but Avalara expectes a positive

            // Build and submit the tax request
            GetTaxRequest taxRequest = BuildTaxRequest(customer, GetOriginAddress(), DocumentType.SalesInvoice);

            taxRequest.Discount = discountAmount;
            taxRequest.DocCode  = order.OrderNumber.ToString() + "." + (numberOfRefundTransactions + 1).ToString();
            taxRequest.TaxOverride.TaxOverrideType = TaxOverrideType.TaxDate;
            taxRequest.TaxOverride.TaxDate         = order.OrderDate;
            taxRequest.TaxOverride.Reason          = "Refund";
            taxRequest.DocDate = DateTime.Now;
            taxRequest.Commit  = CommitRefunds;

            if (refundTotal > 0)
            {
                // Partial refund
                // Add in the refund line object
                Line refundLineItem = new Line
                {
                    Amount  = -refundTotal,
                    Qty     = 1,
                    No      = "1",
                    TaxCode = TaxRefunds ? null : "NT"                     // Make this refund non-taxable as recommended by Avalara
                };

                taxRequest.Lines.Add(refundLineItem);
            }
            else
            {
                // Refund the full order
                // Void any partial refunds
                VoidRefunds(order);

                // Add order items to the refund transaction
                // Create line items for all cart items and shipping selections
                var cartItemAddressGroups = GroupCartItemsByShippingAddress(cartItems, customer.PrimaryShippingAddressID);
                var lineItems             = CreateItemAndShippingLineItems(cartItemAddressGroups, (shipmentAddressId, shipmentAddress, shipmentCartItems) => CreateOrderShippingLineItem(shipmentAddress, shipmentCartItems, order, shipmentAddressId));

                // Create line items for order options using the first shipping address as the destination
                var firstShippingAddress = LoadAvalaraAddress(cartItemAddressGroups.First().Key);
                lineItems = lineItems.Concat(CreateOrderOptionLineItems(orderOptions, firstShippingAddress));

                // Add each line to the request, setting the line number sequentially
                int lineItemIndex = 0;
                foreach (var line in lineItems)
                {
                    line.Amount = -line.Amount;
                    line.No     = (++lineItemIndex).ToString();
                    taxRequest.Lines.Add(line);
                }
            }

            TaxSvc       taxService = CreateTaxService();
            GetTaxResult taxResult  = taxService.GetTax(taxRequest);

            foreach (Message message in taxResult.Messages)
            {
                LogErrorMessage(message);
            }
        }
Exemplo n.º 10
0
        public decimal GetTaxRate(Customer customer, CartItemCollection cartItems, IEnumerable <OrderOption> orderOptions)
        {
            if (!Enabled)
            {
                throw new InvalidOperationException("AvalaraInactiveException");
            }

            if (!customer.HasAtLeastOneAddress() || !cartItems.Any())
            {
                return(0m);
            }

            // Return the cached value if it's present and still valid
            string  lastCartHash    = HttpContext.Current.Items["Avalara.CartHash"] as string;
            decimal?lastTaxAmount   = HttpContext.Current.Items["Avalara.TaxAmount"] as decimal?;
            string  currentCartHash = GetCartHash(cartItems, customer, orderOptions);

            if (lastTaxAmount != null && currentCartHash == lastCartHash)
            {
                return(lastTaxAmount.Value);
            }

            // Create line items for all cart items and shipping selections
            var cartItemAddressGroups = GroupCartItemsByShippingAddress(cartItems, customer.PrimaryShippingAddressID);
            var lineItems             = CreateItemAndShippingLineItems(cartItemAddressGroups, (shipmentAddressId, shipmentAddress, shipmentCartItems) => CreateCartShippingLineItem(shipmentAddress, customer, shipmentCartItems, orderOptions));

            // Create line items for order options using the first shipping address as the destination
            var firstShippingAddress = LoadAvalaraAddress(cartItemAddressGroups.First().Key);

            lineItems = lineItems.Concat(CreateOrderOptionLineItems(orderOptions, firstShippingAddress));

            decimal discountAmount = -cartItems.DiscountResults.Sum(dr => dr.OrderTotal);               // This value is returned as negative, but Avalara expectes a positive

            // Build and submit the tax request
            GetTaxRequest taxRequest = BuildTaxRequest(customer, GetOriginAddress(), DocumentType.SalesOrder);

            taxRequest.Discount = discountAmount;

            // Add each line to the request, setting the line number sequentially
            int lineItemIndex = 1;

            foreach (var line in lineItems)
            {
                line.No = (lineItemIndex++).ToString();
                taxRequest.Lines.Add(line);
            }

            TaxSvc       taxService = CreateTaxService();
            GetTaxResult taxResult  = taxService.GetTax(taxRequest);

            foreach (Message message in taxResult.Messages)
            {
                LogErrorMessage(message);
            }

            decimal taxAmount = taxResult.TotalTax;

            // Cache the tax amount
            HttpContext.Current.Items["Avalara.CartHash"]  = currentCartHash;
            HttpContext.Current.Items["Avalara.TaxAmount"] = taxAmount;

            return(taxAmount);
        }
Exemplo n.º 11
0
        public static void Test()
        {
            string accountNumber = ConfigurationManager.AppSettings["AvaTax:AccountNumber"];
            string licenseKey = ConfigurationManager.AppSettings["AvaTax:LicenseKey"];
            string serviceURL = ConfigurationManager.AppSettings["AvaTax:ServiceUrl"];

            TaxSvc taxSvc = new TaxSvc();

            // Header Level Parameters
            // Required Header Parameters
            taxSvc.Configuration.Security.Account = accountNumber;
            taxSvc.Configuration.Security.License = licenseKey;
            taxSvc.Configuration.Url = serviceURL;
            taxSvc.Configuration.ViaUrl = serviceURL;
            taxSvc.Profile.Client = "AvaTaxSample";

            // Optional Header Parameters
            taxSvc.Profile.Name = "Development";

            GetTaxRequest getTaxRequest = new GetTaxRequest();

            // Document Level Parameters
            // Required Request Parameters
            getTaxRequest.CustomerCode = "ABC4335";
            getTaxRequest.DocDate = DateTime.Parse("2014-01-01");
            //// getTaxRequest.Lines is also required, and is presented later in this file.

            // Best Practice Request Parameters
            getTaxRequest.CompanyCode = "APITrialCompany";
            getTaxRequest.DocCode = "INV001";
            getTaxRequest.DetailLevel = DetailLevel.Tax;
            getTaxRequest.Commit = false;
            getTaxRequest.DocType = DocumentType.SalesInvoice;

            // Situational Request Parameters
            // getTaxRequest.BusinessIdentificationNo = "234243";
            // getTaxRequest.CustomerUsageType = "G";
            // getTaxRequest.ExemptionNo = "12345";
            // getTaxRequest.Discount = 50;
            // getTaxRequest.LocationCode = "01";
            // getTaxRequest.TaxOverride.TaxOverrideType = TaxOverrideType.TaxDate;
            // getTaxRequest.TaxOverride.Reason = "Adjustment for return";
            // getTaxRequest.TaxOverride.TaxDate = DateTime.Parse("2013-07-01");
            // getTaxRequest.TaxOverride.TaxAmount = 0;
            // getTaxRequest.ServiceMode = ServiceMode.Automatic;

            // Optional Request Parameters
            getTaxRequest.PurchaseOrderNo = "PO123456";
            getTaxRequest.ReferenceCode = "ref123456";
            getTaxRequest.PosLaneCode = "09";
            getTaxRequest.CurrencyCode = "USD";
            getTaxRequest.ExchangeRate = (decimal)1.0;
            getTaxRequest.ExchangeRateEffDate = DateTime.Parse("2013-01-01");
            getTaxRequest.SalespersonCode = "Bill Sales";

            // Address Data
            Address address1 = new Address();
            address1.Line1 = "45 Fremont Street";
            address1.City = "San Francisco";
            address1.Region = "CA";

            Address address2 = new Address();
            address2.Line1 = "118 N Clark St";
            address2.Line2 = "Suite 100";
            address2.Line3 = "ATTN Accounts Payable";
            address2.City = "Chicago";
            address2.Region = "IL";
            address2.Country = "US";
            address2.PostalCode = "60602";

            Address address3 = new Address();
            address3.Latitude = "47.627935";
            address3.Longitude = "-122.51702";

            // Line Data
            // Required Parameters
            Line line1 = new Line();
            line1.No = "01";
            line1.ItemCode = "N543";
            line1.Qty = 1;
            line1.Amount = 10;
            line1.OriginAddress = address1;
            line1.DestinationAddress = address2;

            // Best Practice Request Parameters
            line1.Description = "Red Size 7 Widget";
            line1.TaxCode = "NT";

            // Situational Request Parameters
            // line1.CustomerUsageType = "L";
            // line1.ExemptionNo = "12345";
            // line1.Discounted = true;
            // line1.TaxIncluded = true;
            // line1.TaxOverride.TaxOverrideType = TaxOverrideType.TaxDate;
            // line1.TaxOverride.Reason = "Adjustment for return";
            // line1.TaxOverride.TaxDate = DateTime.Parse("2013-07-01");
            // line1.TaxOverride.TaxAmount = 0;

            // Optional Request Parameters
            line1.Ref1 = "ref123";
            line1.Ref2 = "ref456";
            getTaxRequest.Lines.Add(line1);

            Line line2 = new Line();
            line2.No = "02";
            line2.ItemCode = "T345";
            line2.Qty = 3;
            line2.Amount = 150;
            line2.OriginAddress = address1;
            line2.DestinationAddress = address3;
            line2.Description = "Size 10 Green Running Shoe";
            line2.TaxCode = "PC030147";
            getTaxRequest.Lines.Add(line2);

            Line line3 = new Line();
            line3.No = "02-FR";
            line3.ItemCode = "FREIGHT";
            line3.Qty = 1;
            line3.Amount = 15;
            line3.OriginAddress = address1;
            line3.DestinationAddress = address3;
            line3.Description = "Shipping Charge";
            line3.TaxCode = "FR";
            getTaxRequest.Lines.Add(line3);

            GetTaxResult getTaxResult = taxSvc.GetTax(getTaxRequest);

            Console.WriteLine("GetTaxTest Result: " + getTaxResult.ResultCode.ToString());
            if (!getTaxResult.ResultCode.Equals(SeverityLevel.Success))
            {
                foreach (Message message in getTaxResult.Messages)
                {
                    Console.WriteLine(message.Summary);
                }
            }
            else
            {
                Console.WriteLine("Document Code: " + getTaxResult.DocCode + " Total Tax: " + getTaxResult.TotalTax);
                foreach (TaxLine taxLine in getTaxResult.TaxLines)
                {
                    Console.WriteLine("    " + "Line Number: " + taxLine.No + " Line Tax: " + getTaxResult.TotalTax.ToString());
                    foreach (TaxDetail taxDetail in taxLine.TaxDetails)
                    {
                        Console.WriteLine("        " + "Jurisdiction: " + taxDetail.JurisName + " Tax: " + taxDetail.Tax.ToString());
                    }
                }
            }
        }