diff --git a/app/Models/Banking/Transaction.php b/app/Models/Banking/Transaction.php index 9563bcf34..5f5505484 100644 --- a/app/Models/Banking/Transaction.php +++ b/app/Models/Banking/Transaction.php @@ -4,7 +4,6 @@ namespace App\Models\Banking; use App\Abstracts\Model; use App\Models\Common\Media as MediaModel; -use App\Models\Setting\Category; use App\Scopes\Transaction as Scope; use App\Traits\Currencies; use App\Traits\DateTime; diff --git a/config/type.php b/config/type.php index af729558d..6092fad27 100644 --- a/config/type.php +++ b/config/type.php @@ -320,6 +320,32 @@ return [ ], ], + Transaction::INCOME_TRANSFER_TYPE => [ + 'group' => 'banking', + 'route' => [ + 'prefix' => 'transactions', // core use with group + prefix, module ex. estimates + 'parameter' => 'transaction', // banking/transactions/{parameter}/edit + //'create' => 'transactions.create', // if you change route, you can write full path + ], + 'permission' => [ + 'prefix' => 'transactions', + //'create' => 'create-banking-transactions', + ], + 'translation' => [ + 'prefix' => 'transactions', // this translation file name. + 'related_document_amount' => 'invoices.invoice_amount', + 'transactions' => 'general.incomes', + ], + 'contact_type' => 'customer', + 'document_type' => 'invoice', + 'split_type' => Transaction::INCOME_SPLIT_TYPE, + 'email_template' => 'payment_received_customer', + 'script' => [ + 'folder' => 'banking', + 'file' => 'transactions', + ], + ], + Transaction::INCOME_RECURRING_TYPE => [ 'group' => 'banking', 'route' => [ @@ -373,6 +399,31 @@ return [ ], ], + Transaction::EXPENSE_TRANSFER_TYPE => [ + 'group' => 'banking', + 'route' => [ + 'prefix' => 'transactions', // core use with group + prefix, module ex. estimates + 'parameter' => 'transaction', // banking/transactions/{parameter}/edit + //'create' => 'transactions.create', // if you change route, you can write full path + ], + 'permission' => [ + 'prefix' => 'transactions', + //'create' => 'create-banking-transactions', + ], + 'translation' => [ + 'prefix' => 'transactions', // this translation file name. + 'related_document_amount' => 'bills.bill_amount', + ], + 'contact_type' => 'vendor', + 'document_type' => 'bill', + 'split_type' => Transaction::EXPENSE_SPLIT_TYPE, + 'email_template' => 'payment_made_vendor', + 'script' => [ + 'folder' => 'banking', + 'file' => 'transactions', + ], + ], + Transaction::EXPENSE_RECURRING_TYPE => [ 'group' => 'banking', 'route' => [ diff --git a/resources/lang/en-GB/invoices.php b/resources/lang/en-GB/invoices.php index cd1448388..058920cbf 100644 --- a/resources/lang/en-GB/invoices.php +++ b/resources/lang/en-GB/invoices.php @@ -79,7 +79,7 @@ return [ ], 'sticky' => [ - 'description' => 'You are previewing how your customer will see the web version of your invoice.', + 'description' => 'You are previewing how your customer will see the web version of your invoice.', ], ]; diff --git a/resources/lang/en-GB/messages.php b/resources/lang/en-GB/messages.php index 80f1c0ec6..4652bc0cc 100644 --- a/resources/lang/en-GB/messages.php +++ b/resources/lang/en-GB/messages.php @@ -41,6 +41,7 @@ return [ 'reconciled_doc' => 'Warning: You are not allowed to change/delete :type because it has reconciled transactions!', '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.', ], ]; diff --git a/resources/views/components/transactions/show/transfer.blade.php b/resources/views/components/transactions/show/transfer.blade.php index 80b103c4b..46dcc143d 100644 --- a/resources/views/components/transactions/show/transfer.blade.php +++ b/resources/views/components/transactions/show/transfer.blade.php @@ -1,10 +1,15 @@ @if ($transaction->isTransferTransaction()) - @php - $from_account = '' . $transaction->transfer->expense_account->title . ''; - $to_account = '' . $transaction->transfer->income_account->title . ''; - @endphp + @php $transfer = $transaction->transfer; @endphp -