diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 7f72dbfa6c4..1778bf429f4 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -3506,7 +3506,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); @@ -3517,10 +3517,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); 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 8e13c399491..5accecb163d 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -1388,12 +1388,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;