mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 22:21:42 +00:00
Clean up various code.
This commit is contained in:
@@ -92,9 +92,6 @@ class Amount
|
||||
return $user->currencies()->orderBy('code', 'ASC')->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function getDefaultCurrency(): TransactionCurrency
|
||||
{
|
||||
/** @var User $user */
|
||||
|
||||
@@ -577,39 +577,12 @@ class ExportDataGenerator
|
||||
$recurringRepos->setUser($this->user);
|
||||
$header = [
|
||||
// recurrence:
|
||||
'user_id',
|
||||
'recurrence_id',
|
||||
'row_contains',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'type',
|
||||
'title',
|
||||
'description',
|
||||
'first_date',
|
||||
'repeat_until',
|
||||
'latest_date',
|
||||
'repetitions',
|
||||
'apply_rules',
|
||||
'active',
|
||||
'user_id', 'recurrence_id', 'row_contains', 'created_at', 'updated_at', 'type', 'title', 'description', 'first_date', 'repeat_until', 'latest_date', 'repetitions', 'apply_rules', 'active',
|
||||
|
||||
// repetition info:
|
||||
'type',
|
||||
'moment',
|
||||
'skip',
|
||||
'weekend',
|
||||
'type', 'moment', 'skip', 'weekend',
|
||||
// transactions + meta:
|
||||
'currency_code',
|
||||
'foreign_currency_code',
|
||||
'source_name',
|
||||
'source_type',
|
||||
'destination_name',
|
||||
'destination_type',
|
||||
'amount',
|
||||
'foreign_amount',
|
||||
'category',
|
||||
'budget',
|
||||
'piggy_bank',
|
||||
'tags',
|
||||
'currency_code', 'foreign_currency_code', 'source_name', 'source_type', 'destination_name', 'destination_type', 'amount', 'foreign_amount', 'category', 'budget', 'piggy_bank', 'tags',
|
||||
];
|
||||
$records = [];
|
||||
$recurrences = $recurringRepos->getAll();
|
||||
@@ -618,20 +591,9 @@ class ExportDataGenerator
|
||||
foreach ($recurrences as $recurrence) {
|
||||
// add recurrence:
|
||||
$records[] = [
|
||||
$this->user->id,
|
||||
$recurrence->id,
|
||||
$this->user->id, $recurrence->id,
|
||||
'recurrence',
|
||||
$recurrence->created_at->toAtomString(),
|
||||
$recurrence->updated_at->toAtomString(),
|
||||
$recurrence->transactionType->type,
|
||||
$recurrence->title,
|
||||
$recurrence->description,
|
||||
$recurrence->first_date?->format('Y-m-d'),
|
||||
$recurrence->repeat_until?->format('Y-m-d'),
|
||||
$recurrence->latest_date?->format('Y-m-d'),
|
||||
$recurrence->repetitions,
|
||||
$recurrence->apply_rules,
|
||||
$recurrence->active,
|
||||
$recurrence->created_at->toAtomString(), $recurrence->updated_at->toAtomString(), $recurrence->transactionType->type, $recurrence->title, $recurrence->description, $recurrence->first_date?->format('Y-m-d'), $recurrence->repeat_until?->format('Y-m-d'), $recurrence->latest_date?->format('Y-m-d'), $recurrence->repetitions, $recurrence->apply_rules, $recurrence->active,
|
||||
];
|
||||
|
||||
// add new row for each repetition
|
||||
@@ -642,23 +604,10 @@ class ExportDataGenerator
|
||||
$this->user->id,
|
||||
$recurrence->id,
|
||||
'repetition',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null, null, null, null, null, null, null, null, null, null, null,
|
||||
|
||||
// repetition:
|
||||
$repetition->repetition_type,
|
||||
$repetition->repetition_moment,
|
||||
$repetition->repetition_skip,
|
||||
$repetition->weekend,
|
||||
$repetition->repetition_type, $repetition->repetition_moment, $repetition->repetition_skip, $repetition->weekend,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -674,37 +623,13 @@ class ExportDataGenerator
|
||||
$this->user->id,
|
||||
$recurrence->id,
|
||||
'transaction',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null, null, null, null, null, null, null, null, null, null, null,
|
||||
|
||||
// repetition:
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null, null, null, null,
|
||||
|
||||
// transaction:
|
||||
$transaction->transactionCurrency->code,
|
||||
$transaction->foreignCurrency?->code,
|
||||
$transaction->sourceAccount->name,
|
||||
$transaction->sourceAccount->accountType->type,
|
||||
$transaction->destinationAccount->name,
|
||||
$transaction->destinationAccount->accountType->type,
|
||||
$transaction->amount,
|
||||
$transaction->foreign_amount,
|
||||
$categoryName,
|
||||
$budgetId,
|
||||
$piggyBankId,
|
||||
implode(',', $tags),
|
||||
$transaction->transactionCurrency->code, $transaction->foreignCurrency?->code, $transaction->sourceAccount->name, $transaction->sourceAccount->accountType->type, $transaction->destinationAccount->name, $transaction->destinationAccount->accountType->type, $transaction->amount, $transaction->foreign_amount, $categoryName, $budgetId, $piggyBankId, implode(',', $tags),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -739,31 +664,7 @@ class ExportDataGenerator
|
||||
*/
|
||||
private function exportRules(): string
|
||||
{
|
||||
$header = [
|
||||
'user_id',
|
||||
'rule_id',
|
||||
'row_contains',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'group_id',
|
||||
'group_name',
|
||||
'title',
|
||||
'description',
|
||||
'order',
|
||||
'active',
|
||||
'stop_processing',
|
||||
'strict',
|
||||
'trigger_type',
|
||||
'trigger_value',
|
||||
'trigger_order',
|
||||
'trigger_active',
|
||||
'trigger_stop_processing',
|
||||
'action_type',
|
||||
'action_value',
|
||||
'action_order',
|
||||
'action_active',
|
||||
'action_stop_processing',
|
||||
];
|
||||
$header = ['user_id', 'rule_id', 'row_contains', 'created_at', 'updated_at', 'group_id', 'title', 'description', 'order', 'active', 'stop_processing', 'strict', 'trigger_type', 'trigger_value', 'trigger_order', 'trigger_active', 'trigger_stop_processing', 'action_type', 'action_value', 'action_order', 'action_active', 'action_stop_processing'];
|
||||
$ruleRepos = app(RuleRepositoryInterface::class);
|
||||
$ruleRepos->setUser($this->user);
|
||||
$rules = $ruleRepos->getAll();
|
||||
@@ -772,19 +673,9 @@ class ExportDataGenerator
|
||||
/** @var Rule $rule */
|
||||
foreach ($rules as $rule) {
|
||||
$records[] = [
|
||||
$this->user->id,
|
||||
$rule->id,
|
||||
$this->user->id, $rule->id,
|
||||
'rule',
|
||||
$rule->created_at->toAtomString(),
|
||||
$rule->updated_at->toAtomString(),
|
||||
$rule->ruleGroup->id,
|
||||
$rule->ruleGroup->title,
|
||||
$rule->title,
|
||||
$rule->description,
|
||||
$rule->order,
|
||||
$rule->active,
|
||||
$rule->stop_processing,
|
||||
$rule->strict,
|
||||
$rule->created_at->toAtomString(), $rule->updated_at->toAtomString(), $rule->ruleGroup->id, $rule->ruleGroup->title, $rule->title, $rule->description, $rule->order, $rule->active, $rule->stop_processing, $rule->strict,
|
||||
];
|
||||
|
||||
/** @var RuleTrigger $trigger */
|
||||
@@ -793,21 +684,8 @@ class ExportDataGenerator
|
||||
$this->user->id,
|
||||
$rule->id,
|
||||
'trigger',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$trigger->trigger_type,
|
||||
$trigger->trigger_value,
|
||||
$trigger->order,
|
||||
$trigger->active,
|
||||
$trigger->stop_processing,
|
||||
null, null, null, null, null, null, null, null, null, null,
|
||||
$trigger->trigger_type, $trigger->trigger_value, $trigger->order, $trigger->active, $trigger->stop_processing,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -817,26 +695,8 @@ class ExportDataGenerator
|
||||
$this->user->id,
|
||||
$rule->id,
|
||||
'action',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$action->action_type,
|
||||
$action->action_value,
|
||||
$action->order,
|
||||
$action->active,
|
||||
$action->stop_processing,
|
||||
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
|
||||
$action->action_type, $action->action_value, $action->order, $action->active, $action->stop_processing,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -927,34 +787,7 @@ class ExportDataGenerator
|
||||
private function exportTransactions(): string
|
||||
{
|
||||
// TODO better place for keys?
|
||||
$header = [
|
||||
'user_id',
|
||||
'group_id',
|
||||
'journal_id',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'group_title',
|
||||
'type',
|
||||
'amount',
|
||||
'foreign_amount',
|
||||
'currency_code',
|
||||
'foreign_currency_code',
|
||||
'description',
|
||||
'date',
|
||||
'source_name',
|
||||
'source_iban',
|
||||
'source_type',
|
||||
'destination_name',
|
||||
'destination_iban',
|
||||
'destination_type',
|
||||
'reconciled',
|
||||
'category',
|
||||
'budget',
|
||||
'bill',
|
||||
'tags',
|
||||
'notes',
|
||||
// all optional meta fields:
|
||||
];
|
||||
$header = ['user_id', 'group_id', 'journal_id', 'created_at', 'updated_at', 'group_title', 'type', 'amount', 'foreign_amount', 'currency_code', 'foreign_currency_code', 'description', 'date', 'source_name', 'source_iban', 'source_type', 'destination_name', 'destination_iban', 'destination_type', 'reconciled', 'category', 'budget', 'bill', 'tags', 'notes'];
|
||||
|
||||
$metaFields = config('firefly.journal_meta_fields');
|
||||
$header = array_merge($header, $metaFields);
|
||||
@@ -980,65 +813,21 @@ class ExportDataGenerator
|
||||
foreach ($journals as $journal) {
|
||||
$metaData = $repository->getMetaFields($journal['transaction_journal_id'], $metaFields);
|
||||
$records[] = [
|
||||
$journal['user_id'],
|
||||
$journal['transaction_group_id'],
|
||||
$journal['transaction_journal_id'],
|
||||
$journal['created_at']->toAtomString(),
|
||||
$journal['updated_at']->toAtomString(),
|
||||
$journal['transaction_group_title'],
|
||||
$journal['transaction_type_type'],
|
||||
$journal['amount'],
|
||||
$journal['foreign_amount'],
|
||||
$journal['currency_code'],
|
||||
$journal['foreign_currency_code'],
|
||||
$journal['description'],
|
||||
$journal['date']->toAtomString(),
|
||||
$journal['source_account_name'],
|
||||
$journal['source_account_iban'],
|
||||
$journal['source_account_type'],
|
||||
$journal['destination_account_name'],
|
||||
$journal['destination_account_iban'],
|
||||
$journal['destination_account_type'],
|
||||
$journal['reconciled'],
|
||||
$journal['category_name'],
|
||||
$journal['budget_name'],
|
||||
$journal['bill_name'],
|
||||
$journal['user_id'], $journal['transaction_group_id'], $journal['transaction_journal_id'], $journal['created_at']->toAtomString(), $journal['updated_at']->toAtomString(), $journal['transaction_group_title'], $journal['transaction_type_type'], $journal['amount'], $journal['foreign_amount'], $journal['currency_code'], $journal['foreign_currency_code'], $journal['description'], $journal['date']->toAtomString(), $journal['source_account_name'], $journal['source_account_iban'], $journal['source_account_type'], $journal['destination_account_name'], $journal['destination_account_iban'], $journal['destination_account_type'], $journal['reconciled'], $journal['category_name'], $journal['budget_name'], $journal['bill_name'],
|
||||
$this->mergeTags($journal['tags']),
|
||||
$this->clearStringKeepNewlines($journal['notes']),
|
||||
|
||||
// export also the optional fields (ALL)
|
||||
|
||||
// sepa
|
||||
$metaData['sepa_cc'],
|
||||
$metaData['sepa_ct_op'],
|
||||
$metaData['sepa_ct_id'],
|
||||
$metaData['sepa_db'],
|
||||
$metaData['sepa_country'],
|
||||
$metaData['sepa_ep'],
|
||||
$metaData['sepa_ci'],
|
||||
$metaData['sepa_batch_id'],
|
||||
$metaData['external_url'],
|
||||
$metaData['sepa_cc'], $metaData['sepa_ct_op'], $metaData['sepa_ct_id'], $metaData['sepa_db'], $metaData['sepa_country'], $metaData['sepa_ep'], $metaData['sepa_ci'], $metaData['sepa_batch_id'], $metaData['external_url'],
|
||||
|
||||
// dates
|
||||
$metaData['interest_date'],
|
||||
$metaData['book_date'],
|
||||
$metaData['process_date'],
|
||||
$metaData['due_date'],
|
||||
$metaData['payment_date'],
|
||||
$metaData['invoice_date'],
|
||||
$metaData['interest_date'], $metaData['book_date'], $metaData['process_date'], $metaData['due_date'], $metaData['payment_date'], $metaData['invoice_date'],
|
||||
|
||||
// others
|
||||
$metaData['recurrence_id'],
|
||||
$metaData['internal_reference'],
|
||||
$metaData['bunq_payment_id'],
|
||||
$metaData['import_hash'],
|
||||
$metaData['import_hash_v2'],
|
||||
$metaData['external_id'],
|
||||
$metaData['original_source'],
|
||||
$metaData['recurrence_id'], $metaData['internal_reference'], $metaData['bunq_payment_id'], $metaData['import_hash'], $metaData['import_hash_v2'], $metaData['external_id'], $metaData['original_source'],
|
||||
|
||||
// recurring transactions
|
||||
$metaData['recurrence_total'],
|
||||
$metaData['recurrence_count'],
|
||||
$metaData['recurrence_total'], $metaData['recurrence_count'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -84,9 +84,9 @@ trait ModelInformation
|
||||
/** @var AccountType $mortgage */
|
||||
$mortgage = $repository->getAccountTypeByType(AccountType::MORTGAGE);
|
||||
$liabilityTypes = [
|
||||
$debt->id => (string)trans(sprintf('firefly.account_type_%s', AccountType::DEBT)),
|
||||
$loan->id => (string)trans(sprintf('firefly.account_type_%s', AccountType::LOAN)),
|
||||
$mortgage->id => (string)trans(sprintf('firefly.account_type_%s', AccountType::MORTGAGE)),
|
||||
$debt->id => (string) trans(sprintf('firefly.account_type_%s', AccountType::DEBT)),
|
||||
$loan->id => (string) trans(sprintf('firefly.account_type_%s', AccountType::LOAN)),
|
||||
$mortgage->id => (string) trans(sprintf('firefly.account_type_%s', AccountType::MORTGAGE)),
|
||||
];
|
||||
asort($liabilityTypes);
|
||||
|
||||
@@ -97,7 +97,7 @@ trait ModelInformation
|
||||
{
|
||||
$roles = [];
|
||||
foreach (config('firefly.accountRoles') as $role) {
|
||||
$roles[$role] = (string)trans(sprintf('firefly.account_role_%s', $role));
|
||||
$roles[$role] = (string) trans(sprintf('firefly.account_role_%s', $role));
|
||||
}
|
||||
|
||||
return $roles;
|
||||
@@ -115,7 +115,7 @@ trait ModelInformation
|
||||
$triggers = [];
|
||||
foreach ($operators as $key => $operator) {
|
||||
if ('user_action' !== $key && false === $operator['alias']) {
|
||||
$triggers[$key] = (string)trans(sprintf('firefly.rule_trigger_%s_choice', $key));
|
||||
$triggers[$key] = (string) trans(sprintf('firefly.rule_trigger_%s_choice', $key));
|
||||
}
|
||||
}
|
||||
asort($triggers);
|
||||
@@ -156,6 +156,8 @@ trait ModelInformation
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
*/
|
||||
private function getTriggersForJournal(TransactionJournal $journal): array
|
||||
{
|
||||
@@ -164,7 +166,7 @@ trait ModelInformation
|
||||
$triggers = [];
|
||||
foreach ($operators as $key => $operator) {
|
||||
if ('user_action' !== $key && false === $operator['alias']) {
|
||||
$triggers[$key] = (string)trans(sprintf('firefly.rule_trigger_%s_choice', $key));
|
||||
$triggers[$key] = (string) trans(sprintf('firefly.rule_trigger_%s_choice', $key));
|
||||
}
|
||||
}
|
||||
asort($triggers);
|
||||
|
||||
@@ -215,6 +215,8 @@ class Steam
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
*/
|
||||
public function balanceInRangeConverted(Account $account, Carbon $start, Carbon $end, TransactionCurrency $native): array
|
||||
{
|
||||
@@ -317,22 +319,36 @@ class Steam
|
||||
}
|
||||
|
||||
/**
|
||||
* selection of transactions
|
||||
* 1: all normal transactions. No foreign currency info. In $currency. Need conversion.
|
||||
* 2: all normal transactions. No foreign currency info. In $native. Need NO conversion.
|
||||
* 3: all normal transactions. No foreign currency info. In neither currency. Need conversion.
|
||||
* Then, select everything with foreign currency info:
|
||||
* 4. All transactions with foreign currency info in $native. Normal currency value is ignored. Do not need
|
||||
* conversion.
|
||||
* 5. All transactions with foreign currency info NOT in $native, but currency info in $currency. Need conversion.
|
||||
* 6. All transactions with foreign currency info NOT in $native, and currency info NOT in $currency. Need
|
||||
* conversion.
|
||||
*
|
||||
* Gets balance at the end of current month by default. Returns the balance converted
|
||||
* to the indicated currency ($native).
|
||||
*
|
||||
* @throws FireflyException
|
||||
*
|
||||
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
||||
*/
|
||||
public function balanceConverted(Account $account, Carbon $date, TransactionCurrency $native): string
|
||||
{
|
||||
// app('log')->debug(sprintf('Now in balanceConverted (%s) for account #%d, converting to %s', $date->format('Y-m-d'), $account->id, $native->code));
|
||||
app('log')->debug(sprintf('Now in balanceConverted (%s) for account #%d, converting to %s', $date->format('Y-m-d'), $account->id, $native->code));
|
||||
$cache = new CacheProperties();
|
||||
$cache->addProperty($account->id);
|
||||
$cache->addProperty('balance');
|
||||
$cache->addProperty($date);
|
||||
$cache->addProperty($native->id);
|
||||
if ($cache->has()) {
|
||||
// Log::debug('Cached!');
|
||||
// return $cache->get();
|
||||
Log::debug('Cached!');
|
||||
|
||||
return $cache->get();
|
||||
}
|
||||
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
@@ -344,20 +360,9 @@ class Steam
|
||||
return $this->balance($account, $date);
|
||||
}
|
||||
|
||||
/**
|
||||
* selection of transactions
|
||||
* 1: all normal transactions. No foreign currency info. In $currency. Need conversion.
|
||||
* 2: all normal transactions. No foreign currency info. In $native. Need NO conversion.
|
||||
* 3: all normal transactions. No foreign currency info. In neither currency. Need conversion.
|
||||
* Then, select everything with foreign currency info:
|
||||
* 4. All transactions with foreign currency info in $native. Normal currency value is ignored. Do not need conversion.
|
||||
* 5. All transactions with foreign currency info NOT in $native, but currency info in $currency. Need conversion.
|
||||
* 6. All transactions with foreign currency info NOT in $native, and currency info NOT in $currency. Need conversion.
|
||||
*/
|
||||
$new = [];
|
||||
$existing = [];
|
||||
// 1
|
||||
$new[] = $account->transactions()
|
||||
$new[] = $account->transactions() // 1
|
||||
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
|
||||
->where('transaction_journals.date', '<=', $date->format('Y-m-d 23:59:59'))
|
||||
->where('transactions.transaction_currency_id', $currency->id)
|
||||
@@ -365,8 +370,7 @@ class Steam
|
||||
->get(['transaction_journals.date', 'transactions.amount'])->toArray()
|
||||
;
|
||||
app('log')->debug(sprintf('%d transaction(s) in set #1', count($new[0])));
|
||||
// 2
|
||||
$existing[] = $account->transactions()
|
||||
$existing[] = $account->transactions() // 2
|
||||
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
|
||||
->where('transaction_journals.date', '<=', $date->format('Y-m-d 23:59:59'))
|
||||
->where('transactions.transaction_currency_id', $native->id)
|
||||
@@ -374,8 +378,7 @@ class Steam
|
||||
->get(['transactions.amount'])->toArray()
|
||||
;
|
||||
app('log')->debug(sprintf('%d transaction(s) in set #2', count($existing[0])));
|
||||
// 3
|
||||
$new[] = $account->transactions()
|
||||
$new[] = $account->transactions() // 3
|
||||
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
|
||||
->where('transaction_journals.date', '<=', $date->format('Y-m-d 23:59:59'))
|
||||
->where('transactions.transaction_currency_id', '!=', $currency->id)
|
||||
@@ -384,8 +387,7 @@ class Steam
|
||||
->get(['transaction_journals.date', 'transactions.amount'])->toArray()
|
||||
;
|
||||
app('log')->debug(sprintf('%d transactions in set #3', count($new[1])));
|
||||
// 4
|
||||
$existing[] = $account->transactions()
|
||||
$existing[] = $account->transactions() // 4
|
||||
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
|
||||
->where('transaction_journals.date', '<=', $date->format('Y-m-d 23:59:59'))
|
||||
->where('transactions.foreign_currency_id', $native->id)
|
||||
@@ -393,8 +395,7 @@ class Steam
|
||||
->get(['transactions.foreign_amount'])->toArray()
|
||||
;
|
||||
app('log')->debug(sprintf('%d transactions in set #4', count($existing[1])));
|
||||
// 5
|
||||
$new[] = $account->transactions()
|
||||
$new[] = $account->transactions()// 5
|
||||
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
|
||||
->where('transaction_journals.date', '<=', $date->format('Y-m-d 23:59:59'))
|
||||
->where('transactions.transaction_currency_id', $currency->id)
|
||||
@@ -403,8 +404,7 @@ class Steam
|
||||
->get(['transaction_journals.date', 'transactions.amount'])->toArray()
|
||||
;
|
||||
app('log')->debug(sprintf('%d transactions in set #5', count($new[2])));
|
||||
// 6
|
||||
$new[] = $account->transactions()
|
||||
$new[] = $account->transactions()// 6
|
||||
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
|
||||
->where('transaction_journals.date', '<=', $date->format('Y-m-d 23:59:59'))
|
||||
->where('transactions.transaction_currency_id', '!=', $currency->id)
|
||||
|
||||
Reference in New Issue
Block a user