Use email model option to joint file for subscription

Allow the adherent subscription to use the email model option to join or no joint file.
This commit is contained in:
Bernard Saulme 2020-11-25 18:11:36 +01:00 committed by GitHub
parent 74605cec12
commit be7714be1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -333,7 +333,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$listofpaths = array();
$listofnames = array();
$listofmimes = array();
if (is_object($object->invoice)) {
if (is_object($object->invoice) && is_object($arraydefaultmessage) && intval($arraydefaultmessage->joinfiles)) {
$invoicediroutput = $conf->facture->dir_output;
$fileparams = dol_most_recent_file($invoicediroutput.'/'.$object->invoice->ref, preg_quote($object->invoice->ref, '/').'[^\-]+');
$file = $fileparams['fullname'];