diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 76b41f3ce86..41cc8042144 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1051,6 +1051,23 @@ class Facture extends CommonInvoice else return -1; } + /** + * Return link to download file from a direct external access + * + * @param int $withpicto Add download picto into link + * @return string HTML link to file + */ + function getDirectExternalLink($withpicto=0) + { + // Define $urlwithroot + $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); + $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + + $url='eee'; + return ''.$this->ref.''; + } + /** * Return clicable link of object (with eventually picto) * diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 62f82bc33d1..0c8fbbc733d 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -808,7 +808,7 @@ if ($source == 'invoice') print ''.$langs->trans("Creditor"); print ''.$creditor.''; - print ''; + print ''; print ''."\n"; // Debitor @@ -821,8 +821,8 @@ if ($source == 'invoice') $text=''.$langs->trans("PaymentInvoiceRef",$invoice->ref).''; print ''.$langs->trans("Designation"); print ''.$text; - print ''; - print ''; + print ''; + print ''; print ''."\n"; // Amount @@ -846,13 +846,21 @@ if ($source == 'invoice') print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); print ''.$fulltag.''; print ''; print ''; print ''."\n"; + // Add download link + if (GETPOST('download','int') > 0) + { + print ''.$langs->trans("Document"); + print ''; + print $invoice->getDirectExternalLink(1); + print ''."\n"; + } + // Shipping address $shipToName=$invoice->thirdparty->name; $shipToStreet=$invoice->thirdparty->address;