diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index d4489d08187..54b6c227ed4 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -771,7 +771,7 @@ if (!$error && $action == 'writebookkeeping' && $user->hasRight('accounting', 'b if (!empty($val['lib'])) { $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " / " : ""); } - if ($tabtype[$key] === 'banktransfert') { + if ($tabtype[$key] == 'banktransfert') { $reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer); } else { $reflabel .= dol_string_nohtmltag($val['soclib']); @@ -794,24 +794,24 @@ if (!$error && $action == 'writebookkeeping' && $user->hasRight('accounting', 'b $bookkeeping->fk_user_author = $user->id; $bookkeeping->date_creation = $now; - if ($tabtype[$key] === 'payment') { // If payment is payment of customer invoice, we get ref of invoice + if ($tabtype[$key] == 'payment') { // If payment is payment of customer invoice, we get ref of invoice $lettering = true; $bookkeeping->subledger_account = $k; // For payment, the subledger account is stored as $key of $tabtp $bookkeeping->subledger_label = $tabcompany[$key]['name']; // $tabcompany is defined only if we are sure there is 1 thirdparty for the bank transaction $bookkeeping->numero_compte = $tabcompany[$key]['accountancy_code_general']; $bookkeeping->label_compte = $accountingaccountcustomer->label; - } elseif ($tabtype[$key] === 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice + } elseif ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice $lettering = true; $bookkeeping->subledger_account = $k; // For payment, the subledger account is stored as $key of $tabtp $bookkeeping->subledger_label = $tabcompany[$key]['name']; // $tabcompany is defined only if we are sure there is 1 thirdparty for the bank transaction $bookkeeping->numero_compte = $tabcompany[$key]['accountancy_code_general']; $bookkeeping->label_compte = $accountingaccountsupplier->label; - } elseif ($tabtype[$key] === 'payment_expensereport') { + } elseif ($tabtype[$key] == 'payment_expensereport') { $bookkeeping->subledger_account = $tabuser[$key]['accountancy_code']; $bookkeeping->subledger_label = $tabuser[$key]['name']; $bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_EXPENSEREPORT'); $bookkeeping->label_compte = $accountingaccountexpensereport->label; - } elseif ($tabtype[$key] === 'payment_salary') { + } elseif ($tabtype[$key] == 'payment_salary') { $bookkeeping->subledger_account = $tabuser[$key]['accountancy_code']; $bookkeeping->subledger_label = $tabuser[$key]['name']; $bookkeeping->numero_compte = $tabuser[$key]['accountancy_code_general']; @@ -822,44 +822,44 @@ if (!$error && $action == 'writebookkeeping' && $user->hasRight('accounting', 'b $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] === 'payment_vat') { + } elseif ($tabtype[$key] == 'payment_vat') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] === 'payment_donation') { + } elseif ($tabtype[$key] == 'payment_donation') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] === 'member') { + } elseif ($tabtype[$key] == 'member') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] === 'payment_loan') { + } elseif ($tabtype[$key] == 'payment_loan') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] === 'payment_various') { + } elseif ($tabtype[$key] == 'payment_various') { $bookkeeping->subledger_account = $k; $bookkeeping->subledger_label = $tabcompany[$key]['name']; $accountingaccount->fetch(0, $tabpay[$key]["account_various"], true); // TODO Use a cache $bookkeeping->numero_compte = $tabpay[$key]["account_various"]; $bookkeeping->label_compte = $accountingaccount->label; - } elseif ($tabtype[$key] === 'banktransfert') { + } elseif ($tabtype[$key] == 'banktransfert') { $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; $accountingaccount->fetch(0, $k, true); // TODO Use a cache $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; } else { - if ($tabtype[$key] === 'unknown') { // Unknown transaction, we will use a waiting account for thirdparty. + if ($tabtype[$key] == 'unknown') { // Unknown transaction, we will use a waiting account for thirdparty. // Temporary account $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 994a47ccd73..66b558fb005 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2019 JC Prieto - * Copyright (C) 2022-2024 Frédéric France + * Copyright (C) 2022-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -535,7 +535,7 @@ class Account extends CommonObject * @param int $fk_bank To search using bank transaction id * @param int $url_id To search using link to * @param string $type To search using type - * @return int<-1,-1>|array Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error + * @return int<-1,-1>|array Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error */ public function get_url($fk_bank = 0, $url_id = 0, $type = '') {