diff --git a/app/Abstracts/Report.php b/app/Abstracts/Report.php index d4206499f..b98450aef 100644 --- a/app/Abstracts/Report.php +++ b/app/Abstracts/Report.php @@ -47,11 +47,6 @@ abstract class Report public $loaded = false; - public $indents = [ - 'table_header' => '0px', - 'table_rows' => '24px', - ]; - public $chart = [ 'line' => [ 'width' => '0', diff --git a/app/Jobs/Common/CreateContact.php b/app/Jobs/Common/CreateContact.php index b136766b3..2cf3710bc 100644 --- a/app/Jobs/Common/CreateContact.php +++ b/app/Jobs/Common/CreateContact.php @@ -4,6 +4,7 @@ namespace App\Jobs\Common; use App\Abstracts\Job; use App\Models\Auth\User; +use App\Models\Auth\Role; use App\Models\Common\Contact; class CreateContact extends Job @@ -48,11 +49,14 @@ class CreateContact extends Job $data = $this->request->all(); $data['locale'] = setting('default.locale', 'en-GB'); - $user = User::create($data); - $user->roles()->attach(['3']); - $user->companies()->attach([session('company_id')]); + $customer_role = Role::all()->filter(function ($role) { + return $role->hasPermission('read-client-portal'); + })->first(); + + $user = User::create($data); + $user->roles()->attach($customer_role); + $user->companies()->attach(session('company_id')); - // St user id to request $this->request['user_id'] = $user->id; } } diff --git a/app/Reports/ProfitLoss.php b/app/Reports/ProfitLoss.php index f96aac242..cf55d9f27 100644 --- a/app/Reports/ProfitLoss.php +++ b/app/Reports/ProfitLoss.php @@ -16,11 +16,6 @@ class ProfitLoss extends Report public $icon = 'fa fa-heart'; - public $indents = [ - 'table_header' => '0px', - 'table_rows' => '48px', - ]; - public function setViews() { parent::setViews(); diff --git a/app/Reports/TaxSummary.php b/app/Reports/TaxSummary.php index 15baa5679..f9dc3dca9 100644 --- a/app/Reports/TaxSummary.php +++ b/app/Reports/TaxSummary.php @@ -21,11 +21,6 @@ class TaxSummary extends Report public $icon = 'fa fa-percent'; - public $indents = [ - 'table_header' => '0px', - 'table_rows' => '48px', - ]; - public function setViews() { parent::setViews(); diff --git a/config/debugbar.php b/config/debugbar.php index 01116a0c5..a0d80cef2 100644 --- a/config/debugbar.php +++ b/config/debugbar.php @@ -122,7 +122,7 @@ return [ 'files' => false, // Show the included files 'config' => false, // Display config settings 'cache' => false, // Display cache events - 'models' => false, // Display models + 'models' => true, // Display models ], /* diff --git a/resources/views/layouts/print.blade.php b/resources/views/layouts/print.blade.php index 2dc203b99..3f5601fd4 100644 --- a/resources/views/layouts/print.blade.php +++ b/resources/views/layouts/print.blade.php @@ -1,5 +1,4 @@ - @include('partials.print.head') @@ -9,5 +8,4 @@ @stack('body_end') - diff --git a/resources/views/partials/print/head.blade.php b/resources/views/partials/print/head.blade.php index a3d2460b9..e9de5521f 100644 --- a/resources/views/partials/print/head.blade.php +++ b/resources/views/partials/print/head.blade.php @@ -20,7 +20,6 @@ } - @stack('css') @stack('stylesheet') diff --git a/resources/views/partials/reports/print.blade.php b/resources/views/partials/reports/print.blade.php index 6324a0e57..04e6f094a 100644 --- a/resources/views/partials/reports/print.blade.php +++ b/resources/views/partials/reports/print.blade.php @@ -1,12 +1,13 @@ @extends('layouts.print') -@section('content') +@section('title', $class->model->name) +@section('content')

{{ $class->model->name }}

{{ setting('company.name') }} - @if(!empty($class->model->settings->chart)) + @if (!empty($class->model->settings->chart)) @include($class->views['chart']) @endif diff --git a/resources/views/partials/reports/table.blade.php b/resources/views/partials/reports/table.blade.php index a3794a43a..5366b369d 100644 --- a/resources/views/partials/reports/table.blade.php +++ b/resources/views/partials/reports/table.blade.php @@ -9,7 +9,7 @@ @else -
{{ trans('general.no_records') }}
+
{{ trans('general.no_records') }}
@endif diff --git a/resources/views/partials/reports/table/footer.blade.php b/resources/views/partials/reports/table/footer.blade.php index ba6e3260a..26c39de50 100644 --- a/resources/views/partials/reports/table/footer.blade.php +++ b/resources/views/partials/reports/table/footer.blade.php @@ -1,9 +1,9 @@ +@php $grand_total = array_sum($class->footer_totals[$table]); @endphp + - {{ trans_choice('general.totals', 1) }} - @php $grand_total = 0; @endphp + {{ trans_choice('general.totals', 1) }} @foreach($class->footer_totals[$table] as $total) - @php $grand_total += $total; @endphp @money($total, setting('default.currency'), true) @endforeach @money($grand_total, setting('default.currency'), true) diff --git a/resources/views/partials/reports/table/rows.blade.php b/resources/views/partials/reports/table/rows.blade.php index 51832cc90..35f8c5cfc 100644 --- a/resources/views/partials/reports/table/rows.blade.php +++ b/resources/views/partials/reports/table/rows.blade.php @@ -1,9 +1,9 @@ -@php $row_total = 0; @endphp - - {{ $class->row_names[$table][$id] }} - @foreach($rows as $row) - @php $row_total += $row; @endphp - @money($row, setting('default.currency'), true) - @endforeach - @money($row_total, setting('default.currency'), true) - +@if ($row_total = array_sum($rows)) + + {{ $class->row_names[$table][$id] }} + @foreach($rows as $row) + @money($row, setting('default.currency'), true) + @endforeach + @money($row_total, setting('default.currency'), true) + +@endif diff --git a/resources/views/reports/profit_loss/content/footer.blade.php b/resources/views/reports/profit_loss/content/footer.blade.php index 286aeb58f..2b4b4728a 100644 --- a/resources/views/reports/profit_loss/content/footer.blade.php +++ b/resources/views/reports/profit_loss/content/footer.blade.php @@ -2,7 +2,7 @@ - + @foreach($class->net_profit as $profit) @endforeach diff --git a/resources/views/reports/profit_loss/table/footer.blade.php b/resources/views/reports/profit_loss/table/footer.blade.php index 5cae13c0c..a83bd574e 100644 --- a/resources/views/reports/profit_loss/table/footer.blade.php +++ b/resources/views/reports/profit_loss/table/footer.blade.php @@ -1,9 +1,9 @@ +@php $grand_total = array_sum($class->footer_totals[$table]); @endphp + - - @php $grand_total = 0; @endphp - @foreach($class->footer_totals[$table] as $date => $total) - @php $grand_total += $total; @endphp + + @foreach($class->footer_totals[$table] as $total) @endforeach diff --git a/resources/views/reports/tax_summary/content/header.blade.php b/resources/views/reports/tax_summary/content/header.blade.php index b658d1847..cec2e60d3 100644 --- a/resources/views/reports/tax_summary/content/header.blade.php +++ b/resources/views/reports/tax_summary/content/header.blade.php @@ -1,10 +1,10 @@ -
+
{{ trans('reports.net_profit') }}{{ trans('reports.net_profit') }}@money($profit, setting('default.currency'), true)
{{ trans_choice('general.totals', 1) }}{{ trans_choice('general.totals', 1) }}@money($total, setting('default.currency'), true)@money($grand_total, setting('default.currency'), true)
- + @foreach($class->dates as $date) - + @endforeach diff --git a/resources/views/reports/tax_summary/table/footer.blade.php b/resources/views/reports/tax_summary/table/footer.blade.php index 17b2c7bd9..c88fa5aee 100644 --- a/resources/views/reports/tax_summary/table/footer.blade.php +++ b/resources/views/reports/tax_summary/table/footer.blade.php @@ -1,9 +1,9 @@ +@php $grand_total = array_sum($class->footer_totals[$table]); @endphp + - - - @php $grand_total = 0; @endphp + + @foreach($class->footer_totals[$table] as $total) - @php $grand_total += $total; @endphp @endforeach diff --git a/resources/views/reports/tax_summary/table/header.blade.php b/resources/views/reports/tax_summary/table/header.blade.php index d35424d7c..61579aee4 100644 --- a/resources/views/reports/tax_summary/table/header.blade.php +++ b/resources/views/reports/tax_summary/table/header.blade.php @@ -1,4 +1,4 @@ - +
{{ $date }}{{ $date }}{{ trans_choice('general.totals', 1) }}
{{ trans('reports.net') }}
{{ trans('reports.net') }}@money($total, setting('default.currency'), true)@money($grand_total, setting('default.currency'), true)

{{ $table }}