mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 00:34:35 -04:00
php cs fixes
This commit is contained in:
parent
0f92b6c82e
commit
80b85d5c21
@ -73,12 +73,12 @@ class EmailReport
|
|||||||
|
|
||||||
public string $report_name = '';
|
public string $report_name = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optional array of report keys for
|
* Optional array of report keys for
|
||||||
* filter the columns of the report
|
* filter the columns of the report
|
||||||
*
|
*
|
||||||
* @var array $report_keys
|
* @var array $report_keys
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
public array $report_keys = [];
|
public array $report_keys = [];
|
||||||
|
|
||||||
@ -89,9 +89,9 @@ class EmailReport
|
|||||||
|
|
||||||
public bool $include_tax = true;
|
public bool $include_tax = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Comma separated string of statuses for filtering the Invoice report
|
* Comma separated string of statuses for filtering the Invoice report
|
||||||
*
|
*
|
||||||
* all
|
* all
|
||||||
* draft
|
* draft
|
||||||
* sent
|
* sent
|
||||||
@ -99,7 +99,7 @@ class EmailReport
|
|||||||
* unpaid
|
* unpaid
|
||||||
* overdue
|
* overdue
|
||||||
* viewed
|
* viewed
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
public string $status = '';
|
public string $status = '';
|
||||||
|
|
||||||
|
@ -928,11 +928,9 @@ class BaseController extends Controller
|
|||||||
} //allows us to selective display bank integrations back to the user if they can view / create bank transactions but without the bank balance being present in the response
|
} //allows us to selective display bank integrations back to the user if they can view / create bank transactions but without the bank balance being present in the response
|
||||||
elseif($this->entity_type == TaxRate::class && $user->hasIntersectPermissions(['create_invoice','edit_invoice','create_quote','edit_quote','create_purchase_order','edit_purchase_order'])) {
|
elseif($this->entity_type == TaxRate::class && $user->hasIntersectPermissions(['create_invoice','edit_invoice','create_quote','edit_quote','create_purchase_order','edit_purchase_order'])) {
|
||||||
// need to show tax rates if the user has the ability to create documents.
|
// need to show tax rates if the user has the ability to create documents.
|
||||||
}
|
} elseif($this->entity_type == ExpenseCategory::class && $user->hasPermission('create_expense')) {
|
||||||
elseif($this->entity_type == ExpenseCategory::class && $user->hasPermission('create_expense')) {
|
|
||||||
// need to show expense categories if the user has the ability to create expenses.
|
// need to show expense categories if the user has the ability to create expenses.
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$query->where('user_id', '=', $user->id);
|
$query->where('user_id', '=', $user->id);
|
||||||
}
|
}
|
||||||
} elseif (in_array($this->entity_type, [Design::class, GroupSetting::class, PaymentTerm::class, TaskStatus::class])) {
|
} elseif (in_array($this->entity_type, [Design::class, GroupSetting::class, PaymentTerm::class, TaskStatus::class])) {
|
||||||
|
@ -248,7 +248,7 @@ class PreviewController extends BaseController
|
|||||||
$company = $user->company();
|
$company = $user->company();
|
||||||
$design = \App\Models\Design::query()
|
$design = \App\Models\Design::query()
|
||||||
->where('id', $request_data['design_id'])
|
->where('id', $request_data['design_id'])
|
||||||
->where(function ($q) use ($user){
|
->where(function ($q) use ($user) {
|
||||||
$q->whereNull('company_id')->orWhere('company_id', $user->companyId());
|
$q->whereNull('company_id')->orWhere('company_id', $user->companyId());
|
||||||
})
|
})
|
||||||
->first();
|
->first();
|
||||||
|
@ -68,7 +68,7 @@ class SearchController extends Controller
|
|||||||
'type' => '/client',
|
'type' => '/client',
|
||||||
'id' => $contact->client->hashed_id,
|
'id' => $contact->client->hashed_id,
|
||||||
'path' => "/clients/{$contact->client->hashed_id}"
|
'path' => "/clients/{$contact->client->hashed_id}"
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,8 +41,9 @@ class VendorExpenseNotify implements ShouldQueue
|
|||||||
{
|
{
|
||||||
MultiDB::setDB($this->db);
|
MultiDB::setDB($this->db);
|
||||||
|
|
||||||
if(!$this->expense->vendor)
|
if(!$this->expense->vendor) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this->expense->vendor->contacts->filter(function (VendorContact $contact) {
|
$this->expense->vendor->contacts->filter(function (VendorContact $contact) {
|
||||||
return $contact->send_email && $contact->email;
|
return $contact->send_email && $contact->email;
|
||||||
|
@ -624,7 +624,7 @@ class PdfBuilder
|
|||||||
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.cost'], 'properties' => ['data-ref' => 'task_table-task.cost-td']];
|
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.cost'], 'properties' => ['data-ref' => 'task_table-task.cost-td']];
|
||||||
} elseif ($cell == '$product.discount' && !$this->service->company->enable_product_discount) {
|
} elseif ($cell == '$product.discount' && !$this->service->company->enable_product_discount) {
|
||||||
$element['elements'][] = ['element' => 'td', 'content' => $row['$product.discount'], 'properties' => ['data-ref' => 'product_table-product.discount-td', 'style' => 'display: none;']];
|
$element['elements'][] = ['element' => 'td', 'content' => $row['$product.discount'], 'properties' => ['data-ref' => 'product_table-product.discount-td', 'style' => 'display: none;']];
|
||||||
}elseif ($cell == '$task.hours') {
|
} elseif ($cell == '$task.hours') {
|
||||||
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.quantity'], 'properties' => ['data-ref' => 'task_table-task.hours-td']];
|
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.quantity'], 'properties' => ['data-ref' => 'task_table-task.hours-td']];
|
||||||
} elseif ($cell == '$product.tax_rate1') {
|
} elseif ($cell == '$product.tax_rate1') {
|
||||||
$element['elements'][] = ['element' => 'td', 'content' => $row[$cell], 'properties' => ['data-ref' => 'product_table-product.tax1-td']];
|
$element['elements'][] = ['element' => 'td', 'content' => $row[$cell], 'properties' => ['data-ref' => 'product_table-product.tax1-td']];
|
||||||
@ -806,7 +806,7 @@ class PdfBuilder
|
|||||||
$elements[] = ['element' => 'th', 'content' => $aliases[$column] . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($aliases[$column], 1) . '-th', 'hidden' => $this->service->config->settings->hide_empty_columns_on_pdf]];
|
$elements[] = ['element' => 'th', 'content' => $aliases[$column] . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($aliases[$column], 1) . '-th', 'hidden' => $this->service->config->settings->hide_empty_columns_on_pdf]];
|
||||||
} elseif ($column == '$product.discount' && !$this->service->company->enable_product_discount) {
|
} elseif ($column == '$product.discount' && !$this->service->company->enable_product_discount) {
|
||||||
$elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($column, 1) . '-th', 'style' => 'display: none;']];
|
$elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($column, 1) . '-th', 'style' => 'display: none;']];
|
||||||
}elseif ($column == '$product.tax_rate1') {
|
} elseif ($column == '$product.tax_rate1') {
|
||||||
$elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-product.tax1-th", 'hidden' => $this->service->config->settings->hide_empty_columns_on_pdf]];
|
$elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-product.tax1-th", 'hidden' => $this->service->config->settings->hide_empty_columns_on_pdf]];
|
||||||
} elseif ($column == '$product.tax_rate2') {
|
} elseif ($column == '$product.tax_rate2') {
|
||||||
$elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-product.tax2-th", 'hidden' => $this->service->config->settings->hide_empty_columns_on_pdf]];
|
$elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-product.tax2-th", 'hidden' => $this->service->config->settings->hide_empty_columns_on_pdf]];
|
||||||
|
@ -69,9 +69,9 @@ class PdfMock
|
|||||||
if(isset($this->request['design_id']) && $design = Design::withTrashed()->find($this->request['design_id'])) {
|
if(isset($this->request['design_id']) && $design = Design::withTrashed()->find($this->request['design_id'])) {
|
||||||
$pdf_config->design = $design;
|
$pdf_config->design = $design;
|
||||||
$pdf_config->entity_design_id = $design->hashed_id;
|
$pdf_config->entity_design_id = $design->hashed_id;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
$pdf_config->design = Design::withTrashed()->find($this->decodePrimaryKey($pdf_config->entity_design_id));
|
$pdf_config->design = Design::withTrashed()->find($this->decodePrimaryKey($pdf_config->entity_design_id));
|
||||||
|
}
|
||||||
|
|
||||||
$pdf_service->config = $pdf_config;
|
$pdf_service->config = $pdf_config;
|
||||||
|
|
||||||
|
@ -799,7 +799,7 @@ class Design extends BaseDesign
|
|||||||
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.cost'], 'properties' => ['data-ref' => 'task_table-task.cost-td']];
|
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.cost'], 'properties' => ['data-ref' => 'task_table-task.cost-td']];
|
||||||
} elseif ($cell == '$product.discount' && !$this->company->enable_product_discount) {
|
} elseif ($cell == '$product.discount' && !$this->company->enable_product_discount) {
|
||||||
$element['elements'][] = ['element' => 'td', 'content' => $row['$product.discount'], 'properties' => ['data-ref' => 'product_table-product.discount-td', 'style' => 'display: none;']];
|
$element['elements'][] = ['element' => 'td', 'content' => $row['$product.discount'], 'properties' => ['data-ref' => 'product_table-product.discount-td', 'style' => 'display: none;']];
|
||||||
} elseif ($cell == '$task.hours') {
|
} elseif ($cell == '$task.hours') {
|
||||||
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.quantity'], 'properties' => ['data-ref' => 'task_table-task.hours-td']];
|
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.quantity'], 'properties' => ['data-ref' => 'task_table-task.hours-td']];
|
||||||
} elseif ($cell == '$product.tax_rate1') {
|
} elseif ($cell == '$product.tax_rate1') {
|
||||||
$element['elements'][] = ['element' => 'td', 'content' => $row[$cell], 'properties' => ['data-ref' => 'product_table-product.tax1-td']];
|
$element['elements'][] = ['element' => 'td', 'content' => $row[$cell], 'properties' => ['data-ref' => 'product_table-product.tax1-td']];
|
||||||
|
@ -82,12 +82,11 @@ class PdfMaker
|
|||||||
|
|
||||||
$ts = new TemplateService();
|
$ts = new TemplateService();
|
||||||
|
|
||||||
if(isset($this->data['template']['entity'])){
|
if(isset($this->data['template']['entity'])) {
|
||||||
try{
|
try {
|
||||||
$entity = $this->data['template']['entity'];
|
$entity = $this->data['template']['entity'];
|
||||||
$ts->setCompany($entity->company);
|
$ts->setCompany($entity->company);
|
||||||
}
|
} catch(\Exception $e) {
|
||||||
catch(\Exception $e){
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -179,11 +179,13 @@ class TemplateService
|
|||||||
|
|
||||||
private function getSettings(): object
|
private function getSettings(): object
|
||||||
{
|
{
|
||||||
if($this->settings)
|
if($this->settings) {
|
||||||
return $this->settings;
|
return $this->settings;
|
||||||
|
}
|
||||||
|
|
||||||
if($this->client)
|
if($this->client) {
|
||||||
return $this->client->getMergedSettings();
|
return $this->client->getMergedSettings();
|
||||||
|
}
|
||||||
|
|
||||||
return $this->company->settings;
|
return $this->company->settings;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user