diff --git a/ChangeLog b/ChangeLog index 8fd47651f99..308b1704819 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ For users: - New: Add field "signature" into thirdparty card. If filled, text is added at end of predefined email texts. If option MAIL_DO_NOT_USE_SIGN is on, this feature is disabled. +- New: Can input a payment back onto an credit note. - New: Add link "Back to list" on all cards. - New: After first install, warning are visible onto mandatory setup not configured. Show also total number of activated modules. diff --git a/htdocs/.gitignore b/htdocs/.gitignore index 462109fff42..dfa990ed38c 100644 --- a/htdocs/.gitignore +++ b/htdocs/.gitignore @@ -1,3 +1,4 @@ /test.php /custom* /bootstrap +/multicompany diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 5c278dd66f3..6303751dfe5 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -744,19 +744,31 @@ if ($rowid) print_fiche_titre($langs->trans("NewCotisation")); - $bankdirect=0; // Option to write to bank is on by default - $bankviainvoice=0; // Option to write via invoice is on by default - $invoiceonly=0; - if (! empty($conf->banque->enabled) && $conf->global->ADHERENT_BANK_USE && (empty($_POST['paymentsave']) || $_POST["paymentsave"] == 'bankdirect')) $bankdirect=1; - if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1; + // Define default choice to select + $bankdirect=0; // 1 means option by default is write to bank direct with no invoice + $invoiceonly=0; // 1 means option by default is invoice only + $bankviainvoice=0; // 1 means option by default is write to bank via invoice + if (GETPOST('paymentsave')) + { + if (GETPOST('paymentsave') == 'bankdirect') $bankdirect=1; + if (GETPOST('paymentsave') == 'invoiceonly') $invoiceonly=1; + if (GETPOST('paymentsave') == 'bankviainvoice') $bankviainvoice=1; + } + else + { + if (! empty($conf->global->ADHERENT_BANK_USE) && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1; + else if (! empty($conf->global->ADHERENT_BANK_USE) && ! empty($conf->banque->enabled)) $bankdirect=1; + else if (empty($conf->global->ADHERENT_BANK_USE) && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $invoiceonly=1; + } print "\n\n\n"; if ($conf->use_javascript_ajax) { + //var_dump($bankdirect.'-'.$bankviainvoice.'-'.$invoiceonly.'-'.empty($conf->global->ADHERENT_BANK_USE)); print "\n".'