mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
ba75a44eb8
* Adopt Laravel coding style The Laravel framework adopts the PSR-2 coding style with some additions. Laravel apps *should* adopt this coding style as well. However, Shift allows you to customize the adopted coding style by adding your own [PHP CS Fixer][1] `.php_cs` config to your project. You may use [Shift's .php_cs][2] file as a base. [1]: https://github.com/FriendsOfPHP/PHP-CS-Fixer [2]: https://gist.github.com/laravel-shift/cab527923ed2a109dda047b97d53c200 * Shift bindings PHP 5.5.9+ adds the new static `class` property which provides the fully qualified class name. This is preferred over using class name strings as these references are checked by the parser. * Shift core files * Shift to Throwable * Add laravel/ui dependency * Unindent vendor mail templates * Shift config files * Default config files In an effort to make upgrading the constantly changing config files easier, Shift defaulted them so you can review the commit diff for changes. Moving forward, you should use ENV variables or create a separate config file to allow the core config files to remain automatically upgradeable. * Shift Laravel dependencies * Shift cleanup * Upgrade to Laravel 7 Co-authored-by: Laravel Shift <shift@laravelshift.com>
175 lines
6.5 KiB
PHP
175 lines
6.5 KiB
PHP
<?php
|
|
/**
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
*
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
*
|
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
|
*
|
|
* @license https://opensource.org/licenses/AAL
|
|
*/
|
|
|
|
namespace App\DataMapper;
|
|
|
|
use App\DataMapper\CompanySettings;
|
|
use App\Utils\Traits\MakesHash;
|
|
|
|
/**
|
|
* FreeCompanySettings.
|
|
*/
|
|
class FreeCompanySettings extends BaseSettings
|
|
{
|
|
use MakesHash;
|
|
/*Group settings based on functionality*/
|
|
public $credit_design_id = 'VolejRejNm';
|
|
public $client_number_pattern = '';
|
|
public $client_number_counter = 1;
|
|
public $credit_number_pattern = '';
|
|
public $credit_number_counter = 1;
|
|
public $currency_id = '1';
|
|
public $custom_value1 = '';
|
|
public $custom_value2 = '';
|
|
public $custom_value3 = '';
|
|
public $custom_value4 = '';
|
|
public $date_format_id = '';
|
|
// public $enabled_item_tax_rates = 0;
|
|
public $expense_number_pattern = '';
|
|
public $expense_number_counter = 1;
|
|
public $inclusive_taxes = false;
|
|
public $invoice_design_id = 'VolejRejNm';
|
|
public $invoice_number_pattern = '';
|
|
public $invoice_number_counter = 1;
|
|
public $invoice_taxes = 0;
|
|
public $language_id = '';
|
|
public $military_time = false;
|
|
public $payment_number_pattern = '';
|
|
public $payment_number_counter = 1;
|
|
public $payment_terms = '';
|
|
public $payment_type_id = '0';
|
|
public $portal_design_id = '1';
|
|
public $quote_design_id = 'VolejRejNm';
|
|
public $quote_number_pattern = '';
|
|
public $quote_number_counter = 1;
|
|
public $timezone_id = '';
|
|
public $show_currency_code = false;
|
|
public $company_gateway_ids = '';
|
|
public $task_number_pattern = '';
|
|
public $task_number_counter = 1;
|
|
public $tax_name1 = '';
|
|
public $tax_rate1 = 0;
|
|
public $tax_name2 = '';
|
|
public $tax_rate2 = 0;
|
|
public $tax_name3 = '';
|
|
public $tax_rate3 = 0;
|
|
public $ticket_number_pattern = '';
|
|
public $ticket_number_counter = 1;
|
|
public $translations;
|
|
public $vendor_number_pattern = '';
|
|
public $vendor_number_counter = 1;
|
|
|
|
/* Company Meta data that we can use to build sub companies*/
|
|
|
|
public $address1 = '';
|
|
public $address2 = '';
|
|
public $city = '';
|
|
public $company_logo = '';
|
|
public $country_id;
|
|
public $email = '';
|
|
public $id_number = '';
|
|
public $name = '';
|
|
public $phone = '';
|
|
public $postal_code = '';
|
|
public $state = '';
|
|
public $vat_number = '';
|
|
public $website = '';
|
|
|
|
public static $casts = [
|
|
'portal_design_id' => 'string',
|
|
'currency_id' => 'string',
|
|
'task_number_pattern' => 'string',
|
|
'task_number_counter' => 'int',
|
|
'expense_number_pattern' => 'string',
|
|
'expense_number_counter' => 'int',
|
|
'vendor_number_pattern' => 'string',
|
|
'vendor_number_counter' => 'int',
|
|
'ticket_number_pattern' => 'string',
|
|
'ticket_number_counter' => 'int',
|
|
'payment_number_pattern' => 'string',
|
|
'payment_number_counter' => 'int',
|
|
'company_gateway_ids' => 'string',
|
|
'address1' => 'string',
|
|
'address2' => 'string',
|
|
'city' => 'string',
|
|
'company_logo' => 'string',
|
|
'country_id' => 'string',
|
|
'currency_id' => 'string',
|
|
'custom_value1' => 'string',
|
|
'custom_value2' => 'string',
|
|
'custom_value3' => 'string',
|
|
'custom_value4' => 'string',
|
|
'inclusive_taxes' => 'bool',
|
|
'name' => 'string',
|
|
'payment_terms' => 'string',
|
|
'payment_type_id' => 'string',
|
|
'phone' => 'string',
|
|
'postal_code' => 'string',
|
|
'quote_design_id' => 'string',
|
|
'credit_design_id' => 'string',
|
|
'recurring_number_prefix' => 'string',
|
|
'state' => 'string',
|
|
'email' => 'string',
|
|
'vat_number' => 'string',
|
|
'id_number' => 'string',
|
|
'tax_name1' => 'string',
|
|
'tax_name2' => 'string',
|
|
'tax_name3' => 'string',
|
|
'tax_rate1' => 'float',
|
|
'tax_rate2' => 'float',
|
|
'tax_rate3' => 'float',
|
|
'timezone_id' => 'string',
|
|
'date_format_id' => 'string',
|
|
'military_time' => 'bool',
|
|
'language_id' => 'string',
|
|
'show_currency_code' => 'bool',
|
|
'design' => 'string',
|
|
'website' => 'string',
|
|
];
|
|
|
|
/**
|
|
* Cast object values and return entire class
|
|
* prevents missing properties from not being returned
|
|
* and always ensure an up to date class is returned.
|
|
*
|
|
* @return \stdClass
|
|
*/
|
|
public function __construct($obj)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Provides class defaults on init.
|
|
* @return object
|
|
*/
|
|
public static function defaults():\stdClass
|
|
{
|
|
$config = json_decode(config('ninja.settings'));
|
|
|
|
$data = (object) get_class_vars(CompanySettings::class);
|
|
|
|
unset($data->casts);
|
|
unset($data->protected_fields);
|
|
|
|
$data->timezone_id = (string) config('ninja.i18n.timezone_id');
|
|
$data->currency_id = (string) config('ninja.i18n.currency_id');
|
|
$data->language_id = (string) config('ninja.i18n.language_id');
|
|
$data->payment_terms = (int) config('ninja.i18n.payment_terms');
|
|
$data->military_time = (bool) config('ninja.i18n.military_time');
|
|
$data->date_format_id = (string) config('ninja.i18n.date_format_id');
|
|
$data->country_id = (string) config('ninja.i18n.country_id');
|
|
$data->translations = (object) [];
|
|
$data->pdf_variables = (object) self::getEntityVariableDefaults();
|
|
|
|
return self::setCasts($data, self::$casts);
|
|
}
|
|
}
|