From 291b071d9655779ff044c01af7d2bfc539a01786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 29 Jun 2024 19:32:43 +0200 Subject: [PATCH 1/3] fix Undefined variable $outlangs (#30197) Co-authored-by: Laurent Destailleur --- htdocs/core/tpl/object_discounts.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/object_discounts.tpl.php b/htdocs/core/tpl/object_discounts.tpl.php index 17221165344..2826cef6c6f 100644 --- a/htdocs/core/tpl/object_discounts.tpl.php +++ b/htdocs/core/tpl/object_discounts.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2021 Frédéric France + * Copyright (C) 2021-2024 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 @@ -69,7 +69,7 @@ print ' '.$addrelativediscount; if ($absolute_discount > 0) { if (!empty($cannotApplyDiscount) || !$isInvoice || $isNewObject || $object->statut > $objclassname::STATUS_DRAFT || $object->type == $objclassname::TYPE_CREDIT_NOTE || $object->type == $objclassname::TYPE_DEPOSIT) { $translationKey = empty($discount_type) ? 'CompanyHasDownPaymentOrCommercialDiscount' : 'HasDownPaymentOrCommercialDiscountFromSupplier'; - $text = $langs->trans($translationKey, price($absolute_discount, 1, $outlangs, 1, -1, -1, $conf->currency)); + $text = $langs->trans($translationKey, price($absolute_discount, 1, $langs, 1, -1, -1, $conf->currency)).'.'; if ($isInvoice && !$isNewObject && $object->statut > $objclassname::STATUS_DRAFT && $object->type != $objclassname::TYPE_CREDIT_NOTE && $object->type != $objclassname::TYPE_DEPOSIT) { $text = $form->textwithpicto($text, $langs->trans('AbsoluteDiscountUse')); From bd39e561abac674ccc50a6168f182938ac7f8d79 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 29 Jun 2024 19:37:35 +0200 Subject: [PATCH 2/3] Situation invoice - Fix admin message (#30172) * Situation invoice - Fix admin message * Indent --- htdocs/index.php | 5 +++-- htdocs/langs/en_US/admin.lang | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/index.php b/htdocs/index.php index 96f61aa12d7..b37ce645d92 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -118,8 +118,9 @@ if (getDolGlobalString('MAIN_MOTD')) { */ // Specific warning to propose to upgrade invoice situation to progressive mode -if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1 ) { - print info_admin($langs->trans("WarningExperimentalFeatureInvoiceSituationNeedToUpgradeToProgressiveMode")); +if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) { + $langs->loadLangs(array("admin")); + print info_admin($langs->trans("WarningExperimentalFeatureInvoiceSituationNeedToUpgradeToProgressiveMode", 'https://partners.dolibarr.org')); print "
"; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 98c658e6a78..9adbb71316a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2104,7 +2104,7 @@ BaseCurrency=Reference currency of the company (go into setup of company to chan WarningNoteModuleInvoiceForFrenchLaw=This module %s is compliant with French laws (Loi Finance 2016). WarningNoteModulePOSForFrenchLaw=This module %s is compliant with French laws (Loi Finance 2016) because module Non Reversible Logs is automatically activated. WarningInstallationMayBecomeNotCompliantWithLaw=You are trying to install module %s that is an external module. Activating an external module means you trust the publisher of that module and that you are sure that this module does not adversely impact the behavior of your application, and is compliant with laws of your country (%s). If the module introduces an illegal feature, you become responsible for the use of illegal software. -WarningExperimentalFeatureInvoiceSituationNeedToUpgradeToProgressiveMode=If you're using the experimental mode for status invoices, you'll need to update your data to switch to the official mode. Contact a preferred partner who will help you with this task. List of preferred partners available by following this link +WarningExperimentalFeatureInvoiceSituationNeedToUpgradeToProgressiveMode=If you're using the experimental mode for situation invoices, you'll need to update your data to switch to the official mode. Contact a preferred partner who will help you with this task. List of preferred partners available by following this link MAIN_PDF_MARGIN_LEFT=Left margin on PDF MAIN_PDF_MARGIN_RIGHT=Right margin on PDF From f27dc99bf6cbecb998f9b1ba214cdcb4a7376a9d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 Jun 2024 20:00:43 +0200 Subject: [PATCH 3/3] Fix test --- htdocs/core/tpl/objectline_title.tpl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php index ca1cf385264..6863dd024e5 100644 --- a/htdocs/core/tpl/objectline_title.tpl.php +++ b/htdocs/core/tpl/objectline_title.tpl.php @@ -167,7 +167,8 @@ if ($usemargins && isModEnabled('margin') && empty($user->socid)) { if (getDolGlobalString('DISPLAY_MARGIN_RATES') && $user->hasRight('margins', 'liretous')) { print ''.$langs->trans('MarginRate'); - if ($object->status == $object::STATUS_DRAFT && $user->hasRight("propal", "creer")) { + // @phan-suppress-next-line PhanUndeclaredConstantOfClass + if (in_array($object->element, array('propal', 'commande', 'facture', 'supplier_proposal', 'order_supplier', 'invoice_supplier')) && $object->status == $object::STATUS_DRAFT) { print 'id.'">'.img_edit($langs->trans("UpdateForAllLines"), 0, 'class="clickmarginforalllines opacitymedium paddingleft cursorpointer"').''; if (GETPOST('mode', 'aZ09') == 'marginforalllines') { print '
';