Invoice number digit column issue solved..
This commit is contained in:
parent
9b16a29264
commit
a2aee0b031
@ -41,6 +41,10 @@ class Setting extends FormRequest
|
||||
break;
|
||||
}
|
||||
|
||||
if ($this->request->has('number_digit')) {
|
||||
$rules['number_digit'] = 'required|integer|min:1|max:20';
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
|
57
app/View/Components/Form/Group/NumberDigit.php
Normal file
57
app/View/Components/Form/Group/NumberDigit.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Form\Group;
|
||||
|
||||
use App\Abstracts\View\Components\Form;
|
||||
|
||||
class NumberDigit extends Form
|
||||
{
|
||||
public $type = 'number_digit';
|
||||
|
||||
public $number_digits;
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
if (empty($this->name)) {
|
||||
$this->name = 'number_digit';
|
||||
}
|
||||
|
||||
if (empty($this->label)) {
|
||||
$this->label = trans('settings.invoice.digit');
|
||||
}
|
||||
|
||||
$this->number_digits = [
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5',
|
||||
'6' => '6',
|
||||
'7' => '7',
|
||||
'8' => '8',
|
||||
'9' => '9',
|
||||
'10' => '10',
|
||||
'11' => '11',
|
||||
'12' => '12',
|
||||
'13' => '13',
|
||||
'14' => '14',
|
||||
'15' => '15',
|
||||
'16' => '16',
|
||||
'17' => '17',
|
||||
'18' => '18',
|
||||
'19' => '19',
|
||||
'20' => '20',
|
||||
];
|
||||
|
||||
if (empty($this->selected) && empty($this->getParentData('model'))) {
|
||||
$this->selected = setting('invoice.number_digit');
|
||||
}
|
||||
|
||||
return view('components.form.group.number_digit');
|
||||
}
|
||||
}
|
13
resources/views/components/form/group/number_digit.blade.php
Normal file
13
resources/views/components/form/group/number_digit.blade.php
Normal file
@ -0,0 +1,13 @@
|
||||
<x-form.group.select
|
||||
:name="$name"
|
||||
:label="$label"
|
||||
:options="$number_digits"
|
||||
:selected="$selected"
|
||||
|
||||
form-group-class="{{ $formGroupClass }}"
|
||||
:required="$required"
|
||||
:readonly="$readonly"
|
||||
sort-options="false"
|
||||
|
||||
{{ $attributes }}
|
||||
/>
|
@ -14,7 +14,7 @@
|
||||
<x-slot name="body">
|
||||
<x-form.group.text name="number_prefix" label="{{ trans('settings.invoice.prefix') }}" value="{{ setting('invoice.number_prefix') }}" not-required />
|
||||
|
||||
<x-form.group.text name="number_digit" label="{{ trans('settings.invoice.digit') }}" value="{{ setting('invoice.number_digit') }}" not-required />
|
||||
<x-form.group.number_digit not-required />
|
||||
|
||||
<x-form.group.text name="number_next" label="{{ trans('settings.invoice.next') }}" value="{{ setting('invoice.number_next') }}" not-required />
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user