From cd1eb3b9924181b235243857db4cfd6669868c3f Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 5 Oct 2021 12:53:04 +0200 Subject: [PATCH] FIX: deposit payment terms: PHPDoc --- htdocs/compta/facture/class/facture.class.php | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 9c40ca4107f..9e65add59ce 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1407,14 +1407,18 @@ class Facture extends CommonInvoice } /** - * @param Propal|Commande $origin - * @param User $user - * @param type $notrigger - * @param bool $autoValidate - * @param array $overrideFields - * @return Facture + * Creates a deposit from a proposal or an order by grouping lines by VAT rates + * + * @param Propal|Commande $origin The original proposal or order + * @param int $date Invoice date + * @param int $payment_terms_id Invoice payment terms + * @param User $user Object user + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @param bool $autoValidateDeposit Whether to aumatically validate the deposit created + * @param array $overrideFields Array of fields to force values + * @return Facture|null The deposit created, or null if error (populates $origin->error in this case) */ - static public function createDepositFromOrigin(CommonObject $origin, $date, $cond_reglement_id, User $user, $notrigger = 0, $autoValidateDeposit = false, $overrideFields = array()) + static public function createDepositFromOrigin(CommonObject $origin, $date, $payment_terms_id, User $user, $notrigger = 0, $autoValidateDeposit = false, $overrideFields = array()) { global $conf, $langs, $hookmanager, $action; @@ -1435,7 +1439,7 @@ class Facture extends CommonInvoice return null; } - if ($cond_reglement_id <= 0) { + if ($payment_terms_id <= 0) { $origin->error = $langs->trans('ErrorFieldRequired', $langs->transnoentities('PaymentConditionsShort')); return null; } @@ -1459,7 +1463,7 @@ class Facture extends CommonInvoice $deposit->ref_client = $origin->ref_client; $deposit->date = $date; $deposit->mode_reglement_id = $origin->mode_reglement_id; - $deposit->cond_reglement_id = $cond_reglement_id; + $deposit->cond_reglement_id = $payment_terms_id; $deposit->availability_id = $origin->availability_id; $deposit->demand_reason_id = $origin->demand_reason_id; $deposit->fk_account = $origin->fk_account; @@ -1575,7 +1579,7 @@ class Facture extends CommonInvoice $descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref; // Hidden conf - if (! empty($conf->global->INVOICE_DEPOSIT_DETAIL_LINES_IN_DESCRIPTION) && ! empty($descriptions[$tva])) { + if (! empty($conf->global->INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION) && ! empty($descriptions[$tva])) { $descline .= '