From e10d89dd369b901662f91e3cf9ef011b45a2354d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Jun 2022 03:00:51 +0200 Subject: [PATCH 1/2] Fix regression --- htdocs/accountancy/class/bookkeeping.class.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 000ac06f3c6..5f3def1d3ee 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1722,11 +1722,6 @@ class BookKeeping extends CommonObject dol_syslog(__METHOD__, LOG_DEBUG); $result = $this->db->query($sql); if ($result) { - // Add an empty line when transaction is validated to permit to add new line manually - if ($mode != "_tmp") { - $line = new BookKeepingLine(); - $this->linesmvt[] = $line; - } while ($obj = $this->db->fetch_object($result)) { $line = new BookKeepingLine(); From 900c71b5d6a5e32696a89981672bcb82ae7be3fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Jun 2022 03:07:11 +0200 Subject: [PATCH 2/2] Fix can add an empty line in tmp edit mode of transation --- htdocs/accountancy/bookkeeping/card.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index f9ec739e63d..b05fe8588bc 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -643,11 +643,9 @@ if ($action == 'create') { print "\n"; - // Empty line is the first line of $object->linesmvt - // So we must get the first line (the empty one) and pu it at the end of the array - // in order to display it correctly to the user - $empty_line = array_shift($object->linesmvt); - $object->linesmvt[]= $empty_line; + // Add an empty line + $line = new BookKeepingLine(); + $object->linesmvt[] = $line; foreach ($object->linesmvt as $line) { print '';