Set default payment notifications for new companies

This commit is contained in:
David Bomba 2024-02-14 16:23:37 +11:00
parent 9bbeddb913
commit dba0bab91e
2 changed files with 3 additions and 3 deletions

View File

@ -878,7 +878,7 @@ class CompanySettings extends BaseSettings
{
$notification = new stdClass();
$notification->email = [];
$notification->email = ['invoice_sent_all'];
$notification->email = ['invoice_sent_all','payment_success_all','payment_manual_all'];
return $notification;
}

View File

@ -112,8 +112,8 @@ class TransactionTransformer implements BankRevenueInterface
// enrich description with currencyExchange informations
if (array_key_exists('currencyExchange', $transaction)) {
foreach ($transaction["currencyExchange"] as $exchangeRate) {
$targetAmount = round($amount * (float) $exchangeRate["exchangeRate"], 2);
$description .= '\nexchangeRate: ' . $amount . " " . $exchangeRate["sourceCurrency"] . " = " . $targetAmount . " " . $exchangeRate["targetCurrency"] . " (" . $exchangeRate["quotationDate"] . ")";
$targetAmount = round($amount * (float) ($exchangeRate["exchangeRate"] ?? 1) , 2);
$description .= '\nexchangeRate: ' . $amount . " " . ($exchangeRate["sourceCurrency"] ?? '?') . " = " . $targetAmount . " " . ($exchangeRate["targetCurrency"] ?? '?') . " (" . ($exchangeRate["quotationDate"] ?? '?') . ")";
}
}