akaunting/database/seeds/Settings.php

81 lines
2.9 KiB
PHP
Raw Normal View History

2017-09-14 22:21:00 +03:00
<?php
namespace Database\Seeds;
2019-11-16 10:21:14 +03:00
use App\Abstracts\Model;
2017-09-14 22:21:00 +03:00
use Illuminate\Database\Seeder;
class Settings extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$this->create();
Model::reguard();
}
private function create()
{
2018-07-26 23:00:45 +03:00
$company_id = $this->command->argument('company');
2017-09-14 22:21:00 +03:00
2019-02-22 16:14:13 +03:00
setting()->setExtraColumns(['company_id' => $company_id]);
2020-01-08 17:07:18 +03:00
$offline_payments = [];
$offline_payments[] = [
'code' => 'offline-payments.cash.1',
'name' => trans('demo.offline_payments.cash'),
'customer' => '0',
'order' => '1',
'description' => null,
];
$offline_payments[] = [
'code' => 'offline-payments.bank_transfer.2',
'name' => trans('demo.offline_payments.bank'),
'customer' => '0',
'order' => '2',
'description' => null,
];
2019-02-22 16:14:13 +03:00
setting()->set([
2020-01-08 17:07:18 +03:00
'localisation.financial_start' => now()->startOfYear()->format('d-m'),
2019-11-16 10:21:14 +03:00
'localisation.timezone' => 'Europe/London',
'localisation.date_format' => 'd M Y',
'localisation.date_separator' => 'space',
'localisation.percent_position' => 'after',
'invoice.number_prefix' => 'INV-',
'invoice.number_digit' => '5',
'invoice.number_next' => '1',
'invoice.item_name' => 'settings.invoice.item',
'invoice.price_name' => 'settings.invoice.price',
'invoice.quantity_name' => 'settings.invoice.quantity',
'invoice.title' => trans_choice('general.invoices', 1),
'invoice.payment_terms' => '0',
2019-12-25 21:48:05 +03:00
'invoice.template' => 'default',
2020-01-08 17:35:52 +03:00
'invoice.color' => '#55588b',
2019-11-16 10:21:14 +03:00
'default.payment_method' => 'offline-payments.cash.1',
'default.list_limit' => '25',
'default.use_gravatar' => '0',
'email.protocol' => 'mail',
'email.sendmail_path' => '/usr/sbin/sendmail -bs',
'schedule.send_invoice_reminder' => '0',
'schedule.invoice_days' => '1,3,5,10',
'schedule.send_bill_reminder' => '0',
'schedule.bill_days' => '10,5,3,1',
'schedule.time' => '09:00',
'wizard.completed' => '0',
2020-01-08 17:07:18 +03:00
'offline-payments.methods' => json_encode($offline_payments),
2019-11-16 10:21:14 +03:00
'contact.type.customer' => 'customer',
'contact.type.vendor' => 'vendor',
2017-09-14 22:21:00 +03:00
]);
}
}