Merge branch 'akaunting:master' into master

This commit is contained in:
Burak Civan 2022-06-06 17:24:12 +03:00 committed by GitHub
commit 37f59eb310
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 18 deletions

View File

@ -34,7 +34,9 @@ class Content extends Component
$this->counts = []; $this->counts = [];
// Handle documents // Handle documents
$this->documents = $this->contact->documents()->with('transactions')->get(); $docs = $this->contact->isCustomer() ? 'invoices' : 'bills';
$this->documents = $this->contact->$docs()->with('transactions')->get();
$this->counts['documents'] = $this->documents->count(); $this->counts['documents'] = $this->documents->count();

View File

@ -37,6 +37,10 @@ class Category extends Form
$this->categories->put($model->category->id, $model->category->name); $this->categories->put($model->category->id, $model->category->name);
} }
if($model = $this->getParentData('model')) {
$this->selected = $model->category_id;
}
if (empty($this->selected) && (in_array($type, ['income', 'expense']))) { if (empty($this->selected) && (in_array($type, ['income', 'expense']))) {
$this->selected = setting('default.' . $type . '_category'); $this->selected = setting('default.' . $type . '_category');
} }

View File

@ -4,9 +4,12 @@
</x-slot> </x-slot>
<x-slot name="body"> <x-slot name="body">
@if (empty($document))
<x-form.group.recurring :type="$type" @started="onChangeRecurringDate()" />
@else
<x-form.group.recurring <x-form.group.recurring
:type="$type" :type="$type"
@started="onChangeRecurringDate" @started="onChangeRecurringDate()"
:frequency="$document ? $document->recurring->frequency : null" :frequency="$document ? $document->recurring->frequency : null"
:custom-frequency="$document ? $document->recurring->custom_frequency : null" :custom-frequency="$document ? $document->recurring->custom_frequency : null"
:limit="$document ? $document->recurring->limit_by : null" :limit="$document ? $document->recurring->limit_by : null"
@ -14,5 +17,6 @@
:limit-count="$document ? $document->recurring->limit_count : null" :limit-count="$document ? $document->recurring->limit_count : null"
:limit-date-value="$document ? $document->recurring->limit_date : null" :limit-date-value="$document ? $document->recurring->limit_date : null"
/> />
@endif
</x-slot> </x-slot>
</x-form.section> </x-form.section>