From a5678147dd92f566a09d358f9a9bce61fb3ef03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 13 Jan 2021 16:52:32 +0100 Subject: [PATCH 1/2] add missing translation --- htdocs/compta/prelevement/card.php | 15 +++++++-------- htdocs/langs/en_US/withdrawals.lang | 5 +++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 5d87303236a..90d5e1e8fe6 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005 Rodolphe Quiedeville * Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2010-2016 Juanjo Menent - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 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 @@ -354,8 +354,8 @@ if ($id > 0 || $ref) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); - if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 - { + if (($page * $limit) > $nbtotalofrecords) { + // if total resultset is smaller then paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } @@ -445,15 +445,14 @@ if ($id > 0 || $ref) $i++; } - if ($num > 0) - { + if ($num > 0) { print ''; print ''.$langs->trans("Total").''; print ' '; print ''; - if (empty($offset) && $num <= $limit) // If we have all record on same page, then the following test/warning can be done - { - if ($total != $object->amount) print img_warning("TotalAmountOfdirectDebitOrderDiffersFromSumOfLines"); + if (empty($offset) && $num <= $limit) { + // If we have all record on same page, then the following test/warning can be done + if ($total != $object->amount) print img_warning($langs->trans("TotalAmountOfdirectDebitOrderDiffersFromSumOfLines")); } print price($total); print "\n"; diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index debfeaa9d27..059b3451c11 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -26,7 +26,7 @@ NotPossibleForThisStatusOfWithdrawReceiptORLine=Not yet possible. Withdraw statu NbOfInvoiceToWithdraw=No. of qualified customer invoices with waiting direct debit order NbOfInvoiceToWithdrawWithInfo=No. of customer invoice with direct debit payment orders having defined bank account information NbOfInvoiceToPayByBankTransfer=No. of qualified supplier invoices waiting for a payment by credit transfer -SupplierInvoiceWaitingWithdraw=Vendor invoice waiting for payment by credit transfer +SupplierInvoiceWaitingWithdraw=Vendor invoice waiting for payment by credit transfer InvoiceWaitingWithdraw=Invoice waiting for direct debit InvoiceWaitingPaymentByBankTransfer=Invoice waiting for credit transfer AmountToWithdraw=Amount to withdraw @@ -148,4 +148,5 @@ InfoRejectSubject=Direct debit payment order refused InfoRejectMessage=Hello,

the direct debit payment order of invoice %s related to the company %s, with an amount of %s has been refused by the bank.

--
%s ModeWarning=Option for real mode was not set, we stop after this simulation ErrorCompanyHasDuplicateDefaultBAN=Company with id %s has more than one default bank account. No way to know wich one to use. -ErrorICSmissing=Missing ICS in Bank account %s +ErrorICSmissing=Missing ICS in Bank account %s +TotalAmountOfdirectDebitOrderDiffersFromSumOfLines=Total amount of direct debit order differs from sum of lines From 271378fb87e46855710f1e2191f44e8242a043e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 13 Jan 2021 18:09:57 +0100 Subject: [PATCH 2/2] add translation --- htdocs/compta/prelevement/create.php | 36 +++++++++++----------------- htdocs/langs/en_US/banks.lang | 1 + 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 26b91a1e100..db751735bb0 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -66,18 +66,14 @@ $parameters = array('mode' => $mode, 'format' => $format, 'limit' => $limit, 'pa $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -if (empty($reshook)) -{ +if (empty($reshook)) { // Change customer bank information to withdraw - if ($action == 'modify') - { - for ($i = 1; $i < 9; $i++) - { + if ($action == 'modify') { + for ($i = 1; $i < 9; $i++) { dolibarr_set_const($db, GETPOST("nom$i"), GETPOST("value$i"), 'chaine', 0, '', $conf->entity); } } - if ($action == 'create') - { + if ($action == 'create') { $default_account=($type == 'bank-transfer' ? 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT' : 'PRELEVEMENT_ID_BANKACCOUNT'); if ($id_bankaccount != $conf->global->{$default_account}){ @@ -88,7 +84,8 @@ if (empty($reshook)) $bank = new Account($db); $bank->fetch($conf->global->{$default_account}); if (empty($bank->ics) || empty($bank->ics_transfer)){ - setEventMessages($langs->trans("ErrorICSmissing", $bank->getNomUrl(1)), null, 'errors'); + $errormessage = str_replace('{url}', $bank->getNomUrl(1), $langs->trans("ErrorICSmissing", '{url}')); + setEventMessages($errormessage, null, 'errors'); header("Location: ".DOL_URL_ROOT.'/compta/prelevement/create.php'); exit; } @@ -111,8 +108,7 @@ if (empty($reshook)) $mesg = $langs->trans("NoInvoiceCouldBeWithdrawed", $format); setEventMessages($mesg, null, 'errors'); $mesg .= '
'."\n"; - foreach ($bprev->invoice_in_error as $key => $val) - { + foreach ($bprev->invoice_in_error as $key => $val) { $mesg .= ''.$val."
\n"; } } else { @@ -145,8 +141,7 @@ $bprev = new BonPrelevement($db); llxHeader('', $langs->trans("NewStandingOrder")); -if (prelevement_check_config($type) < 0) -{ +if (prelevement_check_config($type) < 0) { $langs->load("errors"); setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Withdraw")), null, 'errors'); } @@ -237,8 +232,7 @@ if ($nb) { print ''.$title."\n"; } } else { - if ($mysoc->isInEEC()) - { + if ($mysoc->isInEEC()) { $title = $langs->trans("CreateForSepaFRST"); if ($type == 'bank-transfer') { $title = $langs->trans("CreateSepaFileForPaymentByBankTransfer"); @@ -289,8 +283,7 @@ $sql .= " ".MAIN_DB_PREFIX."societe as s,"; $sql .= " ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql .= " WHERE s.rowid = f.fk_soc"; $sql .= " AND f.entity IN (".getEntity('invoice').")"; -if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) -{ +if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS)) { $sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED; } //$sql .= " AND pfd.amount > 0"; @@ -305,12 +298,11 @@ if ($type == 'bank-transfer') { if ($socid > 0) $sql .= " AND f.fk_soc = ".$socid; $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) -{ +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); - if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 - { + if (($page * $limit) > $nbtotalofrecords) { + // if total resultset is smaller then paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } @@ -399,7 +391,7 @@ if ($resql) if ($format) print ' ('.$format.')'; } } else { - print img_warning($langs->trans("NoBankAccount")); + print img_warning($langs->trans("NoBankAccountDefined")); } print ''; // Amount diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang index a0dc27f86c4..81a23238550 100644 --- a/htdocs/langs/en_US/banks.lang +++ b/htdocs/langs/en_US/banks.lang @@ -180,3 +180,4 @@ BankColorizeMovementDesc=If this function is enable, you can choose specific bac BankColorizeMovementName1=Background color for debit movement BankColorizeMovementName2=Background color for credit movement IfYouDontReconcileDisableProperty=If you don't make the bank reconciliations on some bank accounts, disable the property "%s" on them to remove this warning. +NoBankAccountDefined=No bank account defined