Merge branch 'akaunting:master' into master

This commit is contained in:
Burak Civan 2022-06-10 09:25:07 +03:00 committed by GitHub
commit dd9b492aee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 14 additions and 33 deletions

View File

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

View File

@ -8,11 +8,12 @@ use App\Models\Banking\Transfer as Model;
use App\Models\Setting\Category; use App\Models\Setting\Category;
use App\Traits\Currencies; use App\Traits\Currencies;
use App\Traits\Jobs; use App\Traits\Jobs;
use App\Traits\Transactions;
use App\Utilities\Date; use App\Utilities\Date;
class Transfers extends Import class Transfers extends Import
{ {
use Currencies, Jobs; use Currencies, Jobs, Transactions;
public function model(array $row) public function model(array $row)
{ {
@ -51,6 +52,7 @@ class Transfers extends Import
{ {
$expense_transaction = $this->dispatch(new CreateTransaction([ $expense_transaction = $this->dispatch(new CreateTransaction([
'company_id' => $row['company_id'], 'company_id' => $row['company_id'],
'number' => $this->getNextTransactionNumber(),
'type' => 'expense', 'type' => 'expense',
'account_id' => $row['from_account_id'], 'account_id' => $row['from_account_id'],
'paid_at' => $row['transferred_at'], 'paid_at' => $row['transferred_at'],
@ -85,6 +87,7 @@ class Transfers extends Import
$income_transaction = $this->dispatch(new CreateTransaction([ $income_transaction = $this->dispatch(new CreateTransaction([
'company_id' => $row['company_id'], 'company_id' => $row['company_id'],
'number' => $this->getNextTransactionNumber(),
'type' => 'income', 'type' => 'income',
'account_id' => $row['to_account_id'], 'account_id' => $row['to_account_id'],
'paid_at' => $row['transferred_at'], 'paid_at' => $row['transferred_at'],

View File

@ -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.
* *

View File

@ -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.
* *

Binary file not shown.

Binary file not shown.

View File

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

View File

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