mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-27 17:31:09 -06:00
Updated some code [skip ci]
This commit is contained in:
parent
62d5a1da87
commit
834b1afb38
@ -2,4 +2,4 @@
|
||||
tools:
|
||||
external_code_coverage:
|
||||
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
|
||||
- "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
|
||||
- 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 Preferences;
|
||||
use Redirect;
|
||||
use Route;
|
||||
use Session;
|
||||
use Steam;
|
||||
|
||||
|
@ -108,4 +108,4 @@ class NewUserController extends Controller
|
||||
|
||||
return Redirect::route('index');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,4 +24,4 @@ use Zizaco\Entrust\EntrustPermission;
|
||||
*/
|
||||
class Permission extends EntrustPermission
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -25,4 +25,4 @@ use Zizaco\Entrust\EntrustRole;
|
||||
*/
|
||||
class Role extends EntrustRole
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ use Carbon\Carbon;
|
||||
use Crypt;
|
||||
use FireflyIII\Models\Category;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use Illuminate\Database\Query\JoinClause;
|
||||
use Illuminate\Support\Collection;
|
||||
use FireflyIII\Repositories\Shared\ComponentRepository;
|
||||
/**
|
||||
|
@ -4,6 +4,7 @@ namespace FireflyIII\Repositories\Shared;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Query\JoinClause;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* Class ComponentRepository
|
||||
@ -15,42 +16,42 @@ class ComponentRepository
|
||||
|
||||
|
||||
/**
|
||||
* @param $object
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param stdClass $object
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @param bool $shared
|
||||
* @param bool $shared
|
||||
*
|
||||
* @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) {
|
||||
// shared is true.
|
||||
// always ignore transfers between accounts!
|
||||
$sum
|
||||
= $object->transactionjournals()
|
||||
->transactionTypes(['Withdrawal'])
|
||||
->before($end)->after($start)->get(['transaction_journals.*'])->sum('amount');
|
||||
->transactionTypes(['Withdrawal'])
|
||||
->before($end)->after($start)->get(['transaction_journals.*'])->sum('amount');
|
||||
|
||||
} else {
|
||||
// do something else, SEE budgets.
|
||||
// get all journals in this month where the asset account is NOT shared.
|
||||
$sum = $object->transactionjournals()
|
||||
->before($end)
|
||||
->after($start)
|
||||
->transactionTypes(['Withdrawal'])
|
||||
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')
|
||||
->leftJoin(
|
||||
'account_meta', function (JoinClause $join) {
|
||||
$join->on('account_meta.account_id', '=', 'accounts.id')->where('account_meta.name', '=', 'accountRole');
|
||||
}
|
||||
)
|
||||
->where('account_meta.data', '!=', '"sharedAsset"')
|
||||
->get(['transaction_journals.*'])->sum('amount');
|
||||
->before($end)
|
||||
->after($start)
|
||||
->transactionTypes(['Withdrawal'])
|
||||
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')
|
||||
->leftJoin(
|
||||
'account_meta', function (JoinClause $join) {
|
||||
$join->on('account_meta.account_id', '=', 'accounts.id')->where('account_meta.name', '=', 'accountRole');
|
||||
}
|
||||
)
|
||||
->where('account_meta.data', '!=', '"sharedAsset"')
|
||||
->get(['transaction_journals.*'])->sum('amount');
|
||||
}
|
||||
|
||||
return $sum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,26 +75,18 @@ class CacheProperties
|
||||
foreach ($this->properties as $property) {
|
||||
|
||||
if ($property instanceof Collection || $property instanceof EloquentCollection) {
|
||||
$this->md5 .= print_r($property->toArray(), true);
|
||||
$this->md5 .= json_encode($property->toArray());
|
||||
continue;
|
||||
}
|
||||
if ($property instanceof Carbon) {
|
||||
$this->md5 .= $property->toRfc3339String();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_array($property)) {
|
||||
$this->md5 .= print_r($property, true);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_object($property)) {
|
||||
$this->md5 .= $property->__toString();
|
||||
}
|
||||
if (is_array($property)) {
|
||||
$this->md5 .= print_r($property, true);
|
||||
}
|
||||
$this->md5 .= (string) $property;
|
||||
|
||||
$this->md5 .= json_encode($property);
|
||||
}
|
||||
|
||||
$this->md5 = md5($this->md5);
|
||||
@ -107,4 +99,4 @@ class CacheProperties
|
||||
{
|
||||
Cache::forever($this->md5, $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,10 +45,10 @@ return [
|
||||
'changePassword' => 'Verander je wachtwoord',
|
||||
|
||||
// bills
|
||||
'bills' => 'Rekeningen',
|
||||
'newBill' => 'Nieuwe rekening',
|
||||
'edit_bill' => 'Wijzig rekening ":name"',
|
||||
'delete_bill' => 'Verwijder rekening ":name"',
|
||||
'bills' => 'Contracten',
|
||||
'newBill' => 'Nieuw contract',
|
||||
'edit_bill' => 'Wijzig contract ":name"',
|
||||
'delete_bill' => 'Verwijder contract ":name"',
|
||||
|
||||
// reminders
|
||||
'reminders' => 'Herinneringen',
|
||||
|
@ -45,7 +45,7 @@ return [
|
||||
'update_amount' => 'Bedrag bijwerken',
|
||||
|
||||
// bills:
|
||||
'delete_bill' => 'Verwijder rekening ":name"',
|
||||
'delete_bill' => 'Verwijder contract ":name"',
|
||||
|
||||
// accounts:
|
||||
'details_for_asset' => 'Overzicht voor betaalrekening ":name"',
|
||||
@ -128,8 +128,8 @@ return [
|
||||
'newTransfer' => 'Nieuwe overschrijving',
|
||||
'moneyIn' => 'Inkomsten',
|
||||
'moneyOut' => 'Uitgaven',
|
||||
'billsToPay' => 'Openstaande rekeningen',
|
||||
'billsPaid' => 'Betaalde rekeningen',
|
||||
'billsToPay' => 'Openstaande contracten',
|
||||
'billsPaid' => 'Betaalde contracten',
|
||||
'viewDetails' => 'Meer info',
|
||||
'divided' => 'verdeeld',
|
||||
'toDivide' => 'te verdelen',
|
||||
@ -161,7 +161,7 @@ return [
|
||||
'transfers' => 'Overschrijvingen',
|
||||
'moneyManagement' => 'Geldbeheer',
|
||||
'piggyBanks' => 'Spaarpotjes',
|
||||
'bills' => 'Rekeningen',
|
||||
'bills' => 'Contracten',
|
||||
'createNew' => 'Nieuw',
|
||||
'withdrawal' => 'Uitgave',
|
||||
'deposit' => 'Inkomsten',
|
||||
@ -170,7 +170,7 @@ return [
|
||||
'Withdrawal' => 'Uitgave',
|
||||
'Deposit' => 'Inkomsten',
|
||||
'Transfer' => 'Overschrijving',
|
||||
'bill' => 'Rekening',
|
||||
'bill' => 'Contracten',
|
||||
'yes' => 'Ja',
|
||||
'no' => 'Nee',
|
||||
'amount' => 'Bedrag',
|
||||
@ -227,7 +227,7 @@ return [
|
||||
'noBudget' => '(geen budget)',
|
||||
'maxAmount' => 'Maximaal bedrag',
|
||||
'minAmount' => 'Minimaal bedrag',
|
||||
'billEntry' => 'Bedrag voor deze rekening',
|
||||
'billEntry' => 'Bedrag voor dit contract',
|
||||
'name' => 'Naam',
|
||||
'date' => 'Datum',
|
||||
'paid' => 'Betaald',
|
||||
|
@ -58,7 +58,7 @@ return [
|
||||
'noBudget' => '(geen budget)',
|
||||
|
||||
'delete_account' => 'Verwijder rekening ":name"',
|
||||
'delete_bill' => 'Verwijder rekening ":name"',
|
||||
'delete_bill' => 'Verwijder contract ":name"',
|
||||
'delete_budget' => 'Verwijder budget ":name"',
|
||||
'delete_category' => 'Verwijder categorie ":name"',
|
||||
'delete_currency' => 'Verwijder munteenheid ":name"',
|
||||
@ -66,7 +66,7 @@ return [
|
||||
'delete_journal' => 'Verwijder transactie met omschrijving ":description"',
|
||||
|
||||
'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?',
|
||||
'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?',
|
||||
@ -78,8 +78,8 @@ return [
|
||||
'|Ook alle :count transacties verbonden aan deze rekening worden verwijderd.',
|
||||
'also_delete_piggyBanks' => 'Ook het spaarpotje verbonden aan deze rekening wordt verwijderd.' .
|
||||
'|Ook alle :count spaarpotjes verbonden aan deze rekening worden verwijderd.',
|
||||
'bill_keep_transactions' => 'De transactie verbonden aan deze rekening blijft bewaard.' .
|
||||
'|De :count transacties verbonden aan deze rekening blijven bewaard.',
|
||||
'bill_keep_transactions' => 'De transactie verbonden aan dit contract blijft bewaard.' .
|
||||
'|De :count transacties verbonden aan dit contract blijven bewaard.',
|
||||
'budget_keep_transactions' => 'De transactie verbonden aan dit budget blijft bewaard.' .
|
||||
'|De :count transacties verbonden aan dit budget blijven bewaard.',
|
||||
'category_keep_transactions' => 'De transactie verbonden aan deze categorie blijft bewaard.' .
|
||||
|
@ -23,7 +23,7 @@ return [
|
||||
'to' => 'Naar',
|
||||
'budget' => 'Budget',
|
||||
'category' => 'Categorie',
|
||||
'bill' => 'Rekening',
|
||||
'bill' => 'Contract',
|
||||
'withdrawal' => 'Uitgave',
|
||||
'deposit' => 'Inkomsten',
|
||||
'transfer' => 'Overschrijving',
|
||||
|
Loading…
Reference in New Issue
Block a user