added withholding option in report
This commit is contained in:
parent
30639e29b6
commit
a67c03ef17
@ -32,7 +32,9 @@ class TaxSummary extends Report
|
||||
|
||||
public function setTables()
|
||||
{
|
||||
$taxes = Tax::enabled()->notWithholding()->notRate(0)->orderBy('name')->pluck('name')->toArray();
|
||||
$withholding = ($this->getSetting('withholding') == 'yes') ? 'withholding' : 'notWithholding';
|
||||
|
||||
$taxes = Tax::enabled()->$withholding()->notRate(0)->orderBy('name')->pluck('name')->toArray();
|
||||
|
||||
$this->tables = array_combine($taxes, $taxes);
|
||||
}
|
||||
@ -122,6 +124,25 @@ class TaxSummary extends Report
|
||||
return [
|
||||
$this->getPeriodField(),
|
||||
$this->getBasisField(),
|
||||
$this->getWithholdingField(),
|
||||
];
|
||||
}
|
||||
|
||||
public function getWithholdingField()
|
||||
{
|
||||
return [
|
||||
'type' => 'selectGroup',
|
||||
'name' => 'withholding',
|
||||
'title' => trans('taxes.withholding'),
|
||||
'icon' => 'hand-holding-usd',
|
||||
'values' => [
|
||||
'yes' => trans('general.yes'),
|
||||
'no' => trans('general.no'),
|
||||
],
|
||||
'selected' => 'no',
|
||||
'attributes' => [
|
||||
'required' => 'required',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -42,16 +42,16 @@
|
||||
'data-field' => 'settings',
|
||||
],
|
||||
$field['attributes']),
|
||||
isset($class->model->settings->{$field['name']}) ? $class->model->settings->{$field['name']}: null
|
||||
isset($report->settings->{$field['name']}) ? $report->settings->{$field['name']}: null
|
||||
) }}
|
||||
@elseif ($type == 'selectGroup')
|
||||
{{ Form::$type($field['name'], $field['title'], $field['icon'], $field['values'], $report->settings->{$field['name']}, array_merge([
|
||||
{{ Form::$type($field['name'], $field['title'], $field['icon'], $field['values'], isset($report->settings->{$field['name']}) ? $report->settings->{$field['name']} : $field['selected'], array_merge([
|
||||
'data-field' => 'settings'
|
||||
],
|
||||
$field['attributes'])
|
||||
) }}
|
||||
@elseif ($type == 'radioGroup')
|
||||
{{ Form::$type($field['name'], $field['title'], isset($report->settings->{$field['name']}) ? $report->settings->{$field['name']} : 1, $field['enable'], $field['disable'], array_merge([
|
||||
{{ Form::$type($field['name'], $field['title'], isset($report->settings->{$field['name']}) ? $report->settings->{$field['name']} : true, $field['enable'], $field['disable'], array_merge([
|
||||
'data-field' => 'settings'
|
||||
],
|
||||
$field['attributes'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user