Add link to pay online into sponge template.
This commit is contained in:
parent
1d4a803d8d
commit
41577714ce
@ -1059,7 +1059,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
// Show payment mode CHQ
|
// Show payment mode CHQ
|
||||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
||||||
{
|
{
|
||||||
// If unregulated or forced payment mode to CHQ
|
// If payment mode unregulated or payment mode forced to CHQ
|
||||||
if (!empty($conf->global->FACTURE_CHQ_NUMBER))
|
if (!empty($conf->global->FACTURE_CHQ_NUMBER))
|
||||||
{
|
{
|
||||||
$diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
|
$diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
|
||||||
|
|||||||
@ -1124,13 +1124,27 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
$lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
|
$lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
|
||||||
$pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L');
|
$pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L');
|
||||||
|
|
||||||
|
// Show online payment link
|
||||||
|
$useonlinepayment = ((! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled)) && !empty($conf->global->PDF_SHOW_LINK_TO_ONLINE_PAYMENT));
|
||||||
|
if ($object->mode_reglement_code == 'CB' || $object->mode_reglement_code == 'VAD' && $object->statut != Facture::STATUS_DRAFT && $useonlinepayment) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
$langs->loadLangs(array('payment', 'paybox'));
|
||||||
|
$servicename=$langs->transnoentities('Online');
|
||||||
|
$paiement_url = getOnlinePaymentUrl('', 'invoice', $object->ref, '', '', '');
|
||||||
|
$linktopay = $langs->trans("ToOfferALinkForOnlinePayment", $servicename).' <a href="'.$paiement_url.'">'.$outputlangs->transnoentities("ClickHere").'</a>';
|
||||||
|
|
||||||
|
$pdf->writeHTMLCell(80, 10, '', '', dol_htmlentitiesbr($linktopay), 0, 1);
|
||||||
|
}
|
||||||
|
|
||||||
$posy=$pdf->GetY()+2;
|
$posy=$pdf->GetY()+2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show payment mode CHQ
|
// Show payment mode CHQ
|
||||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
||||||
{
|
{
|
||||||
// If payment mode not forced or forced to CHQ
|
// If payment mode unregulated or payment mode forced to CHQ
|
||||||
if (! empty($conf->global->FACTURE_CHQ_NUMBER))
|
if (! empty($conf->global->FACTURE_CHQ_NUMBER))
|
||||||
{
|
{
|
||||||
$diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE);
|
$diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user