diff --git a/app/Abstracts/View/Components/Transactions/Show.php b/app/Abstracts/View/Components/Transactions/Show.php index 1577e3aa9..629bdd1cf 100644 --- a/app/Abstracts/View/Components/Transactions/Show.php +++ b/app/Abstracts/View/Components/Transactions/Show.php @@ -304,6 +304,9 @@ abstract class Show extends Component /** @var bool */ public $hideRecurringMessage; + /** @var bool */ + public $hideConnectMessage; + /** @var bool */ public $hideCreated; @@ -335,7 +338,7 @@ abstract class Show extends Component string $routeDocumentShow = '', string $routeTransactionShow = '', string $textButtonAddNew = '', bool $hideSchedule = false, bool $hideChildren = false, bool $hideConnect = false, bool $hideTransfer = false, bool $hideAttachment = false, $attachment = [], - array $connectTranslations = [], string $textRecurringType = '', bool $hideRecurringMessage = false, bool $hideCreated = false + array $connectTranslations = [], string $textRecurringType = '', bool $hideRecurringMessage = false, $hideConnectMessage = false, bool $hideCreated = false ) { $this->type = $type; $this->transaction = $transaction; @@ -472,6 +475,7 @@ abstract class Show extends Component // Connect translations $this->connectTranslations = $this->getTranslationsForConnect($type); + $this->hideConnectMessage = $hideConnectMessage; $this->textRecurringType = $this->getTextRecurringType($type, $textRecurringType); $this->hideRecurringMessage = $hideRecurringMessage; diff --git a/app/Http/Controllers/Banking/Transactions.php b/app/Http/Controllers/Banking/Transactions.php index 62241035e..6cac4f5ce 100644 --- a/app/Http/Controllers/Banking/Transactions.php +++ b/app/Http/Controllers/Banking/Transactions.php @@ -39,7 +39,7 @@ class Transactions extends Controller { $this->setActiveTabForTransactions(); - $transactions = Transaction::with('account', 'category', 'contact')->collect(['paid_at'=> 'desc']); + $transactions = Transaction::with('account', 'category', 'contact', 'taxes')->collect(['paid_at'=> 'desc']); $total_transactions = Transaction::count(); @@ -395,7 +395,7 @@ class Transactions extends Controller $translations = collect($this->getTranslationsForConnect($transaction->type)); $data = [ - 'transaction' => $transaction->load(['account', 'category'])->toJson(), + 'transaction' => $transaction->load(['account', 'category', 'taxes'])->toJson(), 'currency' => $transaction->currency->toJson(), 'documents' => $documents, 'translations' => $translations->toJson(), diff --git a/app/Traits/Transactions.php b/app/Traits/Transactions.php index c9de6f7d5..c418e8d46 100644 --- a/app/Traits/Transactions.php +++ b/app/Traits/Transactions.php @@ -192,6 +192,7 @@ trait Transactions 'add_an' => trans('general.form.add_an', ['field' => trans_choice('general.' . Str::plural($document_type), 1)]), 'transaction' => trans_choice('general.' . Str::plural($type), 1), 'difference' => trans('general.difference'), + 'connect_tax' => trans('messages.warning.connect_tax', ['type' => $type]), ]; } diff --git a/resources/assets/js/components/AkauntingConnectTransactions.vue b/resources/assets/js/components/AkauntingConnectTransactions.vue index d33cd411b..16231f0af 100644 --- a/resources/assets/js/components/AkauntingConnectTransactions.vue +++ b/resources/assets/js/components/AkauntingConnectTransactions.vue @@ -21,6 +21,11 @@ +
+

+ {{ translations.connect_tax }} +

+
diff --git a/resources/lang/en-GB/messages.php b/resources/lang/en-GB/messages.php index 0e655640b..31334d4a9 100644 --- a/resources/lang/en-GB/messages.php +++ b/resources/lang/en-GB/messages.php @@ -46,6 +46,7 @@ return [ 'disable_code' => 'Warning: You are not allowed to disable or change the currency of :name because it has :text related.', 'payment_cancel' => 'Warning: You have cancelled your recent :method payment!', 'missing_transfer' => 'Warning: The transfer related to this transaction is missing. You should consider deleting this transaction.', + 'connect_tax' => 'Warning: This :type has a tax amount. Taxes added to the :type can not be connected, so the tax will be added to the total and calculated accordingly.', ], ]; diff --git a/resources/lang/en-GB/transactions.php b/resources/lang/en-GB/transactions.php index 96711392f..8bfef6e66 100644 --- a/resources/lang/en-GB/transactions.php +++ b/resources/lang/en-GB/transactions.php @@ -12,6 +12,7 @@ return [ 'recurring_expense' => 'Recurring Expense', 'included_tax' => 'Included tax amount', 'connected' => 'Connected', + 'connect_message' => 'Taxes for this :type were not calculated during the connection process. Taxes can not be connected.', 'form_description' => [ 'general' => 'Here you can enter the general information of transaction such as date, amount, account, description, etc.', diff --git a/resources/views/components/transactions/show/content.blade.php b/resources/views/components/transactions/show/content.blade.php index 68d15a6ce..00ca6de32 100644 --- a/resources/views/components/transactions/show/content.blade.php +++ b/resources/views/components/transactions/show/content.blade.php @@ -28,6 +28,14 @@ @stack('recurring_message_end') + @stack('connect_message_start') + + @if (! $hideConnectMessage && $transaction->isSplitTransaction() && $transaction->taxes->count()) + + @endif + + @stack('connect_message_end') + @stack('row_create_start') @if (! $hideCreated)