Skip to content

[18.0][l10n_it_riba_oca] Cannot pay multiple lines of the same SBF RiBa slip individually #5247

Description

@seba-faso

Module

l10n_it_riba_oca

Describe the bug

When using a Salvo Buon Fine (SBF) RiBa configuration, a slip containing multiple installments cannot be paid correctly one line at a time.

After the slip is credited, paying the first line works. However, attempting to pay a second line of the same slip fails because the generated accounting entry is not balanced.

The same issue occurs regardless of which line is paid first: once one line has been marked as paid, another credited line of the same slip cannot subsequently be paid.

The workflow works if another line is marked as past due instead of paid, which suggests that the issue is specifically related to processing multiple paid lines within the same credited SBF slip.

To Reproduce

Affected versions:

Steps to reproduce the behavior:

  1. Configure a RiBa payment method using the "Salvo buon fine" flow.
  2. Create and post a customer invoice with at least two RiBa installments.
  3. Create a single RiBa slip containing both installments.
  4. Confirm the slip.
  5. Mark the slip as credited.
  6. Enter the full credited amount when creating the credit accounting entry.
  7. From the credited slip, mark one individual line as paid.
  8. Attempt to mark the second individual line as paid.

Actual behavior

The first line can be marked as paid, but paying the second line fails because the generated accounting entry is not balanced.

Expected behavior

Each credited line of the same SBF RiBa slip should be independently markable as paid or past due at its respective maturity date.

A common SBF workflow is:

  • one slip contains multiple RiBa installments with different maturity dates;
  • the bank credits the total amount of the slip;
  • each individual RiBa is later confirmed as paid or marked as past due when its maturity date is reached.

Therefore, paying one line should not prevent another line of the same credited slip from being paid later.

Additional context

We also tested the bank reconciliation workflow.

The bank transaction can be reconciled against the accounting entry generated by the RiBa credit operation. However, this reconciliation does not update the state of the individual RiBa slip lines.

Bank reconciliation successfully reconciles the bank transaction with the accounting entry generated by the RiBa credit operation, but it does not update the state of the individual RiBa slip lines. Therefore, this does not provide an alternative way to process the individual lines as paid.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions