move document statutes keys..
This commit is contained in:
parent
0f158cdc7e
commit
00ed7bcd49
@ -713,7 +713,17 @@ abstract class DocumentIndex extends Base
|
||||
return $translation;
|
||||
}
|
||||
|
||||
return $default_key;
|
||||
$alias = config('type.' . $type . '.alias');
|
||||
|
||||
if (!empty($alias)) {
|
||||
$translation = $alias . '::' . config('type.' . $type . '.translation.prefix') . '.statuses';
|
||||
|
||||
if (is_array(trans($$translation))) {
|
||||
return $translation . '.';
|
||||
}
|
||||
}
|
||||
|
||||
return 'documents.statuses.';
|
||||
}
|
||||
|
||||
protected function getClassStatus($type, $classStatus)
|
||||
|
@ -637,17 +637,27 @@ abstract class DocumentShow extends Base
|
||||
{
|
||||
if (!empty($textHistoryStatus)) {
|
||||
return $textHistoryStatus;
|
||||
}
|
||||
}
|
||||
|
||||
$default_key = config('type.' . $type . '.translation.prefix') . '.statuses.';
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'history_status', $default_key);
|
||||
$translation = $this->getTextFromConfig($type, 'document_status', $default_key);
|
||||
|
||||
if (!empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
return $default_key;
|
||||
$alias = config('type.' . $type . '.alias');
|
||||
|
||||
if (!empty($alias)) {
|
||||
$translation = $alias . '::' . config('type.' . $type . '.translation.prefix') . '.statuses';
|
||||
|
||||
if (is_array(trans($$translation))) {
|
||||
return $translation . '.';
|
||||
}
|
||||
}
|
||||
|
||||
return 'documents.statuses.';
|
||||
}
|
||||
|
||||
protected function getRouteButtonAddNew($type, $routeButtonAddNew)
|
||||
|
@ -104,7 +104,7 @@ class PaymentReceived extends Notification
|
||||
$this->invoice->document_number,
|
||||
money($this->invoice->amount, $this->invoice->currency_code, true),
|
||||
company_date($this->invoice->due_at),
|
||||
trans('invoices.statuses.' . $this->invoice->status),
|
||||
trans('documents.statuses.' . $this->invoice->status),
|
||||
URL::signedRoute('signed.invoices.show', [$this->invoice->id, 'company_id' => $this->invoice->company_id]),
|
||||
route('invoices.show', $this->invoice->id),
|
||||
route('portal.invoices.show', $this->invoice->id),
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace App\Traits;
|
||||
|
||||
use App\Models\Document\Document;
|
||||
use App\Abstracts\View\Components\Document as DocumentComponent;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
@ -50,10 +51,14 @@ trait Documents
|
||||
],
|
||||
];
|
||||
|
||||
$statuses = collect($list[$type])->each(function ($code) use ($type) {
|
||||
// @todo get dynamic path
|
||||
//$trans_key = $this->getTextDocumentStatuses($type);
|
||||
$trans_key = 'documents.statuses.';
|
||||
|
||||
$statuses = collect($list[$type])->each(function ($code) use ($type, $trans_key) {
|
||||
$item = new \stdClass();
|
||||
$item->code = $code;
|
||||
$item->name = trans(Str::plural($type) . '.statuses.' . $code);
|
||||
$item->name = trans($trans_key . $code);
|
||||
|
||||
return $item;
|
||||
});
|
||||
@ -70,4 +75,27 @@ trait Documents
|
||||
{
|
||||
return Str::slug($document->document_number, $separator, language()->getShortCode());
|
||||
}
|
||||
|
||||
protected function getTextDocumentStatuses($type)
|
||||
{
|
||||
$default_key = config('type.' . $type . '.translation.prefix') . '.statuses.';
|
||||
|
||||
$translation = DocumentComponent::getTextFromConfig($type, 'document_status', $default_key);
|
||||
|
||||
if (!empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
$alias = config('type.' . $type . '.alias');
|
||||
|
||||
if (!empty($alias)) {
|
||||
$translation = $alias . '::' . config('type.' . $type . '.translation.prefix') . '.statuses';
|
||||
|
||||
if (is_array(trans($$translation))) {
|
||||
return $translation . '.';
|
||||
}
|
||||
}
|
||||
|
||||
return 'documents.statuses.';
|
||||
}
|
||||
}
|
||||
|
@ -38,16 +38,6 @@ return [
|
||||
'receive_bill' => 'Receive Bill',
|
||||
'make_payment' => 'Make Payment',
|
||||
|
||||
'statuses' => [
|
||||
'draft' => 'Draft',
|
||||
'received' => 'Received',
|
||||
'partial' => 'Partial',
|
||||
'paid' => 'Paid',
|
||||
'overdue' => 'Overdue',
|
||||
'unpaid' => 'Unpaid',
|
||||
'cancelled' => 'Cancelled',
|
||||
],
|
||||
|
||||
'messages' => [
|
||||
'draft' => 'This is a <b>DRAFT</b> bill and will be reflected to charts after it gets received.',
|
||||
|
||||
|
@ -1,6 +1,26 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'statuses' => [
|
||||
'draft' => 'Draft',
|
||||
'sent' => 'Sent',
|
||||
'expired' => 'Expired',
|
||||
'viewed' => 'Viewed',
|
||||
'approved' => 'Approved',
|
||||
'received' => 'Received',
|
||||
'refused' => 'Refused',
|
||||
'restored' => 'Restored',
|
||||
'reversed' => 'Reversed',
|
||||
'partial' => 'Partial',
|
||||
'paid' => 'Paid',
|
||||
'invoiced' => 'Invoiced',
|
||||
'overdue' => 'Overdue',
|
||||
'unpaid' => 'Unpaid',
|
||||
'cancelled' => 'Cancelled',
|
||||
'void' => 'Void',
|
||||
],
|
||||
|
||||
'messages' => [
|
||||
'email_sent' => ':type email has been sent!',
|
||||
'marked_sent' => ':type marked as sent!',
|
||||
|
@ -40,18 +40,6 @@ return [
|
||||
'get_paid' => 'Get Paid',
|
||||
'accept_payments' => 'Accept Online Payments',
|
||||
|
||||
'statuses' => [
|
||||
'draft' => 'Draft',
|
||||
'sent' => 'Sent',
|
||||
'viewed' => 'Viewed',
|
||||
'approved' => 'Approved',
|
||||
'partial' => 'Partial',
|
||||
'paid' => 'Paid',
|
||||
'overdue' => 'Overdue',
|
||||
'unpaid' => 'Unpaid',
|
||||
'cancelled' => 'Cancelled',
|
||||
],
|
||||
|
||||
'messages' => [
|
||||
'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.',
|
||||
|
@ -57,7 +57,7 @@
|
||||
|
||||
@if($item->bill)
|
||||
@if ($item->bill->status == 'paid')
|
||||
<el-tooltip content="{{ $item->bill->document_number }} / {{ trans('bills.statuses.paid') }}"
|
||||
<el-tooltip content="{{ $item->bill->document_number }} / {{ trans('documents.statuses.paid') }}"
|
||||
effect="success"
|
||||
:open-delay="100"
|
||||
placement="top">
|
||||
@ -66,7 +66,7 @@
|
||||
</span>
|
||||
</el-tooltip>
|
||||
@elseif ($item->bill->status == 'partial')
|
||||
<el-tooltip content="{{ $item->bill->document_number }} / {{ trans('bills.statuses.partial') }}"
|
||||
<el-tooltip content="{{ $item->bill->document_number }} / {{ trans('documents.statuses.partial') }}"
|
||||
effect="info"
|
||||
:open-delay="100"
|
||||
placement="top">
|
||||
|
@ -194,7 +194,7 @@
|
||||
<td class="col-xs-4 col-sm-3 text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="col-sm-3 d-none d-sm-block text-left">@date($item->issued_at)</td>
|
||||
<td class="col-sm-3 d-none d-sm-block text-left">@date($item->due_at)</td>
|
||||
<td class="col-xs-4 col-sm-2"><span class="badge badge-pill badge-{{ $item->status_label }} my--2">{{ trans('bills.statuses.' . $item->status) }}</span></td>
|
||||
<td class="col-xs-4 col-sm-2"><span class="badge badge-pill badge-{{ $item->status_label }} my--2">{{ trans('documents.statuses.' . $item->status) }}</span></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
@ -194,7 +194,7 @@
|
||||
<td class="col-xs-4 col-sm-3 text-right">@money($item->amount, $item->currency_code, true)</td>
|
||||
<td class="col-sm-3 d-none d-sm-block text-left">@date($item->issued_at)</td>
|
||||
<td class="col-sm-3 d-none d-sm-block text-left">@date($item->due_at)</td>
|
||||
<td class="col-xs-4 col-sm-2"><span class="badge badge-pill badge-{{ $item->status_label }} my--2">{{ trans('invoices.statuses.' . $item->status) }}</span></td>
|
||||
<td class="col-xs-4 col-sm-2"><span class="badge badge-pill badge-{{ $item->status_label }} my--2">{{ trans('documents.statuses.' . $item->status) }}</span></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
@ -57,7 +57,7 @@
|
||||
|
||||
@if($item->invoice)
|
||||
@if ($item->invoice->status == 'paid')
|
||||
<el-tooltip content="{{ $item->invoice->document_number }} / {{ trans('invoices.statuses.paid') }}"
|
||||
<el-tooltip content="{{ $item->invoice->document_number }} / {{ trans('documents.statuses.paid') }}"
|
||||
effect="success"
|
||||
:open-delay="100"
|
||||
placement="top">
|
||||
@ -66,7 +66,7 @@
|
||||
</span>
|
||||
</el-tooltip>
|
||||
@elseif ($item->invoice->status == 'partial')
|
||||
<el-tooltip content="{{ $item->invoice->document_number }} / {{ trans('invoices.statuses.partial') }}"
|
||||
<el-tooltip content="{{ $item->invoice->document_number }} / {{ trans('documents.statuses.partial') }}"
|
||||
effect="info"
|
||||
:open-delay="100"
|
||||
placement="top">
|
||||
|
Loading…
x
Reference in New Issue
Block a user