Invoice number digit column issue solved..

This commit is contained in:
Cüneyt Şentürk 2023-01-10 11:11:53 +03:00
parent 9b16a29264
commit a2aee0b031
4 changed files with 75 additions and 1 deletions

View File

@ -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;
}

View 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');
}
}

View 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 }}
/>

View File

@ -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 />