This commit is contained in:
James Cole
2020-05-23 19:54:02 +02:00
parent c2e542004d
commit 0783500eaa
2 changed files with 2 additions and 2 deletions

View File

@@ -132,6 +132,7 @@ class BudgetLimitController extends Controller
*/ */
public function store(Request $request) public function store(Request $request)
{ {
Log::debug('Going to store new budget-limit.', $request->all());
// first search for existing one and update it if necessary. // first search for existing one and update it if necessary.
$currency = $this->currencyRepos->find((int) $request->get('transaction_currency_id')); $currency = $this->currencyRepos->find((int) $request->get('transaction_currency_id'));
$budget = $this->repository->findNull((int) $request->get('budget_id')); $budget = $this->repository->findNull((int) $request->get('budget_id'));
@@ -143,7 +144,6 @@ class BudgetLimitController extends Controller
$start->startOfDay(); $start->startOfDay();
$end->endOfDay(); $end->endOfDay();
Log::debug(sprintf('Start: %s, end: %s', $start->format('Y-m-d H:i:s'), $end->format('Y-m-d H:i:s'))); Log::debug(sprintf('Start: %s, end: %s', $start->format('Y-m-d H:i:s'), $end->format('Y-m-d H:i:s')));
$limit = $this->blRepository->find($budget, $currency, $start, $end); $limit = $this->blRepository->find($budget, $currency, $start, $end);

View File

@@ -330,7 +330,7 @@ class BudgetRepository implements BudgetRepositoryInterface
// create initial budget limit. // create initial budget limit.
$today = new Carbon; $today = new Carbon;
$start = app('navigation')->startOfPeriod($today, $autoBudget->period); $start = app('navigation')->startOfPeriod($today, $autoBudget->period);
$end = app('navigation')->startOfPeriod($start, $autoBudget->period); $end = app('navigation')->endOfPeriod($start, $autoBudget->period);
$limitRepos = app(BudgetLimitRepositoryInterface::class); $limitRepos = app(BudgetLimitRepositoryInterface::class);
$limitRepos->setUser($this->user); $limitRepos->setUser($this->user);