Merge branch 'develop' into 5.8-dev

This commit is contained in:
James Cole
2022-12-26 06:24:50 +01:00
2 changed files with 5 additions and 2 deletions

View File

@@ -107,6 +107,9 @@ class Steam
if(null === $number) { if(null === $number) {
return '0'; return '0';
} }
if('' === trim($number)) {
return '0';
}
if (str_contains($number, '.')) { if (str_contains($number, '.')) {
if ($number[0] !== '-') { if ($number[0] !== '-') {
return bcadd($number, '0.'.str_repeat('0', $precision).'5', $precision); return bcadd($number, '0.'.str_repeat('0', $precision).'5', $precision);

View File

@@ -89,7 +89,7 @@ class UpdatePiggybank implements ActionInterface
if ((int)$source->account_id === (int)$piggyBank->account_id) { if ((int)$source->account_id === (int)$piggyBank->account_id) {
Log::debug('Piggy bank account is linked to source, so remove amount from piggy bank.'); Log::debug('Piggy bank account is linked to source, so remove amount from piggy bank.');
$this->removeAmount($journal, $piggyBank, $destination->amount); $this->removeAmount($piggyBank, $journalObj, $destination->amount);
event(new TriggeredAuditLog($this->action->rule, $journalObj, 'remove_from_piggy', null, ['currency_symbol' => $journalObj->transactionCurrency->symbol, 'decimal_places' => $journalObj->transactionCurrency->decimal_places, 'amount' => $destination->amount, 'piggy' => $piggyBank->name])); event(new TriggeredAuditLog($this->action->rule, $journalObj, 'remove_from_piggy', null, ['currency_symbol' => $journalObj->transactionCurrency->symbol, 'decimal_places' => $journalObj->transactionCurrency->decimal_places, 'amount' => $destination->amount, 'piggy' => $piggyBank->name]));
@@ -97,7 +97,7 @@ class UpdatePiggybank implements ActionInterface
} }
if ((int)$destination->account_id === (int)$piggyBank->account_id) { if ((int)$destination->account_id === (int)$piggyBank->account_id) {
Log::debug('Piggy bank account is linked to source, so add amount to piggy bank.'); Log::debug('Piggy bank account is linked to source, so add amount to piggy bank.');
$this->addAmount($journal, $piggyBank, $destination->amount); $this->addAmount($piggyBank, $journalObj, $destination->amount);
event(new TriggeredAuditLog($this->action->rule, $journalObj, 'add_to_piggy', null, ['currency_symbol' => $journalObj->transactionCurrency->symbol, 'decimal_places' => $journalObj->transactionCurrency->decimal_places, 'amount' => $destination->amount, 'piggy' => $piggyBank->name])); event(new TriggeredAuditLog($this->action->rule, $journalObj, 'add_to_piggy', null, ['currency_symbol' => $journalObj->transactionCurrency->symbol, 'decimal_places' => $journalObj->transactionCurrency->decimal_places, 'amount' => $destination->amount, 'piggy' => $piggyBank->name]));