Merge branch 'akaunting:master' into master
This commit is contained in:
commit
dd9b492aee
@ -90,6 +90,9 @@ abstract class Form extends Component
|
||||
/** @var array */
|
||||
public $dynamicAttributes = [];
|
||||
|
||||
/** @var bool */
|
||||
public $hideCurrency;
|
||||
|
||||
/**
|
||||
* 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,
|
||||
string $formGroupClass = '', string $inputGroupClass = '',
|
||||
$dynamicAttributes = '',
|
||||
bool $hideCurrency = false
|
||||
) {
|
||||
$this->type = $this->getType($type);
|
||||
$this->name = $this->getName($name);
|
||||
@ -133,6 +137,8 @@ abstract class Form extends Component
|
||||
$this->custom_attributes = $this->getCustomAttributes();
|
||||
|
||||
$this->setDynamicAttributes($dynamicAttributes);
|
||||
|
||||
$this->hideCurrency = $hideCurrency;
|
||||
}
|
||||
|
||||
protected function getType($type)
|
||||
|
@ -8,11 +8,12 @@ use App\Models\Banking\Transfer as Model;
|
||||
use App\Models\Setting\Category;
|
||||
use App\Traits\Currencies;
|
||||
use App\Traits\Jobs;
|
||||
use App\Traits\Transactions;
|
||||
use App\Utilities\Date;
|
||||
|
||||
class Transfers extends Import
|
||||
{
|
||||
use Currencies, Jobs;
|
||||
use Currencies, Jobs, Transactions;
|
||||
|
||||
public function model(array $row)
|
||||
{
|
||||
@ -51,6 +52,7 @@ class Transfers extends Import
|
||||
{
|
||||
$expense_transaction = $this->dispatch(new CreateTransaction([
|
||||
'company_id' => $row['company_id'],
|
||||
'number' => $this->getNextTransactionNumber(),
|
||||
'type' => 'expense',
|
||||
'account_id' => $row['from_account_id'],
|
||||
'paid_at' => $row['transferred_at'],
|
||||
@ -85,6 +87,7 @@ class Transfers extends Import
|
||||
|
||||
$income_transaction = $this->dispatch(new CreateTransaction([
|
||||
'company_id' => $row['company_id'],
|
||||
'number' => $this->getNextTransactionNumber(),
|
||||
'type' => 'income',
|
||||
'account_id' => $row['to_account_id'],
|
||||
'paid_at' => $row['transferred_at'],
|
||||
|
@ -13,22 +13,6 @@ class Account extends Form
|
||||
|
||||
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.
|
||||
*
|
||||
|
@ -52,7 +52,7 @@ class Contact extends Form
|
||||
|
||||
$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);
|
||||
}
|
||||
}
|
||||
@ -69,7 +69,7 @@ class Contact extends Form
|
||||
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
@ -8,18 +8,6 @@ class Country extends Form
|
||||
{
|
||||
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.
|
||||
*
|
||||
|
Binary file not shown.
Binary file not shown.
@ -70,7 +70,7 @@
|
||||
<x-sortablelink column="sale_price" title="{{ trans('items.sale_price') }}" />
|
||||
</x-slot>
|
||||
<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-table.th>
|
||||
</x-table.tr>
|
||||
|
@ -10,7 +10,7 @@
|
||||
</x-slot>
|
||||
|
||||
<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 />
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user