mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
This commit is contained in:
parent
b1c1bbd6c0
commit
26f7575ba2
@ -36,6 +36,7 @@ use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface;
|
||||
use FireflyIII\Repositories\Budget\OperationsRepositoryInterface;
|
||||
use FireflyIII\Repositories\UserGroups\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Support\CacheProperties;
|
||||
use FireflyIII\Support\Http\Controllers\DateCalculation;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
/**
|
||||
@ -43,6 +44,7 @@ use Illuminate\Http\JsonResponse;
|
||||
*/
|
||||
class BoxController extends Controller
|
||||
{
|
||||
use DateCalculation;
|
||||
/**
|
||||
* This box has three types of info to display:
|
||||
* 0) If the user has available amount this period and has overspent: overspent box.
|
||||
@ -125,9 +127,9 @@ class BoxController extends Controller
|
||||
if (bccomp($leftToSpendAmount, '0') >= 0) {
|
||||
app('log')->debug('Left to spend is positive or zero!');
|
||||
$boxTitle = (string)trans('firefly.left_to_spend');
|
||||
$days = $today->diffInDays($end) + 1;
|
||||
$activeDaysLeft = $this->activeDaysLeft($start, $end); // see method description.
|
||||
$display = 1; // not overspent
|
||||
$leftPerDayAmount = bcdiv($leftToSpendAmount, (string)$days);
|
||||
$leftPerDayAmount = bcdiv($leftToSpendAmount, (string)$activeDaysLeft);
|
||||
app('log')->debug(sprintf('Left to spend per day is %s', $leftPerDayAmount));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user