mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-24 14:46:37 +00:00
Merge branch 'release/3.4.0.5'
This commit is contained in:
@@ -15,4 +15,5 @@ EMAIL_SMTP=
|
|||||||
EMAIL_DRIVER=smtp
|
EMAIL_DRIVER=smtp
|
||||||
EMAIL_USERNAME=
|
EMAIL_USERNAME=
|
||||||
EMAIL_PASSWORD=
|
EMAIL_PASSWORD=
|
||||||
ANALYTICS_ID=
|
ANALYTICS_ID=
|
||||||
|
EMAIL_PRETEND=false
|
@@ -14,4 +14,5 @@ SESSION_DRIVER=array
|
|||||||
EMAIL_SMTP=
|
EMAIL_SMTP=
|
||||||
EMAIL_USERNAME=
|
EMAIL_USERNAME=
|
||||||
EMAIL_PASSWORD=
|
EMAIL_PASSWORD=
|
||||||
ANALYTICS_ID=ABC
|
ANALYTICS_ID=ABC
|
||||||
|
EMAIL_PRETEND=true
|
@@ -1,5 +1,5 @@
|
|||||||
# Firefly III
|
# Firefly III
|
||||||
#### v3.4.0.4
|
#### v3.4.0.5
|
||||||
|
|
||||||
[](https://travis-ci.org/JC5/firefly-iii)
|
[](https://travis-ci.org/JC5/firefly-iii)
|
||||||
[](http://stillmaintained.com/JC5/firefly-iii)
|
[](http://stillmaintained.com/JC5/firefly-iii)
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Class Command
|
* Class Command
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Commands
|
* @package FireflyIII\Commands
|
||||||
*/
|
*/
|
||||||
abstract class Command
|
abstract class Command
|
||||||
|
@@ -6,6 +6,7 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
|||||||
/**
|
/**
|
||||||
* Class Kernel
|
* Class Kernel
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Console
|
* @package FireflyIII\Console
|
||||||
*/
|
*/
|
||||||
class Kernel extends ConsoleKernel
|
class Kernel extends ConsoleKernel
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
/**
|
/**
|
||||||
* Class Event
|
* Class Event
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Events
|
* @package FireflyIII\Events
|
||||||
*/
|
*/
|
||||||
abstract class Event
|
abstract class Event
|
||||||
|
@@ -6,6 +6,7 @@ use Illuminate\Queue\SerializesModels;
|
|||||||
/**
|
/**
|
||||||
* Class JournalCreated
|
* Class JournalCreated
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Events
|
* @package FireflyIII\Events
|
||||||
*/
|
*/
|
||||||
class JournalCreated extends Event
|
class JournalCreated extends Event
|
||||||
|
@@ -5,6 +5,7 @@ use Illuminate\Queue\SerializesModels;
|
|||||||
/**
|
/**
|
||||||
* Class JournalDeleted
|
* Class JournalDeleted
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Events
|
* @package FireflyIII\Events
|
||||||
*/
|
*/
|
||||||
class JournalDeleted extends Event
|
class JournalDeleted extends Event
|
||||||
|
@@ -6,6 +6,7 @@ use Illuminate\Queue\SerializesModels;
|
|||||||
/**
|
/**
|
||||||
* Class JournalSaved
|
* Class JournalSaved
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Events
|
* @package FireflyIII\Events
|
||||||
*/
|
*/
|
||||||
class JournalSaved extends Event
|
class JournalSaved extends Event
|
||||||
|
@@ -6,6 +6,7 @@ namespace FireflyIII\Exceptions;
|
|||||||
/**
|
/**
|
||||||
* Class FireflyException
|
* Class FireflyException
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Exceptions
|
* @package FireflyIII\Exceptions
|
||||||
*/
|
*/
|
||||||
class FireflyException extends \Exception
|
class FireflyException extends \Exception
|
||||||
|
@@ -6,6 +6,7 @@ use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
|||||||
/**
|
/**
|
||||||
* Class Handler
|
* Class Handler
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Exceptions
|
* @package FireflyIII\Exceptions
|
||||||
*/
|
*/
|
||||||
class Handler extends ExceptionHandler
|
class Handler extends ExceptionHandler
|
||||||
|
@@ -5,6 +5,7 @@ namespace FireflyIII\Exceptions;
|
|||||||
/**
|
/**
|
||||||
* Class NotImplementedException
|
* Class NotImplementedException
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Exceptions
|
* @package FireflyIII\Exceptions
|
||||||
*/
|
*/
|
||||||
class NotImplementedException extends \Exception
|
class NotImplementedException extends \Exception
|
||||||
|
@@ -4,6 +4,7 @@ namespace FireflyIII\Exceptions;
|
|||||||
/**
|
/**
|
||||||
* Class ValidationExceptions
|
* Class ValidationExceptions
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Exception
|
* @package FireflyIII\Exception
|
||||||
*/
|
*/
|
||||||
class ValidationException extends \Exception
|
class ValidationException extends \Exception
|
||||||
|
@@ -5,6 +5,7 @@ use FireflyIII\Events\JournalDeleted;
|
|||||||
/**
|
/**
|
||||||
* Class JournalDeletedHandler
|
* Class JournalDeletedHandler
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Handlers\Events
|
* @package FireflyIII\Handlers\Events
|
||||||
*/
|
*/
|
||||||
class JournalDeletedHandler
|
class JournalDeletedHandler
|
||||||
|
@@ -38,6 +38,7 @@ class AuthController extends Controller
|
|||||||
*
|
*
|
||||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||||
* @param \Illuminate\Contracts\Auth\Registrar $registrar
|
* @param \Illuminate\Contracts\Auth\Registrar $registrar
|
||||||
|
* @codeCoverageIgnore
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function __construct(Guard $auth, Registrar $registrar)
|
public function __construct(Guard $auth, Registrar $registrar)
|
||||||
@@ -51,7 +52,9 @@ class AuthController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Show the application login form.
|
* Show the application login form.
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public function getLogin()
|
public function getLogin()
|
||||||
{
|
{
|
||||||
@@ -73,7 +76,9 @@ class AuthController extends Controller
|
|||||||
$this->throwValidationException(
|
$this->throwValidationException(
|
||||||
$request, $validator
|
$request, $validator
|
||||||
);
|
);
|
||||||
|
// @codeCoverageIgnoreStart
|
||||||
}
|
}
|
||||||
|
// @codeCoverageIgnoreEnd
|
||||||
|
|
||||||
$data = $request->all();
|
$data = $request->all();
|
||||||
$data['password'] = bcrypt($data['password']);
|
$data['password'] = bcrypt($data['password']);
|
||||||
|
@@ -7,7 +7,7 @@ use Illuminate\Foundation\Auth\ResetsPasswords;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PasswordController
|
* Class PasswordController
|
||||||
*
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Http\Controllers\Auth
|
* @package FireflyIII\Http\Controllers\Auth
|
||||||
*/
|
*/
|
||||||
class PasswordController extends Controller
|
class PasswordController extends Controller
|
||||||
|
@@ -187,17 +187,6 @@ class GoogleChartController extends Controller
|
|||||||
if ($entry[1] != 0 || $entry[2] != 0 || $entry[3] != 0) {
|
if ($entry[1] != 0 || $entry[2] != 0 || $entry[3] != 0) {
|
||||||
$chart->addRow($entry[0], $entry[1], $entry[2], $entry[3]);
|
$chart->addRow($entry[0], $entry[1], $entry[2], $entry[3]);
|
||||||
}
|
}
|
||||||
// if ($entry[2] > 0) {
|
|
||||||
// $left = $entry[1] - $entry[2];
|
|
||||||
// if ($left > 0) {
|
|
||||||
// $chart->addRow($entry[0], $left, null);
|
|
||||||
// } else {
|
|
||||||
// if ($left < 0) {
|
|
||||||
// $chart->addRow($entry[0], null, $left);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$chart->generate();
|
$chart->generate();
|
||||||
|
@@ -7,6 +7,7 @@ use Illuminate\Http\Request;
|
|||||||
/**
|
/**
|
||||||
* Class Authenticate
|
* Class Authenticate
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Http\Middleware
|
* @package FireflyIII\Http\Middleware
|
||||||
*/
|
*/
|
||||||
class Authenticate
|
class Authenticate
|
||||||
|
@@ -8,6 +8,7 @@ use Illuminate\Http\Request;
|
|||||||
/**
|
/**
|
||||||
* Class RedirectIfAuthenticated
|
* Class RedirectIfAuthenticated
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Http\Middleware
|
* @package FireflyIII\Http\Middleware
|
||||||
*/
|
*/
|
||||||
class RedirectIfAuthenticated
|
class RedirectIfAuthenticated
|
||||||
|
@@ -10,6 +10,7 @@ use Log;
|
|||||||
/**
|
/**
|
||||||
* Class ReplaceTestVars
|
* Class ReplaceTestVars
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Http\Middleware
|
* @package FireflyIII\Http\Middleware
|
||||||
*/
|
*/
|
||||||
class ReplaceTestVars
|
class ReplaceTestVars
|
||||||
|
@@ -6,6 +6,7 @@ use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
|||||||
/**
|
/**
|
||||||
* Class VerifyCsrfToken
|
* Class VerifyCsrfToken
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Http\Middleware
|
* @package FireflyIII\Http\Middleware
|
||||||
*/
|
*/
|
||||||
class VerifyCsrfToken extends BaseVerifier
|
class VerifyCsrfToken extends BaseVerifier
|
||||||
|
@@ -10,6 +10,7 @@ use Input;
|
|||||||
/**
|
/**
|
||||||
* Class AccountFormRequest
|
* Class AccountFormRequest
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Http\Requests
|
* @package FireflyIII\Http\Requests
|
||||||
*/
|
*/
|
||||||
class AccountFormRequest extends Request
|
class AccountFormRequest extends Request
|
||||||
|
@@ -9,6 +9,7 @@ use Input;
|
|||||||
/**
|
/**
|
||||||
* Class BillFormRequest
|
* Class BillFormRequest
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Http\Requests
|
* @package FireflyIII\Http\Requests
|
||||||
*/
|
*/
|
||||||
class BillFormRequest extends Request
|
class BillFormRequest extends Request
|
||||||
|
@@ -9,6 +9,7 @@ use Input;
|
|||||||
/**
|
/**
|
||||||
* Class BudgetFormRequest
|
* Class BudgetFormRequest
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Http\Requests
|
* @package FireflyIII\Http\Requests
|
||||||
*/
|
*/
|
||||||
class BudgetFormRequest extends Request
|
class BudgetFormRequest extends Request
|
||||||
|
@@ -9,6 +9,7 @@ use Input;
|
|||||||
/**
|
/**
|
||||||
* Class CategoryFormRequest
|
* Class CategoryFormRequest
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Http\Requests
|
* @package FireflyIII\Http\Requests
|
||||||
*/
|
*/
|
||||||
class CategoryFormRequest extends Request
|
class CategoryFormRequest extends Request
|
||||||
|
@@ -8,6 +8,7 @@ use Input;
|
|||||||
/**
|
/**
|
||||||
* Class BillFormRequest
|
* Class BillFormRequest
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Http\Requests
|
* @package FireflyIII\Http\Requests
|
||||||
*/
|
*/
|
||||||
class CurrencyFormRequest extends Request
|
class CurrencyFormRequest extends Request
|
||||||
|
@@ -7,6 +7,7 @@ use Auth;
|
|||||||
/**
|
/**
|
||||||
* Class DeleteAccountFormRequest
|
* Class DeleteAccountFormRequest
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Http\Requests
|
* @package FireflyIII\Http\Requests
|
||||||
*/
|
*/
|
||||||
class DeleteAccountFormRequest extends Request
|
class DeleteAccountFormRequest extends Request
|
||||||
|
@@ -10,6 +10,7 @@ use Input;
|
|||||||
/**
|
/**
|
||||||
* Class JournalFormRequest
|
* Class JournalFormRequest
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Http\Requests
|
* @package FireflyIII\Http\Requests
|
||||||
*/
|
*/
|
||||||
class JournalFormRequest extends Request
|
class JournalFormRequest extends Request
|
||||||
|
@@ -8,6 +8,7 @@ use Input;
|
|||||||
/**
|
/**
|
||||||
* Class PiggyBankFormRequest
|
* Class PiggyBankFormRequest
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Http\Requests
|
* @package FireflyIII\Http\Requests
|
||||||
*/
|
*/
|
||||||
class PiggyBankFormRequest extends Request
|
class PiggyBankFormRequest extends Request
|
||||||
|
@@ -7,6 +7,7 @@ use Auth;
|
|||||||
/**
|
/**
|
||||||
* Class ProfileFormRequest
|
* Class ProfileFormRequest
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Http\Requests
|
* @package FireflyIII\Http\Requests
|
||||||
*/
|
*/
|
||||||
class ProfileFormRequest extends Request
|
class ProfileFormRequest extends Request
|
||||||
|
@@ -5,6 +5,7 @@ use Illuminate\Foundation\Http\FormRequest;
|
|||||||
/**
|
/**
|
||||||
* Class Request
|
* Class Request
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Http\Requests
|
* @package FireflyIII\Http\Requests
|
||||||
*/
|
*/
|
||||||
abstract class Request extends FormRequest
|
abstract class Request extends FormRequest
|
||||||
|
@@ -15,6 +15,7 @@ use Input;
|
|||||||
/**
|
/**
|
||||||
* Class TagFormRequest
|
* Class TagFormRequest
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Http\Requests
|
* @package FireflyIII\Http\Requests
|
||||||
*/
|
*/
|
||||||
class TagFormRequest extends Request
|
class TagFormRequest extends Request
|
||||||
|
@@ -319,7 +319,7 @@ Breadcrumbs::register(
|
|||||||
|
|
||||||
Breadcrumbs::register(
|
Breadcrumbs::register(
|
||||||
'reports.month', function (Generator $breadcrumbs, Carbon $date) {
|
'reports.month', function (Generator $breadcrumbs, Carbon $date) {
|
||||||
$breadcrumbs->parent('reports.index');
|
$breadcrumbs->parent('reports.year', $date);
|
||||||
$breadcrumbs->push('Monthly report for ' . $date->format('F Y'), route('reports.month', [$date->year, $date->month]));
|
$breadcrumbs->push('Monthly report for ' . $date->format('F Y'), route('reports.month', [$date->year, $date->month]));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@@ -29,6 +29,7 @@ class Account extends Model
|
|||||||
/**
|
/**
|
||||||
* @param array $fields
|
* @param array $fields
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* @return Account|null
|
* @return Account|null
|
||||||
*/
|
*/
|
||||||
public static function firstOrCreateEncrypted(array $fields)
|
public static function firstOrCreateEncrypted(array $fields)
|
||||||
@@ -86,6 +87,7 @@ class Account extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
*/
|
*/
|
||||||
public function accountMeta()
|
public function accountMeta()
|
||||||
@@ -94,6 +96,7 @@ class Account extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
public function accountType()
|
public function accountType()
|
||||||
@@ -102,6 +105,7 @@ class Account extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
@@ -110,6 +114,7 @@ class Account extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @param $fieldName
|
* @param $fieldName
|
||||||
*
|
*
|
||||||
* @return string|null
|
* @return string|null
|
||||||
@@ -127,6 +132,7 @@ class Account extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
@@ -144,6 +150,7 @@ class Account extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
*/
|
*/
|
||||||
public function piggyBanks()
|
public function piggyBanks()
|
||||||
@@ -152,6 +159,7 @@ class Account extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param EloquentBuilder $query
|
* @param EloquentBuilder $query
|
||||||
* @param array $types
|
* @param array $types
|
||||||
*/
|
*/
|
||||||
@@ -165,6 +173,7 @@ class Account extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param EloquentBuilder $query
|
* @param EloquentBuilder $query
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @param string $value
|
* @param string $value
|
||||||
@@ -181,6 +190,7 @@ class Account extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
public function setNameAttribute($value)
|
public function setNameAttribute($value)
|
||||||
@@ -190,6 +200,7 @@ class Account extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
*/
|
*/
|
||||||
public function transactions()
|
public function transactions()
|
||||||
@@ -198,6 +209,7 @@ class Account extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
public function user()
|
public function user()
|
||||||
|
@@ -6,6 +6,7 @@ use Watson\Validating\ValidatingTrait;
|
|||||||
/**
|
/**
|
||||||
* Class AccountMeta
|
* Class AccountMeta
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class AccountMeta extends Model
|
class AccountMeta extends Model
|
||||||
@@ -22,6 +23,7 @@ class AccountMeta extends Model
|
|||||||
protected $table = 'account_meta';
|
protected $table = 'account_meta';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
public function account()
|
public function account()
|
||||||
|
@@ -5,6 +5,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
/**
|
/**
|
||||||
* Class AccountType
|
* Class AccountType
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class AccountType extends Model
|
class AccountType extends Model
|
||||||
|
@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
/**
|
/**
|
||||||
* Class Budget
|
* Class Budget
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class Budget extends Model
|
class Budget extends Model
|
||||||
@@ -17,6 +18,7 @@ class Budget extends Model
|
|||||||
protected $fillable = ['user_id', 'name'];
|
protected $fillable = ['user_id', 'name'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
*/
|
*/
|
||||||
public function budgetlimits()
|
public function budgetlimits()
|
||||||
|
@@ -5,6 +5,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
/**
|
/**
|
||||||
* Class BudgetLimit
|
* Class BudgetLimit
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class BudgetLimit extends Model
|
class BudgetLimit extends Model
|
||||||
|
@@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
/**
|
/**
|
||||||
* Class Category
|
* Class Category
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class Category extends Model
|
class Category extends Model
|
||||||
@@ -17,6 +18,7 @@ class Category extends Model
|
|||||||
protected $fillable = ['user_id', 'name'];
|
protected $fillable = ['user_id', 'name'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
@@ -25,6 +27,7 @@ class Category extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
*/
|
*/
|
||||||
public function transactionjournals()
|
public function transactionjournals()
|
||||||
@@ -66,6 +69,7 @@ class Category extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
public function user()
|
public function user()
|
||||||
@@ -74,6 +78,7 @@ class Category extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
public function setNameAttribute($value)
|
public function setNameAttribute($value)
|
||||||
@@ -83,6 +88,7 @@ class Category extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
@@ -94,9 +100,7 @@ class Category extends Model
|
|||||||
return Crypt::decrypt($value);
|
return Crypt::decrypt($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
return $value;
|
return $value;
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
/**
|
/**
|
||||||
* Class Component
|
* Class Component
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class Component extends Model
|
class Component extends Model
|
||||||
|
@@ -13,6 +13,7 @@ class LimitRepetition extends Model
|
|||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
public function budgetLimit()
|
public function budgetLimit()
|
||||||
@@ -21,6 +22,7 @@ class LimitRepetition extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
|
@@ -17,6 +17,7 @@ class PiggyBank extends Model
|
|||||||
= ['name', 'account_id', 'order', 'reminder_skip', 'targetamount', 'startdate', 'targetdate', 'reminder', 'remind_me'];
|
= ['name', 'account_id', 'order', 'reminder_skip', 'targetamount', 'startdate', 'targetdate', 'reminder', 'remind_me'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
public function account()
|
public function account()
|
||||||
@@ -44,6 +45,7 @@ class PiggyBank extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
*/
|
*/
|
||||||
public function piggyBankRepetitions()
|
public function piggyBankRepetitions()
|
||||||
@@ -52,6 +54,7 @@ class PiggyBank extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
@@ -60,6 +63,7 @@ class PiggyBank extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
@@ -70,6 +74,7 @@ class PiggyBank extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
*/
|
*/
|
||||||
public function piggyBankEvents()
|
public function piggyBankEvents()
|
||||||
@@ -78,6 +83,7 @@ class PiggyBank extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
|
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
|
||||||
*/
|
*/
|
||||||
public function reminders()
|
public function reminders()
|
||||||
@@ -86,6 +92,7 @@ class PiggyBank extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
public function setNameAttribute($value)
|
public function setNameAttribute($value)
|
||||||
@@ -95,6 +102,7 @@ class PiggyBank extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
|
@@ -5,6 +5,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
/**
|
/**
|
||||||
* Class PiggyBankEvent
|
* Class PiggyBankEvent
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class PiggyBankEvent extends Model
|
class PiggyBankEvent extends Model
|
||||||
|
@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
/**
|
/**
|
||||||
* Class PiggyBankRepetition
|
* Class PiggyBankRepetition
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class PiggyBankRepetition extends Model
|
class PiggyBankRepetition extends Model
|
||||||
|
@@ -5,6 +5,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
/**
|
/**
|
||||||
* Class Preference
|
* Class Preference
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class Preference extends Model
|
class Preference extends Model
|
||||||
|
@@ -17,6 +17,7 @@ class Reminder extends Model
|
|||||||
protected $fillable = ['user_id', 'startdate', 'metadata', 'enddate', 'active', 'notnow', 'remindersable_id', 'remindersable_type',];
|
protected $fillable = ['user_id', 'startdate', 'metadata', 'enddate', 'active', 'notnow', 'remindersable_id', 'remindersable_type',];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
@@ -27,6 +28,7 @@ class Reminder extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
@@ -35,6 +37,7 @@ class Reminder extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
@@ -49,6 +52,7 @@ class Reminder extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
@@ -59,6 +63,7 @@ class Reminder extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\MorphTo
|
* @return \Illuminate\Database\Eloquent\Relations\MorphTo
|
||||||
*/
|
*/
|
||||||
public function remindersable()
|
public function remindersable()
|
||||||
@@ -67,6 +72,7 @@ class Reminder extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param EloquentBuilder $query
|
* @param EloquentBuilder $query
|
||||||
* @param Carbon $start
|
* @param Carbon $start
|
||||||
* @param Carbon $end
|
* @param Carbon $end
|
||||||
@@ -79,6 +85,7 @@ class Reminder extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param EloquentBuilder $query
|
* @param EloquentBuilder $query
|
||||||
*
|
*
|
||||||
* @return $this
|
* @return $this
|
||||||
@@ -92,6 +99,7 @@ class Reminder extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
public function setMetadataAttribute($value)
|
public function setMetadataAttribute($value)
|
||||||
@@ -101,6 +109,7 @@ class Reminder extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
public function user()
|
public function user()
|
||||||
|
@@ -67,6 +67,7 @@ class Tag extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
@@ -75,6 +76,7 @@ class Tag extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
@@ -85,6 +87,7 @@ class Tag extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
@@ -95,6 +98,7 @@ class Tag extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
public function setDescriptionAttribute($value)
|
public function setDescriptionAttribute($value)
|
||||||
@@ -103,6 +107,7 @@ class Tag extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
public function setTagAttribute($value)
|
public function setTagAttribute($value)
|
||||||
@@ -111,6 +116,7 @@ class Tag extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
*/
|
*/
|
||||||
public function transactionjournals()
|
public function transactionjournals()
|
||||||
@@ -119,6 +125,7 @@ class Tag extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
public function user()
|
public function user()
|
||||||
|
@@ -9,6 +9,7 @@ use Watson\Validating\ValidatingTrait;
|
|||||||
/**
|
/**
|
||||||
* Class Transaction
|
* Class Transaction
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class Transaction extends Model
|
class Transaction extends Model
|
||||||
|
@@ -4,8 +4,10 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* Class TransactionCurrency
|
* Class TransactionCurrency
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class TransactionCurrency extends Model
|
class TransactionCurrency extends Model
|
||||||
|
@@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
/**
|
/**
|
||||||
* Class TransactionGroup
|
* Class TransactionGroup
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class TransactionGroup extends Model
|
class TransactionGroup extends Model
|
||||||
|
@@ -32,6 +32,7 @@ class TransactionJournal extends Model
|
|||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
public function bill()
|
public function bill()
|
||||||
@@ -40,6 +41,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
*/
|
*/
|
||||||
public function budgets()
|
public function budgets()
|
||||||
@@ -48,6 +50,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
*/
|
*/
|
||||||
public function categories()
|
public function categories()
|
||||||
@@ -94,6 +97,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
*/
|
*/
|
||||||
public function transactions()
|
public function transactions()
|
||||||
@@ -102,6 +106,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getDates()
|
public function getDates()
|
||||||
@@ -110,6 +115,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
@@ -120,12 +126,11 @@ class TransactionJournal extends Model
|
|||||||
return Crypt::decrypt($value);
|
return Crypt::decrypt($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
return $value;
|
return $value;
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
*/
|
*/
|
||||||
public function piggyBankEvents()
|
public function piggyBankEvents()
|
||||||
@@ -134,6 +139,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param EloquentBuilder $query
|
* @param EloquentBuilder $query
|
||||||
* @param Account $account
|
* @param Account $account
|
||||||
*/
|
*/
|
||||||
@@ -147,6 +153,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param EloquentBuilder $query
|
* @param EloquentBuilder $query
|
||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
*
|
*
|
||||||
@@ -158,6 +165,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param EloquentBuilder $query
|
* @param EloquentBuilder $query
|
||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
*
|
*
|
||||||
@@ -169,6 +177,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param EloquentBuilder $query
|
* @param EloquentBuilder $query
|
||||||
* @param $amount
|
* @param $amount
|
||||||
*/
|
*/
|
||||||
@@ -185,6 +194,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param EloquentBuilder $query
|
* @param EloquentBuilder $query
|
||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
*
|
*
|
||||||
@@ -196,6 +206,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param EloquentBuilder $query
|
* @param EloquentBuilder $query
|
||||||
* @param array $types
|
* @param array $types
|
||||||
*/
|
*/
|
||||||
@@ -211,6 +222,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* Automatically includes the 'with' parameters to get relevant related
|
* Automatically includes the 'with' parameters to get relevant related
|
||||||
* objects.
|
* objects.
|
||||||
*
|
*
|
||||||
@@ -226,6 +238,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
public function setDescriptionAttribute($value)
|
public function setDescriptionAttribute($value)
|
||||||
@@ -235,6 +248,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
*/
|
*/
|
||||||
public function tags()
|
public function tags()
|
||||||
@@ -243,6 +257,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
public function transactionCurrency()
|
public function transactionCurrency()
|
||||||
@@ -251,6 +266,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
public function transactionType()
|
public function transactionType()
|
||||||
@@ -259,6 +275,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
*/
|
*/
|
||||||
public function transactiongroups()
|
public function transactiongroups()
|
||||||
@@ -267,6 +284,7 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
public function user()
|
public function user()
|
||||||
|
@@ -5,6 +5,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
/**
|
/**
|
||||||
* Class TransactionRelation
|
* Class TransactionRelation
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class TransactionRelation extends Model
|
class TransactionRelation extends Model
|
||||||
|
@@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
/**
|
/**
|
||||||
* Class TransactionType
|
* Class TransactionType
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Models
|
* @package FireflyIII\Models
|
||||||
*/
|
*/
|
||||||
class TransactionType extends Model
|
class TransactionType extends Model
|
||||||
|
@@ -10,6 +10,7 @@ use FireflyIII\Support\Preferences;
|
|||||||
use FireflyIII\Support\Steam;
|
use FireflyIII\Support\Steam;
|
||||||
use FireflyIII\Support\Twig\Budget;
|
use FireflyIII\Support\Twig\Budget;
|
||||||
use FireflyIII\Support\Twig\General;
|
use FireflyIII\Support\Twig\General;
|
||||||
|
use FireflyIII\Support\Twig\Translation;
|
||||||
use FireflyIII\Support\Twig\Journal;
|
use FireflyIII\Support\Twig\Journal;
|
||||||
use FireflyIII\Support\Twig\PiggyBank;
|
use FireflyIII\Support\Twig\PiggyBank;
|
||||||
use FireflyIII\Validation\FireflyValidator;
|
use FireflyIII\Validation\FireflyValidator;
|
||||||
@@ -42,6 +43,7 @@ class FireflyServiceProvider extends ServiceProvider
|
|||||||
Twig::addExtension(new General);
|
Twig::addExtension(new General);
|
||||||
Twig::addExtension(new Journal);
|
Twig::addExtension(new Journal);
|
||||||
Twig::addExtension(new Budget);
|
Twig::addExtension(new Budget);
|
||||||
|
Twig::addExtension(new Translation);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function register()
|
public function register()
|
||||||
|
@@ -137,7 +137,7 @@ class JournalRepository implements JournalRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function getWithDate($id, Carbon $date)
|
public function getWithDate($id, Carbon $date)
|
||||||
{
|
{
|
||||||
return Auth::user()->transactionjournals()->where('id', $id)->where('date', $date->format('Y-m-d'))->first();
|
return Auth::user()->transactionjournals()->where('id', $id)->where('date', $date->format('Y-m-d 00:00:00'))->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -379,14 +379,19 @@ class JournalRepository implements JournalRepositoryInterface
|
|||||||
$to = Account::find($data['account_to_id']);
|
$to = Account::find($data['account_to_id']);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (is_null($to->id)) {
|
if (is_null($to) || (!is_null($to) && is_null($to->id))) {
|
||||||
Log::error('"to"-account is null, so we cannot continue!');
|
Log::error('"to"-account is null, so we cannot continue!');
|
||||||
App::abort(500, '"to"-account is null, so we cannot continue!');
|
App::abort(500, '"to"-account is null, so we cannot continue!');
|
||||||
|
// @codeCoverageIgnoreStart
|
||||||
}
|
}
|
||||||
if (is_null($from->id)) {
|
// @codeCoverageIgnoreEnd
|
||||||
|
|
||||||
|
if (is_null($from) || (!is_null($from) && is_null($from->id))) {
|
||||||
Log::error('"from"-account is null, so we cannot continue!');
|
Log::error('"from"-account is null, so we cannot continue!');
|
||||||
App::abort(500, '"from"-account is null, so we cannot continue!');
|
App::abort(500, '"from"-account is null, so we cannot continue!');
|
||||||
|
// @codeCoverageIgnoreStart
|
||||||
}
|
}
|
||||||
|
// @codeCoverageIgnoreEnd
|
||||||
|
|
||||||
return [$from, $to];
|
return [$from, $to];
|
||||||
}
|
}
|
||||||
|
@@ -145,14 +145,20 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
|
|||||||
/**
|
/**
|
||||||
* Set all piggy banks to order 0.
|
* Set all piggy banks to order 0.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function reset()
|
public function reset()
|
||||||
{
|
{
|
||||||
DB::table('piggy_banks')
|
// split query to make it work in sqlite:
|
||||||
->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.id')
|
$set = PiggyBank::
|
||||||
->where('accounts.user_id', Auth::user()->id)
|
leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.id')
|
||||||
->update(['order' => 0, 'piggy_banks.updated_at' => DB::Raw('NOW()')]);
|
->where('accounts.user_id', Auth::user()->id)->get(['piggy_banks.*']);
|
||||||
|
foreach ($set as $e) {
|
||||||
|
$e->order = 0;
|
||||||
|
$e->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -9,6 +9,7 @@ use FireflyIII\Models\Reminder;
|
|||||||
/**
|
/**
|
||||||
* Class PiggyBankPart
|
* Class PiggyBankPart
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Collection
|
* @package FireflyIII\Collection
|
||||||
*/
|
*/
|
||||||
class PiggyBankPart
|
class PiggyBankPart
|
||||||
|
@@ -20,7 +20,7 @@ class ReminderRepository implements ReminderRepositoryInterface
|
|||||||
protected $helper;
|
protected $helper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
@@ -52,6 +52,7 @@ class TagRepository implements TagRepositoryInterface
|
|||||||
|
|
||||||
$withdrawals = $tag->transactionjournals()->where('transaction_type_id', $withdrawal->id)->count();
|
$withdrawals = $tag->transactionjournals()->where('transaction_type_id', $withdrawal->id)->count();
|
||||||
$transfers = $tag->transactionjournals()->where('transaction_type_id', $transfer->id)->count();
|
$transfers = $tag->transactionjournals()->where('transaction_type_id', $transfer->id)->count();
|
||||||
|
$deposits = $tag->transactionjournals()->where('transaction_type_id', $deposit->id)->count();
|
||||||
|
|
||||||
if ($tag->tagMode == 'balancingAct') {
|
if ($tag->tagMode == 'balancingAct') {
|
||||||
|
|
||||||
@@ -73,39 +74,47 @@ class TagRepository implements TagRepositoryInterface
|
|||||||
}
|
}
|
||||||
if ($tag->tagMode == 'advancePayment') {
|
if ($tag->tagMode == 'advancePayment') {
|
||||||
|
|
||||||
|
// advance payments cannot accept transfers:
|
||||||
|
if ($journal->transaction_type_id == $transfer->id) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// only if this is the only withdrawal
|
// the first transaction to be attached to this
|
||||||
if ($journal->transaction_type_id == $withdrawal->id && $withdrawals < 1) {
|
// tag is attached just like that:
|
||||||
|
if ($withdrawals < 1 && $deposits < 1) {
|
||||||
$journal->tags()->save($tag);
|
$journal->tags()->save($tag);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// only if this is a deposit.
|
// if withdrawal and already has a withdrawal, return false:
|
||||||
if ($journal->transaction_type_id == $deposit->id) {
|
if ($journal->transaction_type_id == $withdrawal->id && $withdrawals == 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// if this is a deposit, account must match the current only journal
|
// if already has transaction journals, must match ALL asset account id's:
|
||||||
// (if already present):
|
if ($deposits > 0 || $withdrawals == 1) {
|
||||||
$currentWithdrawal = $tag->transactionjournals()->where('transaction_type_id', $withdrawal->id)->first();
|
$match = true;
|
||||||
|
/** @var TransactionJournal $check */
|
||||||
if ($currentWithdrawal && $currentWithdrawal->assetAccount->id == $journal->assetAccount->id) {
|
foreach ($tag->transactionjournals as $check) {
|
||||||
|
if ($check->assetAccount->id != $journal->assetAccount->id) {
|
||||||
|
$match = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($match) {
|
||||||
$journal->tags()->save($tag);
|
$journal->tags()->save($tag);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
if (is_null($currentWithdrawal)) {
|
|
||||||
$journal->tags()->save($tag);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// @codeCoverageIgnoreStart
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// @codeCoverageIgnoreEnd
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Tag $tag
|
* @param Tag $tag
|
||||||
|
@@ -7,6 +7,7 @@ use Validator;
|
|||||||
/**
|
/**
|
||||||
* Class Registrar
|
* Class Registrar
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Services
|
* @package FireflyIII\Services
|
||||||
*/
|
*/
|
||||||
class Registrar implements RegistrarContract
|
class Registrar implements RegistrarContract
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace FireflyIII\Support;
|
namespace FireflyIII\Support;
|
||||||
|
|
||||||
use Cache;
|
|
||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
use FireflyIII\Models\TransactionCurrency;
|
use FireflyIII\Models\TransactionCurrency;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
|
@@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Facade;
|
|||||||
/**
|
/**
|
||||||
* Class Amount
|
* Class Amount
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Support\Facades
|
* @package FireflyIII\Support\Facades
|
||||||
*/
|
*/
|
||||||
class Amount extends Facade
|
class Amount extends Facade
|
||||||
|
@@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Facade;
|
|||||||
/**
|
/**
|
||||||
* Class Amount
|
* Class Amount
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Support\Facades
|
* @package FireflyIII\Support\Facades
|
||||||
*/
|
*/
|
||||||
class ExpandedForm extends Facade
|
class ExpandedForm extends Facade
|
||||||
|
@@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Facade;
|
|||||||
/**
|
/**
|
||||||
* Class Navigation
|
* Class Navigation
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Support\Facades
|
* @package FireflyIII\Support\Facades
|
||||||
*/
|
*/
|
||||||
class Navigation extends Facade
|
class Navigation extends Facade
|
||||||
|
@@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Facade;
|
|||||||
/**
|
/**
|
||||||
* Class Preferences
|
* Class Preferences
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Support\Facades
|
* @package FireflyIII\Support\Facades
|
||||||
*/
|
*/
|
||||||
class Preferences extends Facade
|
class Preferences extends Facade
|
||||||
|
@@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Facade;
|
|||||||
/**
|
/**
|
||||||
* Class Steam
|
* Class Steam
|
||||||
*
|
*
|
||||||
|
* @codeCoverageIgnore
|
||||||
* @package FireflyIII\Support\Facades
|
* @package FireflyIII\Support\Facades
|
||||||
*/
|
*/
|
||||||
class Steam extends Facade
|
class Steam extends Facade
|
||||||
|
42
app/Support/Twig/Translation.php
Normal file
42
app/Support/Twig/Translation.php
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace FireflyIII\Support\Twig;
|
||||||
|
|
||||||
|
use FireflyIII\Models\LimitRepetition;
|
||||||
|
use Twig_Extension;
|
||||||
|
use Twig_SimpleFilter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Budget
|
||||||
|
*
|
||||||
|
* @package FireflyIII\Support\Twig
|
||||||
|
*/
|
||||||
|
class Translation extends Twig_Extension
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getFilters()
|
||||||
|
{
|
||||||
|
$filters = [];
|
||||||
|
|
||||||
|
$filters[] = new Twig_SimpleFilter(
|
||||||
|
'_', function ($name) {
|
||||||
|
|
||||||
|
return trans('firefly.'.$name);
|
||||||
|
|
||||||
|
}, ['is_safe' => ['html']]
|
||||||
|
);
|
||||||
|
|
||||||
|
return $filters;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return 'FireflyIII\Support\Twig\Translation';
|
||||||
|
}
|
||||||
|
}
|
@@ -119,6 +119,6 @@ return [
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'pretend' => false,
|
'pretend' => env('EMAIL_PRETEND', false),
|
||||||
|
|
||||||
];
|
];
|
||||||
|
@@ -6,5 +6,7 @@ return [
|
|||||||
'pleaseHold' => 'Please hold...',
|
'pleaseHold' => 'Please hold...',
|
||||||
'mandatoryFields' => 'Mandatory fields',
|
'mandatoryFields' => 'Mandatory fields',
|
||||||
'optionalFields' => 'Optional fields',
|
'optionalFields' => 'Optional fields',
|
||||||
'options' => 'Options'
|
'options' => 'Options',
|
||||||
];
|
'something' => 'Something!'
|
||||||
|
|
||||||
|
];
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa {{ subTitleIcon }}"></i> {{ trans('firefly.mandatoryFields') }}
|
<i class="fa {{ subTitleIcon }}"></i> {{ 'mandatoryFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.text('name') }}
|
{{ ExpandedForm.text('name') }}
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
{% if what == 'asset' %}
|
{% if what == 'asset' %}
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-smile-o"></i> {{ trans('firefly.optionalFields') }}
|
<i class="fa fa-smile-o"></i> {{ 'optionalFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-bolt"></i> {{ trans('firefly.options') }}
|
<i class="fa fa-bolt"></i> {{ 'options'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.optionsList('create','account') }}
|
{{ ExpandedForm.optionsList('create','account') }}
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa {{ subTitleIcon }}"></i> {{ trans('firefly.mandatoryFields') }}
|
<i class="fa {{ subTitleIcon }}"></i> {{ 'mandatoryFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.text('name') }}
|
{{ ExpandedForm.text('name') }}
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-smile-o"></i> {{ trans('firefly.optionalFields') }}
|
<i class="fa fa-smile-o"></i> {{ 'optionalFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{% if account.accounttype.type == 'Default account' or account.accounttype.type == 'Asset account' %}
|
{% if account.accounttype.type == 'Default account' or account.accounttype.type == 'Asset account' %}
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<!-- panel for options -->
|
<!-- panel for options -->
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-bolt"></i> {{ trans('firefly.options') }}
|
<i class="fa fa-bolt"></i> {{ 'options'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.optionsList('update','account') }}
|
{{ ExpandedForm.optionsList('update','account') }}
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-exclamation-circle"></i> {{ trans('firefly.mandatoryFields') }}
|
<i class="fa fa-exclamation-circle"></i> {{ 'mandatoryFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.text('name') }}
|
{{ ExpandedForm.text('name') }}
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-smile-o"></i> {{ trans('firefly.optionalFields') }}
|
<i class="fa fa-smile-o"></i> {{ 'optionalFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.integer('skip',0) }}
|
{{ ExpandedForm.integer('skip',0) }}
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
<!-- panel for options -->
|
<!-- panel for options -->
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-bolt"></i> {{ trans('firefly.options') }}
|
<i class="fa fa-bolt"></i> {{ 'options'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.optionsList('create','bill') }}
|
{{ ExpandedForm.optionsList('create','bill') }}
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-exclamation-circle"></i> {{ trans('firefly.mandatoryFields') }}
|
<i class="fa fa-exclamation-circle"></i> {{ 'mandatoryFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.text('name') }}
|
{{ ExpandedForm.text('name') }}
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-smile-o"></i> {{ trans('firefly.optionalFields') }}
|
<i class="fa fa-smile-o"></i> {{ 'optionalFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.integer('skip') }}
|
{{ ExpandedForm.integer('skip') }}
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-bolt"></i> {{ trans('firefly.options') }}
|
<i class="fa fa-bolt"></i> {{ 'options'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.optionsList('update','bill') }}
|
{{ ExpandedForm.optionsList('update','bill') }}
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-exclamation"></i> {{ trans('firefly.mandatoryFields') }}
|
<i class="fa fa-exclamation"></i> {{ 'mandatoryFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.text('name') }}
|
{{ ExpandedForm.text('name') }}
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<!-- panel for options -->
|
<!-- panel for options -->
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-bolt"></i> {{ trans('firefly.options') }}
|
<i class="fa fa-bolt"></i> {{ 'options'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.optionsList('create','budget') }}
|
{{ ExpandedForm.optionsList('create','budget') }}
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-fw fa-exclamation"></i> {{ trans('firefly.mandatoryFields') }}
|
<i class="fa fa-fw fa-exclamation"></i> {{ 'mandatoryFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.checkbox('active') }}
|
{{ ExpandedForm.checkbox('active') }}
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<!-- panel for options -->
|
<!-- panel for options -->
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-bolt"></i> {{ trans('firefly.options') }}
|
<i class="fa fa-bolt"></i> {{ 'options'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.optionsList('update','budget') }}
|
{{ ExpandedForm.optionsList('update','budget') }}
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-exclamation"></i> {{ trans('firefly.mandatoryFields') }}
|
<i class="fa fa-exclamation"></i> {{ 'mandatoryFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.text('name') }}
|
{{ ExpandedForm.text('name') }}
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<!-- panel for options -->
|
<!-- panel for options -->
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-bolt"></i> {{ trans('firefly.options') }}
|
<i class="fa fa-bolt"></i> {{ 'options'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.optionsList('create','category') }}
|
{{ ExpandedForm.optionsList('create','category') }}
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-exclamation"></i> {{ trans('firefly.mandatoryFields') }}
|
<i class="fa fa-exclamation"></i> {{ 'mandatoryFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.text('name') }}
|
{{ ExpandedForm.text('name') }}
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<!-- panel for options -->
|
<!-- panel for options -->
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-bolt"></i> {{ trans('firefly.options') }}
|
<i class="fa fa-bolt"></i> {{ 'options'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.optionsList('update','category') }}
|
{{ ExpandedForm.optionsList('update','category') }}
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa {{ subTitleIcon }}"></i> {{ trans('firefly.mandatoryFields') }}
|
<i class="fa {{ subTitleIcon }}"></i> {{ 'mandatoryFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.text('name',null,{'maxlength' : 48}) }}
|
{{ ExpandedForm.text('name',null,{'maxlength' : 48}) }}
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
<!-- panel for options -->
|
<!-- panel for options -->
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-bolt"></i> {{ trans('firefly.options') }}
|
<i class="fa fa-bolt"></i> {{ 'options'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.optionsList('create','currency') }}
|
{{ ExpandedForm.optionsList('create','currency') }}
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa {{ subTitleIcon }}"></i> {{ trans('firefly.mandatoryFields') }}
|
<i class="fa {{ subTitleIcon }}"></i> {{ 'mandatoryFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.text('name',null,{'maxlength' : 48}) }}
|
{{ ExpandedForm.text('name',null,{'maxlength' : 48}) }}
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
<!-- panel for options -->
|
<!-- panel for options -->
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-bolt"></i> {{ trans('firefly.options') }}
|
<i class="fa fa-bolt"></i> {{ 'options'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.optionsList('update','currency') }}
|
{{ ExpandedForm.optionsList('update','currency') }}
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
{% if count == 0 %}
|
{% if count == 0 %}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||||
<p class="lead">{{ trans('firefly.welcome') }}</p>
|
<p class="lead">{{ 'welcome'|_ }}</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Create a new asset account to get started.
|
Create a new asset account to get started.
|
||||||
|
@@ -89,15 +89,15 @@
|
|||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">{{ trans('firefly.close') }}</span>
|
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">{{ 'close'|_ }}</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title" id="helpTitle">{{ trans('firefly.pleaseHold') }}</h4>
|
<h4 class="modal-title" id="helpTitle">{{ 'pleaseHold'|_ }}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body" id="helpBody">
|
<div class="modal-body" id="helpBody">
|
||||||
<i class="fa fa-refresh fa-spin"></i>
|
<i class="fa fa-refresh fa-spin"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('firefly.close') }}</button>
|
<button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-fw fa-exclamation"></i> {{ trans('firefly.mandatoryFields') }}
|
<i class="fa fa-fw fa-exclamation"></i> {{ 'mandatoryFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
<div class="col-lg-6 col-md-12 col-sm-12">
|
<div class="col-lg-6 col-md-12 col-sm-12">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-smile-o"></i> {{ trans('firefly.optionalFields') }}
|
<i class="fa fa-smile-o"></i> {{ 'optionalFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.date('targetdate') }}
|
{{ ExpandedForm.date('targetdate') }}
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<!-- panel for options -->
|
<!-- panel for options -->
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-bolt"></i> {{ trans('firefly.options') }}
|
<i class="fa fa-bolt"></i> {{ 'options'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.optionsList('create','piggy bank') }}
|
{{ ExpandedForm.optionsList('create','piggy bank') }}
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
<div class="col-lg-6 col-md-12 col-sm-6">
|
<div class="col-lg-6 col-md-12 col-sm-6">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-fw fa-exclamation"></i> {{ trans('firefly.mandatoryFields') }}
|
<i class="fa fa-fw fa-exclamation"></i> {{ 'mandatoryFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<div class="col-lg-6 col-md-12 col-sm-12">
|
<div class="col-lg-6 col-md-12 col-sm-12">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-smile-o"></i> {{ trans('firefly.optionalFields') }}
|
<i class="fa fa-smile-o"></i> {{ 'optionalFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.date('targetdate') }}
|
{{ ExpandedForm.date('targetdate') }}
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<!-- panel for options -->
|
<!-- panel for options -->
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-bolt"></i> {{ trans('firefly.options') }}
|
<i class="fa fa-bolt"></i> {{ 'options'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.optionsList('update','piggy bank') }}
|
{{ ExpandedForm.optionsList('update','piggy bank') }}
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
<div class="col-lg-5 col-md-5 col-sm-12">
|
<div class="col-lg-5 col-md-5 col-sm-12">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-tag"></i> {{ trans('firefly.mandatoryFields') }}
|
<i class="fa fa-tag"></i> {{ 'mandatoryFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.text('tag') }}
|
{{ ExpandedForm.text('tag') }}
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-smile-o"></i> {{ trans('firefly.optionalFields') }}
|
<i class="fa fa-smile-o"></i> {{ 'optionalFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.date('date') }}
|
{{ ExpandedForm.date('date') }}
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<!-- panel for options -->
|
<!-- panel for options -->
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-bolt"></i> {{ trans('firefly.options') }}
|
<i class="fa fa-bolt"></i> {{ 'options'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.optionsList('create','tag') }}
|
{{ ExpandedForm.optionsList('create','tag') }}
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
<div class="col-lg-5 col-md-5 col-sm-12">
|
<div class="col-lg-5 col-md-5 col-sm-12">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-tag"></i> {{ trans('firefly.mandatoryFields') }}
|
<i class="fa fa-tag"></i> {{ 'mandatoryFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.text('tag') }}
|
{{ ExpandedForm.text('tag') }}
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-smile-o"></i> {{ trans('firefly.optionalFields') }}
|
<i class="fa fa-smile-o"></i> {{ 'optionalFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.date('date') }}
|
{{ ExpandedForm.date('date') }}
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<!-- panel for options -->
|
<!-- panel for options -->
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-bolt"></i> {{ trans('firefly.options') }}
|
<i class="fa fa-bolt"></i> {{ 'options'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.optionsList('update','tag') }}
|
{{ ExpandedForm.optionsList('update','tag') }}
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
<div class="col-lg-6 col-md-12 col-sm-12">
|
<div class="col-lg-6 col-md-12 col-sm-12">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-exclamation-circle"></i> {{ trans('firefly.mandatoryFields') }}
|
<i class="fa fa-exclamation-circle"></i> {{ 'mandatoryFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<!-- DESCRIPTION ALWAYS AVAILABLE -->
|
<!-- DESCRIPTION ALWAYS AVAILABLE -->
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
<div class="col-lg-6 col-md-12 col-sm-12">
|
<div class="col-lg-6 col-md-12 col-sm-12">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-smile-o"></i> {{ trans('firefly.optionalFields') }}
|
<i class="fa fa-smile-o"></i> {{ 'optionalFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<!-- BUDGET ONLY WHEN CREATING A WITHDRAWAL -->
|
<!-- BUDGET ONLY WHEN CREATING A WITHDRAWAL -->
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
<!-- panel for options -->
|
<!-- panel for options -->
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-bolt"></i> {{ trans('firefly.options') }}
|
<i class="fa fa-bolt"></i> {{ 'options'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.optionsList('create','transaction') }}
|
{{ ExpandedForm.optionsList('create','transaction') }}
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
<div class="col-lg-6 col-md-12 col-sm-12">
|
<div class="col-lg-6 col-md-12 col-sm-12">
|
||||||
<div class="panel panel-primary">
|
<div class="panel panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-exclamation-circle"></i> {{ trans('firefly.mandatoryFields') }}
|
<i class="fa fa-exclamation-circle"></i> {{ 'mandatoryFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<!-- ALWAYS AVAILABLE -->
|
<!-- ALWAYS AVAILABLE -->
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
<div class="col-lg-6 col-md-12 col-sm-12">
|
<div class="col-lg-6 col-md-12 col-sm-12">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-smile-o"></i> {{ trans('firefly.optionalFields') }}
|
<i class="fa fa-smile-o"></i> {{ 'optionalFields'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<!-- BUDGET ONLY WHEN CREATING A WITHDRAWAL -->
|
<!-- BUDGET ONLY WHEN CREATING A WITHDRAWAL -->
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
<!-- panel for options -->
|
<!-- panel for options -->
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<i class="fa fa-bolt"></i> {{ trans('firefly.options') }}
|
<i class="fa fa-bolt"></i> {{ 'options'|_ }}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
{{ ExpandedForm.optionsList('update','transaction') }}
|
{{ ExpandedForm.optionsList('update','transaction') }}
|
||||||
|
@@ -42,7 +42,7 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|||||||
Log::debug('Created new database.');
|
Log::debug('Created new database.');
|
||||||
touch($original);
|
touch($original);
|
||||||
Artisan::call('migrate');
|
Artisan::call('migrate');
|
||||||
copy($original, $copy);
|
|
||||||
|
|
||||||
// create EUR currency
|
// create EUR currency
|
||||||
/** @var TransactionCurrency $currency */
|
/** @var TransactionCurrency $currency */
|
||||||
@@ -50,8 +50,11 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
|
|||||||
$currency->code = 'EUR';
|
$currency->code = 'EUR';
|
||||||
$currency->save();
|
$currency->save();
|
||||||
Log::debug('Created new EUR currency.');
|
Log::debug('Created new EUR currency.');
|
||||||
|
copy($original, $copy);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (file_exists($copy)) {
|
if (file_exists($copy)) {
|
||||||
|
Log::debug('Copied copy back over original.');
|
||||||
copy($copy, $original);
|
copy($copy, $original);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
68
tests/controllers/AuthControllerTest.php
Normal file
68
tests/controllers/AuthControllerTest.php
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
<?php
|
||||||
|
use League\FactoryMuffin\Facade as FactoryMuffin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class AuthControllerTest
|
||||||
|
*/
|
||||||
|
class AuthControllerTest extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Sets up the fixture, for example, opens a network connection.
|
||||||
|
* This method is called before a test is executed.
|
||||||
|
*/
|
||||||
|
public function setUp()
|
||||||
|
{
|
||||||
|
parent::setUp();
|
||||||
|
FactoryMuffin::create('FireflyIII\User');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called before the first test of this test class is run.
|
||||||
|
*
|
||||||
|
* @since Method available since Release 3.4.0
|
||||||
|
*/
|
||||||
|
public static function setUpBeforeClass()
|
||||||
|
{
|
||||||
|
parent::setUpBeforeClass();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tears down the fixture, for example, closes a network connection.
|
||||||
|
* This method is called after a test is executed.
|
||||||
|
*/
|
||||||
|
public function tearDown()
|
||||||
|
{
|
||||||
|
parent::tearDown();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testPostRegister()
|
||||||
|
{
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'email' => 'test@example.com',
|
||||||
|
'password' => 'onetwothree',
|
||||||
|
'password_confirmation' => 'onetwothree',
|
||||||
|
'_token' => 'replaceMe'
|
||||||
|
];
|
||||||
|
$this->call('POST', '/auth/register', $data);
|
||||||
|
$this->assertResponseStatus(302);
|
||||||
|
$this->assertSessionHas('success');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testPostRegisterFails()
|
||||||
|
{
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'email' => 'test@example.com',
|
||||||
|
'password' => 'onetwothree',
|
||||||
|
'password_confirmation' => 'onetwofour',
|
||||||
|
'_token' => 'replaceMe'
|
||||||
|
];
|
||||||
|
$this->call('POST', '/auth/register', $data);
|
||||||
|
$this->assertResponseStatus(302);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -115,6 +115,28 @@ class TagControllerTest extends TestCase
|
|||||||
$this->assertResponseOk();
|
$this->assertResponseOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testMultipleDeposits()
|
||||||
|
{
|
||||||
|
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$type = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
|
||||||
|
for ($i = 0; $i < 3; $i++) {
|
||||||
|
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
|
$journal->transaction_type_id = $type->id;
|
||||||
|
$journal->save();
|
||||||
|
$tag->transactionJournals()->save($journal);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$tag->tagMode = 'nothing';
|
||||||
|
$tag->save();
|
||||||
|
$this->be($tag->user);
|
||||||
|
|
||||||
|
$this->call('GET', '/tags/edit/' . $tag->id);
|
||||||
|
$this->assertResponseOk();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function testHideTagHelp()
|
public function testHideTagHelp()
|
||||||
{
|
{
|
||||||
|
@@ -173,9 +173,9 @@ FactoryMuffin::define(
|
|||||||
'FireflyIII\Models\AccountType',
|
'FireflyIII\Models\AccountType',
|
||||||
[
|
[
|
||||||
'type' => function () {
|
'type' => function () {
|
||||||
$types = ['Expense account', 'Revenue account', 'Asset account'];
|
$types = ['Expense account', 'Revenue account', 'Asset account','Cash account'];
|
||||||
$count = DB::table('account_types')->count();
|
$count = DB::table('account_types')->count();
|
||||||
if ($count < 3) {
|
if ($count < 4) {
|
||||||
return $types[$count];
|
return $types[$count];
|
||||||
} else {
|
} else {
|
||||||
return RandomString::generateRandomString(10);
|
return RandomString::generateRandomString(10);
|
||||||
|
@@ -50,7 +50,7 @@ class CurrencyRepositoryTest extends TestCase
|
|||||||
FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||||
|
|
||||||
$set = $this->object->get();
|
$set = $this->object->get();
|
||||||
$this->assertCount(2, $set);
|
$this->assertCount(3, $set); // EUR is already present.
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,7 +76,7 @@ class CurrencyRepositoryTest extends TestCase
|
|||||||
$preference->data = 'ABC';
|
$preference->data = 'ABC';
|
||||||
$preference->save();
|
$preference->save();
|
||||||
$found = $this->object->getCurrencyByPreference($preference);
|
$found = $this->object->getCurrencyByPreference($preference);
|
||||||
$this->assertEquals($first->id, $found->id);
|
$this->assertEquals(1, $found->id); // EUR is first and will be set.
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,5 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
use FireflyIII\Models\Reminder;
|
||||||
|
use FireflyIII\Models\Transaction;
|
||||||
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use FireflyIII\Repositories\Journal\JournalRepository;
|
use FireflyIII\Repositories\Journal\JournalRepository;
|
||||||
|
use Illuminate\Pagination\LengthAwarePaginator;
|
||||||
|
use League\FactoryMuffin\Facade as FactoryMuffin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generated by PHPUnit_SkeletonGenerator on 2015-05-05 at 19:19:32.
|
* Generated by PHPUnit_SkeletonGenerator on 2015-05-05 at 19:19:32.
|
||||||
@@ -32,145 +37,502 @@ class JournalRepositoryTest extends TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Journal\JournalRepository::deactivateReminder
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::deactivateReminder
|
||||||
* @todo Implement testDeactivateReminder().
|
|
||||||
*/
|
*/
|
||||||
public function testDeactivateReminder()
|
public function testDeactivateReminder()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$reminder = FactoryMuffin::create('FireflyIII\Models\Reminder');
|
||||||
$this->markTestIncomplete(
|
$reminder->active = 1;
|
||||||
'This test has not been implemented yet.'
|
$reminder->save();
|
||||||
);
|
$this->be($reminder->user);
|
||||||
|
|
||||||
|
$this->object->deactivateReminder($reminder->id);
|
||||||
|
|
||||||
|
$this->assertEquals(1, Reminder::where('id', $reminder->id)->where('active', 0)->count());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Journal\JournalRepository::delete
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::delete
|
||||||
* @todo Implement testDelete().
|
|
||||||
*/
|
*/
|
||||||
public function testDelete()
|
public function testDelete()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
$this->markTestIncomplete(
|
$account = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
'This test has not been implemented yet.'
|
$transaction = Transaction::create(
|
||||||
|
[
|
||||||
|
'account_id' => $account->id,
|
||||||
|
'transaction_journal_id' => $journal->id,
|
||||||
|
'amount' => 100,
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->object->delete($journal);
|
||||||
|
|
||||||
|
$this->assertEquals(0, TransactionJournal::where('id', $journal->id)->whereNull('deleted_at')->count());
|
||||||
|
$this->assertEquals(0, Transaction::where('id', $transaction->id)->whereNull('deleted_at')->count());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Journal\JournalRepository::first
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::first
|
||||||
* @todo Implement testFirst().
|
|
||||||
*/
|
*/
|
||||||
public function testFirst()
|
public function testFirst()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
$this->markTestIncomplete(
|
$this->be($journal->user);
|
||||||
'This test has not been implemented yet.'
|
|
||||||
);
|
$first = $this->object->first();
|
||||||
|
|
||||||
|
$this->assertEquals($journal->id, $first->id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Journal\JournalRepository::getAmountBefore
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::getAmountBefore
|
||||||
* @todo Implement testGetAmountBefore().
|
|
||||||
*/
|
*/
|
||||||
public function testGetAmountBefore()
|
public function testGetAmountBefore()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$transaction = FactoryMuffin::create('FireflyIII\Models\Transaction');
|
||||||
$this->markTestIncomplete(
|
$before = $this->object->getAmountBefore($transaction->transactionjournal, $transaction);
|
||||||
'This test has not been implemented yet.'
|
|
||||||
);
|
$this->assertEquals(0, $before);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Journal\JournalRepository::getJournalsOfType
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::getJournalsOfType
|
||||||
* @todo Implement testGetJournalsOfType().
|
|
||||||
*/
|
*/
|
||||||
public function testGetJournalsOfType()
|
public function testGetJournalsOfType()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$user = FactoryMuffin::create('FireflyIII\User');
|
||||||
$this->markTestIncomplete(
|
$type = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
'This test has not been implemented yet.'
|
$this->be($user);
|
||||||
);
|
$result = $this->object->getJournalsOfType($type);
|
||||||
|
$this->assertCount(0, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Journal\JournalRepository::getJournalsOfTypes
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::getJournalsOfTypes
|
||||||
* @todo Implement testGetJournalsOfTypes().
|
|
||||||
*/
|
*/
|
||||||
public function testGetJournalsOfTypes()
|
public function testGetJournalsOfTypes()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
$this->markTestIncomplete(
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
'This test has not been implemented yet.'
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
);
|
$user = FactoryMuffin::create('FireflyIII\User');
|
||||||
|
$this->be($user);
|
||||||
|
$types = ['Withdrawal', 'Expense'];
|
||||||
|
$set = $this->object->getJournalsOfTypes($types, 0, 1);
|
||||||
|
|
||||||
|
$this->assertTrue($set instanceof LengthAwarePaginator);
|
||||||
|
$this->assertEquals(1, $set->currentPage());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Journal\JournalRepository::getTransactionType
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::getTransactionType
|
||||||
* @todo Implement testGetTransactionType().
|
|
||||||
*/
|
*/
|
||||||
public function testGetTransactionType()
|
public function testGetTransactionType()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$type = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
$this->markTestIncomplete(
|
$otherType = $this->object->getTransactionType($type->type);
|
||||||
'This test has not been implemented yet.'
|
$this->assertEquals($type->id, $otherType->id);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Journal\JournalRepository::getWithDate
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::getWithDate
|
||||||
* @todo Implement testGetWithDate().
|
|
||||||
*/
|
*/
|
||||||
public function testGetWithDate()
|
public function testGetWithDate()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
$this->markTestIncomplete(
|
$this->be($journal->user);
|
||||||
'This test has not been implemented yet.'
|
|
||||||
);
|
$found = $this->object->getWithDate($journal->id, $journal->date);
|
||||||
|
|
||||||
|
$this->assertEquals($journal->id, $found->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Journal\JournalRepository::saveTags
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::saveTags
|
||||||
* @todo Implement testSaveTags().
|
|
||||||
*/
|
*/
|
||||||
public function testSaveTags()
|
public function testSaveTags()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
$this->markTestIncomplete(
|
$tags = ['one', 'two', 'three'];
|
||||||
'This test has not been implemented yet.'
|
$this->be($journal->user);
|
||||||
);
|
|
||||||
|
$this->object->saveTags($journal, $tags);
|
||||||
|
|
||||||
|
$this->assertCount(3, $journal->tags()->get());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Journal\JournalRepository::store
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::store
|
||||||
* @todo Implement testStore().
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::storeAccounts
|
||||||
*/
|
*/
|
||||||
public function testStore()
|
public function testStore()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
$this->markTestIncomplete(
|
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||||
'This test has not been implemented yet.'
|
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
|
||||||
);
|
$account1 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
|
$user = FactoryMuffin::create('FireflyIII\User');
|
||||||
|
$data = [
|
||||||
|
'description' => 'Some journal ' . rand(1, 100),
|
||||||
|
'user' => $user->id,
|
||||||
|
'what' => 'withdrawal',
|
||||||
|
'amount_currency_id' => $currency->id,
|
||||||
|
'account_id' => $account1->id,
|
||||||
|
'expense_account' => 'Some expense account',
|
||||||
|
'date' => '2014-01-01',
|
||||||
|
'category' => 'Some category',
|
||||||
|
'budget_id' => $budget->id,
|
||||||
|
'amount' => 100,
|
||||||
|
'tags' => ['one', 'two', 'three']
|
||||||
|
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
$journal = $this->object->store($data);
|
||||||
|
|
||||||
|
$this->assertEquals($data['description'], $journal->description);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::store
|
||||||
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::storeAccounts
|
||||||
|
*/
|
||||||
|
public function testStoreDeposit()
|
||||||
|
{
|
||||||
|
for ($i = 0; $i < 4; $i++) {
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||||
|
}
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
|
||||||
|
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||||
|
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
|
||||||
|
$account1 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
|
$user = FactoryMuffin::create('FireflyIII\User');
|
||||||
|
$data = [
|
||||||
|
'description' => 'Some journal ' . rand(1, 100),
|
||||||
|
'user' => $user->id,
|
||||||
|
'what' => 'deposit',
|
||||||
|
'amount_currency_id' => $currency->id,
|
||||||
|
'account_id' => $account1->id,
|
||||||
|
'revenue_account' => 'Some revenue account',
|
||||||
|
'date' => '2014-01-01',
|
||||||
|
'category' => 'Some category',
|
||||||
|
'budget_id' => $budget->id,
|
||||||
|
'amount' => 100,
|
||||||
|
'tags' => ['one', 'two', 'three']
|
||||||
|
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
$journal = $this->object->store($data);
|
||||||
|
|
||||||
|
$this->assertEquals($data['description'], $journal->description);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::store
|
||||||
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::storeAccounts
|
||||||
|
*/
|
||||||
|
public function testStoreExpenseWithCash()
|
||||||
|
{
|
||||||
|
for ($i = 0; $i < 4; $i++) {
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||||
|
}
|
||||||
|
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||||
|
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
|
||||||
|
$account1 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
|
$user = FactoryMuffin::create('FireflyIII\User');
|
||||||
|
$data = [
|
||||||
|
'description' => 'Some journal ' . rand(1, 100),
|
||||||
|
'user' => $user->id,
|
||||||
|
'what' => 'withdrawal',
|
||||||
|
'amount_currency_id' => $currency->id,
|
||||||
|
'account_id' => $account1->id,
|
||||||
|
'expense_account' => '',
|
||||||
|
'date' => '2014-01-01',
|
||||||
|
'category' => 'Some other category',
|
||||||
|
'budget_id' => $budget->id,
|
||||||
|
'amount' => 100,
|
||||||
|
'tags' => ['one', 'two', 'three']
|
||||||
|
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
$journal = $this->object->store($data);
|
||||||
|
|
||||||
|
$this->assertEquals($data['description'], $journal->description);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::store
|
||||||
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::storeAccounts
|
||||||
|
* @expectedException Symfony\Component\HttpKernel\Exception\HttpException
|
||||||
|
*/
|
||||||
|
public function testStoreInvalidFromAccount()
|
||||||
|
{
|
||||||
|
for ($i = 0; $i < 4; $i++) {
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||||
|
}
|
||||||
|
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||||
|
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
|
||||||
|
$account1 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
|
$user = FactoryMuffin::create('FireflyIII\User');
|
||||||
|
$data = [
|
||||||
|
'description' => 'Some journal ' . rand(1, 100),
|
||||||
|
'user' => $user->id,
|
||||||
|
'what' => 'transfer',
|
||||||
|
'amount_currency_id' => $currency->id,
|
||||||
|
'account_from_id' => $account1->id,
|
||||||
|
'account_to_id' => 17,
|
||||||
|
'date' => '2014-01-01',
|
||||||
|
'category' => 'Some other category',
|
||||||
|
'budget_id' => $budget->id,
|
||||||
|
'amount' => 100,
|
||||||
|
'tags' => ['one', 'two', 'three']
|
||||||
|
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
$journal = $this->object->store($data);
|
||||||
|
|
||||||
|
$this->assertEquals($data['description'], $journal->description);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::store
|
||||||
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::storeAccounts
|
||||||
|
* @expectedException Symfony\Component\HttpKernel\Exception\HttpException
|
||||||
|
*/
|
||||||
|
public function testStoreInvalidToAccount()
|
||||||
|
{
|
||||||
|
for ($i = 0; $i < 4; $i++) {
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||||
|
}
|
||||||
|
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||||
|
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
|
||||||
|
$account1 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
|
$user = FactoryMuffin::create('FireflyIII\User');
|
||||||
|
$data = [
|
||||||
|
'description' => 'Some journal ' . rand(1, 100),
|
||||||
|
'user' => $user->id,
|
||||||
|
'what' => 'transfer',
|
||||||
|
'amount_currency_id' => $currency->id,
|
||||||
|
'account_from_id' => 17,
|
||||||
|
'account_to_id' => $account1->id,
|
||||||
|
'date' => '2014-01-01',
|
||||||
|
'category' => 'Some other category',
|
||||||
|
'budget_id' => $budget->id,
|
||||||
|
'amount' => 100,
|
||||||
|
'tags' => ['one', 'two', 'three']
|
||||||
|
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
$journal = $this->object->store($data);
|
||||||
|
|
||||||
|
$this->assertEquals($data['description'], $journal->description);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::store
|
||||||
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::storeAccounts
|
||||||
|
*/
|
||||||
|
public function testStoreRevenueWithCash()
|
||||||
|
{
|
||||||
|
for ($i = 0; $i < 4; $i++) {
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||||
|
}
|
||||||
|
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||||
|
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
|
||||||
|
$account1 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
|
$user = FactoryMuffin::create('FireflyIII\User');
|
||||||
|
$data = [
|
||||||
|
'description' => 'Some journal ' . rand(1, 100),
|
||||||
|
'user' => $user->id,
|
||||||
|
'what' => 'deposit',
|
||||||
|
'amount_currency_id' => $currency->id,
|
||||||
|
'account_id' => $account1->id,
|
||||||
|
'revenue_account' => '',
|
||||||
|
'date' => '2014-01-01',
|
||||||
|
'category' => 'Some other category',
|
||||||
|
'budget_id' => $budget->id,
|
||||||
|
'amount' => 100,
|
||||||
|
'tags' => ['one', 'two', 'three']
|
||||||
|
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
$journal = $this->object->store($data);
|
||||||
|
|
||||||
|
$this->assertEquals($data['description'], $journal->description);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::store
|
||||||
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::storeAccounts
|
||||||
|
*/
|
||||||
|
public function testStoreTransfer()
|
||||||
|
{
|
||||||
|
for ($i = 0; $i < 4; $i++) {
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||||
|
}
|
||||||
|
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||||
|
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
|
||||||
|
$account1 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
|
$account2 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
|
$user = FactoryMuffin::create('FireflyIII\User');
|
||||||
|
$data = [
|
||||||
|
'description' => 'Some journal ' . rand(1, 100),
|
||||||
|
'user' => $user->id,
|
||||||
|
'what' => 'transfer',
|
||||||
|
'amount_currency_id' => $currency->id,
|
||||||
|
'account_from_id' => $account1->id,
|
||||||
|
'account_to_id' => $account2->id,
|
||||||
|
'date' => '2014-01-01',
|
||||||
|
'category' => 'Some other category',
|
||||||
|
'budget_id' => $budget->id,
|
||||||
|
'amount' => 100,
|
||||||
|
'tags' => ['one', 'two', 'three']
|
||||||
|
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
$journal = $this->object->store($data);
|
||||||
|
|
||||||
|
$this->assertEquals($data['description'], $journal->description);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Journal\JournalRepository::update
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::update
|
||||||
* @todo Implement testUpdate().
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::updateTags
|
||||||
*/
|
*/
|
||||||
public function testUpdate()
|
public function testUpdate()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
for ($i = 0; $i < 4; $i++) {
|
||||||
$this->markTestIncomplete(
|
FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||||
'This test has not been implemented yet.'
|
}
|
||||||
|
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
|
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||||
|
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
|
||||||
|
$account1 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
|
$account2 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
|
|
||||||
|
// two transactions
|
||||||
|
Transaction::create(
|
||||||
|
[
|
||||||
|
'account_id' => $account1->id,
|
||||||
|
'transaction_journal_id' => $journal->id,
|
||||||
|
'amount' => 100,
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
Transaction::create(
|
||||||
|
[
|
||||||
|
'account_id' => $account1->id,
|
||||||
|
'transaction_journal_id' => $journal->id,
|
||||||
|
'amount' => -100,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'amount_currency_id' => $currency->id,
|
||||||
|
'description' => 'New description ' . rand(1, 100),
|
||||||
|
'date' => '2015-01-01',
|
||||||
|
'category' => 'SomenewCat',
|
||||||
|
'amount' => 50,
|
||||||
|
'user' => $journal->user_id,
|
||||||
|
'budget_id' => $budget->id,
|
||||||
|
'account_from_id' => $account1->id,
|
||||||
|
'account_to_id' => $account2->id,
|
||||||
|
'revenue_account' => 'Some revenue account',
|
||||||
|
'expense_account' => 'Some expense account',
|
||||||
|
'tags' => ['a', 'b', 'c']
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
$result = $this->object->update($journal, $data);
|
||||||
|
|
||||||
|
$this->assertEquals($result->description, $data['description']);
|
||||||
|
$this->assertEquals($result->amount, 50);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::update
|
||||||
|
* @covers FireflyIII\Repositories\Journal\JournalRepository::updateTags
|
||||||
|
*/
|
||||||
|
public function testUpdateNoTags()
|
||||||
|
{
|
||||||
|
for ($i = 0; $i < 4; $i++) {
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||||
|
}
|
||||||
|
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
|
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||||
|
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
|
||||||
|
$account1 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
|
$account2 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
|
|
||||||
|
// two transactions
|
||||||
|
Transaction::create(
|
||||||
|
[
|
||||||
|
'account_id' => $account1->id,
|
||||||
|
'transaction_journal_id' => $journal->id,
|
||||||
|
'amount' => 100,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
Transaction::create(
|
||||||
|
[
|
||||||
|
'account_id' => $account1->id,
|
||||||
|
'transaction_journal_id' => $journal->id,
|
||||||
|
'amount' => -100,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'amount_currency_id' => $currency->id,
|
||||||
|
'description' => 'New description ' . rand(1, 100),
|
||||||
|
'date' => '2015-01-01',
|
||||||
|
'category' => 'SomenewCat',
|
||||||
|
'amount' => 50,
|
||||||
|
'user' => $journal->user_id,
|
||||||
|
'budget_id' => $budget->id,
|
||||||
|
'account_from_id' => $account1->id,
|
||||||
|
'account_to_id' => $account2->id,
|
||||||
|
'revenue_account' => 'Some revenue account',
|
||||||
|
'expense_account' => 'Some expense account',
|
||||||
|
'tags' => []
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
$result = $this->object->update($journal, $data);
|
||||||
|
|
||||||
|
$this->assertEquals($result->description, $data['description']);
|
||||||
|
$this->assertEquals($result->amount, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers FireflyIII\Repositories\Journal\JournalRepository::updateTags
|
|
||||||
* @todo Implement testUpdateTags().
|
|
||||||
*/
|
|
||||||
public function testUpdateTags()
|
|
||||||
{
|
|
||||||
// Remove the following lines when you implement this test.
|
|
||||||
$this->markTestIncomplete(
|
|
||||||
'This test has not been implemented yet.'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use FireflyIII\Models\PiggyBank;
|
||||||
|
use FireflyIII\Models\PiggyBankRepetition;
|
||||||
use FireflyIII\Repositories\PiggyBank\PiggyBankRepository;
|
use FireflyIII\Repositories\PiggyBank\PiggyBankRepository;
|
||||||
|
use League\FactoryMuffin\Facade as FactoryMuffin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generated by PHPUnit_SkeletonGenerator on 2015-05-05 at 19:19:32.
|
* Generated by PHPUnit_SkeletonGenerator on 2015-05-05 at 19:19:32.
|
||||||
@@ -32,62 +36,98 @@ class PiggyBankRepositoryTest extends TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::calculateParts
|
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::calculateParts
|
||||||
* @todo Implement testCalculateParts().
|
|
||||||
*/
|
*/
|
||||||
public function testCalculateParts()
|
public function testCalculateParts()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
/** @var PiggyBankRepetition $repetition */
|
||||||
$this->markTestIncomplete(
|
$repetition = FactoryMuffin::create('FireflyIII\Models\PiggyBankRepetition');
|
||||||
'This test has not been implemented yet.'
|
$repetition->startdate = new Carbon('2014-01-01');
|
||||||
);
|
$repetition->targetdate = new Carbon('2014-12-31');
|
||||||
|
$repetition->save();
|
||||||
|
|
||||||
|
$parts = $this->object->calculateParts($repetition);
|
||||||
|
|
||||||
|
$this->assertCount(1, $parts);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::calculateParts
|
||||||
|
*/
|
||||||
|
public function testCalculatePartsWithReminder()
|
||||||
|
{
|
||||||
|
/** @var PiggyBankRepetition $repetition */
|
||||||
|
$repetition = FactoryMuffin::create('FireflyIII\Models\PiggyBankRepetition');
|
||||||
|
/** @var PiggyBank $piggyBank */
|
||||||
|
$piggyBank = FactoryMuffin::create('FireflyIII\Models\PiggyBank');
|
||||||
|
$piggyBank->startdate = new Carbon('2014-01-01');
|
||||||
|
$piggyBank->targetdate = new Carbon('2014-12-31');
|
||||||
|
$piggyBank->remind_me = 1;
|
||||||
|
$piggyBank->reminder = 'monthly';
|
||||||
|
$repetition->startdate = new Carbon('2014-01-01');
|
||||||
|
$repetition->targetdate = new Carbon('2014-12-31');
|
||||||
|
$repetition->piggy_bank_id = $piggyBank->id;
|
||||||
|
$repetition->save();
|
||||||
|
$piggyBank->save();
|
||||||
|
|
||||||
|
$parts = $this->object->calculateParts($repetition);
|
||||||
|
$this->assertCount(12, $parts);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::createEvent
|
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::createEvent
|
||||||
* @todo Implement testCreateEvent().
|
|
||||||
*/
|
*/
|
||||||
public function testCreateEvent()
|
public function testCreateEvent()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$piggyBank = FactoryMuffin::create('FireflyIII\Models\PiggyBank');
|
||||||
$this->markTestIncomplete(
|
$this->object->createEvent($piggyBank, 100);
|
||||||
'This test has not been implemented yet.'
|
|
||||||
);
|
$this->assertCount(1, $piggyBank->piggybankevents()->get());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::createPiggyBankPart
|
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::createPiggyBankPart
|
||||||
* @todo Implement testCreatePiggyBankPart().
|
|
||||||
*/
|
*/
|
||||||
public function testCreatePiggyBankPart()
|
public function testCreatePiggyBankPart()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$repetition = FactoryMuffin::create('FireflyIII\Models\PiggyBankRepetition');
|
||||||
$this->markTestIncomplete(
|
$data = [
|
||||||
'This test has not been implemented yet.'
|
'repetition' => $repetition,
|
||||||
);
|
'amountPerBar' => 100,
|
||||||
|
'currentAmount' => 100,
|
||||||
|
'cumulativeAmount' => 100,
|
||||||
|
'startDate' => new Carbon,
|
||||||
|
'targetDate' => new Carbon,
|
||||||
|
];
|
||||||
|
$part = $this->object->createPiggyBankPart($data);
|
||||||
|
$this->assertEquals($data['amountPerBar'], $part->getAmountPerBar());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::destroy
|
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::destroy
|
||||||
* @todo Implement testDestroy().
|
|
||||||
*/
|
*/
|
||||||
public function testDestroy()
|
public function testDestroy()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$piggyBank = FactoryMuffin::create('FireflyIII\Models\PiggyBank');
|
||||||
$this->markTestIncomplete(
|
|
||||||
'This test has not been implemented yet.'
|
$this->object->destroy($piggyBank);
|
||||||
);
|
|
||||||
|
$this->assertCount(0, PiggyBank::where('id', $piggyBank->id)->whereNull('deleted_at')->get());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::getEventSummarySet
|
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::getEventSummarySet
|
||||||
* @todo Implement testGetEventSummarySet().
|
|
||||||
*/
|
*/
|
||||||
public function testGetEventSummarySet()
|
public function testGetEventSummarySet()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$piggyBank = FactoryMuffin::create('FireflyIII\Models\PiggyBank');
|
||||||
$this->markTestIncomplete(
|
$set = $this->object->getEventSummarySet($piggyBank);
|
||||||
'This test has not been implemented yet.'
|
|
||||||
);
|
$this->assertCount(0, $set);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -96,46 +136,51 @@ class PiggyBankRepositoryTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testGetEvents()
|
public function testGetEvents()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$piggyBank = FactoryMuffin::create('FireflyIII\Models\PiggyBank');
|
||||||
$this->markTestIncomplete(
|
$set = $this->object->getEvents($piggyBank);
|
||||||
'This test has not been implemented yet.'
|
|
||||||
);
|
$this->assertCount(0, $set);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::getPiggyBanks
|
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::getPiggyBanks
|
||||||
* @todo Implement testGetPiggyBanks().
|
|
||||||
*/
|
*/
|
||||||
public function testGetPiggyBanks()
|
public function testGetPiggyBanks()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$piggyBank = FactoryMuffin::create('FireflyIII\Models\PiggyBank');
|
||||||
$this->markTestIncomplete(
|
$this->be($piggyBank->account->user);
|
||||||
'This test has not been implemented yet.'
|
$set = $this->object->getPiggyBanks();
|
||||||
);
|
|
||||||
|
$this->assertCount(1, $set);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::reset
|
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::reset
|
||||||
* @todo Implement testReset().
|
|
||||||
*/
|
*/
|
||||||
public function testReset()
|
public function testReset()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$piggyBank = FactoryMuffin::create('FireflyIII\Models\PiggyBank');
|
||||||
$this->markTestIncomplete(
|
$piggyBank->order = 4;
|
||||||
'This test has not been implemented yet.'
|
$piggyBank->save();
|
||||||
);
|
$this->be($piggyBank->account->user);
|
||||||
|
$this->object->reset();
|
||||||
|
|
||||||
|
$this->assertCount(1, PiggyBank::where('order', 0)->get());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::setOrder
|
* @covers FireflyIII\Repositories\PiggyBank\PiggyBankRepository::setOrder
|
||||||
* @todo Implement testSetOrder().
|
|
||||||
*/
|
*/
|
||||||
public function testSetOrder()
|
public function testSetOrder()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$piggyBank = FactoryMuffin::create('FireflyIII\Models\PiggyBank');
|
||||||
$this->markTestIncomplete(
|
$piggyBank->order = 4;
|
||||||
'This test has not been implemented yet.'
|
$this->be($piggyBank->account->user);
|
||||||
);
|
$piggyBank->save();
|
||||||
|
|
||||||
|
$this->object->setOrder($piggyBank->id, 3);
|
||||||
|
$newPiggy = PiggyBank::find($piggyBank->id);
|
||||||
|
$this->assertEquals(3, $newPiggy->order);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -144,10 +189,21 @@ class PiggyBankRepositoryTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testStore()
|
public function testStore()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$account = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
$this->markTestIncomplete(
|
|
||||||
'This test has not been implemented yet.'
|
$data = [
|
||||||
);
|
'remind_me' => 1,
|
||||||
|
'account_id' => $account->id,
|
||||||
|
'name' => 'Some piggy',
|
||||||
|
'targetamount' => 100,
|
||||||
|
'reminder_skip' => 0,
|
||||||
|
'order' => 1,
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
$piggyBank = $this->object->store($data);
|
||||||
|
|
||||||
|
$this->assertEquals(1, $piggyBank->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -156,9 +212,21 @@ class PiggyBankRepositoryTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testUpdate()
|
public function testUpdate()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$piggyBank = FactoryMuffin::create('FireflyIII\Models\PiggyBank');
|
||||||
$this->markTestIncomplete(
|
|
||||||
'This test has not been implemented yet.'
|
$data = [
|
||||||
);
|
'name' => 'Update piggy ' . rand(1, 100),
|
||||||
|
'account_id' => $piggyBank->account_id,
|
||||||
|
'targetamount' => 101,
|
||||||
|
'targetdate' => new Carbon,
|
||||||
|
'reminder' => null,
|
||||||
|
'startdate' => new Carbon,
|
||||||
|
'remind_me' => '1'
|
||||||
|
];
|
||||||
|
|
||||||
|
$new = $this->object->update($piggyBank, $data);
|
||||||
|
|
||||||
|
$this->assertEquals($data['name'], $new->name);
|
||||||
|
$this->assertEquals($piggyBank->id, $new->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
use Carbon\Carbon;
|
||||||
use FireflyIII\Repositories\Reminder\ReminderRepository;
|
use FireflyIII\Repositories\Reminder\ReminderRepository;
|
||||||
|
use League\FactoryMuffin\Facade as FactoryMuffin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generated by PHPUnit_SkeletonGenerator on 2015-05-05 at 19:19:32.
|
* Generated by PHPUnit_SkeletonGenerator on 2015-05-05 at 19:19:32.
|
||||||
@@ -18,6 +20,8 @@ class ReminderRepositoryTest extends TestCase
|
|||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
$helper = $this->mock('FireflyIII\Helpers\Reminders\ReminderHelperInterface');
|
||||||
|
$helper->shouldReceive('getReminderText')->andReturn('Hello!');
|
||||||
$this->object = new ReminderRepository;
|
$this->object = new ReminderRepository;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -33,49 +37,116 @@ class ReminderRepositoryTest extends TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Reminder\ReminderRepository::getActiveReminders
|
* @covers FireflyIII\Repositories\Reminder\ReminderRepository::getActiveReminders
|
||||||
* @todo Implement testGetActiveReminders().
|
|
||||||
*/
|
*/
|
||||||
public function testGetActiveReminders()
|
public function testGetActiveReminders()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$yesterday = Carbon::now()->subDay();
|
||||||
$this->markTestIncomplete(
|
$tomorrow = Carbon::now()->addDay();
|
||||||
'This test has not been implemented yet.'
|
|
||||||
);
|
$user = FactoryMuffin::create('FireflyIII\User');
|
||||||
|
for ($i = 0; $i < 3; $i++) {
|
||||||
|
$reminder = FactoryMuffin::create('FireflyIII\Models\Reminder');
|
||||||
|
$reminder->active = 1;
|
||||||
|
$reminder->notnow = 0;
|
||||||
|
$reminder->startdate = $yesterday;
|
||||||
|
$reminder->enddate = $tomorrow;
|
||||||
|
$reminder->user_id = $user->id;
|
||||||
|
$reminder->save();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$reminder = FactoryMuffin::create('FireflyIII\Models\Reminder');
|
||||||
|
$reminder->active = 0;
|
||||||
|
$reminder->notnow = 0;
|
||||||
|
$reminder->startdate = $yesterday;
|
||||||
|
$reminder->enddate = $tomorrow;
|
||||||
|
$reminder->user_id = $user->id;
|
||||||
|
$reminder->save();
|
||||||
|
$this->be($user);
|
||||||
|
|
||||||
|
$set = $this->object->getActiveReminders();
|
||||||
|
$this->assertCount(3, $set);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Reminder\ReminderRepository::getDismissedReminders
|
* @covers FireflyIII\Repositories\Reminder\ReminderRepository::getDismissedReminders
|
||||||
* @todo Implement testGetDismissedReminders().
|
|
||||||
*/
|
*/
|
||||||
public function testGetDismissedReminders()
|
public function testGetDismissedReminders()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
|
||||||
$this->markTestIncomplete(
|
$user = FactoryMuffin::create('FireflyIII\User');
|
||||||
'This test has not been implemented yet.'
|
for ($i = 0; $i < 3; $i++) {
|
||||||
);
|
$reminder = FactoryMuffin::create('FireflyIII\Models\Reminder');
|
||||||
|
$reminder->notnow = 1;
|
||||||
|
$reminder->user_id = $user->id;
|
||||||
|
$reminder->save();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$reminder = FactoryMuffin::create('FireflyIII\Models\Reminder');
|
||||||
|
$reminder->notnow = 0;
|
||||||
|
$reminder->user_id = $user->id;
|
||||||
|
$reminder->save();
|
||||||
|
$this->be($user);
|
||||||
|
|
||||||
|
$set = $this->object->getDismissedReminders();
|
||||||
|
$this->assertCount(3, $set);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Reminder\ReminderRepository::getExpiredReminders
|
* @covers FireflyIII\Repositories\Reminder\ReminderRepository::getExpiredReminders
|
||||||
* @todo Implement testGetExpiredReminders().
|
|
||||||
*/
|
*/
|
||||||
public function testGetExpiredReminders()
|
public function testGetExpiredReminders()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$yesterday = Carbon::now()->subDay();
|
||||||
$this->markTestIncomplete(
|
$tomorrow = Carbon::now()->addDay();
|
||||||
'This test has not been implemented yet.'
|
|
||||||
);
|
$user = FactoryMuffin::create('FireflyIII\User');
|
||||||
|
for ($i = 0; $i < 3; $i++) {
|
||||||
|
$reminder = FactoryMuffin::create('FireflyIII\Models\Reminder');
|
||||||
|
$reminder->active = 1;
|
||||||
|
$reminder->notnow = 0;
|
||||||
|
$reminder->startdate = $tomorrow;
|
||||||
|
$reminder->enddate = $yesterday;
|
||||||
|
$reminder->user_id = $user->id;
|
||||||
|
$reminder->save();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$reminder = FactoryMuffin::create('FireflyIII\Models\Reminder');
|
||||||
|
$reminder->active = 0;
|
||||||
|
$reminder->notnow = 0;
|
||||||
|
$reminder->startdate = $tomorrow;
|
||||||
|
$reminder->enddate = $yesterday;
|
||||||
|
$reminder->user_id = $user->id;
|
||||||
|
$reminder->save();
|
||||||
|
$this->be($user);
|
||||||
|
|
||||||
|
$set = $this->object->getExpiredReminders();
|
||||||
|
$this->assertCount(3, $set);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Reminder\ReminderRepository::getInactiveReminders
|
* @covers FireflyIII\Repositories\Reminder\ReminderRepository::getInactiveReminders
|
||||||
* @todo Implement testGetInactiveReminders().
|
|
||||||
*/
|
*/
|
||||||
public function testGetInactiveReminders()
|
public function testGetInactiveReminders()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$user = FactoryMuffin::create('FireflyIII\User');
|
||||||
$this->markTestIncomplete(
|
for ($i = 0; $i < 3; $i++) {
|
||||||
'This test has not been implemented yet.'
|
$reminder = FactoryMuffin::create('FireflyIII\Models\Reminder');
|
||||||
);
|
$reminder->active = 0;
|
||||||
|
$reminder->user_id = $user->id;
|
||||||
|
$reminder->save();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$reminder = FactoryMuffin::create('FireflyIII\Models\Reminder');
|
||||||
|
$reminder->active = 1;
|
||||||
|
$reminder->user_id = $user->id;
|
||||||
|
$reminder->save();
|
||||||
|
$this->be($user);
|
||||||
|
|
||||||
|
$set = $this->object->getInactiveReminders();
|
||||||
|
$this->assertCount(3, $set);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
use FireflyIII\Models\Tag;
|
||||||
|
use FireflyIII\Models\Transaction;
|
||||||
use FireflyIII\Repositories\Tag\TagRepository;
|
use FireflyIII\Repositories\Tag\TagRepository;
|
||||||
|
use League\FactoryMuffin\Facade as FactoryMuffin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generated by PHPUnit_SkeletonGenerator on 2015-05-05 at 19:19:32.
|
* Generated by PHPUnit_SkeletonGenerator on 2015-05-05 at 19:19:32.
|
||||||
@@ -31,27 +34,298 @@ class TagRepositoryTest extends TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Already connected tag and transaction journal returns FALSE.
|
||||||
|
*
|
||||||
* @covers FireflyIII\Repositories\Tag\TagRepository::connect
|
* @covers FireflyIII\Repositories\Tag\TagRepository::connect
|
||||||
* @todo Implement testConnect().
|
|
||||||
*/
|
*/
|
||||||
public function testConnect()
|
public function testConnectAlreadyConnected()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
$this->markTestIncomplete(
|
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||||
'This test has not been implemented yet.'
|
$journal->tags()->save($tag);
|
||||||
);
|
|
||||||
|
$result = $this->object->connect($journal, $tag);
|
||||||
|
$this->assertFalse($result);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A deposit cannot be connected to a balancing act.
|
||||||
|
*
|
||||||
|
* @covers FireflyIII\Repositories\Tag\TagRepository::connect
|
||||||
|
*/
|
||||||
|
public function testConnectBalancingOneDeposit()
|
||||||
|
{
|
||||||
|
$withdrawal = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$deposit = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$transfer = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
|
||||||
|
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
|
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||||
|
|
||||||
|
$journal->transaction_type_id = $deposit->id;
|
||||||
|
$tag->tagMode = 'balancingAct';
|
||||||
|
|
||||||
|
$tag->save();
|
||||||
|
$journal->save();
|
||||||
|
|
||||||
|
$result = $this->object->connect($journal, $tag);
|
||||||
|
$this->assertFalse($result);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connecting a single transfer to a balancing act is possible if there are no
|
||||||
|
* other transfers already connected.
|
||||||
|
*
|
||||||
|
* @covers FireflyIII\Repositories\Tag\TagRepository::connect
|
||||||
|
*/
|
||||||
|
public function testConnectBalancingOneTransfer()
|
||||||
|
{
|
||||||
|
$withdrawal = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$deposit = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$transfer = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
|
||||||
|
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
|
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||||
|
|
||||||
|
$journal->transaction_type_id = $transfer->id;
|
||||||
|
$tag->tagMode = 'balancingAct';
|
||||||
|
|
||||||
|
$tag->save();
|
||||||
|
$journal->save();
|
||||||
|
|
||||||
|
$result = $this->object->connect($journal, $tag);
|
||||||
|
$this->assertTrue($result);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connecting a single withdrawal to a balancing act is possible if there are
|
||||||
|
* not other withdrawals already connected.
|
||||||
|
*
|
||||||
|
* @covers FireflyIII\Repositories\Tag\TagRepository::connect
|
||||||
|
*/
|
||||||
|
public function testConnectBalancingOneWithdrawal()
|
||||||
|
{
|
||||||
|
$withdrawal = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$deposit = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$transfer = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
|
||||||
|
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
|
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||||
|
|
||||||
|
$journal->transaction_type_id = $withdrawal->id;
|
||||||
|
$tag->tagMode = 'balancingAct';
|
||||||
|
|
||||||
|
$tag->save();
|
||||||
|
$journal->save();
|
||||||
|
|
||||||
|
$result = $this->object->connect($journal, $tag);
|
||||||
|
$this->assertTrue($result);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers FireflyIII\Repositories\Tag\TagRepository::connect
|
||||||
|
*/
|
||||||
|
public function testConnectDefault()
|
||||||
|
{
|
||||||
|
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
|
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||||
|
$tag->tagMode = 'nothing';
|
||||||
|
$tag->save();
|
||||||
|
|
||||||
|
$result = $this->object->connect($journal, $tag);
|
||||||
|
$this->assertTrue($result);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Once one or more journals have been accepted by the tag, others must match the asset account
|
||||||
|
* id. For this to work, we must also create an asset account, and a transaction.
|
||||||
|
*
|
||||||
|
* @covers FireflyIII\Repositories\Tag\TagRepository::connect
|
||||||
|
*/
|
||||||
|
public function testConnectPaymentMultipleMatch()
|
||||||
|
{
|
||||||
|
$withdrawal = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$deposit = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$transfer = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
|
||||||
|
$expense = FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||||
|
$revenue = FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||||
|
$asset = FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||||
|
|
||||||
|
$account = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
|
|
||||||
|
|
||||||
|
$journal1 = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
|
$journal2 = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
|
|
||||||
|
// transactions for both:
|
||||||
|
Transaction::create(['account_id' => $account->id, 'transaction_journal_id' => $journal1->id, 'amount' => 100]);
|
||||||
|
Transaction::create(['account_id' => $account->id, 'transaction_journal_id' => $journal2->id, 'amount' => 100]);
|
||||||
|
|
||||||
|
|
||||||
|
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||||
|
|
||||||
|
$journal1->transaction_type_id = $withdrawal->id;
|
||||||
|
$journal2->transaction_type_id = $deposit->id;
|
||||||
|
$tag->tagMode = 'advancePayment';
|
||||||
|
$account->account_type_id = $asset->id;
|
||||||
|
|
||||||
|
$tag->save();
|
||||||
|
$journal1->save();
|
||||||
|
$journal2->save();
|
||||||
|
$account->save();
|
||||||
|
// connect journal1:
|
||||||
|
$journal1->tags()->save($tag);
|
||||||
|
|
||||||
|
$result = $this->object->connect($journal2, $tag);
|
||||||
|
$this->assertTrue($result);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Once one or more journals have been accepted by the tag, others must match the asset account
|
||||||
|
* id. For this to work, we must also create an asset account, and a transaction.
|
||||||
|
*
|
||||||
|
* @covers FireflyIII\Repositories\Tag\TagRepository::connect
|
||||||
|
*/
|
||||||
|
public function testConnectPaymentNoMatch()
|
||||||
|
{
|
||||||
|
$withdrawal = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$deposit = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$transfer = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
|
||||||
|
$expense = FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||||
|
$revenue = FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||||
|
$asset = FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||||
|
|
||||||
|
$account1 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
|
$account2 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||||
|
|
||||||
|
|
||||||
|
$journal1 = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
|
$journal2 = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
|
|
||||||
|
// transactions for both:
|
||||||
|
Transaction::create(['account_id' => $account1->id, 'transaction_journal_id' => $journal1->id, 'amount' => 100]);
|
||||||
|
Transaction::create(['account_id' => $account2->id, 'transaction_journal_id' => $journal2->id, 'amount' => 100]);
|
||||||
|
|
||||||
|
|
||||||
|
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||||
|
|
||||||
|
$journal1->transaction_type_id = $withdrawal->id;
|
||||||
|
$journal2->transaction_type_id = $deposit->id;
|
||||||
|
$tag->tagMode = 'advancePayment';
|
||||||
|
$account1->account_type_id = $asset->id;
|
||||||
|
$account2->account_type_id = $asset->id;
|
||||||
|
|
||||||
|
$tag->save();
|
||||||
|
$journal1->save();
|
||||||
|
$journal2->save();
|
||||||
|
$account1->save();
|
||||||
|
$account2->save();
|
||||||
|
// connect journal1:
|
||||||
|
$journal1->tags()->save($tag);
|
||||||
|
|
||||||
|
$result = $this->object->connect($journal2, $tag);
|
||||||
|
// account1 and account2 are different, so false:
|
||||||
|
$this->assertFalse($result);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An advance payment accepts no transfers
|
||||||
|
*
|
||||||
|
* @covers FireflyIII\Repositories\Tag\TagRepository::connect
|
||||||
|
*/
|
||||||
|
public function testConnectPaymentOneTransfer()
|
||||||
|
{
|
||||||
|
$withdrawal = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$deposit = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$transfer = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
|
||||||
|
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
|
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||||
|
|
||||||
|
$journal->transaction_type_id = $transfer->id;
|
||||||
|
$tag->tagMode = 'advancePayment';
|
||||||
|
|
||||||
|
$tag->save();
|
||||||
|
$journal->save();
|
||||||
|
|
||||||
|
$result = $this->object->connect($journal, $tag);
|
||||||
|
$this->assertFalse($result);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An advance payment accepts only one withdrawal, not two.
|
||||||
|
*
|
||||||
|
* @covers FireflyIII\Repositories\Tag\TagRepository::connect
|
||||||
|
*/
|
||||||
|
public function testConnectPaymentOneWithdrawal()
|
||||||
|
{
|
||||||
|
$withdrawal = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$deposit = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$transfer = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
|
||||||
|
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
|
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||||
|
|
||||||
|
$journal->transaction_type_id = $withdrawal->id;
|
||||||
|
$tag->tagMode = 'advancePayment';
|
||||||
|
|
||||||
|
$tag->save();
|
||||||
|
$journal->save();
|
||||||
|
|
||||||
|
$result = $this->object->connect($journal, $tag);
|
||||||
|
$this->assertTrue($result);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An advance payment accepts only one withdrawal, not two.
|
||||||
|
*
|
||||||
|
* @covers FireflyIII\Repositories\Tag\TagRepository::connect
|
||||||
|
*/
|
||||||
|
public function testConnectPaymentTwoWithdrawals()
|
||||||
|
{
|
||||||
|
$withdrawal = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$deposit = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
$transfer = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||||
|
|
||||||
|
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
|
$otherJournal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||||
|
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||||
|
|
||||||
|
$journal->transaction_type_id = $withdrawal->id;
|
||||||
|
$otherJournal->transaction_type_id = $withdrawal->id;
|
||||||
|
$tag->tagMode = 'advancePayment';
|
||||||
|
|
||||||
|
$tag->save();
|
||||||
|
$journal->save();
|
||||||
|
$otherJournal->save();
|
||||||
|
$otherJournal->tags()->save($tag);
|
||||||
|
|
||||||
|
$result = $this->object->connect($journal, $tag);
|
||||||
|
$this->assertFalse($result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Tag\TagRepository::destroy
|
* @covers FireflyIII\Repositories\Tag\TagRepository::destroy
|
||||||
* @todo Implement testDestroy().
|
|
||||||
*/
|
*/
|
||||||
public function testDestroy()
|
public function testDestroy()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||||
$this->markTestIncomplete(
|
$this->object->destroy($tag);
|
||||||
'This test has not been implemented yet.'
|
|
||||||
);
|
$this->assertCount(0, Tag::where('id', $tag->id)->whereNull('deleted_at')->get());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -60,33 +334,68 @@ class TagRepositoryTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testGet()
|
public function testGet()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$user = FactoryMuffin::create('FireflyIII\User');
|
||||||
$this->markTestIncomplete(
|
$tag1 = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||||
'This test has not been implemented yet.'
|
$tag2 = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||||
);
|
$tag1->tag = 'BBB';
|
||||||
|
$tag2->tag = 'AAA';
|
||||||
|
$tag1->user_id = $user->id;
|
||||||
|
$tag2->user_id = $user->id;
|
||||||
|
|
||||||
|
$tag1->save();
|
||||||
|
$tag2->save();
|
||||||
|
|
||||||
|
$this->be($user);
|
||||||
|
|
||||||
|
$set = $this->object->get();
|
||||||
|
|
||||||
|
$this->assertCount(2, $set);
|
||||||
|
$this->assertEquals('AAA', $set->first()->tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Tag\TagRepository::store
|
* @covers FireflyIII\Repositories\Tag\TagRepository::store
|
||||||
* @todo Implement testStore().
|
|
||||||
*/
|
*/
|
||||||
public function testStore()
|
public function testStore()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$user = FactoryMuffin::create('FireflyIII\User');
|
||||||
$this->markTestIncomplete(
|
|
||||||
'This test has not been implemented yet.'
|
$data = [
|
||||||
);
|
'tag' => 'Hello' . rand(1, 100),
|
||||||
|
'date' => '2012-01-01',
|
||||||
|
'description' => 'Some',
|
||||||
|
'latitude' => 12,
|
||||||
|
'longitude' => 13,
|
||||||
|
'zoomLevel' => 4,
|
||||||
|
'tagMode' => 'nothing'
|
||||||
|
];
|
||||||
|
$this->be($user);
|
||||||
|
|
||||||
|
$tag = $this->object->store($data);
|
||||||
|
$this->assertEquals($data['tag'], $tag->tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers FireflyIII\Repositories\Tag\TagRepository::update
|
* @covers FireflyIII\Repositories\Tag\TagRepository::update
|
||||||
* @todo Implement testUpdate().
|
|
||||||
*/
|
*/
|
||||||
public function testUpdate()
|
public function testUpdate()
|
||||||
{
|
{
|
||||||
// Remove the following lines when you implement this test.
|
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||||
$this->markTestIncomplete(
|
|
||||||
'This test has not been implemented yet.'
|
|
||||||
);
|
$data = [
|
||||||
|
'tag' => 'Hello' . rand(1, 100),
|
||||||
|
'date' => '2012-01-01',
|
||||||
|
'description' => 'Some',
|
||||||
|
'latitude' => 12,
|
||||||
|
'longitude' => 13,
|
||||||
|
'zoomLevel' => 4,
|
||||||
|
'tagMode' => 'nothing'
|
||||||
|
];
|
||||||
|
$this->be($tag->user);
|
||||||
|
|
||||||
|
$newTag = $this->object->update($tag, $data);
|
||||||
|
$this->assertEquals($data['tag'], $newTag->tag);
|
||||||
|
$this->assertEquals($tag->id, $newTag->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user