Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Error con balanceo de nómina #63

Open
yamelsenih opened this issue May 20, 2024 · 1 comment
Open

[Bug Report] Error con balanceo de nómina #63

yamelsenih opened this issue May 20, 2024 · 1 comment
Labels
bug Something isn't working Publicado

Comments

@yamelsenih
Copy link

yamelsenih commented May 20, 2024

Bug report

Cuando se está contabilizando una nómina y se tiene una diferencia negativa se genera un error de balanceo.

Steps to reproduce

  1. Genere una Nómina: Debe tener más deducciones que asignaciones contabilizadas
  2. Complete la Nómina
  3. Verifique el botón de completar

Screenshot or Gif

fd5b2665-32c2-4b78-b43f-08c16f7ac93a

Expected behavior

Por lo general al contabilizar un documento de nómina debe llevarlo a la cuenta de balanceo si hay diferencia.

Aquí hay un problema porque está comparando valores absolutos:

if (totalDebit.abs().compareTo(totalCredit.abs()) > 0) {
  regTotal = fact.createLine(null, acct, getC_Currency_ID(), null, totalDebit.subtract(totalCredit));
} else {
  regTotal = fact.createLine(null, acct, getC_Currency_ID(), totalCredit.abs().subtract(totalDebit.abs()), null);
}

Contexto Adicional

adempiere#4305
adempiere#4306

@yamelsenih yamelsenih added the bug Something isn't working label May 20, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Bug report

When a payroll is being posted and there is a negative difference, a balancing error is generated.

Steps to play

  1. Generate a Payroll: You must have more deductions than posted assignments
  2. Complete the Payroll
  3. Check the complete button

Screenshot or Gif

fd5b2665-32c2-4b78-b43f-08c16f7ac93a

Expected behavior

Generally, when posting a payroll document, you should take it to the balancing account if there is a difference.

There is a problem here because you are comparing absolute values:

if (totalDebit.abs().compareTo(totalCredit.abs()) > 0) {
  regTotal = fact.createLine(null, acct, getC_Currency_ID(), null, totalDebit.subtract(totalCredit));
} else {
  regTotal = fact.createLine(null, acct, getC_Currency_ID(), totalCredit.abs().subtract(totalDebit.abs()), null);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Publicado
Projects
None yet
Development

No branches or pull requests

2 participants