From 39ff3d3190f94840068b85d9ac2f7bf491db3565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 30 Dec 2020 19:07:46 +0100 Subject: [PATCH] phpcs --- htdocs/fourn/facture/list.php | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 08bab0b4c76..eef93849c8b 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -11,7 +11,7 @@ * Copyright (C) 2015-2016 Ferran Marcet * Copyright (C) 2017 Josep Lluís Amador * Copyright (C) 2018 Charlene Benke - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2020 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 @@ -60,8 +60,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'sup $socid = GETPOST('socid', 'int'); // Security check -if ($user->socid > 0) -{ +if ($user->socid > 0) { $action = ''; $_GET["action"] = ''; $socid = $user->socid; @@ -363,13 +362,10 @@ if ($massaction == 'transfer_request') { $langs->load("withdrawals"); - if (!$user->rights->paymentbybanktransfer->create) - { + if (!$user->rights->paymentbybanktransfer->create) { $error++; setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors'); - } - else - { + } else { //Checking error $error = 0; @@ -421,34 +417,27 @@ if ($massaction == 'transfer_request') elseif (!empty($objecttmp->mode_reglement_code) && $objecttmp->mode_reglement_code != 'VIR') { $error++; setEventMessages($objecttmp->ref.' '.$langs->trans("BadPaymentMethod"), $objecttmp->errors, 'errors'); - } - else { + } else { $listofbills[] = $objecttmp; // $listofbills will only contains invoices with good payment method and no request already done } } } //Massive withdraw request for request with no errors - if (!empty($listofbills)) - { + if (!empty($listofbills)) { $nbwithdrawrequestok = 0; - foreach ($listofbills as $aBill) - { + foreach ($listofbills as $aBill) { $db->begin(); $result = $aBill->demande_prelevement($user, $aBill->resteapayer, 'bank-transfer', 'supplier_invoice'); - if ($result > 0) - { + if ($result > 0) { $db->commit(); $nbwithdrawrequestok++; - } - else - { + } else { $db->rollback(); setEventMessages($aBill->error, $aBill->errors, 'errors'); } } - if ($nbwithdrawrequestok > 0) - { + if ($nbwithdrawrequestok > 0) { setEventMessages($langs->trans("BankTransferRequestsDone", $nbwithdrawrequestok), null, 'mesgs'); } }