Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2023-12-03 20:32:45 +01:00
commit a04dafff18
6 changed files with 92 additions and 2 deletions

30
.php-cs-fixer.dist.php Normal file
View file

@ -0,0 +1,30 @@
<?php
$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude([
'htdocs/includes',
])
->notPath([
'vendor',
])
;
return (new PhpCsFixer\Config())
->setRules([
// Apply PSR-12 as per https://wiki.dolibarr.org/index.php?title=Langages_et_normes#PHP:~:text=utiliser%20est%20le-,PSR%2D12,-(https%3A//www
// '@PSR12' => true, // Disabled for now to limit number of changes
// Minimum version Dolibarr v18.0.0
'@PHP71Migration' => true,
//'strict_param' => true,
//'array_syntax' => ['syntax' => 'short'],
'array_syntax' => false,
])
->setFinder($finder)
// TAB Indent violates PSR-12 "must" rule, but used in code
// (See https://www.php-fig.org/psr/psr-12/#24-indenting )
->setIndent("\t")
// All files MUST use the Unix LF line ending only
// https://www.php-fig.org/psr/psr-12/#22-files
->setLineEnding("\n")
;

View file

@ -0,0 +1,52 @@
#!/bin/bash
#
# Usage:
# Optionally set COMPOSER_CMD to the command to use to run composer.
# Optionally set COMPOSER_VENDOR_DIR to your vendor path for composer.
#
# Run php-cs-fixer by calling this script:
# ./run-php-cs-fixer.sh check # Only checks (the default)
# ./run-php-cs-fixer.sh fix # Fixes
#
# You can fix only a few files using
# ./run-php-cs-fixer.sh fix htdocs/path/to/myfile.php
#
# You can run this from the root directory of dolibarr
# dev/tools/run-php-cs-fixer.sh fix htdocs/path/to/myfile.php
#
# You can provide the environment variables on the CLI like this:
# COMPOSER_CMD="php ~/composer.phar" COMPOSER_VENDOR_DIR="~/vendor" ./run-php-cs-fixer.sh
#
# or export them:
# export COMPOSER_CMD="php ~/composer.phar"
# export COMPOSER_VENDOR_DIR="~/vendor"
# ./run-php-cs-fixer.sh
#
# Or some other method
#
MYDIR=$(dirname "$(realpath "$0")")
export COMPOSER_VENDOR_DIR=${COMPOSER_VENDOR_DIR:=$MYDIR/vendor}
COMPOSER_CMD=${COMPOSER_CMD:=composer}
#
# Install/update
#
PHP_CS_FIXER="${COMPOSER_VENDOR_DIR}/bin/php-cs-fixer"
if [ ! -r "${PHP_CS_FIXER}" ] ; then
[[ ! -e "${COMPOSER_VENDOR_DIR}" ]] && ${COMPOSER_CMD} install
[[ -e "${COMPOSER_VENDOR_DIR}" ]] && ${COMPOSER_CMD} update
${COMPOSER_CMD} require --dev friendsofphp/php-cs-fixer
fi
(
cd "${MYDIR}/../.." || exit
CMD=
# If no argument, run check by default
[[ "$1" == "" ]] && CMD=check
# shellcheck disable=SC2086
"${PHP_CS_FIXER}" $CMD "$@"
)

View file

@ -997,7 +997,7 @@ class Expedition extends CommonObject
$linebatch = new ExpeditionLineBatch($this->db);
$ret = $linebatch->fetchFromStock($value['id_batch']); // load serial, sellby, eatby
if ($ret < 0) {
$this->error = $linebatch->error;
$this->setErrorsFromObject($linebatch);
return -1;
}
$linebatch->qty = $value['q'];
@ -1038,6 +1038,7 @@ class Expedition extends CommonObject
$this->lines[$num] = $line;
return 1;
}
return 0;
}
/**

View file

@ -45,6 +45,8 @@ class LoanSchedule extends CommonObject
*/
public $fk_loan;
public $bank_account;
public $bank_line;
/**
* @var string Create date
*/

View file

@ -98,6 +98,11 @@ class PaymentLoan extends CommonObject
public $type_code;
public $type_label;
public $chid;
public $label;
public $paymenttype;
public $bank_account;
public $bank_line;
/**

View file

@ -829,7 +829,7 @@ class Thirdparties extends DolibarrApi
* Get representatives of thirdparty
*
* @param int $id ID of the thirdparty
* @param string $mode 0=Array with properties, 1=Array of id.
* @param int $mode 0=Array with properties, 1=Array of id.
*
* @url GET {id}/representatives
*