diff --git a/.gitignore b/.gitignore index e9603bd2d8f..3315a7eed88 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,4 @@ yarn.lock package-lock.json doc/install.lock +/.asciidoctorconfig.adoc diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 897f60e8aaa..7e2cdc56543 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -2088,7 +2088,7 @@ class BookKeeping extends CommonObject * FIXME: This function takes the parent of parent to get the root account ! * * @param string $account Accounting account - * @return array Array with root account information (max 2 upper level) + * @return array|int Array with root account information (max 2 upper level), <0 if KO */ public function getRootAccount($account = null) { diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 5749518e2b9..272c067807d 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -329,6 +329,7 @@ class Lettering extends BookKeeping // Update request $now = dol_now(); + $affected_rows = 0; if (!$error) { $sql = "UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping SET"; @@ -341,6 +342,8 @@ class Lettering extends BookKeeping if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); + } else { + $affected_rows = $this->db->affected_rows($resql); } } @@ -352,7 +355,7 @@ class Lettering extends BookKeeping } return -1 * $error; } else { - return 1; + return $affected_rows; } } @@ -387,7 +390,7 @@ class Lettering extends BookKeeping } return -1 * $error; } else { - return 1; + return $this->db->affected_rows($resql); } } @@ -482,7 +485,7 @@ class Lettering extends BookKeeping else $result = $this->updateLettering($bookkeeping_lines); if ($result < 0) { $group_error++; - } else { + } elseif ($result > 0) { $nb_lettering++; } } diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 544f077f1ea..0137e63406f 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -805,6 +805,12 @@ if (!$error && $action == 'writebookkeeping') { require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; $lettering_static = new Lettering($db); $nb_lettering = $lettering_static->bookkeepingLetteringAll(array($bookkeeping->id)); + + if ($nb_lettering < 0) { + $error++; + $errorforline++; + setEventMessages($lettering_static->error, $lettering_static->errors, 'errors'); + } } } } diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index d00a968571f..12303089dca 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -381,6 +381,12 @@ if ($action == 'writebookkeeping') { require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; $lettering_static = new Lettering($db); $nb_lettering = $lettering_static->bookkeepingLettering(array($bookkeeping->id)); + + if ($nb_lettering < 0) { + $error++; + $errorforline++; + setEventMessages($lettering_static->error, $lettering_static->errors, 'errors'); + } } } } diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 9eb6688c63b..565a3a59222 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -463,7 +463,15 @@ if ($action == 'writebookkeeping') { if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && getDolGlobalInt('ACCOUNTING_ENABLE_AUTOLETTERING')) { require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; $lettering_static = new Lettering($db); + $nb_lettering = $lettering_static->bookkeepingLettering(array($bookkeeping->id)); + + if ($nb_lettering < 0) { + $error++; + $errorforline++; + $errorforinvoice[$key] = 'other'; + setEventMessages($lettering_static->error, $lettering_static->errors, 'errors'); + } } } } diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 89a1ed2904d..74df98e873a 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -3303,11 +3303,11 @@ class Adherent extends CommonObject */ public function getKanbanView($option = '', $arraydata = null) { + global $selected; $return = '