AR_InvoiceTaxSummary_bus is updated only Taxable Amount in A/R Invoice Data Entry Totals

Hello everyone!

I have script that should be updating the value of TaxAmount field in Account Receivable ->Invoice Data Entry...

strInvoiceNumerAndSchedule = strInvoiceNumber & "IN" & "000001EX"

Set oTS = oSession.AsObject(oSession.GetObject("AR_InvoiceTaxSummary_bus"))
retVal = oTS.SetKey(strInvoiceNumerAndSchedule)
retVal = oTS.SetValue("SalesTaxAmt", CDbl(TotalTaxAmount.text))
retVal = oTS.Write()

He is updating the value only at A/R Invoice Data Entry Totals(Taxable Amount field) tab but not in ->TaxDetail ->Tax Amount.

Is it a Sage bug or i have to modify my script?

Parents Reply Children
  • 0 in reply to Kent Rhodes
    Tnx for the replays Kevin and Kent u are helping me alot and i`m rly appreciate your help!

    A little more info- we have custom tax schedule in which i`m trying to make a change on SalesTaxAmt
    As documentation says AR_InvoceTaxSummery to get access you need :
    KPRIMARY:InvoiceNo+InvoiceType+ScheduleSeqNo+TaxCode
    KTAXCODE:TaxCode+InvoiceNo+InvoiceType+ScheduleSeqNo

    Set oInvoiceTaxSummary = oSession.AsObject(oSession.GetObject("AR_InvoiceTaxSummary_bus"))
    retVal = oInvoiceTaxSummary.SetKeyValue("InvoiceNo", strInvoiceNumber)
    retVal = oInvoiceTaxSummary.SetKeyValue("InvoiceType$", strInvoiceType)
    retVal = oInvoiceTaxSummary.SetKeyValue("ScheduleSeqNo", strScheduleSeqNo)
    retVal = oInvoiceTaxSummary.SetKeyValue("TaxCode$", strTaxCode)
    retVal = oInvoiceTaxSummary.SetKey()

    retVal = oInvoiceTaxSummary.SetValue("SalesTaxAmt", 1234.02)

    'I tried with or without .Write() method
    retVal = oInvoiceTaxSummary.Write()

    I know this functionality is working because Sage has default Tax schedule and it work fine.I think Sage get little confuse because there are 2 fields SalesTaxAmt - AR_InvoiceHeader which is my default bus in this example and AR_InvoiceTaxSummary which also has SalesTaxAmt field and the value i`m trying to change.
  • 0 in reply to Kent Rhodes
    Txn for the replays Kevin and Kent u are helping me alot guys and Im rly appreciate your help!

    A little more info - we have custom tax schedule in which im trying to make a change on SalesTaxAmt
    As documentation says AR_InvoiceTaxSummary to get access you need :
    KPRIMARY: InvoiceNo+InvoiceType+ScheduleSeqNo+TaxCode
    KTAXCODE: TaxCode+InvoiceNo+InvoiceType+ScheduleSeqNo

    Set oInvoiceTaxSummary = oSession.AsObject(oSession.GetObject("AR_InvoiceTaxSummary_bus"))
    retVal = oInvoiceTaxSummary.SetKeyValue("InvoiceNo$", "0100084")
    retVal = oInvoiceTaxSummary.SetKeyValue("InvoiceType$", "IN")
    retVal = oInvoiceTaxSummary.SetKeyValue("ScheduleSeqNo$", "000001")
    retVal = oInvoiceTaxSummary.SetKeyValue("TaxCode$", "EX")
    retVal = oInvoiceTaxSummary.SetKey()

    retVal = oInvoiceTaxSummary.SetValue("SalesTaxAmt", 1234.02)
    retVal = oInvoiceTaxSummary.Write()
    I know that this functionality is working because Sage has default Tax schedule and it work fine.I think Sage get little confuse because there is 2 fields SalesTaxAmt - AR_InvoiceHeader which is my default bus and AR_InvoiceTaxSummary which also has SalesTaxAmt field and the value im trying to change