akaunting 3.0 (the last dance)
This commit is contained in:
@ -42,39 +42,6 @@ class Currencies extends Seeder
|
||||
'decimal_mark' => config('money.USD.decimal_mark'),
|
||||
'thousands_separator' => config('money.USD.thousands_separator'),
|
||||
],
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'name' => trans('demo.currencies.eur'),
|
||||
'code' => 'EUR',
|
||||
'rate' => '1.25',
|
||||
'precision' => config('money.EUR.precision'),
|
||||
'symbol' => config('money.EUR.symbol'),
|
||||
'symbol_first' => config('money.EUR.symbol_first'),
|
||||
'decimal_mark' => config('money.EUR.decimal_mark'),
|
||||
'thousands_separator' => config('money.EUR.thousands_separator'),
|
||||
],
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'name' => trans('demo.currencies.gbp'),
|
||||
'code' => 'GBP',
|
||||
'rate' => '1.60',
|
||||
'precision' => config('money.GBP.precision'),
|
||||
'symbol' => config('money.GBP.symbol'),
|
||||
'symbol_first' => config('money.GBP.symbol_first'),
|
||||
'decimal_mark' => config('money.GBP.decimal_mark'),
|
||||
'thousands_separator' => config('money.GBP.thousands_separator'),
|
||||
],
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'name' => trans('demo.currencies.try'),
|
||||
'code' => 'TRY',
|
||||
'rate' => '0.80',
|
||||
'precision' => config('money.TRY.precision'),
|
||||
'symbol' => config('money.TRY.symbol'),
|
||||
'symbol_first' => config('money.TRY.symbol_first'),
|
||||
'decimal_mark' => config('money.TRY.decimal_mark'),
|
||||
'thousands_separator' => config('money.TRY.thousands_separator'),
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($rows as $row) {
|
||||
|
@ -34,15 +34,13 @@ class Dashboards extends Seeder
|
||||
'company_id' => $company_id,
|
||||
'name' => trans_choice('general.dashboards', 1),
|
||||
'custom_widgets' => [
|
||||
'App\Widgets\TotalIncome',
|
||||
'App\Widgets\TotalExpenses',
|
||||
'App\Widgets\TotalProfit',
|
||||
'App\Widgets\Receivables',
|
||||
'App\Widgets\Payables',
|
||||
'App\Widgets\CashFlow',
|
||||
'App\Widgets\IncomeByCategory',
|
||||
'App\Widgets\ProfitLoss',
|
||||
'App\Widgets\ExpensesByCategory',
|
||||
'App\Widgets\AccountBalance',
|
||||
'App\Widgets\LatestIncome',
|
||||
'App\Widgets\LatestExpenses',
|
||||
'App\Widgets\BankFeeds',
|
||||
],
|
||||
'users' => $user_id,
|
||||
'created_from' => 'core::seed',
|
||||
|
@ -55,6 +55,11 @@ class EmailTemplates extends Seeder
|
||||
'class' => 'App\Notifications\Sale\Invoice',
|
||||
'name' => 'settings.email.templates.invoice_recur_admin',
|
||||
],
|
||||
[
|
||||
'alias' => 'invoice_view_admin',
|
||||
'class' => 'App\Notifications\Sale\Invoice',
|
||||
'name' => 'settings.email.templates.invoice_view_admin',
|
||||
],
|
||||
[
|
||||
'alias' => 'invoice_payment_customer',
|
||||
'class' => 'App\Notifications\Portal\PaymentReceived',
|
||||
@ -76,9 +81,14 @@ class EmailTemplates extends Seeder
|
||||
'name' => 'settings.email.templates.bill_recur_admin',
|
||||
],
|
||||
[
|
||||
'alias' => 'revenue_new_customer',
|
||||
'class' => 'App\Notifications\Sale\Revenue',
|
||||
'name' => 'settings.email.templates.revenue_new_customer',
|
||||
'alias' => 'payment_received_customer',
|
||||
'class' => 'App\Notifications\Banking\Transaction',
|
||||
'name' => 'settings.email.templates.payment_received_customer',
|
||||
],
|
||||
[
|
||||
'alias' => 'payment_made_vendor',
|
||||
'class' => 'App\Notifications\Banking\Transaction',
|
||||
'name' => 'settings.email.templates.payment_made_vendor',
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -29,9 +29,7 @@ class Permissions extends Seeder
|
||||
'admin' => [
|
||||
'admin-panel' => 'r',
|
||||
'api' => 'r',
|
||||
'auth-permissions' => 'c,r,u,d',
|
||||
'auth-profile' => 'r,u',
|
||||
'auth-roles' => 'c,r,u,d',
|
||||
'auth-users' => 'c,r,u,d',
|
||||
'banking-accounts' => 'c,r,u,d',
|
||||
'banking-reconciliations' => 'c,r,u,d',
|
||||
@ -41,17 +39,14 @@ class Permissions extends Seeder
|
||||
'common-dashboards' => 'c,r,u,d',
|
||||
'common-import' => 'c',
|
||||
'common-items' => 'c,r,u,d',
|
||||
'common-notifications' => 'c,r,u,d',
|
||||
'common-reports' => 'c,r,u,d',
|
||||
'common-search' => 'r',
|
||||
'common-uploads' => 'r,d',
|
||||
'common-widgets' => 'c,r,u,d',
|
||||
'purchases-bills' => 'c,r,u,d',
|
||||
'purchases-payments' => 'c,r,u,d',
|
||||
'purchases-vendors' => 'c,r,u,d',
|
||||
'sales-customers' => 'c,r,u,d',
|
||||
'sales-invoices' => 'c,r,u,d',
|
||||
'sales-revenues' => 'c,r,u,d',
|
||||
'install-updates' => 'r,u',
|
||||
'modules-api-key' => 'c,u',
|
||||
'modules-home' => 'r',
|
||||
@ -65,26 +60,24 @@ class Permissions extends Seeder
|
||||
'reports-profit-loss' => 'r',
|
||||
'reports-tax-summary' => 'r',
|
||||
'settings-categories' => 'c,r,u,d',
|
||||
'settings-company' => 'r',
|
||||
'settings-company' => 'r,u',
|
||||
'settings-currencies' => 'c,r,u,d',
|
||||
'settings-defaults' => 'r',
|
||||
'settings-email' => 'r',
|
||||
'settings-invoice' => 'r',
|
||||
'settings-localisation' => 'r',
|
||||
'settings-defaults' => 'r,u',
|
||||
'settings-email' => 'r,u',
|
||||
'settings-email-templates' => 'r,u',
|
||||
'settings-invoice' => 'r,u',
|
||||
'settings-localisation' => 'r,u',
|
||||
'settings-modules' => 'r,u',
|
||||
'settings-settings' => 'r,u',
|
||||
'settings-schedule' => 'r',
|
||||
'settings-schedule' => 'r,u',
|
||||
'settings-taxes' => 'c,r,u,d',
|
||||
'widgets-account-balance' => 'r',
|
||||
'widgets-bank-feeds' => 'r',
|
||||
'widgets-cash-flow' => 'r',
|
||||
'widgets-expenses-by-category' => 'r',
|
||||
'widgets-income-by-category' => 'r',
|
||||
'widgets-latest-expenses' => 'r',
|
||||
'widgets-latest-income' => 'r',
|
||||
'widgets-total-expenses' => 'r',
|
||||
'widgets-total-income' => 'r',
|
||||
'widgets-total-profit' => 'r',
|
||||
'widgets-currencies' => 'r',
|
||||
'widgets-expenses-by-category' => 'r',
|
||||
'widgets-payables' => 'r',
|
||||
'widgets-profit-loss' => 'r',
|
||||
'widgets-receivables' => 'r',
|
||||
],
|
||||
'manager' => [
|
||||
'admin-panel' => 'r',
|
||||
@ -97,17 +90,14 @@ class Permissions extends Seeder
|
||||
'common-dashboards' => 'c,r,u,d',
|
||||
'common-import' => 'c',
|
||||
'common-items' => 'c,r,u,d',
|
||||
'common-notifications' => 'c,r,u,d',
|
||||
'common-reports' => 'c,r,u,d',
|
||||
'common-search' => 'r',
|
||||
'common-uploads' => 'r',
|
||||
'common-widgets' => 'c,r,u,d',
|
||||
'purchases-bills' => 'c,r,u,d',
|
||||
'purchases-payments' => 'c,r,u,d',
|
||||
'purchases-vendors' => 'c,r,u,d',
|
||||
'sales-customers' => 'c,r,u,d',
|
||||
'sales-invoices' => 'c,r,u,d',
|
||||
'sales-revenues' => 'c,r,u,d',
|
||||
'install-updates' => 'r,u',
|
||||
'notifications' => 'r,u',
|
||||
'reports-expense-summary' => 'r',
|
||||
@ -116,33 +106,54 @@ class Permissions extends Seeder
|
||||
'reports-profit-loss' => 'r',
|
||||
'reports-tax-summary' => 'r',
|
||||
'settings-categories' => 'c,r,u,d',
|
||||
'settings-company' => 'r',
|
||||
'settings-company' => 'r,u',
|
||||
'settings-currencies' => 'c,r,u,d',
|
||||
'settings-defaults' => 'r',
|
||||
'settings-email' => 'r',
|
||||
'settings-invoice' => 'r',
|
||||
'settings-localisation' => 'r',
|
||||
'settings-defaults' => 'r,u',
|
||||
'settings-email' => 'r,u',
|
||||
'settings-email-templates' => 'r,u',
|
||||
'settings-invoice' => 'r,u',
|
||||
'settings-localisation' => 'r,u',
|
||||
'settings-modules' => 'r,u',
|
||||
'settings-settings' => 'r,u',
|
||||
'settings-schedule' => 'r',
|
||||
'settings-schedule' => 'r,u',
|
||||
'settings-taxes' => 'c,r,u,d',
|
||||
'widgets-account-balance' => 'r',
|
||||
'widgets-bank-feeds' => 'r',
|
||||
'widgets-cash-flow' => 'r',
|
||||
'widgets-expenses-by-category' => 'r',
|
||||
'widgets-income-by-category' => 'r',
|
||||
'widgets-latest-expenses' => 'r',
|
||||
'widgets-latest-income' => 'r',
|
||||
'widgets-total-expenses' => 'r',
|
||||
'widgets-total-income' => 'r',
|
||||
'widgets-total-profit' => 'r',
|
||||
'widgets-currencies' => 'r',
|
||||
'widgets-expenses-by-category' => 'r',
|
||||
'widgets-payables' => 'r',
|
||||
'widgets-profit-loss' => 'r',
|
||||
'widgets-receivables' => 'r',
|
||||
],
|
||||
'customer' => [
|
||||
'client-portal' => 'r',
|
||||
'portal-invoices' => 'r,u',
|
||||
'portal-payments' => 'r,u',
|
||||
'portal-profile' => 'r,u',
|
||||
]
|
||||
],
|
||||
'accountant' => [
|
||||
'admin-panel' => 'r',
|
||||
'api' => 'r',
|
||||
'common-dashboards' => 'r',
|
||||
'common-items' => 'r',
|
||||
'purchases-bills' => 'r',
|
||||
'purchases-vendors' => 'r',
|
||||
'sales-customers' => 'r',
|
||||
'sales-invoices' => 'r',
|
||||
'banking-accounts' => 'r',
|
||||
'banking-reconciliations' => 'r',
|
||||
'banking-transactions' => 'r',
|
||||
'banking-transfers' => 'r',
|
||||
'reports-expense-summary' => 'r',
|
||||
'reports-income-summary' => 'r',
|
||||
'reports-income-expense-summary' => 'r',
|
||||
'reports-profit-loss' => 'r',
|
||||
'reports-tax-summary' => 'r',
|
||||
'modules-home' => 'r',
|
||||
'modules-item' => 'r',
|
||||
'modules-my' => 'r',
|
||||
'modules-tiles' => 'r',
|
||||
],
|
||||
];
|
||||
|
||||
$this->attachPermissionsByRoleNames($rows);
|
||||
|
@ -33,23 +33,23 @@ class Reports extends Seeder
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'class' => 'App\Reports\IncomeSummary',
|
||||
'name' => trans('reports.summary.income'),
|
||||
'name' => trans('reports.income_summary'),
|
||||
'description' => trans('demo.reports.income'),
|
||||
'settings' => ['group' => 'category', 'period' => 'monthly', 'basis' => 'accrual', 'chart' => 'line'],
|
||||
'settings' => ['group' => 'category', 'period' => 'monthly', 'basis' => 'accrual'],
|
||||
],
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'class' => 'App\Reports\ExpenseSummary',
|
||||
'name' => trans('reports.summary.expense'),
|
||||
'name' => trans('reports.expense_summary'),
|
||||
'description' => trans('demo.reports.expense'),
|
||||
'settings' => ['group' => 'category', 'period' => 'monthly', 'basis' => 'accrual', 'chart' => 'line'],
|
||||
'settings' => ['group' => 'category', 'period' => 'monthly', 'basis' => 'accrual'],
|
||||
],
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'class' => 'App\Reports\IncomeExpenseSummary',
|
||||
'name' => trans('reports.summary.income_expense'),
|
||||
'name' => trans('reports.income_expense_summary'),
|
||||
'description' => trans('demo.reports.income_expense'),
|
||||
'settings' => ['group' => 'category', 'period' => 'monthly', 'basis' => 'accrual', 'chart' => 'line'],
|
||||
'settings' => ['group' => 'category', 'period' => 'monthly', 'basis' => 'accrual'],
|
||||
],
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
@ -61,7 +61,7 @@ class Reports extends Seeder
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'class' => 'App\Reports\TaxSummary',
|
||||
'name' => trans('reports.summary.tax'),
|
||||
'name' => trans('reports.tax_summary'),
|
||||
'description' => trans('demo.reports.tax'),
|
||||
'settings' => ['period' => 'quarterly', 'basis' => 'accrual'],
|
||||
],
|
||||
|
16
database/seeds/SampleData.php
Executable file → Normal file
16
database/seeds/SampleData.php
Executable file → Normal file
@ -27,6 +27,8 @@ class SampleData extends Seeder
|
||||
$count = (int) $this->command->option('count');
|
||||
$small_count = ($count <= 10) ? $count : 10;
|
||||
|
||||
$company = (int) $this->command->option('company');
|
||||
|
||||
$this->command->info('Creating sample data...');
|
||||
|
||||
$bar = $this->command->getOutput()->createProgressBar(7);
|
||||
@ -34,25 +36,25 @@ class SampleData extends Seeder
|
||||
|
||||
$bar->start();
|
||||
|
||||
Contact::factory()->count($count)->create();
|
||||
Contact::factory()->company($company)->count($count)->create();
|
||||
$bar->advance();
|
||||
|
||||
Category::factory()->count($count)->create();
|
||||
Category::factory()->company($company)->count($count)->create();
|
||||
$bar->advance();
|
||||
|
||||
Tax::factory()->count($small_count)->enabled()->create();
|
||||
Tax::factory()->company($company)->count($small_count)->enabled()->create();
|
||||
$bar->advance();
|
||||
|
||||
Item::factory()->count($count)->create();
|
||||
Item::factory()->company($company)->count($count)->create();
|
||||
$bar->advance();
|
||||
|
||||
Account::factory()->count($small_count)->create();
|
||||
Account::factory()->company($company)->count($small_count)->create();
|
||||
$bar->advance();
|
||||
|
||||
Document::factory()->bill()->count($count)->create();
|
||||
Document::factory()->company($company)->bill()->count($count)->create();
|
||||
$bar->advance();
|
||||
|
||||
Document::factory()->invoice()->count($count)->create();
|
||||
Document::factory()->company($company)->invoice()->count($count)->create();
|
||||
$bar->advance();
|
||||
|
||||
$bar->finish();
|
||||
|
@ -57,6 +57,9 @@ class TestCompany extends Seeder
|
||||
|
||||
$company->makeCurrent(true);
|
||||
|
||||
setting()->set('email.protocol', 'log');
|
||||
config(['mail.default' => setting('email.protocol')]);
|
||||
|
||||
$this->command->info('Test company created.');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user