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_details
@@ -76,7 +76,7 @@ class Bold extends AbstractDesign $product_table_header - + $product_table_body @@ -84,7 +84,7 @@ class Bold extends AbstractDesign $task_table_header - + $task_table_body diff --git a/app/Designs/Business.php b/app/Designs/Business.php index bf8dde055a01..3a8086cc1a1d 100644 --- a/app/Designs/Business.php +++ b/app/Designs/Business.php @@ -52,10 +52,10 @@ $custom_css
$company_logo
-
+
$company_details
-
+
$company_address
'; @@ -64,11 +64,11 @@ $custom_css public function body() { return '
-
+
$client_details
-
+
$entity_details
@@ -78,7 +78,7 @@ $custom_css $product_table_header - + $product_table_body @@ -86,7 +86,7 @@ $custom_css $task_table_header - + $task_table_body diff --git a/app/Designs/Clean.php b/app/Designs/Clean.php index 8e193c3d49a3..f3725fc2b4e7 100644 --- a/app/Designs/Clean.php +++ b/app/Designs/Clean.php @@ -48,10 +48,10 @@ class Clean extends AbstractDesign
$company_logo
-
+
$company_details
-
+
$company_address
@@ -68,13 +68,13 @@ class Clean extends AbstractDesign
-
+
$entity_labels
-
+
$entity_details
-
+
$client_details
@@ -84,7 +84,7 @@ class Clean extends AbstractDesign $product_table_header - + $product_table_body @@ -92,7 +92,7 @@ class Clean extends AbstractDesign $task_table_header - + $task_table_body diff --git a/app/Designs/Creative.php b/app/Designs/Creative.php index 880082804185..e4ad6149435d 100644 --- a/app/Designs/Creative.php +++ b/app/Designs/Creative.php @@ -60,14 +60,14 @@ $custom_css

#$entity_number

-
$entity_details
+
$entity_details
$product_table_header - + $product_table_body
@@ -75,7 +75,7 @@ $custom_css $task_table_header - + $task_table_body diff --git a/app/Designs/Designer.php b/app/Designs/Designer.php index 70feff34a623..f54986bbde6b 100644 --- a/app/Designs/Designer.php +++ b/app/Designs/Designer.php @@ -107,7 +107,7 @@ class Designer
' ; - $signature = '
'; /** @wip */ + $signature = ''; $logo = '
'; if (!$this->entity->user->account->isPaid()) { diff --git a/app/Designs/Elegant.php b/app/Designs/Elegant.php index f9e7c94e2449..94b1ff099097 100644 --- a/app/Designs/Elegant.php +++ b/app/Designs/Elegant.php @@ -47,7 +47,7 @@ class Elegant extends AbstractDesign
$company_logo
-
+
$entity_details
@@ -57,13 +57,13 @@ class Elegant extends AbstractDesign public function body() { return '
-
+
$client_details
-
+
$company_details
-
+
$company_address
@@ -71,7 +71,7 @@ class Elegant extends AbstractDesign $product_table_header - + $product_table_body @@ -79,7 +79,7 @@ class Elegant extends AbstractDesign $task_table_header - + $task_table_body diff --git a/app/Designs/Hipster.php b/app/Designs/Hipster.php index a010fb259119..b9a26ed0b658 100644 --- a/app/Designs/Hipster.php +++ b/app/Designs/Hipster.php @@ -48,15 +48,15 @@ $custom_css

From:

-
+
$company_details
-
+
$company_address
-
+

To:

$client_details
@@ -90,7 +90,7 @@ $custom_css $product_table_header - + $product_table_body @@ -98,7 +98,7 @@ $custom_css $task_table_header - + $task_table_body diff --git a/app/Designs/Modern.php b/app/Designs/Modern.php index b66f31d6e195..caff3de2e12f 100644 --- a/app/Designs/Modern.php +++ b/app/Designs/Modern.php @@ -45,10 +45,10 @@ $custom_css

$company.name

-
+
$company_details
-
+
$entity_details
@@ -64,7 +64,7 @@ $custom_css
$company_logo
-
+
$client_details
@@ -74,7 +74,7 @@ $custom_css $product_table_header - + $product_table_body @@ -82,7 +82,7 @@ $custom_css $task_table_header - + $task_table_body @@ -141,10 +141,10 @@ $custom_css return '