Transaction edit via document information..
This commit is contained in:
parent
774f64a051
commit
355cee0cf2
|
|
@ -239,6 +239,19 @@ class Transactions extends Controller
|
||||||
*/
|
*/
|
||||||
public function update(Transaction $transaction, Request $request)
|
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));
|
$response = $this->ajaxDispatch(new UpdateTransaction($transaction, $request));
|
||||||
|
|
||||||
if ($response['success']) {
|
if ($response['success']) {
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ return [
|
||||||
],
|
],
|
||||||
|
|
||||||
'messages' => [
|
'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',
|
'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}',
|
'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}',
|
'delete_document_transaction_error' => 'This endpoint cannot be deleted to a document. Use {{akaunting_url}}/documents/{{akaunting_document_id}}/transactions/{akaunting_transaction_id}',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue