diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index c658916e359..7093493dad9 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2006 Marc Barilley * Copyright (C) 2011-2013 Philippe Grand - * Copyright (C) 2022 Frédéric France + * Copyright (C) 2022-2023 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 @@ -29,10 +29,10 @@ /** * Prepare array with list of tabs * - * @param Object $object Object related to tabs + * @param FactureFournisseur $object Object related to tabs * @return array Array of tabs to show */ -function facturefourn_prepare_head($object) +function facturefourn_prepare_head(FactureFournisseur $object) { global $db, $langs, $conf; @@ -56,7 +56,7 @@ function facturefourn_prepare_head($object) } //if ($fac->mode_reglement_code == 'PRE') - if (!empty($conf->paymentbybanktransfer->enabled)) { + if (isModEnabled('paymentbybanktransfer')) { $nbStandingOrders = 0; $sql = "SELECT COUNT(pfd.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd"; @@ -132,8 +132,8 @@ function facturefourn_prepare_head($object) /** * Prepare array with list of tabs * - * @param Object $object Object related to tabs - * @return array Array of tabs to show + * @param CommandeFournisseur $object Object related to tabs + * @return array Array of tabs to show */ function ordersupplier_prepare_head(CommandeFournisseur $object) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 4f74168b4cb..170f60912aa 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -176,8 +176,20 @@ class CommandeFournisseur extends CommonOrder */ public $fk_account; + /** + * @var int payment choice ID + */ public $mode_reglement_id; + + /** + * @var string payment choice code + */ public $mode_reglement_code; + + /** + * @var string paymnet choice label + */ + public $mode_reglement; public $user_author_id; public $user_valid_id; public $user_approve_id; @@ -272,7 +284,7 @@ class CommandeFournisseur extends CommonOrder 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>3, 'position'=>175), 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>3, 'position'=>180), 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>0, 'position'=>190), - 'fk_account' =>array('type'=>'integer', 'label'=>'BankAccount', 'enabled'=>'$conf->banque->enabled', 'visible'=>3, 'position'=>200), + 'fk_account' =>array('type'=>'integer', 'label'=>'BankAccount', 'enabled'=>'isModEnabled("banque")', 'visible'=>3, 'position'=>200), 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>1, 'visible'=>3, 'position'=>205), 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLocation', 'enabled'=>1, 'visible'=>3, 'position'=>210), 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>0, 'position'=>215), @@ -998,8 +1010,8 @@ class CommandeFournisseur extends CommonOrder if (!empty($conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER)) { $mybool = false; - $file = $conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER.'.php'; - $classname = $conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER; + $file = getDolGlobalString('COMMANDE_SUPPLIER_ADDON_NUMBER').'.php'; + $classname = getDolGlobalString('COMMANDE_SUPPLIER_ADDON_NUMBER'); // Include file with class $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); @@ -1461,7 +1473,7 @@ class CommandeFournisseur extends CommonOrder $sql .= ", ".((int) $user->id); $sql .= ", ".self::STATUS_DRAFT; $sql .= ", ".((int) $this->source); - $sql .= ", '".$this->db->escape($conf->global->COMMANDE_SUPPLIER_ADDON_PDF)."'"; + $sql .= ", '".$this->db->escape(getDolGlobalString('COMMANDE_SUPPLIER_ADDON_PDF'))."'"; $sql .= ", ".($this->mode_reglement_id > 0 ? $this->mode_reglement_id : 'null'); $sql .= ", ".($this->cond_reglement_id > 0 ? $this->cond_reglement_id : 'null'); $sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL'); @@ -3267,7 +3279,7 @@ class CommandeFournisseur extends CommonOrder if (!empty($this->model_pdf)) { $modele = $this->model_pdf; } elseif (!empty($conf->global->COMMANDE_SUPPLIER_ADDON_PDF)) { - $modele = $conf->global->COMMANDE_SUPPLIER_ADDON_PDF; + $modele = getDolGlobalString('COMMANDE_SUPPLIER_ADDON_PDF'); } }