diff --git a/.env.example b/.env.example index f09ea84584..ab5f94b185 100644 --- a/.env.example +++ b/.env.example @@ -18,4 +18,7 @@ EMAIL_PASSWORD= ANALYTICS_ID= EMAIL_PRETEND=false RUNCLEANUP=true -SITE_OWNER=mail@example.com \ No newline at end of file +SITE_OWNER=mail@example.com + +SENDGRID_USERNAME= +SENDGRID_PASSWORD= \ No newline at end of file diff --git a/README.md b/README.md index a3de7d2e42..bf530c612b 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ Firefly III uses the following libraries and tools: * The AdminLTE template by [Almsaseed Studio](https://almsaeedstudio.com/) * The [Google charts](https://developers.google.com/chart/) library. +* [Chart.js](http://www.chartjs.org/) * [Bootstrap](http://getbootstrap.com/) * [Laravel](http://laravel.com/) * [Twig](http://twig.sensiolabs.org/) diff --git a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php index e4dd7a6857..a193cbd0cf 100644 --- a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php +++ b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php @@ -38,7 +38,7 @@ class ChartJsBillChartGenerator implements BillChartGenerator /** @var Bill $entry */ foreach ($unpaid as $entry) { // loop unpaid: $description = $entry[0]->name . ' (' . $entry[1]->format('jS M Y') . ')'; - $amount = ($entry[0]->amount_max + $entry[0]->amount_min) / 2; + $amount = bcdiv(bcadd($entry[0]->amount_max, $entry[0]->amount_min), 2); $unpaidDescriptions[] = $description; $unpaidAmount = bcadd($unpaidAmount, $amount); unset($amount, $description); diff --git a/app/Generator/Chart/Bill/GoogleBillChartGenerator.php b/app/Generator/Chart/Bill/GoogleBillChartGenerator.php index d77a9a5f8f..3ccf83d7d5 100644 --- a/app/Generator/Chart/Bill/GoogleBillChartGenerator.php +++ b/app/Generator/Chart/Bill/GoogleBillChartGenerator.php @@ -44,7 +44,7 @@ class GoogleBillChartGenerator implements BillChartGenerator /** @var Bill $entry */ foreach ($unpaid as $entry) { $description = $entry[0]->name . ' (' . $entry[1]->format('jS M Y') . ')'; - $amount = ($entry[0]->amount_max + $entry[0]->amount_min) / 2; + $amount = bcdiv(bcadd($entry[0]->amount_max, $entry[0]->amount_min), 2); $unpaidDescriptions[] = $description; $unpaidAmount = bcadd($unpaidAmount, $amount); unset($amount, $description); @@ -81,9 +81,9 @@ class GoogleBillChartGenerator implements BillChartGenerator foreach ($entries as $result) { $chart->addRow( clone $result->date, - floatval($bill->amount_max), - floatval($bill->amount_min), - floatval($result->amount) + round($bill->amount_max, 2), + round($bill->amount_min, 2), + round($result->amount, 2) ); } diff --git a/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php b/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php index 1117272c57..0bd146b737 100644 --- a/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php +++ b/app/Generator/Chart/PiggyBank/ChartJsPiggyBankChartGenerator.php @@ -26,7 +26,7 @@ class ChartJsPiggyBankChartGenerator implements PiggyBankChartGenerator // language: $language = Preferences::get('language', 'en')->data; - $format = Config::get('firefly.month.' . $language); + $format = Config::get('firefly.monthAndDay.' . $language); $data = [ 'count' => 1, diff --git a/app/Handlers/Events/UpdateJournalConnection.php b/app/Handlers/Events/UpdateJournalConnection.php index 2708e463a2..768a85f5bf 100644 --- a/app/Handlers/Events/UpdateJournalConnection.php +++ b/app/Handlers/Events/UpdateJournalConnection.php @@ -49,10 +49,12 @@ class UpdateJournalConnection if (is_null($repetition)) { return; } - $amount = $journal->amount; - $diff = $amount - $event->amount; // update current repetition + bcscale(2); - $repetition->currentamount += $diff; + $amount = $journal->amount; + $diff = bcsub($amount, $event->amount); // update current repetition + + $repetition->currentamount = bcadd($repetition->currentamount, $diff); $repetition->save(); diff --git a/app/Helpers/Attachments/AttachmentHelper.php b/app/Helpers/Attachments/AttachmentHelper.php new file mode 100644 index 0000000000..ff62f2fb4c --- /dev/null +++ b/app/Helpers/Attachments/AttachmentHelper.php @@ -0,0 +1,222 @@ +maxUploadSize = Config::get('firefly.maxUploadSize'); + $this->allowedMimes = Config::get('firefly.allowedMimes'); + $this->errors = new MessageBag; + $this->messages = new MessageBag; + } + + /** + * @param Attachment $attachment + * + * @return string + */ + public function getAttachmentLocation(Attachment $attachment) + { + $path = storage_path('upload') . DIRECTORY_SEPARATOR . 'at-' . $attachment->id . '.data'; + + return $path; + } + + /** + * @param Model $model + * + * @return bool + */ + public function saveAttachmentsForModel(Model $model) + { + $files = Input::file('attachments'); + + if (is_array($files)) { + foreach ($files as $entry) { + if (!is_null($entry)) { + $this->processFile($entry, $model); + } + } + } else { + $this->processFile($files, $model); + } + + return true; + } + + /** + * @param UploadedFile $file + * @param Model $model + * + * @return bool + */ + protected function hasFile(UploadedFile $file, Model $model) + { + $md5 = md5_file($file->getRealPath()); + $name = $file->getClientOriginalName(); + $class = get_class($model); + $count = Auth::user()->attachments()->where('md5', $md5)->where('attachable_id', $model->id)->where('attachable_type', $class)->count(); + + if ($count > 0) { + $msg = trans('validation.file_already_attached', ['name' => $name]); + $this->errors->add('attachments', $msg); + + return true; + } + + return false; + } + + /** + * @param UploadedFile $file + * @param Model $model + * + * @return bool + */ + protected function validateUpload(UploadedFile $file, Model $model) + { + if (!$this->validMime($file)) { + return false; + } + if (!$this->validSize($file)) { + return false; + } + if ($this->hasFile($file, $model)) { + return false; + } + + return true; + } + + /** + * @param UploadedFile $file + * @param Model $model + * + * @return bool|Attachment + */ + protected function processFile(UploadedFile $file, Model $model) + { + $validation = $this->validateUpload($file, $model); + if ($validation === false) { + return false; + } + + $attachment = new Attachment; // create Attachment object. + $attachment->user()->associate(Auth::user()); + $attachment->attachable()->associate($model); + $attachment->md5 = md5_file($file->getRealPath()); + $attachment->filename = $file->getClientOriginalName(); + $attachment->mime = $file->getMimeType(); + $attachment->size = $file->getSize(); + $attachment->uploaded = 0; + $attachment->save(); + + $path = $file->getRealPath(); // encrypt and move file to storage. + $content = file_get_contents($path); + $encrypted = Crypt::encrypt($content); + + // store it: + $upload = $this->getAttachmentLocation($attachment); + if (is_writable(dirname($upload))) { + file_put_contents($upload, $encrypted); + } + + $attachment->uploaded = 1; // update attachment + $attachment->save(); + + $name = e($file->getClientOriginalName()); // add message: + $msg = trans('validation.file_attached', ['name' => $name]); + $this->messages->add('attachments', $msg); + + // return it. + return $attachment; + + + } + + /** + * @param UploadedFile $file + * + * @return bool + */ + protected function validMime(UploadedFile $file) + { + $mime = e($file->getMimeType()); + $name = e($file->getClientOriginalName()); + + if (!in_array($mime, $this->allowedMimes)) { + $msg = trans('validation.file_invalid_mime', ['name' => $name, 'mime' => $mime]); + $this->errors->add('attachments', $msg); + + return false; + } + + return true; + } + + /** + * @param UploadedFile $file + * + * @return bool + */ + protected function validSize(UploadedFile $file) + { + $size = $file->getSize(); + $name = e($file->getClientOriginalName()); + if ($size > $this->maxUploadSize) { + $msg = trans('validation.file_too_large', ['name' => $name]); + $this->errors->add('attachments', $msg); + + return false; + } + + return true; + } + + /** + * @return MessageBag + */ + public function getErrors() + { + return $this->errors; + } + + /** + * @return MessageBag + */ + public function getMessages() + { + return $this->messages; + } + + +} diff --git a/app/Helpers/Attachments/AttachmentHelperInterface.php b/app/Helpers/Attachments/AttachmentHelperInterface.php new file mode 100644 index 0000000000..f25971a173 --- /dev/null +++ b/app/Helpers/Attachments/AttachmentHelperInterface.php @@ -0,0 +1,41 @@ +accounts()->find($this->value); if (!is_null($account)) { - Log::debug('Found ' . $account->accountType->type . ' named "******" with ID: ' . $this->value.' (not mapped) '); + Log::debug('Found ' . $account->accountType->type . ' named "******" with ID: ' . $this->value . ' (not mapped) '); } } diff --git a/app/Helpers/Csv/Wizard.php b/app/Helpers/Csv/Wizard.php index 4045c97102..148934ee60 100644 --- a/app/Helpers/Csv/Wizard.php +++ b/app/Helpers/Csv/Wizard.php @@ -7,9 +7,10 @@ use Crypt; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Csv\Mapper\MapperInterface; use League\Csv\Reader; +use Log; use ReflectionException; use Session; -use Log; + /** * Class Wizard * @@ -110,6 +111,7 @@ class Wizard implements WizardInterface foreach ($fields as $field) { if (!Session::has($field)) { Log::error('Session is missing field: ' . $field); + return false; } } diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.php index 07e13eff6f..095d68ae53 100644 --- a/app/Helpers/Report/ReportHelper.php +++ b/app/Helpers/Report/ReportHelper.php @@ -79,7 +79,7 @@ class ReportHelper implements ReportHelperInterface foreach ($accounts as $account) { $start = bcadd($start, $account->startBalance); $end = bcadd($end, $account->endBalance); - $diff = bcadd($diff, ($account->endBalance - $account->startBalance)); + $diff = bcadd($diff, bcsub($account->endBalance, $account->startBalance)); } $object = new AccountCollection; @@ -255,6 +255,8 @@ class ReportHelper implements ReportHelperInterface $repository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface'); $set = $repository->getBudgets(); + bcscale(2); + foreach ($set as $budget) { $repetitions = $repository->getBudgetLimitRepetitions($budget, $start, $end); @@ -277,9 +279,9 @@ class ReportHelper implements ReportHelperInterface $budgetLine->setBudget($budget); $budgetLine->setRepetition($repetition); $expenses = $repository->spentInPeriodCorrected($budget, $repetition->startdate, $repetition->enddate, $shared); - $left = $expenses < floatval($repetition->amount) ? floatval($repetition->amount) - $expenses : 0; - $spent = $expenses > floatval($repetition->amount) ? 0 : $expenses; - $overspent = $expenses > floatval($repetition->amount) ? $expenses - floatval($repetition->amount) : 0; + $left = $expenses < $repetition->amount ? bcsub($repetition->amount, $expenses) : 0; + $spent = $expenses > $repetition->amount ? 0 : $expenses; + $overspent = $expenses > $repetition->amount ? bcsub($expenses, $repetition->amount) : 0; $budgetLine->setLeft($left); $budgetLine->setSpent($spent); diff --git a/app/Helpers/Report/ReportQuery.php b/app/Helpers/Report/ReportQuery.php index 69044a06ff..5e8834374c 100644 --- a/app/Helpers/Report/ReportQuery.php +++ b/app/Helpers/Report/ReportQuery.php @@ -212,17 +212,19 @@ class ReportQuery implements ReportQueryInterface public function spentInBudgetCorrected(Account $account, Budget $budget, Carbon $start, Carbon $end) { - return floatval( - Auth::user()->transactionjournals() - ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') - ->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id') - ->transactionTypes(['Withdrawal']) - ->where('transactions.account_id', $account->id) - ->before($end) - ->after($start) - ->where('budget_transaction_journal.budget_id', $budget->id) - ->get(['transaction_journals.*'])->sum('amount') - ) * -1; + bcscale(2); + + return bcmul( + Auth::user()->transactionjournals() + ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') + ->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id') + ->transactionTypes(['Withdrawal']) + ->where('transactions.account_id', $account->id) + ->before($end) + ->after($start) + ->where('budget_transaction_journal.budget_id', $budget->id) + ->get(['transaction_journals.*'])->sum('amount'), -1 + ); } /** diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 44026114aa..3d17a25e00 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -130,7 +130,7 @@ class AccountController extends Controller 'ccMonthlyPaymentDate' => $account->getMeta('ccMonthlyPaymentDate'), 'openingBalanceDate' => $openingBalance ? $openingBalance->date->format('Y-m-d') : null, 'openingBalance' => $openingBalanceAmount, - 'virtualBalance' => floatval($account->virtual_balance) + 'virtualBalance' => round($account->virtual_balance, 2) ]; Session::flash('preFilled', $preFilled); Session::flash('gaEventCategory', 'accounts'); @@ -167,10 +167,11 @@ class AccountController extends Controller $startBalances = Steam::balancesById($ids, $start); $endBalances = Steam::balancesById($ids, $end); + $activities = Steam::getLastActivities($ids); $accounts->each( - function (Account $account) use ($startBalances, $endBalances) { - $account->lastActivityDate = null;//$repository->getLastActivity($account); + function (Account $account) use ($activities, $startBalances, $endBalances) { + $account->lastActivityDate = isset($activities[$account->id]) ? $activities[$account->id] : null; $account->startBalance = isset($startBalances[$account->id]) ? $startBalances[$account->id] : null; $account->endBalance = isset($endBalances[$account->id]) ? $endBalances[$account->id] : null; } @@ -209,12 +210,12 @@ class AccountController extends Controller $accountData = [ 'name' => $request->input('name'), 'accountType' => $request->input('what'), - 'virtualBalance' => floatval($request->input('virtualBalance')), + 'virtualBalance' => round($request->input('virtualBalance'), 2), 'active' => true, 'user' => Auth::user()->id, 'iban' => $request->input('iban'), 'accountRole' => $request->input('accountRole'), - 'openingBalance' => floatval($request->input('openingBalance')), + 'openingBalance' => round($request->input('openingBalance'), 2), 'openingBalanceDate' => new Carbon((string)$request->input('openingBalanceDate')), 'openingBalanceCurrency' => intval($request->input('balance_currency_id')), @@ -252,8 +253,8 @@ class AccountController extends Controller 'user' => Auth::user()->id, 'iban' => $request->input('iban'), 'accountRole' => $request->input('accountRole'), - 'virtualBalance' => floatval($request->input('virtualBalance')), - 'openingBalance' => floatval($request->input('openingBalance')), + 'virtualBalance' => round($request->input('virtualBalance'), 2), + 'openingBalance' => round($request->input('openingBalance'), 2), 'openingBalanceDate' => new Carbon((string)$request->input('openingBalanceDate')), 'openingBalanceCurrency' => intval($request->input('balance_currency_id')), 'ccType' => $request->input('ccType'), diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.php new file mode 100644 index 0000000000..ac255e3783 --- /dev/null +++ b/app/Http/Controllers/AttachmentController.php @@ -0,0 +1,173 @@ + $attachment->filename]); + + // put previous url in session if not redirect from store (not "return_to_edit"). + if (Session::get('attachments.edit.fromUpdate') !== true) { + Session::put('attachments.edit.url', URL::previous()); + } + Session::forget('attachments.edit.fromUpdate'); + + return view('attachments.edit', compact('attachment', 'subTitleIcon', 'subTitle')); + } + + /** + * @param Attachment $attachment + * + * @return \Illuminate\View\View + */ + public function delete(Attachment $attachment) + { + $subTitle = trans('firefly.delete_attachment', ['name' => $attachment->filename]); + + // put previous url in session + Session::put('attachments.delete.url', URL::previous()); + Session::flash('gaEventCategory', 'attachments'); + Session::flash('gaEventAction', 'delete-attachment'); + + return view('attachments.delete', compact('attachment', 'subTitle')); + } + + /** + * @param AttachmentRepositoryInterface $repository + * @param Attachment $attachment + * + * @return \Illuminate\Http\RedirectResponse + */ + public function destroy(AttachmentRepositoryInterface $repository, Attachment $attachment) + { + $name = $attachment->filename; + + $repository->destroy($attachment); + + Session::flash('success', trans('firefly.attachment_deleted', ['name' => $name])); + Preferences::mark(); + + return redirect(Session::get('attachments.delete.url')); + } + + /** + * @param Attachment $attachment + */ + public function download(Attachment $attachment, AttachmentHelperInterface $helper) + { + + $file = $helper->getAttachmentLocation($attachment); + if (file_exists($file)) { + + $quoted = sprintf('"%s"', addcslashes(basename($attachment->filename), '"\\')); + + header('Content-Description: File Transfer'); + header('Content-Type: application/octet-stream'); + header('Content-Disposition: attachment; filename=' . $quoted); + header('Content-Transfer-Encoding: binary'); + header('Connection: Keep-Alive'); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + header('Content-Length: ' . $attachment->size); + + echo Crypt::decrypt(file_get_contents($file)); + + } else { + abort(404); + } + } + + /** + * @param Attachment $attachment + * + * @return \Illuminate\Http\Response + */ + public function preview(Attachment $attachment) + { + if ($attachment->mime == 'application/pdf') { + $file = public_path('images/page_white_acrobat.png'); + } else { + $file = public_path('images/page_green.png'); + } + + $response = Response::make(File::get($file)); + $response->header('Content-Type', 'image/png'); + + return $response; + } + + + /** + * @param AttachmentFormRequest $request + * @param AttachmentRepositoryInterface $repository + * @param Attachment $attachment + * + * @return \Illuminate\Http\RedirectResponse + */ + public function update(AttachmentFormRequest $request, AttachmentRepositoryInterface $repository, Attachment $attachment) + { + + $attachmentData = [ + 'title' => $request->input('title'), + 'description' => $request->input('description'), + 'notes' => $request->input('notes'), + ]; + + $repository->update($attachment, $attachmentData); + + Session::flash('success', 'Attachment "' . $attachment->filename . '" updated.'); + Preferences::mark(); + + if (intval(Input::get('return_to_edit')) === 1) { + // set value so edit routine will not overwrite URL: + Session::put('attachments.edit.fromUpdate', true); + + return redirect(route('attachments.edit', [$attachment->id]))->withInput(['return_to_edit' => 1]); + } + + // redirect to previous URL. + return redirect(Session::get('attachments.edit.url')); + + } + +} diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index 97e9bf6a09..f997fe5060 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -9,6 +9,7 @@ use Illuminate\Foundation\Auth\ThrottlesLogins; use Illuminate\Http\Request; use Illuminate\Mail\Message; use Mail; +use Request as Rq; use Session; use Twig; use Validator; @@ -22,18 +23,17 @@ class AuthController extends Controller { use AuthenticatesAndRegistersUsers, ThrottlesLogins; + /** + * Show the application registration form. + * + * @return \Illuminate\Http\Response + */ + public function getRegister() + { + $host = Rq::getHttpHost(); - /* - |-------------------------------------------------------------------------- - | Registration & Login Controller - |-------------------------------------------------------------------------- - | - | This controller handles the registration of new users, as well as the - | authentication of existing users. By default, this controller uses - | a simple trait to add these behaviors. Why don't you explore it? - | - */ - + return view('auth.register', compact('host')); + } /** * Handle a login request to the application. @@ -60,12 +60,26 @@ class AuthController extends Controller } $credentials = $this->getCredentials($request); - $credentials['blocked'] = 0; + $credentials['blocked'] = 0; // most not be blocked. if (Auth::attempt($credentials, $request->has('remember'))) { return $this->handleUserWasAuthenticated($request, $throttles); } + // default error message: + $message = $this->getFailedLoginMessage(); + + // try to find a blocked user with this email address. + /** @var User $foundUser */ + $foundUser = User::where('email', $credentials['email'])->where('blocked', 1)->first(); + if (!is_null($foundUser)) { + // if it exists, show message: + $code = $foundUser->blocked_code; + $message = trans('firefly.' . $code . '_error', ['email' => $credentials['email']]); + } + + // try + // If the login attempt was unsuccessful we will increment the number of attempts // to login and redirect the user back to the login form. Of course, when this // user surpasses their maximum number of attempts they will get locked out. @@ -77,7 +91,7 @@ class AuthController extends Controller ->withInput($request->only($this->loginUsername(), 'remember')) ->withErrors( [ - $this->loginUsername() => $this->getFailedLoginMessage(), + $this->loginUsername() => $message, ] ); } diff --git a/app/Http/Controllers/CronController.php b/app/Http/Controllers/CronController.php new file mode 100644 index 0000000000..31c7939f26 --- /dev/null +++ b/app/Http/Controllers/CronController.php @@ -0,0 +1,64 @@ + 0 && strlen(env('SENDGRID_PASSWORD')) > 0) { + + $URL = 'https://api.sendgrid.com/api/bounces.get.json'; + $parameters = [ + 'api_user' => env('SENDGRID_USERNAME'), + 'api_key' => env('SENDGRID_PASSWORD'), + 'date' => 1, + 'days' => 7 + ]; + $fullURL = $URL . '?' . http_build_query($parameters); + $data = json_decode(file_get_contents($fullURL)); + + /* + * Loop the result, if any. + */ + if (is_array($data)) { + echo 'Found ' . count($data) . ' entries in the SendGrid bounce list.' . "\n"; + foreach ($data as $entry) { + $address = $entry->email; + $user = User::where('email', $address)->where('blocked', 0)->first(); + if (!is_null($user)) { + echo 'Found a user: ' . $address . ', who is now blocked.' . "\n"; + $user->blocked = 1; + $user->blocked_code = 'bounced'; + $user->password = 'bounced'; + $user->save(); + } else { + echo 'Found no user: ' . $address . ', did nothing.' . "\n"; + } + } + } + echo 'Done!' . "\n"; + } else { + echo 'Please fill in SendGrid details.'; + } + + } + +} diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 3cd48800ed..9b9c5bef5e 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -1,5 +1,6 @@ amount_max + $entry[0]->amount_min) / 2; + $current = bcdiv(bcadd($entry[0]->amount_max, $entry[0]->amount_min), 2); $amount = bcadd($amount, $current); } diff --git a/app/Http/Controllers/NewUserController.php b/app/Http/Controllers/NewUserController.php index f568da53f7..c08717e4a7 100644 --- a/app/Http/Controllers/NewUserController.php +++ b/app/Http/Controllers/NewUserController.php @@ -53,13 +53,13 @@ class NewUserController extends Controller // create normal asset account: $assetAccount = [ 'name' => $request->get('bank_name'), - 'iban' => null, + 'iban' => null, 'accountType' => 'asset', 'virtualBalance' => 0, 'active' => true, 'user' => Auth::user()->id, 'accountRole' => 'defaultAsset', - 'openingBalance' => floatval($request->input('bank_balance')), + 'openingBalance' => round($request->input('bank_balance'), 2), 'openingBalanceDate' => new Carbon, 'openingBalanceCurrency' => intval($request->input('balance_currency_id')), ]; @@ -70,13 +70,13 @@ class NewUserController extends Controller if (strlen($request->get('savings_balance') > 0)) { $savingsAccount = [ 'name' => $request->get('bank_name') . ' savings account', - 'iban' => null, + 'iban' => null, 'accountType' => 'asset', 'virtualBalance' => 0, 'active' => true, 'user' => Auth::user()->id, 'accountRole' => 'savingAsset', - 'openingBalance' => floatval($request->input('savings_balance')), + 'openingBalance' => round($request->input('savings_balance'), 2), 'openingBalanceDate' => new Carbon, 'openingBalanceCurrency' => intval($request->input('balance_currency_id')), ]; @@ -88,9 +88,9 @@ class NewUserController extends Controller if (strlen($request->get('credit_card_limit') > 0)) { $creditAccount = [ 'name' => 'Credit card', - 'iban' => null, + 'iban' => null, 'accountType' => 'asset', - 'virtualBalance' => floatval($request->get('credit_card_limit')), + 'virtualBalance' => round($request->get('credit_card_limit'), 2), 'active' => true, 'user' => Auth::user()->id, 'accountRole' => 'ccAsset', diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index 049f4c83b3..c0bf03eabd 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -47,10 +47,11 @@ class PiggyBankController extends Controller */ public function add(AccountRepositoryInterface $repository, PiggyBank $piggyBank) { + bcscale(2); $date = Session::get('end', Carbon::now()->endOfMonth()); $leftOnAccount = $repository->leftOnAccount($piggyBank->account, $date); $savedSoFar = $piggyBank->currentRelevantRep()->currentamount; - $leftToSave = $piggyBank->targetamount - $savedSoFar; + $leftToSave = bcsub($piggyBank->targetamount, $savedSoFar); $maxAmount = min($leftOnAccount, $leftToSave); return view('piggy-banks.add', compact('piggyBank', 'maxAmount')); @@ -66,7 +67,7 @@ class PiggyBankController extends Controller $periods = Config::get('firefly.piggy_bank_periods'); $accounts = ExpandedForm::makeSelectList($repository->getAccounts(['Default account', 'Asset account'])); - $subTitle = trans('firefly.create_new_piggybank'); + $subTitle = trans('firefly.new_piggy_bank'); $subTitleIcon = 'fa-plus'; // put previous url in session if not redirect from store (not "create another"). @@ -171,9 +172,9 @@ class PiggyBankController extends Controller $accounts = []; /** @var PiggyBank $piggyBank */ foreach ($piggyBanks as $piggyBank) { - $piggyBank->savedSoFar = floatval($piggyBank->currentRelevantRep()->currentamount); + $piggyBank->savedSoFar = round($piggyBank->currentRelevantRep()->currentamount, 2); $piggyBank->percentage = $piggyBank->savedSoFar != 0 ? intval($piggyBank->savedSoFar / $piggyBank->targetamount * 100) : 0; - $piggyBank->leftToSave = $piggyBank->targetamount - $piggyBank->savedSoFar; + $piggyBank->leftToSave = bcsub($piggyBank->targetamount, $piggyBank->savedSoFar); /* * Fill account information: @@ -185,7 +186,7 @@ class PiggyBankController extends Controller 'balance' => Steam::balance($account, $end, true), 'leftForPiggyBanks' => $repository->leftOnAccount($account, $end), 'sumOfSaved' => $piggyBank->savedSoFar, - 'sumOfTargets' => floatval($piggyBank->targetamount), + 'sumOfTargets' => round($piggyBank->targetamount, 2), 'leftToSave' => $piggyBank->leftToSave ]; } else { @@ -211,7 +212,7 @@ class PiggyBankController extends Controller if (is_array($data)) { foreach ($data as $order => $id) { - $repository->setOrder(intval($id), (intval($order) + 1)); + $repository->setOrder(intval($id), ($order + 1)); } } } @@ -225,13 +226,13 @@ class PiggyBankController extends Controller */ public function postAdd(PiggyBankRepositoryInterface $repository, AccountRepositoryInterface $accounts, PiggyBank $piggyBank) { - $amount = round(floatval(Input::get('amount')), 2); + bcscale(2); + $amount = round(Input::get('amount'), 2); $date = Session::get('end', Carbon::now()->endOfMonth()); $leftOnAccount = $accounts->leftOnAccount($piggyBank->account, $date); $savedSoFar = $piggyBank->currentRelevantRep()->currentamount; - $leftToSave = $piggyBank->targetamount - $savedSoFar; + $leftToSave = bcsub($piggyBank->targetamount, $savedSoFar); $maxAmount = round(min($leftOnAccount, $leftToSave), 2); - bcscale(2); if ($amount <= $maxAmount) { $repetition = $piggyBank->currentRelevantRep(); @@ -258,7 +259,7 @@ class PiggyBankController extends Controller */ public function postRemove(PiggyBankRepositoryInterface $repository, PiggyBank $piggyBank) { - $amount = floatval(Input::get('amount')); + $amount = round(Input::get('amount'), 2); bcscale(2); $savedSoFar = $piggyBank->currentRelevantRep()->currentamount; @@ -319,7 +320,7 @@ class PiggyBankController extends Controller 'name' => $request->get('name'), 'startdate' => new Carbon, 'account_id' => intval($request->get('account_id')), - 'targetamount' => floatval($request->get('targetamount')), + 'targetamount' => round($request->get('targetamount'), 2), 'remind_me' => false, 'reminder_skip' => 0, 'targetdate' => strlen($request->get('targetdate')) > 0 ? new Carbon($request->get('targetdate')) : null, @@ -354,7 +355,7 @@ class PiggyBankController extends Controller 'name' => $request->get('name'), 'startdate' => is_null($piggyBank->startdate) ? $piggyBank->created_at : $piggyBank->startdate, 'account_id' => intval($request->get('account_id')), - 'targetamount' => floatval($request->get('targetamount')), + 'targetamount' => round($request->get('targetamount'), 2), 'remind_me' => false, 'reminder_skip' => 0, 'targetdate' => strlen($request->get('targetdate')) > 0 ? new Carbon($request->get('targetdate')) : null, diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php index 8a1c02d227..6acda3d570 100644 --- a/app/Http/Controllers/ProfileController.php +++ b/app/Http/Controllers/ProfileController.php @@ -4,6 +4,7 @@ use Auth; use FireflyIII\Http\Requests; use FireflyIII\Http\Requests\DeleteAccountFormRequest; use FireflyIII\Http\Requests\ProfileFormRequest; +use FireflyIII\User; use Hash; use Session; @@ -20,7 +21,7 @@ class ProfileController extends Controller */ public function changePassword() { - return view('profile.change-password')->with('title', Auth::user()->email)->with('subTitle', 'Change your password')->with( + return view('profile.change-password')->with('title', Auth::user()->email)->with('subTitle', trans('firefly.change_your_password'))->with( 'mainTitleIcon', 'fa-user' ); } @@ -30,7 +31,7 @@ class ProfileController extends Controller */ public function deleteAccount() { - return view('profile.delete-account')->with('title', Auth::user()->email)->with('subTitle', 'Delete account')->with( + return view('profile.delete-account')->with('title', Auth::user()->email)->with('subTitle', trans('firefly.delete_account'))->with( 'mainTitleIcon', 'fa-user' ); } @@ -41,7 +42,7 @@ class ProfileController extends Controller */ public function index() { - return view('profile.index')->with('title', 'Profile')->with('subTitle', Auth::user()->email)->with('mainTitleIcon', 'fa-user'); + return view('profile.index')->with('title', trans('firefly.profile'))->with('subTitle', Auth::user()->email)->with('mainTitleIcon', 'fa-user'); } /** @@ -53,7 +54,7 @@ class ProfileController extends Controller { // old, new1, new2 if (!Hash::check($request->get('current_password'), Auth::user()->password)) { - Session::flash('error', 'Invalid current password!'); + Session::flash('error', trans('firefly.invalid_current_password')); return redirect(route('profile.change-password')); } @@ -68,7 +69,7 @@ class ProfileController extends Controller Auth::user()->password = $request->get('new_password'); Auth::user()->save(); - Session::flash('success', 'Password changed!'); + Session::flash('success', trans('firefly.password_changed')); return redirect(route('profile')); } @@ -83,7 +84,7 @@ class ProfileController extends Controller protected function validatePassword($old, $new1) { if ($new1 == $old) { - return 'The idea is to change your password.'; + return trans('firefly.should_change'); } return true; @@ -100,17 +101,28 @@ class ProfileController extends Controller { // old, new1, new2 if (!Hash::check($request->get('password'), Auth::user()->password)) { - Session::flash('error', 'Invalid password!'); + Session::flash('error', trans('firefly.invalid_password')); return redirect(route('profile.delete-account')); } // DELETE! + $email = Auth::user()->email; Auth::user()->delete(); Session::flush(); Session::flash('gaEventCategory', 'user'); Session::flash('gaEventAction', 'delete-account'); + // create a new user with the same email address so re-registration is blocked. + User::create( + [ + 'email' => $email, + 'password' => 'deleted', + 'blocked' => 1, + 'blocked_code' => 'deleted' + ] + ); + return redirect(route('index')); } diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.php index 1f28df89b2..cf79dd47e1 100644 --- a/app/Http/Controllers/TagController.php +++ b/app/Http/Controllers/TagController.php @@ -188,22 +188,24 @@ class TagController extends Controller /** @var Collection $tags */ $tags = Auth::user()->tags()->where('tagMode', $type)->orderBy('date', 'ASC')->get(); - $tags = $tags->sortBy( function (Tag $tag) { - return strtolower($tag->tag); + $date = $tag->date->format('Ymd'); + + return strtolower($date . $tag->tag); } ); /** @var Tag $tag */ foreach ($tags as $tag) { - $year = is_null($tag->date) ? trans('firefly.no_year') : $tag->date->year; - $month = is_null($tag->date) ? trans('firefly.no_month') : $tag->date->formatLocalized($this->monthFormat); - $collection[$type][$year][$month][] = $tag; + + $year = is_null($tag->date) ? trans('firefly.no_year') : $tag->date->year; + $monthFormatted = is_null($tag->date) ? trans('firefly.no_month') : $tag->date->formatLocalized($this->monthFormat); + + $collection[$type][$year][$monthFormatted][] = $tag; } } - return view('tags.index', compact('title', 'mainTitleIcon', 'types', 'helpHidden', 'collection')); } diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index 647602e09b..d88c7f7d3c 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; @@ -15,6 +16,7 @@ use Input; use Preferences; use Response; use Session; +use Steam; use URL; use View; @@ -43,14 +45,17 @@ class TransactionController extends Controller */ public function create(AccountRepositoryInterface $repository, $what = 'deposit') { - $accounts = ExpandedForm::makeSelectList($repository->getAccounts(['Default account', 'Asset account'])); - $budgets = ExpandedForm::makeSelectList(Auth::user()->budgets()->get()); - $budgets[0] = trans('form.noBudget'); - $piggies = ExpandedForm::makeSelectList(Auth::user()->piggyBanks()->get()); - $piggies[0] = trans('form.noPiggybank'); - $preFilled = Session::has('preFilled') ? Session::get('preFilled') : []; - $respondTo = ['account_id', 'account_from_id']; - $subTitle = trans('form.add_new_' . $what); + $maxFileSize = Steam::phpBytes(ini_get('upload_max_filesize')); + $maxPostSize = Steam::phpBytes(ini_get('post_max_size')); + $uploadSize = min($maxFileSize, $maxPostSize); + $accounts = ExpandedForm::makeSelectList($repository->getAccounts(['Default account', 'Asset account'])); + $budgets = ExpandedForm::makeSelectList(Auth::user()->budgets()->get()); + $budgets[0] = trans('form.noBudget'); + $piggies = ExpandedForm::makeSelectList(Auth::user()->piggyBanks()->get()); + $piggies[0] = trans('form.noPiggybank'); + $preFilled = Session::has('preFilled') ? Session::get('preFilled') : []; + $respondTo = ['account_id', 'account_from_id']; + $subTitle = trans('form.add_new_' . $what); foreach ($respondTo as $r) { $preFilled[$r] = Input::get($r); @@ -68,7 +73,7 @@ class TransactionController extends Controller asort($piggies); - return view('transactions.create', compact('accounts', 'budgets', 'what', 'piggies', 'subTitle')); + return view('transactions.create', compact('accounts', 'uploadSize', 'budgets', 'what', 'piggies', 'subTitle')); } /** @@ -121,14 +126,17 @@ class TransactionController extends Controller */ public function edit(AccountRepositoryInterface $repository, TransactionJournal $journal) { - $what = strtolower($journal->transactionType->type); - $accounts = ExpandedForm::makeSelectList($repository->getAccounts(['Default account', 'Asset account'])); - $budgets = ExpandedForm::makeSelectList(Auth::user()->budgets()->get()); - $budgets[0] = trans('form.noBudget'); - $piggies = ExpandedForm::makeSelectList(Auth::user()->piggyBanks()->get()); - $piggies[0] = trans('form.noPiggybank'); - $subTitle = trans('breadcrumbs.edit_journal', ['description' => $journal->description]); - $preFilled = [ + $maxFileSize = Steam::phpBytes(ini_get('upload_max_filesize')); + $maxPostSize = Steam::phpBytes(ini_get('post_max_size')); + $uploadSize = min($maxFileSize, $maxPostSize); + $what = strtolower($journal->transactionType->type); + $accounts = ExpandedForm::makeSelectList($repository->getAccounts(['Default account', 'Asset account'])); + $budgets = ExpandedForm::makeSelectList(Auth::user()->budgets()->get()); + $budgets[0] = trans('form.noBudget'); + $piggies = ExpandedForm::makeSelectList(Auth::user()->piggyBanks()->get()); + $piggies[0] = trans('form.noPiggybank'); + $subTitle = trans('breadcrumbs.edit_journal', ['description' => $journal->description]); + $preFilled = [ 'date' => $journal->date->format('Y-m-d'), 'category' => '', 'budget_id' => 0, @@ -179,7 +187,7 @@ class TransactionController extends Controller Session::forget('transactions.edit.fromUpdate'); - return view('transactions.edit', compact('journal', 'accounts', 'what', 'budgets', 'piggies', 'subTitle'))->with('data', $preFilled); + return view('transactions.edit', compact('journal', 'uploadSize', 'accounts', 'what', 'budgets', 'piggies', 'subTitle'))->with('data', $preFilled); } /** @@ -238,10 +246,11 @@ class TransactionController extends Controller */ public function show(JournalRepositoryInterface $repository, TransactionJournal $journal) { + bcscale(2); $journal->transactions->each( function (Transaction $t) use ($journal, $repository) { $t->before = $repository->getAmountBefore($journal, $t); - $t->after = $t->before + $t->amount; + $t->after = bcadd($t->before, $t->amount); } ); $what = strtolower($journal->transactionType->type); @@ -256,15 +265,33 @@ 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(); - $journal = $repository->store($journalData); + + // if not withdrawal, unset budgetid. + if ($journalData['what'] != 'withdrawal') { + $journalData['budget_id'] = 0; + } + + $journal = $repository->store($journalData); + + // save attachments: + $att->saveAttachmentsForModel($journal); + + // flash errors + if (count($att->getErrors()->get('attachments')) > 0) { + Session::flash('error', $att->getErrors()->get('attachments')); + } + // flash messages + if (count($att->getMessages()->get('attachments')) > 0) { + Session::flash('info', $att->getMessages()->get('attachments')); + } // rescan journal, UpdateJournalConnection event(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')))); } @@ -288,16 +315,29 @@ class TransactionController extends Controller /** * @param JournalFormRequest $request * @param JournalRepositoryInterface $repository + * @param AttachmentHelperInterface $att * @param TransactionJournal $journal * - * @return \Illuminate\Http\RedirectResponse + * @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector */ - public function update(JournalFormRequest $request, JournalRepositoryInterface $repository, TransactionJournal $journal) + public function update(JournalFormRequest $request, JournalRepositoryInterface $repository, AttachmentHelperInterface $att, TransactionJournal $journal) { $journalData = $request->getJournalData(); $repository->update($journal, $journalData); + // save attachments: + $att->saveAttachmentsForModel($journal); + + // flash errors + if (count($att->getErrors()->get('attachments')) > 0) { + Session::flash('error', $att->getErrors()->get('attachments')); + } + // flash messages + if (count($att->getMessages()->get('attachments')) > 0) { + Session::flash('info', $att->getMessages()->get('attachments')); + } + event(new JournalSaved($journal)); // update, get events by date and sort DESC diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index e83a32aefb..23026e7bde 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -52,6 +52,11 @@ class Authenticate return redirect()->guest('auth/login'); } } + + if (intval($this->auth->user()->blocked) == 1) { + return redirect()->route('logout'); + } + // if logged in, set user language: $pref = Preferences::get('language', 'en'); App::setLocale($pref->data); diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index f6bd70ec03..71dd254d3d 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -24,5 +24,4 @@ class VerifyCsrfToken extends BaseVerifier { return parent::handle($request, $next); } - } diff --git a/app/Http/Requests/AttachmentFormRequest.php b/app/Http/Requests/AttachmentFormRequest.php new file mode 100644 index 0000000000..50a6665591 --- /dev/null +++ b/app/Http/Requests/AttachmentFormRequest.php @@ -0,0 +1,36 @@ + 'between:1,255', + 'description' => 'between:1,65536', + 'notes' => 'between:1,65536', + ]; + } +} diff --git a/app/Http/Requests/BillFormRequest.php b/app/Http/Requests/BillFormRequest.php index 3a360f4874..341369f8b8 100644 --- a/app/Http/Requests/BillFormRequest.php +++ b/app/Http/Requests/BillFormRequest.php @@ -31,9 +31,9 @@ class BillFormRequest extends Request return [ 'name' => $this->get('name'), 'match' => $this->get('match'), - 'amount_min' => floatval($this->get('amount_min')), - 'amount_currency_id' => floatval($this->get('amount_currency_id')), - 'amount_max' => floatval($this->get('amount_max')), + 'amount_min' => round($this->get('amount_min'), 2), + 'amount_currency_id' => round($this->get('amount_currency_id'), 2), + 'amount_max' => round($this->get('amount_max'), 2), 'date' => new Carbon($this->get('date')), 'user' => Auth::user()->id, 'repeat_freq' => $this->get('repeat_freq'), diff --git a/app/Http/Requests/JournalFormRequest.php b/app/Http/Requests/JournalFormRequest.php index 3bcc2b1a75..ba7dc0dc19 100644 --- a/app/Http/Requests/JournalFormRequest.php +++ b/app/Http/Requests/JournalFormRequest.php @@ -37,7 +37,7 @@ class JournalFormRequest extends Request 'account_to_id' => intval($this->get('account_to_id')), 'expense_account' => $this->get('expense_account'), 'revenue_account' => $this->get('revenue_account'), - 'amount' => floatval($this->get('amount')), + 'amount' => round($this->get('amount'), 2), 'user' => Auth::user()->id, 'amount_currency_id' => intval($this->get('amount_currency_id')), 'date' => new Carbon($this->get('date')), diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.php index d9f64ab902..aab4f281b1 100644 --- a/app/Http/breadcrumbs.php +++ b/app/Http/breadcrumbs.php @@ -280,9 +280,16 @@ Breadcrumbs::register( } ); Breadcrumbs::register( - 'change-password', function (Generator $breadcrumbs) { + 'profile.change-password', function (Generator $breadcrumbs) { $breadcrumbs->parent('profile'); - $breadcrumbs->push(trans('breadcrumbs.changePassword'), route('change-password')); + $breadcrumbs->push(trans('breadcrumbs.changePassword'), route('profile.change-password')); + +} +); +Breadcrumbs::register( + 'profile.delete-account', function (Generator $breadcrumbs) { + $breadcrumbs->parent('profile'); + $breadcrumbs->push(trans('firefly.delete_account'), route('profile.delete-account')); } ); diff --git a/app/Http/routes.php b/app/Http/routes.php index aa6d5d0daa..17307916dc 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -1,5 +1,6 @@ where('user_id', Auth::user()->id)->first(); + if ($object) { + return $object; + } + } + + throw new NotFoundHttpException; +} +); + Route::bind( 'currency', function ($value) { if (Auth::check()) { @@ -144,6 +158,7 @@ Route::bind( * Auth\AuthController */ Route::get('/register', ['uses' => 'Auth\AuthController@getRegister', 'as' => 'register']); +Route::get('/cron/sendgrid', ['uses' => 'CronController@sendgrid']); Route::controllers( [ @@ -177,6 +192,21 @@ Route::group( Route::post('/accounts/update/{account}', ['uses' => 'AccountController@update', 'as' => 'accounts.update']); Route::post('/accounts/destroy/{account}', ['uses' => 'AccountController@destroy', 'as' => 'accounts.destroy']); + + /** + * Attachment Controller + */ + + Route::post('/attachment/update/{attachment}', ['uses' => 'AttachmentController@update', 'as' => 'attachments.update']); + Route::post('/attachment/destroy/{attachment}', ['uses' => 'AttachmentController@destroy', 'as' => 'attachments.destroy']); + + Route::get('/attachment/edit/{attachment}', ['uses' => 'AttachmentController@edit', 'as' => 'attachments.edit']); + Route::get('/attachment/delete/{attachment}', ['uses' => 'AttachmentController@delete', 'as' => 'attachments.delete']); + Route::get('/attachment/show/{attachment}', ['uses' => 'AttachmentController@show', 'as' => 'attachments.show']); + Route::get('/attachment/preview/{attachment}', ['uses' => 'AttachmentController@preview', 'as' => 'attachments.preview']); + Route::get('/attachment/download/{attachment}', ['uses' => 'AttachmentController@download', 'as' => 'attachments.download']); + + /** * Bills Controller */ diff --git a/app/Models/Account.php b/app/Models/Account.php index 71c60a5360..b3967b1da4 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -11,23 +11,23 @@ use Watson\Validating\ValidatingTrait; * Class Account * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property \Carbon\Carbon $deleted_at - * @property integer $user_id - * @property integer $account_type_id - * @property string $name - * @property boolean $active - * @property boolean $encrypted - * @property float $virtual_balance - * @property string $iban - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\AccountMeta[] $accountMeta - * @property-read \FireflyIII\Models\AccountType $accountType - * @property-read mixed $name_for_editform - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBank[] $piggyBanks - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Transaction[] $transactions - * @property-read \FireflyIII\User $user + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property \Carbon\Carbon $deleted_at + * @property integer $user_id + * @property integer $account_type_id + * @property string $name + * @property boolean $active + * @property boolean $encrypted + * @property float $virtual_balance + * @property string $iban + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\AccountMeta[] $accountMeta + * @property-read \FireflyIII\Models\AccountType $accountType + * @property-read mixed $name_for_editform + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBank[] $piggyBanks + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Transaction[] $transactions + * @property-read \FireflyIII\User $user * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Account whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Account whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Account whereUpdatedAt($value) @@ -41,13 +41,13 @@ use Watson\Validating\ValidatingTrait; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Account whereIban($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Account accountTypeIn($types) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Account hasMetaValue($name, $value) - * @property-read bool $joinedAccountTypes - * @property float $startBalance - * @property float $endBalance - * @property float $piggyBalance - * @property float $percentage - * @property float $difference - * @property \Carbon\Carbon $lastActivityDate + * @property-read bool $joinedAccountTypes + * @property float $startBalance + * @property float $endBalance + * @property float $piggyBalance + * @property float $percentage + * @property float $difference + * @property \Carbon\Carbon $lastActivityDate */ class Account extends Model { diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php index f511b64145..42c0f4837b 100644 --- a/app/Models/AccountMeta.php +++ b/app/Models/AccountMeta.php @@ -7,13 +7,13 @@ use Watson\Validating\ValidatingTrait; * Class AccountMeta * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property integer $account_id - * @property string $name - * @property string $data - * @property-read \FireflyIII\Models\Account $account + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property integer $account_id + * @property string $name + * @property string $data + * @property-read \FireflyIII\Models\Account $account * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\AccountMeta whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\AccountMeta whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\AccountMeta whereUpdatedAt($value) diff --git a/app/Models/AccountType.php b/app/Models/AccountType.php index c62827f2d6..6716a9ab69 100644 --- a/app/Models/AccountType.php +++ b/app/Models/AccountType.php @@ -6,12 +6,12 @@ use Illuminate\Database\Eloquent\Model; * Class AccountType * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property string $type - * @property boolean $editable - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Account[] $accounts + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property string $type + * @property boolean $editable + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Account[] $accounts * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\AccountType whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\AccountType whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\AccountType whereUpdatedAt($value) diff --git a/app/Models/Attachment.php b/app/Models/Attachment.php new file mode 100644 index 0000000000..63bd69586c --- /dev/null +++ b/app/Models/Attachment.php @@ -0,0 +1,190 @@ +morphTo(); + } + + /** + * @codeCoverageIgnore + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ + public function user() + { + return $this->belongsTo('FireflyIII\User'); + } + + + /** + * @codeCoverageIgnore + * + * @param $value + * + * @return null|string + */ + public function getFilenameAttribute($value) + { + if (is_null($value)) { + return null; + } + + return Crypt::decrypt($value); + } + + /** + * @param string $value + */ + public function setFilenameAttribute($value) + { + $this->attributes['filename'] = Crypt::encrypt($value); + } + + /** + * @codeCoverageIgnore + * + * @param $value + * + * @return null|string + */ + public function getMimeAttribute($value) + { + if (is_null($value)) { + return null; + } + + return Crypt::decrypt($value); + } + + /** + * @param string $value + */ + public function setMimeAttribute($value) + { + $this->attributes['mime'] = Crypt::encrypt($value); + } + + /** + * @codeCoverageIgnore + * + * @param $value + * + * @return null|string + */ + public function getTitleAttribute($value) + { + if (is_null($value)) { + return null; + } + + return Crypt::decrypt($value); + } + + /** + * @param string $value + */ + public function setTitleAttribute($value) + { + $this->attributes['title'] = Crypt::encrypt($value); + } + + /** + * @codeCoverageIgnore + * + * @param $value + * + * @return null|string + */ + public function getDescriptionAttribute($value) + { + if (is_null($value)) { + return null; + } + + return Crypt::decrypt($value); + } + + /** + * @param string $value + */ + public function setDescriptionAttribute($value) + { + $this->attributes['description'] = Crypt::encrypt($value); + } + + /** + * @codeCoverageIgnore + * + * @param $value + * + * @return null|string + */ + public function getNotesAttribute($value) + { + if (is_null($value)) { + return null; + } + + return Crypt::decrypt($value); + } + + /** + * @param string $value + */ + public function setNotesAttribute($value) + { + $this->attributes['notes'] = Crypt::encrypt($value); + } + +} diff --git a/app/Models/Bill.php b/app/Models/Bill.php index d3bd82ca78..e1196585c0 100644 --- a/app/Models/Bill.php +++ b/app/Models/Bill.php @@ -7,23 +7,23 @@ use Illuminate\Database\Eloquent\Model; * Class Bill * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property integer $user_id - * @property string $name - * @property string $match - * @property float $amount_min - * @property float $amount_max - * @property \Carbon\Carbon $date - * @property boolean $active - * @property boolean $automatch - * @property string $repeat_freq - * @property integer $skip - * @property boolean $name_encrypted - * @property boolean $match_encrypted - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionjournals - * @property-read \FireflyIII\User $user + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property integer $user_id + * @property string $name + * @property string $match + * @property float $amount_min + * @property float $amount_max + * @property \Carbon\Carbon $date + * @property boolean $active + * @property boolean $automatch + * @property string $repeat_freq + * @property integer $skip + * @property boolean $name_encrypted + * @property boolean $match_encrypted + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionjournals + * @property-read \FireflyIII\User $user * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereUpdatedAt($value) @@ -39,8 +39,8 @@ use Illuminate\Database\Eloquent\Model; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereSkip($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereNameEncrypted($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Bill whereMatchEncrypted($value) - * @property-read \Carbon\Carbon $nextExpectedMatch - * @property-read \Carbon\Carbon $lastFoundMatch + * @property-read \Carbon\Carbon $nextExpectedMatch + * @property-read \Carbon\Carbon $lastFoundMatch */ class Bill extends Model { diff --git a/app/Models/Budget.php b/app/Models/Budget.php index cea282cb95..5184b576e6 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -8,17 +8,17 @@ use Illuminate\Database\Eloquent\SoftDeletes; * Class Budget * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property \Carbon\Carbon $deleted_at - * @property string $name - * @property integer $user_id - * @property boolean $active - * @property boolean $encrypted - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\BudgetLimit[] $budgetlimits - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionjournals - * @property-read \FireflyIII\User $user + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property \Carbon\Carbon $deleted_at + * @property string $name + * @property integer $user_id + * @property boolean $active + * @property boolean $encrypted + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\BudgetLimit[] $budgetlimits + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionjournals + * @property-read \FireflyIII\User $user * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Budget whereUpdatedAt($value) diff --git a/app/Models/BudgetLimit.php b/app/Models/BudgetLimit.php index 56093bfd8d..2a4a61b64d 100644 --- a/app/Models/BudgetLimit.php +++ b/app/Models/BudgetLimit.php @@ -6,16 +6,16 @@ use Illuminate\Database\Eloquent\Model; * Class BudgetLimit * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property integer $budget_id - * @property \Carbon\Carbon $startdate - * @property float $amount - * @property boolean $repeats - * @property string $repeat_freq - * @property-read \FireflyIII\Models\Budget $budget - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\LimitRepetition[] $limitrepetitions + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property integer $budget_id + * @property \Carbon\Carbon $startdate + * @property float $amount + * @property boolean $repeats + * @property string $repeat_freq + * @property-read \FireflyIII\Models\Budget $budget + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\LimitRepetition[] $limitrepetitions * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\BudgetLimit whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\BudgetLimit whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\BudgetLimit whereUpdatedAt($value) diff --git a/app/Models/Category.php b/app/Models/Category.php index cd6d554be2..7792eba5f0 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -8,15 +8,15 @@ use Illuminate\Database\Eloquent\SoftDeletes; * Class Category * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property \Carbon\Carbon $deleted_at - * @property string $name - * @property integer $user_id - * @property boolean $encrypted - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionjournals - * @property-read \FireflyIII\User $user + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property \Carbon\Carbon $deleted_at + * @property string $name + * @property integer $user_id + * @property boolean $encrypted + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionjournals + * @property-read \FireflyIII\User $user * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereUpdatedAt($value) @@ -24,8 +24,8 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereName($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereUserId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Category whereEncrypted($value) - * @property-read float $spent - * @property-read \Carbon\Carbon $lastActivity + * @property-read float $spent + * @property-read \Carbon\Carbon $lastActivity */ class Category extends Model { diff --git a/app/Models/Component.php b/app/Models/Component.php index 29c15b922b..cd21c366b7 100644 --- a/app/Models/Component.php +++ b/app/Models/Component.php @@ -7,13 +7,13 @@ use Illuminate\Database\Eloquent\SoftDeletes; * Class Component * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property \Carbon\Carbon $deleted_at - * @property string $name - * @property integer $user_id - * @property string $class + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property \Carbon\Carbon $deleted_at + * @property string $name + * @property integer $user_id + * @property string $class * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Component whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Component whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Component whereUpdatedAt($value) diff --git a/app/Models/LimitRepetition.php b/app/Models/LimitRepetition.php index 9f4307e587..29c48ed359 100644 --- a/app/Models/LimitRepetition.php +++ b/app/Models/LimitRepetition.php @@ -6,14 +6,14 @@ use Illuminate\Database\Eloquent\Model; * Class LimitRepetition * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property integer $budget_limit_id - * @property \Carbon\Carbon $startdate - * @property \Carbon\Carbon $enddate - * @property float $amount - * @property-read \FireflyIII\Models\BudgetLimit $budgetLimit + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property integer $budget_limit_id + * @property \Carbon\Carbon $startdate + * @property \Carbon\Carbon $enddate + * @property float $amount + * @property-read \FireflyIII\Models\BudgetLimit $budgetLimit * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\LimitRepetition whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\LimitRepetition whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\LimitRepetition whereUpdatedAt($value) diff --git a/app/Models/Permission.php b/app/Models/Permission.php index 1463451a81..1b6aaeb147 100644 --- a/app/Models/Permission.php +++ b/app/Models/Permission.php @@ -8,13 +8,13 @@ use Zizaco\Entrust\EntrustPermission; * Class Permission * * @package FireflyIII\Models - * @property integer $id - * @property string $name - * @property string $display_name - * @property string $description - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property-read \Illuminate\Database\Eloquent\Collection|\Config::get('entrust.role[] $roles + * @property integer $id + * @property string $name + * @property string $display_name + * @property string $description + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property-read \Illuminate\Database\Eloquent\Collection|\Config::get('entrust.role[] $roles * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Permission whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Permission whereName($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Permission whereDisplayName($value) diff --git a/app/Models/PiggyBank.php b/app/Models/PiggyBank.php index 1b4c52983c..33f6be11c4 100644 --- a/app/Models/PiggyBank.php +++ b/app/Models/PiggyBank.php @@ -8,22 +8,22 @@ use Illuminate\Database\Eloquent\SoftDeletes; * Class PiggyBank * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property \Carbon\Carbon $deleted_at - * @property integer $account_id - * @property string $name - * @property float $targetamount - * @property \Carbon\Carbon $startdate - * @property \Carbon\Carbon $targetdate - * @property integer $order - * @property boolean $encrypted - * @property boolean $remind_me - * @property integer $reminder_skip - * @property-read \FireflyIII\Models\Account $account - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBankRepetition[] $piggyBankRepetitions - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBankEvent[] $piggyBankEvents + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property \Carbon\Carbon $deleted_at + * @property integer $account_id + * @property string $name + * @property float $targetamount + * @property \Carbon\Carbon $startdate + * @property \Carbon\Carbon $targetdate + * @property integer $order + * @property boolean $encrypted + * @property boolean $remind_me + * @property integer $reminder_skip + * @property-read \FireflyIII\Models\Account $account + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBankRepetition[] $piggyBankRepetitions + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBankEvent[] $piggyBankEvents * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereUpdatedAt($value) @@ -37,7 +37,9 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereEncrypted($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereRemindMe($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereReminderSkip($value) - * @property-read \FireflyIII\Models\PiggyBankRepetition $currentRep + * @property-read \FireflyIII\Models\PiggyBankRepetition $currentRep + * @property string $reminder + * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBank whereReminder($value) */ class PiggyBank extends Model { diff --git a/app/Models/PiggyBankEvent.php b/app/Models/PiggyBankEvent.php index 9ee5836bb9..0678ea5865 100644 --- a/app/Models/PiggyBankEvent.php +++ b/app/Models/PiggyBankEvent.php @@ -6,15 +6,15 @@ use Illuminate\Database\Eloquent\Model; * Class PiggyBankEvent * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property integer $piggy_bank_id - * @property integer $transaction_journal_id - * @property \Carbon\Carbon $date - * @property float $amount - * @property-read \FireflyIII\Models\PiggyBank $piggyBank - * @property-read \FireflyIII\Models\TransactionJournal $transactionJournal + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property integer $piggy_bank_id + * @property integer $transaction_journal_id + * @property \Carbon\Carbon $date + * @property float $amount + * @property-read \FireflyIII\Models\PiggyBank $piggyBank + * @property-read \FireflyIII\Models\TransactionJournal $transactionJournal * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBankEvent whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBankEvent whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBankEvent whereUpdatedAt($value) diff --git a/app/Models/PiggyBankRepetition.php b/app/Models/PiggyBankRepetition.php index ba6c50fb72..2c410351e4 100644 --- a/app/Models/PiggyBankRepetition.php +++ b/app/Models/PiggyBankRepetition.php @@ -8,14 +8,14 @@ use Illuminate\Database\Eloquent\Model; * Class PiggyBankRepetition * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property integer $piggy_bank_id - * @property \Carbon\Carbon $startdate - * @property \Carbon\Carbon $targetdate - * @property float $currentamount - * @property-read \FireflyIII\Models\PiggyBank $piggyBank + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property integer $piggy_bank_id + * @property \Carbon\Carbon $startdate + * @property \Carbon\Carbon $targetdate + * @property float $currentamount + * @property-read \FireflyIII\Models\PiggyBank $piggyBank * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBankRepetition whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBankRepetition whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\PiggyBankRepetition whereUpdatedAt($value) diff --git a/app/Models/Preference.php b/app/Models/Preference.php index 4f813c53a5..258216dd6f 100644 --- a/app/Models/Preference.php +++ b/app/Models/Preference.php @@ -7,15 +7,15 @@ use Illuminate\Database\Eloquent\Model; * Class Preference * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property integer $user_id - * @property string $name - * @property string $name_encrypted - * @property string $data - * @property string $data_encrypted - * @property-read \FireflyIII\User $user + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property integer $user_id + * @property string $name + * @property string $name_encrypted + * @property string $data + * @property string $data_encrypted + * @property-read \FireflyIII\User $user * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Preference whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Preference whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Preference whereUpdatedAt($value) diff --git a/app/Models/Role.php b/app/Models/Role.php index 7f7c74ff74..6cee8151d3 100644 --- a/app/Models/Role.php +++ b/app/Models/Role.php @@ -8,14 +8,14 @@ use Zizaco\Entrust\EntrustRole; * Class Role * * @package FireflyIII\Models - * @property integer $id - * @property string $name - * @property string $display_name - * @property string $description - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property-read \Illuminate\Database\Eloquent\Collection|\Config::get('auth.model[] $users - * @property-read \Illuminate\Database\Eloquent\Collection|\Config::get('entrust.permission[] $perms + * @property integer $id + * @property string $name + * @property string $display_name + * @property string $description + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property-read \Illuminate\Database\Eloquent\Collection|\Config::get('auth.model[] $users + * @property-read \Illuminate\Database\Eloquent\Collection|\Config::get('entrust.permission[] $perms * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Role whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Role whereName($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Role whereDisplayName($value) diff --git a/app/Models/Tag.php b/app/Models/Tag.php index d4c9259473..f7784212bd 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -10,20 +10,20 @@ use Watson\Validating\ValidatingTrait; * Class Tag * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property string $deleted_at - * @property integer $user_id - * @property string $tag - * @property string $tagMode - * @property \Carbon\Carbon $date - * @property string $description - * @property float $latitude - * @property float $longitude - * @property integer $zoomLevel - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionjournals - * @property-read \FireflyIII\User $user + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property string $deleted_at + * @property integer $user_id + * @property string $tag + * @property string $tagMode + * @property \Carbon\Carbon $date + * @property string $description + * @property float $latitude + * @property float $longitude + * @property integer $zoomLevel + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionjournals + * @property-read \FireflyIII\User $user * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Tag whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Tag whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Tag whereUpdatedAt($value) @@ -64,7 +64,7 @@ class Tag extends Model // everything but the tag: unset($fields['tagMode']); $search = $fields; - unset($search['name']); + unset($search['tag']); $query = Tag::orderBy('id'); foreach ($search as $name => $value) { diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index 7729db02cb..e2b799220b 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -10,16 +10,16 @@ use Watson\Validating\ValidatingTrait; * Class Transaction * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property \Carbon\Carbon $deleted_at - * @property integer $account_id - * @property integer $transaction_journal_id - * @property string $description - * @property float $amount - * @property-read \FireflyIII\Models\Account $account - * @property-read \FireflyIII\Models\TransactionJournal $transactionJournal + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property \Carbon\Carbon $deleted_at + * @property integer $account_id + * @property integer $transaction_journal_id + * @property string $description + * @property float $amount + * @property-read \FireflyIII\Models\Account $account + * @property-read \FireflyIII\Models\TransactionJournal $transactionJournal * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Transaction whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Transaction whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Transaction whereUpdatedAt($value) @@ -30,8 +30,8 @@ use Watson\Validating\ValidatingTrait; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Transaction whereAmount($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Transaction after($date) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Transaction before($date) - * @property float $before - * @property float $after + * @property float $before + * @property float $after */ class Transaction extends Model { diff --git a/app/Models/TransactionCurrency.php b/app/Models/TransactionCurrency.php index dafe776d46..8323329c99 100644 --- a/app/Models/TransactionCurrency.php +++ b/app/Models/TransactionCurrency.php @@ -7,14 +7,14 @@ use Illuminate\Database\Eloquent\SoftDeletes; * Class TransactionCurrency * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property \Carbon\Carbon $deleted_at - * @property string $code - * @property string $name - * @property string $symbol - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionJournals + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property \Carbon\Carbon $deleted_at + * @property string $code + * @property string $name + * @property string $symbol + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionJournals * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionCurrency whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionCurrency whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionCurrency whereUpdatedAt($value) diff --git a/app/Models/TransactionGroup.php b/app/Models/TransactionGroup.php index 33451a4faa..606bb59f15 100644 --- a/app/Models/TransactionGroup.php +++ b/app/Models/TransactionGroup.php @@ -7,14 +7,14 @@ use Illuminate\Database\Eloquent\SoftDeletes; * Class TransactionGroup * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property \Carbon\Carbon $deleted_at - * @property integer $user_id - * @property string $relation - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionjournals - * @property-read \FireflyIII\User $user + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property \Carbon\Carbon $deleted_at + * @property integer $user_id + * @property string $relation + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionjournals + * @property-read \FireflyIII\User $user * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionGroup whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionGroup whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionGroup whereUpdatedAt($value) diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index 48d96de99e..a2b1fc3f8b 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -13,35 +13,35 @@ use Watson\Validating\ValidatingTrait; * Class TransactionJournal * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property \Carbon\Carbon $deleted_at - * @property integer $user_id - * @property integer $transaction_type_id - * @property integer $bill_id - * @property integer $transaction_currency_id - * @property string $description - * @property boolean $completed - * @property \Carbon\Carbon $date - * @property boolean $encrypted - * @property integer $order - * @property integer $tag_count - * @property-read \FireflyIII\Models\Bill $bill - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Budget[] $budgets - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Category[] $categories - * @property-read mixed $actual_amount - * @property-read mixed $amount - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Tag[] $tags - * @property-read mixed $correct_amount - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Transaction[] $transactions - * @property-read mixed $destination_account - * @property-read mixed $source_account - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBankEvent[] $piggyBankEvents - * @property-read \FireflyIII\Models\TransactionCurrency $transactionCurrency - * @property-read \FireflyIII\Models\TransactionType $transactionType - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionGroup[] $transactiongroups - * @property-read \FireflyIII\User $user + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property \Carbon\Carbon $deleted_at + * @property integer $user_id + * @property integer $transaction_type_id + * @property integer $bill_id + * @property integer $transaction_currency_id + * @property string $description + * @property boolean $completed + * @property \Carbon\Carbon $date + * @property boolean $encrypted + * @property integer $order + * @property integer $tag_count + * @property-read \FireflyIII\Models\Bill $bill + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Budget[] $budgets + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Category[] $categories + * @property-read mixed $actual_amount + * @property-read mixed $amount + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Tag[] $tags + * @property-read mixed $correct_amount + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Transaction[] $transactions + * @property-read mixed $destination_account + * @property-read mixed $source_account + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBankEvent[] $piggyBankEvents + * @property-read \FireflyIII\Models\TransactionCurrency $transactionCurrency + * @property-read \FireflyIII\Models\TransactionType $transactionType + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionGroup[] $transactiongroups + * @property-read \FireflyIII\User $user * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionJournal whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionJournal whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionJournal whereUpdatedAt($value) @@ -62,12 +62,13 @@ use Watson\Validating\ValidatingTrait; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionJournal onDate($date) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionJournal transactionTypes($types) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionJournal withRelevantData() - * @property-read bool $account_encrypted - * @property-read bool $joinedTransactions - * @property-read bool $joinedTransactionTypes - * @property-read int $account_id - * @property-read string $name - * @property-read string $symbol + * @property-read bool $account_encrypted + * @property-read bool $joinedTransactions + * @property-read bool $joinedTransactionTypes + * @property-read int $account_id + * @property string $name + * @property-read string $symbol + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Attachment[] $attachments */ class TransactionJournal extends Model { @@ -467,6 +468,14 @@ class TransactionJournal extends Model $this->attributes['encrypted'] = true; } + /** + * @return \Illuminate\Database\Eloquent\Relations\MorphMany + */ + public function attachments() + { + return $this->morphMany('FireflyIII\Models\Attachment', 'attachable'); + } + /** * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsTo diff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.php index 60b3940a0c..3b00323459 100644 --- a/app/Models/TransactionType.php +++ b/app/Models/TransactionType.php @@ -7,12 +7,12 @@ use Illuminate\Database\Eloquent\SoftDeletes; * Class TransactionType * * @package FireflyIII\Models - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property \Carbon\Carbon $deleted_at - * @property string $type - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionJournals + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property \Carbon\Carbon $deleted_at + * @property string $type + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionJournals * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionType whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionType whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionType whereUpdatedAt($value) diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php index 5f3b310017..45e2d5bb62 100644 --- a/app/Providers/FireflyServiceProvider.php +++ b/app/Providers/FireflyServiceProvider.php @@ -88,11 +88,15 @@ class FireflyServiceProvider extends ServiceProvider $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\Repositories\Attachment\AttachmentRepositoryInterface', 'FireflyIII\Repositories\Attachment\AttachmentRepository'); $this->app->bind('FireflyIII\Support\Search\SearchInterface', 'FireflyIII\Support\Search\Search'); // 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/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index 3dd955bcfc..e0490c8178 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -128,17 +128,17 @@ class AccountRepository implements AccountRepositoryInterface if ($cache->has()) { return $cache->get(); // @codeCoverageIgnore } + $query = Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account']); - - if ($preference->data == []) { - $accounts = Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->orderBy('accounts.name', 'ASC')->get(['accounts.*']); - } else { - $accounts = Auth::user()->accounts()->whereIn('id', $preference->data)->orderBy('accounts.name', 'ASC')->get(['accounts.*']); + if (count($preference->data) > 0) { + $query->whereIn('accounts.id', $preference->data); } - $cache->store($accounts); + $result = $query->get(['accounts.*']); - return $accounts; + $cache->store($result); + + return $result; } /** @@ -207,23 +207,6 @@ class AccountRepository implements AccountRepositoryInterface } - /** - * @param Account $account - * - * @return Carbon|null - */ - public function getLastActivity(Account $account) - { - $lastTransaction = $account->transactions()->leftJoin( - 'transaction_journals', 'transactions.transaction_journal_id', '=', 'transaction_journals.id' - )->orderBy('transaction_journals.date', 'DESC')->first(['transactions.account_id', 'transaction_journals.date']); - if ($lastTransaction) { - return $lastTransaction->date; - } - - return null; - } - /** * Get the accounts of a user that have piggy banks connected to them. * @@ -253,6 +236,7 @@ class AccountRepository implements AccountRepositoryInterface if (count($ids) > 0) { $accounts = Auth::user()->accounts()->whereIn('id', $ids)->get(); } + bcscale(2); $accounts->each( function (Account $account) use ($start, $end) { @@ -266,7 +250,7 @@ class AccountRepository implements AccountRepositoryInterface // sum of piggy bank amounts on this account: // diff between endBalance and piggyBalance. // then, percentage. - $difference = $account->endBalance - $account->piggyBalance; + $difference = bcsub($account->endBalance, $account->piggyBalance); $account->difference = $difference; $account->percentage = $difference != 0 && $account->endBalance != 0 ? round((($difference / $account->endBalance) * 100)) : 100; @@ -294,13 +278,15 @@ class AccountRepository implements AccountRepositoryInterface $start = clone Session::get('start', new Carbon); $end = clone Session::get('end', new Carbon); + bcscale(2); + $accounts->each( function (Account $account) use ($start, $end) { $account->startBalance = Steam::balance($account, $start); $account->endBalance = Steam::balance($account, $end); // diff (negative when lost, positive when gained) - $diff = $account->endBalance - $account->startBalance; + $diff = bcsub($account->endBalance, $account->startBalance); if ($diff < 0 && $account->startBalance > 0) { // percentage lost compared to start. @@ -429,11 +415,11 @@ class AccountRepository implements AccountRepositoryInterface } /** - * @return float + * @return string */ public function sumOfEverything() { - return floatval(Auth::user()->transactions()->sum('amount')); + return Auth::user()->transactions()->sum('amount'); } /** @@ -562,10 +548,8 @@ class AccountRepository implements AccountRepositoryInterface */ protected function storeInitialBalance(Account $account, Account $opposing, array $data) { - $type = $data['openingBalance'] < 0 ? 'Withdrawal' : 'Deposit'; - $transactionType = TransactionType::whereType($type)->first(); - - $journal = new TransactionJournal( + $transactionType = TransactionType::whereType('Opening balance')->first(); + $journal = TransactionJournal::create( [ 'user_id' => $data['user'], 'transaction_type_id' => $transactionType->id, @@ -577,7 +561,6 @@ class AccountRepository implements AccountRepositoryInterface 'encrypted' => true ] ); - $journal->save(); if ($data['openingBalance'] < 0) { $firstAccount = $opposing; @@ -590,6 +573,7 @@ class AccountRepository implements AccountRepositoryInterface $firstAmount = $data['openingBalance']; $secondAmount = $data['openingBalance'] * -1; } + $one = new Transaction(['account_id' => $firstAccount->id, 'transaction_journal_id' => $journal->id, 'amount' => $firstAmount]); $one->save();// first transaction: from diff --git a/app/Repositories/Account/AccountRepositoryInterface.php b/app/Repositories/Account/AccountRepositoryInterface.php index a9a393c0c4..86dcb2e616 100644 --- a/app/Repositories/Account/AccountRepositoryInterface.php +++ b/app/Repositories/Account/AccountRepositoryInterface.php @@ -96,14 +96,7 @@ interface AccountRepositoryInterface public function getJournals(Account $account, $page); /** - * @param Account $account - * - * @return Carbon|null - */ - public function getLastActivity(Account $account); - - /** - * @return float + * @return string */ public function sumOfEverything(); diff --git a/app/Repositories/Attachment/AttachmentRepository.php b/app/Repositories/Attachment/AttachmentRepository.php new file mode 100644 index 0000000000..13f7f8f0a0 --- /dev/null +++ b/app/Repositories/Attachment/AttachmentRepository.php @@ -0,0 +1,47 @@ +getAttachmentLocation($attachment); + unlink($file); + $attachment->delete(); + } + + /** + * @param Attachment $attachment + * @param array $data + * + * @return Attachment + */ + public function update(Attachment $attachment, array $data) + { + + $attachment->title = $data['title']; + $attachment->description = $data['description']; + $attachment->notes = $data['notes']; + $attachment->save(); + + return $attachment; + + } +} diff --git a/app/Repositories/Attachment/AttachmentRepositoryInterface.php b/app/Repositories/Attachment/AttachmentRepositoryInterface.php new file mode 100644 index 0000000000..44ae352b15 --- /dev/null +++ b/app/Repositories/Attachment/AttachmentRepositoryInterface.php @@ -0,0 +1,30 @@ +transactionjournals()->transactionTypes(['Withdrawal'])->onDate($date)->get(['transaction_journals.*'])->sum('amount')); + bcscale(2); + $sum = $budget->transactionjournals()->transactionTypes(['Withdrawal'])->onDate($date)->get(['transaction_journals.*'])->sum('amount'); - return $sum * -1; + return bcmul($sum, -1); } /** @@ -247,7 +248,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn ->first(['limit_repetitions.*']); if ($repetition) { - return floatval($repetition->amount); + return $repetition->amount; } return null; @@ -299,7 +300,9 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn ->transactionTypes(['Withdrawal']) ->get(['transaction_journals.*'])->sum('amount'); - return floatval($noBudgetSet) * -1; + bcscale(2); + + return bcmul($noBudgetSet, -1); } /** diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index 0cd96d8038..3686fbc581 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -89,7 +89,7 @@ class CategoryRepository extends ComponentRepository implements CategoryReposito $name = $isEncrypted ? Crypt::decrypt($name) : $name; $result[$categoryId] = [ 'name' => $name, - 'sum' => floatval($entry->amount), + 'sum' => $entry->amount, ]; } @@ -194,11 +194,11 @@ class CategoryRepository extends ComponentRepository implements CategoryReposito * @param Category $category * @param Carbon $date * - * @return float + * @return string */ public function spentOnDaySumCorrected(Category $category, Carbon $date) { - return floatval($category->transactionjournals()->onDate($date)->get(['transaction_journals.*'])->sum('amount')); + return $category->transactionjournals()->onDate($date)->get(['transaction_journals.*'])->sum('amount'); } /** diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php index ab71355313..eebbbf205a 100644 --- a/app/Repositories/Journal/JournalRepository.php +++ b/app/Repositories/Journal/JournalRepository.php @@ -252,13 +252,13 @@ class JournalRepository implements JournalRepositoryInterface // update the from and to transaction. /** @var Transaction $transaction */ foreach ($journal->transactions()->get() as $transaction) { - if (floatval($transaction->amount) < 0) { + if ($transaction->amount < 0) { // this is the from transaction, negative amount: $transaction->amount = $data['amount'] * -1; $transaction->account_id = $fromAccount->id; $transaction->save(); } - if (floatval($transaction->amount) > 0) { + if ($transaction->amount > 0) { $transaction->amount = $data['amount']; $transaction->account_id = $toAccount->id; $transaction->save(); diff --git a/app/Repositories/PiggyBank/PiggybankPart.php b/app/Repositories/PiggyBank/PiggybankPart.php index 79341dffd8..79090311fe 100644 --- a/app/Repositories/PiggyBank/PiggybankPart.php +++ b/app/Repositories/PiggyBank/PiggybankPart.php @@ -82,10 +82,11 @@ class PiggyBankPart */ public function percentage() { + bcscale(2); if ($this->getCurrentamount() < $this->getCumulativeAmount()) { $pct = 0; // calculate halfway point? - if ($this->getCumulativeAmount() - $this->getCurrentamount() < $this->getAmountPerBar()) { + if (bcsub($this->getCumulativeAmount(), $this->getCurrentamount()) < $this->getAmountPerBar()) { $left = $this->getCurrentamount() % $this->getAmountPerBar(); $pct = round($left / $this->getAmountPerBar() * 100); } diff --git a/app/Support/Amount.php b/app/Support/Amount.php index fb8d93db45..611bdcd101 100644 --- a/app/Support/Amount.php +++ b/app/Support/Amount.php @@ -64,16 +64,16 @@ class Amount if ($coloured === true) { if ($amount === 0.0) { - return '' . $symbol . ' ' . $string . ''; + return '' . $symbol . ' ' . $string . ''; } if ($amount > 0) { - return '' . $symbol . ' ' . $string . ''; + return '' . $symbol . ' ' . $string . ''; } - return '' . $symbol . ' ' . $string . ''; + return '' . $symbol . ' ' . $string . ''; } - return $symbol . ' ' . $string; + return $symbol . ' ' . $string; } /** diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php index dd68cfd198..59e3db0fb5 100644 --- a/app/Support/ExpandedForm.php +++ b/app/Support/ExpandedForm.php @@ -20,6 +20,25 @@ use Session; class ExpandedForm { + /** + * @param $name + * @param null $value + * @param array $options + * + * @return string + */ + public function staticText($name, $value, array $options = []) + { + $label = $this->label($name, $options); + $options = $this->expandOptionArray($name, $label, $options); + $classes = $this->getHolderClasses($name); + $value = $this->fillFieldValue($name, $value); + $html = view('form.static', compact('classes', 'name', 'label', 'value', 'options'))->render(); + + return $html; + + } + /** * @param $name * @param null $value diff --git a/app/Support/Steam.php b/app/Support/Steam.php index f5f8e3f61f..2a5d64d07c 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -2,6 +2,7 @@ namespace FireflyIII\Support; +use Auth; use Carbon\Carbon; use DB; use FireflyIII\Models\Account; @@ -14,6 +15,28 @@ use FireflyIII\Models\Transaction; */ class Steam { + + /** + * @param array $accounts + * + * @return array + */ + public function getLastActivities(array $accounts) + { + $list = []; + + $set = Auth::user()->transactions() + ->whereIn('account_id', $accounts) + ->groupBy('account_id') + ->get(['transactions.account_id', DB::Raw('MAX(`transaction_journals`.`date`) as `max_date`')]); + + foreach ($set as $entry) { + $list[intval($entry->account_id)] = new Carbon($entry->max_date); + } + + return $list; + } + /** * * @param \FireflyIII\Models\Account $account @@ -90,4 +113,33 @@ class Steam return $result; } + // parse PHP size: + /** + * @param $string + * + * @return int + */ + public function phpBytes($string) + { + $string = strtolower($string); + + if (!(strpos($string, 'k') === false)) { + // has a K in it, remove the K and multiply by 1024. + $bytes = bcmul(rtrim($string, 'k'), 1024); + + return intval($bytes); + } + + if (!(strpos($string, 'm') === false)) { + // has a M in it, remove the M and multiply by 1048576. + $bytes = bcmul(rtrim($string, 'm'), 1048576); + + return intval($bytes); + } + + return $string; + + + } + } diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index b42350a579..bf2a1c725a 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -35,7 +35,9 @@ class General extends Twig_Extension $this->formatAmountPlain(), $this->formatJournal(), $this->balance(), - $this->getAccountRole() + $this->getAccountRole(), + $this->formatFilesize(), + $this->mimeIcon(), ]; } @@ -66,6 +68,50 @@ class General extends Twig_Extension return 'FireflyIII\Support\Twig\General'; } + /** + * @return Twig_SimpleFilter + */ + protected function formatFilesize() + { + return new Twig_SimpleFilter( + 'filesize', function ($size) { + $size = intval($size); + + // less than one GB, more than one MB + if ($size < (1024 * 1024 * 2014) && $size >= (1024 * 1024)) { + return round($size / (1024 * 1024), 2) . ' MB'; + } + + // less than one MB + if ($size < (1024 * 1024)) { + return round($size / 1024, 2) . ' KB'; + } + + return $size . ' bytes'; + } + ); + } + + /** + * @return Twig_SimpleFilter + */ + protected function mimeIcon() + { + return new Twig_SimpleFilter( + 'mimeIcon', function ($string) { + switch ($string) { + default: + return 'fa-file-o'; + case 'application/pdf': + return 'fa-file-pdf-o'; + case 'image/png': + case 'image/jpeg': + return 'fa-file-image-o'; + } + }, ['is_safe' => ['html']] + ); + } + /** * @return Twig_SimpleFilter */ diff --git a/app/User.php b/app/User.php index e46ad621e0..2fd0ae8fdf 100644 --- a/app/User.php +++ b/app/User.php @@ -11,21 +11,21 @@ use Zizaco\Entrust\Traits\EntrustUserTrait; * Class User * * @package FireflyIII - * @property integer $id - * @property \Carbon\Carbon $created_at - * @property \Carbon\Carbon $updated_at - * @property string $email - * @property string $password - * @property string $reset - * @property string $remember_token - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Account[] $accounts - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Tag[] $tags - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Bill[] $bills - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Budget[] $budgets - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Category[] $categories - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Preference[] $preferences - * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionjournals - * @property-read \Illuminate\Database\Eloquent\Collection|\Config::get('entrust.role[] $roles + * @property integer $id + * @property \Carbon\Carbon $created_at + * @property \Carbon\Carbon $updated_at + * @property string $email + * @property string $password + * @property string $reset + * @property string $remember_token + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Account[] $accounts + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Tag[] $tags + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Bill[] $bills + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Budget[] $budgets + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Category[] $categories + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Preference[] $preferences + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\TransactionJournal[] $transactionjournals + * @property-read \Illuminate\Database\Eloquent\Collection|\Config::get('entrust.role[] $roles * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereId($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereUpdatedAt($value) @@ -33,6 +33,11 @@ use Zizaco\Entrust\Traits\EntrustUserTrait; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User wherePassword($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereReset($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereRememberToken($value) + * @property boolean $blocked + * @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Attachment[] $attachments + * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereBlocked($value) + * @property string $blocked_code + * @method static \Illuminate\Database\Query\Builder|\FireflyIII\User whereBlockedCode($value) */ class User extends Model implements AuthenticatableContract, CanResetPasswordContract { @@ -44,7 +49,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon * * @var array */ - protected $fillable = ['email', 'password']; + protected $fillable = ['email', 'password', 'blocked', 'blocked_code']; /** * The attributes excluded from the model's JSON form. * @@ -66,6 +71,14 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon return $this->hasMany('FireflyIII\Models\Account'); } + /** + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function attachments() + { + return $this->hasMany('FireflyIII\Models\Attachment'); + } + /** * @return \Illuminate\Database\Eloquent\Relations\HasMany */ diff --git a/composer.json b/composer.json index d3fb277a16..76cbe45f22 100644 --- a/composer.json +++ b/composer.json @@ -30,18 +30,12 @@ "rcrowe/twigbridge": "0.7.x@dev", "zizaco/entrust": "dev-laravel-5", "codeception/codeception": "*", - "league/csv": "^7.1" + "league/csv": "^7.1", + "nesbot/carbon": "^1.20" }, "require-dev": { "barryvdh/laravel-debugbar": "@stable", - "barryvdh/laravel-ide-helper": "~2.0", - "phpunit/phpunit": "~4.0", - "phpspec/phpspec": "~2.1", - "satooshi/php-coveralls": "0.6.1", - "mockery/mockery": "0.9.*", - "league/factory-muffin": "~2.1", - "codeclimate/php-test-reporter": "^0.1.2", - "fzaninotto/faker": "^1.4" + "barryvdh/laravel-ide-helper": "~2.0" }, "autoload": { "classmap": [ diff --git a/composer.lock b/composer.lock index b343a0188d..3f0c144b82 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "16409d4004d305517bea330fcc6591a6", + "hash": "ba6c2069135e1a6dc2b677523e8366f3", "packages": [ { "name": "classpreloader/classpreloader", @@ -62,22 +62,22 @@ }, { "name": "codeception/codeception", - "version": "2.1.0", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "b5af3aac061ffaeb65ed023534b3c50558e90d07" + "reference": "6c22380326421947fba0d6116c13a5c24d214adb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/b5af3aac061ffaeb65ed023534b3c50558e90d07", - "reference": "b5af3aac061ffaeb65ed023534b3c50558e90d07", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/6c22380326421947fba0d6116c13a5c24d214adb", + "reference": "6c22380326421947fba0d6116c13a5c24d214adb", "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", - "facebook/webdriver": "~0.4|~0.5", + "facebook/webdriver": "~1.0", "guzzlehttp/guzzle": ">=4.0|<7.0", "guzzlehttp/psr7": "~1.0", "php": ">=5.4.0", @@ -110,9 +110,7 @@ ], "type": "library", "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } + "branch-alias": [] }, "autoload": { "psr-4": { @@ -140,20 +138,20 @@ "functional testing", "unit testing" ], - "time": "2015-06-30 03:38:01" + "time": "2015-07-14 11:24:17" }, { "name": "danielstjules/stringy", - "version": "1.9.0", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/danielstjules/Stringy.git", - "reference": "3cf18e9e424a6dedc38b7eb7ef580edb0929461b" + "reference": "4749c205db47ee5b32e8d1adf6d9aff8db6caf3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/danielstjules/Stringy/zipball/3cf18e9e424a6dedc38b7eb7ef580edb0929461b", - "reference": "3cf18e9e424a6dedc38b7eb7ef580edb0929461b", + "url": "https://api.github.com/repos/danielstjules/Stringy/zipball/4749c205db47ee5b32e8d1adf6d9aff8db6caf3b", + "reference": "4749c205db47ee5b32e8d1adf6d9aff8db6caf3b", "shasum": "" }, "require": { @@ -196,7 +194,7 @@ "utility", "utils" ], - "time": "2015-02-10 06:19:18" + "time": "2015-07-23 00:54:12" }, { "name": "davejamesmiller/laravel-breadcrumbs", @@ -805,36 +803,38 @@ }, { "name": "facebook/webdriver", - "version": "v0.6.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/facebook/php-webdriver.git", - "reference": "2c5b305ea91b00ebbc433ad1663b7f16c1b31ec5" + "reference": "8eb1952d6be0725e1064c4fe0630d0d4d1de7639" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/2c5b305ea91b00ebbc433ad1663b7f16c1b31ec5", - "reference": "2c5b305ea91b00ebbc433ad1663b7f16c1b31ec5", + "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/8eb1952d6be0725e1064c4fe0630d0d4d1de7639", + "reference": "8eb1952d6be0725e1064c4fe0630d0d4d1de7639", "shasum": "" }, "require": { "php": ">=5.3.19" }, "require-dev": { - "phpdocumentor/phpdocumentor": "2.*", - "phpunit/phpunit": "3.7.*" + "phpunit/phpunit": "4.6.*" + }, + "suggest": { + "phpdocumentor/phpdocumentor": "2.*" }, "type": "library", "autoload": { - "classmap": [ - "lib/" - ] + "psr-4": { + "Facebook\\WebDriver\\": "lib/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], - "description": "A php client for WebDriver", + "description": "A PHP client for WebDriver", "homepage": "https://github.com/facebook/php-webdriver", "keywords": [ "facebook", @@ -842,7 +842,7 @@ "selenium", "webdriver" ], - "time": "2015-02-09 19:39:34" + "time": "2015-07-16 19:31:12" }, { "name": "grumpydictator/gchart", @@ -1244,16 +1244,16 @@ }, { "name": "laravel/framework", - "version": "v5.1.7", + "version": "v5.1.8", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "5e942882319845f71c681ce6e85831129bf66426" + "reference": "c4ce8d7a3ac6e655e8b5f0ff3ee07d24fab765ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/5e942882319845f71c681ce6e85831129bf66426", - "reference": "5e942882319845f71c681ce6e85831129bf66426", + "url": "https://api.github.com/repos/laravel/framework/zipball/c4ce8d7a3ac6e655e8b5f0ff3ee07d24fab765ba", + "reference": "c4ce8d7a3ac6e655e8b5f0ff3ee07d24fab765ba", "shasum": "" }, "require": { @@ -1368,7 +1368,7 @@ "framework", "laravel" ], - "time": "2015-07-12 02:27:36" + "time": "2015-07-21 18:33:13" }, { "name": "league/commonmark", @@ -1488,16 +1488,16 @@ }, { "name": "league/flysystem", - "version": "1.0.7", + "version": "1.0.10", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "b58431785768abbb4f00c10e66a065095a0693ef" + "reference": "3475ce0b1b5cab41f012905c4c58ad645088f7c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/b58431785768abbb4f00c10e66a065095a0693ef", - "reference": "b58431785768abbb4f00c10e66a065095a0693ef", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3475ce0b1b5cab41f012905c4c58ad645088f7c9", + "reference": "3475ce0b1b5cab41f012905c4c58ad645088f7c9", "shasum": "" }, "require": { @@ -1565,7 +1565,7 @@ "sftp", "storage" ], - "time": "2015-07-11 14:58:06" + "time": "2015-07-21 19:35:53" }, { "name": "monolog/monolog", @@ -1736,16 +1736,16 @@ }, { "name": "nikic/php-parser", - "version": "v1.3.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "dff239267fd1befa1cd40430c9ed12591aa720ca" + "reference": "196f177cfefa0f1f7166c0a05d8255889be12418" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dff239267fd1befa1cd40430c9ed12591aa720ca", - "reference": "dff239267fd1befa1cd40430c9ed12591aa720ca", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/196f177cfefa0f1f7166c0a05d8255889be12418", + "reference": "196f177cfefa0f1f7166c0a05d8255889be12418", "shasum": "" }, "require": { @@ -1755,7 +1755,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -1777,7 +1777,7 @@ "parser", "php" ], - "time": "2015-05-02 15:40:40" + "time": "2015-07-14 17:31:05" }, { "name": "phpdocumentor/reflection-docblock", @@ -1890,16 +1890,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "2.1.7", + "version": "2.1.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "07e27765596d72c378a6103e80da5d84e802f1e4" + "reference": "5bd48b86cd282da411bb80baac1398ce3fefac41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/07e27765596d72c378a6103e80da5d84e802f1e4", - "reference": "07e27765596d72c378a6103e80da5d84e802f1e4", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5bd48b86cd282da411bb80baac1398ce3fefac41", + "reference": "5bd48b86cd282da411bb80baac1398ce3fefac41", "shasum": "" }, "require": { @@ -1948,20 +1948,20 @@ "testing", "xunit" ], - "time": "2015-06-30 06:52:35" + "time": "2015-07-26 12:54:47" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb" + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a923bb15680d0089e2316f7a4af8f437046e96bb", - "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", "shasum": "" }, "require": { @@ -1995,7 +1995,7 @@ "filesystem", "iterator" ], - "time": "2015-04-02 05:19:05" + "time": "2015-06-21 13:08:43" }, { "name": "phpunit/php-text-template", @@ -2040,16 +2040,16 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.6", + "version": "1.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "83fe1bdc5d47658b727595c14da140da92b3d66d" + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/83fe1bdc5d47658b727595c14da140da92b3d66d", - "reference": "83fe1bdc5d47658b727595c14da140da92b3d66d", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", "shasum": "" }, "require": { @@ -2077,7 +2077,7 @@ "keywords": [ "timer" ], - "time": "2015-06-13 07:35:30" + "time": "2015-06-21 08:01:12" }, { "name": "phpunit/php-token-stream", @@ -2130,16 +2130,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.7.6", + "version": "4.7.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0ebabb4cda7d066be8391dfdbaf57fe70ac9a99b" + "reference": "9b97f9d807b862c2de2a36e86690000801c85724" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0ebabb4cda7d066be8391dfdbaf57fe70ac9a99b", - "reference": "0ebabb4cda7d066be8391dfdbaf57fe70ac9a99b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9b97f9d807b862c2de2a36e86690000801c85724", + "reference": "9b97f9d807b862c2de2a36e86690000801c85724", "shasum": "" }, "require": { @@ -2198,26 +2198,27 @@ "testing", "xunit" ], - "time": "2015-06-30 06:53:57" + "time": "2015-07-13 11:28:34" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.5", + "version": "2.3.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "1c330b1b6e1ea8fd15f2fbea46770576e366855c" + "reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/1c330b1b6e1ea8fd15f2fbea46770576e366855c", - "reference": "1c330b1b6e1ea8fd15f2fbea46770576e366855c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/18dfbcb81d05e2296c0bcddd4db96cade75e6f42", + "reference": "18dfbcb81d05e2296c0bcddd4db96cade75e6f42", "shasum": "" }, "require": { "doctrine/instantiator": "~1.0,>=1.0.2", "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2" + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" }, "require-dev": { "phpunit/phpunit": "~4.4" @@ -2253,7 +2254,7 @@ "mock", "xunit" ], - "time": "2015-07-04 05:41:32" + "time": "2015-07-10 06:54:24" }, { "name": "psr/http-message", @@ -2344,16 +2345,16 @@ }, { "name": "psy/psysh", - "version": "v0.5.1", + "version": "v0.5.2", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "e5a46a767928e85f1f47dda654beda8c680ddd94" + "reference": "aaf8772ade08b5f0f6830774a5d5c2f800415975" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/e5a46a767928e85f1f47dda654beda8c680ddd94", - "reference": "e5a46a767928e85f1f47dda654beda8c680ddd94", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/aaf8772ade08b5f0f6830774a5d5c2f800415975", + "reference": "aaf8772ade08b5f0f6830774a5d5c2f800415975", "shasum": "" }, "require": { @@ -2412,7 +2413,7 @@ "interactive", "shell" ], - "time": "2015-07-03 16:48:00" + "time": "2015-07-16 15:26:57" }, { "name": "rcrowe/twigbridge", @@ -2480,16 +2481,16 @@ }, { "name": "sebastian/comparator", - "version": "1.1.1", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1dd8869519a225f7f2b9eb663e225298fade819e" + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e", - "reference": "1dd8869519a225f7f2b9eb663e225298fade819e", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", "shasum": "" }, "require": { @@ -2503,7 +2504,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -2540,7 +2541,7 @@ "compare", "equality" ], - "time": "2015-01-29 16:28:08" + "time": "2015-07-26 15:48:44" }, { "name": "sebastian/diff", @@ -2596,16 +2597,16 @@ }, { "name": "sebastian/environment", - "version": "1.2.2", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e" + "reference": "4fe0a44cddd8cc19583a024bdc7374eb2fef0b87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5a8c7d31914337b69923db26c4221b81ff5a196e", - "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4fe0a44cddd8cc19583a024bdc7374eb2fef0b87", + "reference": "4fe0a44cddd8cc19583a024bdc7374eb2fef0b87", "shasum": "" }, "require": { @@ -2642,20 +2643,20 @@ "environment", "hhvm" ], - "time": "2015-01-01 10:01:08" + "time": "2015-07-26 06:42:57" }, { "name": "sebastian/exporter", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "84839970d05254c73cde183a721c7af13aede943" + "reference": "7ae5513327cb536431847bcc0c10edba2701064e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943", - "reference": "84839970d05254c73cde183a721c7af13aede943", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", + "reference": "7ae5513327cb536431847bcc0c10edba2701064e", "shasum": "" }, "require": { @@ -2708,7 +2709,7 @@ "export", "exporter" ], - "time": "2015-01-27 07:23:06" + "time": "2015-06-21 07:55:53" }, { "name": "sebastian/global-state", @@ -2763,16 +2764,16 @@ }, { "name": "sebastian/recursion-context", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252" + "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", + "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", "shasum": "" }, "require": { @@ -2812,7 +2813,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-01-24 09:48:32" + "time": "2015-06-21 08:04:50" }, { "name": "sebastian/version", @@ -2904,16 +2905,16 @@ }, { "name": "symfony/browser-kit", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/BrowserKit.git", - "reference": "d0a144a1a96d5dc90bed2814b2096a1322761672" + "reference": "176905d3d74c2f99e6ab70f4f5a89460532495ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/d0a144a1a96d5dc90bed2814b2096a1322761672", - "reference": "d0a144a1a96d5dc90bed2814b2096a1322761672", + "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/176905d3d74c2f99e6ab70f4f5a89460532495ae", + "reference": "176905d3d74c2f99e6ab70f4f5a89460532495ae", "shasum": "" }, "require": { @@ -2955,20 +2956,20 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2015-06-04 20:11:48" + "time": "2015-07-09 16:07:40" }, { "name": "symfony/console", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "564398bc1f33faf92fc2ec86859983d30eb81806" + "reference": "8cf484449130cabfd98dcb4694ca9945802a21ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/564398bc1f33faf92fc2ec86859983d30eb81806", - "reference": "564398bc1f33faf92fc2ec86859983d30eb81806", + "url": "https://api.github.com/repos/symfony/Console/zipball/8cf484449130cabfd98dcb4694ca9945802a21ed", + "reference": "8cf484449130cabfd98dcb4694ca9945802a21ed", "shasum": "" }, "require": { @@ -3012,11 +3013,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2015-06-10 15:30:22" + "time": "2015-07-09 16:07:40" }, { "name": "symfony/css-selector", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/CssSelector.git", @@ -3069,16 +3070,16 @@ }, { "name": "symfony/debug", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/Debug.git", - "reference": "075070230c5bbc65abde8241191655bbce0716e2" + "reference": "9daa1bf9f7e615fa2fba30357e479a90141222e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Debug/zipball/075070230c5bbc65abde8241191655bbce0716e2", - "reference": "075070230c5bbc65abde8241191655bbce0716e2", + "url": "https://api.github.com/repos/symfony/Debug/zipball/9daa1bf9f7e615fa2fba30357e479a90141222e3", + "reference": "9daa1bf9f7e615fa2fba30357e479a90141222e3", "shasum": "" }, "require": { @@ -3125,20 +3126,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2015-06-08 09:37:21" + "time": "2015-07-09 16:07:40" }, { "name": "symfony/dom-crawler", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/DomCrawler.git", - "reference": "11d8eb8ccc1533f4c2d89a025f674894fda520b3" + "reference": "9dabece63182e95c42b06967a0d929a5df78bc35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/11d8eb8ccc1533f4c2d89a025f674894fda520b3", - "reference": "11d8eb8ccc1533f4c2d89a025f674894fda520b3", + "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/9dabece63182e95c42b06967a0d929a5df78bc35", + "reference": "9dabece63182e95c42b06967a0d929a5df78bc35", "shasum": "" }, "require": { @@ -3178,20 +3179,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2015-05-22 14:54:25" + "time": "2015-07-09 16:07:40" }, { "name": "symfony/event-dispatcher", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "be3c5ff8d503c46768aeb78ce6333051aa6f26d9" + "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/be3c5ff8d503c46768aeb78ce6333051aa6f26d9", - "reference": "be3c5ff8d503c46768aeb78ce6333051aa6f26d9", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", + "reference": "9310b5f9a87ec2ea75d20fec0b0017c77c66dac3", "shasum": "" }, "require": { @@ -3236,20 +3237,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2015-06-08 09:37:21" + "time": "2015-06-18 19:21:56" }, { "name": "symfony/finder", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/Finder.git", - "reference": "c13a40d638aeede1e8400f8c956c7f9246c05f75" + "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/c13a40d638aeede1e8400f8c956c7f9246c05f75", - "reference": "c13a40d638aeede1e8400f8c956c7f9246c05f75", + "url": "https://api.github.com/repos/symfony/Finder/zipball/ae0f363277485094edc04c9f3cbe595b183b78e4", + "reference": "ae0f363277485094edc04c9f3cbe595b183b78e4", "shasum": "" }, "require": { @@ -3285,20 +3286,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2015-06-04 20:11:48" + "time": "2015-07-09 16:07:40" }, { "name": "symfony/http-foundation", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/HttpFoundation.git", - "reference": "4f363c426b0ced57e3d14460022feb63937980ff" + "reference": "88903c0531b90d4ecd90282b18f08c0c77bde0b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/4f363c426b0ced57e3d14460022feb63937980ff", - "reference": "4f363c426b0ced57e3d14460022feb63937980ff", + "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/88903c0531b90d4ecd90282b18f08c0c77bde0b2", + "reference": "88903c0531b90d4ecd90282b18f08c0c77bde0b2", "shasum": "" }, "require": { @@ -3338,20 +3339,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2015-06-10 15:30:22" + "time": "2015-07-09 16:07:40" }, { "name": "symfony/http-kernel", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/HttpKernel.git", - "reference": "208101c7a11e31933183bd2a380486e528c74302" + "reference": "4a8a6f2a847475b3a38da50363a07f69b5cbf37e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/208101c7a11e31933183bd2a380486e528c74302", - "reference": "208101c7a11e31933183bd2a380486e528c74302", + "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/4a8a6f2a847475b3a38da50363a07f69b5cbf37e", + "reference": "4a8a6f2a847475b3a38da50363a07f69b5cbf37e", "shasum": "" }, "require": { @@ -3418,20 +3419,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2015-06-11 21:15:28" + "time": "2015-07-13 19:27:49" }, { "name": "symfony/process", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/Process.git", - "reference": "552d8efdc80980cbcca50b28d626ac8e36e3cdd1" + "reference": "48aeb0e48600321c272955132d7606ab0a49adb3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/552d8efdc80980cbcca50b28d626ac8e36e3cdd1", - "reference": "552d8efdc80980cbcca50b28d626ac8e36e3cdd1", + "url": "https://api.github.com/repos/symfony/Process/zipball/48aeb0e48600321c272955132d7606ab0a49adb3", + "reference": "48aeb0e48600321c272955132d7606ab0a49adb3", "shasum": "" }, "require": { @@ -3467,20 +3468,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2015-06-08 09:37:21" + "time": "2015-07-01 11:25:50" }, { "name": "symfony/routing", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/Routing.git", - "reference": "5581be29185b8fb802398904555f70da62f6d50d" + "reference": "ea9134f277162b02e5f80ac058b75a77637b0d26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Routing/zipball/5581be29185b8fb802398904555f70da62f6d50d", - "reference": "5581be29185b8fb802398904555f70da62f6d50d", + "url": "https://api.github.com/repos/symfony/Routing/zipball/ea9134f277162b02e5f80ac058b75a77637b0d26", + "reference": "ea9134f277162b02e5f80ac058b75a77637b0d26", "shasum": "" }, "require": { @@ -3538,20 +3539,20 @@ "uri", "url" ], - "time": "2015-06-11 17:20:40" + "time": "2015-07-09 16:07:40" }, { "name": "symfony/translation", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/Translation.git", - "reference": "8349a2b0d11bd0311df9e8914408080912983a0b" + "reference": "c8dc34cc936152c609cdd722af317e4239d10dd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Translation/zipball/8349a2b0d11bd0311df9e8914408080912983a0b", - "reference": "8349a2b0d11bd0311df9e8914408080912983a0b", + "url": "https://api.github.com/repos/symfony/Translation/zipball/c8dc34cc936152c609cdd722af317e4239d10dd6", + "reference": "c8dc34cc936152c609cdd722af317e4239d10dd6", "shasum": "" }, "require": { @@ -3599,20 +3600,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2015-06-11 17:26:34" + "time": "2015-07-09 16:07:40" }, { "name": "symfony/var-dumper", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "c509921f260353bf07b257f84017777c8b0aa4bc" + "reference": "fde603d9f4b2418ff0f0315b93eb039c9aa41205" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/c509921f260353bf07b257f84017777c8b0aa4bc", - "reference": "c509921f260353bf07b257f84017777c8b0aa4bc", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/fde603d9f4b2418ff0f0315b93eb039c9aa41205", + "reference": "fde603d9f4b2418ff0f0315b93eb039c9aa41205", "shasum": "" }, "require": { @@ -3658,20 +3659,20 @@ "debug", "dump" ], - "time": "2015-06-08 09:37:21" + "time": "2015-07-01 12:07:40" }, { "name": "symfony/yaml", - "version": "v2.7.1", + "version": "v2.7.2", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160" + "reference": "4bfbe0ed3909bfddd75b70c094391ec1f142f860" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/9808e75c609a14f6db02f70fccf4ca4aab53c160", - "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/4bfbe0ed3909bfddd75b70c094391ec1f142f860", + "reference": "4bfbe0ed3909bfddd75b70c094391ec1f142f860", "shasum": "" }, "require": { @@ -3707,7 +3708,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-06-10 15:30:22" + "time": "2015-07-01 11:25:50" }, { "name": "twig/twig", @@ -3935,7 +3936,231 @@ "time": "2015-07-09 16:32:53" } ], - "packages-dev": null, + "packages-dev": [ + { + "name": "barryvdh/laravel-debugbar", + "version": "v2.0.5", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/laravel-debugbar.git", + "reference": "753106cd1f9c724d05bb48728bc652231174e279" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/753106cd1f9c724d05bb48728bc652231174e279", + "reference": "753106cd1f9c724d05bb48728bc652231174e279", + "shasum": "" + }, + "require": { + "illuminate/support": "~5.0.17|5.1.*", + "maximebf/debugbar": "~1.10.2", + "php": ">=5.4.0", + "symfony/finder": "~2.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Barryvdh\\Debugbar\\": "src/" + }, + "files": [ + "src/helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "PHP Debugbar integration for Laravel", + "keywords": [ + "debug", + "debugbar", + "laravel", + "profiler", + "webprofiler" + ], + "time": "2015-07-09 14:51:59" + }, + { + "name": "barryvdh/laravel-ide-helper", + "version": "v2.0.6", + "source": { + "type": "git", + "url": "https://github.com/barryvdh/laravel-ide-helper.git", + "reference": "037386153630a7515a1542f29410d8c267651689" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/037386153630a7515a1542f29410d8c267651689", + "reference": "037386153630a7515a1542f29410d8c267651689", + "shasum": "" + }, + "require": { + "illuminate/console": "5.0.x|5.1.x", + "illuminate/filesystem": "5.0.x|5.1.x", + "illuminate/support": "5.0.x|5.1.x", + "php": ">=5.4.0", + "phpdocumentor/reflection-docblock": "2.0.4", + "symfony/class-loader": "~2.3" + }, + "require-dev": { + "doctrine/dbal": "~2.3" + }, + "suggest": { + "doctrine/dbal": "Load information from the database about models for phpdocs (~2.3)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Barryvdh\\LaravelIdeHelper\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Barry vd. Heuvel", + "email": "barryvdh@gmail.com" + } + ], + "description": "Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.", + "keywords": [ + "autocomplete", + "codeintel", + "helper", + "ide", + "laravel", + "netbeans", + "phpdoc", + "phpstorm", + "sublime" + ], + "time": "2015-06-25 08:58:59" + }, + { + "name": "maximebf/debugbar", + "version": "v1.10.4", + "source": { + "type": "git", + "url": "https://github.com/maximebf/php-debugbar.git", + "reference": "7b2006e6e095126b5a061ec33fca3d90ea8a8219" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/7b2006e6e095126b5a061ec33fca3d90ea8a8219", + "reference": "7b2006e6e095126b5a061ec33fca3d90ea8a8219", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0", + "symfony/var-dumper": "~2.6" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "kriswallsmith/assetic": "The best way to manage assets", + "monolog/monolog": "Log using Monolog", + "predis/predis": "Redis storage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-0": { + "DebugBar": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Maxime Bouroumeau-Fuseau", + "email": "maxime.bouroumeau@gmail.com", + "homepage": "http://maximebf.com" + } + ], + "description": "Debug bar in the browser for php application", + "homepage": "https://github.com/maximebf/php-debugbar", + "keywords": [ + "debug" + ], + "time": "2015-02-05 07:51:20" + }, + { + "name": "symfony/class-loader", + "version": "v2.7.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/ClassLoader.git", + "reference": "2fccbc544997340808801a7410cdcb96dd12edc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/2fccbc544997340808801a7410cdcb96dd12edc4", + "reference": "2fccbc544997340808801a7410cdcb96dd12edc4", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/finder": "~2.0,>=2.0.5", + "symfony/phpunit-bridge": "~2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\ClassLoader\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony ClassLoader Component", + "homepage": "https://symfony.com", + "time": "2015-06-25 12:52:11" + } + ], "aliases": [], "minimum-stability": "stable", "stability-flags": { diff --git a/config/app.php b/config/app.php index c23a78eb01..1ab4e1f26d 100644 --- a/config/app.php +++ b/config/app.php @@ -147,8 +147,8 @@ return [ * Application Service Providers... */ 'FireflyIII\Providers\AppServiceProvider', - //'FireflyIII\Providers\BusServiceProvider', - //'FireflyIII\Providers\ConfigServiceProvider', + 'FireflyIII\Providers\BusServiceProvider', + 'FireflyIII\Providers\ConfigServiceProvider', 'FireflyIII\Providers\EventServiceProvider', 'FireflyIII\Providers\RouteServiceProvider', 'FireflyIII\Providers\FireflyServiceProvider', diff --git a/config/firefly.php b/config/firefly.php index a2733e3ef5..20d51d6d8f 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -2,10 +2,12 @@ return [ 'chart' => 'chartjs', - 'version' => '3.4.9', + 'version' => '3.4.10', 'index_periods' => ['1D', '1W', '1M', '3M', '6M', '1Y', 'custom'], 'budget_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'], 'csv_import_enabled' => true, + 'maxUploadSize' => 5242880, + 'allowedMimes' => ['image/png', 'image/jpeg', 'application/pdf'], 'piggy_bank_periods' => [ 'week' => 'Week', 'month' => 'Month', diff --git a/config/twigbridge.php b/config/twigbridge.php index dd60091875..04826b5504 100644 --- a/config/twigbridge.php +++ b/config/twigbridge.php @@ -145,12 +145,12 @@ return [ 'ExpandedForm' => [ 'is_safe' => [ 'date', 'text', 'select', 'balance', 'optionsList', 'checkbox', 'amount', 'tags', 'integer', 'textarea', 'location', - 'multiRadio','file','multiCheckbox' + 'multiRadio', 'file', 'multiCheckbox', 'staticText' ] ], 'Form' => [ 'is_safe' => [ - 'input', 'select', 'checkbox', 'model', 'open', 'radio', 'textarea','file' + 'input', 'select', 'checkbox', 'model', 'open', 'radio', 'textarea', 'file' ] ], ], diff --git a/database/migrations/2015_07_14_204645_changes_for_v349.php b/database/migrations/2015_07_14_204645_changes_for_v349.php index 2cd99ab8c4..3f2538c339 100644 --- a/database/migrations/2015_07_14_204645_changes_for_v349.php +++ b/database/migrations/2015_07_14_204645_changes_for_v349.php @@ -8,6 +8,16 @@ use Illuminate\Database\Schema\Blueprint; */ class ChangesForV349 extends Migration { + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } + /** * Run the migrations. * @@ -22,14 +32,4 @@ class ChangesForV349 extends Migration } ); } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - // - } } diff --git a/database/migrations/2015_07_17_190438_changes_for_v3410.php b/database/migrations/2015_07_17_190438_changes_for_v3410.php new file mode 100644 index 0000000000..c8e64213d9 --- /dev/null +++ b/database/migrations/2015_07_17_190438_changes_for_v3410.php @@ -0,0 +1,56 @@ +increments('id'); + $table->timestamps(); + $table->softDeletes(); + $table->integer('attachable_id')->unsigned(); + $table->string('attachable_type'); + $table->integer('user_id')->unsigned(); + $table->string('md5', 32); + $table->text('filename'); + $table->text('title')->nullable(); + $table->text('description')->nullable(); + $table->text('notes')->nullable(); + $table->text('mime'); + $table->integer('size')->unsigned(); + $table->tinyInteger('uploaded', false, true)->default(0); + + } + ); + + // add "blocked_code" to users: + Schema::table( + 'users', function (Blueprint $table) { + $table->string('blocked_code', 25)->nullable(); + } + ); + } +} diff --git a/database/seeds/PermissionSeeder.php b/database/seeds/PermissionSeeder.php index 877ebc865a..c6ef9688f3 100644 --- a/database/seeds/PermissionSeeder.php +++ b/database/seeds/PermissionSeeder.php @@ -18,4 +18,4 @@ class PermissionSeeder extends Seeder } -} \ No newline at end of file +} diff --git a/database/seeds/TestDataSeeder.php b/database/seeds/TestDataSeeder.php index caf79cdd90..1e583acc44 100644 --- a/database/seeds/TestDataSeeder.php +++ b/database/seeds/TestDataSeeder.php @@ -68,6 +68,9 @@ class TestDataSeeder extends Seeder // pay daily groceries: $this->createGroceries($current); + // create tag (each type of tag, for date): + $this->createTags($current); + // go out for drinks: $this->createDrinksAndOthers($current); @@ -84,6 +87,23 @@ class TestDataSeeder extends Seeder } + /** + * @param Carbon $date + */ + protected function createTags(Carbon $date) + { + Tag::create( + [ + 'user_id' => $this->user->id, + 'tag' => 'SomeTag' . $date->month . '.' . $date->year . '.nothing', + 'tagMode' => 'nothing', + 'date' => $date->format('Y-m-d'), + + + ] + ); + } + /** * */ @@ -267,7 +287,7 @@ class TestDataSeeder extends Seeder 'startdate' => '2015-04-01', 'reminder_skip' => 0, 'remind_me' => 0, - 'order' => 1, + 'order' => 2, ] ); $repetition = $phone->piggyBankRepetitions()->first(); @@ -305,7 +325,7 @@ class TestDataSeeder extends Seeder 'startdate' => '2015-04-01', 'reminder_skip' => 0, 'remind_me' => 0, - 'order' => 1, + 'order' => 3, ] ); $repetition = $couch->piggyBankRepetitions()->first(); @@ -334,6 +354,20 @@ class TestDataSeeder extends Seeder 'amount' => '40' ] ); + + // empty one. + PiggyBank::create( + [ + 'account_id' => $account->id, + 'name' => 'New head set', + 'targetamount' => 500, + 'startdate' => '2015-04-01', + 'reminder_skip' => 0, + 'remind_me' => 0, + 'order' => 4, + ] + ); + } /** @@ -363,7 +397,11 @@ class TestDataSeeder extends Seeder */ protected function createIncome($description, Carbon $date, $amount) { - $date = new Carbon($date->format('Y-m') . '-23'); // paid on 23rd. + $date = new Carbon($date->format('Y-m') . '-23'); // paid on 23rd. + $today = new Carbon; + if ($date >= $today) { + return null; + } $toAccount = $this->findAccount('MyBank Checking Account'); $fromAccount = $this->findAccount('Job'); $category = Category::firstOrCreateEncrypted(['name' => 'Salary', 'user_id' => $this->user->id]); @@ -596,6 +634,7 @@ class TestDataSeeder extends Seeder { $start = clone $date; $end = clone $date; + $today = new Carbon; $start->startOfMonth(); $end->endOfMonth(); @@ -605,7 +644,7 @@ class TestDataSeeder extends Seeder $budget = Budget::firstOrCreateEncrypted(['name' => 'Groceries', 'user_id' => $this->user->id]); $current = clone $start; - while ($current < $end) { + while ($current < $end && $current < $today) { // daily groceries: $amount = rand(1000, 2500) / 100; $toAccount = $this->findAccount($stores[rand(0, count($stores) - 1)]); @@ -651,10 +690,11 @@ class TestDataSeeder extends Seeder { $start = clone $date; $end = clone $date; + $today = new Carbon; $start->startOfMonth(); $end->endOfMonth(); $current = clone $start; - while ($current < $end) { + while ($current < $end && $current < $today) { // weekly drink: $thisDate = clone $current; diff --git a/public/css/firefly.css b/public/css/firefly.css index 81b3942858..147bcec4f0 100644 --- a/public/css/firefly.css +++ b/public/css/firefly.css @@ -11,3 +11,9 @@ margin: 0; padding: 0; } + +/* fix login box */ +.login-box {width:600px;} +.login-logo {width:360px;margin-left:110px;} +.login-box-body {width:360px;margin-left:110px;} +.register-box-body {width:360px;margin-left:110px;} \ No newline at end of file diff --git a/public/images/image.png b/public/images/image.png new file mode 100755 index 0000000000..fc3c393caa Binary files /dev/null and b/public/images/image.png differ diff --git a/public/images/page_green.png b/public/images/page_green.png new file mode 100755 index 0000000000..de8e003f9f Binary files /dev/null and b/public/images/page_green.png differ diff --git a/public/images/page_white_acrobat.png b/public/images/page_white_acrobat.png new file mode 100755 index 0000000000..8f8095e46f Binary files /dev/null and b/public/images/page_white_acrobat.png differ diff --git a/public/index.php b/public/index.php index 6ee13c9258..94d706ee68 100644 --- a/public/index.php +++ b/public/index.php @@ -18,16 +18,7 @@ | */ -/** - * Adding c3.php for code coverage during codeception tests - * ref: https://github.com/Codeception/c3 - */ -if (file_exists(__DIR__ . '/../c3.php')) { - require __DIR__ . '/../c3.php'; -} - -require __DIR__.'/../bootstrap/autoload.php'; - +require __DIR__ . '/../bootstrap/autoload.php'; /* @@ -42,7 +33,7 @@ require __DIR__.'/../bootstrap/autoload.php'; | */ -$app = require_once __DIR__.'/../bootstrap/app.php'; +$app = require_once __DIR__ . '/../bootstrap/app.php'; /* |-------------------------------------------------------------------------- @@ -59,11 +50,10 @@ $app = require_once __DIR__.'/../bootstrap/app.php'; $kernel = $app->make('Illuminate\Contracts\Http\Kernel'); $response = $kernel->handle( - $request = Illuminate\Http\Request::capture() + $request = Illuminate\Http\Request::capture() ); $response->send(); - $kernel->terminate($request, $response); diff --git a/resources/lang/en/firefly.php b/resources/lang/en/firefly.php index ee92227d21..26a67e6de9 100644 --- a/resources/lang/en/firefly.php +++ b/resources/lang/en/firefly.php @@ -18,12 +18,70 @@ return [ 'showEverything' => 'Show everything', 'never' => 'Never', 'search_results_for' => 'Search results for ":query"', + 'bounced_error' => 'The message sent to :email bounced, so no access for you.', + 'deleted_error' => 'These credentials do not match our records.', + 'removed_amount' => 'Removed :amount', + 'added_amount' => 'Added :amount', + 'asset_account_role_help' => 'Any extra options resulting from your choice can be set later.', + + // tags + 'store_new_tag' => 'Store new tag', + 'update_tag' => 'Update tag', + 'no_location_set' => 'No location set.', + 'meta_data' => 'Meta data', + 'edit_tag' => 'Edit tag', + 'delete_tag' => 'Delete tag', + 'location' => 'Location', + + // preferences + 'pref_home_screen_accounts' => 'Home screen accounts', + 'pref_home_screen_accounts_help' => 'Which accounts should be displayed on the home page?', + 'pref_budget_settings' => 'Budget settings', + 'pref_budget_settings_help' => 'What\'s the maximum amount of money a budget envelope may contain?', + 'pref_view_range' => 'View range', + 'pref_view_range_help' => 'Some charts are automatically grouped in periods. What period would you prefer?', + 'pref_1D' => 'One day', + 'pref_1W' => 'One week', + 'pref_1M' => 'One month', + 'pref_3M' => 'Three months (quarter)', + 'pref_6M' => 'Six months', + 'pref_languages' => 'Languages', + 'pref_languages_help' => 'Firefly III supports several languages. Which one do you prefer?', + 'pref_save_settings' => 'Save settings', + + // profile: + 'change_your_password' => 'Change your password', + 'delete_account' => 'Delete account', + 'current_password' => 'Current password', + 'new_password' => 'New password', + 'new_password_again' => 'New password (again)', + 'delete_your_account' => 'Delete your account', + 'delete_your_account_help' => 'Deleting your account will also delete any accounts, transactions, anything you might have saved' . + ' into Firefly III. It\'ll be GONE.', + 'delete_your_account_password' => 'Enter your password to continue.', + 'password' => 'Password', + 'are_you_sure' => 'Are you sure? You cannot undo this.', + 'delete_account_button' => 'DELETE your account', + 'invalid_current_password' => 'Invalid current password!', + 'password_changed' => 'Password changed!', + 'should_change' => 'The idea is to change your password.', + 'invalid_password' => 'Invalid password!', + + + // attachments + 'nr_of_attachments' => 'One attachment|:count attachments', + 'attachments' => 'Attachments', + 'edit_attachment' => 'Edit attachment ":name"', + 'update_attachment' => 'Update attachment', + 'delete_attachment' => 'Delete attachment ":name"', + 'attachment_deleted' => 'Deleted attachment ":name"', + 'upload_max_file_size' => 'Maximum file size: :size', // tour: - 'prev' => 'Prev', - 'next' => 'Next', - 'end-tour' => 'End tour', - 'pause' => 'Pause', + 'prev' => 'Prev', + 'next' => 'Next', + 'end-tour' => 'End tour', + 'pause' => 'Pause', // transaction index 'title_expenses' => 'Expenses', @@ -40,24 +98,23 @@ return [ 'csv_define_column_roles' => 'Define column roles', 'csv_map_values' => 'Map found values to existing values', 'csv_download_config' => 'Download CSV configuration file.', - 'csv_index_text' => - 'This form allows you to import a CSV file with transactions into Firefly. It is based on the excellent CSV importer made by' . - ' the folks at Atlassian. Simply upload your CSV file and follow the instructions.' . - ' If you would like to learn more, please click on the button at the top of this page.', + 'csv_index_text' => 'This form allows you to import a CSV file with transactions into Firefly. It is based on the excellent CSV' . + ' importer made by the folks at Atlassian. Simply upload your CSV' . + ' file and follow the instructions. If you would like to learn more, please click on the button at the top of this page.', 'csv_index_beta_warning' => 'This tool is very much in beta. Please proceed with caution', 'csv_header_help' => 'Check this box when your CSV file\'s first row consists of column names, not actual data', - 'csv_date_help' => 'Date time format in your CSV. Follow the format like this' . - ' page indicates. The default value will parse dates that look like this: ' . date('Ymd'), + 'csv_date_help' => 'Date time format in your CSV. Follow the format like this page ' . + 'indicates. The default value will parse dates that look like this: ' . date('Ymd'), 'csv_csv_file_help' => 'Select the CSV file here. You can only upload one file at a time', 'csv_csv_config_file_help' => 'Select your CSV import configuration here. If you do not know what this is, ignore it. It will be explained later.', 'csv_upload_button' => 'Start importing CSV', 'csv_column_roles_title' => 'Define column roles', - 'csv_column_roles_text' => - 'Firefly does not know what each column means. You need to indicate what every column is. Please check out the example ' - . 'data if you\'re not sure yourself. Click on the question mark (top right of the page) to learn what' - . ' each column means. If you want to map imported data onto existing data in Firefly, use the checkbox. ' - . 'The next step will show you what this button does.', + 'csv_column_roles_text' => 'Firefly does not know what each column means. You need to indicate what every column is. ' . + 'Please check out the example data if you\'re not sure yourself. Click on the question mark ' . + '(top right of the page) to learn what each column means. If you want to map imported data ' . + 'onto existing data in Firefly, use the checkbox. The next step will show you what this button does.', 'csv_column_roles_table' => 'Column roles', 'csv_column' => 'CSV column', 'cvs_column_name' => 'CSV column name', @@ -67,15 +124,15 @@ return [ 'csv_continue' => 'Continue to the next step', 'csv_go_back' => 'Go back to the previous step', 'csv_map_title' => 'Map found values to existing values', - 'csv_map_text' => - 'This page allows you to map the values from the CSV file to existing entries in your database. This ensures that accounts and other' - . ' things won\'t be created twice.', + 'csv_map_text' => 'This page allows you to map the values from the CSV file to existing entries in your ' . + 'database. This ensures that accounts and other things won\'t be created twice.', 'cvs_field_value' => 'Field value from CSV', 'csv_field_mapped_to' => 'Must be mapped to...', + 'csv_do_not_map' => 'Do not map this value', 'csv_download_config_title' => 'Download CSV configuration', 'csv_download_config_text' => 'Everything you\'ve just set up can be downloaded as a configuration file. Click the button to do so.', - 'csv_more_information_text' => 'If the import fails, you can use this configuration file so you don\'t have to start all over again.' - . ' But, if the import succeeds, it will be easier to upload similar CSV files.', + 'csv_more_information_text' => 'If the import fails, you can use this configuration file so you don\'t have to start all ' . + 'over again. But, if the import succeeds, it will be easier to upload similar CSV files.', 'csv_do_download_config' => 'Download configuration file.', 'csv_empty_description' => '(empty description)', 'csv_upload_form' => 'CSV upload form', @@ -91,9 +148,7 @@ return [ 'csv_process_new_entries' => 'Firefly has created :imported new transaction(s).', 'csv_start_over' => 'Import again', 'csv_to_index' => 'Back home', - 'csv_do_not_map' => 'Do not map this value', 'csv_upload_not_writeable' => 'Cannot write to the path mentioned here. Cannot upload', - 'csv_column__ignore' => '(ignore this column)', 'csv_column_account-iban' => 'Asset account (IBAN)', 'csv_column_account-id' => 'Asset account ID (matching Firefly)', @@ -123,8 +178,8 @@ return [ 'csv_column_tags-space' => 'Tags (space separated)', 'csv_specifix_RabobankDescription' => 'Select this when you\'re importing Rabobank CSV export files.', 'csv_specifix_Dummy' => 'Checking this has no effect whatsoever.', - 'csv_import_account_help' => 'If your CSV file does NOT contain information about your asset account(s), use this dropdown to select to which' . - ' account the transactions in the CSV belong to.', + 'csv_import_account_help' => 'If your CSV file does NOT contain information about your asset account(s), use this dropdown to select to which' + . ' account the transactions in the CSV belong to.', // create new stuff: @@ -137,9 +192,12 @@ return [ 'create_new_piggy_bank' => 'Create new piggy bank', 'create_new_bill' => 'Create new bill', + // currencies: 'create_currency' => 'Create a new currency', 'edit_currency' => 'Edit currency ":name"', + 'store_currency' => 'Store new currency', + 'update_currency' => 'Update currency', // new user: 'submit' => 'Submit', @@ -167,10 +225,13 @@ return [ 'delete_budget' => 'Delete budget ":name"', 'edit_budget' => 'Edit budget ":name"', 'update_amount' => 'Update amount', + 'update_budget' => 'Update budget', // bills: 'delete_bill' => 'Delete bill ":name"', 'edit_bill' => 'Edit bill ":name"', + 'update_bill' => 'Update bill', + 'store_new_bill' => 'Store new bill', // accounts: 'details_for_asset' => 'Details for asset account ":name"', @@ -222,6 +283,7 @@ return [ 'no_category' => '(no category)', 'category' => 'Category', 'delete_category' => 'Delete category ":name"', + 'store_category' => 'Store new category', // transactions: 'update_withdrawal' => 'Update withdrawal', @@ -299,6 +361,7 @@ return [ 'quarterly' => 'Quarterly', 'half-year' => 'Every six months', 'yearly' => 'Yearly', + 'profile' => 'Profile', // reports: 'reportForYear' => 'Yearly report for :year', @@ -361,7 +424,7 @@ return [ // piggy banks: 'piggy_bank' => 'Piggy bank', 'new_piggy_bank' => 'Create new piggy bank', - 'create_new_piggybank' => 'Create new piggy bank', + 'store_piggy_bank' => 'Store new piggy bank', 'account_status' => 'Account status', 'left_for_piggy_banks' => 'Left for piggy banks', 'sum_of_piggy_banks' => 'Sum of piggy banks', @@ -397,6 +460,17 @@ return [ 'tag_title_nothing' => 'Default tags', 'tag_title_balancingAct' => 'Balancing act tags', 'tag_title_advancePayment' => 'Advance payment tags', - + 'tags_introduction' => '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' => '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. ', + 'tags_start' => 'Create a tag to get started or enter tags when creating new transactions.', ]; diff --git a/resources/lang/en/form.php b/resources/lang/en/form.php index 935ce49bfb..37a0df20a1 100644 --- a/resources/lang/en/form.php +++ b/resources/lang/en/form.php @@ -51,8 +51,8 @@ return [ 'date_format' => 'Date format', 'csv_config' => 'CSV import configuration', 'specifix' => 'Bank- or file specific fixes', - 'csv_import_account' => 'Default import account', - + 'csv_import_account' => 'Default import account', + 'attachments[]' => 'Attachments', 'store_new_withdrawal' => 'Store new withdrawal', 'store_new_deposit' => 'Store new deposit', 'store_new_transfer' => 'Store new transfer', @@ -61,6 +61,12 @@ return [ 'add_new_transfer' => 'Add a new transfer', 'noPiggybank' => '(no piggy bank)', 'noBudget' => '(no budget)', + 'title' => 'Title', + 'notes' => 'Notes', + 'filename' => 'File name', + 'mime' => 'Mime type', + 'size' => 'Size', + 'delete_account' => 'Delete account ":name"', 'delete_bill' => 'Delete bill ":name"', @@ -69,7 +75,9 @@ return [ 'delete_currency' => 'Delete currency ":name"', 'delete_piggyBank' => 'Delete piggy bank ":name"', 'delete_journal' => 'Delete transaction with description ":description"', + 'delete_attachment' => 'Delete attachment ":name"', + 'attachment_areYouSure' => 'Are you sure you want to delete the attachment named ":name"?', 'account_areYouSure' => 'Are you sure you want to delete the account named ":name"?', 'bill_areYouSure' => 'Are you sure you want to delete the bill named ":name"?', 'budget_areYouSure' => 'Are you sure you want to delete the budget named ":name"?', @@ -77,6 +85,7 @@ return [ 'currency_areYouSure' => 'Are you sure you want to delete the currency named ":name"?', 'piggyBank_areYouSure' => 'Are you sure you want to delete the piggy bank named ":name"?', 'journal_areYouSure' => 'Are you sure you want to delete the transaction described ":description"?', + 'tag_areYouSure' => 'Are you sure you want to delete the tag ":tag"?', 'permDeleteWarning' => 'Deleting stuff from Firely is permanent and cannot be undone.', 'also_delete_transactions' => 'The only transaction connected to this account will be deleted as well.' . @@ -89,4 +98,6 @@ return [ '|All :count transactions connected to this budget will spared deletion.', 'category_keep_transactions' => 'The only transaction connected to this category will not be deleted.' . '|All :count transactions connected to this category will spared deletion.', + 'tag_keep_transactions' => 'The only transaction connected to this tag will not be deleted.' . + '|All :count transactions connected to this tag will spared deletion.', ]; diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index e2dae604a2..9aede79f7d 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -13,69 +13,73 @@ return [ | */ - "accepted" => "The :attribute must be accepted.", - "active_url" => "The :attribute is not a valid URL.", - "after" => "The :attribute must be a date after :date.", - "alpha" => "The :attribute may only contain letters.", - "alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.", - "alpha_num" => "The :attribute may only contain letters and numbers.", - "array" => "The :attribute must be an array.", - "unique_for_user" => "There already is an entry with this :attribute.", - "before" => "The :attribute must be a date before :date.", - 'unique_object_for_user' => 'This name is already in use', + 'file_already_attached' => 'Uploaded file ":name" is already attached to this object.', + 'file_attached' => 'Succesfully uploaded file ":name".', + 'file_invalid_mime' => 'File ":name" is of type ":mime" which is not accepted as a new upload.', + 'file_too_large' => 'File ":name" is too large.', + "accepted" => "The :attribute must be accepted.", + "active_url" => "The :attribute is not a valid URL.", + "after" => "The :attribute must be a date after :date.", + "alpha" => "The :attribute may only contain letters.", + "alpha_dash" => "The :attribute may only contain letters, numbers, and dashes.", + "alpha_num" => "The :attribute may only contain letters and numbers.", + "array" => "The :attribute must be an array.", + "unique_for_user" => "There already is an entry with this :attribute.", + "before" => "The :attribute must be a date before :date.", + 'unique_object_for_user' => 'This name is already in use', 'unique_account_for_user' => 'This account name is already in use', - "between" => [ + "between" => [ "numeric" => "The :attribute must be between :min and :max.", "file" => "The :attribute must be between :min and :max kilobytes.", "string" => "The :attribute must be between :min and :max characters.", "array" => "The :attribute must have between :min and :max items.", ], - "boolean" => "The :attribute field must be true or false.", - "confirmed" => "The :attribute confirmation does not match.", - "date" => "The :attribute is not a valid date.", - "date_format" => "The :attribute does not match the format :format.", - "different" => "The :attribute and :other must be different.", - "digits" => "The :attribute must be :digits digits.", - "digits_between" => "The :attribute must be between :min and :max digits.", - "email" => "The :attribute must be a valid email address.", - "filled" => "The :attribute field is required.", - "exists" => "The selected :attribute is invalid.", - "image" => "The :attribute must be an image.", - "in" => "The selected :attribute is invalid.", - "integer" => "The :attribute must be an integer.", - "ip" => "The :attribute must be a valid IP address.", - "max" => [ + "boolean" => "The :attribute field must be true or false.", + "confirmed" => "The :attribute confirmation does not match.", + "date" => "The :attribute is not a valid date.", + "date_format" => "The :attribute does not match the format :format.", + "different" => "The :attribute and :other must be different.", + "digits" => "The :attribute must be :digits digits.", + "digits_between" => "The :attribute must be between :min and :max digits.", + "email" => "The :attribute must be a valid email address.", + "filled" => "The :attribute field is required.", + "exists" => "The selected :attribute is invalid.", + "image" => "The :attribute must be an image.", + "in" => "The selected :attribute is invalid.", + "integer" => "The :attribute must be an integer.", + "ip" => "The :attribute must be a valid IP address.", + "max" => [ "numeric" => "The :attribute may not be greater than :max.", "file" => "The :attribute may not be greater than :max kilobytes.", "string" => "The :attribute may not be greater than :max characters.", "array" => "The :attribute may not have more than :max items.", ], - "mimes" => "The :attribute must be a file of type: :values.", - "min" => [ + "mimes" => "The :attribute must be a file of type: :values.", + "min" => [ "numeric" => "The :attribute must be at least :min.", "file" => "The :attribute must be at least :min kilobytes.", "string" => "The :attribute must be at least :min characters.", "array" => "The :attribute must have at least :min items.", ], - "not_in" => "The selected :attribute is invalid.", - "numeric" => "The :attribute must be a number.", - "regex" => "The :attribute format is invalid.", - "required" => "The :attribute field is required.", - "required_if" => "The :attribute field is required when :other is :value.", - "required_with" => "The :attribute field is required when :values is present.", - "required_with_all" => "The :attribute field is required when :values is present.", - "required_without" => "The :attribute field is required when :values is not present.", - "required_without_all" => "The :attribute field is required when none of :values are present.", - "same" => "The :attribute and :other must match.", - "size" => [ + "not_in" => "The selected :attribute is invalid.", + "numeric" => "The :attribute must be a number.", + "regex" => "The :attribute format is invalid.", + "required" => "The :attribute field is required.", + "required_if" => "The :attribute field is required when :other is :value.", + "required_with" => "The :attribute field is required when :values is present.", + "required_with_all" => "The :attribute field is required when :values is present.", + "required_without" => "The :attribute field is required when :values is not present.", + "required_without_all" => "The :attribute field is required when none of :values are present.", + "same" => "The :attribute and :other must match.", + "size" => [ "numeric" => "The :attribute must be :size.", "file" => "The :attribute must be :size kilobytes.", "string" => "The :attribute must be :size characters.", "array" => "The :attribute must contain :size items.", ], - "unique" => "The :attribute has already been taken.", - "url" => "The :attribute format is invalid.", - "timezone" => "The :attribute must be a valid zone.", + "unique" => "The :attribute has already been taken.", + "url" => "The :attribute format is invalid.", + "timezone" => "The :attribute must be a valid zone.", /* |-------------------------------------------------------------------------- @@ -88,7 +92,7 @@ return [ | */ - 'custom' => [ + 'custom' => [ 'attribute-name' => [ 'rule-name' => 'custom-message', ], @@ -105,6 +109,6 @@ return [ | */ - 'attributes' => [], + 'attributes' => [], ]; diff --git a/resources/lang/nl/firefly.php b/resources/lang/nl/firefly.php index c8ddd776f1..82f115da14 100644 --- a/resources/lang/nl/firefly.php +++ b/resources/lang/nl/firefly.php @@ -18,6 +18,61 @@ return [ 'showEverything' => 'Laat alles zien', 'never' => 'Nooit', 'search_results_for' => 'Zoekresultaten voor ":query"', + 'bounced_error' => 'Het emailtje naar :email kwam nooit aan.', + 'deleted_error' => 'These credentials do not match our records.', + 'removed_amount' => ':amount weggehaald', + 'added_amount' => ':amount toegevoegd', + 'asset_account_role_help' => 'Voorkeuren die voortkomen uit je keuze hier kan je later aangeven.', + + // tags + 'store_new_tag' => 'Sla tag op', + 'update_tag' => 'Sla wijzigingen op', + 'no_location_set' => 'Zonder plaats', + 'location' => 'Plaats', + 'meta_data' => 'Metagegevens', + + // preferences + 'pref_home_screen_accounts' => 'Voorpaginarekeningen', + 'pref_home_screen_accounts_help' => 'Welke betaalrekeningen wil je op de voorpagina zien?', + 'pref_budget_settings' => 'Budgetinstellingen', + 'pref_budget_settings_help' => 'Wat is het maximale bedrag dat je voor een budget kan instellen?', + 'pref_view_range' => 'Bereik', + 'pref_view_range_help' => 'Sommige pagina\'s springen naar een standaard bereik. Welk bereik heeft jouw voorkeur?', + 'pref_1D' => 'Eén dag', + 'pref_1W' => 'Eén week', + 'pref_1M' => 'Eén maand', + 'pref_3M' => 'Drie maanden (kwartaal)', + 'pref_6M' => 'Zes maanden', + 'pref_languages' => 'Talen', + 'pref_languages_help' => 'Firefly III ondersteunt meerdere talen. Welke heeft jouw voorkeur?', + 'pref_save_settings' => 'Instellingen opslaan', + + // profile: + 'change_your_password' => 'Verander je wachtwoord', + 'delete_account' => 'Verwijder je account', + 'current_password' => 'Huidige wachtwoord', + 'new_password' => 'Nieuw wachtwoord', + 'new_password_again' => 'Nieuw wachtwoord (bevestiging)', + 'delete_your_account' => 'Verwijder je account', + 'delete_your_account_help' => 'Als je je account verwijderd worden ook al je rekeningen, transacties en alle andere zaken verwijderd.' . + ' Alles is dan WEG.', + 'delete_your_account_password' => 'Voer je wachtwoord in om door te gaan.', + 'password' => 'Wachtwoord', + 'are_you_sure' => 'Zeker weten? Je kan niet meer terug!', + 'delete_account_button' => 'VERWIJDER je account', + 'invalid_current_password' => 'Huidige wachtwoord is niet geldig!', + 'password_changed' => 'Je wachtwoord is veranderd!', + 'should_change' => 'Vul ook echt een ander wachtwoord in.', + 'invalid_password' => 'Ongeldig wachtwoord!', + + // attach + 'nr_of_attachments' => 'Eén bijlage|:count bijlagen', + 'attachments' => 'Bijlagen', + 'edit_attachment' => 'Wijzig bijlage ":name"', + 'update_attachment' => 'Update bijlage', + 'delete_attachment' => 'Verwijder bijlage ":name"', + 'attachment_deleted' => 'Bijlage ":name" verwijderd', + 'upload_max_file_size' => 'Maximale grootte: :size', // tour: 'prev' => 'Vorige', @@ -37,32 +92,65 @@ return [ 'csv_import' => 'Importeer CSV-bestand', 'csv' => 'CSV', 'csv_index_title' => 'Upload en importeer een kommagescheiden tekstbestand', + 'csv_define_column_roles' => 'Bepaal kolominhoud', + 'csv_map_values' => 'Leg relaties met kolomwaardes', + 'csv_download_config' => 'Download CSV configuratiebestand.', 'csv_index_text' => 'Met deze (en de komende) pagina\'s kan je kommagescheiden tekstbestanden importeren. Deze tool is gebaseerd ' - . 'op de prachtige tool van Atlassian. Om te beginnen selecteer' . - ' je jouw tekstbestand bij "CSV-bestand". ' + . 'op de prachtige tool van Atlassian. Om te beginnen selecteer' + . ' je jouw tekstbestand bij "CSV-bestand". ' . 'Als je hulp nodig hebt, klik dan op het -icoontje rechtsboven.', 'csv_index_beta_warning' => 'Deze tool is nog erg experimenteel. Wees dus voorzichtig.', - 'csv_header_help' => 'Zet hier een vinkje als de eerste rij van je tekstbestand bestaat uit kolomnamen,' . - 'en niet uit daadwerkelijke gegevens.', - 'csv_date_help' => 'Het gebruikte datumformaat in jouw bestand. Gebruik het formaat zoals deze' . - ' pagina het uitlegt (Engels). Het standaardformaat kan omgaan met data zoals deze: ' . date('Ymd'), + 'csv_header_help' => 'Zet hier een vinkje als de eerste rij van je tekstbestand bestaat uit kolomnamen,' + . 'en niet uit daadwerkelijke gegevens.', + 'csv_date_help' => 'Het gebruikte datumformaat in jouw bestand. Gebruik het formaat zoals deze' + . ' pagina het uitlegt (Engels). Het standaardformaat kan omgaan met data zoals deze: ' . date('Ymd'), 'csv_csv_file_help' => 'Voer hier je kommagescheiden tekstbestand in. Je kan er maar één tegelijkertijd invoeren.', 'csv_csv_config_file_help' => 'Voer hier je configuratiebestand in. Als je deze niet hebt, geen zorgen. Latere stappen leggen dit uit.', 'csv_upload_button' => 'Begin de import', - 'csv_define_column_roles' => 'Bepaal kolominhoud', 'csv_column_roles_title' => 'Bepaal de inhoud van elke kolom', - 'csv_column_roles_text' => 'Firefly kan niet automatisch ontdekken wat elke kolom betekent. Je moet het zelf aangeven. Gebruik de' . - ' voorbeeldgegevens als je het ook niet zeker weet. Klik op het -icoontje ' . - 'rechtsboven om te ontdekken wat elke kolomsoort precies is. Als de kolominhoud een directe' . - ' relatie heeft met gegevens' - . - ' die al in Firefly staan, gebruik dan het vinkje. Tijdens de volgende stap komt Firefly hier dan op terug.', + 'csv_column_roles_text' => 'Firefly kan niet automatisch ontdekken wat elke kolom betekent. Je moet het zelf aangeven. Gebruik de' + . ' voorbeeldgegevens als je het ook niet zeker weet. Klik op het -icoontje ' + . 'rechtsboven om te ontdekken wat elke kolomsoort precies is. Als de kolominhoud een directe' + . ' relatie heeft met gegevens' + . ' die al in Firefly staan, gebruik dan het vinkje. Tijdens de volgende stap komt Firefly hier dan op terug.', + 'csv_column_roles_table' => 'Kolominhoud', 'csv_column' => 'CSV-kolom', 'cvs_column_name' => 'CSV-kolomnaam', 'cvs_column_example' => 'Voorbeeldgegevens', 'cvs_column_role' => 'Kolom bevat?', 'csv_do_map_value' => 'Directe relatie?', + 'csv_continue' => 'Naar de volgende stap', + 'csv_go_back' => 'Terug naar de vorige stap', + 'csv_map_title' => 'Leg relaties met kolomwaardes', + 'csv_map_text' => 'Sommige kolommen bevatten waardes die misschien al in Firefly bestaan. Selecteer hier de juiste combinaties' + . 'zodat het importeren netjes aansluit bij je huidige gegevens.', + 'cvs_field_value' => 'Veldwaarde', + 'csv_field_mapped_to' => 'Is gelijk aan', + 'csv_do_not_map' => 'Geen relatie', + 'csv_download_config_title' => 'Download importconfiguratie', + 'csv_download_config_text' => 'Firefly is klaar om je bestand te importeren. De instellingen en selecties die je zojuist hebt gemaakt kan je downloaden' + . ' en opslaan. Bij de volgende keer kan je dit bestand ook uploaden. Als je kommagescheiden bestand dezelfde indeling' + . ' heeft, zullen alle selecties goed staan. Dat scheelt weer!', + 'csv_more_information_text' => 'Ook als het importeren fout gaat is dit bestand handig. Na het importeren krijg je nogmaals de gelegenheid dit bestand' + . 'te downloaden.', + 'csv_do_download_config' => 'Download het configuratiebestand', + 'csv_empty_description' => '(geen beschrijving)', + 'csv_upload_form' => 'CSV upload formulier', + 'csv_index_unsupported_warning' => 'Het volgende wordt nog niet ondersteund:', + 'csv_unsupported_map' => 'The importer cannot map the column ":columnRole" to existing values in the database.', + 'csv_unsupported_value' => 'The importer does not know how to handle values in columns marked as ":columnRole".', + 'csv_cannot_store_value' => 'The importer has not reserved space for columns marked ":columnRole" and will be incapable of processing them.', + 'csv_process_title' => 'Het importeren is klaar', + 'csv_process_text' => ':rows rijen zijn verwerkt.', + 'csv_row' => 'Rij', + 'csv_import_with_errors' => 'Er was één fout. Deze foutmelding is mogelijk in het Engels.|Er zijn :errors fouten opgetreden. De foutmeldingen' + . ' zijn mogelijk in het Engels.', + 'csv_error_see_logs' => 'De logboeken bevatten mogelijk meer details.', + 'csv_process_new_entries' => 'Firefly heeft :imported nieuwe transactie(s) gemaakt.', + 'csv_start_over' => 'Begin opnieuw', + 'csv_to_index' => 'Naar de index', + 'csv_upload_not_writeable' => 'Kan niet naar onderstaand pad schrijven. Kan dus niet uploaden.', 'csv_column__ignore' => '(negeer deze kolom)', 'csv_column_account-iban' => 'Betaalrekening (IBAN)', 'csv_column_account-id' => 'Betaalrekening (ID gelijk aan Firefly)', @@ -90,36 +178,10 @@ return [ 'csv_column_sepa-db' => 'SEPA "direct debet"-nummer', 'csv_column_tags-comma' => 'Tags (kommagescheiden)', 'csv_column_tags-space' => 'Tags (spatiegescheiden)', - 'csv_column_roles_table' => 'Kolominhoud', - 'csv_continue' => 'Naar de volgende stap', - 'csv_go_back' => 'Terug naar de vorige stap', - 'csv_map_values' => 'Leg relaties met kolomwaardes', - 'csv_map_title' => 'Leg relaties met kolomwaardes', - 'csv_map_text' => 'Sommige kolommen bevatten waardes die misschien al in Firefly bestaan. Selecteer hier de juiste combinaties' . - 'zodat het importeren netjes aansluit bij je huidige gegevens.', - 'cvs_field_value' => 'Veldwaarde', - 'csv_field_mapped_to' => 'Is gelijk aan', - 'csv_do_not_map' => 'Geen relatie', - 'csv_download_config_title' => 'Download importconfiguratie', - 'csv_download_config_text' => - 'Firefly is klaar om je bestand te importeren. De instellingen en selecties die je zojuist hebt gemaakt kan je downloaden' - . ' en opslaan. Bij de volgende keer kan je dit bestand ook uploaden. Als je kommagescheiden bestand dezelfde indeling' - . ' heeft, zullen alle selecties goed staan. Dat scheelt weer!', - 'csv_more_information_text' => - 'Ook als het importeren fout gaat is dit bestand handig. Na het importeren krijg je nogmaals de gelegenheid dit bestand' - . 'te downloaden.', - 'csv_do_download_config' => 'Download het configuratiebestand', - 'csv_process_title' => 'Het importeren is klaar', - 'csv_row' => 'Rij', - 'csv_error_see_logs' => 'De logboeken bevatten mogelijk meer details.', - 'csv_process_new_entries' => 'Firefly heeft :imported nieuwe transactie(s) gemaakt.', - 'csv_start_over' => 'Begin opnieuw', - 'csv_to_index' => 'Naar de index', - 'csv_process_text' => ':rows rijen zijn verwerkt.', - 'csv_import_with_errors' => 'Er was één fout. Deze foutmelding is mogelijk in het Engels.|Er zijn :errors fouten opgetreden. De foutmeldingen' - . ' zijn mogelijk in het Engels.', 'csv_specifix_RabobankDescription' => 'Vink dit aan als je Rabobank bestanden importeert.', 'csv_specifix_Dummy' => 'Dit vinkje doet niks (dummy).', + 'csv_import_account_help' => 'Als jouw CSV bestand geen referenties bevat naar jouw rekening(en), geef dan hier aan om welke rekening het gaat.', + // create new stuff: 'create_new_withdrawal' => 'Nieuwe uitgave', 'create_new_deposit' => 'Nieuwe inkomsten', @@ -133,6 +195,8 @@ return [ // currencies: 'create_currency' => 'Voeg nieuwe valuta toe', 'edit_currency' => 'Wijzig valuta ":name"', + 'store_currency' => 'Sla nieuwe valuta op', + 'update_currency' => 'Wijzig valuta', // new user: 'submit' => 'Invoeren', @@ -160,10 +224,13 @@ return [ 'delete_budget' => 'Verwijder budget ":name"', 'edit_budget' => 'Wijzig budget ":name"', 'update_amount' => 'Bedrag bijwerken', + 'update_budget' => 'Budget bijwerken', // bills: 'delete_bill' => 'Verwijder contract ":name"', + 'update_bill' => 'Wijzig contract', 'edit_bill' => 'Wijzig contract ":name"', + 'store_new_bill' => 'Sla nieuw contract op', // accounts: 'details_for_asset' => 'Overzicht voor betaalrekening ":name"', @@ -224,6 +291,7 @@ return [ 'no_category' => '(geen categorie)', 'category' => 'Categorie', 'delete_category' => 'Verwijder categorie ":name"', + 'store_category' => 'Sla nieuwe categorie op', // transactions: 'update_withdrawal' => 'Wijzig uitgave', @@ -287,6 +355,7 @@ return [ 'Withdrawal' => 'Uitgave', 'Deposit' => 'Inkomsten', 'Transfer' => 'Overschrijving', + 'profile' => 'Profiel', 'bill' => 'Contract', 'yes' => 'Ja', 'no' => 'Nee', @@ -363,7 +432,7 @@ return [ // piggy banks: 'piggy_bank' => 'Spaarpotje', 'new_piggy_bank' => 'Nieuw spaarpotje', - 'create_new_piggybank' => 'Nieuw spaarpotje', + 'store_piggy_bank' => 'Sla spaarpotje op', 'account_status' => 'Rekeningoverzicht', 'left_for_piggy_banks' => 'Over voor spaarpotjes', 'sum_of_piggy_banks' => 'Som van spaarpotjes', @@ -395,9 +464,17 @@ return [ 'new_tag' => 'Maak nieuwe tag', 'edit_tag' => 'Wijzig tag ":tag"', 'no_year' => 'Zonder jaar', - 'no_maand' => 'Zonder jaar', + 'no_month' => 'Zonder maand', 'tag_title_nothing' => 'Standaard tags', - 'tag_title_balancingAct' => 'Balancing act tags', - 'tag_title_advancePayment' => 'Advance payment tags', - + 'tag_title_balancingAct' => 'Balancerende tags', + 'tag_title_advancePayment' => 'Vooruitbetaalde tags', + 'tags_introduction' => 'Normaal gesproken zijn tags enkele woorden, gebruikt om gerelateerde zaken snel aan elkaar te plakken. ' . + 'dure-aanschaf, rekening, ' . + 'feestje. In Firefly III hebben tags meer betekenis en kan je er een datum' . + ', beschrijving en locatie aan geven. Daarmee kan je je transacties op een wat zinvollere manier aan elkaar ' . + 'koppelen. Je kan bijvoorbeeld een tag Kerstdiner maken en informatie over' . + ' het restaurant meenemen. Zulke tags zijn enkelvoudig; je gebruikt ze maar bij één gelegenheid.', + 'tags_group' => 'Omdat tags transacties groeperen kan je er teruggaves, vergoedingen en andere geldzaken mee aanduiden, zolang' . + ' de transacties elkaar "opheffen". Hoe je dit aanpakt is aan jou. De gewone manier kan natuurlijk ook.', + 'tags_start' => 'Maak hieronder een tag, of voer nieuwe tags in als je nieuwe transacties maakt.', ]; diff --git a/resources/lang/nl/form.php b/resources/lang/nl/form.php index 071cc3230c..8d2e544b5c 100644 --- a/resources/lang/nl/form.php +++ b/resources/lang/nl/form.php @@ -51,6 +51,14 @@ return [ 'date_format' => 'Datumformaat', 'csv_config' => 'Configuratiebestand', 'specifix' => 'Bank- or of bestandsspecifieke opties', + 'csv_import_account' => 'Standaard rekening voor importeren', + 'attachments[]' => 'Bijlagen', + + 'title' => 'Titel', + 'notes' => 'Notities', + 'filename' => 'Bestandsnaam', + 'mime' => 'Bestandstype', + 'size' => 'Grootte', 'store_new_withdrawal' => 'Nieuwe uitgave opslaan', 'store_new_deposit' => 'Nieuwe inkomsten opslaan', @@ -68,7 +76,10 @@ return [ 'delete_currency' => 'Verwijder valuta ":name"', 'delete_piggyBank' => 'Verwijder spaarpotje ":name"', 'delete_journal' => 'Verwijder transactie met omschrijving ":description"', + 'delete_attachment' => 'Verwijder bijlage ":name"', + 'tag_areYouSure' => 'Weet je zeker dat je de tag met naam ":tag" wilt verwijderen?', + 'attachment_areYouSure' => 'Weet je zeker dat je de bijlage met naam ":name" wilt verwijderen?', 'account_areYouSure' => 'Weet je zeker dat je de rekening met naam ":name" wilt verwijderen?', 'bill_areYouSure' => 'Weet je zeker dat je het contract met naam ":name" wilt verwijderen?', 'budget_areYouSure' => 'Weet je zeker dat je het budget met naam ":name" wilt verwijderen?', @@ -88,4 +99,6 @@ return [ '|De :count transacties verbonden aan dit budget blijven bewaard.', 'category_keep_transactions' => 'De transactie verbonden aan deze categorie blijft bewaard.' . '|De :count transacties verbonden aan deze categorie blijven bewaard.', + 'tag_keep_transactions' => 'De transactie verbonden aan deze tag blijft bewaard.' . + '|De :count transacties verbonden aan deze tag blijven bewaard.', ]; diff --git a/resources/lang/nl/help.php b/resources/lang/nl/help.php index 40efd045ba..bb5cf1d193 100644 --- a/resources/lang/nl/help.php +++ b/resources/lang/nl/help.php @@ -1,5 +1,25 @@ 'Welkom bij Firefly III', + 'main-content-text' => 'Doe jezelf een lol en volg deze korte tour. Je weet dan precies hoe alles werkt.', + 'sidebar-toggle-title' => 'Sidebar om nieuwe dingen te maken', + 'sidebar-toggle-text' => 'Verstopt onder het plusje vind je de knoppen die je nodig hebt om nieuwe dingen te maken.', + 'account-menu-title' => 'Alle rekeningen', + 'account-menu-text' => 'Hier vind je al je rekeningen.', + 'budget-menu-title' => 'Budgetten', + 'budget-menu-text' => 'Gebruik deze pagina voor budgetten.', + 'report-menu-title' => 'Overzichten', + 'report-menu-text' => 'Hier vind je allerlei financiele rapportages.', + 'transaction-menu-title' => 'Transacties', + 'transaction-menu-text' => 'Hier vind je al je bijschrijvingen, afschrijvingen en overboekingen.', + 'option-menu-title' => 'Opties', + 'option-menu-text' => 'Hier vind je alle opties.', + 'main-content-end-title' => 'Einde!', + 'main-content-end-text' => 'Elke pagina heeft een vraagtekentje rechtsboven. Gebruik deze voor meer hulp. Veel plezier!', + + 'csv-index' => 'csv-index', 'register' => 'register', 'index' => 'index', 'home' => 'home', diff --git a/resources/lang/nl/validation.php b/resources/lang/nl/validation.php index 9c27ea93d8..8c8a7cfa3c 100644 --- a/resources/lang/nl/validation.php +++ b/resources/lang/nl/validation.php @@ -13,6 +13,10 @@ return [ | */ + 'file_already_attached' => 'Het geuploade bestand ":name" is al gelinkt aan deze transactie.', + 'file_attached' => 'Bestand met naam ":name" is met succes geuploaded.', + 'file_invalid_mime' => 'Bestand ":name" is van het type ":mime", en die kan je niet uploaden.', + 'file_too_large' => 'Bestand ":name" is te groot.', "accepted" => "The :attribute must be accepted.", "active_url" => "The :attribute is not a valid URL.", "after" => "The :attribute must be a date after :date.", diff --git a/resources/twig/accounts/create.twig b/resources/twig/accounts/create.twig index c52b5321ea..a801fede4a 100644 --- a/resources/twig/accounts/create.twig +++ b/resources/twig/accounts/create.twig @@ -32,7 +32,7 @@ {{ ExpandedForm.text('iban') }} {{ ExpandedForm.balance('openingBalance') }} {{ ExpandedForm.date('openingBalanceDate', phpdate('Y-m-d')) }} - {{ ExpandedForm.select('accountRole', Config.get('firefly.accountRoles'),null,{'helpText' : 'Any extra options resulting from your choice can be set later.'}) }} + {{ ExpandedForm.select('accountRole', Config.get('firefly.accountRoles'),null,{'helpText' : 'asset_account_role_help'|_}) }} {{ ExpandedForm.balance('virtualBalance') }} diff --git a/resources/twig/accounts/delete.twig b/resources/twig/accounts/delete.twig index a3ccf25444..81b16c4b4b 100644 --- a/resources/twig/accounts/delete.twig +++ b/resources/twig/accounts/delete.twig @@ -30,9 +30,11 @@ {{ Lang.choice('form.also_delete_piggyBanks', account.piggyBanks|length, {count: account.piggyBanks|length}) }} {% endif %}

+

{{ 'save_transactions_by_moving'|_ }}

+

{{ Form.select('move_account_before_delete', accountList, null, {class: 'form-control'}) }}

diff --git a/resources/twig/accounts/show.twig b/resources/twig/accounts/show.twig index b61f7ccce7..278701207e 100644 --- a/resources/twig/accounts/show.twig +++ b/resources/twig/accounts/show.twig @@ -25,7 +25,7 @@
{% if Config.get('firefly.chart') == 'google' %} -
+
{% endif %} {% if Config.get('firefly.chart') == 'chartjs' %} diff --git a/resources/twig/attachments/delete.twig b/resources/twig/attachments/delete.twig new file mode 100644 index 0000000000..3b7d412b32 --- /dev/null +++ b/resources/twig/attachments/delete.twig @@ -0,0 +1,34 @@ +{% extends "./layout/default.twig" %} + +{% block breadcrumbs %} + {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute().getName(), attachment) }} +{% endblock %} + +{% block content %} + + {{ Form.open({'class' : 'form-horizontal','id' : 'destroy','url' : route('attachments.destroy',attachment.id)}) }} +
+
+
+
+

{{ trans('form.delete_attachment', {'name': attachment.filename}) }}

+
+
+

+ {{ trans('form.permDeleteWarning') }} +

+ +

+ {{ trans('form.attachment_areYouSure', {'name': attachment.filename}) }} +

+
+ +
+
+
+ + {{ Form.close|raw }} +{% endblock %} diff --git a/resources/twig/attachments/edit.twig b/resources/twig/attachments/edit.twig new file mode 100644 index 0000000000..9ca2c1139f --- /dev/null +++ b/resources/twig/attachments/edit.twig @@ -0,0 +1,59 @@ +{% extends "./layout/default.twig" %} + +{% block breadcrumbs %} + {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute().getName(), attachment) }} +{% endblock %} + +{% block content %} +
+ + + + + +
+
+
+
+

{{ 'mandatoryFields'|_ }}

+
+
+ {{ ExpandedForm.staticText('filename',attachment.filename) }} + {{ ExpandedForm.staticText('mime',attachment.mime) }} + {{ ExpandedForm.staticText('size',attachment.size|filesize) }} +
+
+ +
+
+
+
+

{{ 'optionalFields'|_ }}

+
+
+ {{ ExpandedForm.text('title', attachment.title) }} + {{ ExpandedForm.textarea('description', attachment.description) }} + {{ ExpandedForm.textarea('notes', attachment.notes) }} +
+
+ + +
+
+

{{ 'options'|_ }}

+
+
+ {{ ExpandedForm.optionsList('update','attachment') }} +
+ +
+
+
+ + +
+{% endblock %} diff --git a/resources/twig/auth/login.twig b/resources/twig/auth/login.twig index 3211d30000..88e8d4554e 100644 --- a/resources/twig/auth/login.twig +++ b/resources/twig/auth/login.twig @@ -14,7 +14,6 @@
{% endif %} -

Sign in to start your session

diff --git a/resources/twig/auth/register.twig b/resources/twig/auth/register.twig index 5898015069..1855e5f248 100644 --- a/resources/twig/auth/register.twig +++ b/resources/twig/auth/register.twig @@ -17,6 +17,10 @@
+ {% if host == 'geld.nder.be' %} + + {% endif %}
diff --git a/resources/twig/bills/create.twig b/resources/twig/bills/create.twig index b9c8ba62dd..fd888c257d 100644 --- a/resources/twig/bills/create.twig +++ b/resources/twig/bills/create.twig @@ -47,7 +47,7 @@
diff --git a/resources/twig/bills/edit.twig b/resources/twig/bills/edit.twig index eae7fd2d88..94c4add246 100644 --- a/resources/twig/bills/edit.twig +++ b/resources/twig/bills/edit.twig @@ -49,7 +49,7 @@ diff --git a/resources/twig/budgets/edit.twig b/resources/twig/budgets/edit.twig index 39611eb75d..0bf5ec3daa 100644 --- a/resources/twig/budgets/edit.twig +++ b/resources/twig/budgets/edit.twig @@ -30,7 +30,7 @@ {{ ExpandedForm.optionsList('update','budget') }} diff --git a/resources/twig/categories/create.twig b/resources/twig/categories/create.twig index c12f377cd5..b4dffb55c5 100644 --- a/resources/twig/categories/create.twig +++ b/resources/twig/categories/create.twig @@ -31,7 +31,7 @@ diff --git a/resources/twig/csv/process.twig b/resources/twig/csv/process.twig index 32a0da3ae3..86c5d474e9 100644 --- a/resources/twig/csv/process.twig +++ b/resources/twig/csv/process.twig @@ -44,9 +44,9 @@ {% if journals|length > 0 %} {% endif %} diff --git a/resources/twig/currency/create.twig b/resources/twig/currency/create.twig index 956febad3c..0b3c512f81 100644 --- a/resources/twig/currency/create.twig +++ b/resources/twig/currency/create.twig @@ -33,7 +33,7 @@ diff --git a/resources/twig/currency/edit.twig b/resources/twig/currency/edit.twig index 5444860dc2..a39ab1b0e4 100644 --- a/resources/twig/currency/edit.twig +++ b/resources/twig/currency/edit.twig @@ -34,7 +34,7 @@ diff --git a/resources/twig/emails/registered-html.twig b/resources/twig/emails/registered-html.twig index 712dbcf45c..a776c2299a 100644 --- a/resources/twig/emails/registered-html.twig +++ b/resources/twig/emails/registered-html.twig @@ -54,6 +54,7 @@ } } + diff --git a/resources/twig/errors/503.twig b/resources/twig/errors/503.twig index d5f1296a46..365a8698e3 100644 --- a/resources/twig/errors/503.twig +++ b/resources/twig/errors/503.twig @@ -42,8 +42,8 @@ (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(); + (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; diff --git a/resources/twig/form/static.twig b/resources/twig/form/static.twig new file mode 100644 index 0000000000..e70ba496ba --- /dev/null +++ b/resources/twig/form/static.twig @@ -0,0 +1,7 @@ +
+ + +
+

{{ value }}

+
+
diff --git a/resources/twig/json/tour.twig b/resources/twig/json/tour.twig index d810ee8b80..8b3c415190 100644 --- a/resources/twig/json/tour.twig +++ b/resources/twig/json/tour.twig @@ -1,13 +1,15 @@ \ No newline at end of file + diff --git a/resources/twig/layout/default.twig b/resources/twig/layout/default.twig index 27fde5aa7c..4347a4956d 100644 --- a/resources/twig/layout/default.twig +++ b/resources/twig/layout/default.twig @@ -143,7 +143,7 @@ @@ -191,8 +191,8 @@ (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(); + (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; diff --git a/resources/twig/layout/empty.twig b/resources/twig/layout/empty.twig new file mode 100644 index 0000000000..b3d3a1458c --- /dev/null +++ b/resources/twig/layout/empty.twig @@ -0,0 +1,73 @@ + + + + + Firefly III + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + {% block content %}{% endblock %} +
+ + + + + + + diff --git a/resources/twig/layout/guest.twig b/resources/twig/layout/guest.twig index c27f63e493..1063bf4d98 100644 --- a/resources/twig/layout/guest.twig +++ b/resources/twig/layout/guest.twig @@ -9,6 +9,7 @@ +
@@ -19,8 +19,8 @@
@@ -34,7 +34,7 @@ {% endif %} {% if tag.date %} -

Date: {{ tag.date.formatLocalized(monthAndDayFormat) }}

+

{{ 'date'|_ }}: {{ tag.date.formatLocalized(monthAndDayFormat) }}

{% endif %} @@ -42,7 +42,7 @@
-

Location

+

{{ 'location'|_ }}

@@ -62,7 +62,7 @@

{% else %} -

No location set.

+

{{ 'no_location_set'|_ }}

{% endif %}
@@ -80,8 +80,8 @@
diff --git a/resources/twig/transactions/create.twig b/resources/twig/transactions/create.twig index e4c6a0b696..73832b0149 100644 --- a/resources/twig/transactions/create.twig +++ b/resources/twig/transactions/create.twig @@ -5,93 +5,99 @@ {% endblock %} {% block content %} - {{ Form.open({'class' : 'form-horizontal','id' : 'store','url' : route('transactions.store',what)}) }} - -
-
-
-
-

{{ 'mandatoryFields'|_ }}

-
-
-
- + + + -
-
- {{ 'withdrawal'|_ }} - {{ 'deposit'|_ }} - {{ 'transfer'|_ }} +
+
+
+
+

{{ 'mandatoryFields'|_ }}

+
+
+ + + + + {{ ExpandedForm.text('description') }} + + + {{ ExpandedForm.select('account_id',accounts) }} + + + + {{ ExpandedForm.text('expense_account') }} + + + {{ ExpandedForm.text('revenue_account') }} + + + + {{ ExpandedForm.select('account_from_id',accounts) }} + {{ ExpandedForm.select('account_to_id',accounts) }} + + + + {{ ExpandedForm.amount('amount') }} + + + {{ ExpandedForm.date('date', phpdate('Y-m-d')) }} +
+
+
+
+
+
+

{{ 'optionalFields'|_ }}

+
+
+ + {{ ExpandedForm.select('budget_id',budgets,0) }} + + {{ ExpandedForm.text('category') }} + + + {{ ExpandedForm.text('tags') }} + + + + {{ ExpandedForm.select('piggy_bank_id',piggies) }} + + + {{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }} +
+
- - {{ ExpandedForm.text('description') }} - - - {{ ExpandedForm.select('account_id',accounts) }} - - - - {{ ExpandedForm.text('expense_account') }} - - - {{ ExpandedForm.text('revenue_account') }} - - - - {{ ExpandedForm.select('account_from_id',accounts) }} - {{ ExpandedForm.select('account_to_id',accounts) }} - - - - {{ ExpandedForm.amount('amount') }} - - - {{ ExpandedForm.date('date', phpdate('Y-m-d')) }} + +
+
+

{{ 'options'|_ }}

+
+
+ {{ ExpandedForm.optionsList('create','transaction') }} +
+
-
-
-
-

{{ 'optionalFields'|_ }}

-
-
- - {{ ExpandedForm.select('budget_id',budgets,0) }} - - {{ ExpandedForm.text('category') }} - - - {{ ExpandedForm.text('tags') }} - - - - {{ ExpandedForm.select('piggy_bank_id',piggies) }} -
- -
- - -
-
-

{{ 'options'|_ }}

-
-
- {{ ExpandedForm.optionsList('create','transaction') }} -
- -
-
-
- {{ Form.close|raw }} + {% endblock %} {% block scripts %} diff --git a/resources/twig/transactions/edit.twig b/resources/twig/transactions/edit.twig index 5df0982c35..524e0df51d 100644 --- a/resources/twig/transactions/edit.twig +++ b/resources/twig/transactions/edit.twig @@ -5,94 +5,99 @@ {% endblock %} {% block content %} - {{ Form.open({'class' : 'form-horizontal','id' : 'update','url' : route('transactions.update',journal.id)}) }} +
- - + + + -
-
-
-
-

{{ 'mandatoryFields'|_ }}

+
+
+
+
+

{{ 'mandatoryFields'|_ }}

+
+
+ + {{ ExpandedForm.text('description',journal.description) }} + + + {% if what == 'deposit' or what == 'withdrawal' %} + {{ ExpandedForm.select('account_id',accounts,data['account_id']) }} + {% endif %} + + + {% if what == 'withdrawal' %} + {{ ExpandedForm.text('expense_account',data['expense_account']) }} + {% endif %} + + + {% if what == 'deposit' %} + {{ ExpandedForm.text('revenue_account',data['revenue_account']) }} + {% endif %} + + + {% if what == 'transfer' %} + {{ ExpandedForm.select('account_from_id',accounts,data['account_from_id']) }} + {{ ExpandedForm.select('account_to_id',accounts,data['account_to_id']) }} + {% endif %} + + + {{ ExpandedForm.amount('amount',data.amount,{'currency' : journal.transactionCurrency}) }} + + + {{ ExpandedForm.date('date',data['date']) }} +
-
- - {{ ExpandedForm.text('description',journal.description) }} + - - {% if what == 'deposit' or what == 'withdrawal' %} - {{ ExpandedForm.select('account_id',accounts,data['account_id']) }} - {% endif %} - - - {% if what == 'withdrawal' %} - {{ ExpandedForm.text('expense_account',data['expense_account']) }} - {% endif %} - - - {% if what == 'deposit' %} - {{ ExpandedForm.text('revenue_account',data['revenue_account']) }} - {% endif %} - - - {% if what == 'transfer' %} - {{ ExpandedForm.select('account_from_id',accounts,data['account_from_id']) }} - {{ ExpandedForm.select('account_to_id',accounts,data['account_to_id']) }} - {% endif %} - - - {{ ExpandedForm.amount('amount',data.amount,{'currency' : journal.transactionCurrency}) }} - - - {{ ExpandedForm.date('date',data['date']) }} -
- +
+
+
+

{{ 'optionalFields'|_ }}

+
+
+ + {% if what == 'withdrawal' %} + {{ ExpandedForm.select('budget_id',budgets,data['budget_id']) }} + {% endif %} -
-
-
-
-

{{ 'optionalFields'|_ }}

+ + {{ ExpandedForm.text('category',data['category']) }} + + + {{ ExpandedForm.text('tags') }} + + + {% if what == 'withdrawal' and piggies|length > 0 %} + {{ ExpandedForm.select('piggy_bank_id',piggies,data['piggy_bank_id']) }} + {% endif %} + + + {{ ExpandedForm.file('attachments[]', {'multiple': 'multiple','helpText': trans('firefly.upload_max_file_size', {'size': uploadSize|filesize}) }) }} + +
-
- - {% if what == 'withdrawal' %} - {{ ExpandedForm.select('budget_id',budgets,data['budget_id']) }} - {% endif %} + - - {{ ExpandedForm.text('category',data['category']) }} - - - {{ ExpandedForm.text('tags') }} - - - {% if what == 'withdrawal' and piggies|length > 0 %} - {{ ExpandedForm.select('piggy_bank_id',piggies,data['piggy_bank_id']) }} - {% endif %} - -
-
- - - -
-
-

{{ 'options'|_ }}

-
-
- {{ ExpandedForm.optionsList('update','transaction') }} -
-
-
- {{ Form.close|raw }} + {% endblock %} diff --git a/resources/twig/transactions/show.twig b/resources/twig/transactions/show.twig index 766c0791ee..c87273dd1b 100644 --- a/resources/twig/transactions/show.twig +++ b/resources/twig/transactions/show.twig @@ -74,6 +74,48 @@
+ + + {% if journal.attachments|length > 0 %} +
+
+

{{ 'attachments'|_ }}

+
+
+ + {% for att in journal.attachments %} + + + + + + {% endfor %} +
+
+ + +
+
+ + + {% if att.title %} + {{ att.title }} + {% else %} + {{ att.filename }} + {% endif %} + + ({{ att.size|filesize }}) + {% if att.description %} +
+ {{ att.description }} + {% endif %} +
+ +
+
+
+ {% endif %} + {% if journal.piggyBankEvents|length > 0 %}