Merge branch 'release/3.4.10'

This commit is contained in:
James Cole 2015-07-27 21:23:20 +02:00
commit b318f3f940
127 changed files with 2851 additions and 1008 deletions

View File

@ -18,4 +18,7 @@ EMAIL_PASSWORD=
ANALYTICS_ID=
EMAIL_PRETEND=false
RUNCLEANUP=true
SITE_OWNER=mail@example.com
SITE_OWNER=mail@example.com
SENDGRID_USERNAME=
SENDGRID_PASSWORD=

View File

@ -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/)

View File

@ -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);

View File

@ -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)
);
}

View File

@ -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,

View File

@ -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();

View File

@ -0,0 +1,222 @@
<?php
namespace FireflyIII\Helpers\Attachments;
use Auth;
use Config;
use Crypt;
use FireflyIII\Models\Attachment;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\MessageBag;
use Input;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* Class AttachmentHelper
*
* @package FireflyIII\Helpers\Attachments
*/
class AttachmentHelper implements AttachmentHelperInterface
{
/** @var int */
protected $maxUploadSize;
/** @var array */
protected $allowedMimes;
/** @var MessageBag */
public $errors;
/** @var MessageBag */
public $messages;
/**
*
*/
public function __construct()
{
$this->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;
}
}

View File

@ -0,0 +1,41 @@
<?php
namespace FireflyIII\Helpers\Attachments;
use FireflyIII\Models\Attachment;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\MessageBag;
/**
* Interface AttachmentHelperInterface
*
* @package FireflyIII\Helpers\Attachments
*/
interface AttachmentHelperInterface
{
/**
* @param Model $model
*
* @return bool
*/
public function saveAttachmentsForModel(Model $model);
/**
* @return MessageBag
*/
public function getErrors();
/**
* @return MessageBag
*/
public function getMessages();
/**
* @param Attachment $attachment
*
* @return mixed
*/
public function getAttachmentLocation(Attachment $attachment);
}

View File

@ -29,7 +29,7 @@ class AccountId extends BasicConverter implements ConverterInterface
$account = Auth::user()->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) ');
}
}

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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
);
}
/**

View File

@ -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'),

View File

@ -0,0 +1,173 @@
<?php
namespace FireflyIII\Http\Controllers;
use Crypt;
use File;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Requests\AttachmentFormRequest;
use FireflyIII\Models\Attachment;
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
use Input;
use Preferences;
use Response;
use Session;
use URL;
use View;
/**
* Class AttachmentController
*
* @package FireflyIII\Http\Controllers
*/
class AttachmentController extends Controller
{
/**
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
View::share('mainTitleIcon', 'fa-paperclip');
View::share('title', trans('firefly.attachments'));
}
/**
* @param Attachment $attachment
*
* @return \Illuminate\View\View
*/
public function edit(Attachment $attachment)
{
$subTitleIcon = 'fa-pencil';
$subTitle = trans('firefly.edit_attachment', ['name' => $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'));
}
}

View File

@ -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,
]
);
}

View File

@ -0,0 +1,64 @@
<?php
namespace FireflyIII\Http\Controllers;
use FireflyIII\User;
/**
* Class WebhookController
*
* @package FireflyIII\Http\Controllers
*/
class CronController extends Controller
{
/**
* Firefly doesn't have anything that should be in the a cron job, except maybe this one, and it's fairly exceptional.
*
* If you use SendGrid like I do, you can detect bounces and thereby check if users gave an invalid address. If they did,
* it's easy to block them and change their password. Optionally, you could notify yourself about it and send them a message.
*
* But thats something not supported right now.
*/
public function sendgrid()
{
if (strlen(env('SENDGRID_USERNAME')) > 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.';
}
}
}

View File

@ -1,5 +1,6 @@
<?php namespace FireflyIII\Http\Controllers;
use Artisan;
use Auth;
use Carbon\Carbon;
use Config;
@ -58,6 +59,7 @@ class HomeController extends Controller
Session::clear();
Artisan::call('cache:clear');
return redirect(route('index'));
}

View File

@ -161,7 +161,7 @@ class JsonController extends Controller
}
/** @var Bill $entry */
foreach ($unpaid as $entry) {
$current = ($entry[0]->amount_max + $entry[0]->amount_min) / 2;
$current = bcdiv(bcadd($entry[0]->amount_max, $entry[0]->amount_min), 2);
$amount = bcadd($amount, $current);
}

View File

@ -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',

View File

@ -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,

View File

@ -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'));
}

View File

@ -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'));
}

View File

@ -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

View File

@ -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);

View File

@ -24,5 +24,4 @@ class VerifyCsrfToken extends BaseVerifier
{
return parent::handle($request, $next);
}
}

View File

@ -0,0 +1,36 @@
<?php
namespace FireflyIII\Http\Requests;
use Auth;
/**
* Class AttachmentFormRequest
*
* @codeCoverageIgnore
* @package FireflyIII\Http\Requests
*/
class AttachmentFormRequest extends Request
{
/**
* @return bool
*/
public function authorize()
{
// Only allow logged in users
return Auth::check();
}
/**
* @return array
*/
public function rules()
{
return [
'title' => 'between:1,255',
'description' => 'between:1,65536',
'notes' => 'between:1,65536',
];
}
}

View File

@ -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'),

View File

@ -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')),

View File

@ -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'));
}
);

View File

@ -1,5 +1,6 @@
<?php
use FireflyIII\Models\Account;
use FireflyIII\Models\Attachment;
use FireflyIII\Models\Bill;
use FireflyIII\Models\Budget;
use FireflyIII\Models\Category;
@ -42,6 +43,19 @@ Route::bind(
}
);
Route::bind(
'attachment', function ($value) {
if (Auth::check()) {
$object = Attachment::where('id', $value)->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
*/

View File

@ -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
{

View File

@ -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)

View File

@ -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)

190
app/Models/Attachment.php Normal file
View File

@ -0,0 +1,190 @@
<?php
namespace FireflyIII\Models;
use Crypt;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* Class Attachment
*
* @package FireflyIII\Models
* @property integer $id
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
* @property string $deleted_at
* @property integer $attachable_id
* @property string $attachable_type
* @property integer $user_id
* @property string $md5
* @property string $filename
* @property string $mime
* @property integer $size
* @property boolean $uploaded
* @property-read \ $attachable
* @property-read \FireflyIII\User $user
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Attachment whereId($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Attachment whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Attachment whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Attachment whereDeletedAt($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Attachment whereAttachableId($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Attachment whereAttachableType($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Attachment whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Attachment whereMd5($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Attachment whereFilename($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Attachment whereMime($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Attachment whereSize($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Attachment whereUploaded($value)
* @property string $title
* @property string $description
* @property string $notes
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Attachment whereTitle($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Attachment whereDescription($value)
* @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\Attachment whereNotes($value)
*/
class Attachment extends Model
{
use SoftDeletes;
protected $fillable = ['attachable_id', 'attachable_type', 'user_id', 'md5', 'filename', 'mime', 'title', 'notes', 'description', 'size', 'uploaded'];
/**
* Get all of the owning imageable models.
*/
public function attachable()
{
return $this->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);
}
}

View File

@ -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
{

View File

@ -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)

View File

@ -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)

View File

@ -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
{

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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
{

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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) {

View File

@ -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
{

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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');

View File

@ -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

View File

@ -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();

View File

@ -0,0 +1,47 @@
<?php
namespace FireflyIII\Repositories\Attachment;
use FireflyIII\Models\Attachment;
/**
* Class AttachmentRepository
*
* @package FireflyIII\Repositories\Attachment
*/
class AttachmentRepository implements AttachmentRepositoryInterface
{
/**
* @param Attachment $attachment
*
* @return bool
*/
public function destroy(Attachment $attachment)
{
/** @var \FireflyIII\Helpers\Attachments\AttachmentHelperInterface $helper */
$helper = app('FireflyIII\Helpers\Attachments\AttachmentHelperInterface');
$file = $helper->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;
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace FireflyIII\Repositories\Attachment;
use FireflyIII\Models\Attachment;
/**
* Interface AttachmentRepositoryInterface
*
* @package FireflyIII\Repositories\Attachment
*/
interface AttachmentRepositoryInterface
{
/**
* @param Attachment $attachment
*
* @return bool
*/
public function destroy(Attachment $attachment);
/**
* @param Attachment $attachment
* @param array $attachmentData
*
* @return Attachment
*/
public function update(Attachment $attachment, array $attachmentData);
}

View File

@ -52,9 +52,10 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn
*/
public function expensesOnDayCorrected(Budget $budget, Carbon $date)
{
$sum = floatval($budget->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);
}
/**

View File

@ -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');
}
/**

View File

@ -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();

View File

@ -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);
}

View File

@ -64,16 +64,16 @@ class Amount
if ($coloured === true) {
if ($amount === 0.0) {
return '<span style="color:#999">' . $symbol . ' ' . $string . '</span>';
return '<span style="color:#999">' . $symbol . '&nbsp;' . $string . '</span>';
}
if ($amount > 0) {
return '<span class="text-success">' . $symbol . ' ' . $string . '</span>';
return '<span class="text-success">' . $symbol . '&nbsp;' . $string . '</span>';
}
return '<span class="text-danger">' . $symbol . ' ' . $string . '</span>';
return '<span class="text-danger">' . $symbol . '&nbsp;' . $string . '</span>';
}
return $symbol . ' ' . $string;
return $symbol . '&nbsp;' . $string;
}
/**

View File

@ -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

View File

@ -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;
}
}

View File

@ -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
*/

View File

@ -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
*/

View File

@ -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": [

547
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -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',

View File

@ -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',

View File

@ -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'
]
],
],

View File

@ -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()
{
//
}
}

View File

@ -0,0 +1,56 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV3410
*/
class ChangesForV3410 extends Migration
{
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('attachments');
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create(
'attachments', function (Blueprint $table) {
$table->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();
}
);
}
}

View File

@ -18,4 +18,4 @@ class PermissionSeeder extends Seeder
}
}
}

View File

@ -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;

View File

@ -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;}

BIN
public/images/image.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

BIN
public/images/page_green.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

View File

@ -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);

View File

@ -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, <em>anything</em> 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 <a href="https://www.atlassian.com/">Atlassian</a>. Simply upload your CSV file and follow the instructions.' .
' If you would like to learn more, please click on the <i class="fa fa-question-circle"></i> 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 <a href="https://www.atlassian.com/">Atlassian</a>. Simply upload your CSV' .
' file and follow the instructions. If you would like to learn more, please click on the <i ' .
'class="fa fa-question-circle"></i> 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 <a href="https://secure.' .
'php.net/manual/en/datetime.createfromformat.php#refsect1-datetime.createfromformat-parameters">this' .
' page</a> 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 <a href="https://secure.php.net/manual/en/' .
'datetime.createfromformat.php#refsect1-datetime.createfromformat-parameters">this page</a> ' .
'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' .
' <span class="label label-info">expensive</span>, <span class="label label-info">bill</span>' .
' or <span class="label label-info">for-party</span>. 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 <span class="label label-success">' .
'Christmas dinner with friends</span> 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.',
];

View File

@ -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.',
];

View File

@ -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' => [],
];

View File

@ -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 <em>alle andere zaken</em> 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 <a href="https://www.atlassian.com/">Atlassian</a>. Om te beginnen selecteer' .
' je jouw tekstbestand bij "CSV-bestand". '
. 'op de prachtige tool van <a href="https://www.atlassian.com/">Atlassian</a>. Om te beginnen selecteer'
. ' je jouw tekstbestand bij "CSV-bestand". '
. 'Als je hulp nodig hebt, klik dan op het <i class="fa fa-question-circle"></i>-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 <a href="https://secure.' .
'php.net/manual/en/datetime.createfromformat.php#refsect1-datetime.createfromformat-parameters">deze' .
' pagina</a> 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 <a href="https://secure.'
. 'php.net/manual/en/datetime.createfromformat.php#refsect1-datetime.createfromformat-parameters">deze'
. ' pagina</a> 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 <i class="fa fa-question-circle"></i>-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 <i class="fa fa-question-circle"></i>-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. ' .
'<span class="label label-info">dure-aanschaf</span>, <span class="label label-info">rekening</span>, ' .
'<span class="label label-info">feestje</span>. 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 <span class="label label-success">Kerstdiner</span> 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.',
];

View File

@ -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.',
];

View File

@ -1,5 +1,25 @@
<?php
return [
// tour!
'main-content-title' => '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',

View File

@ -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.",

View File

@ -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') }}
</div>

View File

@ -30,9 +30,11 @@
{{ Lang.choice('form.also_delete_piggyBanks', account.piggyBanks|length, {count: account.piggyBanks|length}) }}
{% endif %}
</p>
<p class="text-success">
{{ 'save_transactions_by_moving'|_ }}
</p>
<p>
{{ Form.select('move_account_before_delete', accountList, null, {class: 'form-control'}) }}
</p>

View File

@ -25,7 +25,7 @@
</div>
<div class="box-body">
{% if Config.get('firefly.chart') == 'google' %}
<div id="overview-chart"></div>
<div id="overview-chart"></div>
{% endif %}
{% if Config.get('firefly.chart') == 'chartjs' %}
<canvas id="overview-chart" style="width:100%;height:400px;"></canvas>

View File

@ -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)}) }}
<div class="row">
<div class="col-lg-6 col-lg-offset-3 col-md-12 col-sm-12">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('form.delete_attachment', {'name': attachment.filename}) }}</h3>
</div>
<div class="box-body">
<p class="text-danger">
{{ trans('form.permDeleteWarning') }}
</p>
<p>
{{ trans('form.attachment_areYouSure', {'name': attachment.filename}) }}
</p>
</div>
<div class="box-footer">
<input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn pull-right btn-danger"/>
<a href="{{ URL.previous() }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
</div>
</div>
</div>
</div>
{{ Form.close|raw }}
{% endblock %}

View File

@ -0,0 +1,59 @@
{% extends "./layout/default.twig" %}
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute().getName(), attachment) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('attachments.update', attachment.id) }}" accept-charset="UTF-8" class="form-horizontal" id="update">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
<input type="hidden" name="id" value="{{ attachment.id }}"/>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.staticText('filename',attachment.filename) }}
{{ ExpandedForm.staticText('mime',attachment.mime) }}
{{ ExpandedForm.staticText('size',attachment.size|filesize) }}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.text('title', attachment.title) }}
{{ ExpandedForm.textarea('description', attachment.description) }}
{{ ExpandedForm.textarea('notes', attachment.notes) }}
</div>
</div>
<!-- panel for options -->
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'options'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.optionsList('update','attachment') }}
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">
{{ ('update_attachment')|_ }}
</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@ -14,7 +14,6 @@
</div>
{% endif %}
<div class="login-box-body">
<p class="login-box-msg">Sign in to start your session</p>

View File

@ -17,6 +17,10 @@
<div class="register-box-body">
<p class="login-box-msg">Register a new account</p>
{% if host == 'geld.nder.be' %}
<p class="text-info login-box-msg">Please note that an account on this site will only
work for one (1) week.</p>
{% endif %}
<form role="form" id="register" method="POST" action="{{ URL.to('/auth/register') }}">
<input type="hidden" name="_token" value="{{ csrf_token() }}">

View File

@ -47,7 +47,7 @@
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">
Store new bill
{{ 'store_new_bill'|_ }}
</button>
</div>
</div>

View File

@ -49,7 +49,7 @@
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">
Update bill
{{ 'update_bill'|_ }}
</button>
</div>
</div>

View File

@ -30,7 +30,7 @@
{{ ExpandedForm.optionsList('update','budget') }}
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">Update budget</button>
<button type="submit" class="btn pull-right btn-success">{{ 'update_budget'|_ }}</button>
</div>
</div>
</div>

View File

@ -31,7 +31,7 @@
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">
Store new category
{{ 'store_category'|_ }}
</button>
</div>
</div>

View File

@ -44,9 +44,9 @@
{% if journals|length > 0 %}
<ul>
{% for journal in journals %}
<li>#{{ journal.id }}: <a href="{{ route('transactions.show', [journal.id]) }}">{{ journal.description }}</a></li>
{% endfor %}
{% for journal in journals %}
<li>#{{ journal.id }}: <a href="{{ route('transactions.show', [journal.id]) }}">{{ journal.description }}</a></li>
{% endfor %}
</ul>
{% endif %}

View File

@ -33,7 +33,7 @@
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">
Store new currency
{{ 'store_currency'|_ }}
</button>
</div>
</div>

Some files were not shown because too many files have changed in this diff Show More