From fb40834059b3e98edf5574b948d92474a9eff18c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Rey Date: Fri, 10 Apr 2026 09:33:25 +0200 Subject: [PATCH 1/2] Saving subledger when cloning a bookeeping entry. (#37807) --- htdocs/accountancy/class/bookkeeping.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 51a9d8844da..d7a16934303 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -3505,7 +3505,7 @@ class BookKeeping extends CommonObject $journal_label = getDolGlobalString('ACCOUNTING_CLONING_ENABLE_INPUT_JOURNAL') ? $accountingJournal->label : $bookKeeping->journal_label; $sql = "SELECT piece_num, label_operation, numero_compte, label_compte, doc_type, code_journal, fk_user_author, doc_ref,"; - $sql .= " fk_doc, fk_docdet, debit, credit, journal_label, sens, montant"; + $sql .= " fk_doc, fk_docdet, debit, credit, journal_label, sens, montant, subledger_account, subledger_label"; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping"; $sql .= " WHERE rowid = " . ((int) $toselectid); $resql = $this->db->query($sql); @@ -3516,10 +3516,10 @@ class BookKeeping extends CommonObject $sql_insert = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_bookkeeping"; $sql_insert .= " (piece_num, label_operation, numero_compte, label_compte, doc_type, code_journal, doc_date, fk_user_author, doc_ref,"; - $sql_insert .= " fk_doc, fk_docdet, debit, credit, date_creation, journal_label, sens, montant)"; + $sql_insert .= " fk_doc, fk_docdet, debit, credit, date_creation, journal_label, sens, montant, subledger_account, subledger_label)"; $sql_insert .= " VALUES"; $sql_insert .= " (" . ((int) $pieceNumNext) . ", '" . $this->db->escape($obj->label_operation) . "', '" . $this->db->escape($obj->numero_compte) . "', '" . $this->db->escape($obj->label_compte) . "', '" . $this->db->escape($obj->doc_type) . "', '" . $this->db->escape($code_journal) . "', '" . $this->db->idate($docdate) . "', '" . $this->db->escape($obj->fk_user_author) . "', '" . $this->db->escape($docRef) . "', "; - $sql_insert .= " ". ((int) $obj->fk_doc) . ", " . ((int) $obj->fk_docdet) . ", " . (float) $obj->debit . ", " . (float) $obj->credit . ", '" . $this->db->idate($docdate) . "', '" . $this->db->escape($journal_label) . "', '" . $this->db->escape($obj->sens) . "', " . (float) $obj->montant . ")"; + $sql_insert .= " ". ((int) $obj->fk_doc) . ", " . ((int) $obj->fk_docdet) . ", " . (float) $obj->debit . ", " . (float) $obj->credit . ", '" . $this->db->idate($docdate) . "', '" . $this->db->escape($journal_label) . "', '" . $this->db->escape($obj->sens) . "', " . (float) $obj->montant . ", '" . $this->db->escape($obj->subledger_account) . "', '" . $this->db->escape($obj->subledger_label) . "')"; $resqlInsert = $this->db->query($sql_insert); From 1ff8ac4d12675a25421ea10f8c553af60869770b Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Fri, 10 Apr 2026 12:22:13 +0200 Subject: [PATCH 2/2] fix: On Supplier proposal external contact type is SERVICE not CUSTOMER (#37798) * fix: On Supplier proposal external contact type is SERVICE not CUSTOMER * fix: On Supplier proposal external contact type is SERVICE not CUSTOMER --- .../modules/supplier_proposal/doc/pdf_zenith.modules.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index cf2510053ee..8e0248d434a 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -1382,12 +1382,12 @@ class pdf_zenith extends ModelePDFSupplierProposal - // If CUSTOMER contact defined on proposal, we use it. Note: Even if this is a supplier object, the code for external contact that follow order is 'CUSTOMER' + // If SUPPLIER/SERVICE contact defined on proposal, we use it. Note: Even if this is a supplier object, the code for external contact that follow order is 'SERVICE' $usecontact = false; if (!getDolGlobalInt('SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT')) { - $arrayidcontact = $object->getIdContact('external', 'CUSTOMER'); + $arrayidcontact = $object->getIdContact('external', 'SERVICE'); } else { - $arrayidcontact = array_merge($object->getIdContact('external', 'CUSTOMER'), $object->getIdContact('external', 'BILLING')); + $arrayidcontact = array_merge($object->getIdContact('external', 'SERVICE'), $object->getIdContact('external', 'BILLING')); } if (is_array($arrayidcontact) && count($arrayidcontact) > 0) { $usecontact = true;