Merge branch 'master' of github.com:akaunting/akaunting

This commit is contained in:
denisdulici 2020-01-19 00:42:00 +03:00
commit ecdbc74f29
31 changed files with 231 additions and 159 deletions

View File

@ -18,10 +18,6 @@ class Report extends FormRequest
'name' => 'required|string',
'description' => 'required|string',
'class' => 'required|string',
'group' => 'required|string',
'period' => 'required|string',
'basis' => 'required|string',
'chart' => 'required|string',
];
}
}

View File

@ -348,13 +348,25 @@ th, td {
*/
.rp-border-top-1 {
border-top: 1px solid #3c3f72;
border-top: 1px solid #e5e5e5;
}
.rp-border-bottom-1 {
border-bottom: 1px solid #3c3f72;
border-bottom: 1px solid #e5e5e5;
}
.rp-border-top-1 {
border-top: 1px solid #e5e5e5;
}
.rp-border-0 {
border: 0 !important;
}
.rp-border-collapse
{
border-collapse: collapse;
}
.rp-float-left {
float: left;
@ -371,7 +383,3 @@ th, td {
=========================================================
*/

View File

@ -281,6 +281,10 @@
</el-select>
<component v-bind:is="add_new_html" @submit="onSubmit"></component>
<select :name="name" class="d-none" v-model="real_model">
<option v-for="(label, value) in selectOptions" :value="value">{{ label }}</option>
</select>
</base-input>
</template>

View File

@ -42,6 +42,20 @@ export default class Form {
continue;
}
if (form_element.getAttribute('data-field')) {
if (!this[form_element.getAttribute('data-field')]) {
var field = {};
this[form_element.getAttribute('data-field')] = field;
}
if (!this[form_element.getAttribute('data-field')][name]) {
this[form_element.getAttribute('data-field')][name] = '';
}
continue;
}
if (type == 'radio') {
if (!this[name]) {
this[name] = (form_element.getAttribute('value') ? 1 : 0) || 0;

View File

@ -28,28 +28,54 @@ const app = new Vue({
data: function () {
return {
form: new Form('report'),
bulk_action: new BulkAction('reports')
bulk_action: new BulkAction('reports'),
report_fields: '',
}
},
methods: {
onChangeClass(class_name) {
axios.get(url + '/common/reports/groups', {
axios.get(url + '/common/reports/fields', {
params: {
class: class_name
}
})
.then(response => {
let options = response.data.data;
let form = this.form;
let html = response.data.html;
this.$children.forEach(select => {
if (select.name == 'group') {
select.selectOptions = options;
}
this.report_fields = Vue.component('add-new-component', (resolve, reject) => {
resolve({
template : '<div id="report-fields" class="row col-md-12">' + html + '</div>',
mixins: [
Global
],
created: function() {
this.form = form;
},
data: function () {
return {
form: {},
}
},
watch: {
form: function (form) {
this.$emit("change", form);
}
},
})
});
})
.catch(error => {
});
},
onChangeReportFields(event) {
this.form = event;
}
}
});

View File

@ -22,7 +22,9 @@
{{ Form::textareaGroup('description', trans('general.description'), null, null, ['rows' => '3', 'required' => 'required']) }}
<component v-bind:is="report_fields"></component>
{{ Form::hidden('report', 'invalid', ['data-field' => 'settings']) }}
<component v-bind:is="report_fields" @change="onChangeReportFields"></component>
</div>
</div>

View File

@ -12,7 +12,7 @@
{{ Form::checkbox($name, $item->$id, null, [
'id' => 'checkbox-' . $name . '-' . $item->$id,
'class' => 'custom-control-input',
'v-model' => !empty($attributes['v-model']) ? $attributes['v-model'] : 'form.' . $name
'v-model' => !empty($attributes['v-model']) ? $attributes['v-model'] : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name
]) }}
<label class="custom-control-label" for="checkbox-{{ $name . '-' . $item->$id}}">

View File

@ -1,25 +1,25 @@
@stack($name . '_input_start')
<akaunting-date
class="{{ $col }} {{ isset($attributes['required']) ? 'required' : '' }}"
:form-classes="[{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }} }]"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
:value="'{{ old($name, $value) }}'"
:config="{
allowInput: true,
@if (!empty($attributes['show-date-format']))
altInput: true,
altFormat: '{{ $attributes['show-date-format'] }}',
@endif
@if (!empty($attributes['date-format']))
dateFormat: '{{ $attributes['date-format'] }}'
@endif
}"
:icon="'fa fa-{{ $icon }}'"
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event' : 'form.' . $name . ' = $event' }}"
:form-error="{{ isset($attributes['v-error-message']) ? $attributes['v-error-message'] : 'form.errors.get("' . $name . '")' }}"
></akaunting-date>
<akaunting-date
class="{{ $col }} {{ isset($attributes['required']) ? 'required' : '' }}"
:form-classes="[{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }} }]"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
:value="'{{ old($name, $value) }}'"
:config="{
allowInput: true,
@if (!empty($attributes['show-date-format']))
altInput: true,
altFormat: '{{ $attributes['show-date-format'] }}',
@endif
@if (!empty($attributes['date-format']))
dateFormat: '{{ $attributes['date-format'] }}'
@endif
}"
:icon="'fa fa-{{ $icon }}'"
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event' : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' : 'form.' . $name . ' = $event' }}"
:form-error="{{ isset($attributes['v-error-message']) ? $attributes['v-error-message'] : 'form.errors.get("' . $name . '")' }}"
></akaunting-date>
@stack($name . '_input_end')

View File

@ -18,7 +18,7 @@
'data-name' => $name,
'data-value' => $value,
'placeholder' => trans('general.form.enter', ['field' => $text]),
'v-model' => !empty($attributes['v-model']) ? $attributes['v-model'] : 'form.' . $name
'v-model' => !empty($attributes['v-model']) ? $attributes['v-model'] : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name
], $attributes)) !!}
</div>

View File

@ -17,7 +17,7 @@
'data-name' => $input_name,
'data-value' => $input_value,
'placeholder' => trans('general.form.enter', ['field' => $text]),
'v-model' => !empty($attributes['v-model']) ? $attributes['v-model'] : 'form.' . $input_name
'v-model' => !empty($attributes['v-model']) ? $attributes['v-model'] : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name
]) !!}
</div>

View File

@ -22,7 +22,7 @@
'class' => 'form-control',
'data-name' => $name,
'data-value' => $value,
'v-model.lazy' => !empty($attributes['v-model']) ? $attributes['v-model'] : 'form.' . $name,
'v-model.lazy' => !empty($attributes['v-model']) ? $attributes['v-model'] : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name,
'v-money' => 'money'
], $attributes)) !!}
</div>

View File

@ -32,7 +32,7 @@
@if (!empty($attributes['collapse']))
:collapse="true"
@endif
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event' : 'form.' . $name . ' = $event' }}"
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event' : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' : 'form.' . $name . ' = $event' }}"
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif

View File

@ -13,7 +13,7 @@
@if (!empty($attributes['collapse']))
:collapse="true"
@endif
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event' : 'form.' . $name . ' = $event' }}"
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event' : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' : 'form.' . $name . ' = $event' }}"
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif

View File

@ -16,7 +16,7 @@
'data-name' => $name,
'data-value' => $value,
'placeholder' => trans('general.form.enter', ['field' => $text]),
'v-model' => !empty($attributes['v-model']) ? $attributes['v-model'] : 'form.' . $name
'v-model' => !empty($attributes['v-model']) ? $attributes['v-model'] : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name
], $attributes)) !!}
</div>

View File

@ -17,7 +17,7 @@
'class' => 'form-control',
'data-name' => $name,
'placeholder' => trans('general.form.enter', ['field' => $text]),
'v-model' => !empty($attributes['v-model']) ? $attributes['v-model'] : 'form.' . $name
'v-model' => !empty($attributes['v-model']) ? $attributes['v-model'] : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name
], $attributes)) !!}
</div>

View File

@ -8,12 +8,12 @@
<div class="btn-group btn-group-toggle radio-yes-no" data-toggle="buttons">
<label class="btn btn-success" @click="form.{{ $name }}=1" v-bind:class="{ active: form.{{ $name }} == 1 }">
{{ trans('general.yes') }}
<input type="radio" name="{{ $name }}" id="{{ $name }}-1" v-model="{{ !empty($attributes['v-model']) ? $attributes['v-model'] : 'form.' . $name }}">
<input type="radio" name="{{ $name }}" id="{{ $name }}-1" v-model="{{ !empty($attributes['v-model']) ? $attributes['v-model'] : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name }}">
</label>
<label class="btn btn-danger" @click="form.{{ $name }}=0" v-bind:class="{ active: form.{{ $name }} == 0 }">
{{ trans('general.no') }}
<input type="radio" name="{{ $name }}" id="{{ $name }}-0" v-model="{{ !empty($attributes['v-model']) ? $attributes['v-model'] : 'form.' . $name }}">
<input type="radio" name="{{ $name }}" id="{{ $name }}-0" v-model="{{ !empty($attributes['v-model']) ? $attributes['v-model'] : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name }}">
</label>
</div>
<input type="hidden" name="{{ $name }}" value="{{ ($value) ? true : false }}" />

View File

@ -27,7 +27,7 @@
]
]
])}}"
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event' : 'form.' . $name . ' = $event' }}"
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event' : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' : 'form.' . $name . ' = $event' }}"
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif

View File

@ -1,26 +1,28 @@
@stack($name . '_input_start')
<akaunting-select
class="{{ $col }} {{ isset($attributes['required']) ? 'required' : '' }}"
:form-classes="[{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }} }]"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
:options="{{ json_encode($values) }}"
:value="'{{ old($name, $selected) }}'"
:icon="'{{ $icon }}'"
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event' : 'form.' . $name . ' = $event' }}"
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif
@if (isset($attributes['disabled']))
:disabled="{{ $attributes['disabled'] }}"
@endif
@if(isset($attributes['v-error-message']))
:form-error="{{ $attributes['v-error-message'] }}"
@else
:form-error="form.errors.get('{{ $name }}')"
@endif
:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
></akaunting-select>
<akaunting-select
class="{{ $col }} {{ isset($attributes['required']) ? 'required' : '' }}"
:form-classes="[{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }} }]"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
:options="{{ json_encode($values) }}"
:value="'{{ old($name, $selected) }}'"
:icon="'{{ $icon }}'"
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event' : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' : 'form.' . $name . ' = $event' }}"
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif
@if (isset($attributes['disabled']))
:disabled="{{ $attributes['disabled'] }}"
@endif
@if(isset($attributes['v-error-message']))
:form-error="{{ $attributes['v-error-message'] }}"
@else
:form-error="form.errors.get('{{ $name }}')"
@endif
:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
></akaunting-select>
@stack($name . '_input_end')

View File

@ -1,39 +1,41 @@
@stack($name . '_input_start')
<akaunting-select
class="{{ $col }} {{ isset($attributes['required']) ? 'required' : '' }}"
:form-classes="[{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }} }]"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
:options="{{ json_encode($values) }}"
:value="'{{ old($name, $selected) }}'"
:icon="'{{ $icon }}'"
:add-new="{{ json_encode([
'status' => true,
'text' => trans('general.form.add_new', ['field' => $text]),
'path' => isset($attributes['path']) ? $attributes['path']: false,
'type' => isset($attributes['type']) ? $attributes['type'] : 'modal',
'field' => isset($attributes['field']) ? $attributes['field'] : 'name',
'buttons' => [
'cancel' => [
'text' => trans('general.cancel'),
'icon' => 'fas fa-times',
'class' => 'btn-outline-secondary'
],
'confirm' => [
'text' => trans('general.save'),
'icon' => 'fas fa-save',
'class' => 'btn-success'
]
<akaunting-select
class="{{ $col }} {{ isset($attributes['required']) ? 'required' : '' }}"
:form-classes="[{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }} }]"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
:options="{{ json_encode($values) }}"
:value="'{{ old($name, $selected) }}'"
:icon="'{{ $icon }}'"
:add-new="{{ json_encode([
'status' => true,
'text' => trans('general.form.add_new', ['field' => $text]),
'path' => isset($attributes['path']) ? $attributes['path']: false,
'type' => isset($attributes['type']) ? $attributes['type'] : 'modal',
'field' => isset($attributes['field']) ? $attributes['field'] : 'name',
'buttons' => [
'cancel' => [
'text' => trans('general.cancel'),
'icon' => 'fas fa-times',
'class' => 'btn-outline-secondary'
],
'confirm' => [
'text' => trans('general.save'),
'icon' => 'fas fa-save',
'class' => 'btn-success'
]
])}}"
:group="true"
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event' : 'form.' . $name . ' = $event' }}"
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif
:form-error="{{ isset($attributes['v-error-message']) ? $attributes['v-error-message'] : 'form.errors.get("' . $name . '")' }}"
:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
></akaunting-select>
]
])}}"
:group="true"
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event' : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' : 'form.' . $name . ' = $event' }}"
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif
:form-error="{{ isset($attributes['v-error-message']) ? $attributes['v-error-message'] : 'form.errors.get("' . $name . '")' }}"
:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
></akaunting-select>
@stack($name . '_input_end')

View File

@ -1,20 +1,22 @@
@stack($name . '_input_start')
<akaunting-select
class="{{ $col }} {{ isset($attributes['required']) ? 'required' : '' }}"
:form-classes="[{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }} }]"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
:options="{{ json_encode($values) }}"
:value="'{{ old($name, $selected) }}'"
:icon="'{{ $icon }}'"
:group="true"
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model']. ' = $event' : 'form.' . $name . ' = $event' }}"
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif
:form-error="{{ isset($attributes['v-error-message']) ? $attributes['v-error-message'] : 'form.errors.get("' . $name . '")' }}"
:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
></akaunting-select>
<akaunting-select
class="{{ $col }} {{ isset($attributes['required']) ? 'required' : '' }}"
:form-classes="[{'has-error': {{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }} }]"
:title="'{{ $text }}'"
:placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'"
:name="'{{ $name }}'"
:options="{{ json_encode($values) }}"
:value="'{{ old($name, $selected) }}'"
:icon="'{{ $icon }}'"
:group="true"
@interface="{{ !empty($attributes['v-model']) ? $attributes['v-model'] . ' = $event' : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' : 'form.' . $name . ' = $event' }}"
@if (!empty($attributes['change']))
@change="{{ $attributes['change'] }}($event)"
@endif
:form-error="{{ isset($attributes['v-error-message']) ? $attributes['v-error-message'] : 'form.errors.get("' . $name . '")' }}"
:no-data-text="'{{ trans('general.no_data') }}'"
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
></akaunting-select>
@stack($name . '_input_end')

View File

@ -16,7 +16,7 @@
'data-name' => $name,
'data-value' => $value,
'placeholder' => trans('general.form.enter', ['field' => $text]),
'v-model' => !empty($attributes['v-model']) ? $attributes['v-model'] : 'form.' . $name
'v-model' => !empty($attributes['v-model']) ? $attributes['v-model'] : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name
], $attributes)) !!}
</div>

View File

@ -10,7 +10,7 @@
'data-name' => $name,
'data-value' => $value,
'placeholder' => trans('general.form.enter', ['field' => $text]),
'v-model' => !empty($attributes['v-model']) ? $attributes['v-model'] : 'form.' . $name
'v-model' => !empty($attributes['v-model']) ? $attributes['v-model'] : !empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name
], $attributes)) !!}
<div class="invalid-feedback d-block"

View File

@ -2,14 +2,30 @@
@php $type = $field['type']; @endphp
@if (($type == 'textGroup') || ($type == 'emailGroup') || ($type == 'passwordGroup'))
{{ Form::$type('settings[' . $field['name'] . ']', $field['title'], $field['icon'], $field['attributes']) }}
{{ Form::$type('settings[' . $field['name'] . ']', $field['title'], $field['icon'], array_merge([
'data-field' => 'settings'
],
$field['attributes'])
) }}
@elseif ($type == 'textareaGroup')
{{ Form::$type('settings[' . $field['name'] . ']', $field['title']) }}
@elseif ($type == 'selectGroup')
{{ Form::$type('settings[' . $field['name'] . ']', $field['title'], $field['icon'], $field['values'], $field['selected'], $field['attributes']) }}
{{ Form::$type($field['name'], $field['title'], $field['icon'], $field['values'], $field['selected'], array_merge([
'data-field' => 'settings'
],
$field['attributes'])
) }}
@elseif ($type == 'radioGroup')
{{ Form::$type('settings[' . $field['name'] . ']', $field['title'], 1, $field['enable'], $field['disable'], $field['attributes']) }}
{{ Form::$type('settings[' . $field['name'] . ']', $field['title'], 1, $field['enable'], $field['disable'], array_merge([
'data-field' => 'settings'
],
$field['attributes'])
) }}
@elseif ($type == 'checkboxGroup')
{{ Form::$type('settings[' . $field['name'] . ']', $field['title'], $field['items'], $field['value'], $field['id'], $field['attributes']) }}
{{ Form::$type('settings[' . $field['name'] . ']', $field['title'], $field['items'], $field['value'], $field['id'], array_merge([
'data-field' => 'settings'
],
$field['attributes'])
) }}
@endif
@endforeach

View File

@ -1,5 +1,5 @@
<div class="table-responsive overflow-auto mt-4">
<table class="table align-items-center">
<table class="table align-items-center rp-border-collapse">
@include($class->views['table.header'])
<tbody>
@if (!empty($class->rows[$table]))

View File

@ -1,5 +1,5 @@
<tfoot>
<tr>
<tr class="rp-border-top-1">
<th class="report-column">{{ trans_choice('general.totals', 1) }}</th>
@php $total_total = 0; @endphp
@foreach($class->totals[$table] as $total)

View File

@ -1,9 +1,9 @@
@php $row_total = 0; @endphp
<tr>
<td class="report-column rp-border-top-1">{{ $class->getTableRowList()[$id] }}</td>
<tr class="rp-border-top-1">
<td class="report-column">{{ $class->getTableRowList()[$id] }}</td>
@foreach($items as $item)
@php $row_total += $item; @endphp
<td class="report-column text-right px-0 rp-border-top-1">@money($item, setting('default.currency'), true)</td>
<td class="report-column text-right px-0">@money($item, setting('default.currency'), true)</td>
@endforeach
<td class="report-column text-right rp-border-top-1">@money($row_total, setting('default.currency'), true)</td>
<td class="report-column text-right">@money($row_total, setting('default.currency'), true)</td>
</tr>

View File

@ -1,12 +1,12 @@
<div class="table-responsive overflow-auto mt-5">
<table class="table align-items-center">
<table class="table align-items-center rp-border-collapse">
<tfoot class="border-top-style">
<tr>
<th class="report-column rp-border-top-1">{{ trans('reports.net_profit') }}</th>
<tr class="rp-border-top-1">
<th class="report-column">{{ trans('reports.net_profit') }}</th>
@foreach($class->net_profit as $profit)
<th class="report-column text-right px-0 rp-border-top-1">@money($profit, setting('default.currency'), true)</th>
<th class="report-column text-right px-0">@money($profit, setting('default.currency'), true)</th>
@endforeach
<th class="report-column text-right rp-border-top-1">
<th class="report-column text-right">
@money(array_sum($class->net_profit), setting('default.currency'), true)
</th>
</tr>

View File

@ -1,12 +1,12 @@
<div class="table-responsive overflow-auto">
<table class="table align-items-center">
<table class="table align-items-center rp-border-collapse">
<thead class="border-top-style">
<tr>
<th class="report-column text-right rp-border-bottom-1"></th>
<tr class="rp-border-bottom-1">
<th class="report-column text-right"></th>
@foreach($class->dates as $date)
<th class="report-column text-right px-0 rp-border-bottom-1">{{ $date }}</th>
<th class="report-column text-right px-0">{{ $date }}</th>
@endforeach
<th class="report-column text-right rp-border-bottom-1">
<th class="report-column text-right">
{{ trans_choice('general.totals', 1) }}
</th>
</tr>

View File

@ -1,11 +1,11 @@
<tfoot>
<tr>
<th class="report-column rp-border-top-1 text-left">{{ trans_choice('general.totals', 1) }}</th>
<tr class="rp-border-top-1">
<th class="report-column text-left">{{ trans_choice('general.totals', 1) }}</th>
@php $total_total = 0; @endphp
@foreach($class->totals[$table] as $date => $total)
@php $total_total += $total; @endphp
<th class="report-column text-right px-0 rp-border-top-1">@money($total, setting('default.currency'), true)</th>
<th class="report-column text-right px-0">@money($total, setting('default.currency'), true)</th>
@endforeach
<th class="report-column text-right rp-border-top-1">@money($total_total, setting('default.currency'), true)</th>
<th class="report-column text-right">@money($total_total, setting('default.currency'), true)</th>
</tr>
</tfoot>

View File

@ -1,5 +1,5 @@
<div class="table-responsive overflow-auto">
<table class="table align-items-center">
<table class="table align-items-center rp-border-collapse">
<thead class="border-top-style">
<tr>
<th class="report-column text-right rp-border-bottom-1"></th>

View File

@ -1,11 +1,11 @@
<tfoot>
<tr>
<th class="report-column rp-border-top-1 text-left">{{ trans('reports.net') }}</th>
<tr class="rp-border-top-1">
<th class="report-column text-left">{{ trans('reports.net') }}</th>
@php $total_total = 0; @endphp
@foreach($class->totals[$table] as $total)
@php $total_total += $total; @endphp
<th class="report-column text-right px-0 rp-border-top-1">@money($total, setting('default.currency'), true)</th>
<th class="report-column text-right px-0">@money($total, setting('default.currency'), true)</th>
@endforeach
<th class="report-column text-right rp-border-top-1">@money($total_total, setting('default.currency'), true)</th>
<th class="report-column text-right">@money($total_total, setting('default.currency'), true)</th>
</tr>
</tfoot>