mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Merge branch 'release/3.4.1'
This commit is contained in:
commit
65c12fd0b2
@ -1,3 +1,3 @@
|
||||
src_dir: .
|
||||
coverage_clover: storage/coverage/clover.xml
|
||||
json_path: storage/coverage/coveralls-upload.json
|
||||
coverage_clover: build/logs/clover.xml
|
||||
json_path: build/logs/coveralls-upload.json
|
||||
|
22
.jshintrc
Normal file
22
.jshintrc
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"undef": true,
|
||||
"unused": false,
|
||||
"strict": true,
|
||||
"browser": true,
|
||||
"jquery": true,
|
||||
"devel": true,
|
||||
"globals": [
|
||||
"language",
|
||||
"token",
|
||||
"currencyCode",
|
||||
"$",
|
||||
"token",
|
||||
"accountID",
|
||||
"billID",
|
||||
"currentMonthName",
|
||||
"previousMonthName",
|
||||
"nextMonthName",
|
||||
"everything",
|
||||
"moment"
|
||||
]
|
||||
}
|
@ -6,10 +6,6 @@ php:
|
||||
- 5.5
|
||||
- 5.6
|
||||
|
||||
addons:
|
||||
code_climate:
|
||||
repo_token: 26489f9e854fcdf7e7660ba29c1455694685465b1f90329a79f7d2bf448acb61
|
||||
|
||||
install:
|
||||
- composer update
|
||||
- php artisan env
|
||||
@ -20,3 +16,5 @@ script:
|
||||
|
||||
after_script:
|
||||
- php vendor/bin/coveralls
|
||||
- CODECLIMATE_REPO_TOKEN=26489f9e854fcdf7e7660ba29c1455694685465b1f90329a79f7d2bf448acb61 ./vendor/bin/test-reporter --stdout > codeclimate.json
|
||||
- "curl -X POST -d @codeclimate.json -H 'Content-Type: application/json' -H 'User-Agent: Code Climate (PHP Test Reporter v0.1.1)' https://codeclimate.com/test_reports"
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Firefly III
|
||||
#### v3.4.0.10
|
||||
#### 3.4.1
|
||||
|
||||
[](https://travis-ci.org/JC5/firefly-iii)
|
||||
[](http://stillmaintained.com/JC5/firefly-iii)
|
||||
|
@ -5,9 +5,11 @@ namespace FireflyIII\Helpers\Reminders;
|
||||
use Amount;
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Config;
|
||||
use FireflyIII\Models\PiggyBank;
|
||||
use FireflyIII\Models\Reminder;
|
||||
use Navigation;
|
||||
use Preferences;
|
||||
|
||||
/**
|
||||
* Class ReminderHelper
|
||||
@ -154,14 +156,21 @@ class ReminderHelper implements ReminderHelperInterface
|
||||
$piggyBank = $reminder->remindersable;
|
||||
|
||||
if (is_null($piggyBank)) {
|
||||
return 'Piggy bank no longer exists.';
|
||||
return trans('firefly.piggy_bank_not_exists');
|
||||
}
|
||||
|
||||
if (is_null($piggyBank->targetdate)) {
|
||||
return 'Add money to this piggy bank to reach your target of ' . Amount::format($piggyBank->targetamount);
|
||||
return trans('firefly.add_any_amount_to_piggy', ['amount' => Amount::format($piggyBank->targetamount)]);
|
||||
}
|
||||
|
||||
return 'Add ' . Amount::format($reminder->metadata->perReminder) . ' to fill this piggy bank on ' . $piggyBank->targetdate->format('jS F Y');
|
||||
$lang = Preferences::get('language', 'en')->data;
|
||||
|
||||
return trans(
|
||||
'firefly.add_set_amount_to_piggy',
|
||||
[
|
||||
'amount' => Amount::format($reminder->metadata->perReminder),
|
||||
'date' => $piggyBank->targetdate->formatLocalized(Config::get('firefly.monthAndDay.' . $lang))
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -46,6 +46,8 @@ class AccountController extends Controller
|
||||
Session::put('accounts.create.url', URL::previous());
|
||||
}
|
||||
Session::forget('accounts.create.fromStore');
|
||||
Session::flash('gaEventCategory', 'accounts');
|
||||
Session::flash('gaEventAction', 'create-' . $what);
|
||||
|
||||
return view('accounts.create', compact('subTitleIcon', 'what', 'subTitle'));
|
||||
|
||||
@ -63,6 +65,8 @@ class AccountController extends Controller
|
||||
|
||||
// put previous url in session
|
||||
Session::put('accounts.delete.url', URL::previous());
|
||||
Session::flash('gaEventCategory', 'accounts');
|
||||
Session::flash('gaEventAction', 'delete-' . $typeName);
|
||||
|
||||
return view('accounts.delete', compact('account', 'subTitle'));
|
||||
}
|
||||
@ -126,6 +130,8 @@ class AccountController extends Controller
|
||||
'virtualBalance' => floatval($account->virtual_balance)
|
||||
];
|
||||
Session::flash('preFilled', $preFilled);
|
||||
Session::flash('gaEventCategory', 'accounts');
|
||||
Session::flash('gaEventAction', 'edit-' . $what);
|
||||
|
||||
return view('accounts.edit', compact('account', 'subTitle', 'subTitleIcon', 'openingBalance', 'what'));
|
||||
}
|
||||
|
@ -43,6 +43,8 @@ class BillController extends Controller
|
||||
Session::put('bills.create.url', URL::previous());
|
||||
}
|
||||
Session::forget('bills.create.fromStore');
|
||||
Session::flash('gaEventCategory', 'bills');
|
||||
Session::flash('gaEventAction', 'create');
|
||||
$subTitle = 'Create new bill';
|
||||
|
||||
return view('bills.create', compact('periods', 'subTitle'));
|
||||
@ -57,7 +59,9 @@ class BillController extends Controller
|
||||
{
|
||||
// put previous url in session
|
||||
Session::put('bills.delete.url', URL::previous());
|
||||
$subTitle = 'Delete "' . e($bill->name) . '"';
|
||||
Session::flash('gaEventCategory', 'bills');
|
||||
Session::flash('gaEventAction', 'delete');
|
||||
$subTitle = trans('firefly.delete_bill', ['name' => $bill->name]);
|
||||
|
||||
return view('bills.delete', compact('bill', 'subTitle'));
|
||||
}
|
||||
@ -93,6 +97,8 @@ class BillController extends Controller
|
||||
Session::put('bills.edit.url', URL::previous());
|
||||
}
|
||||
Session::forget('bills.edit.fromUpdate');
|
||||
Session::flash('gaEventCategory', 'bills');
|
||||
Session::flash('gaEventAction', 'edit');
|
||||
|
||||
return view('bills.edit', compact('subTitle', 'periods', 'bill'));
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php namespace FireflyIII\Http\Controllers;
|
||||
|
||||
use Amount;
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Http\Requests;
|
||||
@ -45,6 +46,9 @@ class BudgetController extends Controller
|
||||
$amount = intval(Input::get('amount'));
|
||||
$date = Session::get('start', Carbon::now()->startOfMonth());
|
||||
$limitRepetition = $repository->updateLimitAmount($budget, $date, $amount);
|
||||
if ($amount == 0) {
|
||||
$limitRepetition = null;
|
||||
}
|
||||
|
||||
return Response::json(['name' => $budget->name, 'repetition' => $limitRepetition ? $limitRepetition->id : 0]);
|
||||
|
||||
@ -60,6 +64,8 @@ class BudgetController extends Controller
|
||||
Session::put('budgets.create.url', URL::previous());
|
||||
}
|
||||
Session::forget('budgets.create.fromStore');
|
||||
Session::flash('gaEventCategory', 'budgets');
|
||||
Session::flash('gaEventAction', 'create');
|
||||
$subTitle = trans('firefly.create_new_budget');
|
||||
|
||||
return view('budgets.create', compact('subTitle'));
|
||||
@ -72,10 +78,12 @@ class BudgetController extends Controller
|
||||
*/
|
||||
public function delete(Budget $budget)
|
||||
{
|
||||
$subTitle = 'Delete budget' . e($budget->name) . '"';
|
||||
$subTitle = trans('firefly.delete_budget', ['name' => $budget->name]);
|
||||
|
||||
// put previous url in session
|
||||
Session::put('budgets.delete.url', URL::previous());
|
||||
Session::flash('gaEventCategory', 'budgets');
|
||||
Session::flash('gaEventAction', 'delete');
|
||||
|
||||
return view('budgets.delete', compact('budget', 'subTitle'));
|
||||
}
|
||||
@ -95,6 +103,7 @@ class BudgetController extends Controller
|
||||
|
||||
Session::flash('success', 'The budget "' . e($name) . '" was deleted.');
|
||||
|
||||
|
||||
return Redirect::to(Session::get('budgets.delete.url'));
|
||||
}
|
||||
|
||||
@ -112,6 +121,8 @@ class BudgetController extends Controller
|
||||
Session::put('budgets.edit.url', URL::previous());
|
||||
}
|
||||
Session::forget('budgets.edit.fromUpdate');
|
||||
Session::flash('gaEventCategory', 'budgets');
|
||||
Session::flash('gaEventAction', 'edit');
|
||||
|
||||
return view('budgets.edit', compact('budget', 'subTitle'));
|
||||
|
||||
@ -126,7 +137,9 @@ class BudgetController extends Controller
|
||||
{
|
||||
$budgets = $repository->getActiveBudgets();
|
||||
$inactive = $repository->getInactiveBudgets();
|
||||
|
||||
$spent = '0';
|
||||
$budgeted = '0';
|
||||
bcscale(2);
|
||||
/**
|
||||
* Do some cleanup:
|
||||
*/
|
||||
@ -134,24 +147,27 @@ class BudgetController extends Controller
|
||||
|
||||
|
||||
// loop the budgets:
|
||||
$budgets->each(
|
||||
function (Budget $budget) use ($repository) {
|
||||
$date = Session::get('start', Carbon::now()->startOfMonth());
|
||||
$end = Session::get('end', Carbon::now()->endOfMonth());
|
||||
$budget->spent = $repository->spentInPeriodCorrected($budget, $date, $end);
|
||||
$budget->currentRep = $repository->getCurrentRepetition($budget, $date);
|
||||
/** @var Budget $budget */
|
||||
foreach ($budgets as $budget) {
|
||||
$date = Session::get('start', Carbon::now()->startOfMonth());
|
||||
$end = Session::get('end', Carbon::now()->endOfMonth());
|
||||
$budget->spent = $repository->spentInPeriodCorrected($budget, $date, $end);
|
||||
$budget->currentRep = $repository->getCurrentRepetition($budget, $date);
|
||||
if ($budget->currentRep) {
|
||||
$budgeted = bcadd($budgeted, $budget->currentRep->amount);
|
||||
}
|
||||
$spent = bcadd($spent, $budget->spent);
|
||||
|
||||
}
|
||||
|
||||
$dateAsString = Session::get('start', Carbon::now()->startOfMonth())->format('FY');
|
||||
$budgetIncomeTotal = Preferences::get('budgetIncomeTotal' . $dateAsString, 1000)->data;
|
||||
$budgetMaximum = Preferences::get('budgetMaximum', 1000)->data;
|
||||
$defaultCurrency = Amount::getDefaultCurrency();
|
||||
|
||||
return view(
|
||||
'budgets.index', compact('budgetMaximum', 'budgetIncomeTotal', 'defaultCurrency', 'inactive', 'budgets', 'spent', 'budgeted')
|
||||
);
|
||||
|
||||
$dateAsString = Session::get('start', Carbon::now()->startOfMonth())->format('FY');
|
||||
$spent = $budgets->sum('spent');
|
||||
$amount = Preferences::get('budgetIncomeTotal' . $dateAsString, 1000)->data;
|
||||
$overspent = $spent > $amount;
|
||||
$spentPCT = $overspent ? ceil($amount / $spent * 100) : ceil($spent / $amount * 100);
|
||||
$budgetMax = Preferences::get('budgetMaximum', 1000);
|
||||
$budgetMaximum = $budgetMax->data;
|
||||
|
||||
return view('budgets.index', compact('budgetMaximum', 'inactive', 'budgets', 'spent', 'spentPCT', 'overspent', 'amount'));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -164,7 +180,10 @@ class BudgetController extends Controller
|
||||
$start = Session::get('start', Carbon::now()->startOfMonth());
|
||||
$end = Session::get('end', Carbon::now()->startOfMonth());
|
||||
$list = $repository->getWithoutBudget($start, $end);
|
||||
$subTitle = 'Transactions without a budget between ' . $start->format('jS F Y') . ' and ' . $end->format('jS F Y');
|
||||
$subTitle = trans(
|
||||
'firefly.without_budget_between',
|
||||
['start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat)]
|
||||
);
|
||||
|
||||
return view('budgets.noBudget', compact('list', 'subTitle'));
|
||||
}
|
||||
@ -198,7 +217,11 @@ class BudgetController extends Controller
|
||||
|
||||
$journals = $repository->getJournals($budget, $repetition);
|
||||
$limits = !is_null($repetition->id) ? [$repetition->budgetLimit] : $repository->getBudgetLimits($budget);
|
||||
$subTitle = !is_null($repetition->id) ? e($budget->name) . ' in ' . $repetition->startdate->format('F Y') : e($budget->name);
|
||||
$subTitle = !is_null($repetition->id)
|
||||
?
|
||||
trans('firefly.budget_in_month', ['name' => $budget->name, 'month' => $repetition->startdate->formatLocalized($this->monthFormat)])
|
||||
:
|
||||
e($budget->name);
|
||||
$journals->setPath('/budgets/show/' . $budget->id);
|
||||
|
||||
return view('budgets.show', compact('limits', 'budget', 'repetition', 'journals', 'subTitle'));
|
||||
|
@ -40,6 +40,8 @@ class CategoryController extends Controller
|
||||
Session::put('categories.create.url', URL::previous());
|
||||
}
|
||||
Session::forget('categories.create.fromStore');
|
||||
Session::flash('gaEventCategory', 'categories');
|
||||
Session::flash('gaEventAction', 'create');
|
||||
$subTitle = 'Create a new category';
|
||||
|
||||
return view('categories.create', compact('subTitle'));
|
||||
@ -52,10 +54,12 @@ class CategoryController extends Controller
|
||||
*/
|
||||
public function delete(Category $category)
|
||||
{
|
||||
$subTitle = 'Delete category "' . e($category->name) . '"';
|
||||
$subTitle = trans('firefly.delete_category', ['name' => $category->name]);
|
||||
|
||||
// put previous url in session
|
||||
Session::put('categories.delete.url', URL::previous());
|
||||
Session::flash('gaEventCategory', 'categories');
|
||||
Session::flash('gaEventAction', 'delete');
|
||||
|
||||
return view('categories.delete', compact('category', 'subTitle'));
|
||||
}
|
||||
@ -91,6 +95,8 @@ class CategoryController extends Controller
|
||||
Session::put('categories.edit.url', URL::previous());
|
||||
}
|
||||
Session::forget('categories.edit.fromUpdate');
|
||||
Session::flash('gaEventCategory', 'categories');
|
||||
Session::flash('gaEventAction', 'edit');
|
||||
|
||||
return view('categories.edit', compact('category', 'subTitle'));
|
||||
|
||||
|
@ -45,6 +45,8 @@ class CurrencyController extends Controller
|
||||
Session::put('currency.create.url', URL::previous());
|
||||
}
|
||||
Session::forget('currency.create.fromStore');
|
||||
Session::flash('gaEventCategory', 'currency');
|
||||
Session::flash('gaEventAction', 'create');
|
||||
|
||||
return view('currency.create', compact('subTitleIcon', 'subTitle'));
|
||||
}
|
||||
@ -84,6 +86,8 @@ class CurrencyController extends Controller
|
||||
|
||||
// put previous url in session
|
||||
Session::put('currency.delete.url', URL::previous());
|
||||
Session::flash('gaEventCategory', 'currency');
|
||||
Session::flash('gaEventAction', 'delete');
|
||||
|
||||
|
||||
return view('currency.delete', compact('currency'));
|
||||
@ -127,6 +131,8 @@ class CurrencyController extends Controller
|
||||
Session::put('currency.edit.url', URL::previous());
|
||||
}
|
||||
Session::forget('currency.edit.fromUpdate');
|
||||
Session::flash('gaEventCategory', 'currency');
|
||||
Session::flash('gaEventAction', 'edit');
|
||||
|
||||
return view('currency.edit', compact('currency', 'subTitle', 'subTitleIcon'));
|
||||
|
||||
|
@ -72,6 +72,8 @@ class PiggyBankController extends Controller
|
||||
Session::put('piggy-banks.create.url', URL::previous());
|
||||
}
|
||||
Session::forget('piggy-banks.create.fromStore');
|
||||
Session::flash('gaEventCategory', 'piggy-banks');
|
||||
Session::flash('gaEventAction', 'create');
|
||||
|
||||
return view('piggy-banks.create', compact('accounts', 'periods', 'subTitle', 'subTitleIcon'));
|
||||
}
|
||||
@ -83,10 +85,12 @@ class PiggyBankController extends Controller
|
||||
*/
|
||||
public function delete(PiggyBank $piggyBank)
|
||||
{
|
||||
$subTitle = 'Delete "' . e($piggyBank->name) . '"';
|
||||
$subTitle = trans('firefly.delete_piggy_bank', ['name' => $piggyBank->name]);
|
||||
|
||||
// put previous url in session
|
||||
Session::put('piggy-banks.delete.url', URL::previous());
|
||||
Session::flash('gaEventCategory', 'piggy-banks');
|
||||
Session::flash('gaEventAction', 'delete');
|
||||
|
||||
return view('piggy-banks.delete', compact('piggyBank', 'subTitle'));
|
||||
}
|
||||
@ -118,7 +122,7 @@ class PiggyBankController extends Controller
|
||||
|
||||
$periods = Config::get('firefly.piggy_bank_periods');
|
||||
$accounts = ExpandedForm::makeSelectList($repository->getAccounts(['Default account', 'Asset account']));
|
||||
$subTitle = 'Edit piggy bank "' . e($piggyBank->name) . '"';
|
||||
$subTitle = trans('firefly.update_piggy_title', ['name' => $piggyBank->name]);
|
||||
$subTitleIcon = 'fa-pencil';
|
||||
|
||||
/*
|
||||
@ -138,6 +142,8 @@ class PiggyBankController extends Controller
|
||||
'remind_me' => intval($piggyBank->remind_me) == 1 && !is_null($piggyBank->reminder) ? true : false
|
||||
];
|
||||
Session::flash('preFilled', $preFilled);
|
||||
Session::flash('gaEventCategory', 'piggy-banks');
|
||||
Session::flash('gaEventAction', 'edit');
|
||||
|
||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||
if (Session::get('piggy-banks.edit.fromUpdate') !== true) {
|
||||
|
@ -109,6 +109,8 @@ class ProfileController extends Controller
|
||||
// DELETE!
|
||||
Auth::user()->delete();
|
||||
Session::flush();
|
||||
Session::flash('gaEventCategory', 'user');
|
||||
Session::flash('gaEventAction', 'delete-account');
|
||||
|
||||
return Redirect::route('index');
|
||||
}
|
||||
|
@ -90,6 +90,10 @@ class ReportController extends Controller
|
||||
$balance = $this->helper->getBalanceReport($start, $end, $shared);
|
||||
$bills = $this->helper->getBillReport($start, $end, $shared);
|
||||
|
||||
Session::flash('gaEventCategory', 'report');
|
||||
Session::flash('gaEventAction', 'month');
|
||||
Session::flash('gaEventLabel', $start->format('F Y'));
|
||||
|
||||
|
||||
return view(
|
||||
'reports.month',
|
||||
@ -133,6 +137,10 @@ class ReportController extends Controller
|
||||
$incomes = $this->helper->getIncomeReport($start, $end, $shared);
|
||||
$expenses = $this->helper->getExpenseReport($start, $end, $shared);
|
||||
|
||||
Session::flash('gaEventCategory', 'report');
|
||||
Session::flash('gaEventAction', 'year');
|
||||
Session::flash('gaEventLabel', $start->format('Y'));
|
||||
|
||||
|
||||
return view(
|
||||
'reports.year',
|
||||
|
@ -31,6 +31,9 @@ use View;
|
||||
*/
|
||||
class TagController extends Controller
|
||||
{
|
||||
|
||||
public $tagOptions = [];
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
@ -40,12 +43,12 @@ class TagController extends Controller
|
||||
View::share('title', 'Tags');
|
||||
View::share('mainTitleIcon', 'fa-tags');
|
||||
View::share('hideTags', true);
|
||||
$tagOptions = [
|
||||
$this->tagOptions = [
|
||||
'nothing' => 'Just a regular tag.',
|
||||
'balancingAct' => 'The tag takes at most two transactions; an expense and a transfer. They\'ll balance each other out.',
|
||||
'advancePayment' => 'The tag accepts one expense and any number of deposits aimed to repay the original expense.',
|
||||
];
|
||||
View::share('tagOptions', $tagOptions);
|
||||
View::share('tagOptions', $this->tagOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -67,6 +70,8 @@ class TagController extends Controller
|
||||
Session::put('tags.create.url', URL::previous());
|
||||
}
|
||||
Session::forget('tags.create.fromStore');
|
||||
Session::flash('gaEventCategory', 'tags');
|
||||
Session::flash('gaEventAction', 'create');
|
||||
|
||||
return view('tags.create', compact('subTitle', 'subTitleIcon'));
|
||||
}
|
||||
@ -78,10 +83,12 @@ class TagController extends Controller
|
||||
*/
|
||||
public function delete(Tag $tag)
|
||||
{
|
||||
$subTitle = 'Delete "' . e($tag->tag) . '"';
|
||||
$subTitle = trans('firefly.delete_tag', ['name' => $tag->tag]);
|
||||
|
||||
// put previous url in session
|
||||
Session::put('tags.delete.url', URL::previous());
|
||||
Session::flash('gaEventCategory', 'tags');
|
||||
Session::flash('gaEventAction', 'delete');
|
||||
|
||||
return view('tags.delete', compact('tag', 'subTitle'));
|
||||
}
|
||||
@ -108,7 +115,7 @@ class TagController extends Controller
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public function edit(Tag $tag)
|
||||
public function edit(Tag $tag, TagRepositoryInterface $repository)
|
||||
{
|
||||
$subTitle = 'Edit tag "' . e($tag->tag) . '"';
|
||||
$subTitleIcon = 'fa-tag';
|
||||
@ -116,67 +123,16 @@ class TagController extends Controller
|
||||
/*
|
||||
* Default tag options (again)
|
||||
*/
|
||||
$tagOptions = [
|
||||
'nothing' => 'Just a regular tag.',
|
||||
'balancingAct' => 'The tag takes at most two transactions; an expense and a transfer. They\'ll balance each other out.',
|
||||
'advancePayment' => 'The tag accepts one expense and any number of deposits aimed to repay the original expense.',
|
||||
];
|
||||
$tagOptions = $this->tagOptions;
|
||||
|
||||
/*
|
||||
* Can this tag become another type?
|
||||
*/
|
||||
$allowToAdvancePayment = true;
|
||||
$allowToBalancingAct = true;
|
||||
|
||||
/*
|
||||
* If this tag is a balancing act, and it contains transfers, it cannot be
|
||||
* changes to an advancePayment.
|
||||
*/
|
||||
|
||||
if ($tag->tagMode == 'balancingAct' || $tag->tagMode == 'nothing') {
|
||||
foreach ($tag->transactionjournals as $journal) {
|
||||
if ($journal->transactionType->type == 'Transfer') {
|
||||
$allowToAdvancePayment = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If this tag contains more than one expenses, it cannot become an advance payment.
|
||||
*/
|
||||
$count = 0;
|
||||
foreach ($tag->transactionjournals as $journal) {
|
||||
if ($journal->transactionType->type == 'Withdrawal') {
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
if ($count > 1) {
|
||||
$allowToAdvancePayment = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* If has more than two transactions already, cannot become a balancing act:
|
||||
*/
|
||||
if ($tag->transactionjournals->count() > 2) {
|
||||
$allowToBalancingAct = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* If any transaction is a deposit, cannot become a balancing act.
|
||||
*/
|
||||
$count = 0;
|
||||
foreach ($tag->transactionjournals as $journal) {
|
||||
if ($journal->transactionType->type == 'Deposit') {
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
if ($count > 0) {
|
||||
$allowToBalancingAct = false;
|
||||
}
|
||||
|
||||
$allowAdvance = $repository->tagAllowAdvance($tag);
|
||||
$allowToBalancingAct = $repository->tagAllowBalancing($tag);
|
||||
|
||||
// edit tag options:
|
||||
if ($allowToAdvancePayment === false) {
|
||||
if ($allowAdvance === false) {
|
||||
unset($tagOptions['advancePayment']);
|
||||
}
|
||||
if ($allowToBalancingAct === false) {
|
||||
@ -189,6 +145,8 @@ class TagController extends Controller
|
||||
Session::put('tags.edit.url', URL::previous());
|
||||
}
|
||||
Session::forget('tags.edit.fromUpdate');
|
||||
Session::flash('gaEventCategory', 'tags');
|
||||
Session::flash('gaEventAction', 'edit');
|
||||
|
||||
return view('tags.edit', compact('tag', 'subTitle', 'subTitleIcon', 'tagOptions'));
|
||||
}
|
||||
|
@ -62,6 +62,8 @@ class TransactionController extends Controller
|
||||
Session::put('transactions.create.url', URL::previous());
|
||||
}
|
||||
Session::forget('transactions.create.fromStore');
|
||||
Session::flash('gaEventCategory', 'transactions');
|
||||
Session::flash('gaEventAction', 'create-' . $what);
|
||||
|
||||
asort($piggies);
|
||||
|
||||
@ -79,10 +81,12 @@ class TransactionController extends Controller
|
||||
public function delete(TransactionJournal $journal)
|
||||
{
|
||||
$type = strtolower($journal->transactionType->type);
|
||||
$subTitle = 'Delete ' . e($type) . ' "' . e($journal->description) . '"';
|
||||
$subTitle = trans('firefly.delete_' . $type, ['description' => $journal->description]);
|
||||
|
||||
// put previous url in session
|
||||
Session::put('transactions.delete.url', URL::previous());
|
||||
Session::flash('gaEventCategory', 'transactions');
|
||||
Session::flash('gaEventAction', 'delete-' . $type);
|
||||
|
||||
return view('transactions.delete', compact('journal', 'subTitle'));
|
||||
|
||||
@ -158,6 +162,8 @@ class TransactionController extends Controller
|
||||
$preFilled['account_to_id'] = $transactions[0]->account->id;
|
||||
|
||||
Session::flash('preFilled', $preFilled);
|
||||
Session::flash('gaEventCategory', 'transactions');
|
||||
Session::flash('gaEventAction', 'edit-' . $what);
|
||||
|
||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||
if (Session::get('transactions.edit.fromUpdate') !== true) {
|
||||
|
@ -6,7 +6,7 @@ use Config;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Http\Request;
|
||||
use Preferences;
|
||||
|
||||
use Carbon\Carbon;
|
||||
/**
|
||||
* Class Authenticate
|
||||
*
|
||||
@ -54,6 +54,7 @@ class Authenticate
|
||||
// if logged in, set user language:
|
||||
$pref = Preferences::get('language', 'en');
|
||||
App::setLocale($pref->data);
|
||||
Carbon::setLocale($pref->data);
|
||||
|
||||
setlocale(LC_TIME, Config::get('firefly.locales.' . $pref->data));
|
||||
|
||||
|
@ -4,12 +4,8 @@ use Closure;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\BudgetLimit;
|
||||
use FireflyIII\Models\Category;
|
||||
use FireflyIII\Models\LimitRepetition;
|
||||
use FireflyIII\Models\PiggyBank;
|
||||
use FireflyIII\Models\PiggyBankEvent;
|
||||
use FireflyIII\Models\PiggyBankRepetition;
|
||||
use FireflyIII\Models\Preference;
|
||||
use FireflyIII\Models\Reminder;
|
||||
use FireflyIII\Models\Transaction;
|
||||
@ -56,131 +52,173 @@ class Cleanup
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
if ($this->auth->guest()) {
|
||||
if ($request->ajax()) {
|
||||
return response('Unauthorized.', 401);
|
||||
} else {
|
||||
return redirect()->guest('auth/login');
|
||||
}
|
||||
return response('Unauthorized.', 401);
|
||||
}
|
||||
$run = env('RUNCLEANUP') == 'true' ? true : false;
|
||||
$count = 0;
|
||||
$count = -1;
|
||||
|
||||
if ($run) {
|
||||
// encrypt account name
|
||||
$set = Account::where('encrypted', 0)->take(5)->get();
|
||||
/** @var Account $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$name = $entry->name;
|
||||
$entry->name = $name;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $name);
|
||||
bcscale(0);
|
||||
|
||||
// encrypt bill name
|
||||
$set = Bill::where('name_encrypted', 0)->take(5)->get();
|
||||
/** @var Bill $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$name = $entry->name;
|
||||
$entry->name = $name;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $name);
|
||||
|
||||
// encrypt bill match
|
||||
$set = Bill::where('match_encrypted', 0)->take(5)->get();
|
||||
/** @var Bill $entry */
|
||||
foreach ($set as $entry) {
|
||||
$match = $entry->match;
|
||||
$entry->match = $match;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $match);
|
||||
|
||||
// encrypt budget name
|
||||
$set = Budget::where('encrypted', 0)->take(5)->get();
|
||||
/** @var Budget $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$name = $entry->name;
|
||||
$entry->name = $name;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $name);
|
||||
|
||||
// encrypt category name
|
||||
$set = Category::where('encrypted', 0)->take(5)->get();
|
||||
/** @var Category $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$name = $entry->name;
|
||||
$entry->name = $name;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $name);
|
||||
|
||||
// encrypt piggy bank name
|
||||
$set = PiggyBank::where('encrypted', 0)->take(5)->get();
|
||||
/** @var PiggyBank $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$name = $entry->name;
|
||||
$entry->name = $name;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $name);
|
||||
|
||||
// encrypt transaction journal description
|
||||
$set = TransactionJournal::where('encrypted', 0)->take(5)->get();
|
||||
/** @var TransactionJournal $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$description = $entry->description;
|
||||
$entry->description = $description;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $description);
|
||||
|
||||
// encrypt reminder metadata
|
||||
$set = Reminder::where('encrypted', 0)->take(5)->get();
|
||||
/** @var Reminder $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$metadata = $entry->metadata;
|
||||
$entry->metadata = $metadata;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $metadata);
|
||||
|
||||
//encrypt preference name
|
||||
$set = Preference::whereNull('name_encrypted')->take(5)->get();
|
||||
/** @var Preference $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$name = $entry->name;
|
||||
$entry->name = $name;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $name);
|
||||
|
||||
//encrypt preference data
|
||||
$set = Preference::whereNull('data_encrypted')->take(5)->get();
|
||||
/** @var Preference $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$data = $entry->data;
|
||||
$entry->data = $data;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $data);
|
||||
if (env('RUNCLEANUP') == 'true') {
|
||||
$count = 0;
|
||||
$count = bcadd($count, $this->encryptAccountAndBills());
|
||||
$count = bcadd($count, $this->encryptBudgetsAndCategories());
|
||||
$count = bcadd($count, $this->encryptPiggiesAndJournals());
|
||||
$count = bcadd($count, $this->encryptRemindersAndPreferences());
|
||||
|
||||
}
|
||||
if ($count == 0 && $run) {
|
||||
if ($count == 0) {
|
||||
Session::flash('warning', 'Please open the .env file and change RUNCLEANUP=true to RUNCLEANUP=false');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
protected function encryptAccountAndBills()
|
||||
{
|
||||
$count = 0;
|
||||
// encrypt account name
|
||||
$set = Account::where('encrypted', 0)->take(5)->get();
|
||||
/** @var Account $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$name = $entry->name;
|
||||
$entry->name = $name;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $name);
|
||||
|
||||
// encrypt bill name
|
||||
$set = Bill::where('name_encrypted', 0)->take(5)->get();
|
||||
/** @var Bill $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$name = $entry->name;
|
||||
$entry->name = $name;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $name);
|
||||
|
||||
// encrypt bill match
|
||||
$set = Bill::where('match_encrypted', 0)->take(5)->get();
|
||||
/** @var Bill $entry */
|
||||
foreach ($set as $entry) {
|
||||
$match = $entry->match;
|
||||
$entry->match = $match;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $match);
|
||||
|
||||
|
||||
return $count;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
protected function encryptBudgetsAndCategories()
|
||||
{
|
||||
$count = 0;
|
||||
// encrypt budget name
|
||||
$set = Budget::where('encrypted', 0)->take(5)->get();
|
||||
/** @var Budget $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$name = $entry->name;
|
||||
$entry->name = $name;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $name);
|
||||
|
||||
// encrypt category name
|
||||
$set = Category::where('encrypted', 0)->take(5)->get();
|
||||
/** @var Category $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$name = $entry->name;
|
||||
$entry->name = $name;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $name);
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
protected function encryptPiggiesAndJournals()
|
||||
{
|
||||
$count = 0;
|
||||
// encrypt piggy bank name
|
||||
$set = PiggyBank::where('encrypted', 0)->take(5)->get();
|
||||
/** @var PiggyBank $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$name = $entry->name;
|
||||
$entry->name = $name;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $name);
|
||||
|
||||
// encrypt transaction journal description
|
||||
$set = TransactionJournal::where('encrypted', 0)->take(5)->get();
|
||||
/** @var TransactionJournal $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$description = $entry->description;
|
||||
$entry->description = $description;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $description);
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
protected function encryptRemindersAndPreferences()
|
||||
{
|
||||
$count = 0;
|
||||
// encrypt reminder metadata
|
||||
$set = Reminder::where('encrypted', 0)->take(5)->get();
|
||||
/** @var Reminder $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$metadata = $entry->metadata;
|
||||
$entry->metadata = $metadata;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $metadata);
|
||||
|
||||
//encrypt preference name
|
||||
$set = Preference::whereNull('name_encrypted')->take(5)->get();
|
||||
/** @var Preference $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$name = $entry->name;
|
||||
$entry->name = $name;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $name);
|
||||
|
||||
//encrypt preference data
|
||||
$set = Preference::whereNull('data_encrypted')->take(5)->get();
|
||||
/** @var Preference $entry */
|
||||
foreach ($set as $entry) {
|
||||
$count++;
|
||||
$data = $entry->data;
|
||||
$entry->data = $data;
|
||||
$entry->save();
|
||||
}
|
||||
unset($set, $entry, $data);
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,6 +6,8 @@ use Illuminate\Support\ServiceProvider;
|
||||
* Class AppServiceProvider
|
||||
*
|
||||
* @package FireflyIII\Providers
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
@ -6,6 +6,8 @@ use Illuminate\Support\ServiceProvider;
|
||||
/**
|
||||
* Class BusServiceProvider
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @package FireflyIII\Providers
|
||||
*/
|
||||
class BusServiceProvider extends ServiceProvider
|
||||
|
@ -6,6 +6,8 @@ use Illuminate\Support\ServiceProvider;
|
||||
* Class ConfigServiceProvider
|
||||
*
|
||||
* @package FireflyIII\Providers
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
*/
|
||||
class ConfigServiceProvider extends ServiceProvider
|
||||
{
|
||||
@ -23,232 +25,7 @@ class ConfigServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
config(
|
||||
[
|
||||
'twigbridge' => [
|
||||
|
||||
'twig' => [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Extension
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| File extension for Twig view files.
|
||||
|
|
||||
*/
|
||||
'extension' => 'twig',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Accepts all Twig environment configuration options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| http://twig.sensiolabs.org/doc/api.html#environment-options
|
||||
|
|
||||
*/
|
||||
'environment' => [
|
||||
|
||||
// When set to true, the generated templates have a __toString() method
|
||||
// that you can use to display the generated nodes.
|
||||
// default: false
|
||||
'debug' => config('app.debug', false),
|
||||
|
||||
// The charset used by the templates.
|
||||
// default: utf-8
|
||||
'charset' => 'utf-8',
|
||||
|
||||
// The base template class to use for generated templates.
|
||||
// default: TwigBridge\Twig\Template
|
||||
'base_template_class' => 'TwigBridge\Twig\Template',
|
||||
|
||||
// An absolute path where to store the compiled templates, or false to disable caching. If null
|
||||
// then the cache file path is used.
|
||||
// default: cache file storage path
|
||||
'cache' => null,
|
||||
|
||||
// When developing with Twig, it's useful to recompile the template
|
||||
// whenever the source code changes. If you don't provide a value
|
||||
// for the auto_reload option, it will be determined automatically based on the debug value.
|
||||
'auto_reload' => true,
|
||||
|
||||
// If set to false, Twig will silently ignore invalid variables
|
||||
// (variables and or attributes/methods that do not exist) and
|
||||
// replace them with a null value. When set to true, Twig throws an exception instead.
|
||||
// default: false
|
||||
'strict_variables' => false,
|
||||
|
||||
// If set to true, auto-escaping will be enabled by default for all templates.
|
||||
// default: true
|
||||
'autoescape' => true,
|
||||
|
||||
// A flag that indicates which optimizations to apply
|
||||
// (default to -1 -- all optimizations are enabled; set it to 0 to disable)
|
||||
'optimizations' => -1,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global variables
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These will always be passed in and can be accessed as Twig variables.
|
||||
| NOTE: these will be overwritten if you pass data into the view with the same key.
|
||||
|
|
||||
*/
|
||||
'globals' => [],
|
||||
],
|
||||
|
||||
'extensions' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Extensions
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Enabled extensions.
|
||||
|
|
||||
| `Twig_Extension_Debug` is enabled automatically if twig.debug is TRUE.
|
||||
|
|
||||
*/
|
||||
'enabled' => [
|
||||
'TwigBridge\Extension\Loader\Facades',
|
||||
'TwigBridge\Extension\Loader\Filters',
|
||||
'TwigBridge\Extension\Loader\Functions',
|
||||
|
||||
'TwigBridge\Extension\Laravel\Auth',
|
||||
'TwigBridge\Extension\Laravel\Config',
|
||||
'TwigBridge\Extension\Laravel\Dump',
|
||||
'TwigBridge\Extension\Laravel\Input',
|
||||
'TwigBridge\Extension\Laravel\Session',
|
||||
'TwigBridge\Extension\Laravel\String',
|
||||
'TwigBridge\Extension\Laravel\Translator',
|
||||
'TwigBridge\Extension\Laravel\Url',
|
||||
|
||||
// 'TwigBridge\Extension\Laravel\Form',
|
||||
// 'TwigBridge\Extension\Laravel\Html',
|
||||
// 'TwigBridge\Extension\Laravel\Legacy\Facades',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Facades
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Available facades. Access like `{{ Config.get('foo.bar') }}`.
|
||||
|
|
||||
| Each facade can take an optional array of options. To mark the whole facade
|
||||
| as safe you can set the option `'is_safe' => true`. Setting the facade as
|
||||
| safe means that any HTML returned will not be escaped.
|
||||
|
|
||||
| It is advisable to not set the whole facade as safe and instead mark the
|
||||
| each appropriate method as safe for security reasons. You can do that with
|
||||
| the following syntax:
|
||||
|
|
||||
| <code>
|
||||
| 'Form' => [
|
||||
| 'is_safe' => [
|
||||
| 'open'
|
||||
| ]
|
||||
| ]
|
||||
| </code>
|
||||
|
|
||||
| The values of the `is_safe` array must match the called method on the facade
|
||||
| in order to be marked as safe.
|
||||
|
|
||||
*/
|
||||
'facades' => [
|
||||
'Breadcrumbs' => [
|
||||
'is_safe' => [
|
||||
'renderIfExists'
|
||||
]
|
||||
],
|
||||
'Session',
|
||||
'Route',
|
||||
'Auth',
|
||||
'Lang',
|
||||
'URL',
|
||||
'Config',
|
||||
'ExpandedForm' => [
|
||||
'is_safe' => [
|
||||
'date', 'text', 'select', 'balance', 'optionsList', 'checkbox', 'amount', 'tags', 'integer', 'textarea', 'location',
|
||||
'multiRadio'
|
||||
]
|
||||
],
|
||||
'Form' => [
|
||||
'is_safe' => [
|
||||
'input', 'select', 'checkbox', 'model', 'open', 'radio', 'textarea'
|
||||
]
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Functions
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Available functions. Access like `{{ secure_url(...) }}`.
|
||||
|
|
||||
| Each function can take an optional array of options. These options are
|
||||
| passed directly to `Twig_SimpleFunction`.
|
||||
|
|
||||
| So for example, to mark a function as safe you can do the following:
|
||||
|
|
||||
| <code>
|
||||
| 'link_to' => [
|
||||
| 'is_safe' => ['html']
|
||||
| ]
|
||||
| </code>
|
||||
|
|
||||
| The options array also takes a `callback` that allows you to name the
|
||||
| function differently in your Twig templates than what it's actually called.
|
||||
|
|
||||
| <code>
|
||||
| 'link' => [
|
||||
| 'callback' => 'link_to'
|
||||
| ]
|
||||
| </code>
|
||||
|
|
||||
*/
|
||||
'functions' => [
|
||||
'elixir',
|
||||
'head',
|
||||
'last',
|
||||
'old'
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Filters
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Available filters. Access like `{{ variable|filter }}`.
|
||||
|
|
||||
| Each filter can take an optional array of options. These options are
|
||||
| passed directly to `Twig_SimpleFilter`.
|
||||
|
|
||||
| So for example, to mark a filter as safe you can do the following:
|
||||
|
|
||||
| <code>
|
||||
| 'studly_case' => [
|
||||
| 'is_safe' => ['html']
|
||||
| ]
|
||||
| </code>
|
||||
|
|
||||
| The options array also takes a `callback` that allows you to name the
|
||||
| filter differently in your Twig templates than what is actually called.
|
||||
|
|
||||
| <code>
|
||||
| 'snake' => [
|
||||
| 'callback' => 'snake_case'
|
||||
| ]
|
||||
| </code>
|
||||
|
|
||||
*/
|
||||
'filters' => [],
|
||||
],
|
||||
]
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ use Validator;
|
||||
* Class FireflyServiceProvider
|
||||
*
|
||||
* @package FireflyIII\Providers
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class FireflyServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
@ -7,6 +7,7 @@ use Illuminate\Routing\Router;
|
||||
* Class RouteServiceProvider
|
||||
*
|
||||
* @package FireflyIII\Providers
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
@ -8,6 +8,7 @@ use Illuminate\Support\ServiceProvider;
|
||||
/**
|
||||
* Class TestingServiceProvider
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
* @package FireflyIII\Providers
|
||||
*/
|
||||
class TestingServiceProvider extends ServiceProvider
|
||||
|
@ -13,18 +13,6 @@ use Illuminate\Support\Collection;
|
||||
interface PiggyBankRepositoryInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getPiggyBanks();
|
||||
|
||||
/**
|
||||
* @param PiggyBank $piggyBank
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getEvents(PiggyBank $piggyBank);
|
||||
|
||||
/**
|
||||
* @param PiggyBank $piggyBank
|
||||
* @param $amount
|
||||
@ -33,6 +21,13 @@ interface PiggyBankRepositoryInterface
|
||||
*/
|
||||
public function createEvent(PiggyBank $piggyBank, $amount);
|
||||
|
||||
/**
|
||||
* @param PiggyBank $piggyBank
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function destroy(PiggyBank $piggyBank);
|
||||
|
||||
/**
|
||||
* @param PiggyBank $piggyBank
|
||||
*
|
||||
@ -43,9 +38,14 @@ interface PiggyBankRepositoryInterface
|
||||
/**
|
||||
* @param PiggyBank $piggyBank
|
||||
*
|
||||
* @return bool
|
||||
* @return Collection
|
||||
*/
|
||||
public function destroy(PiggyBank $piggyBank);
|
||||
public function getEvents(PiggyBank $piggyBank);
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getPiggyBanks();
|
||||
|
||||
/**
|
||||
* Set all piggy banks to order 0.
|
||||
|
@ -143,6 +143,79 @@ class TagRepository implements TagRepositoryInterface
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Can a tag become an advance payment?
|
||||
*
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function tagAllowAdvance(Tag $tag)
|
||||
{
|
||||
/*
|
||||
* If this tag is a balancing act, and it contains transfers, it cannot be
|
||||
* changes to an advancePayment.
|
||||
*/
|
||||
|
||||
if ($tag->tagMode == 'balancingAct' || $tag->tagMode == 'nothing') {
|
||||
foreach ($tag->transactionjournals as $journal) {
|
||||
if ($journal->transactionType->type == 'Transfer') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If this tag contains more than one expenses, it cannot become an advance payment.
|
||||
*/
|
||||
$count = 0;
|
||||
foreach ($tag->transactionjournals as $journal) {
|
||||
if ($journal->transactionType->type == 'Withdrawal') {
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
if ($count > 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Can a tag become a balancing act?
|
||||
*
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function tagAllowBalancing(Tag $tag)
|
||||
{
|
||||
/*
|
||||
* If has more than two transactions already, cannot become a balancing act:
|
||||
*/
|
||||
if ($tag->transactionjournals->count() > 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* If any transaction is a deposit, cannot become a balancing act.
|
||||
*/
|
||||
$count = 0;
|
||||
foreach ($tag->transactionjournals as $journal) {
|
||||
if ($journal->transactionType->type == 'Deposit') {
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
if ($count > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param Tag $tag
|
||||
* @param array $data
|
||||
|
@ -18,6 +18,14 @@ interface TagRepositoryInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function connect(TransactionJournal $journal, Tag $tag);
|
||||
|
||||
/**
|
||||
* This method scans the transaction journals from or to the given asset account
|
||||
* and checks if these are part of a balancing act. If so, it will sum up the amounts
|
||||
@ -34,6 +42,18 @@ interface TagRepositoryInterface
|
||||
*/
|
||||
public function coveredByBalancingActs(Account $account, Carbon $start, Carbon $end);
|
||||
|
||||
/**
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function destroy(Tag $tag);
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function get();
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
*
|
||||
@ -42,9 +62,22 @@ interface TagRepositoryInterface
|
||||
public function store(array $data);
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
* Can a tag become an advance payment?
|
||||
*
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function get();
|
||||
public function tagAllowAdvance(Tag $tag);
|
||||
|
||||
/**
|
||||
* Can a tag become a balancing act?
|
||||
*
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function tagAllowBalancing(Tag $tag);
|
||||
|
||||
/**
|
||||
* @param Tag $tag
|
||||
@ -53,19 +86,4 @@ interface TagRepositoryInterface
|
||||
* @return Tag
|
||||
*/
|
||||
public function update(Tag $tag, array $data);
|
||||
|
||||
/**
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function destroy(Tag $tag);
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function connect(TransactionJournal $journal, Tag $tag);
|
||||
}
|
||||
|
@ -232,15 +232,15 @@ class ExpandedForm
|
||||
$fields = ['title', 'name', 'description'];
|
||||
/** @var Eloquent $entry */
|
||||
foreach ($set as $entry) {
|
||||
$id = intval($entry->id);
|
||||
$title = null;
|
||||
$entryId = intval($entry->id);
|
||||
$title = null;
|
||||
|
||||
foreach ($fields as $field) {
|
||||
if (isset($entry->$field)) {
|
||||
$title = $entry->$field;
|
||||
}
|
||||
}
|
||||
$selectList[$id] = $title;
|
||||
$selectList[$entryId] = $title;
|
||||
}
|
||||
|
||||
return $selectList;
|
||||
|
@ -261,18 +261,20 @@ class Navigation
|
||||
public function periodShow(Carbon $date, $repeatFrequency)
|
||||
{
|
||||
$formatMap = [
|
||||
'daily' => 'j F Y',
|
||||
'week' => '\W\e\e\k W, Y',
|
||||
'weekly' => '\W\e\e\k W, Y',
|
||||
'quarter' => 'F Y',
|
||||
'month' => 'F Y',
|
||||
'monthly' => 'F Y',
|
||||
'year' => 'Y',
|
||||
'yearly' => 'Y',
|
||||
'daily' => '%e %B %Y',
|
||||
'week' => 'Week %W, %Y',
|
||||
'weekly' => 'Week %W, %Y',
|
||||
'quarter' => '%B %Y',
|
||||
'month' => '%B %Y',
|
||||
'monthly' => '%B %Y',
|
||||
'year' => '%Y',
|
||||
'yearly' => '%Y',
|
||||
|
||||
];
|
||||
|
||||
|
||||
if (isset($formatMap[$repeatFrequency])) {
|
||||
return $date->format($formatMap[$repeatFrequency]);
|
||||
return $date->formatLocalized($formatMap[$repeatFrequency]);
|
||||
}
|
||||
throw new FireflyException('No date formats for frequency "' . $repeatFrequency . '"!');
|
||||
}
|
||||
|
2
build/logs/.gitignore
vendored
Normal file
2
build/logs/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*.xml
|
||||
*.json
|
@ -37,7 +37,9 @@
|
||||
"phpspec/phpspec": "~2.1",
|
||||
"satooshi/php-coveralls": "0.6.1",
|
||||
"mockery/mockery": "0.9.*",
|
||||
"league/factory-muffin": "~2.1"
|
||||
"league/factory-muffin": "~2.1",
|
||||
"codeclimate/php-test-reporter": "^0.1.2"
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
59
composer.lock
generated
59
composer.lock
generated
@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "e3e90dd365b74f4878cf3b5b4a1c4007",
|
||||
"hash": "5c085b2cc90ffa610e386897066315a7",
|
||||
"packages": [
|
||||
{
|
||||
"name": "classpreloader/classpreloader",
|
||||
@ -2689,6 +2689,63 @@
|
||||
],
|
||||
"time": "2015-03-17 08:00:28"
|
||||
},
|
||||
{
|
||||
"name": "codeclimate/php-test-reporter",
|
||||
"version": "v0.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/codeclimate/php-test-reporter.git",
|
||||
"reference": "8ed24ff30f3663ecf40f1c12d6c97eb56c69e646"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/codeclimate/php-test-reporter/zipball/8ed24ff30f3663ecf40f1c12d6c97eb56c69e646",
|
||||
"reference": "8ed24ff30f3663ecf40f1c12d6c97eb56c69e646",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-curl": "*",
|
||||
"php": ">=5.3",
|
||||
"satooshi/php-coveralls": "0.6.*",
|
||||
"symfony/console": ">=2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "3.7.*@stable"
|
||||
},
|
||||
"bin": [
|
||||
"composer/bin/test-reporter"
|
||||
],
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "0.1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"CodeClimate\\Component": "src/",
|
||||
"CodeClimate\\Bundle": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Code Climate",
|
||||
"email": "hello@codeclimate.com",
|
||||
"homepage": "https://codeclimate.com"
|
||||
}
|
||||
],
|
||||
"description": "PHP client for reporting test coverage to Code Climate",
|
||||
"homepage": "https://github.com/codeclimate/php-test-reporter",
|
||||
"keywords": [
|
||||
"codeclimate",
|
||||
"coverage"
|
||||
],
|
||||
"time": "2014-07-23 13:42:41"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/instantiator",
|
||||
"version": "1.0.4",
|
||||
|
223
config/twigbridge.php
Normal file
223
config/twigbridge.php
Normal file
@ -0,0 +1,223 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'twig' => [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Extension
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| File extension for Twig view files.
|
||||
|
|
||||
*/
|
||||
'extension' => 'twig',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Accepts all Twig environment configuration options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| http://twig.sensiolabs.org/doc/api.html#environment-options
|
||||
|
|
||||
*/
|
||||
'environment' => [
|
||||
|
||||
// When set to true, the generated templates have a __toString() method
|
||||
// that you can use to display the generated nodes.
|
||||
// default: false
|
||||
'debug' => config('app.debug', false),
|
||||
|
||||
// The charset used by the templates.
|
||||
// default: utf-8
|
||||
'charset' => 'utf-8',
|
||||
|
||||
// The base template class to use for generated templates.
|
||||
// default: TwigBridge\Twig\Template
|
||||
'base_template_class' => 'TwigBridge\Twig\Template',
|
||||
|
||||
// An absolute path where to store the compiled templates, or false to disable caching. If null
|
||||
// then the cache file path is used.
|
||||
// default: cache file storage path
|
||||
'cache' => null,
|
||||
|
||||
// When developing with Twig, it's useful to recompile the template
|
||||
// whenever the source code changes. If you don't provide a value
|
||||
// for the auto_reload option, it will be determined automatically based on the debug value.
|
||||
'auto_reload' => true,
|
||||
|
||||
// If set to false, Twig will silently ignore invalid variables
|
||||
// (variables and or attributes/methods that do not exist) and
|
||||
// replace them with a null value. When set to true, Twig throws an exception instead.
|
||||
// default: false
|
||||
'strict_variables' => false,
|
||||
|
||||
// If set to true, auto-escaping will be enabled by default for all templates.
|
||||
// default: true
|
||||
'autoescape' => true,
|
||||
|
||||
// A flag that indicates which optimizations to apply
|
||||
// (default to -1 -- all optimizations are enabled; set it to 0 to disable)
|
||||
'optimizations' => -1,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global variables
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These will always be passed in and can be accessed as Twig variables.
|
||||
| NOTE: these will be overwritten if you pass data into the view with the same key.
|
||||
|
|
||||
*/
|
||||
'globals' => [],
|
||||
],
|
||||
|
||||
'extensions' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Extensions
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Enabled extensions.
|
||||
|
|
||||
| `Twig_Extension_Debug` is enabled automatically if twig.debug is TRUE.
|
||||
|
|
||||
*/
|
||||
'enabled' => [
|
||||
'TwigBridge\Extension\Loader\Facades',
|
||||
'TwigBridge\Extension\Loader\Filters',
|
||||
'TwigBridge\Extension\Loader\Functions',
|
||||
|
||||
'TwigBridge\Extension\Laravel\Auth',
|
||||
'TwigBridge\Extension\Laravel\Config',
|
||||
'TwigBridge\Extension\Laravel\Dump',
|
||||
'TwigBridge\Extension\Laravel\Input',
|
||||
'TwigBridge\Extension\Laravel\Session',
|
||||
'TwigBridge\Extension\Laravel\String',
|
||||
'TwigBridge\Extension\Laravel\Translator',
|
||||
'TwigBridge\Extension\Laravel\Url',
|
||||
|
||||
// 'TwigBridge\Extension\Laravel\Form',
|
||||
// 'TwigBridge\Extension\Laravel\Html',
|
||||
// 'TwigBridge\Extension\Laravel\Legacy\Facades',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Facades
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Available facades. Access like `{{ Config.get('foo.bar') }}`.
|
||||
|
|
||||
| Each facade can take an optional array of options. To mark the whole facade
|
||||
| as safe you can set the option `'is_safe' => true`. Setting the facade as
|
||||
| safe means that any HTML returned will not be escaped.
|
||||
|
|
||||
| It is advisable to not set the whole facade as safe and instead mark the
|
||||
| each appropriate method as safe for security reasons. You can do that with
|
||||
| the following syntax:
|
||||
|
|
||||
| <code>
|
||||
| 'Form' => [
|
||||
| 'is_safe' => [
|
||||
| 'open'
|
||||
| ]
|
||||
| ]
|
||||
| </code>
|
||||
|
|
||||
| The values of the `is_safe` array must match the called method on the facade
|
||||
| in order to be marked as safe.
|
||||
|
|
||||
*/
|
||||
'facades' => [
|
||||
'Breadcrumbs' => [
|
||||
'is_safe' => [
|
||||
'renderIfExists'
|
||||
]
|
||||
],
|
||||
'Session',
|
||||
'Route',
|
||||
'Auth',
|
||||
'Lang',
|
||||
'URL',
|
||||
'Config',
|
||||
'ExpandedForm' => [
|
||||
'is_safe' => [
|
||||
'date', 'text', 'select', 'balance', 'optionsList', 'checkbox', 'amount', 'tags', 'integer', 'textarea', 'location',
|
||||
'multiRadio'
|
||||
]
|
||||
],
|
||||
'Form' => [
|
||||
'is_safe' => [
|
||||
'input', 'select', 'checkbox', 'model', 'open', 'radio', 'textarea'
|
||||
]
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Functions
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Available functions. Access like `{{ secure_url(...) }}`.
|
||||
|
|
||||
| Each function can take an optional array of options. These options are
|
||||
| passed directly to `Twig_SimpleFunction`.
|
||||
|
|
||||
| So for example, to mark a function as safe you can do the following:
|
||||
|
|
||||
| <code>
|
||||
| 'link_to' => [
|
||||
| 'is_safe' => ['html']
|
||||
| ]
|
||||
| </code>
|
||||
|
|
||||
| The options array also takes a `callback` that allows you to name the
|
||||
| function differently in your Twig templates than what it's actually called.
|
||||
|
|
||||
| <code>
|
||||
| 'link' => [
|
||||
| 'callback' => 'link_to'
|
||||
| ]
|
||||
| </code>
|
||||
|
|
||||
*/
|
||||
'functions' => [
|
||||
'elixir',
|
||||
'head',
|
||||
'last',
|
||||
'old'
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Filters
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Available filters. Access like `{{ variable|filter }}`.
|
||||
|
|
||||
| Each filter can take an optional array of options. These options are
|
||||
| passed directly to `Twig_SimpleFilter`.
|
||||
|
|
||||
| So for example, to mark a filter as safe you can do the following:
|
||||
|
|
||||
| <code>
|
||||
| 'studly_case' => [
|
||||
| 'is_safe' => ['html']
|
||||
| ]
|
||||
| </code>
|
||||
|
|
||||
| The options array also takes a `callback` that allows you to name the
|
||||
| filter differently in your Twig templates than what is actually called.
|
||||
|
|
||||
| <code>
|
||||
| 'snake' => [
|
||||
| 'callback' => 'snake_case'
|
||||
| ]
|
||||
| </code>
|
||||
|
|
||||
*/
|
||||
'filters' => [],
|
||||
]
|
||||
];
|
@ -1,3 +1,4 @@
|
||||
/* globals require */
|
||||
var elixir = require('laravel-elixir');
|
||||
|
||||
/*
|
||||
@ -12,5 +13,6 @@ var elixir = require('laravel-elixir');
|
||||
*/
|
||||
|
||||
elixir(function(mix) {
|
||||
"use strict";
|
||||
mix.less('app.less');
|
||||
});
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
<!-- code coverage -->
|
||||
<logging>
|
||||
<log type="coverage-clover" target="./storage/coverage/clover.xml" charset="UTF-8" />
|
||||
<log type="coverage-clover" target="./build/logs/clover.xml" charset="UTF-8" />
|
||||
</logging>
|
||||
|
||||
<php>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,11 +1,23 @@
|
||||
$(function () {
|
||||
/* global $ */
|
||||
|
||||
|
||||
// Return a helper with preserved width of cells
|
||||
var fixHelper = function (e, ui) {
|
||||
"use strict";
|
||||
ui.children().each(function () {
|
||||
$(this).width($(this).width());
|
||||
});
|
||||
return ui;
|
||||
};
|
||||
|
||||
$(function () {
|
||||
"use strict";
|
||||
if (typeof(googleLineChart) === "function" && typeof accountID !== 'undefined') {
|
||||
googleLineChart('chart/account/' + accountID, 'overview-chart');
|
||||
}
|
||||
|
||||
// sortable!
|
||||
if (typeof $(".sortable-table tbody").sortable != "undefined") {
|
||||
if (typeof $(".sortable-table tbody").sortable !== "undefined") {
|
||||
$(".sortable-table tbody").sortable(
|
||||
{
|
||||
helper: fixHelper,
|
||||
@ -19,23 +31,14 @@ $(function () {
|
||||
});
|
||||
|
||||
|
||||
// Return a helper with preserved width of cells
|
||||
var fixHelper = function (e, ui) {
|
||||
ui.children().each(function () {
|
||||
$(this).width($(this).width());
|
||||
});
|
||||
return ui;
|
||||
};
|
||||
|
||||
function sortStop(event, ui) {
|
||||
"use strict";
|
||||
var current = $(ui.item);
|
||||
var thisDate = current.data('date');
|
||||
var originalBG = current.css('backgroundColor');
|
||||
|
||||
|
||||
if (current.prev().data('date') != thisDate && current.next().data('date') != thisDate) {
|
||||
//console.log('False!');
|
||||
//console.log('[' + current.prev().data('date') + '] [' + thisDate + '] [' + current.next().data('date') + ']');
|
||||
if (current.prev().data('date') !== thisDate && current.next().data('date') !== thisDate) {
|
||||
// animate something with color:
|
||||
current.animate({
|
||||
backgroundColor: "#d9534f"
|
||||
@ -59,10 +62,6 @@ function sortStop(event, ui) {
|
||||
|
||||
// do extra animation when done?
|
||||
$.post('/transaction/reorder', {items: submit, date: thisDate, _token: token});
|
||||
console.log(submit);
|
||||
|
||||
//console.log('TRUE!');
|
||||
//console.log('[' + current.prev().data('date') + '] [' + thisDate + '] [' + current.next().data('date') + ']');
|
||||
|
||||
current.animate({
|
||||
backgroundColor: "#5cb85c"
|
||||
|
@ -1,7 +1,9 @@
|
||||
$(document).ready(function () {
|
||||
/* global googleComboChart, billID */
|
||||
|
||||
if (typeof(googleComboChart) === 'function' && typeof(billID) !== 'undefined') {
|
||||
googleComboChart('chart/bill/' + billID, 'bill-overview');
|
||||
}
|
||||
}
|
||||
$(document).ready(function () {
|
||||
"use strict";
|
||||
if (typeof(googleComboChart) === 'function' && typeof(billID) !== 'undefined') {
|
||||
googleComboChart('chart/bill/' + billID, 'bill-overview');
|
||||
}
|
||||
}
|
||||
);
|
@ -1,12 +1,104 @@
|
||||
/* globals $, budgeted:false, currencySymbol, budgetIncomeTotal ,budgetedMuch, budgetedPercentage, token, budgetID, repetitionID, spent, budgeted*/
|
||||
|
||||
function drawSpentBar() {
|
||||
"use strict";
|
||||
|
||||
var overspent = spent > budgeted;
|
||||
var pct;
|
||||
|
||||
if (overspent) {
|
||||
// draw overspent bar
|
||||
pct = (budgeted / spent) * 100;
|
||||
$('.spentBar .progress-bar-warning').css('width', pct + '%');
|
||||
$('.spentBar .progress-bar-danger').css('width', (100 - pct) + '%');
|
||||
} else {
|
||||
// draw normal bar:
|
||||
pct = (spent / budgeted) * 100;
|
||||
$('.spentBar .progress-bar-info').css('width', pct + '%');
|
||||
}
|
||||
}
|
||||
|
||||
function drawBudgetedBar() {
|
||||
"use strict";
|
||||
var budgetedMuch = budgeted > budgetIncomeTotal;
|
||||
|
||||
// recalculate percentage:
|
||||
|
||||
var pct;
|
||||
if (budgetedMuch) {
|
||||
// budgeted too much.
|
||||
pct = (budgetIncomeTotal / budgeted) * 100;
|
||||
$('.budgetedBar .progress-bar-warning').css('width', pct + '%');
|
||||
$('.budgetedBar .progress-bar-danger').css('width', (100 - pct) + '%');
|
||||
$('.budgetedBar .progress-bar-info').css('width', 0);
|
||||
} else {
|
||||
pct = (budgeted / budgetIncomeTotal) * 100;
|
||||
$('.budgetedBar .progress-bar-warning').css('width', 0);
|
||||
$('.budgetedBar .progress-bar-danger').css('width', 0);
|
||||
$('.budgetedBar .progress-bar-info').css('width', pct + '%');
|
||||
}
|
||||
|
||||
$('#budgetedAmount').html(currencySymbol + ' ' + budgeted.toFixed(2));
|
||||
}
|
||||
|
||||
function updateBudgetedAmounts(e) {
|
||||
"use strict";
|
||||
var target = $(e.target);
|
||||
var id = target.data('id');
|
||||
var value = target.val();
|
||||
var original = target.data('original');
|
||||
var difference = value - original;
|
||||
if (difference !== 0) {
|
||||
// add difference to 'budgeted' var
|
||||
budgeted = budgeted + difference;
|
||||
|
||||
// update original:
|
||||
target.data('original', value);
|
||||
// run drawBudgetedBar() again:
|
||||
drawBudgetedBar();
|
||||
|
||||
// send a post to Firefly to update the amount:
|
||||
$.post('budgets/amount/' + id, {amount: value, _token: token}).success(function (data) {
|
||||
// update the link if relevant:
|
||||
if (data.repetition > 0) {
|
||||
$('.budget-link[data-id="' + id + '"]').attr('href', 'budgets/show/' + id + '/' + data.repetition);
|
||||
} else {
|
||||
$('.budget-link[data-id="' + id + '"]').attr('href', 'budgets/show/' + id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
console.log('Budget id is ' + id);
|
||||
console.log('Difference = ' + (value - original ));
|
||||
|
||||
}
|
||||
|
||||
$(function () {
|
||||
updateRanges();
|
||||
//$('input[type="range"]').change(updateSingleRange);
|
||||
$('input[type="range"]').on('input', updateSingleRange);
|
||||
//$('input[type="number"]').on('change', updateSingleRange);
|
||||
$('input[type="number"]').on('input', updateSingleRange);
|
||||
"use strict";
|
||||
|
||||
$('.updateIncome').on('click', updateIncome);
|
||||
|
||||
/*
|
||||
On start, fill the "spent"-bar using the content from the page.
|
||||
*/
|
||||
drawSpentBar();
|
||||
drawBudgetedBar();
|
||||
|
||||
/*
|
||||
When the input changes, update the percentages for the budgeted bar:
|
||||
*/
|
||||
$('input[type="number"]').on('input', updateBudgetedAmounts);
|
||||
|
||||
|
||||
//updateRanges();
|
||||
//$('input[type="range"]').on('input', updateSingleRange);
|
||||
//$('input[type="number"]').on('input', updateSingleRange);
|
||||
|
||||
|
||||
/*
|
||||
Draw the charts, if necessary:
|
||||
*/
|
||||
if (typeof budgetID !== 'undefined' && typeof repetitionID === 'undefined') {
|
||||
googleColumnChart('chart/budget/' + budgetID, 'budgetOverview');
|
||||
}
|
||||
@ -17,139 +109,138 @@ $(function () {
|
||||
});
|
||||
|
||||
|
||||
function updateSingleRange(e) {
|
||||
// get some values:
|
||||
var input = $(e.target);
|
||||
var id = input.data('id');
|
||||
var value = parseInt(input.val());
|
||||
var spent = parseFloat($('#spent-' + id).data('value'));
|
||||
|
||||
// update small display:
|
||||
if (value > 0) {
|
||||
// show the input:
|
||||
$('#budget-info-' + id + ' span').show();
|
||||
$('#budget-info-' + id + ' input').show();
|
||||
|
||||
// update the text:
|
||||
$('#budget-description-' + id).text('Budgeted: ');
|
||||
} else {
|
||||
// hide the input:
|
||||
$('#budget-info-' + id + ' span').hide();
|
||||
$('#budget-info-' + id + ' input').hide();
|
||||
|
||||
// update the text:
|
||||
$('#budget-description-' + id).html('<em>No budget</em>');
|
||||
}
|
||||
|
||||
// update the range display text:
|
||||
$('#budget-range-display-' + id).text('\u20AC ' + value.toFixed(2));
|
||||
|
||||
// send a post to Firefly to update the amount:
|
||||
$.post('budgets/amount/' + id, {amount: value, _token: token}).success(function (data) {
|
||||
// update the link if relevant:
|
||||
$('#budget-link-' + id).attr('href', 'budgets/show/' + id + '/' + data.repetition);
|
||||
});
|
||||
if (input.attr('type') == 'number') {
|
||||
// update the range-input:
|
||||
$('#budget-range-' + id).val(value);
|
||||
} else {
|
||||
// update the number-input:
|
||||
$('#budget-info-' + id + ' input').val(value);
|
||||
}
|
||||
|
||||
// update or hide the bar, whichever is necessary.
|
||||
updateTotal();
|
||||
return value;
|
||||
}
|
||||
|
||||
function updateTotal() {
|
||||
var sum = 0;
|
||||
$('input[type="range"]').each(function (i, v) {
|
||||
// get some values:
|
||||
sum += parseInt($(v).val());
|
||||
});
|
||||
|
||||
/**
|
||||
* Update total sum:
|
||||
*/
|
||||
var totalAmount = parseInt($('#totalAmount').data('value'));
|
||||
var pct;
|
||||
if (sum <= totalAmount) {
|
||||
pct = sum / totalAmount * 100;
|
||||
$('#progress-bar-default').css('width', pct + '%');
|
||||
$('#progress-bar-warning').css('width', '0');
|
||||
$('#progress-bar-danger').css('width', '0');
|
||||
$('#budgetedAmount').text('\u20AC ' + sum.toFixed(2)).addClass('text-success').removeClass('text-danger');
|
||||
} else {
|
||||
// we gaan er X overheen,
|
||||
|
||||
pct = totalAmount / sum * 100;
|
||||
var danger = 100 - pct;
|
||||
var err = 100 - danger;
|
||||
$('#progress-bar-default').css('width', 0);
|
||||
$('#progress-bar-warning').css('width', err + '%');
|
||||
$('#progress-bar-danger').css('width', danger + '%');
|
||||
$('#budgetedAmount').text('\u20AC ' + sum.toFixed(2)).addClass('text-danger').removeClass('text-success');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function updateIncome(e) {
|
||||
//function updateSingleRange(e) {
|
||||
// "use strict";
|
||||
// // get some values:
|
||||
// var input = $(e.target);
|
||||
// var id = input.data('id');
|
||||
// var value = parseInt(input.val());
|
||||
// var spent = parseFloat($('#spent-' + id).data('value'));
|
||||
//
|
||||
// // update small display:
|
||||
// if (value > 0) {
|
||||
// // show the input:
|
||||
// $('#budget-info-' + id + ' span').show();
|
||||
// $('#budget-info-' + id + ' input').show();
|
||||
//
|
||||
// // update the text:
|
||||
// $('#budget-description-' + id).text('Budgeted: ');
|
||||
// } else {
|
||||
// // hide the input:
|
||||
// $('#budget-info-' + id + ' span').hide();
|
||||
// $('#budget-info-' + id + ' input').hide();
|
||||
//
|
||||
// // update the text:
|
||||
// $('#budget-description-' + id).html('<em>No budget</em>');
|
||||
// }
|
||||
//
|
||||
// // update the range display text:
|
||||
// $('#budget-range-display-' + id).text('\u20AC ' + value.toFixed(2));
|
||||
//
|
||||
// // send a post to Firefly to update the amount:
|
||||
// $.post('budgets/amount/' + id, {amount: value, _token: token}).success(function (data) {
|
||||
// // update the link if relevant:
|
||||
// $('#budget-link-' + id).attr('href', 'budgets/show/' + id + '/' + data.repetition);
|
||||
// });
|
||||
// if (input.attr('type') === 'number') {
|
||||
// // update the range-input:
|
||||
// $('#budget-range-' + id).val(value);
|
||||
// } else {
|
||||
// // update the number-input:
|
||||
// $('#budget-info-' + id + ' input').val(value);
|
||||
// }
|
||||
//
|
||||
// // update or hide the bar, whichever is necessary.
|
||||
// updateTotal();
|
||||
// return value;
|
||||
//}
|
||||
//
|
||||
//function updateTotal() {
|
||||
// "use strict";
|
||||
// var sum = 0;
|
||||
// $('input[type="range"]').each(function (i, v) {
|
||||
// // get some values:
|
||||
// sum += parseInt($(v).val());
|
||||
// });
|
||||
//
|
||||
// /**
|
||||
// * Update total sum:
|
||||
// */
|
||||
// var totalAmount = parseInt($('#totalAmount').data('value'));
|
||||
// var pct;
|
||||
// if (sum <= totalAmount) {
|
||||
// pct = sum / totalAmount * 100;
|
||||
// $('#progress-bar-default').css('width', pct + '%');
|
||||
// $('#progress-bar-warning').css('width', '0');
|
||||
// $('#progress-bar-danger').css('width', '0');
|
||||
// $('#budgetedAmount').text('\u20AC ' + sum.toFixed(2)).addClass('text-success').removeClass('text-danger');
|
||||
// } else {
|
||||
// // we gaan er X overheen,
|
||||
//
|
||||
// pct = totalAmount / sum * 100;
|
||||
// var danger = 100 - pct;
|
||||
// var err = 100 - danger;
|
||||
// $('#progress-bar-default').css('width', 0);
|
||||
// $('#progress-bar-warning').css('width', err + '%');
|
||||
// $('#progress-bar-danger').css('width', danger + '%');
|
||||
// $('#budgetedAmount').text('\u20AC ' + sum.toFixed(2)).addClass('text-danger').removeClass('text-success');
|
||||
// }
|
||||
//
|
||||
//}
|
||||
//
|
||||
function updateIncome() {
|
||||
"use strict";
|
||||
$('#monthlyBudgetModal').empty().load('budgets/income', function () {
|
||||
$('#monthlyBudgetModal').modal('show');
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function updateRanges() {
|
||||
/**
|
||||
* Update all ranges.
|
||||
*/
|
||||
var sum = 0;
|
||||
$('input[type="range"]').each(function (i, v) {
|
||||
// get some values:
|
||||
var input = $(v);
|
||||
var id = input.data('id');
|
||||
var value = parseInt(input.val());
|
||||
|
||||
// calculate sum:
|
||||
sum += value;
|
||||
|
||||
// update small display:
|
||||
$('#budget-range-display-' + id).text('\u20AC ' + value.toFixed(2));
|
||||
|
||||
// update progress bar (if relevant)
|
||||
var barHolder = $('#budget-progress-' + id);
|
||||
var spent = parseFloat(barHolder.data('spent'));
|
||||
|
||||
// send a post to Firefly to update the amount:
|
||||
$.post('budgets/amount/' + id, {amount: value, _token: token}).success(function (data) {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* Update total sum:
|
||||
*/
|
||||
var totalAmount = parseInt($('#totalAmount').data('value'));
|
||||
if (sum <= totalAmount) {
|
||||
var pct = sum / totalAmount * 100;
|
||||
$('#progress-bar-default').css('width', pct + '%');
|
||||
$('#progress-bar-warning').css('width', '0');
|
||||
$('#progress-bar-danger').css('width', '0');
|
||||
$('#budgetedAmount').text('\u20AC ' + sum.toFixed(2)).addClass('text-success').removeClass('text-danger');
|
||||
} else {
|
||||
// we gaan er X overheen,
|
||||
|
||||
var pct = totalAmount / sum * 100;
|
||||
var danger = 100 - pct;
|
||||
var err = 100 - danger;
|
||||
$('#progress-bar-default').css('width', 0);
|
||||
$('#progress-bar-warning').css('width', err + '%');
|
||||
$('#progress-bar-danger').css('width', danger + '%');
|
||||
$('#budgetedAmount').text('\u20AC ' + sum.toFixed(2)).addClass('text-danger').removeClass('text-success');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//
|
||||
//function updateRanges() {
|
||||
// "use strict";
|
||||
//
|
||||
//
|
||||
// var sum = 0;
|
||||
// $('input[type="range"]').each(function (i, v) {
|
||||
// // get some values:
|
||||
// var input = $(v);
|
||||
// var id = input.data('id');
|
||||
// var value = parseInt(input.val());
|
||||
//
|
||||
// // calculate sum:
|
||||
// sum += value;
|
||||
//
|
||||
// // update small display:
|
||||
// $('#budget-range-display-' + id).text('\u20AC ' + value.toFixed(2));
|
||||
//
|
||||
// // send a post to Firefly to update the amount:
|
||||
// $.post('budgets/amount/' + id, {amount: value, _token: token});
|
||||
//
|
||||
// });
|
||||
//
|
||||
// /**
|
||||
// * Update total sum:
|
||||
// */
|
||||
// var totalAmount = parseInt($('#totalAmount').data('value'));
|
||||
// var pct;
|
||||
// if (sum <= totalAmount) {
|
||||
// pct = sum / totalAmount * 100;
|
||||
// $('#progress-bar-default').css('width', pct + '%');
|
||||
// $('#progress-bar-warning').css('width', '0');
|
||||
// $('#progress-bar-danger').css('width', '0');
|
||||
// $('#budgetedAmount').text('\u20AC ' + sum.toFixed(2)).addClass('text-success').removeClass('text-danger');
|
||||
// } else {
|
||||
// // we gaan er X overheen,
|
||||
//
|
||||
// pct = totalAmount / sum * 100;
|
||||
// var danger = 100 - pct;
|
||||
// var err = 100 - danger;
|
||||
// $('#progress-bar-default').css('width', 0);
|
||||
// $('#progress-bar-warning').css('width', err + '%');
|
||||
// $('#progress-bar-danger').css('width', danger + '%');
|
||||
// $('#budgetedAmount').text('\u20AC ' + sum.toFixed(2)).addClass('text-danger').removeClass('text-success');
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
@ -1,5 +1,6 @@
|
||||
/* globals $, categoryID */
|
||||
$(function () {
|
||||
|
||||
"use strict";
|
||||
if (typeof categoryID !== 'undefined') {
|
||||
googleColumnChart('chart/category/' + categoryID + '/all', 'all');
|
||||
googleColumnChart('chart/category/' + categoryID + '/month', 'month');
|
||||
|
@ -1,8 +1,9 @@
|
||||
/* globals start, end, dateRangeURL, everything, firstDate, moment, currentMonthName, $, previousMonthName, nextMonthName, applyLabel, cancelLabel, toLabel, customRangeLabel, fromLabel, */
|
||||
$(function () {
|
||||
|
||||
"use strict";
|
||||
$('.currencySelect').click(currencySelect);
|
||||
|
||||
ranges = {};
|
||||
var ranges = {};
|
||||
ranges[currentMonthName] = [moment().startOf('month'), moment().endOf('month')];
|
||||
ranges[previousMonthName] = [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')];
|
||||
ranges[nextMonthName] = [moment().add(1, 'month').startOf('month'), moment().add(1, 'month').endOf('month')];
|
||||
@ -10,11 +11,6 @@ $(function () {
|
||||
|
||||
$('#daterange').daterangepicker(
|
||||
{
|
||||
//View::share('currentMonthName', $current);
|
||||
//View::share('previousMonthName', $prev);
|
||||
//View::share('nextMonthName', $next);
|
||||
|
||||
|
||||
ranges: ranges,
|
||||
opens: 'left',
|
||||
locale: {
|
||||
@ -54,6 +50,7 @@ $(function () {
|
||||
});
|
||||
|
||||
function currencySelect(e) {
|
||||
"use strict";
|
||||
var target = $(e.target);
|
||||
var symbol = target.data('symbol');
|
||||
var code = target.data('code');
|
||||
|
@ -1,13 +1,16 @@
|
||||
/* globals currencyCode, language, defaultPieChartOptions, defaultLineChartOptions, defaultColumnChartOptions, defaultBarChartOptions, defaultStackedColumnChartOptions, defaultComboChartOptions */
|
||||
/* exported googleLineChart, googleBarChart, googleColumnChart, googleStackedColumnChart, googleComboChart, googlePieChart */
|
||||
var google = google || {};
|
||||
google.load('visualization', '1.1', {'packages': ['corechart', 'bar', 'line'],'language': language });
|
||||
|
||||
function googleChart(chartType, URL, container, options) {
|
||||
"use strict";
|
||||
if ($('#' + container).length === 1) {
|
||||
$.getJSON(URL).success(function (data) {
|
||||
/*
|
||||
Get the data from the JSON
|
||||
*/
|
||||
gdata = new google.visualization.DataTable(data);
|
||||
var gdata = new google.visualization.DataTable(data);
|
||||
|
||||
/*
|
||||
Format as money
|
||||
@ -67,25 +70,32 @@ function googleChart(chartType, URL, container, options) {
|
||||
|
||||
|
||||
function googleLineChart(URL, container, options) {
|
||||
"use strict";
|
||||
return googleChart('line', URL, container, options);
|
||||
}
|
||||
|
||||
|
||||
function googleBarChart(URL, container, options) {
|
||||
"use strict";
|
||||
return googleChart('bar', URL, container, options);
|
||||
}
|
||||
|
||||
function googleColumnChart(URL, container, options) {
|
||||
"use strict";
|
||||
return googleChart('column', URL, container, options);
|
||||
}
|
||||
|
||||
function googleStackedColumnChart(URL, container, options) {
|
||||
"use strict";
|
||||
return googleChart('stackedColumn', URL, container, options);
|
||||
}
|
||||
|
||||
function googleComboChart(URL, container, options) {
|
||||
"use strict";
|
||||
return googleChart('combo', URL, container, options);
|
||||
}
|
||||
|
||||
function googlePieChart(URL, container, options) {
|
||||
"use strict";
|
||||
return googleChart('pie', URL, container, options);
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
/* exported defaultLineChartOptions, defaultBarChartOptions, defaultComboChartOptions, defaultColumnChartOptions, defaultStackedColumnChartOptions, defaultPieChartOptions */
|
||||
|
||||
var defaultLineChartOptions = {
|
||||
curveType: 'function',
|
||||
legend: {
|
||||
@ -69,7 +71,7 @@ var defaultBarChartOptions = {
|
||||
|
||||
legend: {
|
||||
position: 'none'
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
var defaultComboChartOptions = {
|
||||
@ -127,7 +129,7 @@ var defaultColumnChartOptions = {
|
||||
},
|
||||
legend: {
|
||||
position: 'none'
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
var defaultStackedColumnChartOptions = {
|
||||
|
@ -1,13 +1,16 @@
|
||||
$(function () {
|
||||
"use strict";
|
||||
$('#help').click(showHelp);
|
||||
$(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
})
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
});
|
||||
});
|
||||
|
||||
function showHelp(e) {
|
||||
target = $(e.target);
|
||||
route = target.data('route');
|
||||
"use strict";
|
||||
var target = $(e.target);
|
||||
var route = target.data('route');
|
||||
//
|
||||
$('#helpBody').html('<i class="fa fa-refresh fa-spin"></i>');
|
||||
$('#helpTitle').html('Please hold...');
|
||||
|
@ -1,7 +1,9 @@
|
||||
/* globals google */
|
||||
google.setOnLoadCallback(drawChart);
|
||||
|
||||
|
||||
function drawChart() {
|
||||
"use strict";
|
||||
googleLineChart('chart/account/frontpage', 'accounts-chart');
|
||||
googlePieChart('chart/bill/frontpage', 'bills-chart');
|
||||
googleStackedColumnChart('chart/budget/frontpage', 'budgets-chart');
|
||||
@ -12,13 +14,20 @@ function drawChart() {
|
||||
}
|
||||
|
||||
function getBoxAmounts() {
|
||||
"use strict";
|
||||
var boxes = ['in', 'out', 'bills-unpaid', 'bills-paid'];
|
||||
for (x in boxes) {
|
||||
for (var x in boxes) {
|
||||
var box = boxes[x];
|
||||
$.getJSON('/json/box/' + box).success(function (data) {
|
||||
$('#box-' + data.box).html(data.amount);
|
||||
}).fail(function () {
|
||||
console.log('Failed to get box!')
|
||||
});
|
||||
$.getJSON('/json/box/' + box).success(putData).fail(failData);
|
||||
}
|
||||
}
|
||||
|
||||
function putData(data) {
|
||||
"use strict";
|
||||
$('#box-' + data.box).html(data.amount);
|
||||
}
|
||||
|
||||
function failData() {
|
||||
"use strict";
|
||||
console.log('Failed to get box!');
|
||||
}
|
@ -1,4 +1,19 @@
|
||||
/* globals $, googleLineChart, token */
|
||||
|
||||
// Return a helper with preserved width of cells
|
||||
var fixHelper = function (e, tr) {
|
||||
"use strict";
|
||||
var $originals = tr.children();
|
||||
var $helper = tr.clone();
|
||||
$helper.children().each(function (index) {
|
||||
// Set helper cell sizes to match the original sizes
|
||||
$(this).width($originals.eq(index).width());
|
||||
});
|
||||
return $helper;
|
||||
};
|
||||
|
||||
$(function () {
|
||||
"use strict";
|
||||
$('.addMoney').on('click', addMoney);
|
||||
$('.removeMoney').on('click', removeMoney);
|
||||
|
||||
@ -31,18 +46,9 @@ $(function () {
|
||||
);
|
||||
});
|
||||
|
||||
// Return a helper with preserved width of cells
|
||||
var fixHelper = function(e, tr) {
|
||||
var $originals = tr.children();
|
||||
var $helper = tr.clone();
|
||||
$helper.children().each(function (index) {
|
||||
// Set helper cell sizes to match the original sizes
|
||||
$(this).width($originals.eq(index).width());
|
||||
});
|
||||
return $helper;
|
||||
}
|
||||
|
||||
function addMoney(e) {
|
||||
"use strict";
|
||||
var pigID = parseInt($(e.target).data('id'));
|
||||
$('#moneyManagementModal').empty().load('piggy-banks/add/' + pigID, function () {
|
||||
$('#moneyManagementModal').modal('show');
|
||||
@ -52,6 +58,7 @@ function addMoney(e) {
|
||||
}
|
||||
|
||||
function removeMoney(e) {
|
||||
"use strict";
|
||||
var pigID = parseInt($(e.target).data('id'));
|
||||
$('#moneyManagementModal').empty().load('piggy-banks/remove/' + pigID, function () {
|
||||
$('#moneyManagementModal').modal('show');
|
||||
@ -60,15 +67,15 @@ function removeMoney(e) {
|
||||
return false;
|
||||
}
|
||||
function stopSorting() {
|
||||
"use strict";
|
||||
$('.loadSpin').addClass('fa fa-refresh fa-spin');
|
||||
var order = [];
|
||||
$.each($('#sortable>tbody>tr'), function(i,v) {
|
||||
$.each($('#sortable>tbody>tr'), function (i, v) {
|
||||
var holder = $(v);
|
||||
var id = holder.data('id');
|
||||
order.push(id);
|
||||
});
|
||||
$.post('/piggy-banks/sort',{_token: token, order: order}).success(function(data) {
|
||||
"use strict";
|
||||
$.post('/piggy-banks/sort', {_token: token, order: order}).success(function () {
|
||||
$('.loadSpin').removeClass('fa fa-refresh fa-spin');
|
||||
});
|
||||
}
|
@ -1,9 +1,11 @@
|
||||
if (typeof(google) != 'undefined') {
|
||||
/* globals expenseRestShow:true, incomeRestShow:true, year, shared, month, hideTheRest, showTheRest, showTheRestExpense, hideTheRestExpense, googleColumnChart, googleLineChart, googleStackedColumnChartg */
|
||||
if (typeof(google) !== 'undefined') {
|
||||
google.setOnLoadCallback(drawChart);
|
||||
}
|
||||
|
||||
|
||||
function drawChart() {
|
||||
"use strict";
|
||||
googleColumnChart('chart/report/in-out/' + year + shared, 'income-expenses-chart');
|
||||
googleColumnChart('chart/report/in-out-sum/' + year + shared, 'income-expenses-sum-chart');
|
||||
|
||||
@ -13,16 +15,8 @@ function drawChart() {
|
||||
googleLineChart('/chart/account/month/' + year + '/' + month + shared, 'account-balances-chart');
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$('.openModal').on('click', openModal);
|
||||
|
||||
|
||||
// click open the top X income list:
|
||||
$('#showIncomes').click(showIncomes);
|
||||
// click open the top X expense list:
|
||||
$('#showExpenses').click(showExpenses);
|
||||
});
|
||||
|
||||
function openModal(e) {
|
||||
"use strict";
|
||||
var target = $(e.target).parent();
|
||||
@ -61,6 +55,7 @@ function showIncomes() {
|
||||
}
|
||||
|
||||
function showExpenses() {
|
||||
"use strict";
|
||||
if (expenseRestShow) {
|
||||
// hide everything, make button say "show"
|
||||
$('#showExpenses').text(showTheRestExpense);
|
||||
@ -78,4 +73,15 @@ function showExpenses() {
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$(function () {
|
||||
"use strict";
|
||||
$('.openModal').on('click', openModal);
|
||||
|
||||
|
||||
// click open the top X income list:
|
||||
$('#showIncomes').click(showIncomes);
|
||||
// click open the top X expense list:
|
||||
$('#showExpenses').click(showExpenses);
|
||||
});
|
@ -1,5 +1,6 @@
|
||||
/* globals zoomLevel, token, google, latitude, longitude */
|
||||
$(function () {
|
||||
|
||||
"use strict";
|
||||
/*
|
||||
Hide and show the tag index help.
|
||||
*/
|
||||
@ -47,7 +48,7 @@ function clearLocation() {
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
|
||||
"use strict";
|
||||
/*
|
||||
Create new map:
|
||||
*/
|
||||
@ -91,6 +92,7 @@ function saveZoomLevel() {
|
||||
* @param event
|
||||
*/
|
||||
function placeMarker(event) {
|
||||
"use strict";
|
||||
deleteMarkers();
|
||||
var marker = new google.maps.Marker({position: event.latLng, map: map});
|
||||
$('input[name="latitude"]').val(event.latLng.lat());
|
||||
@ -105,6 +107,7 @@ function placeMarker(event) {
|
||||
* Deletes all markers in the array by removing references to them.
|
||||
*/
|
||||
function deleteMarkers() {
|
||||
"use strict";
|
||||
for (var i = 0; i < markers.length; i++) {
|
||||
markers[i].setMap(null);
|
||||
}
|
||||
|
@ -1,8 +1,6 @@
|
||||
/* globals what, $ */
|
||||
$(document).ready(function () {
|
||||
if (typeof googleTablePaged != 'undefined') {
|
||||
googleTablePaged('table/transactions/' + what, 'transaction-table');
|
||||
}
|
||||
|
||||
"use strict";
|
||||
if ($('input[name="expense_account"]').length > 0) {
|
||||
$.getJSON('json/expense-accounts').success(function (data) {
|
||||
$('input[name="expense_account"]').typeahead({source: data});
|
||||
@ -28,7 +26,7 @@ $(document).ready(function () {
|
||||
});
|
||||
}
|
||||
|
||||
if ($('input[name="description"]').length > 0 && what != undefined) {
|
||||
if ($('input[name="description"]').length > 0 && what !== undefined) {
|
||||
$.getJSON('json/transaction-journals/' + what).success(function (data) {
|
||||
$('input[name="description"]').typeahead({source: data});
|
||||
});
|
||||
|
@ -176,7 +176,6 @@
|
||||
// Allow for dropdowns to go bottom up (aka, dropup-menu)
|
||||
//
|
||||
// Just add .dropup after the standard .dropdown class and you're set, bro.
|
||||
// TODO: abstract this so that the navbar fixed styles are not placed here?
|
||||
|
||||
.dropup,
|
||||
.navbar-fixed-bottom .dropdown {
|
||||
|
@ -185,7 +185,6 @@
|
||||
//** `<input>` border color
|
||||
@input-border: #ccc;
|
||||
|
||||
// TODO: Rename `@input-border-radius` to `@input-border-radius-base` in v4
|
||||
//** Default `.form-control` border radius
|
||||
@input-border-radius: @border-radius-base;
|
||||
//** Large `.form-control` border radius
|
||||
|
@ -1,37 +1,44 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
// general stuff:
|
||||
'test' => 'You have selected English.',
|
||||
'close' => 'Close',
|
||||
'pleaseHold' => 'Please hold...',
|
||||
'mandatoryFields' => 'Mandatory fields',
|
||||
'optionalFields' => 'Optional fields',
|
||||
'options' => 'Options',
|
||||
'something' => 'Something!',
|
||||
'actions' => 'Actions',
|
||||
'edit' => 'Edit',
|
||||
'delete' => 'Delete',
|
||||
'welcomeBack' => 'What\'s playing?',
|
||||
|
||||
'everything' => 'Everything',
|
||||
'customRange' => 'Custom range',
|
||||
'apply' => 'Apply',
|
||||
'cancel' => 'Cancel',
|
||||
'from' => 'From',
|
||||
'to' => 'To',
|
||||
|
||||
'showEverything' => 'Show everything',
|
||||
|
||||
// forms:
|
||||
'mandatoryFields' => 'Mandatory fields',
|
||||
'optionalFields' => 'Optional fields',
|
||||
'options' => 'Options',
|
||||
'something' => 'Something!',
|
||||
|
||||
// budgets:
|
||||
'create_new_budget' => 'Create a new budget',
|
||||
'store_new_budget' => ' Store new budget',
|
||||
|
||||
'availableIn' => 'Available in :date',
|
||||
'transactionsWithoutBudget' => 'Expenses without budget',
|
||||
'transactionsWithoutBudgetDate' => 'Expenses without budget in :date',
|
||||
'createBudget' => 'New budget',
|
||||
'inactiveBudgets' => 'Inactive budgets',
|
||||
'without_budget_between' => 'Transactions without a budget between :start and :end',
|
||||
'budget_in_month' => ':name in :month',
|
||||
'delete_budget' => 'Delete budget ":name"',
|
||||
|
||||
// bills:
|
||||
'delete_bill' => 'Delete bill ":name"',
|
||||
|
||||
// accounts:
|
||||
|
||||
'details_for_asset' => 'Details for asset account ":name"',
|
||||
'details_for_expense' => 'Details for expense account ":name"',
|
||||
'details_for_revenue' => 'Details for revenue account ":name"',
|
||||
@ -57,9 +64,17 @@ return [
|
||||
'update_expense_account' => 'Update expense account',
|
||||
'update_revenue_account' => 'Update revenue account',
|
||||
|
||||
'make_new_asset_account' => 'New asset account',
|
||||
'make_new_expense_account' => 'New expense account',
|
||||
'make_new_revenue_account' => 'New revenue account',
|
||||
'make_new_asset_account' => 'Create a new asset account',
|
||||
'make_new_expense_account' => 'Create a new expense account',
|
||||
'make_new_revenue_account' => 'Create a new revenue account',
|
||||
|
||||
'asset_accounts' => 'Asset accounts',
|
||||
'expense_accounts' => 'Expense accounts',
|
||||
'revenue_accounts' => 'Revenue accounts',
|
||||
|
||||
'accountExtraHelp_asset' => '',
|
||||
'accountExtraHelp_expense' => '',
|
||||
'accountExtraHelp_revenue' => '',
|
||||
|
||||
// categories:
|
||||
'new_category' => 'New category',
|
||||
@ -68,10 +83,20 @@ return [
|
||||
'categories' => 'Categories',
|
||||
'no_category' => '(no category)',
|
||||
'category' => 'Category',
|
||||
'delete_category' => 'Delete category ":name"',
|
||||
|
||||
// transactions:
|
||||
'update_withdrawal' => 'Update withdrawal',
|
||||
'update_deposit' => 'Update deposit',
|
||||
'update_transfer' => 'Update transfer',
|
||||
'delete_withdrawal' => 'Delete withdrawal ":description"',
|
||||
'delete_deposit' => 'Delete deposit ":description"',
|
||||
'delete_transfer' => 'Delete transfer ":description"',
|
||||
|
||||
// new user:
|
||||
'welcome' => 'Welcome to Firefly!',
|
||||
'createNewAsset' => 'Create a new asset account to get started. This will allow you to create transactions and start your financial management',
|
||||
'createNewAsset' => 'Create a new asset account to get started. ' .
|
||||
'This will allow you to create transactions and start your financial management',
|
||||
'createNewAssetButton' => 'Create new asset account',
|
||||
|
||||
// home page:
|
||||
@ -122,11 +147,12 @@ return [
|
||||
'createNew' => 'Create new',
|
||||
'withdrawal' => 'Withdrawal',
|
||||
'deposit' => 'Deposit',
|
||||
'account' => 'Account',
|
||||
'transfer' => 'Transfer',
|
||||
'Withdrawal' => 'Withdrawal',
|
||||
'Deposit' => 'Deposit',
|
||||
'Transfer' => 'Transfer',
|
||||
'bill' => 'Rekening',
|
||||
'bill' => 'Bill',
|
||||
'yes' => 'Yes',
|
||||
'no' => 'No',
|
||||
'amount' => 'Amount',
|
||||
@ -141,6 +167,7 @@ return [
|
||||
'half-year' => 'Every six months',
|
||||
'yearly' => 'Yearly',
|
||||
|
||||
// reports:
|
||||
'reportForYear' => 'Yearly report for :year',
|
||||
'reportForYearShared' => 'Yearly report for :year (including shared accounts)',
|
||||
'reportForMonth' => 'Montly report for :year',
|
||||
@ -151,15 +178,10 @@ return [
|
||||
'balanceEndOfYear' => 'Balance at end of year',
|
||||
'balanceStartOfMonth' => 'Balance at end of month',
|
||||
'balanceEndOfMonth' => 'Balance at end of month',
|
||||
|
||||
'balanceStart' => 'Balance at end of period',
|
||||
'balanceEnd' => 'Balance at end of period',
|
||||
|
||||
'reportsOwnAccounts' => 'Reports for your own accounts',
|
||||
'reportsOwnAccountsAndShared' => 'Reports for your own accounts and shared accounts',
|
||||
|
||||
'account' => 'Account',
|
||||
|
||||
'splitByAccount' => 'Split by account',
|
||||
'balancedByTransfersAndTags' => 'Balanced by transfers and tags',
|
||||
'coveredWithTags' => 'Covered with tags',
|
||||
@ -167,11 +189,9 @@ return [
|
||||
'expectedBalance' => 'Expected balance',
|
||||
'outsideOfBudgets' => 'Outside of budgets',
|
||||
'leftInBudget' => 'Left in budget',
|
||||
|
||||
'sumOfSums' => 'Sum of sums',
|
||||
'notCharged' => 'Not charged (yet)',
|
||||
'inactive' => 'Inactive',
|
||||
|
||||
'difference' => 'Difference',
|
||||
'in' => 'In',
|
||||
'out' => 'Out',
|
||||
@ -203,12 +223,40 @@ return [
|
||||
'average' => 'Average',
|
||||
'balanceFor' => 'Balance for :name',
|
||||
|
||||
'asset_accounts' => 'Asset accounts',
|
||||
'expense_accounts' => 'Expense accounts',
|
||||
'revenue_accounts' => 'Revenue accounts',
|
||||
// piggy banks:
|
||||
'new_piggy_bank' => 'Create new piggy bank',
|
||||
'account_status' => 'Account status',
|
||||
'left_for_piggy_banks' => 'Left for piggy banks',
|
||||
'sum_of_piggy_banks' => 'Sum of piggy banks',
|
||||
'saved_so_far' => 'Saved so far',
|
||||
'left_to_save' => 'Left to save',
|
||||
'add_money_to_piggy_title' => 'Add money to piggy bank ":name"',
|
||||
'remove_money_from_piggy_title' => 'Remove money from piggy bank ":name"',
|
||||
'add' => 'Add',
|
||||
'remove' => 'Remove',
|
||||
'max_amount_add' => 'The maximum amount you can add is',
|
||||
'max_amount_remove' => 'The maximum amount you can remove is',
|
||||
'update_piggy_button' => 'Update piggy bank',
|
||||
'update_piggy_title' => 'Update piggy bank ":name"',
|
||||
'details' => 'Details',
|
||||
'events' => 'Events',
|
||||
'target_amount' => 'Target amount',
|
||||
'start_date' => 'Start date',
|
||||
'target_date' => 'Target date',
|
||||
'no_target_date' => 'No target date',
|
||||
'reminder' => 'Reminder',
|
||||
'no_reminder' => 'No reminder',
|
||||
'reminders_left' => 'Reminders left',
|
||||
'expected_amount_per_reminder' => 'Expected amount per reminder',
|
||||
'todo' => 'to do',
|
||||
'table' => 'Table',
|
||||
'piggy_bank_not_exists' => 'Piggy bank no longer exists.',
|
||||
'add_any_amount_to_piggy' => 'Add money to this piggy bank to reach your target of :amount.',
|
||||
'add_set_amount_to_piggy' => 'Add :amount to fill this piggy bank on :date',
|
||||
'delete_piggy_bank' => 'Delete piggy bank ":name"',
|
||||
|
||||
// tags
|
||||
'delete_tag' => 'Delete tag ":name"',
|
||||
|
||||
|
||||
// some extra help:
|
||||
'accountExtraHelp_asset' => '',
|
||||
'accountExtraHelp_expense' => '',
|
||||
'accountExtraHelp_revenue' => '',
|
||||
];
|
||||
|
@ -1,37 +1,44 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
// general stuff:
|
||||
'test' => 'Nederlands geselecteerd!',
|
||||
'close' => 'Sluiten',
|
||||
'pleaseHold' => 'Momentje...',
|
||||
'mandatoryFields' => 'Verplichte velden',
|
||||
'optionalFields' => 'Optionele velden',
|
||||
'options' => 'Opties',
|
||||
'something' => 'Iets!',
|
||||
'actions' => 'Acties',
|
||||
'edit' => 'Wijzig',
|
||||
'delete' => 'Verwijder',
|
||||
'welcomeBack' => 'Hoe staat het er voor?',
|
||||
|
||||
'everything' => 'Alles',
|
||||
'customRange' => 'Zelf bereik kiezen',
|
||||
'apply' => 'Go',
|
||||
'cancel' => 'Annuleren',
|
||||
'from' => 'Van',
|
||||
'to' => 'Tot',
|
||||
|
||||
'showEverything' => 'Laat alles zien',
|
||||
|
||||
// forms:
|
||||
'mandatoryFields' => 'Verplichte velden',
|
||||
'optionalFields' => 'Optionele velden',
|
||||
'options' => 'Opties',
|
||||
'something' => 'Iets!',
|
||||
|
||||
// budgets:
|
||||
'create_new_budget' => 'Maak een nieuw budget',
|
||||
'store_new_budget' => 'Sla nieuw budget op',
|
||||
|
||||
'availableIn' => 'Beschikbaar in :date',
|
||||
'transactionsWithoutBudget' => 'Uitgaven zonder budget',
|
||||
'transactionsWithoutBudgetDate' => 'Uitgaven zonder budget in :date',
|
||||
'createBudget' => 'Maak nieuw budget',
|
||||
'inactiveBudgets' => 'Inactieve budgetten',
|
||||
'without_budget_between' => 'Transacties zonder budget tussen :start en :end',
|
||||
'budget_in_month' => ':name in :month',
|
||||
'delete_budget' => 'Verwijder budget ":name"',
|
||||
|
||||
// bills:
|
||||
'delete_bill' => 'Verwijder rekening ":name"',
|
||||
|
||||
// accounts:
|
||||
|
||||
'details_for_asset' => 'Overzicht voor betaalrekening ":name"',
|
||||
'details_for_expense' => 'Overzicht voor crediteur ":name"',
|
||||
'details_for_revenue' => 'Overzicht voor debiteur ":name"',
|
||||
@ -61,6 +68,23 @@ return [
|
||||
'make_new_expense_account' => 'Nieuwe crediteur',
|
||||
'make_new_revenue_account' => 'Nieuwe debiteur',
|
||||
|
||||
'asset_accounts' => 'Betaalrekeningen',
|
||||
'expense_accounts' => 'Crediteuren',
|
||||
'revenue_accounts' => 'Debiteuren',
|
||||
|
||||
// some extra help:
|
||||
'accountExtraHelp_asset' => '',
|
||||
'accountExtraHelp_expense' =>
|
||||
'Een crediteur is een persoon of een bedrijf waar je geld aan moet betalen. Je staat bij ze in het krijt. Een verwarrende' .
|
||||
' term misschien, maar zo werkt het nou eenmaal. De supermarkt, je huurbaas of de bank zijn crediteuren. Jouw ' .
|
||||
'geld (krediet) gaat naar hen toe. De term komt uit de wereld van de boekhouding. De uitgaves die je hier ziet zijn ' .
|
||||
'positief, want je kijkt uit hun perspectief. Zodra jij afrekent in een winkel, komt het geld er bij hen bij (positief).',
|
||||
'accountExtraHelp_revenue' => 'Als je geld krijgt van een bedrijf of een persoon is dat een debiteur. ' .
|
||||
'Dat kan salaris zijn, of een andere betaling. ' .
|
||||
' Ze hebben een schuld (debet) aan jou. De term komt uit de wereld van de boekhouding.' .
|
||||
' De inkomsten die je hier ziet zijn negatief, want je kijkt uit hun perspectief. Zodra een debiteur geld naar jou ' .
|
||||
'overmaakt gaat het er bij hen af (negatief).',
|
||||
|
||||
// categories:
|
||||
'new_category' => 'Nieuwe categorie',
|
||||
'without_category' => 'Zonder categorie',
|
||||
@ -68,12 +92,22 @@ return [
|
||||
'categories' => 'Categorieën',
|
||||
'no_category' => '(geen categorie)',
|
||||
'category' => 'Categorie',
|
||||
'delete_category' => 'Verwijder categorie ":name"',
|
||||
|
||||
// transactions:
|
||||
'update_withdrawal' => 'Wijzig uitgave',
|
||||
'update_deposit' => 'Wijzig inkomsten',
|
||||
'update_transfer' => 'Wijzig overschrijving',
|
||||
'delete_withdrawal' => 'Verwijder uitgave ":description"',
|
||||
'delete_deposit' => 'Verwijder inkomsten ":description"',
|
||||
'delete_transfer' => 'Verwijder overschrijving ":description"',
|
||||
|
||||
// new user:
|
||||
'welcome' => 'Welkom bij Firefly!',
|
||||
'createNewAsset' => 'Maak om te beginnen een nieuwe betaalrekening. Dit is je start van je financiële beheer.',
|
||||
'createNewAssetButton' => 'Maak een nieuwe betaalrekening',
|
||||
|
||||
|
||||
// home page:
|
||||
'yourAccounts' => 'Je betaalrekeningen',
|
||||
'budgetsAndSpending' => 'Budgetten en uitgaven',
|
||||
@ -122,6 +156,7 @@ return [
|
||||
'createNew' => 'Nieuw',
|
||||
'withdrawal' => 'Uitgave',
|
||||
'deposit' => 'Inkomsten',
|
||||
'account' => 'Rekening',
|
||||
'transfer' => 'Overschrijving',
|
||||
'Withdrawal' => 'Uitgave',
|
||||
'Deposit' => 'Inkomsten',
|
||||
@ -141,6 +176,7 @@ return [
|
||||
'half-year' => 'Elk half jaar',
|
||||
'yearly' => 'Jaarlijks',
|
||||
|
||||
// reports:
|
||||
'reportForYear' => 'Jaaroverzicht :year',
|
||||
'reportForYearShared' => 'Jaaroverzicht :year (inclusief gedeelde rekeningen)',
|
||||
'reportForMonth' => 'Maandoverzicht van :date',
|
||||
@ -151,15 +187,10 @@ return [
|
||||
'balanceEndOfYear' => 'Saldo aan het einde van het jaar',
|
||||
'balanceStartOfMonth' => 'Saldo aan het begin van de maand',
|
||||
'balanceEndOfMonth' => 'Saldo aan het einde van de maand',
|
||||
|
||||
'balanceStart' => 'Saldo aan het begin van de periode',
|
||||
'balanceEnd' => 'Saldo aan het einde van de periode',
|
||||
|
||||
'reportsOwnAccounts' => 'Overzichten voor je eigen betaalrekeningen',
|
||||
'reportsOwnAccountsAndShared' => 'Overzichten voor je eigen betaalrekeningen en gedeelde rekeningen',
|
||||
|
||||
'account' => 'Rekening',
|
||||
|
||||
'splitByAccount' => 'Per betaalrekening',
|
||||
'balancedByTransfersAndTags' => 'Gecorrigeerd met overschrijvingen en tags',
|
||||
'coveredWithTags' => 'Gecorrigeerd met tags',
|
||||
@ -167,11 +198,9 @@ return [
|
||||
'expectedBalance' => 'Verwacht saldo',
|
||||
'outsideOfBudgets' => 'Buiten budgetten',
|
||||
'leftInBudget' => 'Over van budget',
|
||||
|
||||
'sumOfSums' => 'Alles bij elkaar',
|
||||
'notCharged' => '(Nog) niet betaald',
|
||||
'inactive' => 'Niet actief',
|
||||
|
||||
'difference' => 'Verschil',
|
||||
'in' => 'In',
|
||||
'out' => 'Uit',
|
||||
@ -203,20 +232,38 @@ return [
|
||||
'average' => 'Gemiddeld',
|
||||
'balanceFor' => 'Saldo op :name',
|
||||
|
||||
'asset_accounts' => 'Betaalrekeningen',
|
||||
'expense_accounts' => 'Crediteuren',
|
||||
'revenue_accounts' => 'Debiteuren',
|
||||
// piggy banks:
|
||||
'new_piggy_bank' => 'Nieuw spaarpotje',
|
||||
'account_status' => 'Rekeningoverzicht',
|
||||
'left_for_piggy_banks' => 'Over voor spaarpotjes',
|
||||
'sum_of_piggy_banks' => 'Som van spaarpotjes',
|
||||
'saved_so_far' => 'Gespaard',
|
||||
'left_to_save' => 'Te sparen',
|
||||
'add_money_to_piggy_title' => 'Stop geld in spaarpotje ":name"',
|
||||
'remove_money_from_piggy_title' => 'Haal geld uit spaarpotje ":name"',
|
||||
'add' => 'Toevoegen',
|
||||
'remove' => 'Verwijderen',
|
||||
'max_amount_add' => 'Hooguit toe te voegen',
|
||||
'max_amount_remove' => 'Hooguit te verwijderen',
|
||||
'update_piggy_button' => 'Wijzig spaarpotje',
|
||||
'update_piggy_title' => 'Wijzig spaarpotje ":name"',
|
||||
'details' => 'Details',
|
||||
'events' => 'Gebeurtenissen',
|
||||
'target_amount' => 'Doelbedrag',
|
||||
'start_date' => 'Startdatum',
|
||||
'target_date' => 'Doeldatum',
|
||||
'no_target_date' => 'Geen doeldatum',
|
||||
'reminder' => 'Herinnering',
|
||||
'no_reminder' => 'Geen herinnering',
|
||||
'reminders_left' => 'Herinneringen te gaan',
|
||||
'expected_amount_per_reminder' => 'Verwacht bedrag per herinnering',
|
||||
'todo' => 'te doen',
|
||||
'table' => 'Tabel',
|
||||
'add_any_amount_to_piggy' => 'Stop geld in dit spaarpotje om het doel van :amount te halen.',
|
||||
'add_set_amount_to_piggy' => 'Stop voor :date :amount in dit spaarpotje om hem op tijd te vullen.',
|
||||
'delete_piggy_bank' => 'Verwijder spaarpotje ":name"',
|
||||
|
||||
// tags
|
||||
'delete_tag' => 'Verwijder tag ":name"',
|
||||
|
||||
// some extra help:
|
||||
'accountExtraHelp_asset' => '',
|
||||
'accountExtraHelp_expense' =>
|
||||
'Een crediteur is een persoon of een bedrijf waar je geld aan moet betalen. Je staat bij ze in het krijt. Een verwarrende' .
|
||||
' term misschien, maar zo werkt het nou eenmaal. De supermarkt, je huurbaas of de bank zijn crediteuren. Jouw ' .
|
||||
'geld (krediet) gaat naar hen toe. De term komt uit de wereld van de boekhouding. De uitgaves die je hier ziet zijn ' .
|
||||
'positief, want je kijkt uit hun perspectief. Zodra jij afrekent in een winkel, komt het geld er bij hen bij (positief).',
|
||||
'accountExtraHelp_revenue' => 'Als je geld krijgt van een bedrijf of een persoon is dat een debiteur. ' .
|
||||
'Dat kan salaris zijn, of een andere betaling. ' .
|
||||
' Ze hebben een schuld (debet) aan jou. De term komt uit de wereld van de boekhouding.' .
|
||||
' De inkomsten die je hier ziet zijn negatief, want je kijkt uit hun perspectief. Zodra een debiteur geld naar jou ' .
|
||||
'overmaakt gaat het er bij hen af (negatief).',
|
||||
];
|
||||
|
@ -11,23 +11,20 @@
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-4 col-sm-3">
|
||||
<small>{{ 'budgeted'|_ }}: <span id="budgetedAmount" data-value="300"></span></small>
|
||||
<small>{{ 'budgeted'|_ }}: <span id="budgetedAmount" class="text-success">{{ budgeted|formatAmountPlain }}</span></small>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-4 col-sm-3" style="text-align:right;">
|
||||
<small>{{ trans('firefly.availableIn',{date : Session.get('start').formatLocalized(monthFormat) }) }}:
|
||||
<a href="#" class="updateIncome"><span id="totalAmount" data-value="{{ amount }}">{{ amount|formatAmount }}</span></a></small>
|
||||
<a href="#" class="updateIncome"><span id="budgetIncomeTotal" data-value="{{ budgetIncomeTotal }}">{{ budgetIncomeTotal|formatAmount }}</span></a></small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<div class="progress progress-striped">
|
||||
<div class="progress-bar progress-bar-info" id="progress-bar-default" role="progressbar" aria-valuenow="0" aria-valuemin="0"
|
||||
aria-valuemax="100" style="width: 0;"></div>
|
||||
<div class="progress-bar progress-bar-danger" id="progress-bar-danger" role="progressbar" aria-valuenow="0" aria-valuemin="0"
|
||||
aria-valuemax="100" style="width: 0;"></div>
|
||||
<div class="progress-bar progress-bar-warning" id="progress-bar-warning" role="progressbar" aria-valuenow="10" aria-valuemin="0"
|
||||
aria-valuemax="100" style="width: 0;"></div>
|
||||
<div class="progress progress-striped budgetedBar">
|
||||
<div class="progress-bar progress-bar-danger" id="progress-bar-danger" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0;"></div>
|
||||
<div class="progress-bar progress-bar-warning" id="progress-bar-warning" role="progressbar" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100" style="width: 0;"></div>
|
||||
<div class="progress-bar progress-bar-info" id="progress-bar-default" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -38,16 +35,10 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<div class="progress progress-striped">
|
||||
{% if overspent %}
|
||||
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="{{ spentPCT }}" aria-valuemin="0"
|
||||
aria-valuemax="100" style="width: {{ spentPCT }}%;"></div>
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="{{ 100-spentPCT }}" aria-valuemin="0"
|
||||
aria-valuemax="100" style="width: {{ 100-spentPCT }}%;"></div>
|
||||
{% else %}
|
||||
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="{{ spentPCT }}" aria-valuemin="0"
|
||||
aria-valuemax="100" style="width: {{ spentPCT }}%;"></div>
|
||||
{% endif %}
|
||||
<div class="progress progress-striped spentBar">
|
||||
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0;"></div>
|
||||
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0;"></div>
|
||||
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -80,76 +71,48 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-fw fa-tasks"></i>
|
||||
<!-- link in header -->
|
||||
{% if budget.currentRep %}
|
||||
<a href="{{ route('budgets.show', [budget.id, budget.currentRep.id]) }}" id="budget-link-{{ budget.id }}">{{ budget.name }}</a>
|
||||
<a href="{{ route('budgets.show', [budget.id, budget.currentRep.id]) }}" class="budget-link" data-id="{{ budget.id }}">{{ budget.name }}</a>
|
||||
{% else %}
|
||||
<a href="{{ route('budgets.show',budget.id) }}" id="budget-link-{{ budget.id }}">{{ budget.name }}</a>
|
||||
<a href="{{ route('budgets.show',budget.id) }}" class="budget-link" data-id="{{ budget.id }}">{{ budget.name }}</a>
|
||||
{% endif %}
|
||||
|
||||
|
||||
<!-- ACTIONS MENU -->
|
||||
<div class="pull-right">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
|
||||
{{ 'actions'|_ }}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" role="menu">
|
||||
<li><a href="{{ route('budgets.edit',budget.id) }}"><i class="fa fa-pencil fa-fw"></i> {{ 'edit'|_ }}</a></li>
|
||||
<li><a href="{{ route('budgets.delete',budget.id) }}"><i class="fa fa-trash fa-fw"></i> {{ 'delete'|_ }}</a></li>
|
||||
</ul>
|
||||
<div class="pull-right">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
|
||||
{{ 'actions'|_ }}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" role="menu">
|
||||
<li><a href="{{ route('budgets.edit',budget.id) }}"><i class="fa fa-pencil fa-fw"></i> {{ 'edit'|_ }}</a></li>
|
||||
<li><a href="{{ route('budgets.delete',budget.id) }}"><i class="fa fa-trash fa-fw"></i> {{ 'delete'|_ }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td style="width:40%;">{{ 'budgeted'|_ }}</td>
|
||||
<td>
|
||||
<div class="form-group" style="margin-bottom:0;">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">{{ defaultCurrency.symbol|raw }}</div>
|
||||
<input type="hidden" name="balance_currency_id" value="1" />
|
||||
<input class="form-control budgetAmount" data-original="{{ budget.currentRep.amount|number_format(0,'','') }}" data-id="{{ budget.id }}" value="{{ budget.currentRep.amount|number_format(0,'','') }}" autocomplete="off" step="1" min="0" max="{{ budgetMaximum }}" name="amount" type="number">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:50%;">{{ 'spent'|_ }}</td>
|
||||
<td>{{ budget.spent|formatAmount }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<!-- the range in which the budget can be set -->
|
||||
<p>
|
||||
{% if budget.currentRep %}
|
||||
<input type="range" data-id="{{ budget.id }}" data-spent="{{ budget.spent }}" id="budget-range-{{ budget.id }}"
|
||||
max="{{ budgetMaximum }}" min="0" value="{{ budget.currentRep.amount }}"/>
|
||||
{% else %}
|
||||
<input type="range" data-id="{{ budget.id }}" data-spent="{{ budget.spent }}" id="budget-range-{{ budget.id }}"
|
||||
max="{{ budgetMaximum }}" min="0" value="0"/>
|
||||
{% endif %}
|
||||
</p>
|
||||
<!-- some textual info about the budget. Updates dynamically. -->
|
||||
<p>
|
||||
<!-- budget-holder-X holds all the elements -->
|
||||
<span id="budget-holder-{{ budget.id }}">
|
||||
{% if budget.currentRep %}
|
||||
<!-- budget-description-X holds the description. -->
|
||||
<span id="budget-description-{{ budget.id }}">Budgeted: </span>
|
||||
<!-- budget-info-X holds the input and the euro-sign: -->
|
||||
<span id="budget-info-{{ budget.id }}">
|
||||
{% if budget.currentRep.amount > budget.spent %}
|
||||
<span class="text-success">{{ getCurrencySymbol()|raw }}</span> <input type="number" min="0" max="{{ budgetMaximum }}" data-id="{{ budget.id }}"
|
||||
step="1" value="{{ budget.currentRep.amount }}"
|
||||
style="width:90px;color:#3c763d;"/>
|
||||
{% else %}
|
||||
<span class="text-danger">{{ getCurrencySymbol()|raw }}</span> <input type="number" min="0" max="{{ budgetMaximum }}" data-id="{{ budget.id }}"
|
||||
step="1" value="{{ budget.currentRep.amount }}"
|
||||
style="width:90px;color:#a94442;"/>
|
||||
{% endif %}
|
||||
</span>
|
||||
{% else %}
|
||||
<span id="budget-description-{{ budget.id }}"><em>No budget</em></span>
|
||||
<span id="budget-info-{{ budget.id }}">
|
||||
<span class="text-success" style="display:none;">{{ getCurrencySymbol()|raw }}</span> <input data-id="{{ budget.id }}" type="number"
|
||||
min="0" max="{{ budgetMaximum }}" step="1"
|
||||
value="0"
|
||||
style="width:50px;color:#3c763d;display:none;"/>
|
||||
</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<span id="spent-{{ budget.id }}" data-value="{{ budget.spent }}">{{ 'spent'|_ }}: {{ budget.spent|formatAmount }}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="col-lg-3 col-sm-4 col-md-6">
|
||||
<div class="panel panel-default">
|
||||
@ -191,5 +154,15 @@
|
||||
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script type="text/javascript">
|
||||
// actually spent bar data:
|
||||
var spent = {{ spent }};
|
||||
var currencySymbol = "{{ getCurrencySymbol()|raw }}";
|
||||
|
||||
// budgeted data:
|
||||
var budgeted = {{ budgeted }};
|
||||
var budgetIncomeTotal = {{ budgetIncomeTotal }};
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="js/budgets.js"></script>
|
||||
{% endblock %}
|
||||
|
@ -37,5 +37,18 @@
|
||||
<div class="title">Be right back.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', '{{ env('ANALYTICS_ID', 'XXX-XX-X') }}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -169,8 +169,11 @@
|
||||
ga('send', 'pageview');
|
||||
|
||||
// send an event if relevant:
|
||||
{% if Session.has('gaEventCategory') and Session.has('gaEventAction') %}
|
||||
ga('send', 'event', '{{Session.get('gaEventCategory')}}', '{{Session.get('gaEventAction')}}');
|
||||
{% if Session.has('gaEventCategory') and Session.has('gaEventAction') and not Session.has('gaEventLabel') %}
|
||||
ga('send', 'event', '{{Session.get('gaEventCategory')}}', '{{Session.get('gaEventAction')}}');
|
||||
{% endif %}
|
||||
{% if Session.has('gaEventCategory') and Session.has('gaEventAction') and Session.has('gaEventLabel') %}
|
||||
ga('send', 'event', '{{Session.get('gaEventCategory')}}', '{{Session.get('gaEventAction')}}','{{ Session.get('gaEventLabel') }}');
|
||||
{% endif %}
|
||||
|
||||
</script>
|
||||
|
@ -58,5 +58,28 @@
|
||||
<script type="text/javascript" src="js/metisMenu.min.js"></script>
|
||||
<script type="text/javascript" src="js/sb-admin-2.js"></script>
|
||||
|
||||
<script>
|
||||
(function (i, s, o, g, r, a, m) {
|
||||
i['GoogleAnalyticsObject'] = r;
|
||||
i[r] = i[r] || function () {
|
||||
(i[r].q = i[r].q || []).push(arguments)
|
||||
}, i[r].l = 1 * new Date();
|
||||
a = s.createElement(o),
|
||||
m = s.getElementsByTagName(o)[0];
|
||||
a.async = 1;
|
||||
a.src = g;
|
||||
m.parentNode.insertBefore(a, m)
|
||||
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
|
||||
|
||||
ga('create', '{{ env('ANALYTICS_ID', 'XXX-XX-X') }}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
|
||||
// send an event if relevant:
|
||||
{% if Session.has('gaEventCategory') and Session.has('gaEventAction') %}
|
||||
ga('send', 'event', '{{Session.get('gaEventCategory')}}', '{{Session.get('gaEventAction')}}');
|
||||
{% endif %}
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<td style="width:100px;">
|
||||
<div class="btn-group btn-group-xs">
|
||||
<a href="{{ route('piggy-banks.edit', piggyBank.id)}}" class="btn btn-default btn-xs"><i class="fa fa-pencil fa-fw"></i></a>
|
||||
<a href="{{ route('piggy-banks.delete', piggyBank.id)}}" class="btn btn-default btn-xs"><i class="fa fa-trash fa-fw"></i></a>
|
||||
<a href="{{ route('piggy-banks.delete', piggyBank.id)}}" class="btn btn-danger btn-xs"><i class="fa fa-trash fa-fw"></i></a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -171,7 +171,24 @@
|
||||
</ul>
|
||||
<!-- /.nav-second-level -->
|
||||
</li>
|
||||
<!-- profile, again-->
|
||||
<!-- top menu again -->
|
||||
<li class="hidden-sm hidden-md hidden-lg">
|
||||
<a class="{{ activeRoute('profile',null,true) }}" href="{{ route('profile') }}"><i class="fa fa-user fa-fw"></i> {{ Auth.user.email }}</a>
|
||||
</li>
|
||||
|
||||
<li class="hidden-sm hidden-md hidden-lg">
|
||||
<a class="{{ activeRoute('preferences',null,true) }}" href="{{ route('preferences') }}"><i class="fa fa-gear fa-fw"></i> {{ 'preferences'|_ }}</a>
|
||||
</li>
|
||||
<li class="hidden-sm hidden-md hidden-lg">
|
||||
<a class="{{ activeRoute('currency') }}" href="{{ route('currency.index') }}"><i class="fa fa-usd fa-fw"></i> {{ 'currency'|_ }}</a>
|
||||
</li>
|
||||
<li class="hidden-sm hidden-md hidden-lg">
|
||||
<a class="{{ activeRoute('reminders') }}" href="{{ route('reminders.index') }}"><i class="fa fa-clock-o fa-fw"></i> {{ 'reminders'|_ }}</a>
|
||||
</li>
|
||||
<li class="hidden-sm hidden-md hidden-lg">
|
||||
<a href="{{ route('logout') }}"><i class="fa fa-sign-out fa-fw"></i> {{ 'logout'|_ }}</a>
|
||||
</li>
|
||||
|
||||
<!-- reminders, again-->
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -2,12 +2,12 @@
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">{{ 'close'|_ }}</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel">Add money to {{ piggyBank.name }}</h4>
|
||||
<h4 class="modal-title" id="myModalLabel">{{ trans('firefly.add_money_to_piggy_title', {name: piggyBank.name}) }}</h4>
|
||||
</div>
|
||||
<form style="display: inline;" id="add" action="{{ route('piggy-banks.add', piggyBank.id) }}" method="POST">
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
The maximum amount you can add is {{ maxAmount|formatAmount }}.
|
||||
{{ 'max_amount_add'|_ }}: {{ maxAmount|formatAmount }}.
|
||||
</p>
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">{{ getCurrencySymbol()|raw }}</div>
|
||||
@ -17,7 +17,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button>
|
||||
<button type="submit" class="btn btn-primary">Add</button>
|
||||
<button type="submit" class="btn btn-primary">{{ 'add'|_ }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -50,7 +50,7 @@
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<p>
|
||||
<button type="submit" class="btn btn-lg btn-success">
|
||||
<i class="fa fa-pencil"></i> Update piggy bank
|
||||
<i class="fa fa-pencil"></i> {{ 'update_piggy_button'|_ }}
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<p>
|
||||
<a href="{{ route('piggy-banks.create') }}" class="btn btn-success"><i class="fa fa-sort-amount-asc fa-fw"></i> Create new piggy bank</a>
|
||||
<a href="{{ route('piggy-banks.create') }}" class="btn btn-success"><i class="fa fa-sort-amount-asc fa-fw"></i> {{ 'new_piggy_bank'|_ }}</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -22,16 +22,16 @@
|
||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-fw fa-money"></i> Account status
|
||||
<i class="fa fa-fw fa-money"></i> {{ 'account_status'|_ }}
|
||||
</div>
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th>Account</th>
|
||||
<th>Balance</th>
|
||||
<th>Left for piggy banks</th>
|
||||
<th>Sum of piggy banks</th>
|
||||
<th>Saved so far</th>
|
||||
<th>Left to save</th>
|
||||
<th>{{ 'account'|_ }}</th>
|
||||
<th>{{ 'balance'|_ }}</th>
|
||||
<th>{{ 'left_for_piggy_banks'|_ }}</th>
|
||||
<th>{{ 'sum_of_piggy_banks'|_ }}</th>
|
||||
<th>{{ 'saved_so_far'|_ }}</th>
|
||||
<th>{{ 'left_to_save'|_ }}</th>
|
||||
</tr>
|
||||
{% for id,info in accounts %}
|
||||
<tr>
|
||||
|
@ -4,12 +4,12 @@
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">{{ 'close'|_ }}</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel">Remove money from {{ piggyBank.name }}</h4>
|
||||
<h4 class="modal-title" id="myModalLabel">{{ trans('firefly.remove_money_from_piggy_title', {name: piggyBank.name}) }}</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
The maximum amount you can remove is {{ currentRelevantRepAmount(piggyBank)|formatAmount }}
|
||||
{{ 'max_amount_remove'|_ }}: {{ currentRelevantRepAmount(piggyBank)|formatAmount }}.
|
||||
</p>
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">{{ getCurrencySymbol()|raw }}</div>
|
||||
@ -18,7 +18,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button>
|
||||
<button type="submit" class="btn btn-primary">Remove</button>
|
||||
<button type="submit" class="btn btn-primary">{{ 'remove'|_ }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<div class="col-lg-8 col-md-8 col-sm-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-fw fa-clock-o"></i> Events
|
||||
<i class="fa fa-fw fa-clock-o"></i> {{ 'events'|_ }}
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div id="piggy-bank-history"></div>
|
||||
@ -15,7 +15,7 @@
|
||||
<div class="col-lg-4 col-md-4 col-sm-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-fw fa-info-circle"></i> Details
|
||||
<i class="fa fa-fw fa-info-circle"></i> {{ 'details'|_ }}
|
||||
|
||||
<!-- ACTIONS MENU -->
|
||||
<div class="pull-right">
|
||||
@ -34,49 +34,49 @@
|
||||
</div>
|
||||
<table class="table table-bordered table-striped">
|
||||
<tr>
|
||||
<td>Account</td>
|
||||
<td>{{ 'account'|_ }}</td>
|
||||
<td><a href="{{ route('accounts.show', piggyBank.account_id) }}">{{ piggyBank.account.name }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Target amount</td>
|
||||
<td>{{ 'target_amount'|_ }}</td>
|
||||
<td>{{ piggyBank.targetAmount|formatAmount }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Saved so far</td>
|
||||
<td>{{ 'saved_so_far'|_ }}</td>
|
||||
<td>{{ currentRelevantRepAmount(piggyBank)|formatAmount }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Left to save</td>
|
||||
<td>{{ 'left_to_save'|_ }}</td>
|
||||
<td>{{ piggyBank.targetamount - currentRelevantRepAmount(piggyBank)|formatAmount }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Start date</td>
|
||||
<td>{{ 'start_date'|_ }}</td>
|
||||
<td>
|
||||
{% if piggyBank.startdate %}
|
||||
{{ piggyBank.startdate.format('jS F Y')}}
|
||||
{% else %}
|
||||
<em>No start date</em>
|
||||
<em>{{ 'no_start_date'|_ }}</em>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Target date</td>
|
||||
<td>{{ 'target_date'|_ }}</td>
|
||||
<td>
|
||||
{% if piggyBank.targetdate %}
|
||||
{{ piggyBank.targetdate.format('jS F Y') }}
|
||||
{% else %}
|
||||
<em>No start date</em>
|
||||
<em>{{ 'no_target_date'|_ }}</em>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% if piggyBank.reminder %}
|
||||
<tr>
|
||||
<td>Reminder</td>
|
||||
<td>{{ 'reminder'|_ }}</td>
|
||||
<td>
|
||||
{% if piggyBank.remind_me == 0 %}
|
||||
<em>(no reminder)</em>
|
||||
<em>{{ 'no_reminder'|_ }}</em>
|
||||
{% else %}
|
||||
Every
|
||||
{{ 'every'|_ }}
|
||||
{% if piggyBank.reminder_skip != 0 %}
|
||||
{{ piggyBank.reminder_skip }}
|
||||
{% else %}
|
||||
@ -87,18 +87,18 @@
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td>Reminders left</td>
|
||||
<td>(in progress...)</td>
|
||||
<td>{{ 'reminders_left'|_ }}</td>
|
||||
<td>{{ 'todo'|_ }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Expected amount per reminder</td>
|
||||
<td>(in progress...)</td>
|
||||
<td>{{ 'expected_amount_per_reminder'|_ }}</td>
|
||||
<td>{{ 'todo'|_ }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-fw fa-clock-o"></i> Table
|
||||
<i class="fa fa-fw fa-clock-o"></i> {{ 'table'|_ }}
|
||||
</div>
|
||||
{% include 'list/piggy-bank-events' %}
|
||||
</div>
|
||||
|
@ -87,7 +87,7 @@
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<p>
|
||||
<button type="submit" class="btn btn-lg btn-success">
|
||||
<i class="fa fa-pencil"></i> Update transaction
|
||||
<i class="fa fa-pencil"></i> {{ ('update_' ~ what)|_ }}
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
|
2
storage/database/.gitignore
vendored
2
storage/database/.gitignore
vendored
@ -1 +1 @@
|
||||
*.db
|
||||
*.db
|
||||
|
@ -57,6 +57,24 @@ class BudgetControllerTest extends TestCase
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\BudgetController::amount
|
||||
*/
|
||||
public function testAmountZero()
|
||||
{
|
||||
$repository = $this->mock('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
|
||||
$limitRepetition = FactoryMuffin::create('FireflyIII\Models\LimitRepetition');
|
||||
$budget = $limitRepetition->budgetlimit->budget;
|
||||
$this->be($budget->user);
|
||||
$today = new Carbon;
|
||||
|
||||
$this->session(['start' => $today]);
|
||||
$repository->shouldReceive('updateLimitAmount')->once()->andReturn($limitRepetition);
|
||||
$this->call('POST', '/budgets/amount/' . $budget->id, ['amount' => 0, '_token' => 'replaceme']);
|
||||
$this->assertResponseOk();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Http\Controllers\BudgetController::create
|
||||
*/
|
||||
@ -122,20 +140,23 @@ class BudgetControllerTest extends TestCase
|
||||
*/
|
||||
public function testIndex()
|
||||
{
|
||||
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
|
||||
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
|
||||
$this->be($budget->user);
|
||||
$collection = new Collection;
|
||||
$collection->push($budget);
|
||||
$repository = $this->mock('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
|
||||
$repetition = FactoryMuffin::create('FireflyIII\Models\LimitRepetition');
|
||||
|
||||
$repository->shouldReceive('getActiveBudgets')->once()->andReturn($collection);
|
||||
$repository->shouldReceive('getInactiveBudgets')->once()->andReturn($collection);
|
||||
$repository->shouldReceive('cleanupBudgets')->once();
|
||||
$repository->shouldReceive('spentInPeriodCorrected')->once();
|
||||
$repository->shouldReceive('getCurrentRepetition')->once();
|
||||
$repository->shouldReceive('getCurrentRepetition')->once()->andReturn($repetition);
|
||||
Amount::shouldReceive('getCurrencySymbol')->andReturn('x');
|
||||
Amount::shouldReceive('format')->andReturn('x');
|
||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||
$this->call('GET', '/budgets');
|
||||
|
||||
$this->assertResponseOk();
|
||||
|
@ -38,6 +38,7 @@ class HelpControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* Everything present and accounted for, and in cache:
|
||||
*
|
||||
* @covers FireflyIII\Http\Controllers\HelpController::show
|
||||
*/
|
||||
public function testGetHelpText()
|
||||
@ -59,6 +60,7 @@ class HelpControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* Everything present and accounted for, but not cached
|
||||
*
|
||||
* @covers FireflyIII\Http\Controllers\HelpController::show
|
||||
*/
|
||||
public function testGetHelpTextNoCache()
|
||||
@ -82,6 +84,7 @@ class HelpControllerTest extends TestCase
|
||||
|
||||
/**
|
||||
* No such route.
|
||||
*
|
||||
* @covers FireflyIII\Http\Controllers\HelpController::show
|
||||
*/
|
||||
public function testGetHelpTextNoRoute()
|
||||
|
@ -360,16 +360,16 @@ class TransactionControllerTest extends TestCase
|
||||
$account2 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||
|
||||
$piggy = FactoryMuffin::create('FireflyIII\Models\PiggyBank');
|
||||
$piggy = FactoryMuffin::create('FireflyIII\Models\PiggyBank');
|
||||
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$this->be($account->user);
|
||||
|
||||
$account2->user_id = $account->user_id;
|
||||
$account->account_type_id = $asset->id;
|
||||
$account2->account_type_id = $asset->id;
|
||||
$piggy->account_id = $account->id;
|
||||
$piggy->account_id = $account->id;
|
||||
$account->save();
|
||||
$account2->save();
|
||||
$piggy->save();
|
||||
|
@ -233,16 +233,20 @@ class ReportHelperTest extends TestCase
|
||||
$left->save();
|
||||
|
||||
// save meta for account:
|
||||
AccountMeta::create([
|
||||
'account_id' => $left->id,
|
||||
'name' => 'accountRole',
|
||||
'data' => 'defaultAsset'
|
||||
]);
|
||||
AccountMeta::create([
|
||||
'account_id' => $right->id,
|
||||
'name' => 'accountRole',
|
||||
'data' => 'defaultAsset'
|
||||
]);
|
||||
AccountMeta::create(
|
||||
[
|
||||
'account_id' => $left->id,
|
||||
'name' => 'accountRole',
|
||||
'data' => 'defaultAsset'
|
||||
]
|
||||
);
|
||||
AccountMeta::create(
|
||||
[
|
||||
'account_id' => $right->id,
|
||||
'name' => 'accountRole',
|
||||
'data' => 'defaultAsset'
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
@ -292,16 +296,20 @@ class ReportHelperTest extends TestCase
|
||||
$right->account_type_id = $asset->id;
|
||||
|
||||
// save meta for account:
|
||||
AccountMeta::create([
|
||||
'account_id' => $left->id,
|
||||
'name' => 'accountRole',
|
||||
'data' => 'defaultAsset'
|
||||
]);
|
||||
AccountMeta::create([
|
||||
'account_id' => $right->id,
|
||||
'name' => 'accountRole',
|
||||
'data' => 'defaultAsset'
|
||||
]);
|
||||
AccountMeta::create(
|
||||
[
|
||||
'account_id' => $left->id,
|
||||
'name' => 'accountRole',
|
||||
'data' => 'defaultAsset'
|
||||
]
|
||||
);
|
||||
AccountMeta::create(
|
||||
[
|
||||
'account_id' => $right->id,
|
||||
'name' => 'accountRole',
|
||||
'data' => 'defaultAsset'
|
||||
]
|
||||
);
|
||||
|
||||
$right->save();
|
||||
$left->save();
|
||||
|
@ -76,7 +76,7 @@ class AccountModelTest extends TestCase
|
||||
'name' => 'Some new account',
|
||||
'account_type_id' => $account->account_type_id,
|
||||
'user_id' => $account->user_id,
|
||||
'active' => 1,
|
||||
'active' => 1,
|
||||
];
|
||||
|
||||
$result = Account::firstOrCreateEncrypted($search);
|
||||
@ -125,7 +125,7 @@ class AccountModelTest extends TestCase
|
||||
'name' => 'Some new account',
|
||||
'account_type_id' => $account->account_type_id,
|
||||
'user_id' => $account->user_id,
|
||||
'active' => 1,
|
||||
'active' => 1,
|
||||
];
|
||||
|
||||
$result = Account::firstOrNullEncrypted($search);
|
||||
|
@ -38,24 +38,6 @@ class TagModelTest extends TestCase
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Models\Tag::firstOrCreateEncrypted
|
||||
*/
|
||||
public function testFirstOrCreateEncryptedNew()
|
||||
{
|
||||
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||
|
||||
$search = [
|
||||
'tagMode' => 'something',
|
||||
'tag' => 'Something else',
|
||||
'user_id' => $tag->user_id,
|
||||
];
|
||||
|
||||
$result = Tag::firstOrCreateEncrypted($search);
|
||||
|
||||
$this->assertNotEquals($tag->id, $result->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Models\Tag::firstOrCreateEncrypted
|
||||
*/
|
||||
@ -74,4 +56,22 @@ class TagModelTest extends TestCase
|
||||
$this->assertEquals($tag->id, $result->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Models\Tag::firstOrCreateEncrypted
|
||||
*/
|
||||
public function testFirstOrCreateEncryptedNew()
|
||||
{
|
||||
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||
|
||||
$search = [
|
||||
'tagMode' => 'something',
|
||||
'tag' => 'Something else',
|
||||
'user_id' => $tag->user_id,
|
||||
];
|
||||
|
||||
$result = Tag::firstOrCreateEncrypted($search);
|
||||
|
||||
$this->assertNotEquals($tag->id, $result->id);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -324,7 +324,7 @@ class TransactionJournalModelTest extends TestCase
|
||||
// make accounts
|
||||
$expense = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||
FactoryMuffin::create('FireflyIII\Models\Account');
|
||||
$asset = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||
$asset = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||
|
||||
Transaction::create(['account_id' => $expense->id, 'transaction_journal_id' => $withdrawal->id, 'amount' => 300]);
|
||||
Transaction::create(['account_id' => $asset->id, 'transaction_journal_id' => $withdrawal->id, 'amount' => -300]);
|
||||
|
@ -58,8 +58,8 @@ class AccountRepositoryTest extends TestCase
|
||||
public function testDestroy()
|
||||
{
|
||||
// create account:
|
||||
$account = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||
$accountId = $account->id;
|
||||
$account = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||
$accountId = $account->id;
|
||||
$this->be($account->user);
|
||||
|
||||
|
||||
|
@ -43,8 +43,8 @@ class BillRepositoryTest extends TestCase
|
||||
$end = Carbon::now()->endOfMonth();
|
||||
|
||||
// payment:
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$journal->date = $start;
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$journal->date = $start;
|
||||
$journal->bill_id = $bill->id;
|
||||
$journal->save();
|
||||
|
||||
|
@ -103,7 +103,7 @@ class CategoryRepositoryTest extends TestCase
|
||||
$journal1 = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$journal2 = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
/** @var Category $category */
|
||||
$category = FactoryMuffin::create('FireflyIII\Models\Category');
|
||||
$category = FactoryMuffin::create('FireflyIII\Models\Category');
|
||||
|
||||
$journal1->user_id = $user->id;
|
||||
$journal1->date = new Carbon('2015-02-11');
|
||||
@ -113,7 +113,7 @@ class CategoryRepositoryTest extends TestCase
|
||||
$journal2->date = new Carbon('2015-02-11');
|
||||
$journal2->transaction_type_id = $type->id;
|
||||
|
||||
$category->user_id = $user->id;
|
||||
$category->user_id = $user->id;
|
||||
$category->transactionjournals()->save($journal1);
|
||||
$category->transactionjournals()->save($journal2);
|
||||
|
||||
|
@ -58,7 +58,7 @@ class TagRepositoryTest extends TestCase
|
||||
public function testConnectBalancingOneDeposit()
|
||||
{
|
||||
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
$deposit = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
$deposit = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
@ -85,7 +85,7 @@ class TagRepositoryTest extends TestCase
|
||||
{
|
||||
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
$transfer = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
$transfer = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||
@ -142,6 +142,21 @@ class TagRepositoryTest extends TestCase
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers FireflyIII\Repositories\Tag\TagRepository::connect
|
||||
*/
|
||||
public function testConnectInvalidType()
|
||||
{
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||
$tag->tagMode = 'Idontknow';
|
||||
$tag->save();
|
||||
|
||||
$result = $this->object->connect($journal, $tag);
|
||||
$this->assertFalse($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.
|
||||
@ -156,7 +171,7 @@ class TagRepositoryTest extends TestCase
|
||||
|
||||
FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||
FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||
$asset = FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||
$asset = FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||
|
||||
$account = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||
|
||||
@ -203,7 +218,7 @@ class TagRepositoryTest extends TestCase
|
||||
|
||||
FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||
FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||
$asset = FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||
$asset = FactoryMuffin::create('FireflyIII\Models\AccountType');
|
||||
|
||||
$account1 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||
$account2 = FactoryMuffin::create('FireflyIII\Models\Account');
|
||||
@ -248,7 +263,7 @@ class TagRepositoryTest extends TestCase
|
||||
{
|
||||
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
$transfer = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
$transfer = FactoryMuffin::create('FireflyIII\Models\TransactionType');
|
||||
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$tag = FactoryMuffin::create('FireflyIII\Models\Tag');
|
||||
|
Loading…
Reference in New Issue
Block a user