This commit is contained in:
James Cole
2018-04-21 20:27:35 +02:00
parent f8718e0b7b
commit 45cd19d1e3
2 changed files with 21 additions and 15 deletions

View File

@@ -190,7 +190,7 @@ class ReconcileController extends Controller
} }
$currencyId = (int)$this->accountRepos->getMetaValue($account, 'currency_id'); $currencyId = (int)$this->accountRepos->getMetaValue($account, 'currency_id');
$currency = $this->currencyRepos->findNull($currencyId); $currency = $this->currencyRepos->findNull($currencyId);
if (0 === $currencyId) { if (null === $currency) {
$currency = app('amount')->getDefaultCurrency(); // @codeCoverageIgnore $currency = app('amount')->getDefaultCurrency(); // @codeCoverageIgnore
} }
@@ -217,7 +217,6 @@ class ReconcileController extends Controller
$transactionsUri = route('accounts.reconcile.transactions', [$account->id, '%start%', '%end%']); $transactionsUri = route('accounts.reconcile.transactions', [$account->id, '%start%', '%end%']);
$overviewUri = route('accounts.reconcile.overview', [$account->id, '%start%', '%end%']); $overviewUri = route('accounts.reconcile.overview', [$account->id, '%start%', '%end%']);
$indexUri = route('accounts.reconcile', [$account->id, '%start%', '%end%']); $indexUri = route('accounts.reconcile', [$account->id, '%start%', '%end%']);
return view( return view(
'accounts.reconcile.index', compact( 'accounts.reconcile.index', compact(
'account', 'currency', 'subTitleIcon', 'start', 'end', 'subTitle', 'startBalance', 'endBalance', 'transactionsUri', 'account', 'currency', 'subTitleIcon', 'start', 'end', 'subTitle', 'startBalance', 'endBalance', 'transactionsUri',
@@ -350,7 +349,7 @@ class ReconcileController extends Controller
$currencyId = (int)$this->accountRepos->getMetaValue($account, 'currency_id'); $currencyId = (int)$this->accountRepos->getMetaValue($account, 'currency_id');
$currency = $this->currencyRepos->findNull($currencyId); $currency = $this->currencyRepos->findNull($currencyId);
if (0 === $currencyId) { if (0 === $currency) {
$currency = app('amount')->getDefaultCurrency(); // @codeCoverageIgnore $currency = app('amount')->getDefaultCurrency(); // @codeCoverageIgnore
} }
@@ -369,7 +368,7 @@ class ReconcileController extends Controller
$collector->setAccounts(new Collection([$account])) $collector->setAccounts(new Collection([$account]))
->setRange($selectionStart, $selectionEnd)->withBudgetInformation()->withOpposingAccount()->withCategoryInformation(); ->setRange($selectionStart, $selectionEnd)->withBudgetInformation()->withOpposingAccount()->withCategoryInformation();
$transactions = $collector->getJournals(); $transactions = $collector->getJournals();
$html = view('accounts.reconcile.transactions', compact('account', 'transactions', 'start', 'end', 'selectionStart', 'selectionEnd'))->render(); $html = view('accounts.reconcile.transactions', compact('account', 'transactions','currency', 'start', 'end', 'selectionStart', 'selectionEnd'))->render();
return response()->json(['html' => $html, 'startBalance' => $startBalance, 'endBalance' => $endBalance]); return response()->json(['html' => $html, 'startBalance' => $startBalance, 'endBalance' => $endBalance]);
} }

View File

@@ -25,9 +25,9 @@
   
</td> </td>
<td colspan="3"> <td colspan="3">
<span class="label label-default"> <span class="label label-default">
{{ trans('firefly.start_of_reconcile_period', {period: start.formatLocalized(monthAndDayFormat) }) }} {{ trans('firefly.start_of_reconcile_period', {period: start.formatLocalized(monthAndDayFormat) }) }}
</span> </span>
</td> </td>
<td colspan="2"> <td colspan="2">
&nbsp; &nbsp;
@@ -43,9 +43,9 @@
&nbsp; &nbsp;
</td> </td>
<td colspan="3"> <td colspan="3">
<span class="label label-default"> <span class="label label-default">
{{ trans('firefly.end_of_reconcile_period', {period: end.formatLocalized(monthAndDayFormat) }) }} {{ trans('firefly.end_of_reconcile_period', {period: end.formatLocalized(monthAndDayFormat) }) }}
</span> </span>
</td> </td>
<td colspan="2"> <td colspan="2">
&nbsp; &nbsp;
@@ -82,14 +82,21 @@
</td> </td>
<td style="text-align: right;"><span style="margin-right:5px;">{{ transaction|transactionAmount }}</span></td> <td style="text-align: right;"><span style="margin-right:5px;">{{ transaction|transactionAmount }}</span></td>
<td> <td>
{% if currency.id == transaction.transaction_currency_id %}
{% set transactionAmount = transaction.transaction_amount %}
{% else %}
{% set transactionAmount = transaction.transaction_foreign_amount %}
{% endif %}
{% if transaction.reconciled %} {% if transaction.reconciled %}
{{ transaction|transactionReconciled }} {{ transaction|transactionReconciled }}
<input type="hidden" name="cleared[]" data-younger="{% if transaction.date > end %}true{% else %}false{% endif %}" <input type="hidden" name="cleared[]" data-younger="{% if transaction.date > end %}true{% else %}false{% endif %}"
class="cleared" data-id="{{ transaction.id }}" value="{{ transaction.transaction_amount }}"> class="cleared" data-id="{{ transaction.id }}" value="{{ transactionAmount }}">
{% else %} {% else %}
<input type="checkbox" name="reconciled[]" <input type="checkbox" name="reconciled[]"
data-younger="{% if transaction.date > end %}true{% else %}false{% endif %}" data-younger="{% if transaction.date > end %}true{% else %}false{% endif %}"
value="{{ transaction.transaction_amount }}" data-id="{{ transaction.id }}" disabled class="reconcile_checkbox"> value="{{ transactionAmount }}" data-id="{{ transaction.id }}" disabled class="reconcile_checkbox">
{% endif %} {% endif %}
</td> </td>
<td class="hidden-sm hidden-xs"> <td class="hidden-sm hidden-xs">
@@ -119,9 +126,9 @@
&nbsp; &nbsp;
</td> </td>
<td colspan="3"> <td colspan="3">
<span class="label label-default"> <span class="label label-default">
{{ trans('firefly.start_of_reconcile_period', {period: start.formatLocalized(monthAndDayFormat) }) }} {{ trans('firefly.start_of_reconcile_period', {period: start.formatLocalized(monthAndDayFormat) }) }}
</span> </span>
</td> </td>
<td colspan="2"> <td colspan="2">
&nbsp; &nbsp;