TotalTaxAmount SetTaxAmountByRow not working

SOLVED

Hi,

I am trying to update invoice's total tax  using below code

TaxSummaryInfo taxSummaryInfo = journal.GetTotalTaxAmountInfo();
if (taxSummaryInfo.GetCount() > 0)
{
double totalTax = 10;
taxSummaryInfo.SetTaxAmountByRow(1, totalTax);
taxSummaryInfo.Save();
}

But it's throwing error, field you are trying to update is not accessible.

Is there anything wrong or any suggestion to make it working?

Thanks in advance.

Parents
  • 0
    SUGGESTED

    I may not be able to help because I don't use the  SDK and I don't read C# very well.

    However, if you are getting the Total Tax Amount, is this the total tax for an invoice found in table titlutot?  Is this the amount you see in the Ctrl-Shift-Y dialog in Sage 50?

    If so, then this is not the same as the line item rows of each invoice.  It looks like SetTAxAmountByRow is attempting to set the tax you see on each record of an invoice that you see in the Ctrl-Y dialog in Sage 50. eg. 

    taxSummaryInfo.SetTaxAmountByRow(1, totalTax);

    is the first row of the invoice, not the total tax of the invoice.

    If so, is it possible the SDK allows for updating the rows and will calculate the Total Tax for the invoice for you?  In this case GetTotalTaxAmountInfo fields might be read-only or you need a SetTotalTaxAmount method?

    Just a guess!

Reply
  • 0
    SUGGESTED

    I may not be able to help because I don't use the  SDK and I don't read C# very well.

    However, if you are getting the Total Tax Amount, is this the total tax for an invoice found in table titlutot?  Is this the amount you see in the Ctrl-Shift-Y dialog in Sage 50?

    If so, then this is not the same as the line item rows of each invoice.  It looks like SetTAxAmountByRow is attempting to set the tax you see on each record of an invoice that you see in the Ctrl-Y dialog in Sage 50. eg. 

    taxSummaryInfo.SetTaxAmountByRow(1, totalTax);

    is the first row of the invoice, not the total tax of the invoice.

    If so, is it possible the SDK allows for updating the rows and will calculate the Total Tax for the invoice for you?  In this case GetTotalTaxAmountInfo fields might be read-only or you need a SetTotalTaxAmount method?

    Just a guess!

Children
No Data