diff --git a/app/Reports/ProfitLoss.php b/app/Reports/ProfitLoss.php index 45f6491a8..8ee91bff5 100644 --- a/app/Reports/ProfitLoss.php +++ b/app/Reports/ProfitLoss.php @@ -16,6 +16,11 @@ 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 af5c660e3..44b4c076d 100644 --- a/app/Reports/TaxSummary.php +++ b/app/Reports/TaxSummary.php @@ -21,10 +21,16 @@ class TaxSummary extends Report public $icon = 'fa fa-percent'; + public $indents = [ + 'table_header' => '0px', + 'table_rows' => '48px', + ]; + public function setViews() { parent::setViews(); $this->views['content.header'] = 'reports.tax_summary.content.header'; + $this->views['content.footer'] = 'reports.tax_summary.content.footer'; $this->views['table.header'] = 'reports.tax_summary.table.header'; $this->views['table.footer'] = 'reports.tax_summary.table.footer'; } @@ -62,6 +68,17 @@ class TaxSummary extends Report break; } + + // TODO: move to views + foreach ($this->footer_totals as $table => $dates) { + foreach ($dates as $date => $total) { + if (!isset($this->net_profit[$date])) { + $this->net_profit[$date] = 0; + } + + $this->net_profit[$date] += $total; + } + } } public function setTotals($items, $date_field, $check_type = false, $table = 'default') diff --git a/resources/views/partials/reports/header.blade.php b/resources/views/partials/reports/header.blade.php index f1ab68ed5..bb791ea6a 100644 --- a/resources/views/partials/reports/header.blade.php +++ b/resources/views/partials/reports/header.blade.php @@ -2,12 +2,12 @@ @section('new_button') - +  {{ trans('general.print') }} - +  {{ trans('general.export') }} diff --git a/resources/views/partials/reports/table.blade.php b/resources/views/partials/reports/table.blade.php index 3a9117175..424e3907c 100644 --- a/resources/views/partials/reports/table.blade.php +++ b/resources/views/partials/reports/table.blade.php @@ -1,5 +1,5 @@ -
- +
+
@include($class->views['table.header']) @if (!empty($class->row_values[$table])) diff --git a/resources/views/partials/reports/table/footer.blade.php b/resources/views/partials/reports/table/footer.blade.php index 9c987344d..32c99027a 100644 --- a/resources/views/partials/reports/table/footer.blade.php +++ b/resources/views/partials/reports/table/footer.blade.php @@ -1,6 +1,6 @@ - + @php $grand_total = 0; @endphp @foreach($class->footer_totals[$table] as $total) @php $grand_total += $total; @endphp diff --git a/resources/views/reports/profit_loss/content/footer.blade.php b/resources/views/reports/profit_loss/content/footer.blade.php index 02e139b7c..8f96b92a7 100644 --- a/resources/views/reports/profit_loss/content/footer.blade.php +++ b/resources/views/reports/profit_loss/content/footer.blade.php @@ -1,8 +1,8 @@ -
-
{{ trans_choice('general.totals', 1) }}{{ trans_choice('general.totals', 1) }}
+
+
- + @foreach($class->net_profit as $profit) @endforeach diff --git a/resources/views/reports/profit_loss/content/header.blade.php b/resources/views/reports/profit_loss/content/header.blade.php index 2f8335c02..8b700c307 100644 --- a/resources/views/reports/profit_loss/content/header.blade.php +++ b/resources/views/reports/profit_loss/content/header.blade.php @@ -1,12 +1,12 @@ -
-
{{ trans('reports.net_profit') }}{{ trans('reports.net_profit') }}@money($profit, setting('default.currency'), true)
+
+
@foreach($class->dates as $date) @endforeach - diff --git a/resources/views/reports/profit_loss/table/footer.blade.php b/resources/views/reports/profit_loss/table/footer.blade.php index 42262c86e..7d3b1e01c 100644 --- a/resources/views/reports/profit_loss/table/footer.blade.php +++ b/resources/views/reports/profit_loss/table/footer.blade.php @@ -1,6 +1,6 @@ - + @php $grand_total = 0; @endphp @foreach($class->footer_totals[$table] as $date => $total) @php $grand_total += $total; @endphp diff --git a/resources/views/reports/tax_summary/content/footer.blade.php b/resources/views/reports/tax_summary/content/footer.blade.php new file mode 100644 index 000000000..8f96b92a7 --- /dev/null +++ b/resources/views/reports/tax_summary/content/footer.blade.php @@ -0,0 +1,15 @@ +
+
{{ $date }} + {{ trans_choice('general.totals', 1) }}
{{ trans_choice('general.totals', 1) }}{{ trans_choice('general.totals', 1) }}
+ + + + @foreach($class->net_profit as $profit) + + @endforeach + + + +
{{ trans('reports.net_profit') }}@money($profit, setting('default.currency'), true) + @money(array_sum($class->net_profit), setting('default.currency'), true) +
+
diff --git a/resources/views/reports/tax_summary/content/header.blade.php b/resources/views/reports/tax_summary/content/header.blade.php index 018a553f6..72e64f7e6 100644 --- a/resources/views/reports/tax_summary/content/header.blade.php +++ b/resources/views/reports/tax_summary/content/header.blade.php @@ -1,5 +1,5 @@ -
- +
+
diff --git a/resources/views/reports/tax_summary/table/header.blade.php b/resources/views/reports/tax_summary/table/header.blade.php index 61579aee4..d35424d7c 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 @@ - +

{{ $table }}