Merge pull request #21297 from Easya-Solutions/new-thirdparty-card-presend-with-attached-file
NEW add attached file in presend email form of thirdparty card
This commit is contained in:
commit
66889ea450
@ -41,10 +41,10 @@ if ($action == 'presend') {
|
||||
|
||||
$object->fetch_projet();
|
||||
|
||||
if (!in_array($object->element, array('societe', 'user', 'member'))) {
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
if (!in_array($object->element, array('user', 'member'))) {
|
||||
// TODO get also the main_lastdoc field of $object. If not found, try to guess with following code
|
||||
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
// Special case
|
||||
if ($object->element == 'invoice_supplier') {
|
||||
@ -82,12 +82,15 @@ if ($action == 'presend') {
|
||||
|
||||
// Build document if it not exists
|
||||
$forcebuilddoc = true;
|
||||
if (in_array($object->element, array('societe', 'user', 'member'))) {
|
||||
if (in_array($object->element, array('user', 'member'))) {
|
||||
$forcebuilddoc = false;
|
||||
}
|
||||
if ($object->element == 'invoice_supplier' && empty($conf->global->INVOICE_SUPPLIER_ADDON_PDF)) {
|
||||
$forcebuilddoc = false;
|
||||
}
|
||||
if ($object->element == 'societe' && empty($conf->global->COMPANY_ADDON_PDF)) {
|
||||
$forcebuilddoc = false;
|
||||
}
|
||||
if ($forcebuilddoc) { // If there is no default value for supplier invoice, we do not generate file, even if modelpdf was set by a manual generation
|
||||
if ((!$file || !is_readable($file)) && method_exists($object, 'generateDocument')) {
|
||||
$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user