Skip to content

[18.0] [IMP] l10n_it_riba_oca: collect the slip from bank reconciliation - #5308

Open
eLBati wants to merge 4 commits into
OCA:18.0from
eLBati:18.0-imp-l10n_it_riba_oca-settlement-by-reconciliation
Open

eLBati wants to merge 4 commits into
OCA:18.0from
eLBati:18.0-imp-l10n_it_riba_oca-settlement-by-reconciliation

Conversation

@eLBati

@eLBati eLBati commented Sep 11, 2026

Copy link
Copy Markdown
Member

Il modulo non crea più registrazioni di incasso: la distinta risulta pagata quando la riconciliazione bancaria chiude il credito verso la banca.

Fix (primi due commit)

  • L'annullamento di una distinta accettata falliva, perché le registrazioni di accettazione sono confermate e riconciliate con le fatture: ora vengono riportate in bozza prima di essere cancellate.
  • La registrazione di accredito restava in bozza e non poteva essere riconciliata: ora il wizard la conferma dopo averla collegata alla distinta, così viene anche riconciliata con le registrazioni di
    accettazione.

Incasso da riconciliazione bancaria

  • L'accredito rappresenta un credito verso la banca su un conto a parte, di cui l'azienda può disporre fino all'incasso effettivo.
  • La distinta gestisce l'incasso come una fattura: Importo pagato, Importo residuo e Stato pagamento sono calcolati dalla riconciliazione delle righe da incassare. Per il Salvo buon fine è la riga del conto
    RiBa della registrazione di accredito, per il Dopo incasso sono le righe delle registrazioni di accettazione. La distinta passa in stato Pagata quando il residuo è zero, e torna indietro se la riconciliazione
    viene annullata. Il conto RiBa e il conto di accettazione devono essere riconciliabili.
  • Rimossi: le registrazioni di incasso, i pulsanti e i wizard "Segna come pagata", il registro di incasso e lo stato "pagata" delle righe (uno script di migrazione riporta le righe esistenti ad accreditata o
    confermata).
  • La registrazione di insoluto chiude la riga da incassare, riducendo il residuo in entrambe le modalità.

README riscritto in italiano e inglese: registrazioni contabili di ogni fase, prerequisiti per il file RiBa e percorsi di menu corretti.

Supera #5095, #4987 e #5286, che modificano le registrazioni di incasso rimosse qui.

Cancelling an accepted slip failed, because its acceptance entries are
posted and reconciled with the invoices:

    You cannot do this modification on a reconciled journal entry.

The entries of the slip are now set back to draft, which also removes
their reconciliation, before being deleted.

Assisted-by: Claude Opus 5
The credit entry was created in draft, so its line on the RiBa account
could not be reconciled until the user posted it by hand, while both the
settlement and the past due reconcile it. The wizard posts it now.

Assisted-by: Claude Opus 5
@eLBati
eLBati force-pushed the 18.0-imp-l10n_it_riba_oca-settlement-by-reconciliation branch from d9bcfb0 to ee171e8 Compare September 14, 2026 09:00
@eLBati
eLBati marked this pull request as ready for review September 14, 2026 09:15
The credit entry represents a credit on a separate account, that the
company can dispose of until the bank actually pays it. Nothing else has
to be recorded by the module: the slip is collected when the real entry
of the current account, in the bank reconciliation, closes that credit.
The settlement entries the module used to create were never needed, so
they are dropped, along with the wizards that created them and the
settlement journal.

The slip now tracks its collection the way an invoice does: Paid Amount,
Amount Due and Payment Status are computed from the reconciliation of the
lines to collect, that are the RiBa account line of the credit entry for
'Subject to collection' and the bills account lines of the acceptance
entries for 'After collection'. Both accounts have to be reconcilable
now. The slip becomes paid when there is nothing left to collect and goes
back to credited (or accepted) if the reconciliation is undone; Payment
Date is the date of the entry that collected it. The lines have no button
to collect them and stay credited: the only operation left on a single
line is the past due, which is manual and documented as such.

The past due entry now closes the lines to collect of the line it refers
to. It only closed the RiBa account before, so in 'After collection' mode
the accepted bills stayed open and the amount due of the slip kept
counting the lines that were past due.

A line cannot be in state 'paid' any more: a migration script moves the
existing ones back to credited or confirmed.

Assisted-by: Claude Opus 5
@eLBati
eLBati force-pushed the 18.0-imp-l10n_it_riba_oca-settlement-by-reconciliation branch from d47357b to fcad935 Compare September 14, 2026 09:51
Comment on lines 270 to 272
<separator colspan="4" string="Payments" />
<field name='payment_ids' colspan="4" nolabel="1">
<list>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Questo si può togliere?

@VBNext

VBNext commented Sep 14, 2026

Copy link
Copy Markdown

La registrazione di accredito restava in bozza e non poteva essere riconciliata: ora il wizard la conferma dopo averla collegata alla distinta, così viene anche riconciliata con le registrazioni di
accettazione.

Rimaneva in bozza perchè così l'utente poteva modificare la data, alla conferma veniva riconciliata con la registrazione di accettazione
Possibile soluzione:
La registrazone di accettazione prende come data contabile date_accepted (funziona già cosi ed è obbligatorio inserirla), facciamo la stessa cosa con la registrazione di accredito e data date_credited

La distinta gestisce l'incasso come una fattura: Importo pagato, Importo residuo e Stato pagamento sono calcolati dalla riconciliazione delle righe da incassare. Per il Salvo buon fine è la riga del conto

Per gestire l'incasso in questo modo e facilitare la riconciliazione è meglio raggruppare la righe della registrazione di accredito per scadenza, in modo che ci siano più lines to collect nelle distinte con più scadenze

@francesco-ooops

Copy link
Copy Markdown
Contributor

@eLBati se apri una issue la tracciamo per le versioni successive

@francesco-ooops francesco-ooops added the missing issue PRs must be linked to an issue. See the wiki. label Sep 16, 2026
Comment on lines 270 to +279
line.state = "credited"
line.credit_move_id = move # Link credit move to each line

# Post the move only now that it is linked to the slip: posting
# reconciles its line on the acceptance account with the acceptance
# entries of the slip. Its line on the RiBa account has to be
# reconciled too, when the bank collects the RiBa or when the RiBa is
# past due, and draft entries cannot be reconciled.
move.action_post()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

se vuoi "action postare" la registrazione devi dare modo all'utente di scegliere la data.
Utilizzerei date_credited

Comment on lines 185 to 193
if (
not wizard.credit_journal_id
or not wizard.credit_account_id
or not wizard.acceptance_account_id
or not wizard.bank_account_id
or not wizard.bank_expense_account_id
):
raise UserError(self.env._("Every account is mandatory."))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anche qui, come per l'insoluto l'errore serve solo se ci sono spese

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing issue PRs must be linked to an issue. See the wiki. mod:l10n_it_riba_oca Module l10n_it_riba_oca series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants