diff --git a/resources/views/expenses/bills/show.blade.php b/resources/views/expenses/bills/show.blade.php
index 278ae30df..12bc997b7 100644
--- a/resources/views/expenses/bills/show.blade.php
+++ b/resources/views/expenses/bills/show.blade.php
@@ -119,7 +119,7 @@
@stack('timeline_body_make_payment_body_start')
@stack('timeline_body_get_paid_body_message_start')
- @if($bill->status->code != 'paid' && empty($bill->payments->count()))
+ @if($bill->status->code != 'paid' && empty($bill->transactions->count()))
{{ trans_choice('general.statuses', 1) . ' :' }} {{ trans('bills.messages.status.paid.await') }}
@else
{{ trans_choice('general.statuses', 1) . ': ' . trans('general.partially_paid') }}
@@ -128,8 +128,8 @@
@stack('timeline_body_make_payment_body_button_payment_start')
- @if(empty($bill->payments->count()) || (!empty($bill->payments->count()) && $bill->paid != $bill->amount))
-
{{ trans('bills.add_payment') }}
+ @if(empty($bill->transactions->count()) || (!empty($bill->transactions->count()) && $bill->paid != $bill->amount))
+
@endif
@stack('timeline_body_make_payment_body_button_payment_end')
@@ -415,14 +415,14 @@
-
-
-
-
-
- {{ trans('general.date') }} |
- {{ trans_choice('general.statuses', 1) }} |
- {{ trans('general.description') }} |
+
+
+
+
+ {{ trans('general.date') }} |
+ {{ trans_choice('general.statuses', 1) }} |
+ {{ trans('general.description') }} |
+
+
+
+ @foreach($bill->histories as $history)
+
+ @date($history->created_at) |
+ {{ $history->status->name }} |
+ {{ $history->description }} |
-
-
- @foreach($bill->histories as $history)
-
- @date($history->created_at) |
- {{ $history->status->name }} |
- {{ $history->description }} |
-
- @endforeach
-
-
-
+ @endforeach
+
+
@@ -510,73 +508,101 @@
@stack('row_footer_history_end')
- @stack('row_footer_payment_start')
+ @stack('row_footer_transaction_start')
-
-
-
-
-
- {{ trans('general.date') }} |
- {{ trans('general.amount') }} |
- {{ trans_choice('general.accounts', 1) }} |
- {{ trans('general.actions') }} |
-
-
-
- @if ($bill->payments->count())
- @foreach($bill->payments as $payment)
-
- @date($item->paid_at) |
- @money($payment->amount, $payment->currency_code, true) |
- {{ $payment->account->name }} |
-
- @if ($payment->reconciled)
-
- @else
- {!! Form::open([
- 'id' => 'bill-payment-' . $payment->id,
- 'method' => 'DELETE',
- 'route' => ['payments.destroy', $payment->id],
- 'style' => 'display:inline'
- ]) !!}
- {!! Form::button(' ' . trans('general.delete'), array(
- 'type' => 'button',
- 'class' => 'btn btn-danger btn-xs',
- 'title' => trans('general.delete'),
- 'onclick' => 'confirmDelete("' . '#bill-payment-' . $payment->id . '", "' . trans_choice('general.payments', 2) . '", "' . trans('general.delete_confirm', ['name' => '' . Date::parse($payment->paid_at)->format($date_format) . ' - ' . money($payment->amount, $payment->currency_code, true) . ' - ' . $payment->account->name . '', 'type' => strtolower(trans_choice('general.payments', 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")'
- )) !!}
- {!! Form::close() !!}
- @endif
- |
-
- @endforeach
- @else
+
+
+
+
+ {{ trans('general.date') }} |
+ {{ trans('general.amount') }} |
+ {{ trans_choice('general.accounts', 1) }} |
+ {{ trans('general.actions') }} |
+
+
+
+ @if ($bill->transactions->count())
+ @foreach($bill->transactions as $transaction)
-
-
- {{ trans('general.no_records') }}
-
+ | @date($item->paid_at) |
+ @money($transaction->amount, $transaction->currency_code, true) |
+ {{ $transaction->account->name }} |
+
+ @if ($transaction->reconciled)
+
+ @else
+ {!! Form::open([
+ 'id' => 'bill-transaction-' . $transaction->id,
+ 'method' => 'DELETE',
+ 'route' => ['transactions.destroy', $transaction->id],
+ 'style' => 'display:inline'
+ ]) !!}
+ {!! Form::button(' ' . trans('general.delete'), array(
+ 'type' => 'button',
+ 'class' => 'btn btn-danger btn-sm',
+ 'title' => trans('general.delete'),
+ 'onclick' => 'confirmDelete("' . '#bill-transaction-' . $transaction->id . '", "' . trans_choice('general.transaction', 2) . '", "' . trans('general.delete_confirm', ['name' => '' . Date::parse($transaction->paid_at)->format($date_format) . ' - ' . money($transaction->amount, $transaction->currency_code, true) . ' - ' . $transaction->account->name . '', 'type' => strtolower(trans_choice('general.transactions', 1))]) . '", "' . trans('general.cancel') . '", "' . trans('general.delete') . '")'
+ )) !!}
+ {!! Form::close() !!}
+ @endif
|
- @endif
-
-
-
+ @endforeach
+ @else
+
+
+
+ {{ trans('general.no_records') }}
+
+ |
+
+ @endif
+
+
- @stack('row_footer_payment_end')
+ @stack('row_footer_transaction_end')
@stack('row_footer_end')
@endsection
+
+@push('content_content_end')
+
+
+ @include('modals.bills.payment')
+
+
+
+
+
+
+
+
+
+
+@endpush
+
+@push('scripts_start')
+
+@endpush
diff --git a/resources/views/incomes/invoices/show.blade.php b/resources/views/incomes/invoices/show.blade.php
index c3430393a..c6ce302ce 100644
--- a/resources/views/incomes/invoices/show.blade.php
+++ b/resources/views/incomes/invoices/show.blade.php
@@ -147,7 +147,7 @@
@stack('timeline_body_get_paid_body_button_pay_start')
@permission('update-incomes-invoices')
-
+
@endpermission
@stack('timeline_body_get_paid_body_button_pay_end')
@@ -553,7 +553,7 @@
@stack('row_footer_history_end')
- @stack('row_footer_payment_start')
+ @stack('row_footer_transaction_start')
- @stack('row_footer_payment_end')
+ @stack('row_footer_transaction_end')
@stack('row_footer_end')
@endsection
@@ -650,7 +650,7 @@
{{ trans('general.cancel') }}
-
+
{{ trans('invoices.accept_payments') }}
diff --git a/routes/admin.php b/routes/admin.php
index 3a0685d70..54fa987eb 100644
--- a/routes/admin.php
+++ b/routes/admin.php
@@ -88,7 +88,6 @@ Route::group(['prefix' => 'expenses'], function () {
Route::get('bills/{bill}/pdf', 'Expenses\Bills@pdfBill')->name('bills.pdf');
Route::get('bills/{bill}/duplicate', 'Expenses\Bills@duplicate')->name('bills.duplicate');
Route::get('bills/addItem', 'Expenses\Bills@addItem')->middleware(['money'])->name('bill.add.item');
- Route::post('bills/payment', 'Expenses\Bills@payment')->middleware(['date.format', 'money'])->name('bill.payment');
Route::post('bills/import', 'Expenses\Bills@import')->name('bills.import');
Route::get('bills/export', 'Expenses\Bills@export')->name('bills.export');
Route::resource('bills', 'Expenses\Bills', ['middleware' => ['date.format', 'money']]);