From d9a2d2b982613e5a52beb29d949f26931abad44d Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Fri, 22 May 2020 08:00:26 +0200 Subject: [PATCH 1/3] fix not working default values for payment --- htdocs/fourn/facture/card.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 6e8f259bc01..ae6af7bf99b 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1780,6 +1780,18 @@ if ($action == 'create') if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code; } + // when payment condition is empty (means not override by payment condition form a other object, like third-party), try to use default value + if(empty($cond_reglement_id)) + { + $cond_reglement_id = GETPOST("cond_reglement_id"); + } + + // when payment mode is empty (means not override by payment condition form a other object, like third-party), try to use default value + if(empty($mode_reglement_id)) + { + $mode_reglement_id = GETPOST("mode_reglement_id"); + } + print '
'; print ''; print ''; From 53080be2453eb2c6815d809e344c1e5191f070d3 Mon Sep 17 00:00:00 2001 From: Tobias Sekan Date: Fri, 22 May 2020 08:01:29 +0200 Subject: [PATCH 2/3] fix not working default values for payment --- htdocs/compta/facture/card.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ab2262844bf..3b36950447f 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2907,6 +2907,18 @@ if ($action == 'create') if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code; } + // when payment condition is empty (means not override by payment condition form a other object, like third-party), try to use default value + if(empty($cond_reglement_id)) + { + $cond_reglement_id = GETPOST("cond_reglement_id"); + } + + // when payment mode is empty (means not override by payment mode form a other object, like third-party), try to use default value + if(empty($mode_reglement_id)) + { + $mode_reglement_id = GETPOST("mode_reglement_id"); + } + if (!empty($soc->id)) $absolute_discount = $soc->getAvailableDiscounts(); $note_public = $object->getDefaultCreateValueFor('note_public', ((!empty($origin) && !empty($originid) && is_object($objectsrc) && !empty($conf->global->FACTURE_REUSE_NOTES_ON_CREATE_FROM)) ? $objectsrc->note_public : null)); $note_private = $object->getDefaultCreateValueFor('note_private', ((!empty($origin) && !empty($originid) && is_object($objectsrc) && !empty($conf->global->FACTURE_REUSE_NOTES_ON_CREATE_FROM)) ? $objectsrc->note_private : null)); From 2873f4dacfe3a0bdf0c7e91281bb73a40b4f2ce4 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 22 May 2020 06:08:12 +0000 Subject: [PATCH 3/3] Fixing style errors. --- htdocs/compta/facture/card.php | 2 +- htdocs/fourn/facture/card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 3b36950447f..038120151e3 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2918,7 +2918,7 @@ if ($action == 'create') { $mode_reglement_id = GETPOST("mode_reglement_id"); } - + if (!empty($soc->id)) $absolute_discount = $soc->getAvailableDiscounts(); $note_public = $object->getDefaultCreateValueFor('note_public', ((!empty($origin) && !empty($originid) && is_object($objectsrc) && !empty($conf->global->FACTURE_REUSE_NOTES_ON_CREATE_FROM)) ? $objectsrc->note_public : null)); $note_private = $object->getDefaultCreateValueFor('note_private', ((!empty($origin) && !empty($originid) && is_object($objectsrc) && !empty($conf->global->FACTURE_REUSE_NOTES_ON_CREATE_FROM)) ? $objectsrc->note_private : null)); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index ae6af7bf99b..05cb43fceb8 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1791,7 +1791,7 @@ if ($action == 'create') { $mode_reglement_id = GETPOST("mode_reglement_id"); } - + print ''; print ''; print '';