Fixed default account issue..
This commit is contained in:
parent
5faa63e3d5
commit
cec31b4f43
@ -90,6 +90,9 @@ abstract class Form extends Component
|
|||||||
/** @var array */
|
/** @var array */
|
||||||
public $dynamicAttributes = [];
|
public $dynamicAttributes = [];
|
||||||
|
|
||||||
|
/** @var bool */
|
||||||
|
public $hideCurrency;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new component instance.
|
* Create a new component instance.
|
||||||
*
|
*
|
||||||
@ -102,6 +105,7 @@ abstract class Form extends Component
|
|||||||
bool $disabled = false, bool $readonly = false, bool $required = true, bool $notRequired = false,
|
bool $disabled = false, bool $readonly = false, bool $required = true, bool $notRequired = false,
|
||||||
string $formGroupClass = '', string $inputGroupClass = '',
|
string $formGroupClass = '', string $inputGroupClass = '',
|
||||||
$dynamicAttributes = '',
|
$dynamicAttributes = '',
|
||||||
|
bool $hideCurrency = false
|
||||||
) {
|
) {
|
||||||
$this->type = $this->getType($type);
|
$this->type = $this->getType($type);
|
||||||
$this->name = $this->getName($name);
|
$this->name = $this->getName($name);
|
||||||
@ -133,6 +137,8 @@ abstract class Form extends Component
|
|||||||
$this->custom_attributes = $this->getCustomAttributes();
|
$this->custom_attributes = $this->getCustomAttributes();
|
||||||
|
|
||||||
$this->setDynamicAttributes($dynamicAttributes);
|
$this->setDynamicAttributes($dynamicAttributes);
|
||||||
|
|
||||||
|
$this->hideCurrency = $hideCurrency;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getType($type)
|
protected function getType($type)
|
||||||
|
@ -13,22 +13,6 @@ class Account extends Form
|
|||||||
|
|
||||||
public $accounts;
|
public $accounts;
|
||||||
|
|
||||||
/** @var bool */
|
|
||||||
public $hideCurrency;
|
|
||||||
|
|
||||||
/** @var string */
|
|
||||||
public $formGroupClass;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new component instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct(bool $hideCurrency = false, string $formGroupClass = 'sm:col-span-3') {
|
|
||||||
$this->hideCurrency = $hideCurrency;
|
|
||||||
$this->formGroupClass = $formGroupClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the view / contents that represent the component.
|
* Get the view / contents that represent the component.
|
||||||
*
|
*
|
||||||
|
@ -52,7 +52,7 @@ class Contact extends Form
|
|||||||
|
|
||||||
$this->contacts = Model::customer()->enabled()->orderBy('name')->take(setting('default.select_limit'))->get();
|
$this->contacts = Model::customer()->enabled()->orderBy('name')->take(setting('default.select_limit'))->get();
|
||||||
|
|
||||||
if (!empty($model) && $model->customer && ! $this->contacts->has($model->contact_id)) {
|
if (! empty($model) && $model->customer && ! $this->contacts->has($model->contact_id)) {
|
||||||
$this->contacts->put($model->customer->id, $model->customer->name);
|
$this->contacts->put($model->customer->id, $model->customer->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ class Contact extends Form
|
|||||||
|
|
||||||
$this->contacts = Model::vendor()->enabled()->orderBy('name')->take(setting('default.select_limit'))->get();
|
$this->contacts = Model::vendor()->enabled()->orderBy('name')->take(setting('default.select_limit'))->get();
|
||||||
|
|
||||||
if (!empty($model) && $model->vendor && ! $this->contacts->has($model->contact_id)) {
|
if (! empty($model) && $model->vendor && ! $this->contacts->has($model->contact_id)) {
|
||||||
$this->contacts->put($model->vendor->id, $model->vendor->name);
|
$this->contacts->put($model->vendor->id, $model->vendor->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,18 +8,6 @@ class Country extends Form
|
|||||||
{
|
{
|
||||||
public $type = 'country';
|
public $type = 'country';
|
||||||
|
|
||||||
/** @var string */
|
|
||||||
public $formGroupClass;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new component instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct(string $formGroupClass = 'sm:col-span-3') {
|
|
||||||
$this->formGroupClass = $formGroupClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the view / contents that represent the component.
|
* Get the view / contents that represent the component.
|
||||||
*
|
*
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
<x-sortablelink column="sale_price" title="{{ trans('items.sale_price') }}" />
|
<x-sortablelink column="sale_price" title="{{ trans('items.sale_price') }}" />
|
||||||
</x-slot>
|
</x-slot>
|
||||||
<x-slot name="second">
|
<x-slot name="second">
|
||||||
<x-sortablelink column="purchase_price" title="{!! trans('items.purchase_price') !!}" />
|
<x-sortablelink column="purchase_price" title="{{ trans('items.purchase_price') }}" />
|
||||||
</x-slot>
|
</x-slot>
|
||||||
</x-table.th>
|
</x-table.th>
|
||||||
</x-table.tr>
|
</x-table.tr>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
</x-slot>
|
</x-slot>
|
||||||
|
|
||||||
<x-slot name="body">
|
<x-slot name="body">
|
||||||
<x-form.group.account name="account" not-required without-change :selected="setting('default.account')" />
|
<x-form.group.account name="account" not-required without-change />
|
||||||
|
|
||||||
<x-form.group.currency name="currency" not-required />
|
<x-form.group.currency name="currency" not-required />
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user