I'm trying to insert taxes on line item level by using Taxes array on SalesInvoiceLine object. However, when I check it through the interface, taxes are not applied at all. I tried to enter a salesinvoice through the interface and add taxes to line items to make sure that it is not related to a setting. Any help would be appreciated. My code is as follows:
var tax = new SalesLineTax(); tax.Key = new SalesLineTaxKey(); tax.Key.SalesLineKey = new SalesLineKey(); tax.Key.SalesLineKey.SalesDocumentKey = new SalesDocumentKey(); tax.Key.SalesLineKey.SalesDocumentKey.Id = invoiceKey; tax.Key.TaxDetailKey = new TaxDetailKey(); tax.Key.TaxDetailKey.Id = "SOMEKEY"; tax.TaxableAmount = new MoneyAmount(); tax.TaxableAmount.Currency = "USD"; tax.TaxableAmount.DecimalDigits = 2; tax.TaxableAmount.Value = 94.75m; tax.TotalAmount = new MoneyAmount(); tax.TotalAmount.Currency = "USD"; tax.TotalAmount.DecimalDigits = 2; tax.TotalAmount.Value = 94.75m; tax.TaxAmount = new MoneyAmount(); tax.TaxAmount.Currency = "USD"; tax.TaxAmount.DecimalDigits = 2; tax.TaxAmount.Value = 6.15m; salesInvoiceLine.Taxes = new SalesLineTax[] { tax };
*This post is locked for comments