fixed transaction set contact on request witData ( #39nxc76 )
This commit is contained in:
parent
deaca4c9fa
commit
7a07a7512a
@ -28,6 +28,18 @@ class Account extends Form
|
||||
|
||||
$this->accounts = $this->getAccounts();
|
||||
|
||||
$account_id = old('account.id', old('account_id', null));
|
||||
|
||||
if (! empty($account_id)) {
|
||||
$this->selected = $account_id;
|
||||
|
||||
if (! $this->accounts->has($account_id)) {
|
||||
$account = Model::find($account_id);
|
||||
|
||||
$this->accounts->put($account->id, $account->name);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($this->selected) && empty($this->getParentData('model'))) {
|
||||
$this->selected = setting('default.account');
|
||||
}
|
||||
|
@ -33,6 +33,18 @@ class Category extends Form
|
||||
|
||||
$model = $this->getParentData('model');
|
||||
|
||||
$category_id = old('category.id', old('category_id', null));
|
||||
|
||||
if (! empty($category_id)) {
|
||||
$this->selected = $category_id;
|
||||
|
||||
if (! $this->categories->has($category_id)) {
|
||||
$category = Model::find($category_id);
|
||||
|
||||
$this->categories->put($category->id, $category->name);
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($model) && ! empty($model->category_id)) {
|
||||
$this->selected = $model->category_id;
|
||||
|
||||
|
@ -39,6 +39,18 @@ class Contact extends Form
|
||||
|
||||
$model = $this->getParentData('model');
|
||||
|
||||
$contact_id = old('contact.id', old('contact_id', null));
|
||||
|
||||
if (! empty($contact_id)) {
|
||||
$this->selected = $contact_id;
|
||||
|
||||
if (! $this->contacts->has($contact_id)) {
|
||||
$contact = Model::find($contact_id);
|
||||
|
||||
$this->contacts->put($contact->id, $contact->name);
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($model) && ! empty($model->contact_id)) {
|
||||
$this->selected = $model->contact_id;
|
||||
|
||||
|
@ -35,6 +35,18 @@ class Currency extends Form
|
||||
|
||||
$this->currencies = Model::enabled()->orderBy('name')->pluck('name', 'code');
|
||||
|
||||
$currency_id = old('currency.id', old('currency_id', null));
|
||||
|
||||
if (! empty($currency_id)) {
|
||||
$this->selected = $currency_id;
|
||||
|
||||
if (! $this->currencies->has($currency_id)) {
|
||||
$currency = Model::find($currency_id);
|
||||
|
||||
$this->currencies->put($currency->id, $currency->name);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($this->selected) && empty($this->getParentData('model'))) {
|
||||
$this->selected = setting('default.currency');
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ class Tax extends Form
|
||||
if (! empty($tax_id)) {
|
||||
$this->selected = $tax_id;
|
||||
|
||||
if ($this->taxes->has($tax_id)) {
|
||||
if (! $this->taxes->has($tax_id)) {
|
||||
$tax = Model::find($tax_id);
|
||||
|
||||
$this->taxes->put($tax->id, $tax->name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user