+ | 'Form' => [
+ | 'is_safe' => [
+ | 'open'
+ | ]
+ | ]
+ |
+ |
+ | 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',
+ '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:
+ |
+ |
+ | 'link_to' => [
+ | 'is_safe' => ['html']
+ | ]
+ |
+ |
+ | 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.
+ |
+ |
+ | 'link' => [
+ | 'callback' => 'link_to'
+ | ]
+ |
+ |
+ */
+ '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:
+ |
+ |
+ | 'studly_case' => [
+ | 'is_safe' => ['html']
+ | ]
+ |
+ |
+ | The options array also takes a `callback` that allows you to name the
+ | filter differently in your Twig templates than what is actually called.
+ |
+ |
+ | 'snake' => [
+ | 'callback' => 'snake_case'
+ | ]
+ |
+ |
+ */
+ 'filters' => [],
+ ],
+ ]
]
);
}
diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php
index a00ffc289e..eaecd56528 100644
--- a/app/Providers/FireflyServiceProvider.php
+++ b/app/Providers/FireflyServiceProvider.php
@@ -2,13 +2,21 @@
namespace FireflyIII\Providers;
+use App;
+use FireflyIII\Models\Account;
use FireflyIII\Support\Amount;
use FireflyIII\Support\ExpandedForm;
use FireflyIII\Support\Navigation;
use FireflyIII\Support\Preferences;
use FireflyIII\Support\Steam;
+use FireflyIII\Support\Twig\Budget;
+use FireflyIII\Support\Twig\General;
+use FireflyIII\Support\Twig\Journal;
+use FireflyIII\Support\Twig\PiggyBank;
use FireflyIII\Validation\FireflyValidator;
use Illuminate\Support\ServiceProvider;
+use Twig;
+use TwigBridge\Extension\Loader\Functions;
use Validator;
/**
@@ -25,10 +33,22 @@ class FireflyServiceProvider extends ServiceProvider
return new FireflyValidator($translator, $data, $rules, $messages);
}
);
+ /*
+ * Default Twig configuration:
+ */
+
+ $config = App::make('config');
+ Twig::addExtension(new Functions($config));
+ Twig::addExtension(new PiggyBank);
+ Twig::addExtension(new General);
+ Twig::addExtension(new Journal);
+ Twig::addExtension(new Budget);
}
public function register()
{
+
+
$this->app->bind(
'preferences', function () {
return new Preferences;
@@ -63,6 +83,7 @@ class FireflyServiceProvider extends ServiceProvider
$this->app->bind('FireflyIII\Repositories\Bill\BillRepositoryInterface', 'FireflyIII\Repositories\Bill\BillRepository');
$this->app->bind('FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface', 'FireflyIII\Repositories\PiggyBank\PiggyBankRepository');
$this->app->bind('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface', 'FireflyIII\Repositories\Currency\CurrencyRepository');
+ $this->app->bind('FireflyIII\Repositories\Tag\TagRepositoryInterface', 'FireflyIII\Repositories\Tag\TagRepository');
$this->app->bind('FireflyIII\Support\Search\SearchInterface', 'FireflyIII\Support\Search\Search');
@@ -71,6 +92,7 @@ class FireflyServiceProvider extends ServiceProvider
$this->app->bind('FireflyIII\Helpers\Report\ReportHelperInterface', 'FireflyIII\Helpers\Report\ReportHelper');
$this->app->bind('FireflyIII\Helpers\Report\ReportQueryInterface', 'FireflyIII\Helpers\Report\ReportQuery');
+
}
}
diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php
index f8732d7867..330ff2fe81 100644
--- a/app/Repositories/Journal/JournalRepository.php
+++ b/app/Repositories/Journal/JournalRepository.php
@@ -4,10 +4,12 @@ namespace FireflyIII\Repositories\Journal;
use App;
use Auth;
+use DB;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
use FireflyIII\Models\Budget;
use FireflyIII\Models\Category;
+use FireflyIII\Models\Tag;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionType;
@@ -32,36 +34,6 @@ class JournalRepository implements JournalRepositoryInterface
return Auth::user()->transactionjournals()->orderBy('date', 'ASC')->first(['transaction_journals.*']);
}
- /**
- *
- * Get the account_id, which is the asset account that paid for the transaction.
- *
- * @param TransactionJournal $journal
- *
- * @return mixed
- */
- public function getAssetAccount(TransactionJournal $journal)
- {
- $positive = true; // the asset account is in the transaction with the positive amount.
- switch ($journal->transactionType->type) {
- case 'Withdrawal':
- $positive = false;
- break;
- }
- /** @var Transaction $transaction */
- foreach ($journal->transactions()->get() as $transaction) {
- if (floatval($transaction->amount) > 0 && $positive === true) {
- return $transaction->account_id;
- }
- if (floatval($transaction->amount) < 0 && $positive === false) {
- return $transaction->account_id;
- }
-
- }
-
- return $journal->transactions()->first()->account_id;
- }
-
/**
* @param TransactionType $dbType
*
@@ -83,55 +55,26 @@ class JournalRepository implements JournalRepositoryInterface
}
/**
- * @param string $query
- * @param TransactionJournal $journal
*
- * @return Collection
+ * * Remember: a balancingAct takes at most one expense and one transfer.
+ * an advancePayment takes at most one expense, infinite deposits and NO transfers.
+ *
+ * @param TransactionJournal $journal
+ * @param array $array
+ *
+ * @return void
*/
- public function searchRelated($query, TransactionJournal $journal)
+ public function saveTags(TransactionJournal $journal, array $array)
{
- $start = clone $journal->date;
- $end = clone $journal->date;
- $start->startOfMonth();
- $end->endOfMonth();
+ /** @var \FireflyIII\Repositories\Tag\TagRepositoryInterface $tagRepository */
+ $tagRepository = App::make('FireflyIII\Repositories\Tag\TagRepositoryInterface');
- // get already related transactions:
- $exclude = [$journal->id];
- foreach ($journal->transactiongroups()->get() as $group) {
- foreach ($group->transactionjournals()->get() as $current) {
- $exclude[] = $current->id;
+ foreach ($array as $name) {
+ if (strlen(trim($name)) > 0) {
+ $tag = Tag::firstOrCreateEncrypted(['tag' => $name, 'user_id' => $journal->user_id]);
+ $tagRepository->connect($journal, $tag);
}
}
- $exclude = array_unique($exclude);
-
- /** @var Collection $collection */
- $collection = Auth::user()->transactionjournals()
- ->withRelevantData()
- ->before($end)->after($start)->where('encrypted', 0)
- ->whereNotIn('id', $exclude)
- ->where('description', 'LIKE', '%' . $query . '%')
- ->get();
-
- // manually search encrypted entries:
- /** @var Collection $encryptedCollection */
- $encryptedCollection = Auth::user()->transactionjournals()
- ->withRelevantData()
- ->before($end)->after($start)
- ->where('encrypted', 1)
- ->whereNotIn('id', $exclude)
- ->get();
- $encrypted = $encryptedCollection->filter(
- function (TransactionJournal $journal) use ($query) {
- $strPos = strpos(strtolower($journal->description), strtolower($query));
- if ($strPos !== false) {
- return $journal;
- }
-
- return null;
- }
- );
-
- return $collection->merge($encrypted);
}
/**
@@ -191,6 +134,11 @@ class JournalRepository implements JournalRepositoryInterface
$journal->completed = 1;
$journal->save();
+ // store tags
+ if (isset($data['tags']) && is_array($data['tags'])) {
+ $this->saveTags($journal, $data['tags']);
+ }
+
return $journal;
@@ -246,9 +194,54 @@ class JournalRepository implements JournalRepositoryInterface
$journal->save();
+ // update tags:
+ if (isset($data['tags']) && is_array($data['tags'])) {
+ $this->updateTags($journal, $data['tags']);
+ }
+
return $journal;
}
+ /**
+ * @param TransactionJournal $journal
+ * @param array $array
+ *
+ * @return void
+ */
+ public function updateTags(TransactionJournal $journal, array $array)
+ {
+ // create tag repository
+ /** @var \FireflyIII\Repositories\Tag\TagRepositoryInterface $tagRepository */
+ $tagRepository = App::make('FireflyIII\Repositories\Tag\TagRepositoryInterface');
+
+
+ // find or create all tags:
+ $tags = [];
+ $ids = [];
+ foreach ($array as $name) {
+ if (strlen(trim($name)) > 0) {
+ $tag = Tag::firstOrCreateEncrypted(['tag' => $name, 'user_id' => $journal->user_id]);
+ $tags[] = $tag;
+ $ids[] = $tag->id;
+ }
+ }
+
+ // delete all tags connected to journal not in this array:
+ if (count($ids) > 0) {
+ DB::table('tag_transaction_journal')->where('transaction_journal_id', $journal->id)->whereNotIn('tag_id', $ids)->delete();
+ }
+ // if count is zero, delete them all:
+ if(count($ids) == 0) {
+ DB::table('tag_transaction_journal')->where('transaction_journal_id', $journal->id)->delete();
+ }
+
+ // connect each tag to journal (if not yet connected):
+ /** @var Tag $tag */
+ foreach ($tags as $tag) {
+ $tagRepository->connect($journal, $tag);
+ }
+ }
+
/**
* @param TransactionType $type
* @param array $data
diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.php
index 02febb7b96..89e15791fb 100644
--- a/app/Repositories/Journal/JournalRepositoryInterface.php
+++ b/app/Repositories/Journal/JournalRepositoryInterface.php
@@ -21,16 +21,6 @@ interface JournalRepositoryInterface
*/
public function first();
- /**
- *
- * Get the account_id, which is the asset account that paid for the transaction.
- *
- * @param TransactionJournal $journal
- *
- * @return int
- */
- public function getAssetAccount(TransactionJournal $journal);
-
/**
* @param TransactionType $dbType
*
@@ -38,21 +28,28 @@ interface JournalRepositoryInterface
*/
public function getJournalsOfType(TransactionType $dbType);
- /**
- * @param string $query
- * @param TransactionJournal $journal
- *
- * @return Collection
- */
- public function searchRelated($query, TransactionJournal $journal);
-
-
/**
* @param $type
*
* @return TransactionType
*/
public function getTransactionType($type);
+
+ /**
+ * @param TransactionJournal $journal
+ * @param array $array
+ *
+ * @return void
+
+ /**
+ *
+ * @param TransactionJournal $journal
+ * @param array $array
+ *
+ * @return void
+ */
+ public function saveTags(TransactionJournal $journal, array $array);
+
/**
* @param array $data
*
@@ -67,4 +64,12 @@ interface JournalRepositoryInterface
* @return mixed
*/
public function update(TransactionJournal $journal, array $data);
+
+ /**
+ * @param TransactionJournal $journal
+ * @param array $array
+ *
+ * @return mixed
+ */
+ public function updateTags(TransactionJournal $journal, array $array);
}
diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php
index de620494c8..612cfa043e 100644
--- a/app/Repositories/PiggyBank/PiggyBankRepository.php
+++ b/app/Repositories/PiggyBank/PiggyBankRepository.php
@@ -140,12 +140,6 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
/** @var Collection $set */
$set = Auth::user()->piggyBanks()->orderBy('order', 'ASC')->get();
- $set->sortBy(
- function (PiggyBank $piggyBank) {
- return $piggyBank->name;
- }
- );
-
return $set;
}
diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php
new file mode 100644
index 0000000000..301fedb267
--- /dev/null
+++ b/app/Repositories/Tag/TagRepository.php
@@ -0,0 +1,180 @@
+tags()->find($tag->id)) {
+ return false;
+ }
+
+ if ($tag->tagMode == 'nothing') {
+ // save it, no problem:
+ $journal->tags()->save($tag);
+
+ return true;
+ }
+
+ /*
+ * get some withdrawal types:
+ */
+ /** @var TransactionType $withdrawal */
+ $withdrawal = TransactionType::whereType('Withdrawal')->first();
+ /** @var TransactionType $deposit */
+ $deposit = TransactionType::whereType('Deposit')->first();
+ /** @var TransactionType $transfer */
+ $transfer = TransactionType::whereType('Transfer')->first();
+
+ $withdrawals = $tag->transactionjournals()->where('transaction_type_id', $withdrawal->id)->count();
+ $transfers = $tag->transactionjournals()->where('transaction_type_id', $transfer->id)->count();
+
+ if ($tag->tagMode == 'balancingAct') {
+
+ // only if this is the only withdrawal.
+ if ($journal->transaction_type_id == $withdrawal->id && $withdrawals < 1) {
+ $journal->tags()->save($tag);
+
+ return true;
+ }
+ // and only if this is the only transfer
+ if ($journal->transaction_type_id == $transfer->id && $transfers < 1) {
+ $journal->tags()->save($tag);
+
+ return true;
+ }
+
+ // ignore expense
+ return false;
+ }
+ if ($tag->tagMode == 'advancePayment') {
+
+
+ // only if this is the only withdrawal
+ if ($journal->transaction_type_id == $withdrawal->id && $withdrawals < 1) {
+ $journal->tags()->save($tag);
+
+ return true;
+ }
+
+ // only if this is a deposit.
+ if ($journal->transaction_type_id == $deposit->id) {
+
+ // if this is a deposit, account must match the current only journal
+ // (if already present):
+ $currentWithdrawal = $tag->transactionjournals()->where('transaction_type_id', $withdrawal->id)->first();
+
+ if ($currentWithdrawal && $currentWithdrawal->assetAccount->id == $journal->assetAccount->id) {
+ $journal->tags()->save($tag);
+
+ return true;
+ } else {
+ if (is_null($currentWithdrawal)) {
+ $journal->tags()->save($tag);
+
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ return false;
+ }
+
+ /**
+ * @param Tag $tag
+ *
+ * @return boolean
+ */
+ public function destroy(Tag $tag)
+ {
+ $tag->delete();
+
+ return true;
+ }
+
+ /**
+ * @return Collection
+ */
+ public function get()
+ {
+ /** @var Collection $tags */
+ $tags = Auth::user()->tags()->get();
+ $tags->sortBy(
+ function (Tag $tag) {
+ return $tag->tag;
+ }
+ );
+
+ return $tags;
+ }
+
+ /**
+ * @param array $data
+ *
+ * @return Tag
+ */
+ public function store(array $data)
+ {
+ $tag = new Tag;
+ $tag->tag = $data['tag'];
+ $tag->date = $data['date'];
+ $tag->description = $data['description'];
+ $tag->latitude = $data['latitude'];
+ $tag->longitude = $data['longitude'];
+ $tag->zoomLevel = $data['zoomLevel'];
+ $tag->tagMode = $data['tagMode'];
+ $tag->user()->associate(Auth::user());
+ $tag->save();
+
+ return $tag;
+
+
+ }
+
+ /**
+ * @param Tag $tag
+ * @param array $data
+ *
+ * @return Tag
+ */
+ public function update(Tag $tag, array $data)
+ {
+ $tag->tag = $data['tag'];
+ $tag->date = $data['date'];
+ $tag->description = $data['description'];
+ $tag->latitude = $data['latitude'];
+ $tag->longitude = $data['longitude'];
+ $tag->zoomLevel = $data['zoomLevel'];
+ $tag->tagMode = $data['tagMode'];
+ $tag->save();
+
+ return $tag;
+ }
+}
\ No newline at end of file
diff --git a/app/Repositories/Tag/TagRepositoryInterface.php b/app/Repositories/Tag/TagRepositoryInterface.php
new file mode 100644
index 0000000000..4e0d31c102
--- /dev/null
+++ b/app/Repositories/Tag/TagRepositoryInterface.php
@@ -0,0 +1,50 @@
+data)->first();
+ if ($currency) {
- \Cache::forever('FFCURRENCYCODE', $currency->code);
+ Cache::forever('FFCURRENCYCODE', $currency->code);
+ define('FFCURRENCYCODE', $currency->code);
- define('FFCURRENCYCODE', $currency->code);
+ return $currency->code;
+ }
- return $currency->code;
+ return 'EUR';
}
public function getDefaultCurrency()
diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php
index e0d93024c2..a99ee3c23c 100644
--- a/app/Support/ExpandedForm.php
+++ b/app/Support/ExpandedForm.php
@@ -62,7 +62,10 @@ class ExpandedForm
'account_id' => 'Asset account',
'budget_id' => 'Budget',
'openingBalance' => 'Opening balance',
+ 'tagMode' => 'Tag mode',
+ 'tagPosition' => 'Tag location',
'virtualBalance' => 'Virtual balance',
+ 'longitude_latitude' => 'Location',
'targetamount' => 'Target amount',
'accountRole' => 'Account role',
'openingBalanceDate' => 'Opening balance date',
@@ -201,15 +204,17 @@ class ExpandedForm
*
* @return string
*/
- public function month($name, $value = null, array $options = [])
+ public function integer($name, $value = null, array $options = [])
{
- $label = $this->label($name, $options);
- $options = $this->expandOptionArray($name, $label, $options);
- $classes = $this->getHolderClasses($name);
- $value = $this->fillFieldValue($name, $value);
- $html = View::make('form.month', compact('classes', 'name', 'label', 'value', 'options'))->render();
+ $label = $this->label($name, $options);
+ $options = $this->expandOptionArray($name, $label, $options);
+ $classes = $this->getHolderClasses($name);
+ $value = $this->fillFieldValue($name, $value);
+ $options['step'] = '1';
+ $html = View::make('form.integer', compact('classes', 'name', 'label', 'value', 'options'))->render();
return $html;
+
}
/**
@@ -219,14 +224,13 @@ class ExpandedForm
*
* @return string
*/
- public function integer($name, $value = null, array $options = [])
+ public function location($name, $value = null, array $options = [])
{
- $label = $this->label($name, $options);
- $options = $this->expandOptionArray($name, $label, $options);
- $classes = $this->getHolderClasses($name);
- $value = $this->fillFieldValue($name, $value);
- $options['step'] = '1';
- $html = View::make('form.integer', compact('classes', 'name', 'label', 'value', 'options'))->render();
+ $label = $this->label($name, $options);
+ $options = $this->expandOptionArray($name, $label, $options);
+ $classes = $this->getHolderClasses($name);
+ $value = $this->fillFieldValue($name, $value);
+ $html = View::make('form.location', compact('classes', 'name', 'label', 'value', 'options'))->render();
return $html;
@@ -265,6 +269,44 @@ class ExpandedForm
return $selectList;
}
+ /**
+ * @param $name
+ * @param null $value
+ * @param array $options
+ *
+ * @return string
+ */
+ public function month($name, $value = null, array $options = [])
+ {
+ $label = $this->label($name, $options);
+ $options = $this->expandOptionArray($name, $label, $options);
+ $classes = $this->getHolderClasses($name);
+ $value = $this->fillFieldValue($name, $value);
+ $html = View::make('form.month', compact('classes', 'name', 'label', 'value', 'options'))->render();
+
+ return $html;
+ }
+
+ /**
+ * @param $name
+ * @param null $value
+ * @param array $options
+ *
+ * @return string
+ */
+ public function multiRadio($name, array $list = [], $selected = null, array $options = [])
+ {
+ $label = $this->label($name, $options);
+ $options = $this->expandOptionArray($name, $label, $options);
+ $classes = $this->getHolderClasses($name);
+ $selected = $this->fillFieldValue($name, $selected);
+
+ unset($options['class']);
+ $html = View::make('form.multiRadio', compact('classes', 'name', 'label', 'selected', 'options', 'list'))->render();
+
+ return $html;
+ }
+
/**
* @param $type
* @param $name
@@ -336,4 +378,24 @@ class ExpandedForm
return $html;
}
+
+ /**
+ * @param $name
+ * @param null $value
+ * @param array $options
+ *
+ * @return string
+ */
+ public function textarea($name, $value = null, array $options = [])
+ {
+ $label = $this->label($name, $options);
+ $options = $this->expandOptionArray($name, $label, $options);
+ $classes = $this->getHolderClasses($name);
+ $value = $this->fillFieldValue($name, $value);
+ $options['rows'] = 4;
+ $html = View::make('form.textarea', compact('classes', 'name', 'label', 'value', 'options'))->render();
+
+ return $html;
+
+ }
}
diff --git a/app/Support/Twig/Budget.php b/app/Support/Twig/Budget.php
new file mode 100644
index 0000000000..39ec2a1e04
--- /dev/null
+++ b/app/Support/Twig/Budget.php
@@ -0,0 +1,53 @@
+leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
+ ->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
+ ->leftJoin('budget_limits', 'budget_limits.budget_id', '=', 'budget_transaction_journal.budget_id')
+ ->leftJoin('limit_repetitions', 'limit_repetitions.budget_limit_id', '=', 'budget_limits.id')
+ ->where('transaction_journals.date', '>=', $repetition->startdate->format('Y-m-d'))
+ ->where('transaction_journals.date', '<=', $repetition->enddate->format('Y-m-d'))
+ ->where('transaction_journals.user_id', Auth::user()->id)
+ ->whereNull('transactions.deleted_at')
+ ->where('transactions.amount', '>', 0)
+ ->where('limit_repetitions.id', '=', $repetition->id)
+ ->sum('transactions.amount');
+
+ return floatval($sum);
+ }
+ );
+
+ return $functions;
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getName()
+ {
+ return 'FireflyIII\Support\Twig\Budget';
+ }
+}
\ No newline at end of file
diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php
new file mode 100644
index 0000000000..f5faf71981
--- /dev/null
+++ b/app/Support/Twig/General.php
@@ -0,0 +1,146 @@
+format($string);
+ }, ['is_safe' => ['html']]
+ );
+
+ $filters[] = new Twig_SimpleFilter(
+ 'formatTransaction', function (Transaction $transaction) {
+ return App::make('amount')->formatTransaction($transaction);
+ }, ['is_safe' => ['html']]
+ );
+
+ $filters[] = new Twig_SimpleFilter(
+ 'formatAmountPlain', function ($string) {
+ return App::make('amount')->format($string, false);
+ }
+ );
+
+ $filters[] = new Twig_SimpleFilter(
+ 'formatJournal', function ($journal) {
+ return App::make('amount')->formatJournal($journal);
+ }, ['is_safe' => ['html']]
+ );
+
+ $filters[] = new Twig_SimpleFilter(
+ 'balance', function (Account $account = null) {
+ if (is_null($account)) {
+ return 'NULL';
+ }
+
+ return App::make('steam')->balance($account);
+ }
+ );
+
+ // should be a function but OK
+ $filters[] = new Twig_SimpleFilter(
+ 'getAccountRole', function ($name) {
+ return Config::get('firefly.accountRoles.' . $name);
+ }
+ );
+
+ return $filters;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getFunctions()
+ {
+ $functions = [];
+
+ $functions[] = new Twig_SimpleFunction(
+ 'getCurrencyCode', function () {
+ return App::make('amount')->getCurrencyCode();
+ }
+ );
+
+ $functions[] = new Twig_SimpleFunction(
+ 'getCurrencySymbol', function () {
+ return App::make('amount')->getCurrencySymbol();
+ }
+ );
+
+ $functions[] = new Twig_SimpleFunction(
+ 'phpdate', function ($str) {
+ return date($str);
+ }
+ );
+
+
+ $functions[] = new Twig_SimpleFunction(
+ 'env', function ($name, $default) {
+ return env($name, $default);
+ }
+ );
+
+ $functions[] = new Twig_SimpleFunction(
+ 'activeRoute', function ($context) {
+ $args = func_get_args();
+ $route = $args[1];
+ $what = isset($args[2]) ? $args[2] : false;
+ $strict = isset($args[3]) ? $args[3] : false;
+ $activeWhat = isset($context['what']) ? $context['what'] : false;
+
+ // activeRoute
+ if (!($what === false)) {
+ if ($what == $activeWhat && Route::getCurrentRoute()->getName() == $route) {
+ return 'active because-active-what';
+ }
+ } else {
+ if (!$strict && !(strpos(Route::getCurrentRoute()->getName(), $route) === false)) {
+ return 'active because-route-matches-non-strict';
+ } else {
+ if ($strict && Route::getCurrentRoute()->getName() == $route) {
+ return 'active because-route-matches-strict';
+ }
+ }
+ }
+
+ return 'not-xxx-at-all';
+ }, ['needs_context' => true]
+ );
+
+ return $functions;
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getName()
+ {
+ return 'FireflyIII\Support\Twig\General';
+ }
+
+}
\ No newline at end of file
diff --git a/app/Support/Twig/Journal.php b/app/Support/Twig/Journal.php
new file mode 100644
index 0000000000..52dd0d6620
--- /dev/null
+++ b/app/Support/Twig/Journal.php
@@ -0,0 +1,99 @@
+transactionType->type;
+ if ($type == 'Withdrawal') {
+ return '';
+ }
+ if ($type == 'Deposit') {
+ return '';
+ }
+ if ($type == 'Transfer') {
+ return '';
+ }
+ if ($type == 'Opening balance') {
+ return '';
+ }
+
+
+ }, ['is_safe' => ['html']]
+ );
+
+ return $filters;
+ }
+
+ /**
+ * @return array
+ */
+ public function getFunctions()
+ {
+ $functions = [];
+
+ $functions[] = new Twig_SimpleFunction(
+ 'invalidJournal', function (TransactionJournal $journal) {
+ if (!isset($journal->transactions[1]) || !isset($journal->transactions[0])) {
+ return true;
+ }
+
+ return false;
+ }
+ );
+
+ $functions[] = new Twig_SimpleFunction(
+ 'relevantTags', function (TransactionJournal $journal) {
+ if ($journal->tags->count() == 0) {
+ return App::make('amount')->formatJournal($journal);
+ }
+ foreach ($journal->tags as $tag) {
+ if ($tag->tagMode == 'balancingAct') {
+ // return tag formatted for a "balancing act".
+ $amount = App::make('amount')->formatJournal($journal, false);
+
+ return ' ' . $tag->tag . '';
+ }
+ }
+
+
+ return 'TODO: ' . $journal->amount;
+ }
+ );
+
+ return $functions;
+ }
+
+ /**
+ * Returns the name of the extension.
+ *
+ * @return string The extension name
+ */
+ public function getName()
+ {
+ return 'FireflyIII\Support\Twig\Journals';
+ }
+}
\ No newline at end of file
diff --git a/app/Support/Twig/PiggyBank.php b/app/Support/Twig/PiggyBank.php
new file mode 100644
index 0000000000..4d289a4b43
--- /dev/null
+++ b/app/Support/Twig/PiggyBank.php
@@ -0,0 +1,41 @@
+currentRelevantRep()->currentamount;
+ }
+ );
+ return $functions;
+ }
+
+ /**
+ * Returns the name of the extension.
+ *
+ * @return string The extension name
+ */
+ public function getName()
+ {
+ return 'FireflyIII\Support\Twig\PiggyBank';
+ }
+}
\ No newline at end of file
diff --git a/app/User.php b/app/User.php
index 1631995fd7..f649708cfb 100644
--- a/app/User.php
+++ b/app/User.php
@@ -43,6 +43,14 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
return $this->hasMany('FireflyIII\Models\Account');
}
+ /**
+ * @return \Illuminate\Database\Eloquent\Relations\HasMany
+ */
+ public function tags()
+ {
+ return $this->hasMany('FireflyIII\Models\Tag');
+ }
+
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php
index 3dec04fa7e..b8cf753024 100644
--- a/app/Validation/FireflyValidator.php
+++ b/app/Validation/FireflyValidator.php
@@ -13,6 +13,7 @@ use Illuminate\Contracts\Encryption\DecryptException;
use Illuminate\Validation\Validator;
use Log;
use Navigation;
+use Symfony\Component\Translation\TranslatorInterface;
/**
* Class FireflyValidator
@@ -22,6 +23,18 @@ use Navigation;
class FireflyValidator extends Validator
{
+ /**
+ * @param TranslatorInterface $translator
+ * @param array $data
+ * @param array $rules
+ * @param array $messages
+ * @param array $customAttributes
+ */
+ public function __construct(TranslatorInterface $translator, array $data, array $rules, array $messages = [], array $customAttributes = [])
+ {
+ parent::__construct($translator, $data, $rules, $messages);
+ }
+
/**
* @param $attribute
* @param $value
@@ -181,10 +194,14 @@ class FireflyValidator extends Validator
*/
public function validateUniqueObjectForUser($attribute, $value, $parameters)
{
- $table = $parameters[0];
- $field = $parameters[1];
- $encrypted = isset($parameters[2]) ? $parameters[2] : 'encrypted';
- $exclude = isset($parameters[3]) ? $parameters[3] : null;
+ $table = $parameters[0];
+ $field = $parameters[1];
+ $encrypted = isset($parameters[2]) ? $parameters[2] : 'encrypted';
+ $exclude = isset($parameters[3]) ? $parameters[3] : null;
+ $alwaysEncrypted = false;
+ if ($encrypted == 'TRUE') {
+ $alwaysEncrypted = true;
+ }
$query = DB::table($table)->where('user_id', Auth::user()->id);
@@ -195,8 +212,12 @@ class FireflyValidator extends Validator
$set = $query->get();
foreach ($set as $entry) {
- $isEncrypted = intval($entry->$encrypted) == 1 ? true : false;
- $checkValue = $isEncrypted ? Crypt::decrypt($entry->$field) : $entry->$field;
+ if (!$alwaysEncrypted) {
+ $isEncrypted = intval($entry->$encrypted) == 1 ? true : false;
+ } else {
+ $isEncrypted = true;
+ }
+ $checkValue = $isEncrypted ? Crypt::decrypt($entry->$field) : $entry->$field;
if ($checkValue == $value) {
return false;
}
diff --git a/bootstrap/app.php b/bootstrap/app.php
index e3ec5b5519..5b299a9c83 100644
--- a/bootstrap/app.php
+++ b/bootstrap/app.php
@@ -11,6 +11,7 @@
|
*/
+
$app = new Illuminate\Foundation\Application(
realpath(__DIR__ . '/../')
);
@@ -26,6 +27,8 @@ $app = new Illuminate\Foundation\Application(
|
*/
+
+
$app->singleton(
'Illuminate\Contracts\Http\Kernel',
'FireflyIII\Http\Kernel'
@@ -41,6 +44,9 @@ $app->singleton(
'FireflyIII\Exceptions\Handler'
);
+
+
+
/*
|--------------------------------------------------------------------------
| Return The Application
diff --git a/composer.json b/composer.json
index c9459d4f3f..5bbf617f3b 100644
--- a/composer.json
+++ b/composer.json
@@ -26,7 +26,9 @@
"watson/validating": "~1.0",
"doctrine/dbal": "~2.5",
"illuminate/html": "~5.0",
- "league/commonmark": "0.7.*"
+ "league/commonmark": "0.7.*",
+ "rcrowe/twigbridge": "0.7.x@dev",
+ "twig/extensions": "~1.2"
},
"require-dev": {
"barryvdh/laravel-debugbar": "@stable",
diff --git a/composer.lock b/composer.lock
index f1bab601ca..bce1a9507c 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "0d43c4c85607c5cdc901cde2d18b75d5",
+ "hash": "e3e90dd365b74f4878cf3b5b4a1c4007",
"packages": [
{
"name": "classpreloader/classpreloader",
@@ -943,16 +943,16 @@
},
{
"name": "laravel/framework",
- "version": "v5.0.27",
+ "version": "v5.0.28",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "4d6330118a295086ce9ff8eed2200d5b67f17688"
+ "reference": "06a09429322cf53e5bd4587db1060f02a291562e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/4d6330118a295086ce9ff8eed2200d5b67f17688",
- "reference": "4d6330118a295086ce9ff8eed2200d5b67f17688",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/06a09429322cf53e5bd4587db1060f02a291562e",
+ "reference": "06a09429322cf53e5bd4587db1060f02a291562e",
"shasum": ""
},
"require": {
@@ -1022,7 +1022,7 @@
"predis/predis": "~1.0"
},
"suggest": {
- "aws/aws-sdk-php": "Required to use the SQS queue driver (~2.4).",
+ "aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (~2.4).",
"doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.4).",
"guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers (~5.0).",
"iron-io/iron_mq": "Required to use the iron queue driver (~1.5).",
@@ -1065,7 +1065,7 @@
"framework",
"laravel"
],
- "time": "2015-04-04 01:34:57"
+ "time": "2015-04-21 01:44:32"
},
{
"name": "league/commonmark",
@@ -1527,6 +1527,70 @@
],
"time": "2015-03-26 18:43:54"
},
+ {
+ "name": "rcrowe/twigbridge",
+ "version": "0.7.x-dev",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/rcrowe/TwigBridge.git",
+ "reference": "ac0bfb5bcdb4fcd0cd01ab8425620ff07f6af026"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/rcrowe/TwigBridge/zipball/ac0bfb5bcdb4fcd0cd01ab8425620ff07f6af026",
+ "reference": "ac0bfb5bcdb4fcd0cd01ab8425620ff07f6af026",
+ "shasum": ""
+ },
+ "require": {
+ "illuminate/support": "5.0.*",
+ "illuminate/view": "5.0.*",
+ "php": ">=5.4.0",
+ "twig/twig": "~1.15"
+ },
+ "require-dev": {
+ "laravel/framework": "5.0.*",
+ "mockery/mockery": "0.9.*",
+ "phpunit/phpunit": "~4.0",
+ "satooshi/php-coveralls": "~0.6",
+ "squizlabs/php_codesniffer": "~1.5"
+ },
+ "suggest": {
+ "laravelcollective/html": "For bringing back html/form in Laravel 5.x",
+ "twig/extensions": "~1.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "0.7-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "TwigBridge\\": "src",
+ "TwigBridge\\Tests\\": "tests"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Barry vd. Heuvel",
+ "email": "barryvdh@gmail.com"
+ },
+ {
+ "name": "Rob Crowe",
+ "email": "hello@vivalacrowe.com"
+ }
+ ],
+ "description": "Adds the power of Twig to Laravel",
+ "keywords": [
+ "laravel",
+ "twig"
+ ],
+ "time": "2015-04-22 09:19:03"
+ },
{
"name": "swiftmailer/swiftmailer",
"version": "v5.4.0",
@@ -2291,6 +2355,115 @@
],
"time": "2015-03-31 08:12:29"
},
+ {
+ "name": "twig/extensions",
+ "version": "v1.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/twigphp/Twig-extensions.git",
+ "reference": "8cf4b9fe04077bd54fc73f4fde83347040c3b8cd"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/8cf4b9fe04077bd54fc73f4fde83347040c3b8cd",
+ "reference": "8cf4b9fe04077bd54fc73f4fde83347040c3b8cd",
+ "shasum": ""
+ },
+ "require": {
+ "twig/twig": "~1.12"
+ },
+ "require-dev": {
+ "symfony/translation": "~2.3"
+ },
+ "suggest": {
+ "symfony/translation": "Allow the time_diff output to be translated"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Twig_Extensions_": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "Common additional features for Twig that do not directly belong in core",
+ "homepage": "http://twig.sensiolabs.org/doc/extensions/index.html",
+ "keywords": [
+ "i18n",
+ "text"
+ ],
+ "time": "2014-10-30 14:30:03"
+ },
+ {
+ "name": "twig/twig",
+ "version": "v1.18.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/twigphp/Twig.git",
+ "reference": "9f70492f44398e276d1b81c1b43adfe6751c7b7f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/twigphp/Twig/zipball/9f70492f44398e276d1b81c1b43adfe6751c7b7f",
+ "reference": "9f70492f44398e276d1b81c1b43adfe6751c7b7f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.2.7"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.18-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Twig_": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
+ },
+ {
+ "name": "Armin Ronacher",
+ "email": "armin.ronacher@active-4.com",
+ "role": "Project Founder"
+ },
+ {
+ "name": "Twig Team",
+ "homepage": "http://twig.sensiolabs.org/contributors",
+ "role": "Contributors"
+ }
+ ],
+ "description": "Twig, the flexible, fast, and secure template language for PHP",
+ "homepage": "http://twig.sensiolabs.org",
+ "keywords": [
+ "templating"
+ ],
+ "time": "2015-04-19 08:30:27"
+ },
{
"name": "vlucas/phpdotenv",
"version": "v1.1.0",
@@ -3103,16 +3276,16 @@
},
{
"name": "phpspec/prophecy",
- "version": "1.4.0",
+ "version": "v1.4.1",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
- "reference": "8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5"
+ "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5",
- "reference": "8724cd239f8ef4c046f55a3b18b4d91cc7f3e4c5",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373",
+ "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373",
"shasum": ""
},
"require": {
@@ -3159,7 +3332,7 @@
"spy",
"stub"
],
- "time": "2015-03-27 19:31:25"
+ "time": "2015-04-27 22:15:08"
},
{
"name": "phpunit/php-code-coverage",
@@ -4179,6 +4352,7 @@
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
+ "rcrowe/twigbridge": 20,
"barryvdh/laravel-debugbar": 0
},
"prefer-stable": false,
diff --git a/config/app.php b/config/app.php
index fe7ad89606..f0b8a7a614 100644
--- a/config/app.php
+++ b/config/app.php
@@ -136,7 +136,11 @@ return [
'Illuminate\Validation\ValidationServiceProvider',
'Illuminate\View\ViewServiceProvider',
'Illuminate\Html\HtmlServiceProvider',
+ 'TwigBridge\ServiceProvider',
+
'DaveJamesMiller\Breadcrumbs\ServiceProvider',
+ 'Barryvdh\Debugbar\ServiceProvider',
+ 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider',
/*
* Application Service Providers...
@@ -149,6 +153,7 @@ return [
'FireflyIII\Providers\FireflyServiceProvider',
'FireflyIII\Providers\TestingServiceProvider',
+
],
/*
@@ -198,13 +203,14 @@ return [
'View' => 'Illuminate\Support\Facades\View',
'Form' => 'Illuminate\Html\FormFacade',
'Html' => 'Illuminate\Html\HtmlFacade',
- 'Breadcrumbs' => 'DaveJamesMiller\Breadcrumbs\Facade',
-
+ 'Breadcrumbs' => 'DaveJamesMiller\Breadcrumbs\Facade',
'Preferences' => 'FireflyIII\Support\Facades\Preferences',
'Navigation' => 'FireflyIII\Support\Facades\Navigation',
'Amount' => 'FireflyIII\Support\Facades\Amount',
'Steam' => 'FireflyIII\Support\Facades\Steam',
'ExpandedForm' => 'FireflyIII\Support\Facades\ExpandedForm',
+ 'Twig' => 'TwigBridge\Facade\Twig',
+
],
diff --git a/config/view.php b/config/view.php
index 88fc534aeb..6e1a698a10 100644
--- a/config/view.php
+++ b/config/view.php
@@ -14,7 +14,7 @@ return [
*/
'paths' => [
- realpath(base_path('resources/views'))
+ realpath(base_path('resources/twig'))
],
/*
diff --git a/database/migrations/2015_04_26_054507_changes_for_v3310.php b/database/migrations/2015_04_26_054507_changes_for_v3310.php
new file mode 100644
index 0000000000..2c338242a1
--- /dev/null
+++ b/database/migrations/2015_04_26_054507_changes_for_v3310.php
@@ -0,0 +1,75 @@
+dropColumn('relation');
+ }
+ );
+
+ /*
+ * New table!
+ */
+ Schema::create(
+ 'tags', function (Blueprint $table) {
+ $table->increments('id');
+ $table->timestamps();
+ $table->softDeletes();
+ $table->integer('user_id')->unsigned();
+ $table->string('tag', 1024);
+ $table->string('tagMode', 1024);
+ $table->date('date')->nullable();
+ $table->text('description')->nullable();
+ $table->decimal('latitude', 18, 12)->nullable();
+ $table->decimal('longitude', 18, 12)->nullable();
+ $table->smallInteger('zoomLevel', false, true)->nullable();
+
+ // connect reminders to users
+ $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
+ }
+ );
+
+
+ Schema::create('tag_transaction_journal',function (Blueprint $table) {
+ $table->increments('id');
+ $table->integer('tag_id')->unsigned();
+ $table->integer('transaction_journal_id')->unsigned();
+
+ // link to foreign tables.
+ $table->foreign('tag_id', 'tag_grp_id')->references('id')->on('tags')->onDelete('cascade');
+ $table->foreign('transaction_journal_id', 'tag_trj_id')->references('id')->on('transaction_journals')->onDelete('cascade');
+
+ // add unique.
+ $table->unique(['tag_id', 'transaction_journal_id'], 'tag_t_joined');
+
+ });
+ }
+
+}
diff --git a/database/migrations/2015_04_28_075215_changes_for_v3310a.php b/database/migrations/2015_04_28_075215_changes_for_v3310a.php
new file mode 100644
index 0000000000..9c0c1df3d6
--- /dev/null
+++ b/database/migrations/2015_04_28_075215_changes_for_v3310a.php
@@ -0,0 +1,40 @@
+string('relation', 50)->nullable();
+ }
+ );
+ // make new column "relation"
+
+ }
+
+}
diff --git a/database/migrations/2015_04_28_075317_changes_for_v3310b.php b/database/migrations/2015_04_28_075317_changes_for_v3310b.php
new file mode 100644
index 0000000000..5ea3fcfb13
--- /dev/null
+++ b/database/migrations/2015_04_28_075317_changes_for_v3310b.php
@@ -0,0 +1,32 @@
+update(['relation' => 'balance']);
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ //
+ }
+
+}
diff --git a/phpunit.xml b/phpunit.xml
index 677b0226c7..bf13ff1240 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -7,7 +7,7 @@
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
- stopOnFailure="false"
+ stopOnFailure="true"
syntaxCheck="false">
+ Are you sure that you want to delete the {{account.accountType.type|lower}} "{{account.name}}"? +
+ + {% if account.transactions|length > 0 %} ++ {{account.accountType.type|capitalize}} "{{ account.name }}" still has {{ account.transactions|length }} transaction(s) associated to it. These will be deleted as well. +
+ {% endif %} + {% if account.piggyBanks|length > 0 %} ++ {{account.accountType.type|capitalize}} "{{ account.name }}" still has {{ account.piggyBanks|length }} piggy bank(s) associated to it. These will be deleted as well. +
+ {% endif %} ++ + Cancel +
++ +
+Registering an account on Firefly requires an e-mail address.
- @if (count($errors) > 0) + {% if errors|length > 0 %}- -
++ +
++ Are you sure that you want to delete bill "{{ bill.name }}"? +
+ + {% if bill.transactionjournals|length > 0 %} ++ Bill "{{ bill.name }}" still has {{ bill.transactionjournals|length }} transactions connected + to it. These will not be removed but will lose their connection to this bill. +
+ {% endif %} + ++ + Cancel +
+- -
++ +
+- -
-+ +
+- Are you sure that you want to delete budget "{{{$budget->name}}}"? + Are you sure that you want to delete budget "{{ budget.name }}"?
- @if($budget->transactionjournals()->count() > 0) + {% if budget.transactionjournals|length > 0 %}- Budget "{{{$budget->name}}}" still has {{$budget->transactionjournals()->count()}} transactions connected + Budget "{{ budget.name }}" still has {{ budget.transactionjournals|length }} transactions connected to it. These will not be removed but will lose their connection to this budget.
- @endif + {% endif %}Use budgets to organize and limit your expenses.
- -
++ +
+- Are you sure that you want to delete category "{{$category->name}}"? + Are you sure that you want to delete category "{{ category.name }}"?
- @if($category->transactionjournals()->count() > 0) + {% if category.transactionjournals|length > 0 %}- Category "{{{$category->name}}}" still has {{$category->transactionjournals()->count()}} transactions connected + Category "{{ category.name }}" still has {{ category.transactionjournals|length }} transactions connected to it. These will not be removed but will lose their connection to this category.
- @endif + {% endif %}- -
++ +
+- -
++ +
++ +
+Currency | |||
---|---|---|---|
- | -{{{$currency->name}}} ({{{$currency->code}}}) ({{{$currency->symbol}}}) | +{{ currency.name }} ({{ currency.code }}) ({{ currency.symbol|raw }}) | - @if($currency->id == $defaultCurrency->id) + {% if currency.id == defaultCurrency.id %} default - @else - make default - @endif + {% else %} + make default + {% endif %} |
{{ errors.first(name) }}
+{% endif %} diff --git a/resources/twig/form/help.twig b/resources/twig/form/help.twig new file mode 100644 index 0000000000..e1e2d011ea --- /dev/null +++ b/resources/twig/form/help.twig @@ -0,0 +1,3 @@ +{% if options.helpText %} +{{ options.helpText }}
+{% endif %} diff --git a/resources/twig/form/integer.twig b/resources/twig/form/integer.twig new file mode 100644 index 0000000000..527a5b2fea --- /dev/null +++ b/resources/twig/form/integer.twig @@ -0,0 +1,9 @@ +Right-click to set the tag's location. + Clear location +
+ + + + + {% include 'form/feedback.twig' %} +Welcome to Firefly III.
@@ -15,13 +16,10 @@ - @else - - - @include('partials.boxes') - - +{% else %} + + {% include 'partials/boxes.twig' %}Mark your asset accounts as "Savings account" to fill this panel.
- @else - @foreach($savings as $account) + {% else %} + {% for account in savings %}Create piggy banks to fill this panel.
- @else - @foreach($piggyBankAccounts as $account) + {% else %} + {% for account in piggyBankAccounts %}+ | Name | + {% if what == 'asset' %} +Role | + {% endif %} +Current balance | +Active | +Last activity | +Balance difference between {{ Session.get('start').format('jS F Y') }} and {{ Session.get('end').format('jS F Y') }} | +|
---|---|---|---|---|---|---|---|
+ + | +{{ account.name }} | + {% if what == "asset" %} ++ {% for entry in account.accountmeta %} + {% if entry.name == 'accountRole' %} + {{ entry.data|getAccountRole }} + {% endif %} + {% endfor %} + | + {% endif %} +{{ account|balance|formatAmount }} | ++ {% if account.active %} + + {% else %} + + {% endif %} + | + {% if account.lastActivityDate %} ++ {{ account.lastActivityDate.format('j F Y') }} + | + {% else %} ++ Never + | + {% endif %} ++ {{ (account.endBalance - account.startBalance)|formatAmount }} + | + +
+ | Name | +Matches on | +Matching amount | +Last seen match | +Next expected match | +Is active | +Will be automatched | +Repeats every | ++ | |
---|---|---|---|---|---|---|---|---|---|---|
+ + | ++ {{ entry.name }} + | ++ {% for match in entry.match|split(',') %} + {{ match }} + {% endfor %} + | ++ {{ entry.amount_min|formatAmount }} + | ++ {{ entry.amount_max|formatAmount }} + | ++ {% if entry.lastFoundMatch %} + {{entry.lastFoundMatch.format('j F Y')}} + {% else %} + Unknown + {% endif %} + | ++ {% if entry.nextExpectedMatch%} + {{entry.nextExpectedMatch.format('j F Y')}} + {% else %} + Unknown + {% endif %} + | ++ {% if entry.active %} + + {% else %} + + {% endif %} + | ++ {% if entry.automatch %} + + {% else %} + + {% endif %} + | ++ {{ entry.repeat_freq }} + {% if entry.skip > 0 %} + skips over {{entry.skip}} + {% endif %} + | ++ {% if entry.active %} + + {% endif %} + | +
+ | Name | +Last activity | +|
---|---|---|---|
+ | Without a category | ++ | |
+ + | ++ {{ category.name }} + | + {% if category.lastActivity %} ++ {{category.lastActivity.format('jS F Y') }} + | + {% else %} ++ Never + | + {% endif %} +
+ | Description | +Amount | +Date | +From | +To | + + {% if not hideBudgets %} ++ {% endif %} + + + {% if not hideCategories %} + | + {% endif %} + + + {% if not hideBills %} + | + {% endif %} + | |
---|---|---|---|---|---|---|---|---|---|
+ + | ++ | {{ journal.description }} | +Invalid journal: Found {{journal.transactions|length }} transaction(s) | +||||||
+ + | + ++ {{ journal|typeIcon }} + | ++ {{journal.description}} + | ++ {% if not hideTags %} + {{ relevantTags(journal)|raw }} + {% else %} + {{ journal|formatJournal }} + {% endif %} + | ++ {{journal.date.format('j F Y')}} + | ++ {% if journal.transactions[0].account.accountType.type == 'Cash account' %} + (cash) + {% else %} + {{journal.transactions[0].account.name}} + {% endif %} + | ++ {% if journal.transactions[1].account.accountType.type == 'Cash account' %} + (cash) + {% else %} + {{journal.transactions[1].account.name}} + {% endif %} + | + + + {% if not hideBudgets %} ++ {% if journal.budgets[0] %} + {{journal.budgets[0].name}} + {% endif %} + | + {% endif %} + + + {% if not hideCategories %} ++ {% if journal.categories[0] %} + {{journal.categories[0].name}} + {% endif %} + | + {% endif %} + + + {% if not hideBills %} ++ {% if journal.bill %} + {{journal.bill.name}} + {% endif %} + | + {% endif %} +
Piggy bank | + {% endif %} +Date | +Amount | +
---|---|---|
+ {{ event.piggyBank.name }} + | + {% endif %} ++ {% if event.transaction_journal_id %} + {{ event.date.format('j F Y') }} + {% else %} + {{ event.date.format('j F Y') }} + {% endif %} + | + ++ {% if event.amount < 0 %} + Removed {{ event.amount*-1|formatAmountPlain }} + {% else %} + Added {{ event.amount|formatAmountPlain }} + {% endif %} + | +
+ + + | ++ + | ++ {{ piggyBank.name }} + | ++ {{piggyBank.savedSoFar|formatAmountPlain }} + | ++ {% if piggyBank.savedSoFar > 0 %} + + {% endif %} + | + +
+
+
+
+ |
+
+
+ + {% if piggyBank.leftToSave > 0 %} + + {% endif %} + | ++ {{ piggyBank.targetamount|formatAmount }} + {% if piggyBank.leftToSave > 0 %} + ({{ piggyBank.leftToSave|formatAmount }}) + {% endif %} + | +
+ This reminder is active between {{reminder.startdate.format('jS F Y')}} + and {{reminder.enddate.format('jS F Y')}}. +
+ {% if reminder.description %} +{{ reminder.description|raw }}
+ {% endif %} ++ (No reminders) +
++ +
++ Are you sure? +
+ ++ + Cancel +
+- -
++ +
+Account | +Balance | +Left for piggy banks | +Sum of piggy banks | +Saved so far | +Left to save | +
---|---|---|---|---|---|
{{ info.name }} | +{{ info.balance|formatAmount }} | +{{ info.leftForPiggyBanks|formatAmount }} | +{{ info.sumOfTargets|formatAmount }} | +{{ info.sumOfSaved|formatAmount }} | +{{ info.leftToSave|formatAmount }} | +
Account | -{{{$piggyBank->account->name}}} | +{{ piggyBank.account.name }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Target amount | -{!! Amount::format($piggyBank->targetamount) !!} | +{{ piggyBank.targetAmount|formatAmount }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Saved so far | -{!! Amount::format($piggyBank->currentRelevantRep()->currentamount) !!} | +{{ currentRelevantRepAmount(piggyBank)|formatAmount }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Left to save | -{!! Amount::format($piggyBank->targetamount-$piggyBank->currentRelevantRep()->currentamount) !!} | +{{ piggyBank.targetamount - currentRelevantRepAmount(piggyBank)|formatAmount }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Start date | - @if(is_null($piggyBank->startdate)) + {% if piggyBank.startdate %} + {{ piggyBank.startdate.format('jS F Y')}} + {% else %} No start date - @endif - @if(is_object($piggyBank->startdate)) - {{$piggyBank->startdate->format('jS F Y')}} - @endif + {% endif %} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Target date | - @if(is_null($piggyBank->targetdate)) - No target date - @endif - @if(is_object($piggyBank->targetdate)) - {{$piggyBank->targetdate->format('jS F Y')}} - @endif + {% if piggyBank.targetdate %} + {{ piggyBank.targetdate.format('jS F Y') }} + {% else %} + No start date + {% endif %} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reminder | - @if(intval($piggyBank->remind_me) == 0) + {% if piggyBank.remind_me == 0 %} (no reminder) - @else + {% else %} Every - @if($piggyBank->reminder_skip != 0) - {{$piggyBank->reminder_skip}} - @endif - {{$piggyBank->reminder}}(s) - @endif + {% if piggyBank.reminder_skip != 0 %} + {{ piggyBank.reminder_skip }} + {% else %} + {{ piggyBank.reminder }}(s) + {% endif %} + {% endif %} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reminders left | (in progress...) | @@ -101,17 +100,16 @@
Account | +Start of month | +Current balance | +Spent | +Earned | +
---|---|---|---|---|
{{ account.name }} | +{{ account.startBalance|formatAmount }} | +{{ account.endBalance|formatAmount }} | ++ {% if account.startBalance - account.endBalance > 0 %} + {{ (account.startBalance - account.endBalance)|formatAmountPlain }} + {% endif %} + | ++ {% if account.startBalance - account.endBalance < 0 %} + {{ ((account.startBalance - account.endBalance)*-1)|formatAmountPlain }} + {% endif %} + | +
Budgets | + {% for account in accounts %} + {% if not account.hide %} +{{ account.name }} | + {% endif %} + {% endfor %} ++ Left in budget + | +|||
---|---|---|---|---|---|
{{ budget.name }} | +{{ budget.queryAmount|formatAmount }} | + {% set spent = 0 %} + {% for account in accounts %} + {% if not account.hide %} + {% if account.budgetInformation[id] %} ++ {% if id == 0 %} + + {{ account.budgetInformation[id].queryAmount|formatAmount }} + + {% else %} + {{ account.budgetInformation[id].queryAmount|formatAmount }} + {% endif %} + | + {% set spent = spent + account.budgetInformation[id].queryAmount %} + {% else %} +{{ 0|formatAmount }} | + {% endif %} + {% endif %} + {% endfor %} +{{ (budget.queryAmount + budget.spent)|formatAmount }} | +{{ (budget.queryAmount + spent)|formatAmount }} | +
Balanced by transfers | + {% for account in accounts %} + {% if not account.hide %} ++ {{ account.balancedAmount|formatAmount }} + | + {% endif %} + {% endfor %} ++ | |||
Left unbalanced | + {% for account in accounts %} + + {% if not account.hide %} + {% if account.budgetInformation[0] %} ++ {% if account.budgetInformation[0].queryAmount + account.balancedAmount != 0.0 %} + {{ (account.budgetInformation[0].queryAmount + account.balancedAmount)|formatAmount }} + {% else %} + {{ (account.budgetInformation[0].queryAmount + account.balancedAmount)|formatAmount }} + {% endif %} + | + {% else %} +{{ 0|formatAmount }} | + {% endif %} + {% endif %} + {% endfor %} ++ | ||
Sum | + {% for account in accounts %} + {% if not account.hide %} +{{ accountAmounts[account.id]|formatAmount }} | + {% endif %} + {% endfor %} ++ | |||
Expected balance | + {% for account in accounts %} + {% if not account.hide %} +{{ (account.startBalance + accountAmounts[account.id])|formatAmount }} | + {% endif %} + {% endfor %} ++ |
@@ -19,9 +19,9 @@
+
+ ++ {{ entry.description }} + | ++ {% if entry.type == 'Withdrawal' %} + {{entry.queryAmount|formatAmountPlain}} + {% endif %} + {% if entry.type == 'Deposit' %} + {{entry.queryAmount|formatAmountPlain}} + {% endif %} + {% if entry.type == 'Transfer' %} + {{entry.queryAmount|formatAmountPlain}} + {% endif %} + | ++ {{entry.date.format('j F Y')}} + | ++ {{ entry.name }} + | +
Sum | +{{ sum|formatAmount }} | +
{{ expense.name }} | + {% else %} +{{ expense.name }} | + {% endif %} +{{ expense.queryAmount|formatAmountPlain }} | +
Sum | +{{ sum|formatAmountPlain }} | +
In | +{{ totalIn|formatAmount }} | +
Out | +{{ sum|formatAmountPlain }} | +
Difference | +{{ (totalIn - sum)|formatAmount }} | +
Budget | +Envelope | +Spent | +Left | +
---|---|---|---|
+ {% if id > 0 %} + {{ budget.name }} + {% else %} + {{ budget.name }} + {% endif %} + | +{{ budget.queryAmount|formatAmount }} | +{{ (budget.spent*-1)|formatAmountPlain }} | +{{ (budget.queryAmount + budget.spent)|formatAmount }} | +
Sum | +{{ sumEnvelope|formatAmount }} | +{{ sumSpent|formatAmount }} | +{{ sumLeft|formatAmount }} | +
Category | +Spent | +
---|---|
+ {% if id > 0 %} + {{ category.name }} + {% else %} + {{ category.name }} + {% endif %} + | +{{ (category.queryAmount * -1)|formatAmountPlain }} | +
Sum | +{{ (sum * -1)|formatAmountPlain }} | +
{{ account.name }} | +{{ account.startBalance|formatAmount }} | +{{ account.endBalance|formatAmount }} | +{{ account.difference|formatAmount }} | +
Sum | +{{ sumStart|formatAmount }} | +{{ sumEnd|formatAmount }} | +{{ sumDiff|formatAmount }} | +
@@ -49,36 +49,32 @@
In | -{!! Amount::format($incomeSum) !!} | +{{ incomeSum|formatAmount }} |
Out | -{!! Amount::format($expenseSum*-1) !!} | +{{ (expenseSum*-1)|formatAmount }} |
Difference | -{!! Amount::format($incomeSum - $expenseSum) !!} | +{{ (incomeSum - expenseSum)|formatAmount }} |
{{{$income->name}}} | -{!! Amount::format(floatval($income->queryAmount)*-1) !!} | -|
{{ income.name }} | +{{ (income.queryAmount * -1)|formatAmount }} | +|
Sum | -{!! Amount::format($sum) !!} | +{{ sum|formatAmount }} |
{{{$expense['name']}}} | -{!! Amount::format(floatval($expense['queryAmount'])*-1) !!} | +{{ expense.name }} | +{{ (expense.queryAmount*-1)|formatAmount }} |
Sum | -{!! Amount::format($sum) !!} | +{{ sum|formatAmount }} |
Bla bla
++ +
++ Are you sure that you want to delete tag "{{ tag.tag }}"? +
+ + {% if tag.transactionjournals|length > 0 %} ++ Tag "{{ tag.tag }}" still has {{ tag.transactionjournals|length }} transaction(s) connected + to it. These will not be removed but will lose their connection to this tag. +
+ {% endif %} + ++ + Cancel +
++ +
++ Usually tags are singular words, designed to quickly band items together + using things like expensive, + bill or + for-party. In Firefly III, tags can have more properties + such as a date, description and location. This allows you to join transactions together in a more meaningful + way. For example, you could make a tag called Christmas dinner with friends + and add information about the restaurant. Such tags are "singular", you would only use them for a single occasion, + perhaps with multiple transactions. +
++ Tags group transactions together, which makes it possible to store reimbursements + (in case you front money for others) and other "balancing acts" where expenses + are summed up (the payments on your new TV) or where expenses and deposits + are cancelling each other out (buying something with saved money). It's all up to you. + Using tags the old-fashioned way is of course always possible. +
++ Create a tag to get started or enter tags when creating new transactions. +
++ + {% if not helpHidden %} + Hide help + {% else %} + Show help + {% endif %} + +
++ Create new tag +
++ {% if tags|length == 0 %} + No tags + {% else %} + {% for tag in tags %} + +
+ {{tag.description}} +
+ {% endif %} + {% if tag.latitude and tag.longitude and tag.zoomLevel %} +
+
+
+ +
+@@ -23,21 +23,21 @@
+ +
+Date | +{{ journal.date.format('jS F Y') }} | +
Type | +{{ journal.transactiontype.type }} | +
Completed | ++ {% if journal.completed %} + Yes + {% else %} + No + {% endif %} + | +
Budget | +{{ budget.name }} | +
Category | +{{ category.name }} | +
Tags | +
+ {% for tag in journal.tags %}
+
+ + {% if tag.tagMode == 'nothing' %} + + {% endif %} + {% if tag.tagMode == 'balancingAct' %} + + {% endif %} + {% if tag.tagMode == 'advancePayment' %} + + {% endif %} + {{tag.tag}} ++ {% endfor %} + |
+
Amount | +{{ t|formatTransaction }} | +
New balance | +{{ t.before|formatAmount }} → {{ t.after|formatAmount }} | +
Description | +{{ t.description }} | +
{{ $error }}
-@endforeach - -- -
-- Are you sure that you want to delete the {{strtolower($account->accountType->type)}} "{{$account->name}}"? -
- - @if($account->transactions()->count() > 0) -- {{ucfirst($account->accountType->type)}} "{{{$account->name}}}" still has {{$account->transactions()->count()}} transaction(s) associated to it. These will be deleted as well. -
- @endif - @if($account->piggyBanks()->count() > 0) -- {{ucfirst($account->accountType->type)}} "{{{$account->name}}}" still has {{$account->piggyBanks()->count()}} piggy bank(s) associated to it. These will be deleted as well. -
- @endif -- - Cancel -
-- -
-- Are you sure that you want to delete bill "{{{$bill->name}}}"? -
- - @if($bill->transactionjournals()->count() > 0) -- Bill "{{{$bill->name}}}" still has {{$bill->transactionjournals()->count()}} transactions connected - to it. These will not be removed but will lose their connection to this bill. -
- @endif - -- - Cancel -
-- @if($budget->currentRep) - - @else - - @endif -
- -- - - @if($budget->currentRep) - - Budgeted: - - - @if($budget->currentRep->amount > $budget->spent) - {{Amount::getCurrencySymbol()}} - @else - {{Amount::getCurrencySymbol()}} - @endif - - @else - No budget - - - @endif - - -
-- Spent: {!! Amount::format($budget->spent) !!} -
-- -
-{{{$errors->first($name)}}}
-@endif diff --git a/resources/views/form/help.blade.php b/resources/views/form/help.blade.php deleted file mode 100644 index 9b6375c241..0000000000 --- a/resources/views/form/help.blade.php +++ /dev/null @@ -1,3 +0,0 @@ -@if(isset($options['helpText'])) -{{$options['helpText']}}
-@endif diff --git a/resources/views/form/integer.blade.php b/resources/views/form/integer.blade.php deleted file mode 100644 index 9b84d9626f..0000000000 --- a/resources/views/form/integer.blade.php +++ /dev/null @@ -1,9 +0,0 @@ -- | Name | - @if(isset($what) && $what == 'asset') -Role | - @endif -Current balance | -Active | -Last activity | -Balance difference between {{Session::get('start')->format('jS F Y')}} and {{Session::get('end')->format('jS F Y')}} | -|
---|---|---|---|---|---|---|---|
- - | -{{{$account->name}}} | - @if(isset($what) && $what == 'asset') -- @foreach($account->accountmeta as $entry) - @if($entry->name == 'accountRole') - {{Config::get('firefly.accountRoles.'.$entry->data)}} - @endif - @endforeach - | - @endif - -{!! Amount::format($balance) !!} | -- @if($account->active) - - @else - - @endif - | - @if($account->lastActivityDate) -- {{{$account->lastActivityDate->format('j F Y')}}} - | - @else -- Never - | - @endif -- {!! Amount::format($account->endBalance - $account->startBalance) !!} - | - -
- | Name | -Matches on | -Matching amount | -Last seen match | -Next expected match | -Is active | -Will be automatched | -Repeats every | -- | |
---|---|---|---|---|---|---|---|---|---|---|
- - | -- {{{$entry->name}}} - | -- @foreach(explode(',',$entry->match) as $match) - {{{$match}}} - @endforeach - | -- {!! Amount::format($entry->amount_min) !!} - | -- {!! Amount::format($entry->amount_max) !!} - | -- @if($entry->lastFoundMatch) - {{$entry->lastFoundMatch->format('j F Y')}} - @else - Unknown - @endif - | -- @if($entry->nextExpectedMatch) - {{$entry->nextExpectedMatch->format('j F Y')}} - @else - Unknown - @endif - | -- @if($entry->active) - - @else - - @endif - | -- @if($entry->automatch) - - @else - - @endif - | -- {{{$entry->repeat_freq}}} - @if($entry->skip > 0) - skips over {{$entry->skip}} - @endif - | -- @if($entry->active) - - @endif - | -
- | Name | -Last activity | -|
---|---|---|---|
- | Without a category | -- | |
- - | -- {{{$category->name}}} - | - @if($category->lastActivity) -- {{$category->lastActivity->format('jS F Y')}} - | - @else -- Never - | - @endif -
- | Description | -Amount | -Date | -From | -To | - @if(!isset($hideBudget) || (isset($hideBudget) && $hideBudget=== false)) -- @endif - @if(!isset($hideCategory) || (isset($hideCategory) && $hideCategory=== false)) - | - @endif - @if(!isset($hideBill) || (isset($hideBill) && $hideBill=== false)) - | - @endif - | |
---|---|---|---|---|---|---|---|---|---|
- - | -- | {{{$journal->description}}} | -Invalid journal: Found {{$journal->transactions()->count()}} transaction(s) | -||||||
- - | -- @if($journal->transactiontype->type == 'Withdrawal') - - @endif - @if($journal->transactiontype->type == 'Deposit') - - @endif - @if($journal->transactiontype->type == 'Transfer') - - @endif - @if($journal->transactiontype->type == 'Opening balance') - - @endif - | -- {{{$journal->description}}} - | -- @if($journal->transactiontype->type == 'Withdrawal') - {{Amount::formatTransaction($journal->transactions[0],false)}} - @endif - @if($journal->transactiontype->type == 'Deposit') - {{Amount::formatTransaction($journal->transactions[1],false)}} - @endif - @if($journal->transactiontype->type == 'Transfer') - {{Amount::formatTransaction($journal->transactions[1],false)}} - @endif - | -- {{$journal->date->format('j F Y')}} - | -- @if($journal->transactions[0]->account->accounttype->type == 'Cash account') - (cash) - @else - {{{$journal->transactions[0]->account->name}}} - @endif - | -- @if($journal->transactions[1]->account->accounttype->type == 'Cash account') - (cash) - @else - {{{$journal->transactions[1]->account->name}}} - @endif - | - @if(!isset($hideBudget) || (isset($hideBudget) && $hideBudget=== false)) -- budgets[0]) ? $journal->budgets[0] : null; ?> - @if($budget) - {{{$budget->name}}} - @endif - | - @endif - @if(!isset($hideCategory) || (isset($hideCategory) && $hideCategory=== false)) -- categories[0]) ? $journal->categories[0] : null; ?> - @if($category) - {{{$category->name}}} - @endif - | - @endif - @if(!isset($hideBill) || (isset($hideBill) && $hideBill=== false)) -- @if($journal->bill) - {{{$journal->bill->name}}} - @endif - | - @endif - - -
Piggy bank | - @endif -Date | -Amount | -
---|---|---|
- {{{$event->piggyBank->name}}} - | - @endif -- @if(!is_null($event->transaction_journal_id)) - {{$event->date->format('j F Y')}} - @else - {{$event->date->format('j F Y')}} - @endif - | - -- @if($event->amount < 0) - Removed {{Amount::format($event->amount*-1,false)}} - @else - Added {{Amount::format($event->amount,false)}} - @endif - | -
- This reminder is active between {{$reminder->startdate->format('jS F Y')}} - and {{$reminder->enddate->format('jS F Y')}}. -
- @if(isset($reminder->description)) -{!! $reminder->description !!}
- @endif -- (No reminders) -
-- Are you sure? -
- -- - Cancel -
-Account | -Balance | -Left for piggy banks | -Sum of piggy banks | -Saved so far | -Left to save | -
---|---|---|---|---|---|
{{{$info['name']}}} | -{!! Amount::format($info['balance']) !!} | -{!! Amount::format($info['leftForPiggyBanks']) !!} | -{!! Amount::format($info['sumOfTargets']) !!} | -{!! Amount::format($info['sumOfSaved']) !!} | -{!! Amount::format($info['leftToSave']) !!} | -
- | -- @if($journal->transactiontype->type == 'Withdrawal') - - @endif - @if($journal->transactiontype->type == 'Deposit') - - @endif - @if($journal->transactiontype->type == 'Transfer') - - @endif - | -{{$journal->date->format('jS M Y')}} | -- {{{$journal->description}}} - | -- @if($journal->transactiontype->type == 'Withdrawal') - {{Amount::formatTransaction($journal->transactions[0],false)}} - @endif - @if($journal->transactiontype->type == 'Deposit') - {{Amount::formatTransaction($journal->transactions[1],false)}} - @endif - @if($journal->transactiontype->type == 'Transfer') - {{Amount::formatTransaction($journal->transactions[1],false)}} - @endif - | - -
No related transactions
-@endif diff --git a/resources/views/related/relate.blade.php b/resources/views/related/relate.blade.php deleted file mode 100644 index 194b4d74a8..0000000000 --- a/resources/views/related/relate.blade.php +++ /dev/null @@ -1,29 +0,0 @@ -- | - @if($journal->transactiontype->type == 'Withdrawal') - - @endif - @if($journal->transactiontype->type == 'Deposit') - - @endif - @if($journal->transactiontype->type == 'Transfer') - - @endif - | -{{$journal->date->format('jS M Y')}} | -- {{{$journal->description}}} - | -- @if($journal->transactiontype->type == 'Withdrawal') - {{Amount::formatTransaction($journal->transactions[0],false)}} - @endif - @if($journal->transactiontype->type == 'Deposit') - {{Amount::formatTransaction($journal->transactions[1],false)}} - @endif - @if($journal->transactiontype->type == 'Transfer') - {{Amount::formatTransaction($journal->transactions[1],false)}} - @endif - | - -
No results
-@endif diff --git a/resources/views/reminders/show.blade.php b/resources/views/reminders/show.blade.php deleted file mode 100644 index 8ab199dc59..0000000000 --- a/resources/views/reminders/show.blade.php +++ /dev/null @@ -1,38 +0,0 @@ -@extends('layouts.default') -@section('content') -{!! Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $reminder) !!} -- Active between {{$reminder->startdate->format('jS F Y')}} - and {{$reminder->enddate->format('jS F Y')}}. -
- - @if(isset($reminder->description)) -{!! $reminder->description !!}
- @endif --
- -Account | -Start of month | -Current balance | -Spent | -Earned | -
---|---|---|---|---|
{{{$account->name}}} | -{!! Amount::format($account->startBalance) !!} | -{!! Amount::format($account->endBalance) !!} | -- @if($account->startBalance - $account->endBalance >= 0) - {!! Amount::format($account->startBalance - $account->endBalance) !!} - @endif - | -- @if($account->startBalance - $account->endBalance < 0) - {!! Amount::format(($account->startBalance - $account->endBalance)*-1) !!} - @endif - | -
Budgets | - - @foreach($accounts as $account) - @if($account->hide === false) -{{{$account->name}}} | - @endif - id] = 0; - ?> - - @endforeach -- Left in budget - | -|||
---|---|---|---|---|---|
{{{$budget['name']}}} | -{!! Amount::format($budget['queryAmount']) !!} | - - @foreach($accounts as $account) - @if($account->hide === false) - @if(isset($account->budgetInformation[$id])) -- @if($id == 0) - - {!! Amount::format($account->budgetInformation[$id]['queryAmount']) !!} - - @else - {!! Amount::format($account->budgetInformation[$id]['queryAmount']) !!} - @endif - | - budgetInformation[$id]['queryAmount']); - $accountSums[$account->id] += floatval($account->budgetInformation[$id]['queryAmount']); - ?> - @else -{!! Amount::format(0) !!} | - @endif - @endif - @endforeach -{!! Amount::format($budget['queryAmount'] + $budget['spent']) !!} | -{!! Amount::format($budget['queryAmount'] + $spent) !!} | -
Balanced by transfers | - @foreach($accounts as $account) - @if($account->hide === false) -- {!! Amount::format($account->balancedAmount) !!} - | - @endif - @endforeach -- | |||
Left unbalanced | - @foreach($accounts as $account) - id] += $account->balancedAmount; - ?> - @if($account->hide === false) - @if(isset($account->budgetInformation[0])) -- @if($account->budgetInformation[0]['queryAmount'] + $account->balancedAmount != 0.0) - {!! Amount::format($account->budgetInformation[0]['queryAmount'] + $account->balancedAmount) !!} - @else - {!! Amount::format($account->budgetInformation[0]['queryAmount'] + $account->balancedAmount) !!} - @endif - | - @else -{!! Amount::format(0) !!} | - @endif - @endif - @endforeach -- | ||
Sum | - @foreach($accounts as $account) - @if($account->hide === false) -{!! Amount::format($accountSums[$account->id]) !!} | - @endif - @endforeach -- | |||
Expected balance | - @foreach($accounts as $account) - @if($account->hide === false) -{!! Amount::format($account->startBalance + $accountSums[$account->id]) !!} | - @endif - @endforeach -- |
-
- -- {{{$entry->description}}} - | -- queryAmount);?> - @if($entry->type == 'Withdrawal') - {{Amount::format($entry->queryAmount,false)}} - @endif - @if($entry->type == 'Deposit') - {{Amount::format($entry->queryAmount,false)}} - @endif - @if($entry->type == 'Transfer') - {{Amount::format($entry->queryAmount,false)}} - @endif - | -- {{$entry->date->format('j F Y')}} - | -- {{{$entry->name}}} - | -
Sum | -{!! Amount::format($tableSum) !!} | - -
{{{$expense['name']}}} | - @else -{{{$expense['name']}}} | - @endif -{!! Amount::format($expense['queryAmount']) !!} | -
Sum | -{!! Amount::format($sum) !!} | -
In | -{!! Amount::format($in) !!} | -
Out | -{!! Amount::format($sum) !!} | -
Difference | -{!! Amount::format($in - $sum) !!} | -
Budget | -Envelope | -Spent | -Left | -
---|---|---|---|
- @if($id > 0) - {{{$budget['name']}}} - @else - {{{$budget['name']}}} - @endif - | -{!! Amount::format($budget['queryAmount']) !!} | -{!! Amount::format($budget['spent'],false) !!} | -{!! Amount::format($budget['queryAmount'] + $budget['spent']) !!} | -
Sum | -{!! Amount::format($sumEnvelope) !!} | -{!! Amount::format($sumSpent) !!} | -{!! Amount::format($sumLeft) !!} | -
Category | -Spent | -
---|---|
- @if($id > 0) - {{{$category['name']}}} - @else - {{{$category['name']}}} - @endif - | -{!! Amount::format($category['queryAmount'],false) !!} | -
Sum | -{!! Amount::format($sum) !!} | -
{{{$account['name']}}} | -{!! Amount::format($account['startBalance']) !!} | -{!! Amount::format($account['endBalance']) !!} | -{!! Amount::format($account['difference']) !!} | -
Sum | -{!! Amount::format($sumStart) !!} | -{!! Amount::format($sumEnd) !!} | -{!! Amount::format($sumDiff) !!} | -
Bla bla
-- -
- -- -
- -Date | -{{{$journal->date->format('jS F Y')}}} | -
Type | -{{{$journal->transactiontype->type}}} | -
Completed | -- @if($journal->completed == 1) - Yes - @else - No - @endif - | -
Budget | -{{{$budget->name}}} | -
Category | -{{{$category->name}}} | -
- No related transactions -
-Group #{{$group->id}} ({{$group->relation}}) | -||
---|---|---|
- - | -- {{{$jrnl->description}}} - | -- @foreach($jrnl->transactions()->get() as $t) - @if($t->amount > 0) - {!! Amount::formatTransaction($t) !!} - @endif - @endforeach - | -
Amount | -{!! Amount::formatTransaction($t) !!} | -
New balance | -{!! Amount::format($t->before) !!} → {!! Amount::format($t->after) !!} | -
Description | -{{{$t->description}}} | -