James Cole 2023-04-01 10:44:09 +02:00
parent dea6e2c83f
commit 328216534b
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
2 changed files with 3 additions and 1 deletions

View File

@ -49,6 +49,8 @@ use Illuminate\Support\Carbon;
* @method static Builder|UserGroup whereId($value)
* @method static Builder|UserGroup whereTitle($value)
* @method static Builder|UserGroup whereUpdatedAt($value)
* @property-read Collection<int, \FireflyIII\Models\Account> $accounts
* @property-read int|null $accounts_count
* @mixin Eloquent
*/
class UserGroup extends Model

View File

@ -178,7 +178,7 @@ trait ModifiesPiggyBanks
return $piggyBank;
}
$max = $piggyBank->targetamount;
if (1 === bccomp($amount, $max)) {
if (1 === bccomp($amount, $max) && 0 !== bccomp($piggyBank->targetamount, '0')) {
$amount = $max;
}
$difference = bcsub($amount, $repetition->currentamount);