Debug multicurrency
This commit is contained in:
parent
f509c6a266
commit
3c572c1909
@ -148,7 +148,10 @@ elseif ($action == 'setapilayer')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MultiCurrency::syncRates($conf->global->MULTICURRENCY_APP_ID);
|
$result = MultiCurrency::syncRates($conf->global->MULTICURRENCY_APP_ID);
|
||||||
|
if ($result > 0) {
|
||||||
|
setEventMessages($langs->trans("CurrencyRateSyncSucceed"), null, "mesgs");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -18,3 +18,5 @@ MulticurrencyReceived=Received, original currency
|
|||||||
MulticurrencyRemainderToTake=Remaining amount, original currency
|
MulticurrencyRemainderToTake=Remaining amount, original currency
|
||||||
MulticurrencyPaymentAmount=Payment amount, original currency
|
MulticurrencyPaymentAmount=Payment amount, original currency
|
||||||
AmountToOthercurrency=Amount To (in currency of receiving account)
|
AmountToOthercurrency=Amount To (in currency of receiving account)
|
||||||
|
CurrencyRateSyncSucceed=Currency rate synchronization done successfuly
|
||||||
|
MULTICURRENCY_USE_CURRENCY_ON_DOCUMENT=Use the currency of the document for online payments
|
||||||
|
|||||||
@ -628,11 +628,11 @@ class MultiCurrency extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sync rates from api
|
* Sync rates from API
|
||||||
*
|
*
|
||||||
* @param string $key Key to use. Come from $conf->global->MULTICURRENCY_APP_ID.
|
* @param string $key Key to use. Come from $conf->global->MULTICURRENCY_APP_ID.
|
||||||
* @param int $addifnotfound Add if not found
|
* @param int $addifnotfound Add if not found
|
||||||
* @return void
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
public static function syncRates($key, $addifnotfound = 0)
|
public static function syncRates($key, $addifnotfound = 0)
|
||||||
{
|
{
|
||||||
@ -672,11 +672,15 @@ class MultiCurrency extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_syslog("Failed to call endpoint ".$response->error->info, LOG_WARNING);
|
dol_syslog("Failed to call endpoint ".$response->error->info, LOG_WARNING);
|
||||||
setEventMessages($langs->trans('multicurrency_syncronize_error', $response->error->info), null, 'errors');
|
setEventMessages($langs->trans('multicurrency_syncronize_error', $response->error->info), null, 'errors');
|
||||||
|
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user