Custom taxAmount for Bank Transaction causing validation error

Abierto
#768 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
node.js, typescript
Área
api

Línea de trabajo

The field docs are in src/gen/model/accounting/lineItem.ts around lines 38-41, and the call is createBankTransactions with a Spend type and a custom taxAmount. Start by checking whether the SDK or the Xero API performs the tax check, since the generated code may only pass the value through. Done means reproducing the 52.23 vs 52.28 error and either fixing the SDK path or documenting that the API rejects it. The issue has had no reply for over a year, so confirm with maintainers first.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

https://github.com/XeroAPI/xero-node/blob/3217ce3c18d6f986c2b4357dc084cabbefbcac59/src/gen/model/accounting/lineItem.ts#L38-L41

SDK you're using (please complete the following information):

  • Version 13.0.0

Describe the bug
The accounting model LineItem says that you can set a custom taxAmount if the auto calculated amount is wrong. It seems this is possible when creating Invoices but not when creating Bank Transactions.

This is possible via the UI for both bank transactions and invoices, so it just seems to be a validation error that is blocking it.

Creating a 'Spend' BankTransaction using the API with an adjusted TaxAmount results in a Validation Error:

[Message] => Tax amount 52.23 is incorrect for INPUT2 tax type, should be 52.28

To Reproduce
Steps to reproduce the behavior:

  const result = await xero.accountingApi
    .createBankTransactions(tenantId, {
      bankTransactions: [
        {
          type: BankTransaction.TypeEnum.SPEND,
          bankAccount: {
            code: account,
          },
          isReconciled: true,
          contact: { name: 'Contact' },
          date,
          reference
          lineItems: [
            {
              description: 'Description',
              quantity: 1,
              unitAmount: 261.4,
              accountCode,
              taxAmount: 52.23,
            },
          ],
        },
      ],
    })

Expected behavior

If I pass in a custom taxAmount then I expect the bank transaction to be created with the custom tax amount as it is on the UI, not to validate it and throw an error.

Screenshots
Image

Additional context
The docs linked at the top suggest this is possible and the only limitation seems to be a validation making sure the tax matches

Lenguaje dominante
TypeScript
Estrellas
264
Forks
177
Merge medio
10 h 5 min
PR fusionados (30 d)
5

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de XeroAPI/xero-node

Todos los issues de XeroAPI/xero-node

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.