Añadir PartidaReclassifier: reclasificar partidas a otra subcuenta#2011
Open
lanzalibre wants to merge 1 commit into
Open
Añadir PartidaReclassifier: reclasificar partidas a otra subcuenta#2011lanzalibre wants to merge 1 commit into
lanzalibre wants to merge 1 commit into
Conversation
Mueve una o varias partidas a otra subcuenta del mismo ejercicio, opcionalmente reescribiendo el concepto, dentro de una transacción y actualizando los saldos de las subcuentas de origen y destino.
lanzalibre
force-pushed
the
feature/partida-reclassifier
branch
from
July 16, 2026 18:43
b47ae23 to
b602a43
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Descripción
Añade
Core/Lib/Accounting/PartidaReclassifier: reclasificación de partidas ya contabilizadas a otra subcuenta del mismo ejercicio, opcionalmente reescribiendo el concepto:Motivación: corregir la subcuenta de apuntes ya contabilizados (gasto mal clasificado, reclasificaciones de cierre, etc.) hoy obliga a borrar y recrear el asiento o a editar la base de datos a mano. Esta clase lo hace de forma segura:
Partida::save(): ejercicio abierto y asiento editable);Subcuenta::updateBalance().Tests unitarios incluidos (
Test/Core/Lib/PartidaReclassifierTest.php)testMoveLine— mueve una partida a otra subcuenta y comprueba idsubcuenta/codsubcuenta, que el concepto se conserva y que los saldos de origen (a cero) y destino (suma) se actualizan.testMoveLineWithNewConcept— mueve reescribiendo el concepto y lo comprueba.testRejectDifferentExercise— crea otro ejercicio con su subcuenta y comprueba que el movimiento se rechaza y la partida no cambia.testRejectEmptyList— lista vacía de partidas devuelve false.¿Cómo has probado los cambios?