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

Conflicts:
	htdocs/comm/action/peruser.php
	htdocs/core/class/commonobject.class.php
This commit is contained in:
Laurent Destailleur 2024-02-07 18:16:57 +01:00
commit 097290fc38
5 changed files with 32 additions and 5 deletions

View file

@ -65,7 +65,17 @@ jobs:
- name: Setup PHPCS
uses: shivammathur/setup-php@v2
if: steps.changed-php.outputs.any_changed == 'true'
# Install when we're going to run phpcs
if: |
steps.changed-php.outputs.any_changed == 'true'
||
(
github.event_name == 'push'
&& (
github.event.ref == 'refs/heads/develop'
|| endsWith(github.event.ref, '.0')
)
)
with:
php-version: 8.1
coverage: none # disable xdebug, pcov
@ -79,6 +89,17 @@ jobs:
set -o pipefail
pre-commit run php-cs --files ${ALL_CHANGED_FILES} | tee -a ${RAW_LOG}
- name: Run some pre-commit hooks on all files on push to "main" branches
if: |
github.event_name == 'push'
&& (
github.event.ref == 'refs/heads/develop'
|| endsWith(github.event.ref, '.0')
)
run: |
set -o pipefail
pre-commit run -a php-cs | tee -a ${RAW_LOG}
# If error, we convert log in the checkstyle format
- name: Convert Raw Log to CheckStyle format
if: ${{ failure() }}

View file

@ -915,6 +915,12 @@ while ($currentdaytoshow < $lastdaytoshow) {
}
}
$sql .= " AND u.statut = 1";
if ($filtert > 0) {
$sql .= " AND u.rowid = ".((int) $filtert);
}
if ($usergroup > 0) {
$sql .= " AND ug.fk_usergroup = ".((int) $usergroup);
}
if ($user->socid > 0) {
// External users should see only contacts of their company
$sql .= " AND u.fk_soc = ".((int) $user->socid);

View file

@ -9514,7 +9514,7 @@ abstract class CommonObject
$this->$field = (float) $obj->$field;
}
} else {
if (isset($obj->$field) && !is_null($obj->$field) || (isset($info['notnull']) && $info['notnull'] == 1)) {
if (isset($obj->$field) && (!is_null($obj->$field) || (isset($info['notnull']) && $info['notnull'] == 1))) {
$this->$field = (int) $obj->$field;
} else {
$this->$field = null;
@ -9529,7 +9529,7 @@ abstract class CommonObject
$this->$field = (float) $obj->$field;
}
} else {
if (isset($obj->$field) && !is_null($obj->$field) || (isset($info['notnull']) && $info['notnull'] == 1)) {
if (isset($obj->$field) && (!is_null($obj->$field) || (isset($info['notnull']) && $info['notnull'] == 1))) {
$this->$field = (float) $obj->$field;
} else {
$this->$field = null;

View file

@ -2044,7 +2044,7 @@ class CommandeFournisseur extends CommonOrder
$this->line->total_localtax2 = $total_localtax2;
$this->line->total_ttc = $total_ttc;
$this->line->product_type = $type;
$this->line->special_code = (!empty($this->special_code) ? $this->special_code : 0);
$this->line->special_code = (!empty($special_code) ? $special_code : 0);
$this->line->origin = $origin;
$this->line->origin_id = $origin_id;
$this->line->fk_unit = $fk_unit;

View file

@ -294,7 +294,7 @@ if (empty($reshook)) {
if ($pay != "delayed") {
$payment->create($user);
$payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', '');
$res = $payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', '');
if ($res < 0) {
$error++;
dol_htmloutput_errors($langs->trans('ErrorNoPaymentDefined'), $payment->errors, 1);