From a54c233130144959e49c78644e35a3272ca9c01e Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 26 Nov 2025 06:41:16 +0100 Subject: [PATCH 1/3] FIX Accountancy - A validated transaction (blocked) can received new line --- htdocs/accountancy/bookkeeping/card.php | 36 +++++++++++++------------ 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 52a059a7fd8..85915ce0a43 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -966,21 +966,23 @@ if ($action == 'create') { // List of movements print load_fiche_titre($langs->trans("ListeMvts"), '', ''); - print '
'; - if ($optioncss != '') { - print ''; + if (empty($object->date_validation)) { + print ''; + if ($optioncss != '') { + print ''; + } + print ''; + print '' . "\n"; + print '' . "\n"; + print '' . "\n"; + print '' . "\n"; + print '' . "\n"; + print '' . "\n"; + print '' . "\n"; + print '' . "\n"; + print ''; + print ''; } - print ''; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''; - print ''; if (count($object->linesmvt) > 0) { print '
'; @@ -1005,7 +1007,7 @@ if ($action == 'create') { print "\n"; // Add an empty line if there is not yet - if (!empty($object->linesmvt[0])) { + if (!empty($object->linesmvt[0]) && empty($object->date_validation)) { $tmpline = $object->linesmvt[0]; if (!empty($tmpline->numero_compte)) { $line = new BookKeepingLine($db); @@ -1017,7 +1019,7 @@ if ($action == 'create') { $total_debit += $line->debit; $total_credit += $line->credit; - if ($action == 'update' && $line->id == $id) { + if ($action == 'update' && $line->id == $id && empty($line->date_validation)) { print ''; print ''; print ''; @@ -1044,7 +1046,7 @@ if ($action == 'create') { print ''; print ''; print "\n"; - } elseif (empty($line->numero_compte) || (empty($line->debit) && empty($line->credit))) { + } elseif ((empty($line->numero_compte) || (empty($line->debit) && empty($line->credit))) && empty($object->date_validation)) { if (($action == "" || $action == 'add') && $permissiontoadd) { print ''; print ''; From 2e9db19bedb0a19ce1cff0772ab2c22fc5c8fb3d Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 26 Nov 2025 06:46:30 +0100 Subject: [PATCH 2/3] Use $object --- htdocs/accountancy/bookkeeping/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 85915ce0a43..598fa253c41 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -1019,7 +1019,7 @@ if ($action == 'create') { $total_debit += $line->debit; $total_credit += $line->credit; - if ($action == 'update' && $line->id == $id && empty($line->date_validation)) { + if ($action == 'update' && $line->id == $id && empty($object->date_validation)) { print ''; print ''; print ''; From 9247b1f02b2ff2a549b2a511e2c733e6858eb4fd Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 26 Nov 2025 08:09:05 +0100 Subject: [PATCH 3/3] Fix CI --- htdocs/accountancy/bookkeeping/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 598fa253c41..766108a986b 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -967,7 +967,7 @@ if ($action == 'create') { print load_fiche_titre($langs->trans("ListeMvts"), '', ''); if (empty($object->date_validation)) { - print ''; + print ''; if ($optioncss != '') { print ''; }