Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Basic upload working.
James Cole83d6158483e5
diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.phpindex 8744038427..2e2037ed34 100644--- a/app/Http/Controllers/TransactionController.php+++ b/app/Http/Controllers/TransactionController.php@@ -6,6 +6,7 @@ use Config;use ExpandedForm;use FireflyIII\Events\JournalCreated;use FireflyIII\Events\JournalSaved;+use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;use FireflyIII\Http\Requests\JournalFormRequest;use FireflyIII\Models\Transaction;use FireflyIII\Models\TransactionJournal;@@ -256,21 +257,37 @@ class TransactionController extends Controller** @return \Illuminate\Http\RedirectResponse*/- public function store(JournalFormRequest $request, JournalRepositoryInterface $repository)+ public function store(JournalFormRequest $request, JournalRepositoryInterface $repository, AttachmentHelperInterface $att){$journalData = $request->getJournalData();// if not withdrawal, unset budgetid.- if($journalData['what'] != 'withdrawal') {+ if ($journalData['what'] != 'withdrawal') {$journalData['budget_id'] = 0;}- $journal = $repository->store($journalData);+ $journal = $repository->store($journalData);++ // save attachments:+ $att->saveAttachmentsForModel($journal);++ if ($att->getErrors()->count() > 0) {+ // todo moet beter+ Session::flash('error', '<ul>' . join('', $att->getErrors()->get('attachments', '<li>:message</li>')) . '</ul>');+ }+ if ($att->getMessages()->count() > 0) {+ // todo moet beter+ Session::flash('info', '<ul>' . join('', $att->getMessages()->get('attachments', '<li>:message</li>')) . '</ul>');+ }+++ // do something with the messages?+// rescan journal, UpdateJournalConnectionevent(new JournalSaved($journal));- // ConnectJournalToPiggyBank+if ($journal->transactionType->type == 'Transfer' && intval($request->get('piggy_bank_id')) > 0) {event(new JournalCreated($journal, intval($request->get('piggy_bank_id'))));}diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.phpindex 5f3b310017..a08a908fde 100644--- a/app/Providers/FireflyServiceProvider.php+++ b/app/Providers/FireflyServiceProvider.php@@ -93,6 +93,9 @@ class FireflyServiceProvider extends ServiceProvider// CSV import$this->app->bind('FireflyIII\Helpers\Csv\WizardInterface', 'FireflyIII\Helpers\Csv\Wizard');+ // attachments+ $this->app->bind('FireflyIII\Helpers\Attachments\AttachmentHelperInterface', 'FireflyIII\Helpers\Attachments\AttachmentHelper');+// make charts:// alternative is Google instead of ChartJs$this->app->bind('FireflyIII\Generator\Chart\Account\AccountChartGenerator', 'FireflyIII\Generator\Chart\Account\ChartJsAccountChartGenerator');diff --git a/resources/twig/partials/flashes.twig b/resources/twig/partials/flashes.twigindex b22d3ceb1d..d71dd9f381 100644--- a/resources/twig/partials/flashes.twig+++ b/resources/twig/partials/flashes.twig@@ -8,7 +8,7 @@{% if Session.has('info') %}<div class="alert alert-info alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">{{ 'close'|_ }}</span></button>- <strong>Info:</strong> {{ Session.get('info') }}+ <strong>Info:</strong> {{ Session.get('info')|raw }}</div>{% endif %}@@ -22,6 +22,6 @@{% if Session.has('error') %}<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">{{ 'close'|_ }}</span></button>- <strong>Error!</strong> {{ Session.get('error') }}+ <strong>Error!</strong> {{ Session.get('error')|raw }}</div>{% endif %}