diff --git a/.babelrc b/.babelrc new file mode 100644 index 000000000000..3208a6824bd2 --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "plugins": ["@babel/plugin-proposal-class-properties"] +} diff --git a/codacy.yml b/.codacy.yml similarity index 100% rename from codacy.yml rename to .codacy.yml diff --git a/.env.example b/.env.example index a9c2da28c840..2d5ec6c28f81 100644 --- a/.env.example +++ b/.env.example @@ -43,6 +43,7 @@ MAIL_FROM_ADDRESS='user@example.com' MAIL_FROM_NAME='Self Hosted User' POSTMARK_API_TOKEN= +REQUIRE_HTTPS=true GOOGLE_MAPS_API_KEY= API_SECRET=superdoopersecrethere diff --git a/.gitignore b/.gitignore index 2471b6f64436..c6c7e22a3f38 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,5 @@ local_version.txt # Ignore local migrations storage/migrations nbproject -/composer.lock .php_cs.cache \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index d0cb5a51be99..820da341e26c 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,6 @@ { "semi": true, "singleQuote": true, - "trailingComma": "es5" + "trailingComma": "es5", + "arrowParens": "always" } diff --git a/README.md b/README.md index f0776a9ae2bb..6e333aa72af8 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ npm i npm run production ``` -Please Note: Your APP_KEY in the .env file is used to encrypt data, if you loose this you will not be able to run the application. +Please Note: Your APP_KEY in the .env file is used to encrypt data, if you lose this you will not be able to run the application. Run if you want to load sample data, remember to configure .env ``` diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index e347c735c9ef..839f7f562e36 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -299,7 +299,7 @@ class CheckData extends Command $ledger = CompanyLedger::where('client_id', $client->id)->orderBy('id', 'DESC')->first(); - if($ledger && $invoice_balance != $client->balance) + if($ledger && number_format($invoice_balance, 4) != number_format($client->balance, 4)) { $wrong_balances++; $this->logMessage($client->present()->name . " - " . $client->id . " - balances do not match {$invoice_balance} - {$client->balance} - {$ledger->balance}"); diff --git a/app/Console/Commands/CreateTestData.php b/app/Console/Commands/CreateTestData.php index 7b79178e2bab..675a00f36019 100644 --- a/app/Console/Commands/CreateTestData.php +++ b/app/Console/Commands/CreateTestData.php @@ -25,6 +25,7 @@ use App\Models\PaymentType; use App\Models\Product; use App\Models\User; use App\Repositories\InvoiceRepository; +use App\Utils\Traits\GeneratesCounter; use App\Utils\Traits\MakesHash; use Carbon\Carbon; use Faker\Factory; @@ -35,7 +36,7 @@ use Illuminate\Support\Str; class CreateTestData extends Command { - use MakesHash; + use MakesHash, GeneratesCounter; /** * @var string */ @@ -233,7 +234,7 @@ class CreateTestData extends Command $this->createClient($company, $user); } - for($x=0; $x<$this->count; $x++) + for($x=0; $x<$this->count*100; $x++) { $client = $company->clients->random(); @@ -314,7 +315,7 @@ class CreateTestData extends Command ]); - factory(\App\Models\Product::class, 50)->create([ + factory(\App\Models\Product::class, 15000)->create([ 'user_id' => $user->id, 'company_id' => $company->id, ]); @@ -324,7 +325,7 @@ class CreateTestData extends Command $this->info('Creating '.$this->count. ' clients'); - for ($x=0; $x<$this->count; $x++) { + for ($x=0; $x<$this->count*1000; $x++) { $z = $x+1; $this->info("Creating client # ".$z); @@ -393,6 +394,10 @@ class CreateTestData extends Command 'client_id' => $client->id, 'company_id' => $company->id ]); + + $client->id_number = $this->getNextClientNumber($client); + $client->save(); + } private function createExpense($client) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index b1cc83ebc56b..c6f9ab71ff2a 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -13,6 +13,7 @@ namespace App\Console; use App\Jobs\Cron\RecurringInvoicesCron; use App\Jobs\Ninja\AdjustEmailQuota; +use App\Jobs\Ninja\CheckDbStatus; use App\Jobs\Util\ReminderJob; use App\Jobs\Util\SendFailedEmails; use App\Jobs\Util\UpdateExchangeRates; @@ -52,6 +53,7 @@ class Kernel extends ConsoleKernel if(Ninja::isHosted()) { $schedule->job(new AdjustEmailQuota())->daily(); $schedule->job(new SendFailedEmails())->daily(); + $schedule->job(new CheckDbStatus())->everyFiveMinutes(); } /* Run queue's in shared hosting with this*/ if (Ninja::isSelfHost()) { diff --git a/app/DataMapper/CompanySettings.php b/app/DataMapper/CompanySettings.php index babe17df191e..7df564862163 100644 --- a/app/DataMapper/CompanySettings.php +++ b/app/DataMapper/CompanySettings.php @@ -33,7 +33,7 @@ class CompanySettings extends BaseSettings public $enable_client_portal_dashboard = true; //implemented public $signature_on_pdf = false; public $document_email_attachment = false; - public $send_portal_password = false; + //public $send_portal_password = false; public $portal_design_id = '1'; @@ -113,7 +113,7 @@ class CompanySettings extends BaseSettings public $invoice_terms = ''; public $quote_terms = ''; public $invoice_taxes = 0; - public $enabled_item_tax_rates = 0; + // public $enabled_item_tax_rates = 0; public $invoice_design_id = 'VolejRejNm'; public $quote_design_id = 'VolejRejNm'; public $credit_design_id = 'VolejRejNm'; @@ -274,7 +274,7 @@ class CompanySettings extends BaseSettings 'email_template_statement' => 'string', 'email_subject_statement' => 'string', 'signature_on_pdf' => 'bool', - 'send_portal_password' => 'bool', + // 'send_portal_password' => 'bool', 'quote_footer' => 'string', 'page_size' => 'string', 'font_size' => 'int', @@ -344,7 +344,7 @@ class CompanySettings extends BaseSettings 'invoice_design_id' => 'string', 'invoice_fields' => 'string', 'invoice_taxes' => 'int', - 'enabled_item_tax_rates' => 'int', + //'enabled_item_tax_rates' => 'int', 'invoice_footer' => 'string', 'invoice_labels' => 'string', 'invoice_terms' => 'string', diff --git a/app/DataMapper/FreeCompanySettings.php b/app/DataMapper/FreeCompanySettings.php index 4ec96c7bb276..9f18d759972c 100644 --- a/app/DataMapper/FreeCompanySettings.php +++ b/app/DataMapper/FreeCompanySettings.php @@ -33,7 +33,7 @@ class FreeCompanySettings extends BaseSettings public $custom_value3 = ''; public $custom_value4 = ''; public $date_format_id = ''; - public $enabled_item_tax_rates = 0; +// public $enabled_item_tax_rates = 0; public $expense_number_pattern = ''; public $expense_number_counter = 1; public $inclusive_taxes = false; diff --git a/app/Designs/Bold.php b/app/Designs/Bold.php index 472cc17cb304..68f529acb707 100644 --- a/app/Designs/Bold.php +++ b/app/Designs/Bold.php @@ -63,7 +63,7 @@ class Bold extends AbstractDesign
#$entity_number
From:
To:
$client_details$to_label:
-$from_label:
-