Enable by default standalone credit note and invoice subtype for Greece (#26562)

This commit is contained in:
sonikf 2023-11-14 02:56:26 +02:00 committed by GitHub
parent d46988fe62
commit 7a6d60160f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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');
}