FIX: deposit payment terms: PHPDoc

This commit is contained in:
Marc de Lima Lucio 2021-10-05 12:53:04 +02:00
parent fe62808595
commit cd1eb3b992

View File

@ -1407,14 +1407,18 @@ class Facture extends CommonInvoice
} }
/** /**
* @param Propal|Commande $origin * Creates a deposit from a proposal or an order by grouping lines by VAT rates
* @param User $user *
* @param type $notrigger * @param Propal|Commande $origin The original proposal or order
* @param bool $autoValidate * @param int $date Invoice date
* @param array $overrideFields * @param int $payment_terms_id Invoice payment terms
* @return Facture * @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; global $conf, $langs, $hookmanager, $action;
@ -1435,7 +1439,7 @@ class Facture extends CommonInvoice
return null; return null;
} }
if ($cond_reglement_id <= 0) { if ($payment_terms_id <= 0) {
$origin->error = $langs->trans('ErrorFieldRequired', $langs->transnoentities('PaymentConditionsShort')); $origin->error = $langs->trans('ErrorFieldRequired', $langs->transnoentities('PaymentConditionsShort'));
return null; return null;
} }
@ -1459,7 +1463,7 @@ class Facture extends CommonInvoice
$deposit->ref_client = $origin->ref_client; $deposit->ref_client = $origin->ref_client;
$deposit->date = $date; $deposit->date = $date;
$deposit->mode_reglement_id = $origin->mode_reglement_id; $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->availability_id = $origin->availability_id;
$deposit->demand_reason_id = $origin->demand_reason_id; $deposit->demand_reason_id = $origin->demand_reason_id;
$deposit->fk_account = $origin->fk_account; $deposit->fk_account = $origin->fk_account;
@ -1575,7 +1579,7 @@ class Facture extends CommonInvoice
$descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref; $descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref;
// Hidden conf // 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 .= '<ul>' . $descriptions[$tva] . '</ul>'; $descline .= '<ul>' . $descriptions[$tva] . '</ul>';
} }