akaunting 3.0 (the last dance)
This commit is contained in:
1229
app/Abstracts/View/Components/Documents/Form.php
Normal file
1229
app/Abstracts/View/Components/Documents/Form.php
Normal file
File diff suppressed because it is too large
Load Diff
642
app/Abstracts/View/Components/Documents/Index.php
Normal file
642
app/Abstracts/View/Components/Documents/Index.php
Normal file
@ -0,0 +1,642 @@
|
||||
<?php
|
||||
|
||||
namespace App\Abstracts\View\Components\Documents;
|
||||
|
||||
use Akaunting\Module\Module;
|
||||
use App\Abstracts\View\Component;
|
||||
use App\Events\Common\BulkActionsAdding;
|
||||
use App\Traits\Documents;
|
||||
use App\Traits\Modules;
|
||||
use App\Traits\ViewComponents;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\View\View;
|
||||
|
||||
abstract class Index extends Component
|
||||
{
|
||||
use Documents, Modules, ViewComponents;
|
||||
|
||||
public const OBJECT_TYPE = 'document';
|
||||
public const DEFAULT_TYPE = 'invoice';
|
||||
public const DEFAULT_PLURAL_TYPE = 'invoices';
|
||||
|
||||
/* -- Main Start -- */
|
||||
/** @var string */
|
||||
public $type;
|
||||
|
||||
/** @var string */
|
||||
public $alias;
|
||||
|
||||
public $documents;
|
||||
|
||||
/** @var string */
|
||||
public $group;
|
||||
|
||||
/** @var string */
|
||||
public $page;
|
||||
|
||||
/** @var string */
|
||||
public $textTabDocument;
|
||||
|
||||
/** @var string */
|
||||
public $routeTabDocument;
|
||||
|
||||
/** @var string */
|
||||
public $routeTabRecurring;
|
||||
|
||||
/** @var string */
|
||||
public $textPage;
|
||||
|
||||
/** @var string */
|
||||
public $permissionCreate;
|
||||
|
||||
/** @var string */
|
||||
public $permissionUpdate;
|
||||
|
||||
/** @var string */
|
||||
public $permissionDelete;
|
||||
/* -- Main End -- */
|
||||
|
||||
/* -- Buttons Start -- */
|
||||
/** @var bool */
|
||||
public $hideAcceptPayment;
|
||||
|
||||
/** @var bool */
|
||||
public $checkPermissionCreate;
|
||||
|
||||
/** @var bool */
|
||||
public $hideCreate;
|
||||
|
||||
/** @var bool */
|
||||
public $hideImport;
|
||||
|
||||
/** @var bool */
|
||||
public $hideExport;
|
||||
|
||||
/** @var string */
|
||||
public $createRoute;
|
||||
|
||||
/** @var string */
|
||||
public $importRoute;
|
||||
|
||||
/** @var array */
|
||||
public $importRouteParameters;
|
||||
|
||||
/** @var string */
|
||||
public $exportRoute;
|
||||
/* -- Buttons End -- */
|
||||
|
||||
/* -- Content Start -- */
|
||||
/** @var bool */
|
||||
public $hideEmptyPage;
|
||||
|
||||
/** @var array */
|
||||
public $emptyPageButtons;
|
||||
|
||||
/** @var string */
|
||||
public $imageEmptyPage;
|
||||
|
||||
/** @var string */
|
||||
public $textEmptyPage;
|
||||
|
||||
/** @var string */
|
||||
public $urlDocsPath;
|
||||
|
||||
/** @var bool */
|
||||
public $hideSummary;
|
||||
|
||||
/** @var array */
|
||||
public $summaryItems;
|
||||
|
||||
/** @var bool */
|
||||
public $withoutTabs;
|
||||
|
||||
/** @var string */
|
||||
public $tabActive;
|
||||
|
||||
/** @var bool */
|
||||
public $hideRecurringTemplates;
|
||||
|
||||
/** @var bool */
|
||||
public $hideSearchString;
|
||||
|
||||
/** @var bool */
|
||||
public $hideBulkAction;
|
||||
|
||||
/** @var string */
|
||||
public $searchStringModel;
|
||||
|
||||
/** @var string */
|
||||
public $bulkActionClass;
|
||||
|
||||
/** @var array */
|
||||
public $bulkActionRouteParameters;
|
||||
|
||||
/** @var string */
|
||||
public $searchRoute;
|
||||
|
||||
/** @var string */
|
||||
public $classBulkAction;
|
||||
|
||||
/** @var bool */
|
||||
public $hideDueAt;
|
||||
|
||||
/** @var bool */
|
||||
public $hideIssuedAt;
|
||||
|
||||
/** @var string */
|
||||
public $classDueAtAndIssueAt;
|
||||
|
||||
/** @var string */
|
||||
public $textDueAt;
|
||||
|
||||
/** @var string */
|
||||
public $textIssuedAt;
|
||||
|
||||
/** @var bool */
|
||||
public $hideStatus;
|
||||
|
||||
/** @var string */
|
||||
public $classStatus;
|
||||
|
||||
/** @var bool */
|
||||
public $hideContactName;
|
||||
|
||||
/** @var bool */
|
||||
public $hideDocumentNumber;
|
||||
|
||||
/** @var string */
|
||||
public $classContactNameAndDocumentNumber;
|
||||
|
||||
/** @var string */
|
||||
public $textContactName;
|
||||
|
||||
/** @var string */
|
||||
public $showContactRoute;
|
||||
|
||||
/** @var string */
|
||||
public $textDocumentNumber;
|
||||
|
||||
/** @var bool */
|
||||
public $hideAmount;
|
||||
|
||||
/** @var string */
|
||||
public $classAmount;
|
||||
|
||||
/** @var bool */
|
||||
public $hideShow;
|
||||
|
||||
/** @var string */
|
||||
public $showRoute;
|
||||
|
||||
/** @var bool */
|
||||
public $hideEdit;
|
||||
|
||||
/** @var string */
|
||||
public $editRoute;
|
||||
|
||||
/** @var bool */
|
||||
public $hideDuplicate;
|
||||
|
||||
/** @var string */
|
||||
public $duplicateRoute;
|
||||
|
||||
/** @var string */
|
||||
public $textDocumentStatus;
|
||||
|
||||
/** @var bool */
|
||||
public $checkButtonReconciled;
|
||||
|
||||
/** @var bool */
|
||||
public $checkButtonCancelled;
|
||||
/* -- Content End -- */
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
string $type, string $alias = '', $documents = [], string $group = '', string $page = '', string $textTabDocument = '', string $textPage = '',
|
||||
string $routeTabDocument = '', string $routeTabRecurring = '',
|
||||
string $permissionCreate = '', string $permissionUpdate = '', string $permissionDelete = '',
|
||||
bool $hideAcceptPayment = false, bool $checkPermissionCreate = true,
|
||||
bool $hideCreate = false, bool $hideImport = false, bool $hideExport = false,
|
||||
string $createRoute = '', string $importRoute = '', array $importRouteParameters = [], string $exportRoute = '',
|
||||
bool $hideEmptyPage = false, array $emptyPageButtons = [], string $imageEmptyPage = '', string $textEmptyPage = '', string $urlDocsPath = '',
|
||||
bool $hideSummary = false, array $summaryItems = [],
|
||||
bool $withoutTabs = false, string $tabActive = '', bool $hideRecurringTemplates = false,
|
||||
bool $hideSearchString = false, bool $hideBulkAction = false,
|
||||
string $searchStringModel = '', string $bulkActionClass = '', array $bulkActions = [], array $bulkActionRouteParameters = [], string $searchRoute = '', string $classBulkAction = '',
|
||||
bool $hideDueAt = false, bool $hideIssuedAt = false, string $classDueAtAndIssueAt = '', string $textDueAt = '', string $textIssuedAt = '',
|
||||
bool $hideStatus = false, string $classStatus = '',
|
||||
bool $hideContactName = false, bool $hideDocumentNumber = false, string $classContactNameAndDocumentNumber = '', string $textContactName = '', string $showContactRoute = '', string $textDocumentNumber = '',
|
||||
bool $hideAmount = false, string $classAmount = '',
|
||||
bool $hideShow = false, string $showRoute = '', bool $hideEdit = false, string $editRoute = '', bool $hideDuplicate = false, string $duplicateRoute = '',
|
||||
string $textDocumentStatus = '',
|
||||
bool $checkButtonReconciled = true, bool $checkButtonCancelled = true
|
||||
) {
|
||||
/* -- Main Start -- */
|
||||
$this->type = $type;
|
||||
$this->alias = $this->getAlias($type, $alias);
|
||||
$this->documents = ($documents) ? $documents : collect();
|
||||
$this->group = $this->getGroup($type, $group);
|
||||
$this->page = $this->getPage($type, $page);
|
||||
$this->textTabDocument = $this->getTextTabDocument($type, $textTabDocument);
|
||||
$this->textPage = $this->getTextPage($type, $textPage);
|
||||
|
||||
$this->permissionCreate = $this->getPermissionCreate($type, $permissionCreate);
|
||||
$this->permissionUpdate = $this->getPermissionUpdate($type, $permissionUpdate);
|
||||
$this->permissionDelete = $this->getPermissionDelete($type, $permissionDelete);
|
||||
|
||||
$this->routeTabDocument = $this->getRouteTabDocument($type, $routeTabDocument);
|
||||
$this->routeTabRecurring = $this->getRouteTabRecurring($type, $routeTabRecurring);
|
||||
/* -- Main End -- */
|
||||
|
||||
/* -- Buttons Start -- */
|
||||
$this->hideAcceptPayment = $hideAcceptPayment;
|
||||
|
||||
$this->checkPermissionCreate = $checkPermissionCreate;
|
||||
|
||||
$this->hideCreate = $hideCreate;
|
||||
$this->hideImport = $hideImport;
|
||||
$this->hideExport = $hideExport;
|
||||
|
||||
$this->createRoute = $this->getCreateRoute($type, $createRoute);
|
||||
$this->importRoute = $this->getImportRoute($importRoute);
|
||||
$this->importRouteParameters = $this->getImportRouteParameters($type, $importRouteParameters);
|
||||
$this->exportRoute = $this->getExportRoute($type, $exportRoute);
|
||||
/* -- Buttons End -- */
|
||||
|
||||
/* -- Content Start -- */
|
||||
/* -- Empty Page Start -- */
|
||||
$this->hideEmptyPage = $hideEmptyPage;
|
||||
|
||||
$this->emptyPageButtons = $this->getEmptyPageButtons($type, $emptyPageButtons);
|
||||
$this->imageEmptyPage = $this->getImageEmptyPage($type, $imageEmptyPage);
|
||||
$this->textEmptyPage = $this->getTextEmptyPage($type, $textEmptyPage);
|
||||
$this->urlDocsPath = $this->getUrlDocsPath($type, $urlDocsPath);
|
||||
/* -- Empty Page End -- */
|
||||
|
||||
/* -- Summary Start -- */
|
||||
$this->hideSummary = $hideSummary;
|
||||
$this->summaryItems = $this->getSummaryItems($type, $summaryItems);
|
||||
/* -- Sumamry End -- */
|
||||
|
||||
/* Container Start */
|
||||
$this->withoutTabs = $withoutTabs;
|
||||
$this->tabActive = $this->getTabActive($type, $tabActive);
|
||||
|
||||
$this->hideRecurringTemplates = $hideRecurringTemplates;
|
||||
|
||||
$this->hideSearchString = $hideSearchString;
|
||||
$this->hideBulkAction = $hideBulkAction;
|
||||
|
||||
$this->searchStringModel = $this->getSearchStringModel($type, $searchStringModel);
|
||||
|
||||
$this->bulkActionClass = $this->getBulkActionClass($type, $bulkActionClass);
|
||||
$this->bulkActionRouteParameters = $this->getBulkActionRouteParameters($type, $bulkActionRouteParameters);
|
||||
|
||||
$this->searchRoute = $this->getIndexRoute($type, $searchRoute);
|
||||
|
||||
$this->classBulkAction = $this->getClassBulkAction($type, $classBulkAction);
|
||||
|
||||
/* Document Start */
|
||||
$this->hideDueAt = $hideDueAt;
|
||||
$this->hideIssuedAt = $hideIssuedAt;
|
||||
$this->classDueAtAndIssueAt = $this->getClassDueAtAndIssueAt($type, $classDueAtAndIssueAt);
|
||||
$this->textDueAt = $this->getTextDueAt($type, $textDueAt);
|
||||
$this->textIssuedAt = $this->getTextIssuedAt($type, $textIssuedAt);
|
||||
|
||||
$this->hideStatus = $hideStatus;
|
||||
$this->classStatus = $this->getClassStatus($type, $classStatus);
|
||||
|
||||
$this->hideContactName = $hideContactName;
|
||||
$this->hideDocumentNumber = $hideDocumentNumber;
|
||||
$this->classContactNameAndDocumentNumber = $this->getClassContactNameAndDocumentNumber($type, $classContactNameAndDocumentNumber);
|
||||
$this->textContactName = $this->getTextContactName($type, $textContactName);
|
||||
$this->showContactRoute = $this->getShowContactRoute($type, $showContactRoute);
|
||||
$this->textDocumentNumber = $this->getTextDocumentNumber($type, $textDocumentNumber);
|
||||
|
||||
$this->hideAmount = $hideAmount;
|
||||
$this->classAmount = $this->getClassAmount($type, $classAmount);
|
||||
|
||||
$this->hideShow = $hideShow;
|
||||
$this->showRoute = $this->getShowRoute($type, $showRoute);
|
||||
|
||||
$this->hideEdit = $hideEdit;
|
||||
$this->editRoute = $this->getEditRoute($type, $editRoute);
|
||||
|
||||
$this->hideDuplicate = $hideDuplicate;
|
||||
$this->duplicateRoute = $this->getDuplicateRoute($type, $duplicateRoute);
|
||||
|
||||
$this->textDocumentStatus = $this->getTextDocumentStatus($type, $textDocumentStatus);
|
||||
|
||||
$this->checkButtonReconciled = $checkButtonReconciled;
|
||||
$this->checkButtonCancelled = $checkButtonCancelled;
|
||||
/* Document End */
|
||||
/* Container End */
|
||||
/* -- Content End -- */
|
||||
|
||||
// Set Parent data
|
||||
$this->setParentData();
|
||||
}
|
||||
|
||||
protected function getEmptyPageButtons($type, $emptyPageButtons)
|
||||
{
|
||||
if (! empty($emptyPageButtons)) {
|
||||
return $emptyPageButtons;
|
||||
}
|
||||
|
||||
$prefix = config('type.' . static::OBJECT_TYPE . '.' . $type . '.route.prefix', 'invoices');
|
||||
|
||||
$buttons = [];
|
||||
|
||||
if (! $this->hideCreate) {
|
||||
$route = $this->getRouteFromConfig($type, 'create');
|
||||
|
||||
$buttons[] = [
|
||||
'permission' => $this->permissionCreate,
|
||||
'url' => route($this->createRoute),
|
||||
'text' => trans('general.title.new', ['type' => trans_choice($this->textPage ?? 'general.' . $prefix, 1)]),
|
||||
'description' => trans('general.empty.actions.new', ['type' => strtolower(trans_choice($this->textPage ?? 'general.' . $prefix, 1))]),
|
||||
'active_badge' => true,
|
||||
];
|
||||
}
|
||||
|
||||
if (! $this->hideImport) {
|
||||
$route = $this->getRouteFromConfig($type, 'import');
|
||||
|
||||
$buttons[] = [
|
||||
'permission' => $this->permissionCreate,
|
||||
'url' => route($this->importRoute, $this->importRouteParameters),
|
||||
'text' => trans('import.title', ['type' => trans_choice($this->textPage ?? 'general.' . $prefix, 1)]),
|
||||
'description' => trans('general.empty.actions.import', ['type' => strtolower(trans_choice($this->textPage ?? 'general.' . $prefix, 1))]),
|
||||
];
|
||||
}
|
||||
|
||||
return $buttons;
|
||||
}
|
||||
|
||||
public function getSummaryItems($type, $summaryItems)
|
||||
{
|
||||
if (! empty($summaryItems)) {
|
||||
return $summaryItems;
|
||||
}
|
||||
|
||||
$route = $this->getIndexRoute($type, null);
|
||||
|
||||
$totals = $this->getTotalsForFutureDocuments($type);
|
||||
|
||||
$items = [];
|
||||
|
||||
foreach ($totals as $key => $total) {
|
||||
$title = ($key == 'overdue') ? trans('general.overdue') : trans('documents.statuses.' . $key);
|
||||
$href = route($route, ['search' => 'status:' . $key]);
|
||||
$amount = money($total, setting('default.currency'), true);
|
||||
|
||||
$items[] = [
|
||||
'title' => $title,
|
||||
'href' => $href,
|
||||
'amount' => $amount,
|
||||
];
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
protected function getTextTabDocument($type, $textTabDocument)
|
||||
{
|
||||
if (! empty($textTabDocument)) {
|
||||
return $textTabDocument;
|
||||
}
|
||||
|
||||
$default_key = config('type.' . static::OBJECT_TYPE . '.' . $type . '.translation.prefix');
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'tab_document', $default_key);
|
||||
|
||||
if (! empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
return 'general.invoices';
|
||||
}
|
||||
|
||||
public function getTabActive($type, $tabActive)
|
||||
{
|
||||
if (! empty($tabActive)) {
|
||||
return $tabActive;
|
||||
}
|
||||
|
||||
return $type;
|
||||
}
|
||||
|
||||
protected function getRouteTabDocument($type, $routeTabDocument)
|
||||
{
|
||||
if (! empty($routeTabDocument)) {
|
||||
return $routeTabDocument;
|
||||
}
|
||||
|
||||
$route = $this->getRouteFromConfig($type, 'document', 'invoices');
|
||||
|
||||
if (! empty($route)) {
|
||||
return $route;
|
||||
}
|
||||
|
||||
return 'invoices.index';
|
||||
}
|
||||
|
||||
protected function getRouteTabRecurring($type, $routeTabDocument)
|
||||
{
|
||||
if (! empty($routeTabDocument)) {
|
||||
return $routeTabDocument;
|
||||
}
|
||||
|
||||
$route = $this->getRouteFromConfig($type, 'recurring', 'recurring-invoices');
|
||||
|
||||
if (! empty($route)) {
|
||||
return $route;
|
||||
}
|
||||
|
||||
return 'recurring-invoices.index';
|
||||
}
|
||||
|
||||
protected function getClassDueAtAndIssueAt($type, $classDueAtAndIssueAt)
|
||||
{
|
||||
if (! empty($classDueAtAndIssueAt)) {
|
||||
return $classDueAtAndIssueAt;
|
||||
}
|
||||
|
||||
$class = $this->getClassFromConfig($type, 'due_at_and_issue_at');
|
||||
|
||||
if (! empty($class)) {
|
||||
return $class;
|
||||
}
|
||||
|
||||
return 'w-4/12 table-title hidden sm:table-cell';
|
||||
}
|
||||
|
||||
protected function getTextDueAt($type, $textDueAt)
|
||||
{
|
||||
if (! empty($textDueAt)) {
|
||||
return $textDueAt;
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'due_at', 'due_date');
|
||||
|
||||
if (! empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
return 'invoices.due_date';
|
||||
}
|
||||
|
||||
protected function getTextIssuedAt($type, $textIssuedAt)
|
||||
{
|
||||
if (! empty($textIssuedAt)) {
|
||||
return $textIssuedAt;
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case 'bill':
|
||||
case 'expense':
|
||||
case 'purchase':
|
||||
$default_key = 'bill_date';
|
||||
break;
|
||||
default:
|
||||
$default_key = 'invoice_date';
|
||||
break;
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'issued_at', $default_key);
|
||||
|
||||
if (! empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
return 'invoices.invoice_date';
|
||||
}
|
||||
|
||||
protected function getClassStatus($type, $classStatus)
|
||||
{
|
||||
if (! empty($classStatus)) {
|
||||
return $classStatus;
|
||||
}
|
||||
|
||||
$class = $this->getClassFromConfig($type, 'status');
|
||||
|
||||
if (! empty($class)) {
|
||||
return $class;
|
||||
}
|
||||
|
||||
return 'w-3/12 table-title hidden sm:table-cell';
|
||||
}
|
||||
|
||||
protected function getClassContactNameAndDocumentNumber($type, $classContactNameAndDocumentNumber)
|
||||
{
|
||||
if (! empty($classContactNameAndDocumentNumber)) {
|
||||
return $classContactNameAndDocumentNumber;
|
||||
}
|
||||
|
||||
$class = $this->getClassFromConfig($type, 'contact_name');
|
||||
|
||||
if (! empty($class)) {
|
||||
return $class;
|
||||
}
|
||||
|
||||
return 'w-6/12 sm:w-3/12 table-title';
|
||||
}
|
||||
|
||||
protected function getTextContactName($type, $textContactName)
|
||||
{
|
||||
if (! empty($textContactName)) {
|
||||
return $textContactName;
|
||||
}
|
||||
|
||||
$default_key = Str::plural(config('type.' . static::OBJECT_TYPE . '.' . $type . '.contact_type'), 2);
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'contact_name', $default_key, 'trans_choice');
|
||||
|
||||
if (! empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
return 'general.customers';
|
||||
}
|
||||
|
||||
protected function getShowContactRoute($type, $showContactRoute)
|
||||
{
|
||||
if (! empty($showContactRoute)) {
|
||||
return $showContactRoute;
|
||||
}
|
||||
|
||||
|
||||
if (! empty($showRoute)) {
|
||||
return $showRoute;
|
||||
}
|
||||
|
||||
$route = $this->getRouteFromConfig($type, 'contact.show', 1);
|
||||
|
||||
if (!empty($route)) {
|
||||
return $route;
|
||||
}
|
||||
|
||||
$default_key = Str::plural(config('type.' . static::OBJECT_TYPE . '.' . $type . '.contact_type'), 2);
|
||||
|
||||
return $default_key . '.show';
|
||||
}
|
||||
|
||||
protected function getTextDocumentNumber($type, $textDocumentNumber)
|
||||
{
|
||||
if (! empty($textDocumentNumber)) {
|
||||
return $textDocumentNumber;
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'document_number', 'numbers');
|
||||
|
||||
if (! empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
return 'general.numbers';
|
||||
}
|
||||
|
||||
protected function getClassAmount($type, $classAmount)
|
||||
{
|
||||
if (! empty($classAmount)) {
|
||||
return $classAmount;
|
||||
}
|
||||
|
||||
$class = $this->getClassFromConfig($type, 'amount');
|
||||
|
||||
if (! empty($class)) {
|
||||
return $class;
|
||||
}
|
||||
|
||||
return 'w-6/12 sm:w-2/12';
|
||||
}
|
||||
|
||||
protected function getTextDocumentStatus($type, $textDocumentStatus)
|
||||
{
|
||||
if (! empty($textDocumentStatus)) {
|
||||
return $textDocumentStatus;
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'document_status', 'statuses.');
|
||||
|
||||
if (! empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
$alias = config('type.' . static::OBJECT_TYPE . '.' . $type . '.alias');
|
||||
|
||||
if (! empty($alias)) {
|
||||
$translation = $alias . '::' . config('type.' . static::OBJECT_TYPE . '.' . $type . '.translation.prefix') . '.statuses';
|
||||
|
||||
if (is_array(trans($translation))) {
|
||||
return $translation . '.';
|
||||
}
|
||||
}
|
||||
|
||||
return 'documents.statuses.';
|
||||
}
|
||||
}
|
1352
app/Abstracts/View/Components/Documents/Show.php
Normal file
1352
app/Abstracts/View/Components/Documents/Show.php
Normal file
File diff suppressed because it is too large
Load Diff
679
app/Abstracts/View/Components/Documents/Template.php
Normal file
679
app/Abstracts/View/Components/Documents/Template.php
Normal file
@ -0,0 +1,679 @@
|
||||
<?php
|
||||
|
||||
namespace App\Abstracts\View\Components\Documents;
|
||||
|
||||
use App\Abstracts\View\Component;
|
||||
use App\Models\Common\Media;
|
||||
use App\Traits\DateTime;
|
||||
use App\Traits\Documents;
|
||||
use App\Traits\ViewComponents;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
use Intervention\Image\Exception\NotReadableException;
|
||||
use Image;
|
||||
|
||||
abstract class Template extends Component
|
||||
{
|
||||
use DateTime, Documents, ViewComponents;
|
||||
|
||||
public const OBJECT_TYPE = 'document';
|
||||
public const DEFAULT_TYPE = 'invoice';
|
||||
public const DEFAULT_PLURAL_TYPE = 'invoices';
|
||||
|
||||
public $type;
|
||||
|
||||
public $item;
|
||||
|
||||
public $document;
|
||||
|
||||
/** @var string */
|
||||
public $documentTemplate;
|
||||
|
||||
public $date_format;
|
||||
|
||||
public $logo;
|
||||
|
||||
public $backgroundColor;
|
||||
|
||||
public $hideFooter;
|
||||
|
||||
public $hideCompanyLogo;
|
||||
|
||||
public $hideCompanyDetails;
|
||||
|
||||
public $hideCompanyName;
|
||||
|
||||
public $hideCompanyAddress;
|
||||
|
||||
public $hideCompanyTaxNumber;
|
||||
|
||||
public $hideCompanyPhone;
|
||||
|
||||
public $hideCompanyEmail;
|
||||
|
||||
public $hideContactInfo;
|
||||
|
||||
public $hideContactName;
|
||||
|
||||
public $hideContactAddress;
|
||||
|
||||
public $hideContactTaxNumber;
|
||||
|
||||
public $hideContactPhone;
|
||||
|
||||
public $hideContactEmail;
|
||||
|
||||
public $hideOrderNumber;
|
||||
|
||||
public $hideDocumentNumber;
|
||||
|
||||
public $hideIssuedAt;
|
||||
|
||||
public $hideDueAt;
|
||||
|
||||
/** @var string */
|
||||
public $textDocumentTitle;
|
||||
|
||||
/** @var string */
|
||||
public $textDocumentSubheading;
|
||||
|
||||
public $textContactInfo;
|
||||
|
||||
/** @var string */
|
||||
public $textIssuedAt;
|
||||
|
||||
/** @var string */
|
||||
public $textDueAt;
|
||||
|
||||
/** @var string */
|
||||
public $textDocumentNumber;
|
||||
|
||||
/** @var string */
|
||||
public $textOrderNumber;
|
||||
|
||||
public $hideItems;
|
||||
|
||||
public $hideName;
|
||||
|
||||
public $hideDescription;
|
||||
|
||||
public $hideQuantity;
|
||||
|
||||
public $hidePrice;
|
||||
|
||||
public $hideDiscount;
|
||||
|
||||
public $hideAmount;
|
||||
|
||||
/** @var string */
|
||||
public $textItems;
|
||||
|
||||
/** @var string */
|
||||
public $textQuantity;
|
||||
|
||||
/** @var string */
|
||||
public $textPrice;
|
||||
|
||||
/** @var string */
|
||||
public $textAmount;
|
||||
|
||||
public $hideNote;
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
$type, $document, $item = false, $documentTemplate = '', $logo = '', $backgroundColor = '',
|
||||
bool $hideFooter = false, bool $hideCompanyLogo = false, bool $hideCompanyDetails = false,
|
||||
bool $hideCompanyName = false, bool $hideCompanyAddress = false, bool $hideCompanyTaxNumber = false, bool $hideCompanyPhone = false, bool $hideCompanyEmail = false, bool $hideContactInfo = false,
|
||||
bool $hideContactName = false, bool $hideContactAddress = false, bool $hideContactTaxNumber = false, bool $hideContactPhone = false, bool $hideContactEmail = false,
|
||||
bool $hideOrderNumber = false, bool $hideDocumentNumber = false, bool $hideIssuedAt = false, bool $hideDueAt = false,
|
||||
string $textDocumentTitle = '', string $textDocumentSubheading = '',
|
||||
string $textContactInfo = '', string $textDocumentNumber = '', string $textOrderNumber = '', string $textIssuedAt = '', string $textDueAt = '',
|
||||
bool $hideItems = false, bool $hideName = false, bool $hideDescription = false, bool $hideQuantity = false, bool $hidePrice = false, bool $hideDiscount = false, bool $hideAmount = false, bool $hideNote = false,
|
||||
string $textItems = '', string $textQuantity = '', string $textPrice = '', string $textAmount = ''
|
||||
) {
|
||||
$this->type = $type;
|
||||
$this->item = $item;
|
||||
$this->document = $document;
|
||||
$this->documentTemplate = $this->getDocumentTemplate($type, $documentTemplate);
|
||||
$this->logo = $this->getLogo($logo);
|
||||
$this->backgroundColor = $this->getBackgroundColor($type, $backgroundColor);
|
||||
|
||||
$this->hideFooter = $hideFooter;
|
||||
$this->hideCompanyLogo = $hideCompanyLogo;
|
||||
$this->hideCompanyDetails = $hideCompanyDetails;
|
||||
$this->hideCompanyName = $hideCompanyName;
|
||||
$this->hideCompanyAddress = $hideCompanyAddress;
|
||||
$this->hideCompanyTaxNumber = $hideCompanyTaxNumber;
|
||||
$this->hideCompanyPhone = $hideCompanyPhone;
|
||||
$this->hideCompanyEmail = $hideCompanyEmail;
|
||||
$this->hideContactInfo = $hideContactInfo;
|
||||
$this->hideContactName = $hideContactName;
|
||||
$this->hideContactAddress = $hideContactAddress;
|
||||
$this->hideContactTaxNumber = $hideContactTaxNumber;
|
||||
$this->hideContactPhone = $hideContactPhone;
|
||||
$this->hideContactEmail = $hideContactEmail;
|
||||
$this->hideOrderNumber = $hideOrderNumber;
|
||||
$this->hideDocumentNumber = $hideDocumentNumber;
|
||||
$this->hideIssuedAt = $hideIssuedAt;
|
||||
$this->hideDueAt = $hideDueAt;
|
||||
|
||||
$this->textDocumentTitle = $this->getTextDocumentTitle($type, $textDocumentTitle);
|
||||
$this->textDocumentSubheading = $this->gettextDocumentSubheading($type, $textDocumentSubheading);
|
||||
$this->textContactInfo = $this->getTextContactInfo($type, $textContactInfo);
|
||||
$this->textIssuedAt = $this->getTextIssuedAt($type, $textIssuedAt);
|
||||
$this->textDocumentNumber = $this->getTextDocumentNumber($type, $textDocumentNumber);
|
||||
$this->textDueAt = $this->getTextDueAt($type, $textDueAt);
|
||||
$this->textOrderNumber = $this->getTextOrderNumber($type, $textOrderNumber);
|
||||
|
||||
$this->hideItems = $this->getHideItems($type, $hideItems, $hideName, $hideDescription);
|
||||
$this->hideName = $this->getHideName($type, $hideName);
|
||||
$this->hideDescription = $this->getHideDescription($type, $hideDescription);
|
||||
$this->hideQuantity = $this->getHideQuantity($type, $hideQuantity);
|
||||
$this->hidePrice = $this->getHidePrice($type, $hidePrice);
|
||||
$this->hideDiscount = $this->getHideDiscount($type, $hideDiscount);
|
||||
$this->hideAmount = $this->getHideAmount($type, $hideAmount);
|
||||
$this->hideNote = $hideNote;
|
||||
|
||||
$this->textItems = $this->getTextItems($type, $textItems);
|
||||
$this->textQuantity = $this->getTextQuantity($type, $textQuantity);
|
||||
$this->textPrice = $this->getTextPrice($type, $textPrice);
|
||||
$this->textAmount = $this->getTextAmount($type, $textAmount);
|
||||
|
||||
// Set Parent data
|
||||
//$this->setParentData();
|
||||
}
|
||||
|
||||
protected function getDocumentTemplate($type, $documentTemplate)
|
||||
{
|
||||
if (! empty($documentTemplate)) {
|
||||
return $documentTemplate;
|
||||
}
|
||||
|
||||
if ($template = config('type.document.' . $type . '.template', false)) {
|
||||
return $template;
|
||||
}
|
||||
|
||||
$documentTemplate = setting($this->getSettingKey($type, 'template'), 'default');
|
||||
|
||||
return $documentTemplate;
|
||||
}
|
||||
|
||||
protected function getLogo($logo)
|
||||
{
|
||||
if (! empty($logo)) {
|
||||
return $logo;
|
||||
}
|
||||
|
||||
$media_id = (! empty($this->document->contact->logo) && ! empty($this->document->contact->logo->id)) ? $this->document->contact->logo->id : setting('company.logo');
|
||||
|
||||
$media = Media::find($media_id);
|
||||
|
||||
if (! empty($media)) {
|
||||
$path = $media->getDiskPath();
|
||||
|
||||
if (Storage::missing($path)) {
|
||||
return $logo;
|
||||
}
|
||||
} else {
|
||||
$path = base_path('public/img/company.png');
|
||||
}
|
||||
|
||||
try {
|
||||
$image = Image::cache(function($image) use ($media, $path) {
|
||||
$width = setting('invoice.logo_size_width');
|
||||
$height = setting('invoice.logo_size_height');
|
||||
|
||||
if ($media) {
|
||||
$image->make(Storage::get($path))->resize($width, $height)->encode();
|
||||
} else {
|
||||
$image->make($path)->resize($width, $height)->encode();
|
||||
}
|
||||
});
|
||||
} catch (NotReadableException | \Exception $e) {
|
||||
Log::info('Company ID: ' . company_id() . ' components/documentshow.php exception.');
|
||||
Log::info($e->getMessage());
|
||||
|
||||
$path = base_path('public/img/company.png');
|
||||
|
||||
$image = Image::cache(function($image) use ($path) {
|
||||
$width = setting('invoice.logo_size_width');
|
||||
$height = setting('invoice.logo_size_height');
|
||||
|
||||
$image->make($path)->resize($width, $height)->encode();
|
||||
});
|
||||
}
|
||||
|
||||
if (empty($image)) {
|
||||
return $logo;
|
||||
}
|
||||
|
||||
$extension = File::extension($path);
|
||||
|
||||
return 'data:image/' . $extension . ';base64,' . base64_encode($image);
|
||||
}
|
||||
|
||||
protected function getBackgroundColor($type, $backgroundColor)
|
||||
{
|
||||
if (! empty($backgroundColor)) {
|
||||
return $backgroundColor;
|
||||
}
|
||||
|
||||
if ($background_color = config('type.document.' . $type . '.color', false)) {
|
||||
return $background_color;
|
||||
}
|
||||
|
||||
|
||||
if (! empty($alias = config('type.document.' . $type . '.alias'))) {
|
||||
$type = $alias . '.' . str_replace('-', '_', $type);
|
||||
}
|
||||
|
||||
$backgroundColor = setting($this->getSettingKey($type, 'color'), '#55588b');
|
||||
|
||||
return $backgroundColor;
|
||||
}
|
||||
|
||||
protected function getTextDocumentTitle($type, $textDocumentTitle)
|
||||
{
|
||||
if (! empty($textDocumentTitle)) {
|
||||
return $textDocumentTitle;
|
||||
}
|
||||
|
||||
$key = $this->getSettingKey($type, 'title');
|
||||
|
||||
if (! empty(setting($key))) {
|
||||
return setting($key);
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'document_title', Str::plural($type));
|
||||
|
||||
if (! empty($translation)) {
|
||||
return trans_choice($translation, 1);
|
||||
}
|
||||
|
||||
return setting('invoice.title');
|
||||
}
|
||||
|
||||
protected function getTextDocumentSubheading($type, $textDocumentSubheading)
|
||||
{
|
||||
if (! empty($textDocumentSubheading)) {
|
||||
return $textDocumentSubheading;
|
||||
}
|
||||
|
||||
$key = $this->getSettingKey($type, 'subheading');
|
||||
|
||||
if (! empty(setting($key))) {
|
||||
return setting($key);
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'document_subheading', 'subheading');
|
||||
|
||||
if (! empty($translation)) {
|
||||
return trans($translation);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function getTextDocumentNumber($type, $textDocumentNumber)
|
||||
{
|
||||
if (! empty($textDocumentNumber)) {
|
||||
return $textDocumentNumber;
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case 'bill':
|
||||
case 'expense':
|
||||
case 'purchase':
|
||||
$default_key = 'bill_number';
|
||||
break;
|
||||
default:
|
||||
$default_key = 'invoice_number';
|
||||
break;
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'document_number', $default_key);
|
||||
|
||||
if (! empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
return 'general.numbers';
|
||||
}
|
||||
|
||||
protected function getTextOrderNumber($type, $textOrderNumber)
|
||||
{
|
||||
if (! empty($textOrderNumber)) {
|
||||
return $textOrderNumber;
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'order_number');
|
||||
|
||||
if (! empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
return 'invoices.order_number';
|
||||
}
|
||||
|
||||
protected function getTextContactInfo($type, $textContactInfo)
|
||||
{
|
||||
if (! empty($textContactInfo)) {
|
||||
return $textContactInfo;
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case 'bill':
|
||||
case 'expense':
|
||||
case 'purchase':
|
||||
$default_key = 'bill_from';
|
||||
break;
|
||||
default:
|
||||
$default_key = 'bill_to';
|
||||
break;
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'contact_info', $default_key);
|
||||
|
||||
if (! empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
return 'invoices.bill_to';
|
||||
}
|
||||
|
||||
protected function getTextIssuedAt($type, $textIssuedAt)
|
||||
{
|
||||
if (! empty($textIssuedAt)) {
|
||||
return $textIssuedAt;
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case 'bill':
|
||||
case 'expense':
|
||||
case 'purchase':
|
||||
$default_key = 'bill_date';
|
||||
break;
|
||||
default:
|
||||
$default_key = 'invoice_date';
|
||||
break;
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'issued_at', $default_key);
|
||||
|
||||
if (! empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
return 'invoices.invoice_date';
|
||||
}
|
||||
|
||||
protected function getTextDueAt($type, $textDueAt)
|
||||
{
|
||||
if (! empty($textDueAt)) {
|
||||
return $textDueAt;
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'due_at', 'due_date');
|
||||
|
||||
if (! empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
return 'invoices.due_date';
|
||||
}
|
||||
|
||||
protected function getTextItems($type, $textItems)
|
||||
{
|
||||
if (! empty($textItems)) {
|
||||
return $textItems;
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if (setting($this->getSettingKey($type, 'item_name'), 'items') === 'custom') {
|
||||
if (empty($textItems = setting($this->getSettingKey($type, 'item_name_input')))) {
|
||||
$textItems = 'general.items';
|
||||
}
|
||||
|
||||
return $textItems;
|
||||
}
|
||||
|
||||
if (setting($this->getSettingKey($type, 'item_name')) !== null
|
||||
&& (trans(setting($this->getSettingKey($type, 'item_name'))) != setting($this->getSettingKey($type, 'item_name')))
|
||||
) {
|
||||
return setting($this->getSettingKey($type, 'item_name'));
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'items');
|
||||
|
||||
if (! empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
return 'general.items';
|
||||
}
|
||||
|
||||
protected function getTextQuantity($type, $textQuantity)
|
||||
{
|
||||
if (! empty($textQuantity)) {
|
||||
return $textQuantity;
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if (setting($this->getSettingKey($type, 'quantity_name'), 'quantity') === 'custom') {
|
||||
if (empty($textQuantity = setting($this->getSettingKey($type, 'quantity_name_input')))) {
|
||||
$textQuantity = 'invoices.quantity';
|
||||
}
|
||||
|
||||
return $textQuantity;
|
||||
}
|
||||
|
||||
if (setting($this->getSettingKey($type, 'quantity_name')) !== null
|
||||
&& (trans(setting($this->getSettingKey($type, 'quantity_name'))) != setting($this->getSettingKey($type, 'quantity_name')))
|
||||
) {
|
||||
return setting($this->getSettingKey($type, 'quantity_name'));
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'quantity');
|
||||
|
||||
if (! empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
return 'invoices.quantity';
|
||||
}
|
||||
|
||||
protected function getTextPrice($type, $textPrice)
|
||||
{
|
||||
if (! empty($textPrice)) {
|
||||
return $textPrice;
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if (setting($this->getSettingKey($type, 'price_name'), 'price') === 'custom') {
|
||||
if (empty($textPrice = setting($this->getSettingKey($type, 'price_name_input')))) {
|
||||
$textPrice = 'invoices.price';
|
||||
}
|
||||
|
||||
return $textPrice;
|
||||
}
|
||||
|
||||
if (setting($this->getSettingKey($type, 'price_name')) !== null
|
||||
&& (trans(setting($this->getSettingKey($type, 'price_name'))) != setting($this->getSettingKey($type, 'price_name')))
|
||||
) {
|
||||
return setting($this->getSettingKey($type, 'price_name'));
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'price');
|
||||
|
||||
if (! empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
return 'invoices.price';
|
||||
}
|
||||
|
||||
protected function getTextAmount($type, $textAmount)
|
||||
{
|
||||
if (! empty($textAmount)) {
|
||||
return $textAmount;
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'amount');
|
||||
|
||||
if (! empty($translation)) {
|
||||
return $translation;
|
||||
}
|
||||
|
||||
return 'general.amount';
|
||||
}
|
||||
|
||||
protected function getHideItems($type, $hideItems, $hideName, $hideDescription)
|
||||
{
|
||||
if (! empty($hideItems)) {
|
||||
return $hideItems;
|
||||
}
|
||||
|
||||
$hide = $this->getHideFromConfig($type, 'items');
|
||||
|
||||
if ($hide) {
|
||||
return $hide;
|
||||
}
|
||||
|
||||
$hideItems = ($this->getHideName($type, $hideName) & $this->getHideDescription($type, $hideDescription)) ? true : false;
|
||||
|
||||
return $hideItems;
|
||||
}
|
||||
|
||||
protected function getHideName($type, $hideName)
|
||||
{
|
||||
if (! empty($hideName)) {
|
||||
return $hideName;
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideName = setting($this->getSettingKey($type, 'hide_item_name'), false)) {
|
||||
return $hideName;
|
||||
}
|
||||
|
||||
$hide = $this->getHideFromConfig($type, 'name');
|
||||
|
||||
if ($hide) {
|
||||
return $hide;
|
||||
}
|
||||
|
||||
// @todo what return value invoice or always false??
|
||||
return setting('invoice.hide_item_name', $hideName);
|
||||
}
|
||||
|
||||
protected function getHideDescription($type, $hideDescription)
|
||||
{
|
||||
if (! empty($hideDescription)) {
|
||||
return $hideDescription;
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideDescription = setting($this->getSettingKey($type, 'hide_item_description'), false)) {
|
||||
return $hideDescription;
|
||||
}
|
||||
|
||||
$hide = $this->getHideFromConfig($type, 'description');
|
||||
|
||||
if ($hide) {
|
||||
return $hide;
|
||||
}
|
||||
|
||||
// @todo what return value invoice or always false??
|
||||
return setting('invoice.hide_item_description', $hideDescription);
|
||||
}
|
||||
|
||||
protected function getHideQuantity($type, $hideQuantity)
|
||||
{
|
||||
if (! empty($hideQuantity)) {
|
||||
return $hideQuantity;
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideQuantity = setting($this->getSettingKey($type, 'hide_quantity'), false)) {
|
||||
return $hideQuantity;
|
||||
}
|
||||
|
||||
$hide = $this->getHideFromConfig($type, 'quantity');
|
||||
|
||||
if ($hide) {
|
||||
return $hide;
|
||||
}
|
||||
|
||||
// @todo what return value invoice or always false??
|
||||
return setting('invoice.hide_quantity', $hideQuantity);
|
||||
}
|
||||
|
||||
protected function getHidePrice($type, $hidePrice)
|
||||
{
|
||||
if (! empty($hidePrice)) {
|
||||
return $hidePrice;
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hidePrice = setting($this->getSettingKey($type, 'hide_price'), false)) {
|
||||
return $hidePrice;
|
||||
}
|
||||
|
||||
$hide = $this->getHideFromConfig($type, 'price');
|
||||
|
||||
if ($hide) {
|
||||
return $hide;
|
||||
}
|
||||
|
||||
// @todo what return value invoice or always false??
|
||||
return setting('invoice.hide_price', $hidePrice);
|
||||
}
|
||||
|
||||
protected function getHideDiscount($type, $hideDiscount)
|
||||
{
|
||||
if (! empty($hideDiscount)) {
|
||||
return $hideDiscount;
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideDiscount = setting($this->getSettingKey($type, 'hide_discount'), false)) {
|
||||
return $hideDiscount;
|
||||
}
|
||||
|
||||
$hide = $this->getHideFromConfig($type, 'discount');
|
||||
|
||||
if ($hide) {
|
||||
return $hide;
|
||||
}
|
||||
|
||||
// @todo what return value invoice or always false??
|
||||
return setting('invoice.hide_discount', $hideDiscount);
|
||||
}
|
||||
|
||||
protected function getHideAmount($type, $hideAmount)
|
||||
{
|
||||
if (! empty($hideAmount)) {
|
||||
return $hideAmount;
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideAmount = setting($this->getSettingKey($type, 'hide_amount'), false)) {
|
||||
return $hideAmount;
|
||||
}
|
||||
|
||||
$hide = $this->getHideFromConfig($type, 'amount');
|
||||
|
||||
if ($hide) {
|
||||
return $hide;
|
||||
}
|
||||
|
||||
// @todo what return value invoice or always false??
|
||||
return setting('invoice.hide_amount', $hideAmount);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user