mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Merge branch 'develop' into 5.8-dev
This commit is contained in:
@@ -458,7 +458,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
//Log::debug(sprintf('Dates = %d, journalCount = %d, total = %d', $dates->count(), $count, $total));
|
||||
|
||||
if ($total > 0) {
|
||||
$average = bcdiv(bcadd($bill->amount_max, $bill->amount_min), '2');
|
||||
$average = bcdiv(bcadd((string) $bill->amount_max, (string) $bill->amount_min), '2');
|
||||
$multi = bcmul($average, (string) $total);
|
||||
$return[$currencyId] = $return[$currencyId] ?? '0';
|
||||
$return[$currencyId] = bcadd($return[$currencyId], $multi);
|
||||
|
@@ -341,7 +341,8 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
|
||||
}
|
||||
if (null !== $piggyBank->targetdate && $repetition->currentamount < $piggyBank->targetamount) {
|
||||
$now = Carbon::now();
|
||||
$diffInMonths = $now->diffInMonths($piggyBank->targetdate, false);
|
||||
$startDate = null !== $piggyBank->startdate && $piggyBank->startdate->gte($now) ? $piggyBank->startdate : $now;
|
||||
$diffInMonths = $startDate->diffInMonths($piggyBank->targetdate, false);
|
||||
$remainingAmount = bcsub($piggyBank->targetamount, $repetition->currentamount);
|
||||
|
||||
// more than 1 month to go and still need money to save:
|
||||
|
@@ -353,7 +353,7 @@ class TransactionGroupTransformer extends AbstractTransformer
|
||||
$source = $this->getSourceTransaction($journal);
|
||||
$destination = $this->getDestinationTransaction($journal);
|
||||
$type = $journal->transactionType->type;
|
||||
$amount = $this->getAmount($type, $source->amount);
|
||||
$amount = $this->getAmount($type, (string) $source->amount);
|
||||
$foreignAmount = $this->getForeignAmount($type, $source->foreign_amount);
|
||||
$metaFieldData = $this->groupRepos->getMetaFields($journal->id, $this->metaFields);
|
||||
$metaDates = $this->getDates($this->groupRepos->getMetaDateFields($journal->id, $this->metaDateFields));
|
||||
|
Reference in New Issue
Block a user