Merge branch 'master' of github.com:akaunting/akaunting

This commit is contained in:
Cüneyt Şentürk
2023-02-14 18:28:00 +03:00
6 changed files with 22 additions and 22 deletions

View File

@ -17,10 +17,10 @@ class Transactions extends Import
{ {
$row = parent::map($row); $row = parent::map($row);
$row['currency_code'] = $this->getCurrencyCode($row);
$row['account_id'] = $this->getAccountId($row); $row['account_id'] = $this->getAccountId($row);
$row['category_id'] = $this->getCategoryId($row); $row['category_id'] = $this->getCategoryId($row);
$row['contact_id'] = $this->getContactId($row); $row['contact_id'] = $this->getContactId($row);
$row['currency_code'] = $this->getCurrencyCode($row);
$row['document_id'] = $this->getDocumentId($row); $row['document_id'] = $this->getDocumentId($row);
return $row; return $row;

View File

@ -4,7 +4,6 @@ namespace App\Imports\Common\Sheets;
use App\Abstracts\Import; use App\Abstracts\Import;
use App\Http\Requests\Common\ItemTax as Request; use App\Http\Requests\Common\ItemTax as Request;
use App\Models\Common\Item;
use App\Models\Common\ItemTax as Model; use App\Models\Common\ItemTax as Model;
class ItemTaxes extends Import class ItemTaxes extends Import
@ -16,14 +15,14 @@ class ItemTaxes extends Import
public function map($row): array public function map($row): array
{ {
$row = parent::map($row); if ($this->isEmpty($row, 'item_name')) {
$row['item_id'] = (int) Item::where('name', $row['item_name'])->value('id');
if ($this->isEmpty($row, 'item_id')) {
return []; return [];
} }
$row = parent::map($row);
$row['item_id'] = $this->getItemId($row);
$row['tax_id'] = $this->getTaxId($row); $row['tax_id'] = $this->getTaxId($row);
return $row; return $row;

View File

@ -102,7 +102,7 @@ trait Import
'created_by' => $row['created_by'], 'created_by' => $row['created_by'],
]; ];
Validator::validate($data, [(new CurrencyRequest)->rules()]); Validator::validate($data, (new CurrencyRequest)->rules());
$currency = $this->dispatch(new CreateCurrency($data)); $currency = $this->dispatch(new CreateCurrency($data));
@ -181,7 +181,7 @@ trait Import
'created_by' => $row['created_by'], 'created_by' => $row['created_by'],
]; ];
Validator::validate($data, [(new AccountRequest)->rules()]); Validator::validate($data, (new AccountRequest)->rules());
$account = $this->dispatch(new CreateAccount($data)); $account = $this->dispatch(new CreateAccount($data));
@ -207,7 +207,7 @@ trait Import
'created_by' => $row['created_by'], 'created_by' => $row['created_by'],
]; ];
Validator::validate($data, [(new AccountRequest)->rules()]); Validator::validate($data, (new AccountRequest)->rules());
$account = $this->dispatch(new CreateAccount($data)); $account = $this->dispatch(new CreateAccount($data));
@ -233,7 +233,7 @@ trait Import
'created_by' => $row['created_by'], 'created_by' => $row['created_by'],
]; ];
Validator::validate($data, [(new AccountRequest)->rules()]); Validator::validate($data, (new AccountRequest)->rules());
$account = $this->dispatch(new CreateAccount($data)); $account = $this->dispatch(new CreateAccount($data));
@ -258,7 +258,7 @@ trait Import
'created_by' => $row['created_by'], 'created_by' => $row['created_by'],
]; ];
Validator::validate($data, [(new CategoryRequest)->rules()]); Validator::validate($data, (new CategoryRequest)->rules());
$category = $this->dispatch(new CreateCategory($data)); $category = $this->dispatch(new CreateCategory($data));
@ -284,7 +284,7 @@ trait Import
'created_by' => $row['created_by'], 'created_by' => $row['created_by'],
]; ];
Validator::validate($data, [(new ContactRequest)->rules()]); Validator::validate($data, (new ContactRequest)->rules());
$contact = $this->dispatch(new CreateContact($data)); $contact = $this->dispatch(new CreateContact($data));
@ -310,7 +310,7 @@ trait Import
'created_by' => $row['created_by'], 'created_by' => $row['created_by'],
]; ];
Validator::validate($data, [(new ContactRequest)->rules()]); Validator::validate($data, (new ContactRequest)->rules());
$contact = $this->dispatch(new CreateContact($data)); $contact = $this->dispatch(new CreateContact($data));
@ -335,7 +335,7 @@ trait Import
'created_by' => $row['created_by'], 'created_by' => $row['created_by'],
]; ];
Validator::validate($data, [(new ItemRequest())->rules()]); Validator::validate($data, (new ItemRequest())->rules());
$item = $this->dispatch(new CreateItem($data)); $item = $this->dispatch(new CreateItem($data));
@ -354,13 +354,13 @@ trait Import
'company_id' => company_id(), 'company_id' => company_id(),
'rate' => $row['tax_rate'], 'rate' => $row['tax_rate'],
'type' => $type, 'type' => $type,
'name' => !empty($row['tax_name']) ? $row['tax_name'] : $row['tax_rate'], 'name' => !empty($row['tax_name']) ? $row['tax_name'] : (string) $row['tax_rate'],
'enabled' => 1, 'enabled' => 1,
'created_from' => $row['created_from'], 'created_from' => $row['created_from'],
'created_by' => $row['created_by'], 'created_by' => $row['created_by'],
]; ];
Validator::validate($data, [(new TaxRequest())->rules()]); Validator::validate($data, (new TaxRequest())->rules());
$tax = $this->dispatch(new CreateTax($data)); $tax = $this->dispatch(new CreateTax($data));

View File

@ -166,7 +166,8 @@
"preferred-install": "dist", "preferred-install": "dist",
"sort-packages": true, "sort-packages": true,
"allow-plugins": { "allow-plugins": {
"mnsami/composer-custom-directory-installer": true "mnsami/composer-custom-directory-installer": true,
"php-http/discovery": true
} }
} }
} }

View File

@ -2,12 +2,12 @@
<div class="relative bg-body z-10 rounded-lg shadow-2xl p-5 sm:p-10 full-height-mobile" style="height:675px;"> <div class="relative bg-body z-10 rounded-lg shadow-2xl p-5 sm:p-10 full-height-mobile" style="height:675px;">
<WizardSteps :active_state="active"></WizardSteps> <WizardSteps :active_state="active"></WizardSteps>
<div class="flex flex-col justify-between -mt-5 sm:mt-0 overflow-y-auto" style="height: calc(100% - 53px)"> <div class="flex flex-col justify-between -mt-5 sm:mt-0" style="height: calc(100% - 53px)">
<div v-if="pageLoad" class="absolute left-0 right-0 top-0 bottom-0 w-full h-full bg-white rounded-lg flex items-center justify-center z-50"> <div v-if="pageLoad" class="absolute inset-0 w-full h-full bg-white rounded-lg flex items-center justify-center z-50">
<span class="material-icons form-spin animate-spin text-9xl">data_usage</span> <span class="material-icons form-spin animate-spin text-9xl">data_usage</span>
</div> </div>
<div class="overflow-x-visible menu-scroll mt-1"> <div class="overflow-x-visible overflow-y-auto menu-scroll mt-1">
<form ref="form" class="py-2 align-middle inline-block min-w-full"> <form ref="form" class="py-2 align-middle inline-block min-w-full">
<div class="relative"> <div class="relative">
<div v-if="pageLoad" class="absolute left-0 right-0 top-0 bottom-0 w-full h-full bg-white rounded-lg flex items-center justify-center z-50"> <div v-if="pageLoad" class="absolute left-0 right-0 top-0 bottom-0 w-full h-full bg-white rounded-lg flex items-center justify-center z-50">

View File

@ -1,2 +1,2 @@
<div class="w-full h-full absolute left-0 right-0 top-0 bottom-0 bg-cover bg-no-repeat opacity-20" <div class="w-full h-full absolute inset-0 bg-cover bg-no-repeat opacity-20"
style="background-image:url({{ asset('public/img/dashboard.png') }});"></div> style="background-image:url({{ asset('public/img/dashboard.png') }});"></div>