diff --git a/ChangeLog b/ChangeLog index b27d787d51c46..33325c74d5aa3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -34,7 +34,7 @@ FIX: fatal error on loading pictures in attached documents of an event (#30553) FIX: for country type (#29745) FIX: group by qty in product margin tab (#29853) FIX: init total amounts in margin module (#29854) -FIX: issue to get the right files exported in Quadratrus export.php (#30004) +FIX: issue to get the right files exported in Quadratus export.php (#30004) FIX: lang output for sales representative on PDF (#30469) FIX: langs in common docgenerator (#29774) FIX: langs overwrite (#29630) @@ -46,9 +46,9 @@ FIX: Missing expense report picto in menu (#29908) FIX: Missing the description in tooltip when option show in tooltip on FIX: mo cloning (#29686) FIX: modification date from label in accounting bookkeeping list (#30038) -FIX: move porpale ref pdf cornas (#29989) +FIX: move proposal ref pdf cornas (#29989) FIX: Not qualified lines for reception (#29473) -FIX: on change ref for bank account attachement are lost (#30529) +FIX: on change ref for bank account attachment are lost (#30529) FIX: orders to bill menu (#30179) FIX: Page expands when ticket messages are too long (#29785) FIX: parameter name (#29666) @@ -56,16 +56,16 @@ FIX: PHP8 warning if $conf->reception is checked the old fashion way (#29697) FIX: PHP 8 warning on output of successful cronjob (#29922) FIX: PHP exception on getSpecialCode (#29646) FIX: php warning if cookie doesn’t exist (#29723) -FIX: pos: invoice date incorrectly set beacause of timezome mismatches (reverts #36e91da) (#30184) +FIX: pos: invoice date incorrectly set because of timezome mismatches (reverts #36e91da) (#30184) FIX: public project form return an error if SOCIETE_EMAIL_UNIQUE (#29942) FIX: REPLENISH MANY FOURN WHEN ORDER ALREADY CREATE (#29710) FIX: Supplier Order search on date valid (#30448) FIX: Ternary operator condition is always true/false (#29649) FIX: to avoid error during upgrade with pgsql (#30443) FIX: transfer in accountancy for expense reports. -FIX: unitialised var (#29728) +FIX: uninitialized var (#29728) FIX: - Unknown Character on HTML (#30257) -FIX: Unsigned propal having signing date (#29825) +FIX: Unsigned proposal having signing date (#29825) FIX: Update asset.class.php FIX: update date_echeance of supplier invoices when we update invoice date in the past (#29886) FIX: User List - Function is show in wrong column when module HRM enabled (#30186) diff --git a/dev/tools/codespell/codespell-ignore.txt b/dev/tools/codespell/codespell-ignore.txt index 75be2a3431331..672b646596b60 100644 --- a/dev/tools/codespell/codespell-ignore.txt +++ b/dev/tools/codespell/codespell-ignore.txt @@ -48,6 +48,7 @@ udo ue ro ws +zar # Code string ect tempdate diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 97387198fcd3c..d9125d4b19a9b 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1,8 +1,8 @@ - * Copyright (C) 2015-2022 Alexandre Spangaro - * Copyright (C) 2015-2020 Florian Henry - * Copyright (C) 2018-2020 Frédéric France +/* Copyright (C) 2014-2017 Olivier Geffroy + * Copyright (C) 2015-2024 Alexandre Spangaro + * Copyright (C) 2015-2020 Florian Henry + * Copyright (C) 2018-2020 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -384,6 +384,15 @@ public function create(User $user, $notrigger = false) $this->piece_num = 1; } + if (empty($this->label_compte)) { + $accountingaccount = new AccountingAccount($this->db); + $accountingaccount->fetch('', $this->numero_compte); + + dol_syslog(get_class($this).":: fetch label_compte if empty for number =".$accountingaccount->label, LOG_DEBUG); + + $this->label_compte = $accountingaccount->label; + } + $now = dol_now(); $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element." ("; @@ -2692,7 +2701,6 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep $sql = 'SELECT'; $sql .= " t.numero_compte,"; - $sql .= " t.label_compte,"; if ($separate_auxiliary_account) { $sql .= " t.subledger_account,"; $sql .= " t.subledger_label,"; @@ -2707,7 +2715,7 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep $sql .= ' AND aa.pcg_type IN (' . $this->db->sanitize(implode(',', $pcg_type_filter), 1) . ')'; $sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($fiscal_period->date_start) . "'"; $sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($fiscal_period->date_end) . "'"; - $sql .= ' GROUP BY t.numero_compte, t.label_compte, aa.pcg_type'; + $sql .= ' GROUP BY t.numero_compte, aa.pcg_type'; if ($separate_auxiliary_account) { $sql .= ' ,t.subledger_account, t.subledger_label'; } @@ -2732,10 +2740,10 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep $bookkeeping = new BookKeeping($this->db); $bookkeeping->doc_date = $new_fiscal_period->date_start; $bookkeeping->date_lim_reglement = ''; - $bookkeeping->doc_ref = $new_fiscal_period->label; + $bookkeeping->doc_ref = $fiscal_period->label; $bookkeeping->date_creation = $now; $bookkeeping->doc_type = 'closure'; - $bookkeeping->fk_doc = $new_fiscal_period->id; + $bookkeeping->fk_doc = $fiscal_period->id; $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add $bookkeeping->thirdparty_code = ''; @@ -2750,7 +2758,7 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep $bookkeeping->numero_compte = $obj->numero_compte; $bookkeeping->label_compte = $obj->label_compte; - $bookkeeping->label_operation = $new_fiscal_period->label; + $bookkeeping->label_operation = $fiscal_period->label; $bookkeeping->montant = $mt; $bookkeeping->sens = ($mt >= 0) ? 'C' : 'D'; $bookkeeping->debit = ($mt < 0) ? -$mt : 0; @@ -2779,10 +2787,10 @@ public function closeFiscalPeriod($fiscal_period_id, $new_fiscal_period_id, $sep $bookkeeping = new BookKeeping($this->db); $bookkeeping->doc_date = $new_fiscal_period->date_start; $bookkeeping->date_lim_reglement = ''; - $bookkeeping->doc_ref = $new_fiscal_period->label; + $bookkeeping->doc_ref = $fiscal_period->label; $bookkeeping->date_creation = $now; $bookkeeping->doc_type = 'closure'; - $bookkeeping->fk_doc = $new_fiscal_period->id; + $bookkeeping->fk_doc = $fiscal_period->id; $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add $bookkeeping->thirdparty_code = '';