Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2023-04-05 16:34:44 +02:00
commit 7d0a025039
2 changed files with 21 additions and 20 deletions

View File

@ -8040,6 +8040,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
// Set the online payment url link into __ONLINE_PAYMENT_URL__ key // Set the online payment url link into __ONLINE_PAYMENT_URL__ key
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$outputlangs->loadLangs(array('paypal', 'other')); $outputlangs->loadLangs(array('paypal', 'other'));
$amounttouse = 0;
$typeforonlinepayment = 'free'; $typeforonlinepayment = 'free';
if (is_object($object) && $object->element == 'commande') { if (is_object($object) && $object->element == 'commande') {
$typeforonlinepayment = 'order'; $typeforonlinepayment = 'order';
@ -8049,7 +8051,6 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
} }
if (is_object($object) && $object->element == 'member') { if (is_object($object) && $object->element == 'member') {
$typeforonlinepayment = 'member'; $typeforonlinepayment = 'member';
$amounttouse = 0;
if (!empty($object->last_subscription_amount)) { if (!empty($object->last_subscription_amount)) {
$amounttouse = $object->last_subscription_amount; $amounttouse = $object->last_subscription_amount;
} }

View File

@ -189,10 +189,10 @@ function getValidOnlinePaymentMethods($paymentmethod = '')
* *
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member' ...) * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member' ...)
* @param string $ref Ref of object * @param string $ref Ref of object
* @param int $amount Amount of money to request for * @param int|float $amount Amount of money to request for
* @return string Url string * @return string Url string
*/ */
function showOnlinePaymentUrl($type, $ref, $amount = '9.99') function showOnlinePaymentUrl($type, $ref, $amount = 0)
{ {
global $langs; global $langs;
@ -216,10 +216,10 @@ function showOnlinePaymentUrl($type, $ref, $amount = '9.99')
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member' ...) * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member' ...)
* @param string $ref Ref of object * @param string $ref Ref of object
* @param string $label Text or HTML tag to display, if empty it display the URL * @param string $label Text or HTML tag to display, if empty it display the URL
* @param int $amount Amount of money to request for * @param int|float $amount Amount of money to request for
* @return string Url string * @return string Url string
*/ */
function getHtmlOnlinePaymentLink($type, $ref, $label = '', $amount = '9.99') function getHtmlOnlinePaymentLink($type, $ref, $label = '', $amount = 0)
{ {
$url = getOnlinePaymentUrl(0, $type, $ref, $amount); $url = getOnlinePaymentUrl(0, $type, $ref, $amount);
$label = $label ? $label : $url; $label = $label ? $label : $url;
@ -233,12 +233,12 @@ function getHtmlOnlinePaymentLink($type, $ref, $label = '', $amount = '9.99')
* @param int $mode 0=True url, 1=Url formated with colors * @param int $mode 0=True url, 1=Url formated with colors
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member', 'boothlocation', ...) * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member', 'boothlocation', ...)
* @param string $ref Ref of object * @param string $ref Ref of object
* @param int $amount Amount of money to request for * @param int|float $amount Amount of money to request for
* @param string $freetag Free tag (required and used for $type='free' only) * @param string $freetag Free tag (required and used for $type='free' only)
* @param string $localorexternal 0=Url for browser, 1=Url for external access * @param string $localorexternal 0=Url for browser, 1=Url for external access
* @return string Url string * @return string Url string
*/ */
function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag = 'your_tag', $localorexternal = 1) function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = 0, $freetag = 'your_tag', $localorexternal = 1)
{ {
global $conf, $dolibarr_main_url_root; global $conf, $dolibarr_main_url_root;