Akaunting/resources/views/components/documents/show/get-paid.blade.php

162 lines
8.8 KiB
PHP
Raw Normal View History

2022-06-01 07:15:55 +00:00
<x-show.accordion type="get_paid" :open="($accordionActive == 'get-paid')">
<x-slot name="head">
<x-show.accordion.head
title="{{ trans('invoices.get_paid') }}"
description="{!! $description !!}"
/>
</x-slot>
<x-slot name="body" class="block" override="class">
2025-01-10 09:58:13 +00:00
@stack('timeline_get_paid_body_start')
2022-06-01 07:15:55 +00:00
<div class="flex flex-wrap space-x-3 rtl:space-x-reverse">
@stack('timeline_get_paid_body_button_payment_start')
@if (! $hideAddPayment)
@if ($document->totals->count())
2023-10-03 08:06:08 +00:00
@if (($document->status != 'paid') && (empty($document->transactions->count()) || (! empty($document->transactions->count()) && ($document->paid != $document->amount))))
@if ($document->status != 'cancelled')
<x-button
@click="onAddPayment('{{ route('modals.documents.document.transactions.create', $document->id) }}')"
id="show-slider-actions-payment-{{ $document->type }}"
class="px-3 py-1.5 mb-3 sm:mb-0 rounded-lg text-xs font-medium leading-6 bg-green hover:bg-green-700 text-white disabled:bg-green-100"
override="class"
>
{{ trans('invoices.add_payment') }}
</x-button>
@else
<x-button kind="disabled" disabled="disabled">
{{ trans('invoices.add_payment') }}
</x-button>
@endif
@endif
@else
<x-tooltip message="{{ trans('invoices.messages.totals_required', ['type' => $type]) }}" placement="top">
<x-dropdown.button disabled="disabled">
{{ trans('invoices.add_payment') }}
</x-dropdown.button>
</x-tooltip>
2022-06-01 07:15:55 +00:00
@endif
@endif
@stack('timeline_get_paid_body_button_payment_end')
@if (! $hideAcceptPayment)
<x-link href="{{ route('apps.categories.show', [
2022-06-06 15:08:03 +00:00
'alias' => 'payment-method',
2022-06-01 07:15:55 +00:00
'utm_source' => $type,
'utm_medium' => 'app',
2022-06-09 08:18:47 +00:00
'utm_campaign' => 'payment_method',
2022-06-01 07:15:55 +00:00
]) }}"
2022-09-06 10:54:56 +00:00
id="show-slider-actions-online-payment-{{ $document->type }}"
2022-06-01 07:15:55 +00:00
override="class"
class="py-1.5 mb-3 sm:mb-0 text-xs bg-transparent hover:bg-transparent font-medium leading-6"
>
2022-06-27 11:53:06 +00:00
<x-link.hover>
{{ trans('documents.accept_payment_online') }}
</x-link.hover>
2022-06-01 07:15:55 +00:00
</x-link>
@endif
2025-01-10 09:58:13 +00:00
@stack('timeline_get_paid_body_button_accept_payment_end')
2022-06-01 07:15:55 +00:00
</div>
2025-01-10 09:58:13 +00:00
@stack('timeline_get_paid_body_button_end')
@stack('timeline_get_paid_body_detail_start')
2022-07-20 14:33:58 +00:00
<div class="text-xs mt-6" style="margin-left: 0 !important;">
2022-06-01 07:15:55 +00:00
<span class="font-medium">
2023-03-23 09:00:23 +00:00
{{ trans('invoices.payments_received') }}:
2022-06-01 07:15:55 +00:00
</span>
2025-01-10 09:58:13 +00:00
@stack('timeline_get_paid_body_detail_description_start')
2022-06-01 07:15:55 +00:00
@if ($transactions->count())
@foreach ($transactions as $transaction)
2022-07-20 14:33:58 +00:00
<div class="my-4">
2022-06-01 07:15:55 +00:00
<span>
<x-date :date="$transaction->paid_at" />
- {!! trans('documents.transaction', [
'amount' => '<span class="font-medium">' . money($transaction->amount, $transaction->currency_code) . '</span>',
2022-06-01 07:15:55 +00:00
'account' => '<span class="font-medium">' . $transaction->account->name . '</span>',
]) !!}
</span>
</br>
2023-03-02 14:12:46 +00:00
<div class="flex flex-row">
@if (! empty($transaction->contact) && $transaction->contact->email)
<x-button id="show-slider-actions-transaction-send-email-{{ $document->type }}-{{ $transaction->id }}" class="text-purple mt-1" override="class" @click="onEmailViaTemplate('{{ route($transactionEmailRoute, $transaction->id) }}', '{{ $transactionEmailTemplate }}')">
2022-07-04 09:52:24 +00:00
<x-button.hover color="to-purple">
2022-06-27 11:53:06 +00:00
{{ trans('general.title.send', ['type' => trans_choice('general.receipts', 1)]) }}
2022-07-04 09:52:24 +00:00
</x-button.hover>
2022-06-01 07:15:55 +00:00
</x-button>
2023-03-02 14:12:46 +00:00
@else
<x-tooltip message="{{ trans('invoices.messages.email_required') }}" placement="top">
2023-10-03 08:06:08 +00:00
<x-button class="text-purple mt-1" override="class" kind="disabled" disabled="disabled">
2023-03-02 14:12:46 +00:00
<x-button.hover color="to-purple">
{{ trans('general.title.send', ['type' => trans_choice('general.receipts', 1)]) }}
</x-button.hover>
</x-button>
</x-tooltip>
@endif
2022-06-01 07:15:55 +00:00
2023-03-02 14:12:46 +00:00
<span class="mt-1 mr-2 ml-2"> - </span>
2022-06-01 07:15:55 +00:00
@if ($document->totals->count())
<x-button
@click="onEditPayment('{{ route('modals.documents.document.transactions.edit', ['document' => $document->id, 'transaction' => $transaction->id]) }}')"
id="show-slider-actions-transaction-edit-{{ $document->type }}-{{ $transaction->id }}"
class="text-purple mt-1"
override="class"
>
<x-button.hover color="to-purple">
{{ trans('general.title.edit', ['type' => trans_choice('general.payments', 1)]) }}
</x-button.hover>
</x-button>
@else
<x-tooltip message="{{ trans('invoices.messages.totals_required', ['type' => $type]) }}" placement="top">
<x-button disabled="disabled" id="show-slider-actions-transaction-edit-{{ $document->type }}-{{ $transaction->id }}" class="text-purple mt-1" override="class">
<x-button.hover color="to-purple">
{{ trans('general.title.edit', ['type' => trans_choice('general.payments', 1)]) }}
</x-button.hover>
</x-button>
</x-tooltip>
@endif
2022-06-01 07:15:55 +00:00
2023-03-02 14:12:46 +00:00
<span class="mt-1 mr-2 ml-2"> - </span>
2022-06-01 07:15:55 +00:00
2023-03-02 14:12:46 +00:00
@php
$message = trans('general.delete_confirm', [
'name' => '<strong>' . Date::parse($transaction->paid_at)->format(company_date_format()) . ' - ' . money($transaction->amount, $transaction->currency_code) . ' - ' . $transaction->account->name . '</strong>',
2023-03-02 14:12:46 +00:00
'type' => strtolower(trans_choice('general.transactions', 1))
]);
@endphp
2022-06-01 07:15:55 +00:00
2023-03-02 14:12:46 +00:00
<x-delete-link
:model="$transaction"
2023-10-03 08:06:08 +00:00
:route="['modals.documents.document.transactions.destroy', $document->id, $transaction->id]"
2023-03-02 14:12:46 +00:00
:title="trans('general.title.delete', ['type' => trans_choice('general.payments', 1)])"
:message="$message"
:label="trans('general.title.delete', ['type' => trans_choice('general.payments', 1)])"
class="text-purple mt-1"
text-class="bg-no-repeat bg-0-2 bg-0-full hover:bg-full-2 bg-gradient-to-b from-transparent to-purple transition-backgroundSize"
override="class"
/>
</div>
2022-06-01 07:15:55 +00:00
</div>
@endforeach
@else
<div class="my-2">
<span>{{ trans('general.no_records') }}</span>
</div>
@endif
2025-01-10 09:58:13 +00:00
@stack('timeline_get_paid_body_detail_description_end')
2022-06-01 07:15:55 +00:00
</div>
2025-01-10 09:58:13 +00:00
@stack('timeline_get_paid_body_end')
2022-06-01 07:15:55 +00:00
</x-slot>
</x-show.accordion>