Transaction edit via document information..

This commit is contained in:
Cüneyt Şentürk 2025-08-30 01:06:12 +01:00
parent 774f64a051
commit 355cee0cf2
2 changed files with 14 additions and 0 deletions

View File

@ -239,6 +239,19 @@ class Transactions extends Controller
*/
public function update(Transaction $transaction, Request $request)
{
if ($transaction->document_id) {
$message = trans('transactions.messages.update_document_transaction');
flash($message)->error()->important();
return response()->json([
'success' => false,
'error' => true,
'message' => $message,
'redirect' => route('transactions.edit', $transaction->id),
]);
}
$response = $this->ajaxDispatch(new UpdateTransaction($transaction, $request));
if ($response['success']) {

View File

@ -49,6 +49,7 @@ return [
],
'messages' => [
'update_document_transaction' => 'You can update this transaction. You should go to the document and edit it there.',
'create_document_transaction_error' => 'This endpoint cannot be added to a document. Use {{akaunting_url}}/documents/{{akaunting_document_id}}/transactions',
'update_document_transaction_error' => 'This endpoint cannot be updated to a document. Use {{akaunting_url}}/documents/{{akaunting_document_id}}/transactions/{akaunting_transaction_id}',
'delete_document_transaction_error' => 'This endpoint cannot be deleted to a document. Use {{akaunting_url}}/documents/{{akaunting_document_id}}/transactions/{akaunting_transaction_id}',