mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 09:22:33 +00:00
Updated some code [skip ci]
This commit is contained in:
@@ -2,4 +2,4 @@
|
|||||||
tools:
|
tools:
|
||||||
external_code_coverage:
|
external_code_coverage:
|
||||||
timeout: 1800 # Timeout in seconds.
|
timeout: 1800 # Timeout in seconds.
|
||||||
runs: 2
|
runs: 2
|
||||||
|
@@ -19,4 +19,4 @@ after_script:
|
|||||||
- CODECLIMATE_REPO_TOKEN=26489f9e854fcdf7e7660ba29c1455694685465b1f90329a79f7d2bf448acb61 ./vendor/bin/test-reporter --stdout > codeclimate.json
|
- CODECLIMATE_REPO_TOKEN=26489f9e854fcdf7e7660ba29c1455694685465b1f90329a79f7d2bf448acb61 ./vendor/bin/test-reporter --stdout > codeclimate.json
|
||||||
- "curl -X POST -d @codeclimate.json -H 'Content-Type: application/json' -H 'User-Agent: Code Climate (PHP Test Reporter v0.1.1)' https://codeclimate.com/test_reports"
|
- "curl -X POST -d @codeclimate.json -H 'Content-Type: application/json' -H 'User-Agent: Code Climate (PHP Test Reporter v0.1.1)' https://codeclimate.com/test_reports"
|
||||||
- wget https://scrutinizer-ci.com/ocular.phar
|
- wget https://scrutinizer-ci.com/ocular.phar
|
||||||
- php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
|
- php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml
|
||||||
|
@@ -6,7 +6,6 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
|||||||
use Input;
|
use Input;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Redirect;
|
use Redirect;
|
||||||
use Route;
|
|
||||||
use Session;
|
use Session;
|
||||||
use Steam;
|
use Steam;
|
||||||
|
|
||||||
|
@@ -108,4 +108,4 @@ class NewUserController extends Controller
|
|||||||
|
|
||||||
return Redirect::route('index');
|
return Redirect::route('index');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,4 +24,4 @@ use Zizaco\Entrust\EntrustPermission;
|
|||||||
*/
|
*/
|
||||||
class Permission extends EntrustPermission
|
class Permission extends EntrustPermission
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -25,4 +25,4 @@ use Zizaco\Entrust\EntrustRole;
|
|||||||
*/
|
*/
|
||||||
class Role extends EntrustRole
|
class Role extends EntrustRole
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,6 @@ use Carbon\Carbon;
|
|||||||
use Crypt;
|
use Crypt;
|
||||||
use FireflyIII\Models\Category;
|
use FireflyIII\Models\Category;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use Illuminate\Database\Query\JoinClause;
|
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use FireflyIII\Repositories\Shared\ComponentRepository;
|
use FireflyIII\Repositories\Shared\ComponentRepository;
|
||||||
/**
|
/**
|
||||||
|
@@ -4,6 +4,7 @@ namespace FireflyIII\Repositories\Shared;
|
|||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Database\Query\JoinClause;
|
use Illuminate\Database\Query\JoinClause;
|
||||||
|
use stdClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ComponentRepository
|
* Class ComponentRepository
|
||||||
@@ -15,42 +16,42 @@ class ComponentRepository
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $object
|
* @param stdClass $object
|
||||||
* @param Carbon $start
|
* @param Carbon $start
|
||||||
* @param Carbon $end
|
* @param Carbon $end
|
||||||
*
|
*
|
||||||
* @param bool $shared
|
* @param bool $shared
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function spentInPeriod($object, Carbon $start, Carbon $end, $shared = false)
|
protected function spentInPeriod(stdClass $object, Carbon $start, Carbon $end, $shared = false)
|
||||||
{
|
{
|
||||||
if ($shared === true) {
|
if ($shared === true) {
|
||||||
// shared is true.
|
// shared is true.
|
||||||
// always ignore transfers between accounts!
|
// always ignore transfers between accounts!
|
||||||
$sum
|
$sum
|
||||||
= $object->transactionjournals()
|
= $object->transactionjournals()
|
||||||
->transactionTypes(['Withdrawal'])
|
->transactionTypes(['Withdrawal'])
|
||||||
->before($end)->after($start)->get(['transaction_journals.*'])->sum('amount');
|
->before($end)->after($start)->get(['transaction_journals.*'])->sum('amount');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// do something else, SEE budgets.
|
// do something else, SEE budgets.
|
||||||
// get all journals in this month where the asset account is NOT shared.
|
// get all journals in this month where the asset account is NOT shared.
|
||||||
$sum = $object->transactionjournals()
|
$sum = $object->transactionjournals()
|
||||||
->before($end)
|
->before($end)
|
||||||
->after($start)
|
->after($start)
|
||||||
->transactionTypes(['Withdrawal'])
|
->transactionTypes(['Withdrawal'])
|
||||||
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||||
->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')
|
->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')
|
||||||
->leftJoin(
|
->leftJoin(
|
||||||
'account_meta', function (JoinClause $join) {
|
'account_meta', function (JoinClause $join) {
|
||||||
$join->on('account_meta.account_id', '=', 'accounts.id')->where('account_meta.name', '=', 'accountRole');
|
$join->on('account_meta.account_id', '=', 'accounts.id')->where('account_meta.name', '=', 'accountRole');
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
->where('account_meta.data', '!=', '"sharedAsset"')
|
->where('account_meta.data', '!=', '"sharedAsset"')
|
||||||
->get(['transaction_journals.*'])->sum('amount');
|
->get(['transaction_journals.*'])->sum('amount');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $sum;
|
return $sum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -75,26 +75,18 @@ class CacheProperties
|
|||||||
foreach ($this->properties as $property) {
|
foreach ($this->properties as $property) {
|
||||||
|
|
||||||
if ($property instanceof Collection || $property instanceof EloquentCollection) {
|
if ($property instanceof Collection || $property instanceof EloquentCollection) {
|
||||||
$this->md5 .= print_r($property->toArray(), true);
|
$this->md5 .= json_encode($property->toArray());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($property instanceof Carbon) {
|
if ($property instanceof Carbon) {
|
||||||
$this->md5 .= $property->toRfc3339String();
|
$this->md5 .= $property->toRfc3339String();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($property)) {
|
|
||||||
$this->md5 .= print_r($property, true);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_object($property)) {
|
if (is_object($property)) {
|
||||||
$this->md5 .= $property->__toString();
|
$this->md5 .= $property->__toString();
|
||||||
}
|
}
|
||||||
if (is_array($property)) {
|
|
||||||
$this->md5 .= print_r($property, true);
|
$this->md5 .= json_encode($property);
|
||||||
}
|
|
||||||
$this->md5 .= (string) $property;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->md5 = md5($this->md5);
|
$this->md5 = md5($this->md5);
|
||||||
@@ -107,4 +99,4 @@ class CacheProperties
|
|||||||
{
|
{
|
||||||
Cache::forever($this->md5, $data);
|
Cache::forever($this->md5, $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -45,10 +45,10 @@ return [
|
|||||||
'changePassword' => 'Verander je wachtwoord',
|
'changePassword' => 'Verander je wachtwoord',
|
||||||
|
|
||||||
// bills
|
// bills
|
||||||
'bills' => 'Rekeningen',
|
'bills' => 'Contracten',
|
||||||
'newBill' => 'Nieuwe rekening',
|
'newBill' => 'Nieuw contract',
|
||||||
'edit_bill' => 'Wijzig rekening ":name"',
|
'edit_bill' => 'Wijzig contract ":name"',
|
||||||
'delete_bill' => 'Verwijder rekening ":name"',
|
'delete_bill' => 'Verwijder contract ":name"',
|
||||||
|
|
||||||
// reminders
|
// reminders
|
||||||
'reminders' => 'Herinneringen',
|
'reminders' => 'Herinneringen',
|
||||||
|
@@ -45,7 +45,7 @@ return [
|
|||||||
'update_amount' => 'Bedrag bijwerken',
|
'update_amount' => 'Bedrag bijwerken',
|
||||||
|
|
||||||
// bills:
|
// bills:
|
||||||
'delete_bill' => 'Verwijder rekening ":name"',
|
'delete_bill' => 'Verwijder contract ":name"',
|
||||||
|
|
||||||
// accounts:
|
// accounts:
|
||||||
'details_for_asset' => 'Overzicht voor betaalrekening ":name"',
|
'details_for_asset' => 'Overzicht voor betaalrekening ":name"',
|
||||||
@@ -128,8 +128,8 @@ return [
|
|||||||
'newTransfer' => 'Nieuwe overschrijving',
|
'newTransfer' => 'Nieuwe overschrijving',
|
||||||
'moneyIn' => 'Inkomsten',
|
'moneyIn' => 'Inkomsten',
|
||||||
'moneyOut' => 'Uitgaven',
|
'moneyOut' => 'Uitgaven',
|
||||||
'billsToPay' => 'Openstaande rekeningen',
|
'billsToPay' => 'Openstaande contracten',
|
||||||
'billsPaid' => 'Betaalde rekeningen',
|
'billsPaid' => 'Betaalde contracten',
|
||||||
'viewDetails' => 'Meer info',
|
'viewDetails' => 'Meer info',
|
||||||
'divided' => 'verdeeld',
|
'divided' => 'verdeeld',
|
||||||
'toDivide' => 'te verdelen',
|
'toDivide' => 'te verdelen',
|
||||||
@@ -161,7 +161,7 @@ return [
|
|||||||
'transfers' => 'Overschrijvingen',
|
'transfers' => 'Overschrijvingen',
|
||||||
'moneyManagement' => 'Geldbeheer',
|
'moneyManagement' => 'Geldbeheer',
|
||||||
'piggyBanks' => 'Spaarpotjes',
|
'piggyBanks' => 'Spaarpotjes',
|
||||||
'bills' => 'Rekeningen',
|
'bills' => 'Contracten',
|
||||||
'createNew' => 'Nieuw',
|
'createNew' => 'Nieuw',
|
||||||
'withdrawal' => 'Uitgave',
|
'withdrawal' => 'Uitgave',
|
||||||
'deposit' => 'Inkomsten',
|
'deposit' => 'Inkomsten',
|
||||||
@@ -170,7 +170,7 @@ return [
|
|||||||
'Withdrawal' => 'Uitgave',
|
'Withdrawal' => 'Uitgave',
|
||||||
'Deposit' => 'Inkomsten',
|
'Deposit' => 'Inkomsten',
|
||||||
'Transfer' => 'Overschrijving',
|
'Transfer' => 'Overschrijving',
|
||||||
'bill' => 'Rekening',
|
'bill' => 'Contracten',
|
||||||
'yes' => 'Ja',
|
'yes' => 'Ja',
|
||||||
'no' => 'Nee',
|
'no' => 'Nee',
|
||||||
'amount' => 'Bedrag',
|
'amount' => 'Bedrag',
|
||||||
@@ -227,7 +227,7 @@ return [
|
|||||||
'noBudget' => '(geen budget)',
|
'noBudget' => '(geen budget)',
|
||||||
'maxAmount' => 'Maximaal bedrag',
|
'maxAmount' => 'Maximaal bedrag',
|
||||||
'minAmount' => 'Minimaal bedrag',
|
'minAmount' => 'Minimaal bedrag',
|
||||||
'billEntry' => 'Bedrag voor deze rekening',
|
'billEntry' => 'Bedrag voor dit contract',
|
||||||
'name' => 'Naam',
|
'name' => 'Naam',
|
||||||
'date' => 'Datum',
|
'date' => 'Datum',
|
||||||
'paid' => 'Betaald',
|
'paid' => 'Betaald',
|
||||||
|
@@ -58,7 +58,7 @@ return [
|
|||||||
'noBudget' => '(geen budget)',
|
'noBudget' => '(geen budget)',
|
||||||
|
|
||||||
'delete_account' => 'Verwijder rekening ":name"',
|
'delete_account' => 'Verwijder rekening ":name"',
|
||||||
'delete_bill' => 'Verwijder rekening ":name"',
|
'delete_bill' => 'Verwijder contract ":name"',
|
||||||
'delete_budget' => 'Verwijder budget ":name"',
|
'delete_budget' => 'Verwijder budget ":name"',
|
||||||
'delete_category' => 'Verwijder categorie ":name"',
|
'delete_category' => 'Verwijder categorie ":name"',
|
||||||
'delete_currency' => 'Verwijder munteenheid ":name"',
|
'delete_currency' => 'Verwijder munteenheid ":name"',
|
||||||
@@ -66,7 +66,7 @@ return [
|
|||||||
'delete_journal' => 'Verwijder transactie met omschrijving ":description"',
|
'delete_journal' => 'Verwijder transactie met omschrijving ":description"',
|
||||||
|
|
||||||
'account_areYouSure' => 'Weet je zeker dat je de rekening 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 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?',
|
'budget_areYouSure' => 'Weet je zeker dat je het budget met naam ":name" wilt verwijderen?',
|
||||||
'category_areYouSure' => 'Weet je zeker dat je het category met naam ":name" wilt verwijderen?',
|
'category_areYouSure' => 'Weet je zeker dat je het category met naam ":name" wilt verwijderen?',
|
||||||
'currency_areYouSure' => 'Weet je zeker dat je de munteenheid met naam ":name" wilt verwijderen?',
|
'currency_areYouSure' => 'Weet je zeker dat je de munteenheid met naam ":name" wilt verwijderen?',
|
||||||
@@ -78,8 +78,8 @@ return [
|
|||||||
'|Ook alle :count transacties verbonden aan deze rekening worden verwijderd.',
|
'|Ook alle :count transacties verbonden aan deze rekening worden verwijderd.',
|
||||||
'also_delete_piggyBanks' => 'Ook het spaarpotje verbonden aan deze rekening wordt verwijderd.' .
|
'also_delete_piggyBanks' => 'Ook het spaarpotje verbonden aan deze rekening wordt verwijderd.' .
|
||||||
'|Ook alle :count spaarpotjes verbonden aan deze rekening worden verwijderd.',
|
'|Ook alle :count spaarpotjes verbonden aan deze rekening worden verwijderd.',
|
||||||
'bill_keep_transactions' => 'De transactie verbonden aan deze rekening blijft bewaard.' .
|
'bill_keep_transactions' => 'De transactie verbonden aan dit contract blijft bewaard.' .
|
||||||
'|De :count transacties verbonden aan deze rekening blijven bewaard.',
|
'|De :count transacties verbonden aan dit contract blijven bewaard.',
|
||||||
'budget_keep_transactions' => 'De transactie verbonden aan dit budget blijft bewaard.' .
|
'budget_keep_transactions' => 'De transactie verbonden aan dit budget blijft bewaard.' .
|
||||||
'|De :count transacties verbonden aan dit budget blijven bewaard.',
|
'|De :count transacties verbonden aan dit budget blijven bewaard.',
|
||||||
'category_keep_transactions' => 'De transactie verbonden aan deze categorie blijft bewaard.' .
|
'category_keep_transactions' => 'De transactie verbonden aan deze categorie blijft bewaard.' .
|
||||||
|
@@ -23,7 +23,7 @@ return [
|
|||||||
'to' => 'Naar',
|
'to' => 'Naar',
|
||||||
'budget' => 'Budget',
|
'budget' => 'Budget',
|
||||||
'category' => 'Categorie',
|
'category' => 'Categorie',
|
||||||
'bill' => 'Rekening',
|
'bill' => 'Contract',
|
||||||
'withdrawal' => 'Uitgave',
|
'withdrawal' => 'Uitgave',
|
||||||
'deposit' => 'Inkomsten',
|
'deposit' => 'Inkomsten',
|
||||||
'transfer' => 'Overschrijving',
|
'transfer' => 'Overschrijving',
|
||||||
|
Reference in New Issue
Block a user