diff --git a/app/Events/AdminMenuCreated.php b/app/Events/AdminMenuCreated.php index 9883abb09..764c931bf 100644 --- a/app/Events/AdminMenuCreated.php +++ b/app/Events/AdminMenuCreated.php @@ -15,4 +15,4 @@ class AdminMenuCreated { $this->menu = $menu; } -} \ No newline at end of file +} diff --git a/app/Events/BillCreated.php b/app/Events/BillCreated.php index fc4881a74..11b29cc1e 100644 --- a/app/Events/BillCreated.php +++ b/app/Events/BillCreated.php @@ -15,4 +15,4 @@ class BillCreated { $this->bill = $bill; } -} \ No newline at end of file +} diff --git a/app/Events/BillUpdated.php b/app/Events/BillUpdated.php index 21751e17a..563eb3254 100644 --- a/app/Events/BillUpdated.php +++ b/app/Events/BillUpdated.php @@ -15,4 +15,4 @@ class BillUpdated { $this->bill = $bill; } -} \ No newline at end of file +} diff --git a/app/Events/CompanySwitched.php b/app/Events/CompanySwitched.php index 3738c8dae..2a25ec4e0 100644 --- a/app/Events/CompanySwitched.php +++ b/app/Events/CompanySwitched.php @@ -15,4 +15,4 @@ class CompanySwitched { $this->company = $company; } -} \ No newline at end of file +} diff --git a/app/Events/CustomerMenuCreated.php b/app/Events/CustomerMenuCreated.php index 5766e1ba2..b7c6fcccc 100644 --- a/app/Events/CustomerMenuCreated.php +++ b/app/Events/CustomerMenuCreated.php @@ -15,4 +15,4 @@ class CustomerMenuCreated { $this->menu = $menu; } -} \ No newline at end of file +} diff --git a/app/Events/InvoiceCreated.php b/app/Events/InvoiceCreated.php index afa2e3c62..e6ab023a8 100644 --- a/app/Events/InvoiceCreated.php +++ b/app/Events/InvoiceCreated.php @@ -15,4 +15,4 @@ class InvoiceCreated { $this->invoice = $invoice; } -} \ No newline at end of file +} diff --git a/app/Events/InvoicePrinting.php b/app/Events/InvoicePrinting.php index f775b69dc..78fb14c7d 100644 --- a/app/Events/InvoicePrinting.php +++ b/app/Events/InvoicePrinting.php @@ -15,4 +15,4 @@ class InvoicePrinting { $this->invoice = $invoice; } -} \ No newline at end of file +} diff --git a/app/Events/InvoiceUpdated.php b/app/Events/InvoiceUpdated.php index d9d6fc3ee..2f4db58e3 100644 --- a/app/Events/InvoiceUpdated.php +++ b/app/Events/InvoiceUpdated.php @@ -15,4 +15,4 @@ class InvoiceUpdated { $this->invoice = $invoice; } -} \ No newline at end of file +} diff --git a/app/Events/ModuleInstalled.php b/app/Events/ModuleInstalled.php index b581eb539..3ce3ef2b0 100644 --- a/app/Events/ModuleInstalled.php +++ b/app/Events/ModuleInstalled.php @@ -19,4 +19,4 @@ class ModuleInstalled $this->alias = $alias; $this->company_id = $company_id; } -} \ No newline at end of file +} diff --git a/app/Events/UpdateFinished.php b/app/Events/UpdateFinished.php index d221c60fd..8af0b3177 100644 --- a/app/Events/UpdateFinished.php +++ b/app/Events/UpdateFinished.php @@ -23,4 +23,4 @@ class UpdateFinished $this->old = $old; $this->new = $new; } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Auth/Login.php b/app/Http/Controllers/Auth/Login.php index ea2aabbf8..68d3ca69d 100644 --- a/app/Http/Controllers/Auth/Login.php +++ b/app/Http/Controllers/Auth/Login.php @@ -79,6 +79,11 @@ class Login extends Controller return redirect($path); } + // Check wizard + if (!setting('general.wizard', false)) { + return redirect('wizard'); + } + return redirect('/'); } diff --git a/app/Http/Controllers/Common/Companies.php b/app/Http/Controllers/Common/Companies.php index 9ed22afe0..1c8efba9e 100644 --- a/app/Http/Controllers/Common/Companies.php +++ b/app/Http/Controllers/Common/Companies.php @@ -264,6 +264,11 @@ class Companies extends Controller event(new CompanySwitched($company)); } + // Check wizard + if (!setting('general.wizard', false)) { + return redirect('wizard'); + } + return redirect('/'); } diff --git a/app/Http/Controllers/Wizard/Companies.php b/app/Http/Controllers/Wizard/Companies.php new file mode 100644 index 000000000..b4f34ee11 --- /dev/null +++ b/app/Http/Controllers/Wizard/Companies.php @@ -0,0 +1,81 @@ +setSettings(); + + return view('wizard.companies.edit', compact('company')); + } + + /** + * Update the specified resource in storage. + * + * @param Company $company + * @param Request $request + * + * @return Response + */ + public function update(Request $request) + { + // Company + $company = Company::find(session('company_id')); + + $fields = $request->all(); + + $skip_keys = ['company_id', '_method', '_token']; + $file_keys = ['company_logo', 'invoice_logo']; + + foreach ($fields as $key => $value) { + // Don't process unwanted keys + if (in_array($key, $skip_keys)) { + continue; + } + + // Process file uploads + if (in_array($key, $file_keys)) { + // Upload attachment + if ($request->file($key)) { + $media = $this->getMedia($request->file($key), 'settings'); + + $company->attachMedia($media, $key); + + $value = $media->id; + } + + // Prevent reset + if (empty($value)) { + continue; + } + } + + setting()->set('general.' . $key, $value); + } + + // Save all settings + setting()->save(); + + return redirect('wizard/currencies'); + } +} diff --git a/app/Http/Controllers/Wizard/Currencies.php b/app/Http/Controllers/Wizard/Currencies.php new file mode 100644 index 000000000..8ae9e6591 --- /dev/null +++ b/app/Http/Controllers/Wizard/Currencies.php @@ -0,0 +1,311 @@ +toArray(); + + // Prepare codes + $codes = array(); + $currencies = MoneyCurrency::getCurrencies(); + foreach ($currencies as $key => $item) { + // Don't show if already available + if (in_array($key, $current)) { + continue; + } + + $codes[$key] = $key; + } + + $html = view('wizard.currencies.create', compact('codes'))->render(); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => 'null', + 'html' => $html, + ]); + } + + /** + * Store a newly created resource in storage. + * + * @param Request $request + * + * @return Response + */ + public function store(Request $request) + { + // Force the rate to be 1 for default currency + if ($request['default_currency']) { + $request['rate'] = '1'; + } + + $currency = Currency::create($request->all()); + + // Update default currency setting + if ($request['default_currency']) { + setting()->set('general.default_currency', $request['code']); + setting()->save(); + } + + $message = trans('messages.success.added', ['type' => trans_choice('general.currencies', 1)]); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => $message, + 'data' => $currency, + ]); + } + + /** + * Show the form for editing the specified resource. + * + * @param Currency $currency + * + * @return Response + */ + public function edit(Currency $currency) + { + if (setting('general.wizard', false)) { + return redirect('/'); + } + + // Get current currencies + $current = Currency::pluck('code')->toArray(); + + // Prepare codes + $codes = array(); + $currencies = MoneyCurrency::getCurrencies(); + foreach ($currencies as $key => $item) { + // Don't show if already available + if (($key != $currency->code) && in_array($key, $current)) { + continue; + } + + $codes[$key] = $key; + } + + $item = $currency; + + $html = view('wizard.currencies.edit', compact('item', 'codes'))->render(); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => 'null', + 'html' => $html, + ]); + } + + /** + * Update the specified resource in storage. + * + * @param Currency $currency + * @param Request $request + * + * @return Response + */ + public function update(Currency $currency, Request $request) + { + // Check if we can disable or change the code + if (!$request['enabled'] || ($currency->code != $request['code'])) { + $relationships = $this->countRelationships($currency, [ + 'accounts' => 'accounts', + 'customers' => 'customers', + 'invoices' => 'invoices', + 'revenues' => 'revenues', + 'bills' => 'bills', + 'payments' => 'payments', + ]); + + if ($currency->code == setting('general.default_currency')) { + $relationships[] = strtolower(trans_choice('general.companies', 1)); + } + } + + if (empty($relationships)) { + // Force the rate to be 1 for default currency + if ($request['default_currency']) { + $request['rate'] = '1'; + } + + $currency->update($request->all()); + + // Update default currency setting + if ($request['default_currency']) { + setting()->set('general.default_currency', $request['code']); + setting()->save(); + } + + $message = trans('messages.success.updated', ['type' => trans_choice('general.currencies', 1)]); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => $message, + 'data' => $currency, + ]); + } else { + $message = trans('messages.warning.disabled', ['name' => $currency->name, 'text' => implode(', ', $relationships)]); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => $message, + 'data' => $currency, + ]); + } + } + + /** + * Enable the specified resource. + * + * @param Currency $currency + * + * @return Response + */ + public function enable(Currency $currency) + { + $currency->enabled = 1; + $currency->save(); + + $message = trans('messages.success.enabled', ['type' => trans_choice('general.currencies', 1)]); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => $message, + 'data' => $currency, + ]); + } + + /** + * Disable the specified resource. + * + * @param Currency $currency + * + * @return Response + */ + public function disable(Currency $currency) + { + $relationships = $this->countRelationships($currency, [ + 'accounts' => 'accounts', + 'customers' => 'customers', + 'invoices' => 'invoices', + 'revenues' => 'revenues', + 'bills' => 'bills', + 'payments' => 'payments', + ]); + + if ($currency->code == setting('general.default_currency')) { + $relationships[] = strtolower(trans_choice('general.companies', 1)); + } + + if (empty($relationships)) { + $currency->enabled = 0; + $currency->save(); + + $message = trans('messages.success.disabled', ['type' => trans_choice('general.currencies', 1)]); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => $message, + 'data' => $currency, + ]); + } else { + $message = trans('messages.warning.disabled', ['name' => $currency->name, 'text' => implode(', ', $relationships)]); + + return response()->json([ + 'success' => false, + 'error' => true, + 'message' => $message, + 'data' => $currency, + ]); + } + } + + /** + * Remove the specified resource from storage. + * + * @param Currency $currency + * + * @return Response + */ + public function destroy(Currency $currency) + { + $relationships = $this->countRelationships($currency, [ + 'accounts' => 'accounts', + 'customers' => 'customers', + 'invoices' => 'invoices', + 'revenues' => 'revenues', + 'bills' => 'bills', + 'payments' => 'payments', + ]); + + if ($currency->code == setting('general.default_currency')) { + $relationships[] = strtolower(trans_choice('general.companies', 1)); + } + + if (empty($relationships)) { + $currency->delete(); + + $message = trans('messages.success.deleted', ['type' => trans_choice('general.currencies', 1)]); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => $message, + 'data' => $currency, + ]); + } else { + $message = trans('messages.warning.deleted', ['name' => $currency->name, 'text' => implode(', ', $relationships)]); + + return response()->json([ + 'success' => false, + 'error' => true, + 'message' => $message, + 'data' => $currency, + ]); + } + } +} diff --git a/app/Http/Controllers/Wizard/Finish.php b/app/Http/Controllers/Wizard/Finish.php new file mode 100644 index 000000000..25a9727fb --- /dev/null +++ b/app/Http/Controllers/Wizard/Finish.php @@ -0,0 +1,39 @@ +set('general.wizard', true); + + // Save all settings + setting()->save(); + + $data = [ + 'query' => [ + 'limit' => 4 + ] + ]; + + $modules = $this->getFeaturedModules($data); + + return view('wizard.finish.index', compact('modules')); + } +} diff --git a/app/Http/Controllers/Wizard/Taxes.php b/app/Http/Controllers/Wizard/Taxes.php new file mode 100644 index 000000000..8d0ff82ab --- /dev/null +++ b/app/Http/Controllers/Wizard/Taxes.php @@ -0,0 +1,224 @@ +render(); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => 'null', + 'html' => $html, + ]); + } + + /** + * Store a newly created resource in storage. + * + * @param Request $request + * + * @return Response + */ + public function store(Request $request) + { + $tax = Tax::create($request->all()); + + $message = trans('messages.success.added', ['type' => trans_choice('general.tax_rates', 1)]); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => $message, + 'data' => $tax, + ]); + } + + /** + * Show the form for editing the specified resource. + * + * @param Tax $tax + * + * @return Response + */ + public function edit(Tax $tax) + { + if (setting(setting('general.wizard', false))) { + return redirect('/'); + } + + $item = $tax; + + return view('wizard.taxes.edit', compact('item')); + } + + /** + * Update the specified resource in storage. + * + * @param Tax $tax + * @param Request $request + * + * @return Response + */ + public function update(Tax $tax, Request $request) + { + $relationships = $this->countRelationships($tax, [ + 'items' => 'items', + 'invoice_items' => 'invoices', + 'bill_items' => 'bills', + ]); + + if (empty($relationships) || $request['enabled']) { + $tax->update($request->all()); + + $message = trans('messages.success.updated', ['type' => trans_choice('general.tax_rates', 1)]); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => $message, + 'data' => $tax, + ]); + } else { + $message = trans('messages.warning.disabled', ['name' => $tax->name, 'text' => implode(', ', $relationships)]); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => $message, + 'data' => $tax, + ]); + } + } + + /** + * Enable the specified resource. + * + * @param Tax $tax + * + * @return Response + */ + public function enable(Tax $tax) + { + $tax->enabled = 1; + $tax->save(); + + $message = trans('messages.success.enabled', ['type' => trans_choice('general.tax_rates', 1)]); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => $message, + 'data' => $tax, + ]); + } + + /** + * Disable the specified resource. + * + * @param Tax $tax + * + * @return Response + */ + public function disable(Tax $tax) + { + $relationships = $this->countRelationships($tax, [ + 'items' => 'items', + 'invoice_items' => 'invoices', + 'bill_items' => 'bills', + ]); + + if (empty($relationships)) { + $tax->enabled = 0; + $tax->save(); + + $message = trans('messages.success.disabled', ['type' => trans_choice('general.tax_rates', 1)]); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => $message, + 'data' => $tax, + ]); + } else { + $message = trans('messages.warning.disabled', ['name' => $tax->name, 'text' => implode(', ', $relationships)]); + + return response()->json([ + 'success' => false, + 'error' => true, + 'message' => $message, + 'data' => $tax, + ]); + } + } + + /** + * Remove the specified resource from storage. + * + * @param Tax $tax + * + * @return Response + */ + public function destroy(Tax $tax) + { + $relationships = $this->countRelationships($tax, [ + 'items' => 'items', + 'invoice_items' => 'invoices', + 'bill_items' => 'bills', + ]); + + if (empty($relationships)) { + $tax->delete(); + + $message = trans('messages.success.deleted', ['type' => trans_choice('general.taxes', 1)]); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => $message, + 'data' => $tax, + ]); + } else { + $message = trans('messages.warning.deleted', ['name' => $tax->name, 'text' => implode(', ', $relationships)]); + + return response()->json([ + 'success' => false, + 'error' => true, + 'message' => $message, + 'data' => $tax, + ]); + } + } +} diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 7ce07c8a5..8f21fcc23 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -41,6 +41,13 @@ class Kernel extends HttpKernel 'company.currencies', ], + 'wizard' => [ + 'web', + 'language', + 'auth', + 'permission:read-admin-panel', + ], + 'admin' => [ 'web', 'language', diff --git a/app/Http/Middleware/AdminMenu.php b/app/Http/Middleware/AdminMenu.php index 8f73efa01..65e76aaa5 100644 --- a/app/Http/Middleware/AdminMenu.php +++ b/app/Http/Middleware/AdminMenu.php @@ -208,4 +208,4 @@ class AdminMenu return $next($request); } -} \ No newline at end of file +} diff --git a/app/Http/Requests/Wizard/Company.php b/app/Http/Requests/Wizard/Company.php new file mode 100644 index 000000000..114f6877f --- /dev/null +++ b/app/Http/Requests/Wizard/Company.php @@ -0,0 +1,30 @@ + 'mimes:' . setting('general.file_types') . '|between:0,' . setting('general.file_size') * 1024, + ]; + } +} diff --git a/app/Listeners/Updates/Version130.php b/app/Listeners/Updates/Version130.php index a50dc1dfe..772632d87 100644 --- a/app/Listeners/Updates/Version130.php +++ b/app/Listeners/Updates/Version130.php @@ -3,6 +3,8 @@ namespace App\Listeners\Updates; use App\Events\UpdateFinished; +use App\Models\Auth\Role; +use App\Models\Auth\Permission; use Artisan; class Version130 extends Listener @@ -24,9 +26,27 @@ class Version130 extends Listener return; } + $permissions = $this->getPermissions(); + + // Attach permission to roles + $roles = Role::all(); + + foreach ($roles as $role) { + $allowed = ['admin']; + + if (!in_array($role->name, $allowed)) { + continue; + } + + foreach ($permissions as $permission) { + $role->attachPermission($permission); + } + } + // Set new Item Reminder settings setting(['general.send_item_reminder' => '0']); setting(['general.schedule_item_stocks' => '3,5,7']); + setting(['general.wizard' => '1']); setting()->save(); @@ -76,4 +96,86 @@ class Version130 extends Listener } } } + + protected function getPermissions() + { + $permissions = []; + + // Create permissions + $permissions[] = Permission::firstOrCreate([ + 'name' => 'create-wizard-companies', + 'display_name' => 'Create Wizard Compaines', + 'description' => 'Create Wizard Compaines', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'create-wizard-currencies', + 'display_name' => 'Create Wizard Currencies', + 'description' => 'Create Wizard Currencies', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'create-wizard-taxes', + 'display_name' => 'Create Wizard Taxes', + 'description' => 'Create Wizard Taxes', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'create-wizard-finish', + 'display_name' => 'Create Wizard Finish', + 'description' => 'Create Wizard Finish', + ]); + + // Read permissions + $permissions[] = Permission::firstOrCreate([ + 'name' => 'read-wizard-companies', + 'display_name' => 'Read Wizard Compaines', + 'description' => 'Read Wizard Compaines', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'read-wizard-currencies', + 'display_name' => 'Read Wizard Currencies', + 'description' => 'Read Wizard Currencies', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'read-wizard-taxes', + 'display_name' => 'Read Wizard Taxes', + 'description' => 'Read Wizard Taxes', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'read-wizard-finish', + 'display_name' => 'Read Wizard Finish', + 'description' => 'Read Wizard Finish', + ]); + + // Update permissions + $permissions[] = Permission::firstOrCreate([ + 'name' => 'update-wizard-companies', + 'display_name' => 'Update Wizard Compaines', + 'description' => 'Update Wizard Compaines', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'update-wizard-currencies', + 'display_name' => 'Update Wizard Currencies', + 'description' => 'Update Wizard Currencies', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'update-wizard-taxes', + 'display_name' => 'Update Wizard Taxes', + 'description' => 'Update Wizard Taxes', + ]); + + $permissions[] = Permission::firstOrCreate([ + 'name' => 'update-wizard-finish', + 'display_name' => 'Update Wizard Finish', + 'description' => 'Update Wizard Finish', + ]); + + return $permissions; + } } diff --git a/app/Providers/ViewComposerServiceProvider.php b/app/Providers/ViewComposerServiceProvider.php index 7cd15d6ac..0e690522a 100644 --- a/app/Providers/ViewComposerServiceProvider.php +++ b/app/Providers/ViewComposerServiceProvider.php @@ -31,7 +31,7 @@ class ViewComposerServiceProvider extends ServiceProvider // Add notifications to header View::composer( - ['partials.admin.header', 'partials.customer.header'], 'App\Http\ViewComposers\Header' + ['partials.wizard.header', 'partials.admin.header', 'partials.customer.header'], 'App\Http\ViewComposers\Header' ); // Add limits to index diff --git a/app/Traits/Modules.php b/app/Traits/Modules.php index 5076ecf1c..977c2a49f 100644 --- a/app/Traits/Modules.php +++ b/app/Traits/Modules.php @@ -200,6 +200,17 @@ trait Modules return []; } + public function getFeaturedModules($data = []) + { + $response = $this->getRemote('apps/featured', 'GET', $data); + + if ($response && ($response->getStatusCode() == 200)) { + return json_decode($response->getBody())->data; + } + + return []; + } + public function getCoreVersion() { $data['query'] = Info::all(); diff --git a/app/Utilities/Installer.php b/app/Utilities/Installer.php index 5d6f8116f..5fbe6c244 100644 --- a/app/Utilities/Installer.php +++ b/app/Utilities/Installer.php @@ -157,7 +157,7 @@ class Installer try { DB::connection('install_test')->getPdo(); - } catch (\Exception $e) {; + } catch (\Exception $e) { return false; } diff --git a/config/language.php b/config/language.php index 125aaa4c5..d7240dfc0 100644 --- a/config/language.php +++ b/config/language.php @@ -115,7 +115,7 @@ return [ | */ - 'allowed' => ['ar-SA', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-GB', 'es-ES', 'es-MX', 'fa-IR', 'fr-FR', 'he-IL', 'hr-HR', 'id-ID', 'it-IT', 'lv-LV', 'mk-MK', 'nb-NO', 'nl-NL', 'pt-BR', 'pt-PT', 'ro-RO', 'ru-RU', 'sk-SK', 'sq-AL', 'sv-SE', 'th-TH', 'tr-TR', 'uk-UA', 'vi-VN', 'zh-CN', 'zh-TW'], + 'allowed' => ['ar-SA', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-GB', 'es-ES', 'es-MX', 'fa-IR', 'fr-FR', 'he-IL', 'hr-HR', 'id-ID', 'it-IT', 'lt-LT', 'lv-LV', 'mk-MK', 'nb-NO', 'nl-NL', 'pt-BR', 'pt-PT', 'ro-RO', 'ru-RU', 'sk-SK', 'sq-AL', 'sv-SE', 'th-TH', 'tr-TR', 'uk-UA', 'vi-VN', 'zh-CN', 'zh-TW'], /* |-------------------------------------------------------------------------- diff --git a/database/seeds/Roles.php b/database/seeds/Roles.php index b6d1b93eb..71069bd0d 100644 --- a/database/seeds/Roles.php +++ b/database/seeds/Roles.php @@ -63,6 +63,10 @@ class Roles extends Seeder 'reports-income-expense-summary' => 'r', 'reports-profit-loss' => 'r', 'reports-tax-summary' => 'r', + 'wizard-companies' => 'c,r,u', + 'wizard-currencies' => 'c,r,u', + 'wizard-taxes' => 'c,r,u', + 'wizard-finish' => 'c,r,u', ], 'manager' => [ 'admin-panel' => 'r', diff --git a/database/seeds/Settings.php b/database/seeds/Settings.php index 1c530c9b5..1746965ab 100644 --- a/database/seeds/Settings.php +++ b/database/seeds/Settings.php @@ -51,7 +51,8 @@ class Settings extends Seeder 'general.session_lifetime' => '30', 'general.file_size' => '2', 'general.file_types' => 'pdf,jpeg,jpg,png', - 'offlinepayment.methods' => '[{"code":"offlinepayment.cash.1","name":"Cash","order":"1","description":null},{"code":"offlinepayment.bank_transfer.2","name":"Bank Transfer","order":"2","description":null}]', + 'general.wizard' => '0', + 'offlinepayment.methods' => '[{"code":"offlinepayment.cash.1","name":"Cash","order":"1","description":null},{"code":"offlinepayment.bank_transfer.2","name":"Bank Transfer","order":"2","description":null}]', ]); } } diff --git a/public/css/app.css b/public/css/app.css index 74af5a3b9..443cb131e 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -750,13 +750,14 @@ input[type="number"] { } #items .select2-container--default .select2-selection--multiple .select2-selection__choice { - background-color: #6da252; - border: 1px solid #6da252; + background-color: #f4f4f4; + color: #444; + border: 1px solid #ddd; margin-bottom: 5px; } #items .select2-container--default .select2-selection--multiple .select2-selection__choice__remove { - color: #fffdfd; + color: #444; } #items span.select2.select2-container.select2-container--default .select2-selection.select2-selection--multiple { @@ -775,4 +776,62 @@ input[type="number"] { #items .select2-search__field { padding-left: 15px; -} \ No newline at end of file +} + +.stepwizard-step p { + margin-top: 5px; + font-size: 16px; + color:#666; +} + +.stepwizard-row { + display: table-row; +} + +.stepwizard { + display: table; + width: 100%; + position: relative; + margin-top: 20px; +} + +.stepwizard-step button[disabled] { + /*opacity: 1 !important; + filter: alpha(opacity=100) !important;*/ +} + +.stepwizard .btn.disabled, .stepwizard .btn[disabled], .stepwizard fieldset[disabled] .btn { + opacity:1 !important; + color:#bbb; +} + +.stepwizard-row:before { + top: 26px; + bottom: 0; + position: absolute; + content:" "; + width: 100%; + height: 1px; + background-color: #ccc; + z-index: 0; +} + +.stepwizard-step { + display: table-cell; + text-align: center; + position: relative; +} + +.btn-circle.btn-success { + color: #fff; +} + +.btn-circle { + width: 50px; + height: 50px; + text-align: center; + padding: 1px 0; + font-size: 30px; + line-height: 1.428571; + border-radius: 30px; +} diff --git a/public/js/app.js b/public/js/app.js index f439f68c0..5b153e223 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -198,7 +198,9 @@ $(document).ready(function () { return true; }); - $('.input-group-invoice-text select').select2(); + if (document.getElementsByClassName('input-group-invoice-text').length) { + $('.input-group-invoice-text select').select2(); + } }); function confirmDelete(form_id, title, message, button_cancel, button_delete) { diff --git a/resources/lang/en-GB/general.php b/resources/lang/en-GB/general.php index 215c64937..116fce799 100644 --- a/resources/lang/en-GB/general.php +++ b/resources/lang/en-GB/general.php @@ -106,11 +106,15 @@ return [ 'partially' => 'Partially', 'partially_paid' => 'Partially Paid', 'export' => 'Export', + 'finish' => 'Finish', + 'wizard' => 'Wizard', + 'skip' => 'Skip', 'enable' => 'Enable', 'disable' => 'Disable', 'select_all' => 'Select All', 'unselect_all' => 'Unselect All', - 'create_date' => 'Create Date', + 'go_to' => 'Go to :name', + 'created_date' => 'Created Date', 'period' => 'Period', 'start' => 'Start', 'end' => 'End', diff --git a/resources/lang/en-GB/modules.php b/resources/lang/en-GB/modules.php index 80a0bbd44..3a2a9a373 100644 --- a/resources/lang/en-GB/modules.php +++ b/resources/lang/en-GB/modules.php @@ -16,6 +16,8 @@ return [ 'no_apps' => 'There are no apps in this category, yet.', 'developer' => 'Are you a developer? Here you can learn how to create an app and start selling today!', + 'recommended_apps' => 'Recommended Apps', + 'about' => 'About', 'added' => 'Added', diff --git a/resources/lang/lt-LT/accounts.php b/resources/lang/lt-LT/accounts.php new file mode 100644 index 000000000..8bc8a610d --- /dev/null +++ b/resources/lang/lt-LT/accounts.php @@ -0,0 +1,14 @@ + 'Įmonės pavadinimas', + 'number' => 'Numeris', + 'opening_balance' => 'Pradinis likutis', + 'current_balance' => 'Likutis', + 'bank_name' => 'Banko pavadinimas', + 'bank_phone' => 'Banko telefonas', + 'bank_address' => 'Banko adresas', + 'default_account' => 'Numatytoji įmonė', + +]; diff --git a/resources/lang/lt-LT/auth.php b/resources/lang/lt-LT/auth.php new file mode 100644 index 000000000..7b7fe014b --- /dev/null +++ b/resources/lang/lt-LT/auth.php @@ -0,0 +1,39 @@ + 'Profilis', + 'logout' => 'Atsijungti', + 'login' => 'Prisijungti', + 'login_to' => 'Prisijunkite, kad pradėtumėte sesiją', + 'remember_me' => 'Prisiminti mane', + 'forgot_password' => 'Pamiršau slaptažodį', + 'reset_password' => 'Atstatyti slaptažodį', + 'enter_email' => 'Įveskite savo el. pašto adresą', + 'current_email' => 'Dabartinis el. paštas', + 'reset' => 'Atstatyti', + 'never' => 'niekada', + + 'password' => [ + 'current' => 'Slaptažodis', + 'current_confirm' => 'Slaptažodžio patvirtinimas', + 'new' => 'Naujas slaptažodis', + 'new_confirm' => 'Naujo slaptažodžio patvirtinimas', + ], + + 'error' => [ + 'self_delete' => 'Negalite ištrinti savęs!', + 'no_company' => 'Nėra priskirtos kompanijos. Prašome susisiekti su sistemos administratoriumi.', + ], + + 'failed' => 'Neteisingi prisijungimo duomenys.', + 'disabled' => 'Šis vartotojas yra išjungtas. Prašome susisiekti su sistemos administratoriumi.', + 'throttle' => 'Per daug bandymų prisijungti. Bandykite po :seconds sec.', + + 'notification' => [ + 'message_1' => 'Jūs gavote šį laišką, nes mes gavome prašymą atstatyti slaptažodį jūsų vartotojui.', + 'message_2' => 'Jei jūs neprašėte atstatyti slaptažodžio - tiesiog nieko nedarykite.', + 'button' => 'Atstatyti slaptažodį', + ], + +]; diff --git a/resources/lang/lt-LT/bills.php b/resources/lang/lt-LT/bills.php new file mode 100644 index 000000000..f7a34028a --- /dev/null +++ b/resources/lang/lt-LT/bills.php @@ -0,0 +1,46 @@ + 'Sąskaitos numeris', + 'bill_date' => 'Sąskaitos data', + 'total_price' => 'Bendra suma', + 'due_date' => 'Terminas', + 'order_number' => 'Užsakymo numeris', + 'bill_from' => 'Sąskaitas iš', + + 'quantity' => 'Kiekis', + 'price' => 'Kaina', + 'sub_total' => 'Tarpinė suma', + 'discount' => 'Nuolaida', + 'tax_total' => 'Mokesčių suma', + 'total' => 'Iš viso', + + 'item_name' => 'Prekės/paslaugos pavadinimas', + + 'show_discount' => ':discount% nuolaida', + 'add_discount' => 'Pridėti nuolaidą', + 'discount_desc' => 'tarpinė suma', + + 'payment_due' => 'Mokėjimo terminas', + 'amount_due' => 'Mokėtina suma', + 'paid' => 'Apmokėta', + 'histories' => 'Istorijos', + 'payments' => 'Mokėjimai', + 'add_payment' => 'Pridėti mokėjimą', + 'mark_received' => 'Pažymėti kaip gautą', + 'download_pdf' => 'Parsisiųsti PDF', + 'send_mail' => 'Siųsti laišką', + + 'status' => [ + 'draft' => 'Juodraštis', + 'received' => 'Gauta', + 'partial' => 'Dalinis', + 'paid' => 'Apmokėta', + ], + + 'messages' => [ + 'received' => 'Sąskaita gauta sėkmingai!', + ], + +]; diff --git a/resources/lang/lt-LT/companies.php b/resources/lang/lt-LT/companies.php new file mode 100644 index 000000000..cbe3111b4 --- /dev/null +++ b/resources/lang/lt-LT/companies.php @@ -0,0 +1,13 @@ + 'Domenas', + 'logo' => 'Logotipas', + 'manage' => 'Valdyti įmones', + 'all' => 'Visos įmonės', + 'error' => [ + 'delete_active' => 'Klaida: Negalite ištrinti aktyvios įmonės, pirma turite pakeisti ją!', + ], + +]; diff --git a/resources/lang/lt-LT/currencies.php b/resources/lang/lt-LT/currencies.php new file mode 100644 index 000000000..3772d6182 --- /dev/null +++ b/resources/lang/lt-LT/currencies.php @@ -0,0 +1,18 @@ + 'Kodas', + 'rate' => 'Kursas', + 'default' => 'Numatytoji valiuta', + 'decimal_mark' => 'Dešimtainis ženklas', + 'thousands_separator' => 'Tūkstančių skyriklis', + 'precision' => 'Tikslumas', + 'symbol' => [ + 'symbol' => 'Simbolis', + 'position' => 'Simbolio pozicija', + 'before' => 'Suma prieš', + 'after' => 'Suma po', + ] + +]; diff --git a/resources/lang/lt-LT/customers.php b/resources/lang/lt-LT/customers.php new file mode 100644 index 000000000..2922f3a07 --- /dev/null +++ b/resources/lang/lt-LT/customers.php @@ -0,0 +1,11 @@ + 'Leisti prisijungti?', + 'user_created' => 'Vartotojas sukurtas', + + 'error' => [ + 'email' => 'Šis el. paštas jau užimtas.' + ] +]; diff --git a/resources/lang/lt-LT/dashboard.php b/resources/lang/lt-LT/dashboard.php new file mode 100644 index 000000000..231e52b15 --- /dev/null +++ b/resources/lang/lt-LT/dashboard.php @@ -0,0 +1,24 @@ + 'Iš viso pajamų', + 'receivables' => 'Gautinos sumos', + 'open_invoices' => 'Atidaryti sąskaitas faktūras', + 'overdue_invoices' => 'Vėluojančios sąskaitos faktūros', + 'total_expenses' => 'Iš viso išlaidų', + 'payables' => 'Mokėtinos sumos', + 'open_bills' => 'Atidaryti sąskaitas', + 'overdue_bills' => 'Vėluojančios sąskaitos', + 'total_profit' => 'Pelnas iš viso', + 'open_profit' => 'Pelnas prieš mokesčius', + 'overdue_profit' => 'Vėluojantis pelnas', + 'cash_flow' => 'Grynųjų pinigų srautai', + 'no_profit_loss' => 'Nėra nuostolių', + 'incomes_by_category' => 'Pajamos pagal kategoriją', + 'expenses_by_category' => 'Išlaidos pagal kategoriją', + 'account_balance' => 'Sąskaitos likutis', + 'latest_incomes' => 'Naujausios pajamos', + 'latest_expenses' => 'Paskutinis išlaidos', + +]; diff --git a/resources/lang/lt-LT/demo.php b/resources/lang/lt-LT/demo.php new file mode 100644 index 000000000..0df5628dc --- /dev/null +++ b/resources/lang/lt-LT/demo.php @@ -0,0 +1,16 @@ + 'Grynieji pinigai', + 'categories_deposit' => 'Depozitas', + 'categories_sales' => 'Pardavimai', + 'currencies_usd' => 'JAV doleris', + 'currencies_eur' => 'Euras', + 'currencies_gbp' => 'Svarai sterlingai', + 'currencies_try' => 'Turkijos Lira', + 'taxes_exempt' => 'Neapmokestinamos pajamos', + 'taxes_normal' => 'Įprastiniai mokesčiai', + 'taxes_sales' => 'PVM', + +]; diff --git a/resources/lang/lt-LT/footer.php b/resources/lang/lt-LT/footer.php new file mode 100644 index 000000000..cc6c6d660 --- /dev/null +++ b/resources/lang/lt-LT/footer.php @@ -0,0 +1,9 @@ + 'Versija', + 'powered' => 'Sukurta Akaunting', + 'software' => 'Nemokama apskaitos programa', + +]; diff --git a/resources/lang/lt-LT/general.php b/resources/lang/lt-LT/general.php new file mode 100644 index 000000000..ad3f5a548 --- /dev/null +++ b/resources/lang/lt-LT/general.php @@ -0,0 +1,121 @@ + 'Prekė|Prekės', + 'incomes' => 'Pajamos|Pajamos', + 'invoices' => 'Sąskaita|Sąskaitos', + 'revenues' => 'Pajamos|Pajamos', + 'customers' => 'Klientas|Klientai', + 'expenses' => 'Išlaidos|Išlaidos', + 'bills' => 'Sąskaitą|Sąskaitos', + 'payments' => 'Mokėjimas|Mokėjimai', + 'vendors' => 'Tiekėjas|Tiekėjai', + 'accounts' => 'Vartotojas|Vartotojai', + 'transfers' => 'Pervedimas|Pervedimai', + 'transactions' => 'Transakcija|Transakcijos', + 'reports' => 'Ataskaita|Ataskaitos', + 'settings' => 'Nustatymas|Nustatymai', + 'categories' => 'Kategorija|Kategorijos', + 'currencies' => 'Valiuta|Valiutos', + 'tax_rates' => 'Mokesčių tarifas|Mokesčių tarifai', + 'users' => 'Vartotojas|Vartotojai', + 'roles' => 'Rolė|Rolės', + 'permissions' => 'Teisė|Teisės', + 'modules' => 'Programėlė|Programėlės', + 'companies' => 'Įmonė|įmonės', + 'profits' => 'Pelnas|Pelnas', + 'taxes' => 'Mokestis|Mokesčiai', + 'logos' => 'Logotipas|Logotipai', + 'pictures' => 'Paveikslėlis|Paveikslėliai', + 'types' => 'Tipas|Tipai', + 'payment_methods' => 'Mokėjimo būdas|Mokėjimo būdai', + 'compares' => 'Pajamos - išlaidos|Pajamos - išlaidos', + 'notes' => 'Pastaba|Pastabos', + 'totals' => 'Iš viso|Iš viso', + 'languages' => 'Kalba|Kalbos', + 'updates' => 'Atnaujinimas|Atnaujinimai', + 'numbers' => 'Skaičius|Skaičiai', + 'statuses' => 'Statusas|Statusai', + 'others' => 'Kiti|Kiti', + + 'dashboard' => 'Pradžia', + 'banking' => 'Bankai ir finansai', + 'general' => 'Bendras', + 'no_records' => 'Nėra įrašų.', + 'date' => 'Data', + 'amount' => 'Kiekis', + 'enabled' => 'Įjungta', + 'disabled' => 'Įšjungta', + 'yes' => 'Taip', + 'no' => 'Ne', + 'na' => 'N/A', + 'daily' => 'Kasdien', + 'monthly' => 'Kas mėnesį', + 'quarterly' => 'Kas ketvirtį', + 'yearly' => 'Kasmet', + 'add' => 'Pridėti', + 'add_new' => 'Pridėti naują', + 'show' => 'Rodyti', + 'edit' => 'Redaguoti', + 'delete' => 'Ištrinti', + 'send' => 'Siųsti', + 'download' => 'Parsisiųsti', + 'delete_confirm' => 'Ar tikrai norite ištrinti?', + 'name' => 'Vardas', + 'email' => 'El. paštas', + 'tax_number' => 'PVM kodas', + 'phone' => 'Telefonas', + 'address' => 'Adresas', + 'website' => 'Interneto svetainė', + 'actions' => 'Veiksmai', + 'description' => 'Aprašymas', + 'manage' => 'Valdyti', + 'code' => 'Kodas', + 'alias' => 'Alternatyva', + 'balance' => 'Balansas', + 'reference' => 'Nuoroda', + 'attachment' => 'Priedai', + 'change' => 'Pakeisti', + 'switch' => 'Perjungti', + 'color' => 'Spalva', + 'save' => 'Išsaugoti', + 'cancel' => 'Atšaukti', + 'from' => 'Nuo', + 'to' => 'Iki', + 'print' => 'Spausdinti', + 'search' => 'Paieška', + 'search_placeholder' => 'Ieškoti..', + 'filter' => 'Filtras', + 'help' => 'Pagalba', + 'all' => 'Visi', + 'all_type' => 'Visi :type', + 'upcoming' => 'Artėjantys', + 'created' => 'Sukurta', + 'id' => 'ID', + 'more_actions' => 'Daugiau veiksmų', + 'duplicate' => 'Duplikuoti', + 'unpaid' => 'Neapmokėta', + 'paid' => 'Apmokėta', + 'overdue' => 'Vėluojanti', + 'partially' => 'Dalinis', + 'partially_paid' => 'Dalinai apmokėta', + 'export' => 'Eksportuoti', + 'enable' => 'Įjungti', + 'disable' => 'Išjungti', + + 'title' => [ + 'new' => 'Naujas :type', + 'edit' => 'Redaguoti :type', + ], + + 'form' => [ + 'enter' => 'Įveskite :field', + 'select' => [ + 'field' => '- Pasirinkite :field -', + 'file' => 'Pasirinkti failą', + ], + 'no_file_selected' => 'Nepasirinktas failas...', + ], + +]; diff --git a/resources/lang/lt-LT/header.php b/resources/lang/lt-LT/header.php new file mode 100644 index 000000000..a428cfba1 --- /dev/null +++ b/resources/lang/lt-LT/header.php @@ -0,0 +1,15 @@ + 'Keisti kalbą', + 'last_login' => 'Paskutinis prisijungimas :laikas', + 'notifications' => [ + 'counter' => '{0} Pranešimų nėra|{1} Turite :count pranešimą|[2,*] Turite :count pranešimus', + 'overdue_invoices' => '{1} :count vėluojanti sąskaita|[2,*] :count vėluojančios sąskaitos', + 'upcoming_bills' => '{1} :count artėjantis mokėjimasl|[2,*] :count artėjantys mokėjimai', + 'items_stock' => '{1} :count prekės nebėra|[2,*] :count prekių nebėra', + 'view_all' => 'Peržiūrėti visus' + ], + +]; diff --git a/resources/lang/lt-LT/import.php b/resources/lang/lt-LT/import.php new file mode 100644 index 000000000..4dd544454 --- /dev/null +++ b/resources/lang/lt-LT/import.php @@ -0,0 +1,9 @@ + 'Importuoti', + 'title' => 'Importuoti :type', + 'message' => 'Leidžiami failų tipai: XLS, XLSX. Prašome parsisiųsti pavyzdį.', + +]; diff --git a/resources/lang/lt-LT/install.php b/resources/lang/lt-LT/install.php new file mode 100644 index 000000000..eef0204c3 --- /dev/null +++ b/resources/lang/lt-LT/install.php @@ -0,0 +1,44 @@ + 'Sekantis', + 'refresh' => 'Atnaujinti', + + 'steps' => [ + 'requirements' => 'Prašome kreiptis į savo talpinimo paslaugų teikėją, kad ištaisytų klaidas!', + 'language' => 'Žingsnis 1/3: Kalbos pasirinkimas', + 'database' => 'Žingsnis 2/3: Duombazės nustatymai', + 'settings' => 'Žingsnis 3/3: Įmonės ir administratoriaus nustatymai', + ], + + 'language' => [ + 'select' => 'Pasirinkite kalbą', + ], + + 'requirements' => [ + 'enabled' => ': feature turi būti įjungta!', + 'disabled' => ': feature turi būti išjungta!', + 'extension' => ':extension turi būti įrašytas ir įjungtas!', + 'directory' => ':directory direktorijoje turi būti leidžiama įrašyti!', + ], + + 'database' => [ + 'hostname' => 'Serverio adresas', + 'username' => 'Vartotojo vardas', + 'password' => 'Slaptažodis', + 'name' => 'Duomenų bazė', + ], + + 'settings' => [ + 'company_name' => 'Įmonės pavadinimas', + 'company_email' => 'Įmonės el. paštas', + 'admin_email' => 'Administratoriaus el. paštas', + 'admin_password' => 'Administratoriaus slaptažodis', + ], + + 'error' => [ + 'connection' => 'Klaida: Nepavyko prisijungti prie duomenų bazės! Prašome įsitikinkite, kad informacija yra teisinga.', + ], + +]; diff --git a/resources/lang/lt-LT/invoices.php b/resources/lang/lt-LT/invoices.php new file mode 100644 index 000000000..e4b72abc0 --- /dev/null +++ b/resources/lang/lt-LT/invoices.php @@ -0,0 +1,55 @@ + 'Sąskaitos-faktūros numeris', + 'invoice_date' => 'Sąskaitos-faktūros data', + 'total_price' => 'Bendra kaina', + 'due_date' => 'Terminas', + 'order_number' => 'Užsakymo numeris', + 'bill_to' => 'Pirkėjas', + + 'quantity' => 'Kiekis', + 'price' => 'Kaina', + 'sub_total' => 'Tarpinė suma', + 'discount' => 'Nuolaida', + 'tax_total' => 'Mokesčių suma', + 'total' => 'Iš viso', + + 'item_name' => 'Prekė/paslauga|Prekės/paslaugos', + + 'show_discount' => ':discount% nuolaida', + 'add_discount' => 'Pridėti nuolaidą', + 'discount_desc' => 'tarpinė suma', + + 'payment_due' => 'Mokėjimo terminas', + 'paid' => 'Apmokėta', + 'histories' => 'Istorijos', + 'payments' => 'Mokėjimai', + 'add_payment' => 'Pridėti mokėjimą', + 'mark_paid' => 'Pažymėti kaip apmokėtą', + 'mark_sent' => 'Pažymėti kaip išsiųstą', + 'download_pdf' => 'Parsisiųsti PDF', + 'send_mail' => 'Siųsti laišką', + + 'status' => [ + 'draft' => 'Juodraštis', + 'sent' => 'Išsiųsta', + 'viewed' => 'Peržiūrėta', + 'approved' => 'Patvirtinta', + 'partial' => 'Dalinis', + 'paid' => 'Apmokėta', + ], + + 'messages' => [ + 'email_sent' => 'Sąskaitą-faktūrą išsiųsta sėkmingai!', + 'marked_sent' => 'SF pažymėta kaip išsiųsta sėkmingai!', + 'email_required' => 'Klientas neturi el. pašto!', + ], + + 'notification' => [ + 'message' => 'Jūs gavote šį laišką, nes :customer jums išrašė sąskaitą už :amount.', + 'button' => 'Apmokėti dabar', + ], + +]; diff --git a/resources/lang/lt-LT/items.php b/resources/lang/lt-LT/items.php new file mode 100644 index 000000000..d6d95e751 --- /dev/null +++ b/resources/lang/lt-LT/items.php @@ -0,0 +1,15 @@ + 'Kiekis|Kiekiai', + 'sales_price' => 'Pardavimo kaina', + 'purchase_price' => 'Pirkimo kaina', + 'sku' => 'Prekės kodas', + + 'notification' => [ + 'message' => 'Jūs gavote šį laišką, nes baigiasi :name likutis.', + 'button' => 'Peržiūrėti dabar', + ], + +]; diff --git a/resources/lang/lt-LT/messages.php b/resources/lang/lt-LT/messages.php new file mode 100644 index 000000000..6e805e386 --- /dev/null +++ b/resources/lang/lt-LT/messages.php @@ -0,0 +1,29 @@ + [ + 'added' => ':type pridėtas!', + 'updated' => ':type atnaujintas!', + 'deleted' => ':type ištrintas!', + 'duplicated' => ':type duplikuotas!', + 'imported' => ':type importuotas!', + 'enabled' => ':type įjungtas!', + 'disabled' => ':type išjungtas!', + ], + 'error' => [ + 'over_payment' => 'Klaida: Apmokėjimas nepridėtas! Užsakymo kiekis viršija turimą kiekį.', + 'not_user_company' => 'Klaida: Jūs neturite teisės valdyti šios kompanijos!', + 'customer' => 'Klaida: Vartotojas nebuvo sukurtas! :name jau naudoja šį el. pašto adresą.', + 'no_file' => 'Klaida: Nepasirinktas failas!', + 'last_category' => 'Klaida: Negalite ištrinti paskutinės :type kategorijos!', + 'invalid_token' => 'Klaida: Neteisingas raktas!', + 'import_column' => 'Klaida: :message :sheet lape. Eilutė: :line.', + 'import_sheet' => 'Klaida: Lapo pavadinimas neteisingas Peržiūrėkite pavyzdį.', + ], + 'warning' => [ + 'deleted' => 'Negalima ištrinti :name, nes jis yra susijęs su :text.', + 'disabled' => 'Negalima išjungti :name, nes jis yra susijęs su :text.', + ], + +]; diff --git a/resources/lang/lt-LT/modules.php b/resources/lang/lt-LT/modules.php new file mode 100644 index 000000000..ef5ac3d82 --- /dev/null +++ b/resources/lang/lt-LT/modules.php @@ -0,0 +1,58 @@ + 'API raktas', + 'api_token' => 'Raktas', + 'my_apps' => 'Mano programėlės', + 'top_paid' => 'Geriausios mokamos', + 'new' => 'Nauji', + 'top_free' => 'Geriausios nemokamos', + 'free' => 'NEMOKAMOS', + 'search' => 'Paieška', + 'install' => 'Įrašyti', + 'buy_now' => 'Pirkti dabar', + 'token_link' => 'Spauskite čia, kad gautumėte savo API raktą.', + 'no_apps' => 'Nėra programėlių šioje kategorijoje.', + 'developer' => 'Ar esate kūrėjas? Čia galite sužinoti, kaip sukurti programėlę ir pradėti pardavinėti šiandien!', + + 'about' => 'Apie', + + 'added' => 'Pridėta', + 'updated' => 'Atnaujinta', + 'compatibility' => 'Suderinamumas', + + 'installed' => ':module įrašytas', + 'uninstalled' => ':module ištrintas', + //'updated' => ':module updated', + 'enabled' => ':module įjungtas', + 'disabled' => ':module įšjungtas', + + 'tab' => [ + 'installation' => 'Įrašymas', + 'faq' => 'DUK', + 'changelog' => 'Pakeitimų sąrašas', + ], + + 'installation' => [ + 'header' => 'Įrašymas', + 'download' => 'Parsisiunčiamas :module failas.', + 'unzip' => 'Išskleidžiami :module failai.', + 'install' => 'Įrašomi :module failai.', + ], + + 'badge' => [ + 'installed' => 'Įrašytas', + ], + + 'button' => [ + 'uninstall' => 'Ištrinti', + 'disable' => 'Išjungti', + 'enable' => 'Įjungti', + ], + + 'my' => [ + 'purchased' => 'Nupirkta', + 'installed' => 'Įrašyta', + ], +]; diff --git a/resources/lang/lt-LT/notifications.php b/resources/lang/lt-LT/notifications.php new file mode 100644 index 000000000..75e6c91fb --- /dev/null +++ b/resources/lang/lt-LT/notifications.php @@ -0,0 +1,10 @@ + 'Oi!', + 'hello' => 'Sveiki!', + 'salutation' => 'Linkėjimai,
:company_name', + 'subcopy' => 'Jei negalite paspausti ":text" nuorodos, nukopijuokite adresą ir nueikite į jį naršyklėje: [:url](:url)', + +]; diff --git a/resources/lang/lt-LT/pagination.php b/resources/lang/lt-LT/pagination.php new file mode 100644 index 000000000..a69c048e3 --- /dev/null +++ b/resources/lang/lt-LT/pagination.php @@ -0,0 +1,9 @@ + '« Ankstesnis', + 'next' => 'Sekantis »', + 'showing' => 'Rodoma nuo :first iki :last iš :total :type', + +]; diff --git a/resources/lang/lt-LT/passwords.php b/resources/lang/lt-LT/passwords.php new file mode 100644 index 000000000..4fb2c8538 --- /dev/null +++ b/resources/lang/lt-LT/passwords.php @@ -0,0 +1,22 @@ + 'Slaptažodžiai turi būti bent šešių simbolių ir sutapti.', + 'reset' => 'Slaptažodis pakeistas!', + 'sent' => 'Slaptažodžio keitimo nuoroda išsiųsta!', + 'token' => 'Šis slaptažodžio atnaujinimas negaliojantis.', + 'user' => "Vartotojas su tokiu el. pašu nerastas.", + +]; diff --git a/resources/lang/lt-LT/recurring.php b/resources/lang/lt-LT/recurring.php new file mode 100644 index 000000000..491cced55 --- /dev/null +++ b/resources/lang/lt-LT/recurring.php @@ -0,0 +1,20 @@ + 'Pasikartojantis', + 'every' => 'Kiekvieną', + 'period' => 'Periodas', + 'times' => 'Kartus', + 'daily' => 'Kasdien', + 'weekly' => 'Kas savaitę', + 'monthly' => 'Kas mėnesį', + 'yearly' => 'Kasmet', + 'custom' => 'Pasirinktinis', + 'days' => 'Diena(os)', + 'weeks' => 'Savaite(ės)', + 'months' => 'Mėnuo(iai)', + 'years' => 'Metai(s)', + 'message' => 'Tai pasikartojanti :type ir kita :type bus automatiškai sugeneruota :data', + +]; diff --git a/resources/lang/lt-LT/reports.php b/resources/lang/lt-LT/reports.php new file mode 100644 index 000000000..18653f3c1 --- /dev/null +++ b/resources/lang/lt-LT/reports.php @@ -0,0 +1,30 @@ + 'Šiais metais', + 'previous_year' => 'Ankstesniais metais', + 'this_quarter' => 'Šį ketvirtį', + 'previous_quarter' => 'Praėjusį ketvirtį', + 'last_12_months' => 'Per paskutinius 12 mėnesių', + 'profit_loss' => 'Pelnas ir nuostoliai', + 'gross_profit' => 'Grynasis pelnas', + 'net_profit' => 'Pelnas prieš mokesčius', + 'total_expenses' => 'Iš viso išlaidų', + 'net' => 'NET', + + 'summary' => [ + 'income' => 'Pajamų suvestinė', + 'expense' => 'Išlaidų suvestinė', + 'income_expense' => 'Pajamos / išlaidos', + 'tax' => 'Mokesčių suvestinė', + ], + + 'quarter' => [ + '1' => 'Sau-Kov', + '2' => 'Bal-Bir', + '3' => 'Lie-Rugs', + '4' => 'Spa-Gruo', + ], + +]; diff --git a/resources/lang/lt-LT/settings.php b/resources/lang/lt-LT/settings.php new file mode 100644 index 000000000..78d0a0e64 --- /dev/null +++ b/resources/lang/lt-LT/settings.php @@ -0,0 +1,90 @@ + [ + 'name' => 'Vardas', + 'email' => 'El. paštas', + 'phone' => 'Telefonas', + 'address' => 'Adresas', + 'logo' => 'Logotipas', + ], + 'localisation' => [ + 'tab' => 'Lokalizacija', + 'date' => [ + 'format' => 'Datos formatas', + 'separator' => 'Datos skirtukas', + 'dash' => 'Brūkšnelis (-)', + 'dot' => 'Taškas (.)', + 'comma' => 'Kablelis (,)', + 'slash' => 'Pasvirasis brūkšnys (/)', + 'space' => 'Tarpas ( )', + ], + 'timezone' => 'Laiko juosta', + 'percent' => [ + 'title' => 'Procentų (%) Pozicija', + 'before' => 'Prieš skaičių', + 'after' => 'Po skaičiaus', + ], + ], + 'invoice' => [ + 'tab' => 'Sąskaita faktūra', + 'prefix' => 'Sąskaitos serija', + 'digit' => 'Skaitmenų kiekis', + 'next' => 'Sekantis numeris', + 'logo' => 'Logotipas', + ], + 'default' => [ + 'tab' => 'Numatytieji', + 'account' => 'Numatytoji įmonė', + 'currency' => 'Numatytoji valiuta', + 'tax' => 'Numatytasis mokesčių tarifas', + 'payment' => 'Numatytasis mokėjimo būdas', + 'language' => 'Numatytoji kalba', + ], + 'email' => [ + 'protocol' => 'Protokolas', + 'php' => 'PHP Mail', + 'smtp' => [ + 'name' => 'SMTP', + 'host' => 'SMTP adresas', + 'port' => 'SMTP portas', + 'username' => 'SMTP prisijungimo vardas', + 'password' => 'SMTP slaptažodis', + 'encryption' => 'SMTP saugumas', + 'none' => 'Joks', + ], + 'sendmail' => 'Sendmail', + 'sendmail_path' => 'Sendmail kelias', + 'log' => 'Prisijungti el. Paštu', + ], + 'scheduling' => [ + 'tab' => 'Planavimas', + 'send_invoice' => 'Siųsti SF priminimą', + 'invoice_days' => 'Siųsti pavėlavus', + 'send_bill' => 'Siųsti sąskaitos priminimą', + 'bill_days' => 'Siųsti prieš pavėlavimą', + 'cron_command' => 'Cron komanda', + 'schedule_time' => 'Paleisti valandą', + ], + 'appearance' => [ + 'tab' => 'Išvaizda', + 'theme' => 'Tema', + 'light' => 'Šviesi', + 'dark' => 'Tamsi', + 'list_limit' => 'Įrašų puslapyje', + 'use_gravatar' => 'Naudoti Gravatar', + ], + 'system' => [ + 'tab' => 'Sistema', + 'session' => [ + 'lifetime' => 'Sesijos galiojimo laikas (min)', + 'handler' => 'Sesijos valdiklis', + 'file' => 'Failas', + 'database' => 'Duomenų bazė', + ], + 'file_size' => 'Maksimalus failo dydis (MB)', + 'file_types' => 'Leidžiami failų tipai', + ], + +]; diff --git a/resources/lang/lt-LT/taxes.php b/resources/lang/lt-LT/taxes.php new file mode 100644 index 000000000..c50b52d4a --- /dev/null +++ b/resources/lang/lt-LT/taxes.php @@ -0,0 +1,8 @@ + 'Kursas', + 'rate_percent' => 'Kursas (%)', + +]; diff --git a/resources/lang/lt-LT/transfers.php b/resources/lang/lt-LT/transfers.php new file mode 100644 index 000000000..a9d520a57 --- /dev/null +++ b/resources/lang/lt-LT/transfers.php @@ -0,0 +1,12 @@ + 'Iš Sąskaitos', + 'to_account' => 'Į Sąskaitą', + + 'messages' => [ + 'delete' => 'Iš :from į :to (:amount)', + ], + +]; diff --git a/resources/lang/lt-LT/updates.php b/resources/lang/lt-LT/updates.php new file mode 100644 index 000000000..86c6150ec --- /dev/null +++ b/resources/lang/lt-LT/updates.php @@ -0,0 +1,15 @@ + 'Versija', + 'latest_version' => 'Naujausia versija', + 'update' => 'Atnaujinti Akaunting į :version versiją', + 'changelog' => 'Pakeitimų sąrašas', + 'check' => 'Tikrinti', + 'new_core' => 'Yra naujesnė Akaunting versija.', + 'latest_core' => 'Sveikiname! Jūs turite naujausią Akaunting versiją. Tolimesni atnaujinimai bus įrašomi automatiškai.', + 'success' => 'Atnaujinimas pavyko sėkmingai.', + 'error' => 'Įvyko klaida atnaujinant, prašome bandyti dar kartą.', + +]; diff --git a/resources/lang/lt-LT/validation.php b/resources/lang/lt-LT/validation.php new file mode 100644 index 000000000..837d44ebc --- /dev/null +++ b/resources/lang/lt-LT/validation.php @@ -0,0 +1,120 @@ + 'Laukas :attribute turi būti priimta.', + 'active_url' => 'Laukas :attribute nėra galiojantis internetinis adresas.', + 'after' => 'Lauko :attribute reikšmė turi būti po :date datos.', + 'after_or_equal' => ':Attribute privalo būti data lygi arba vėlesnė už :date.', + 'alpha' => 'Laukas :attribute gali turėti tik raides.', + 'alpha_dash' => 'Laukas :attribute gali turėti tik raides, skaičius ir brūkšnelius.', + 'alpha_num' => 'Laukas :attribute gali turėti tik raides ir skaičius.', + 'array' => 'Laukas :attribute turi būti masyvas.', + 'before' => 'Laukas :attribute turi būti data prieš :date.', + 'before_or_equal' => ':Attribute privalo būti data ankstenė arba lygi :date.', + 'between' => [ + 'numeric' => 'Lauko :attribute reikšmė turi būti tarp :min ir :max.', + 'file' => 'Failo dydis lauke :attribute turi būti tarp :min ir :max kilobaitų.', + 'string' => 'Simbolių skaičius lauke :attribute turi būti tarp :min ir :max.', + 'array' => 'Elementų skaičius lauke :attribute turi turėti nuo :min iki :max.', + ], + 'boolean' => 'Lauko reikšmė :attribute turi būti \'taip\' arba \'ne\'.', + 'confirmed' => 'Lauko :attribute patvirtinimas nesutampa.', + 'date' => 'Lauko :attribute reikšmė nėra galiojanti data.', + 'date_format' => 'Lauko :attribute reikšmė neatitinka formato :format.', + 'different' => 'Laukų :attribute ir :other reikšmės turi skirtis.', + 'digits' => 'Laukas :attribute turi būti sudarytas iš :digits skaitmenų.', + 'digits_between' => 'Laukas :attribute tuti turėti nuo :min iki :max skaitmenų.', + 'dimensions' => 'Lauke :attribute įkeltas paveiksliukas neatitinka išmatavimų reikalavimo.', + 'distinct' => 'Laukas :attribute pasikartoja.', + 'email' => 'Lauko :attribute reikšmė turi būti galiojantis el. pašto adresas.', + 'exists' => 'Pasirinkta negaliojanti :attribute reikšmė.', + 'file' => ':Attribute privalo būti failas.', + 'filled' => 'Laukas :attribute turi būti užpildytas.', + 'image' => 'Lauko :attribute reikšmė turi būti paveikslėlis.', + 'in' => 'Pasirinkta negaliojanti :attribute reikšmė.', + 'in_array' => 'Laukas :attribute neegzistuoja :other lauke.', + 'integer' => 'Lauko :attribute reikšmė turi būti veikasis skaičius.', + 'ip' => 'Lauko :attribute reikšmė turi būti galiojantis IP adresas.', + 'json' => 'Lauko :attribute reikšmė turi būti JSON tekstas.', + 'max' => [ + 'numeric' => 'Lauko :attribute reikšmė negali būti didesnė nei :max.', + 'file' => 'Failo dydis lauke :attribute reikšmė negali būti didesnė nei :max kilobaitų.', + 'string' => 'Simbolių kiekis lauke :attribute reikšmė negali būti didesnė nei :max simbolių.', + 'array' => 'Elementų kiekis lauke :attribute negali turėti daugiau nei :max elementų.', + ], + 'mimes' => 'Lauko reikšmė :attribute turi būti failas vieno iš sekančių tipų: :values.', + 'mimetypes' => 'Lauko reikšmė :attribute turi būti failas vieno iš sekančių tipų: :values.', + 'min' => [ + 'numeric' => 'Lauko :attribute reikšmė turi būti ne mažesnė nei :min.', + 'file' => 'Failo dydis lauke :attribute turi būti ne mažesnis nei :min kilobaitų.', + 'string' => 'Simbolių kiekis lauke :attribute turi būti ne mažiau nei :min.', + 'array' => 'Elementų kiekis lauke :attribute turi būti ne mažiau nei :min.', + ], + 'not_in' => 'Pasirinkta negaliojanti reikšmė :attribute.', + 'numeric' => 'Lauko :attribute reikšmė turi būti skaičius.', + 'present' => 'Laukas :attribute turi egzistuoti.', + 'regex' => 'Negaliojantis lauko :attribute formatas.', + 'required' => 'Privaloma užpildyti lauką :attribute.', + 'required_if' => 'Privaloma užpildyti lauką :attribute kai :other yra :value.', + 'required_unless' => 'Laukas :attribute yra privalomas, nebent :other yra tarp :values reikšmių.', + 'required_with' => 'Privaloma užpildyti lauką :attribute kai pateikta :values.', + 'required_with_all' => 'Privaloma užpildyti lauką :attribute kai pateikta :values.', + 'required_without' => 'Privaloma užpildyti lauką :attribute kai nepateikta :values.', + 'required_without_all' => 'Privaloma užpildyti lauką :attribute kai nepateikta nei viena iš reikšmių :values.', + 'same' => 'Laukai :attribute ir :other turi sutapti.', + 'size' => [ + 'numeric' => 'Lauko :attribute reikšmė turi būti :size.', + 'file' => 'Failo dydis lauke :attribute turi būti :size kilobaitai.', + 'string' => 'Simbolių skaičius lauke :attribute turi būti :size.', + 'array' => 'Elementų kiekis lauke :attribute turi būti :size.', + ], + 'string' => 'Laukas :attribute turi būti tekstinis.', + 'timezone' => 'Lauko :attribute reikšmė turi būti galiojanti laiko zona.', + 'unique' => 'Tokia :attribute reikšmė jau pasirinkta.', + 'uploaded' => 'Nepavyko įkelti :attribute.', + 'url' => 'Negaliojantis lauko :attribute formatas.', + + /* + |-------------------------------------------------------------------------- + | Custom Validation Language Lines + |-------------------------------------------------------------------------- + | + | Here you may specify custom validation messages for attributes using the + | convention "attribute.rule" to name the lines. This makes it quick to + | specify a specific custom language line for a given attribute rule. + | + */ + + 'custom' => [ + 'attribute-name' => [ + 'rule-name' => 'Pasirinktinis pranešimas', + ], + 'invalid_currency' => ':Attribute kodas neteisingas.', + ], + + /* + |-------------------------------------------------------------------------- + | Custom Validation Attributes + |-------------------------------------------------------------------------- + | + | The following language lines are used to swap attribute place-holders + | with something more reader friendly such as E-Mail Address instead + | of "email". This simply helps us make messages a little cleaner. + | + */ + + 'attributes' => [], + +]; diff --git a/resources/views/banking/reconciliations/index.blade.php b/resources/views/banking/reconciliations/index.blade.php index 2d23ab81f..78de5b513 100644 --- a/resources/views/banking/reconciliations/index.blade.php +++ b/resources/views/banking/reconciliations/index.blade.php @@ -31,7 +31,7 @@ - + diff --git a/resources/views/layouts/wizard.blade.php b/resources/views/layouts/wizard.blade.php new file mode 100644 index 000000000..278b51d48 --- /dev/null +++ b/resources/views/layouts/wizard.blade.php @@ -0,0 +1,20 @@ + + @include('partials.wizard.head') + + + @stack('body_start') + + +
+ @include('partials.wizard.content') +
+ + @stack('body_end') + + + + diff --git a/resources/views/partials/wizard/content.blade.php b/resources/views/partials/wizard/content.blade.php new file mode 100644 index 000000000..4abf0d968 --- /dev/null +++ b/resources/views/partials/wizard/content.blade.php @@ -0,0 +1,39 @@ +@stack('content_start') + + +
+ @stack('content_wrapper_start') + + +
+ @stack('content_header_start') + +

+ @yield('title') + @yield('new_button') +

+ + @stack('content_header_end') +
+ + +
+ @include('flash::message') + + @stack('content_content_start') + + @yield('content') + + @stack('content_content_end') +
+ + + @stack('content_wrapper_end') +
+ + + + +@stack('content_end') \ No newline at end of file diff --git a/resources/views/partials/wizard/head.blade.php b/resources/views/partials/wizard/head.blade.php new file mode 100644 index 000000000..594a1c98c --- /dev/null +++ b/resources/views/partials/wizard/head.blade.php @@ -0,0 +1,101 @@ + + @stack('head_start') + + + + + + + @yield('title') - @setting('general.company_name') + + + + + + + + + + + @if (setting('general.admin_theme', 'skin-green-light') == 'skin-green-light') + + @else + + + @endif + + + + + + + + + @stack('css') + + @stack('stylesheet') + + + + + + + + + + + + + + + + + + + + + + + + @stack('js') + + @stack('scripts') + + @stack('head_end') + diff --git a/resources/views/partials/wizard/pagination.blade.php b/resources/views/partials/wizard/pagination.blade.php new file mode 100644 index 000000000..395807023 --- /dev/null +++ b/resources/views/partials/wizard/pagination.blade.php @@ -0,0 +1,16 @@ +@stack('pagination_start') + +@if ($items->firstItem()) +
+ {{ trans('pagination.showing', ['first' => $items->firstItem(), 'last' => $items->lastItem(), 'total' => $items->total(), 'type' => strtolower(trans_choice('general.' . $type, 2))]) }} +
+
+ {!! $items->appends(request()->except('page'))->links() !!} +
+@else +
+ {{ trans('general.no_records') }} +
+@endif + +@stack('pagination_end') \ No newline at end of file diff --git a/resources/views/settings/settings/edit.blade.php b/resources/views/settings/settings/edit.blade.php index 8b8d99f91..37a5700bf 100644 --- a/resources/views/settings/settings/edit.blade.php +++ b/resources/views/settings/settings/edit.blade.php @@ -39,6 +39,8 @@ {{ Form::textareaGroup('company_address', trans('settings.company.address')) }} {{ Form::fileGroup('company_logo', trans('settings.company.logo')) }} + + {!! Form::hidden('wizard', null, ['id' => 'wizard']) !!}
diff --git a/resources/views/wizard/companies/edit.blade.php b/resources/views/wizard/companies/edit.blade.php new file mode 100644 index 000000000..e1d9805d5 --- /dev/null +++ b/resources/views/wizard/companies/edit.blade.php @@ -0,0 +1,131 @@ +@extends('layouts.wizard') + +@section('title', trans('general.wizard')) + +@section('content') + +
+
+
+
+
+ 1 +

{{ trans_choice('general.companies', 1) }}

+
+
+ +

{{ trans_choice('general.currencies', 2) }}

+
+
+ +

{{ trans_choice('general.taxes', 2) }}

+
+
+ +

{{ trans_choice('general.finish', 1) }}

+
+
+
+
+
+ +
+
+ + {!! Form::model($company, ['method' => 'PATCH', 'files' => true, 'url' => ['wizard/companies'], 'role' => 'form', 'class' => 'form-loading-button']) !!} + +
+

{{ trans_choice('general.companies', 1) }}

+
+ + +
+
+
+ {!! Form::label('sale_price', trans('modules.api_token'), ['class' => 'control-label']) !!} +
+ + {!! Form::text('api_token', setting('general.api_token', null), ['class' => 'form-control', 'required' => 'required', 'placeholder' => trans('general.form.enter', ['field' => trans('modules.api_token')])]) !!} +
+ {!! $errors->first('api_token', '

:message

') !!} +
+

+ {!! trans('modules.token_link') !!} +

+
+
+ + {{ Form::textGroup('company_tax_number', trans('general.tax_number'), 'percent', []) }} + + {{ Form::textGroup('company_phone', trans('settings.company.phone'), 'phone', []) }} + + {{ Form::textareaGroup('company_address', trans('settings.company.address')) }} + + {{ Form::fileGroup('company_logo', trans('settings.company.logo')) }} +
+ + + + + + {!! Form::close() !!} +
+@endsection + +@push('js') + +@endpush + +@push('css') + +@endpush + +@push('scripts') + +@endpush diff --git a/resources/views/wizard/currencies/create.blade.php b/resources/views/wizard/currencies/create.blade.php new file mode 100644 index 000000000..2dd871983 --- /dev/null +++ b/resources/views/wizard/currencies/create.blade.php @@ -0,0 +1,30 @@ +
+ + + + + + + \ No newline at end of file diff --git a/resources/views/wizard/currencies/edit.blade.php b/resources/views/wizard/currencies/edit.blade.php new file mode 100644 index 000000000..ad169fa8f --- /dev/null +++ b/resources/views/wizard/currencies/edit.blade.php @@ -0,0 +1,32 @@ + + + + + + + + \ No newline at end of file diff --git a/resources/views/wizard/currencies/index.blade.php b/resources/views/wizard/currencies/index.blade.php new file mode 100644 index 000000000..6e2b754d1 --- /dev/null +++ b/resources/views/wizard/currencies/index.blade.php @@ -0,0 +1,379 @@ +@extends('layouts.wizard') + +@section('title', trans('general.wizard')) + +@section('content') + +
+
+
+
+
+ 1 +

{{ trans_choice('general.companies', 1) }}

+
+
+ 2 +

{{ trans_choice('general.currencies', 2) }}

+
+
+ +

{{ trans_choice('general.taxes', 2) }}

+
+
+ +

{{ trans_choice('general.finish', 1) }}

+
+
+
+
+
+ +
+
+ +
+

{{ trans_choice('general.currencies', 2) }}

+  {{ trans('general.add_new') }} +
+ + +
+
+
@sortablelink('created_at', trans('general.create_date'))@sortablelink('created_at', trans('general.created_date')) @sortablelink('account_id', trans_choice('general.accounts', 1)) @sortablelink('closing_balance', trans('reconciliations.closing_balance'))
+ {{ Form::textGroup('name', trans('general.name'), 'id-card-o', ['required' => 'required'], null, '') }} + + {{ Form::textGroup('rate', trans('currencies.rate'), 'money', ['required' => 'required'], null, '') }} + + {!! Form::button('', ['type' => 'button', 'class' => 'btn btn-success currency-submit', 'data-loading-text' => trans('general.loading'), 'data-href' => url('wizard/currencies/'), 'style' => 'padding: 9px 14px; margin-top: 10px;']) !!} +
+ {{ Form::textGroup('name', trans('general.name'), 'id-card-o', [], $item->name, '') }} + + {{ Form::textGroup('rate', trans('currencies.rate'), 'money', [], $item->rate, '') }} + + {!! Form::button('', ['type' => 'button', 'class' => 'btn btn-success currency-updated', 'data-loading-text' => trans('general.loading'), 'data-href' => url('wizard/currencies/' . $item->id), 'style' => 'padding: 9px 14px; margin-top: 10px;']) !!} +
+ + + + + + + + + + + @foreach($currencies as $item) + + + + + + + + @endforeach + +
@sortablelink('name', trans('general.name'))@sortablelink('rate', trans('currencies.rate')){{ trans('general.actions') }}
{{ $item->name }}{{ $item->rate }} +
+ + +
+
+ + + + + + + +@endsection + +@push('scripts') + +@endpush diff --git a/resources/views/wizard/finish/index.blade.php b/resources/views/wizard/finish/index.blade.php new file mode 100644 index 000000000..fc3e9a26b --- /dev/null +++ b/resources/views/wizard/finish/index.blade.php @@ -0,0 +1,88 @@ +@extends('layouts.wizard') + +@section('title', trans('general.wizard')) + +@section('content') + +
+
+
+
+
+ 1 +

{{ trans_choice('general.companies', 1) }}

+
+
+ 2 +

{{ trans_choice('general.currencies', 2) }}

+
+
+ 3 +

{{ trans_choice('general.taxes', 2) }}

+
+
+ 4 +

{{ trans_choice('general.finish', 1) }}

+
+
+
+
+
+ +
+
+  {{ trans('general.go_to', ['name' => trans('general.dashboard')]) }} +
+
+ +
+
+
+

{{ trans('modules.recommended_apps') }}

+
+ + @if ($modules) + @foreach ($modules->data as $module) + @include('partials.modules.item') + @endforeach +
+ +
+ @else +
+
+

+ {{ trans('modules.no_apps') }} +

+

+ {!! trans('modules.developer') !!} +

+
+ +
+ @endif +
+
+@endsection + +@push('css') + +@endpush + +@push('scripts') + +@endpush diff --git a/resources/views/wizard/taxes/create.blade.php b/resources/views/wizard/taxes/create.blade.php new file mode 100644 index 000000000..893cf5658 --- /dev/null +++ b/resources/views/wizard/taxes/create.blade.php @@ -0,0 +1,14 @@ + + + {{ Form::textGroup('name', trans('general.name'), 'id-card-o', ['required' => 'required'], null, '') }} + + + {{ Form::textGroup('rate', trans('currencies.rate'), 'money', ['required' => 'required'], null, '') }} + + + {{ Form::radioGroup('enabled', trans('general.enabled'), trans('general.yes'), trans('general.no'), [], 'col-md-12 tax-enabled-radio-group') }} + + + {!! Form::button('', ['type' => 'button', 'class' => 'btn btn-success tax-submit', 'data-loading-text' => trans('general.loading'), 'data-href' => url('wizard/taxes'), 'style' => 'padding: 9px 14px; margin-top: 10px;']) !!} + + \ No newline at end of file diff --git a/resources/views/wizard/taxes/edit.blade.php b/resources/views/wizard/taxes/edit.blade.php new file mode 100644 index 000000000..dda141058 --- /dev/null +++ b/resources/views/wizard/taxes/edit.blade.php @@ -0,0 +1,14 @@ + + + {{ Form::textGroup('name', trans('general.name'), 'id-card-o', ['required' => 'required'], $item->name, '') }} + + + {{ Form::textGroup('rate', trans('currencies.rate'), 'money', ['required' => 'required'], $item->rate, '') }} + + + {{ Form::radioGroup('enabled', trans('general.enabled'), trans('general.yes'), trans('general.no'), [], 'col-md-12') }} + + + {!! Form::button('', ['type' => 'button', 'class' => 'btn btn-success tax-updated', 'data-loading-text' => trans('general.loading'), 'data-href' => url('wizard/taxes/' . $item->id), 'style' => 'padding: 9px 14px; margin-top: 10px;']) !!} + + \ No newline at end of file diff --git a/resources/views/wizard/taxes/index.blade.php b/resources/views/wizard/taxes/index.blade.php new file mode 100644 index 000000000..064e1fbbd --- /dev/null +++ b/resources/views/wizard/taxes/index.blade.php @@ -0,0 +1,377 @@ +@extends('layouts.wizard') + +@section('title', trans('general.wizard')) + +@section('content') + +
+
+
+
+
+ 1 +

{{ trans_choice('general.companies', 1) }}

+
+
+ 2 +

{{ trans_choice('general.currencies', 2) }}

+
+
+ 3 +

{{ trans_choice('general.taxes', 2) }}

+
+
+ +

{{ trans_choice('general.finish', 1) }}

+
+
+
+
+
+ +
+
+ +
+

{{ trans_choice('general.taxes', 2) }}

+  {{ trans('general.add_new') }} +
+ + +
+
+ + + + + + + + + + + @foreach($taxes as $item) + + + + + + + @endforeach + +
@sortablelink('name', trans('general.name'))@sortablelink('rate', trans('taxes.rate_percent')){{ trans('general.actions') }}
{{ $item->name }}{{ $item->rate }} +
+ + +
+
+
+
+ + + + + +
+@endsection + +@push('scripts') + +@endpush diff --git a/routes/web.php b/routes/web.php index bfd43df77..5ca0de267 100644 --- a/routes/web.php +++ b/routes/web.php @@ -7,6 +7,34 @@ Route::group(['middleware' => 'language'], function () { Route::get('{id}/download', 'Common\Uploads@download'); }); + Route::group(['middleware' => 'permission:read-admin-panel'], function () { + Route::group(['prefix' => 'wizard'], function () { + Route::get('/', 'Wizard\Companies@edit')->name('wizard.index'); + Route::get('companies', 'Wizard\Companies@edit')->name('wizard.companies.edit'); + Route::patch('companies', 'Wizard\Companies@update')->name('wizard.companies.update'); + + Route::get('currencies', 'Wizard\Currencies@index')->name('wizard.currencies.index'); + Route::get('currencies/create', 'Wizard\Currencies@create')->name('wizard.currencies.create'); + Route::get('currencies/{currency}/edit', 'Wizard\Currencies@edit')->name('wizard.currencies.edit'); + Route::get('currencies/{currency}/enable', 'Wizard\Currencies@enable')->name('wizard.currencies.enable'); + Route::get('currencies/{currency}/disable', 'Wizard\Currencies@disable')->name('wizard.currencies.disable'); + Route::get('currencies/{currency}/delete', 'Wizard\Currencies@destroy')->name('wizard.currencies.delete'); + Route::post('currencies', 'Wizard\Currencies@store')->name('wizard.currencies.store'); + Route::patch('currencies/{currency}', 'Wizard\Currencies@update')->name('wizard.currencies.update'); + + Route::get('taxes', 'Wizard\Taxes@index')->name('wizard.taxes.index'); + Route::get('taxes/create', 'Wizard\Taxes@create')->name('wizard.taxes.create'); + Route::get('taxes/{tax}/edit', 'Wizard\Taxes@edit')->name('wizard.taxes.edit'); + Route::get('taxes/{tax}/enable', 'Wizard\Taxes@enable')->name('wizard.taxes.enable'); + Route::get('taxes/{tax}/disable', 'Wizard\Taxes@disable')->name('wizard.taxes.disable'); + Route::get('taxes/{tax}/delete', 'Wizard\Taxes@destroy')->name('wizard.taxes.delete'); + Route::post('taxes', 'Wizard\Taxes@store')->name('wizard.taxes.store'); + Route::patch('taxes/{tax}', 'Wizard\Taxes@update')->name('wizard.taxes.upadate'); + + Route::get('finish', 'Wizard\Finish@index')->name('wizard.finish.index'); + }); + }); + Route::group(['middleware' => ['adminmenu', 'permission:read-admin-panel']], function () { Route::get('/', 'Common\Dashboard@index'); diff --git a/tests/Feature/Expenses/BillsTest.php b/tests/Feature/Expenses/BillsTest.php new file mode 100644 index 000000000..dc5008c0c --- /dev/null +++ b/tests/Feature/Expenses/BillsTest.php @@ -0,0 +1,124 @@ +loginAs() + ->get(route('bills.index')) + ->assertStatus(200) + ->assertSeeText(trans_choice('general.bills', 2)); + } + + public function testItShouldSeeBillCreatePage() + { + $this->loginAs() + ->get(route('bills.create')) + ->assertStatus(200) + ->assertSeeText(trans('general.title.new', ['type' => trans_choice('general.bills', 1)])); + } + + public function testItShouldCreateBill() + { + $this->loginAs() + ->post(route('bills.store'), $this->getBillRequest()) + ->assertStatus(302) + ->assertRedirect(route('bills.show', ['bill' => 1])); + + $this->assertFlashLevel('success'); + } + + public function testItShouldCreateBillWithRecurring() + { + $this->loginAs() + ->post(route('bills.store'), $this->getBillRequest(1)) + ->assertStatus(302) + ->assertRedirect(route('bills.show', ['bill' => 1])); + + $this->assertFlashLevel('success'); + } + + public function testItShouldSeeBillUpdatePage() + { + $bill = Bill::create($this->getBillRequest()); + $this->loginAs() + ->get(route('bills.edit', ['bill' => $bill->id])) + ->assertStatus(200) + ->assertSee($bill->vendor_name) + ->assertSee($bill->vendor_email); + } + + public function testItShouldUpdateBill() + { + $request = $this->getBillRequest(); + + $bill = Bill::create($request); + + $request['vendor_name'] = $this->faker->name; + + $this->loginAs() + ->patch(route('bills.update', $bill->id), $request) + ->assertStatus(302); + + $this->assertFlashLevel('success'); + } + + public function testItShouldDeleteBill() + { + $bill = Bill::create($this->getBillRequest()); + + $this->loginAs() + ->delete(route('bills.destroy', $bill->id)) + ->assertStatus(302) + ->assertRedirect(route('bills.index')); + + $this->assertFlashLevel('success'); + + } + + private function getBillRequest($recurring = 0) + { + $amount = $this->faker->randomFloat(2, 2); + + $items = [['name' => 'urun', 'item_id' => null, 'quantity' => '1', 'price' => $amount, 'currency' => 'USD', 'tax_id' => null]]; + + $data = [ + 'vendor_id' => '0', + 'billed_at' => $this->faker->date(), + 'due_at' => $this->faker->date(), + 'bill_number' => '1', + 'order_number' => '1', + 'currency_code' => setting('general.default_currency'), + 'currency_rate' => '1', + 'item' => $items, + 'discount' => '0', + 'notes' => $this->faker->text(5), + 'category_id' => $this->company->categories()->type('expense')->first()->id, + 'recurring_frequency' => 'no', + 'vendor_name' => $this->faker->name, + 'vendor_email' =>$this->faker->email, + 'vendor_tax_number' => null, + 'vendor_phone' => null, + 'vendor_address' => $this->faker->address, + 'bill_status_code' => 'draft', + 'amount' => $amount, + 'company_id' => $this->company->id, + ]; + + if ($recurring) { + $data['recurring_frequency'] = 'yes'; + $data['recurring_interval'] = '1'; + $data['recurring_custom_frequency'] = $this->faker->randomElement(['monthly', 'weekly']); + $data['recurring_count'] = '1'; + } + + return $data; + } +} \ No newline at end of file