mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-09 03:08:09 +00:00
Fixed various bugs that made tests fail.
This commit is contained in:
@@ -366,6 +366,9 @@ class Budget implements CUD, CommonDatabaseCalls, BudgetInterface
|
|||||||
*/
|
*/
|
||||||
public function limitOnStartingOnDate(\Budget $budget, Carbon $date)
|
public function limitOnStartingOnDate(\Budget $budget, Carbon $date)
|
||||||
{
|
{
|
||||||
return $budget->budgetLimits()->where('startdate', $date->format('Y-m-d'))->first();
|
return $budget->budgetLimits()->where('startdate', $date->format('Y-m-d 00:00:00'))->first();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ class Budget extends Eloquent
|
|||||||
*/
|
*/
|
||||||
public function budgetlimits()
|
public function budgetlimits()
|
||||||
{
|
{
|
||||||
return $this->hasMany('BudgetLimit', 'budget_id');
|
return $this->hasMany('BudgetLimit');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Database\Eloquent\Model as Eloquent;
|
||||||
use Illuminate\Database\QueryException;
|
use Illuminate\Database\QueryException;
|
||||||
use Watson\Validating\ValidatingTrait;
|
use Watson\Validating\ValidatingTrait;
|
||||||
use \Illuminate\Database\Eloquent\Model as Eloquent;
|
|
||||||
/**
|
/**
|
||||||
* Class Limit
|
* Class Limit
|
||||||
*/
|
*/
|
||||||
@@ -27,7 +28,7 @@ class BudgetLimit extends Eloquent
|
|||||||
*/
|
*/
|
||||||
public function budget()
|
public function budget()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('Budget','budget_id');
|
return $this->belongsTo('Budget');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class Category extends Eloquent
|
|||||||
*/
|
*/
|
||||||
public function transactionjournals()
|
public function transactionjournals()
|
||||||
{
|
{
|
||||||
return $this->belongsToMany('TransactionJournal', 'budget_transaction_journal', 'budget_id');
|
return $this->belongsToMany('TransactionJournal', 'category_transaction_journal', 'category_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user