Move some translations of invoice and bill to documents langugage file
This commit is contained in:
parent
838bfb7f1d
commit
0b2d33e224
@ -233,7 +233,7 @@ class Bills extends Controller
|
||||
{
|
||||
event(new \App\Events\Document\DocumentReceived($bill));
|
||||
|
||||
$message = trans('bills.messages.marked_received');
|
||||
$message = trans('general.messages.marked_received', ['type' => trans_choice('general.bills', 1)]);
|
||||
|
||||
flash($message)->success();
|
||||
|
||||
@ -251,7 +251,7 @@ class Bills extends Controller
|
||||
{
|
||||
event(new \App\Events\Document\DocumentCancelled($bill));
|
||||
|
||||
$message = trans('bills.messages.marked_cancelled');
|
||||
$message = trans('general.messages.marked_cancelled', ['type' => trans_choice('general.bills', 1)]);
|
||||
|
||||
flash($message)->success();
|
||||
|
||||
@ -310,7 +310,7 @@ class Bills extends Controller
|
||||
try {
|
||||
$this->dispatch(new CreateBankingDocumentTransaction($bill, []));
|
||||
|
||||
$message = trans('bills.messages.marked_paid');
|
||||
$message = trans('general.messages.marked_paid', ['type' => trans_choice('general.bills', 1)]);
|
||||
|
||||
flash($message)->success();
|
||||
} catch(\Exception $e) {
|
||||
|
@ -233,7 +233,7 @@ class Invoices extends Controller
|
||||
{
|
||||
event(new \App\Events\Document\DocumentSent($invoice));
|
||||
|
||||
$message = trans('invoices.messages.marked_sent');
|
||||
$message = trans('documents.messages.marked_sent', ['type' => trans_choice('general.invoices', 1)]);
|
||||
|
||||
flash($message)->success();
|
||||
|
||||
@ -251,7 +251,7 @@ class Invoices extends Controller
|
||||
{
|
||||
event(new \App\Events\Document\DocumentCancelled($invoice));
|
||||
|
||||
$message = trans('invoices.messages.marked_cancelled');
|
||||
$message = trans('general.messages.marked_cancelled', ['type' => trans_choice('general.invoices', 1)]);
|
||||
|
||||
flash($message)->success();
|
||||
|
||||
@ -301,7 +301,7 @@ class Invoices extends Controller
|
||||
|
||||
event(new \App\Events\Document\DocumentSent($invoice));
|
||||
|
||||
flash(trans('invoices.messages.email_sent'))->success();
|
||||
flash(trans('documents.messages.email_sent', ['type' => trans_choice('general.invoices', 1)]))->success();
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
@ -360,7 +360,7 @@ class Invoices extends Controller
|
||||
try {
|
||||
event(new \App\Events\Document\PaymentReceived($invoice));
|
||||
|
||||
$message = trans('invoices.messages.marked_paid');
|
||||
$message = trans('general.messages.marked_paid', ['type' => trans_choice('general.invoices', 1)]);
|
||||
|
||||
flash($message)->success();
|
||||
} catch(\Exception $e) {
|
||||
|
@ -6,7 +6,6 @@ use App\Events\Document\DocumentCancelled as Event;
|
||||
use App\Jobs\Document\CancelDocument;
|
||||
use App\Jobs\Document\CreateDocumentHistory;
|
||||
use App\Traits\Jobs;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class MarkDocumentCancelled
|
||||
{
|
||||
@ -22,7 +21,6 @@ class MarkDocumentCancelled
|
||||
{
|
||||
$this->dispatch(new CancelDocument($event->document));
|
||||
|
||||
$type = Str::plural($event->document->type);
|
||||
$this->dispatch(new CreateDocumentHistory($event->document, 0, trans("$type.messages.marked_cancelled")));
|
||||
$this->dispatch(new CreateDocumentHistory($event->document, 0, trans('general.messages.marked_cancelled', ['type' => ''])));
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ namespace App\Listeners\Document;
|
||||
use App\Events\Document\DocumentReceived as Event;
|
||||
use App\Jobs\Document\CreateDocumentHistory;
|
||||
use App\Traits\Jobs;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class MarkDocumentReceived
|
||||
{
|
||||
@ -25,7 +24,6 @@ class MarkDocumentReceived
|
||||
$event->document->save();
|
||||
}
|
||||
|
||||
$type = Str::plural($event->document->type);
|
||||
$this->dispatch(new CreateDocumentHistory($event->document, 0, trans("$type.messages.marked_received")));
|
||||
$this->dispatch(new CreateDocumentHistory($event->document, 0, trans('general.messages.marked_received', ['type' => ''])));
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ namespace App\Listeners\Document;
|
||||
use App\Events\Document\DocumentSent as Event;
|
||||
use App\Jobs\Document\CreateDocumentHistory;
|
||||
use App\Traits\Jobs;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class MarkDocumentSent
|
||||
{
|
||||
@ -25,8 +24,6 @@ class MarkDocumentSent
|
||||
$event->document->save();
|
||||
}
|
||||
|
||||
$type = Str::plural($event->document->type);
|
||||
|
||||
$this->dispatch(new CreateDocumentHistory($event->document, 0, trans("$type.messages.marked_sent")));
|
||||
$this->dispatch(new CreateDocumentHistory($event->document, 0, trans('documents.messages.marked_sent', ['type' => ''])));
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ namespace App\Listeners\Document;
|
||||
use App\Events\Document\DocumentViewed as Event;
|
||||
use App\Jobs\Document\CreateDocumentHistory;
|
||||
use App\Traits\Jobs;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class MarkDocumentViewed
|
||||
{
|
||||
@ -30,8 +29,6 @@ class MarkDocumentViewed
|
||||
$document->status = 'viewed';
|
||||
$document->save();
|
||||
|
||||
$type = Str::plural($document->type);
|
||||
|
||||
$this->dispatch(new CreateDocumentHistory($event->document, 0, trans("$type.messages.marked_viewed")));
|
||||
$this->dispatch(new CreateDocumentHistory($event->document, 0, trans('general.messages.marked_viewed', ['type' => ''])));
|
||||
}
|
||||
}
|
||||
|
@ -49,9 +49,6 @@ return [
|
||||
],
|
||||
|
||||
'messages' => [
|
||||
'marked_received' => 'Bill marked as received!',
|
||||
'marked_paid' => 'Bill marked as paid!',
|
||||
'marked_cancelled' => 'Bill marked as cancelled!',
|
||||
'draft' => 'This is a <b>DRAFT</b> bill and will be reflected to charts after it gets received.',
|
||||
|
||||
'status' => [
|
||||
|
12
resources/lang/en-GB/documents.php
Normal file
12
resources/lang/en-GB/documents.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'messages' => [
|
||||
'email_sent' => ':type email has been sent!',
|
||||
'marked_sent' => ':type marked as sent!',
|
||||
'marked_paid' => ':type marked as paid!',
|
||||
'marked_viewed' => ':type marked as viewed!',
|
||||
'marked_cancelled' => ':type marked as cancelled!',
|
||||
'marked_received' => ':type marked as received!',
|
||||
],
|
||||
];
|
@ -53,11 +53,6 @@ return [
|
||||
],
|
||||
|
||||
'messages' => [
|
||||
'email_sent' => 'Invoice email has been sent!',
|
||||
'marked_sent' => 'Invoice marked as sent!',
|
||||
'marked_paid' => 'Invoice marked as paid!',
|
||||
'marked_viewed' => 'Invoice marked as viewed!',
|
||||
'marked_cancelled' => 'Invoice marked as cancelled!',
|
||||
'email_required' => 'No email address for this customer!',
|
||||
'draft' => 'This is a <b>DRAFT</b> invoice and will be reflected to charts after it gets sent.',
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user