Merge pull request #24027 from frederic34/patch-8

doc
This commit is contained in:
Laurent Destailleur 2023-02-26 19:42:20 +01:00 committed by GitHub
commit 7127f86e4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 11 deletions

View File

@ -3,7 +3,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006 Marc Barilley <marc@ocebo.com> * Copyright (C) 2006 Marc Barilley <marc@ocebo.com>
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2022-2023 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -29,10 +29,10 @@
/** /**
* Prepare array with list of tabs * 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 * @return array Array of tabs to show
*/ */
function facturefourn_prepare_head($object) function facturefourn_prepare_head(FactureFournisseur $object)
{ {
global $db, $langs, $conf; global $db, $langs, $conf;
@ -56,7 +56,7 @@ function facturefourn_prepare_head($object)
} }
//if ($fac->mode_reglement_code == 'PRE') //if ($fac->mode_reglement_code == 'PRE')
if (!empty($conf->paymentbybanktransfer->enabled)) { if (isModEnabled('paymentbybanktransfer')) {
$nbStandingOrders = 0; $nbStandingOrders = 0;
$sql = "SELECT COUNT(pfd.rowid) as nb"; $sql = "SELECT COUNT(pfd.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd";
@ -132,8 +132,8 @@ function facturefourn_prepare_head($object)
/** /**
* Prepare array with list of tabs * Prepare array with list of tabs
* *
* @param Object $object Object related to tabs * @param CommandeFournisseur $object Object related to tabs
* @return array Array of tabs to show * @return array Array of tabs to show
*/ */
function ordersupplier_prepare_head(CommandeFournisseur $object) function ordersupplier_prepare_head(CommandeFournisseur $object)
{ {

View File

@ -176,8 +176,20 @@ class CommandeFournisseur extends CommonOrder
*/ */
public $fk_account; public $fk_account;
/**
* @var int payment choice ID
*/
public $mode_reglement_id; public $mode_reglement_id;
/**
* @var string payment choice code
*/
public $mode_reglement_code; public $mode_reglement_code;
/**
* @var string paymnet choice label
*/
public $mode_reglement;
public $user_author_id; public $user_author_id;
public $user_valid_id; public $user_valid_id;
public $user_approve_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_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), '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), '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), '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), '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), '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)) { if (!empty($conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER)) {
$mybool = false; $mybool = false;
$file = $conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER.'.php'; $file = getDolGlobalString('COMMANDE_SUPPLIER_ADDON_NUMBER').'.php';
$classname = $conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER; $classname = getDolGlobalString('COMMANDE_SUPPLIER_ADDON_NUMBER');
// Include file with class // Include file with class
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
@ -1461,7 +1473,7 @@ class CommandeFournisseur extends CommonOrder
$sql .= ", ".((int) $user->id); $sql .= ", ".((int) $user->id);
$sql .= ", ".self::STATUS_DRAFT; $sql .= ", ".self::STATUS_DRAFT;
$sql .= ", ".((int) $this->source); $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->mode_reglement_id > 0 ? $this->mode_reglement_id : 'null');
$sql .= ", ".($this->cond_reglement_id > 0 ? $this->cond_reglement_id : 'null'); $sql .= ", ".($this->cond_reglement_id > 0 ? $this->cond_reglement_id : 'null');
$sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL'); $sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL');
@ -3267,7 +3279,7 @@ class CommandeFournisseur extends CommonOrder
if (!empty($this->model_pdf)) { if (!empty($this->model_pdf)) {
$modele = $this->model_pdf; $modele = $this->model_pdf;
} elseif (!empty($conf->global->COMMANDE_SUPPLIER_ADDON_PDF)) { } elseif (!empty($conf->global->COMMANDE_SUPPLIER_ADDON_PDF)) {
$modele = $conf->global->COMMANDE_SUPPLIER_ADDON_PDF; $modele = getDolGlobalString('COMMANDE_SUPPLIER_ADDON_PDF');
} }
} }