Merge pull request #12899 from mapiolca/patch-22
# New Add Link to Pay if Online payment is used
This commit is contained in:
commit
1d4a803d8d
@ -1037,6 +1037,21 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->SetXY($posxval, $posy);
|
||||
$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');
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user