From 7a6d60160ff24822bb6342c7640f1b1466db5990 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Tue, 14 Nov 2023 02:56:26 +0200 Subject: [PATCH] Enable by default standalone credit note and invoice subtype for Greece (#26562) --- htdocs/master.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 70c35008c8d..4e19a517e6c 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -241,6 +241,14 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) { // The deposit invoice type is not allowed in Greece. $conf->global->INVOICE_DISABLE_DEPOSIT = 1; } + if ($mysoc->country_code == 'GR' && !isset($conf->global->INVOICE_CREDIT_NOTE_STANDALONE)) { + // Standalone credit note is compulsory in Greece. + $conf->global->INVOICE_CREDIT_NOTE_STANDALONE = 1; + } + if ($mysoc->country_code == 'GR' && !isset($conf->global->INVOICE_SUBTYPE_ENABLED)) { + // Invoice subtype is a requirement for Greece. + $conf->global->INVOICE_SUBTYPE_ENABLED = 1; + } if (($mysoc->localtax1_assuj || $mysoc->localtax2_assuj) && !isset($conf->global->MAIN_NO_INPUT_PRICE_WITH_TAX)) { // For countries using the 2nd or 3rd tax, we disable input/edit of lines using the price including tax (because 2nb and 3rd tax not yet taken into account). // Work In Progress to support all taxes into unit price entry when MAIN_UNIT_PRICE_WITH_TAX_IS_FOR_ALL_TAXES is set. @@ -251,7 +259,7 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) { // Set default language (must be after the setValues setting global $conf->global->MAIN_LANG_DEFAULT. Page main.inc.php will overwrite langs->defaultlang with user value later) if (!defined('NOREQUIRETRAN')) { - $langcode = (GETPOST('lang', 'aZ09') ? GETPOST('lang', 'aZ09', 1) : (empty($conf->global->MAIN_LANG_DEFAULT) ? 'auto' : $conf->global->MAIN_LANG_DEFAULT)); + $langcode = (GETPOST('lang', 'aZ09') ? GETPOST('lang', 'aZ09', 1) : getDolGlobalString('MAIN_LANG_DEFAULT', 'auto')); if (defined('MAIN_LANG_DEFAULT')) { // So a page can force the language whatever is setup and parameters in URL $langcode = constant('MAIN_LANG_DEFAULT'); }