fix CI payment_salary.php (#35767)

* fix CI payment_salary.php

* Update baseline.txt

* Update phpstan-baseline.neon
This commit is contained in:
Frédéric FRANCE 2025-10-15 18:56:13 +02:00 committed by GitHub
parent f0d53c7dc6
commit 82010e7a60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 35 additions and 40 deletions

View file

@ -15850,13 +15850,13 @@ parameters:
message: '#^Comparison operation "\>" between 1 and 1 is always false\.$#'
identifier: greater.alwaysFalse
count: 1
path: ../../../htdocs/salaries/paiement_salary.php
path: ../../../htdocs/salaries/payment_salary.php
-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
count: 2
path: ../../../htdocs/salaries/paiement_salary.php
path: ../../../htdocs/salaries/payment_salary.php
-
message: '#^Negated boolean expression is always false\.$#'

View file

@ -253,7 +253,7 @@ return [
'htdocs/recruitment/recruitmentjobposition_card.php' => ['PhanUndeclaredProperty'],
'htdocs/recruitment/recruitmentjobposition_document.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/recruitment/recruitmentjobposition_note.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/salaries/paiement_salary.php' => ['PhanUndeclaredProperty'],
'htdocs/salaries/payment_salary.php' => ['PhanUndeclaredProperty'],
'htdocs/salaries/virement_request.php' => ['PhanUndeclaredProperty'],
'htdocs/societe/ajax/company.php' => ['PhanUndeclaredProperty'],
'htdocs/societe/class/societe.class.php' => ['PhanTypeMismatchProperty'],

View file

@ -109,48 +109,43 @@ if (($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == '
if (!$error) {
$paymentid = 0;
$db->begin();
// Create a line of payments
$paiement = new PaymentSalary($db);
$paiement->fk_salary = $id;
$paiement->chid = $id; // deprecated
$paiement->datep = $datepaye;
$paiement->amounts = $amounts; // Tableau de montant
$paiement->fk_typepayment = GETPOSTINT("paiementtype");
$paiement->num_payment = GETPOST("num_payment", 'alphanohtml');
$paiement->note = GETPOST("note", 'restricthtml');
$paiement->note_private = GETPOST("note", 'restricthtml');
$paymentid = $paiement->create($user, (GETPOST('closepaidsalary') == 'on' ? 1 : 0));
if ($paymentid < 0) {
$error++;
setEventMessages($paiement->error, null, 'errors');
$action = 'create';
}
if (!$error) {
$db->begin();
$result = $paiement->addPaymentToBank($user, 'payment_salary', '(SalaryPayment)', GETPOSTINT('accountid'), '', '');
// Create a line of payments
$paiement = new PaymentSalary($db);
$paiement->fk_salary = $id;
$paiement->chid = $id; // deprecated
$paiement->datep = $datepaye;
$paiement->amounts = $amounts; // Tableau de montant
$paiement->fk_typepayment = GETPOSTINT("paiementtype");
$paiement->num_payment = GETPOST("num_payment", 'alphanohtml');
$paiement->note = GETPOST("note", 'restricthtml');
$paiement->note_private = GETPOST("note", 'restricthtml');
if (!$error) {
$paymentid = $paiement->create($user, (GETPOST('closepaidsalary') == 'on' ? 1 : 0));
if ($paymentid < 0) {
$error++;
setEventMessages($paiement->error, null, 'errors');
$action = 'create';
}
if (!($result > 0)) {
$error++;
setEventMessages($paiement->error, null, 'errors');
$action = 'create';
}
}
if (!$error) {
$result = $paiement->addPaymentToBank($user, 'payment_salary', '(SalaryPayment)', GETPOSTINT('accountid'), '', '');
if (!($result > 0)) {
$error++;
setEventMessages($paiement->error, null, 'errors');
$action = 'create';
}
}
if (!$error) {
$db->commit();
$loc = DOL_URL_ROOT.'/salaries/card.php?id='.$id;
header('Location: '.$loc);
exit;
} else {
$db->rollback();
}
if (!$error) {
$db->commit();
$loc = DOL_URL_ROOT.'/salaries/card.php?id='.$id;
header('Location: '.$loc);
exit;
} else {
$db->rollback();
}
}
}