Fixes for Recurring

This commit is contained in:
David Bomba 2020-10-04 21:24:55 +11:00
parent a6234da23a
commit 06b7dfa291
5 changed files with 67 additions and 59 deletions

View File

@ -16,6 +16,7 @@ use App\Events\Invoice\InvoiceWasCreated;
use App\Factory\InvoiceFactory; use App\Factory\InvoiceFactory;
use App\Factory\InvoiceItemFactory; use App\Factory\InvoiceItemFactory;
use App\Helpers\Invoice\InvoiceSum; use App\Helpers\Invoice\InvoiceSum;
use App\Jobs\Company\CreateCompanyPaymentTerms;
use App\Jobs\Ninja\CompanySizeCheck; use App\Jobs\Ninja\CompanySizeCheck;
use App\Jobs\Util\VersionCheck; use App\Jobs\Util\VersionCheck;
use App\Models\Account; use App\Models\Account;
@ -173,6 +174,8 @@ class DemoMode extends Command
]); ]);
} }
CreateCompanyPaymentTerms::dispatchNow($company, $user);
$company_token = new CompanyToken; $company_token = new CompanyToken;
$company_token->user_id = $user->id; $company_token->user_id = $user->id;
$company_token->company_id = $company->id; $company_token->company_id = $company->id;

View File

@ -33,6 +33,11 @@ class ContactKeyLogin
*/ */
public function handle($request, Closure $next) public function handle($request, Closure $next)
{ {
info($request->segment(3));
info($request->route('contact_key'));
if(Auth::guard('contact')->check())
Auth::guard('contact')->logout();
if ($request->segment(3) && config('ninja.db.multi_db_enabled')) { if ($request->segment(3) && config('ninja.db.multi_db_enabled')) {

99
composer.lock generated
View File

@ -5668,24 +5668,25 @@
}, },
{ {
"name": "sabre/uri", "name": "sabre/uri",
"version": "2.2.0", "version": "2.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sabre-io/uri.git", "url": "https://github.com/sabre-io/uri.git",
"reference": "059d11012603be2e32ddb7543602965563ddbb09" "reference": "f502edffafea8d746825bd5f0b923a60fd2715ff"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sabre-io/uri/zipball/059d11012603be2e32ddb7543602965563ddbb09", "url": "https://api.github.com/repos/sabre-io/uri/zipball/f502edffafea8d746825bd5f0b923a60fd2715ff",
"reference": "059d11012603be2e32ddb7543602965563ddbb09", "reference": "f502edffafea8d746825bd5f0b923a60fd2715ff",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1" "php": "^7.1 || ^8.0"
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "~2.16.1", "friendsofphp/php-cs-fixer": "~2.16.1",
"phpunit/phpunit": "^7 || ^8" "phpstan/phpstan": "^0.12",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -5715,7 +5716,7 @@
"uri", "uri",
"url" "url"
], ],
"time": "2020-01-31T18:53:43+00:00" "time": "2020-10-03T10:33:23+00:00"
}, },
{ {
"name": "sabre/xml", "name": "sabre/xml",
@ -6499,7 +6500,7 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
@ -6592,7 +6593,7 @@
}, },
{ {
"name": "symfony/css-selector", "name": "symfony/css-selector",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/css-selector.git", "url": "https://github.com/symfony/css-selector.git",
@ -6723,16 +6724,16 @@
}, },
{ {
"name": "symfony/error-handler", "name": "symfony/error-handler",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/error-handler.git", "url": "https://github.com/symfony/error-handler.git",
"reference": "d2f1d4996d5499f1261164d10080e4120001f041" "reference": "5e4d8ef8d71822922d1eebd130219ae3491a5ca9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/error-handler/zipball/d2f1d4996d5499f1261164d10080e4120001f041", "url": "https://api.github.com/repos/symfony/error-handler/zipball/5e4d8ef8d71822922d1eebd130219ae3491a5ca9",
"reference": "d2f1d4996d5499f1261164d10080e4120001f041", "reference": "5e4d8ef8d71822922d1eebd130219ae3491a5ca9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -6790,11 +6791,11 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-09-27T03:44:28+00:00" "time": "2020-10-02T08:49:02+00:00"
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/event-dispatcher.git", "url": "https://github.com/symfony/event-dispatcher.git",
@ -6957,16 +6958,16 @@
}, },
{ {
"name": "symfony/filesystem", "name": "symfony/filesystem",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/filesystem.git", "url": "https://github.com/symfony/filesystem.git",
"reference": "f3194303d3077829dbbc1d18f50288b2a01146f2" "reference": "1a8697545a8d87b9f2f6b1d32414199cc5e20aae"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/f3194303d3077829dbbc1d18f50288b2a01146f2", "url": "https://api.github.com/repos/symfony/filesystem/zipball/1a8697545a8d87b9f2f6b1d32414199cc5e20aae",
"reference": "f3194303d3077829dbbc1d18f50288b2a01146f2", "reference": "1a8697545a8d87b9f2f6b1d32414199cc5e20aae",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -7017,11 +7018,11 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-09-02T16:23:27+00:00" "time": "2020-09-27T14:02:37+00:00"
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/finder.git", "url": "https://github.com/symfony/finder.git",
@ -7084,16 +7085,16 @@
}, },
{ {
"name": "symfony/http-client", "name": "symfony/http-client",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/http-client.git", "url": "https://github.com/symfony/http-client.git",
"reference": "4a5f2750b54e3cfc5b6711dd78fdbac6563ee7bf" "reference": "df757997ee95101c0ca94c7ea2b76e16a758e0ca"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-client/zipball/4a5f2750b54e3cfc5b6711dd78fdbac6563ee7bf", "url": "https://api.github.com/repos/symfony/http-client/zipball/df757997ee95101c0ca94c7ea2b76e16a758e0ca",
"reference": "4a5f2750b54e3cfc5b6711dd78fdbac6563ee7bf", "reference": "df757997ee95101c0ca94c7ea2b76e16a758e0ca",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -7166,7 +7167,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-09-27T03:44:28+00:00" "time": "2020-10-02T14:24:03+00:00"
}, },
{ {
"name": "symfony/http-client-contracts", "name": "symfony/http-client-contracts",
@ -7245,16 +7246,16 @@
}, },
{ {
"name": "symfony/http-foundation", "name": "symfony/http-foundation",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/http-foundation.git", "url": "https://github.com/symfony/http-foundation.git",
"reference": "6cca6b2e4b69fc5bace160d14cf1ee5f71483db4" "reference": "353b42e7b4fd1c898aab09a059466c9cea74039b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/6cca6b2e4b69fc5bace160d14cf1ee5f71483db4", "url": "https://api.github.com/repos/symfony/http-foundation/zipball/353b42e7b4fd1c898aab09a059466c9cea74039b",
"reference": "6cca6b2e4b69fc5bace160d14cf1ee5f71483db4", "reference": "353b42e7b4fd1c898aab09a059466c9cea74039b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -7316,20 +7317,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-09-13T05:01:27+00:00" "time": "2020-09-27T14:14:57+00:00"
}, },
{ {
"name": "symfony/http-kernel", "name": "symfony/http-kernel",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/http-kernel.git", "url": "https://github.com/symfony/http-kernel.git",
"reference": "17227644c3c66dcf32bdfeceff4364d090cd6756" "reference": "1764b87d2f10d5c9ce6e4850fe27934116d89708"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/17227644c3c66dcf32bdfeceff4364d090cd6756", "url": "https://api.github.com/repos/symfony/http-kernel/zipball/1764b87d2f10d5c9ce6e4850fe27934116d89708",
"reference": "17227644c3c66dcf32bdfeceff4364d090cd6756", "reference": "1764b87d2f10d5c9ce6e4850fe27934116d89708",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -7430,11 +7431,11 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-09-27T04:33:19+00:00" "time": "2020-10-04T07:57:28+00:00"
}, },
{ {
"name": "symfony/mime", "name": "symfony/mime",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/mime.git", "url": "https://github.com/symfony/mime.git",
@ -7511,7 +7512,7 @@
}, },
{ {
"name": "symfony/options-resolver", "name": "symfony/options-resolver",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/options-resolver.git", "url": "https://github.com/symfony/options-resolver.git",
@ -8438,7 +8439,7 @@
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/process.git", "url": "https://github.com/symfony/process.git",
@ -8502,16 +8503,16 @@
}, },
{ {
"name": "symfony/routing", "name": "symfony/routing",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/routing.git", "url": "https://github.com/symfony/routing.git",
"reference": "d36e06eb02a55522a8eed070c1cbc3dc3c389876" "reference": "720348c2ae011f8c56964c0fc3e992840cb60ccf"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/d36e06eb02a55522a8eed070c1cbc3dc3c389876", "url": "https://api.github.com/repos/symfony/routing/zipball/720348c2ae011f8c56964c0fc3e992840cb60ccf",
"reference": "d36e06eb02a55522a8eed070c1cbc3dc3c389876", "reference": "720348c2ae011f8c56964c0fc3e992840cb60ccf",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -8590,7 +8591,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-09-02T16:23:27+00:00" "time": "2020-10-02T13:05:43+00:00"
}, },
{ {
"name": "symfony/service-contracts", "name": "symfony/service-contracts",
@ -8670,7 +8671,7 @@
}, },
{ {
"name": "symfony/string", "name": "symfony/string",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/string.git", "url": "https://github.com/symfony/string.git",
@ -8755,7 +8756,7 @@
}, },
{ {
"name": "symfony/translation", "name": "symfony/translation",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/translation.git", "url": "https://github.com/symfony/translation.git",
@ -8922,7 +8923,7 @@
}, },
{ {
"name": "symfony/var-dumper", "name": "symfony/var-dumper",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/var-dumper.git", "url": "https://github.com/symfony/var-dumper.git",
@ -12097,7 +12098,7 @@
}, },
{ {
"name": "symfony/debug", "name": "symfony/debug",
"version": "v4.4.14", "version": "v4.4.15",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/debug.git", "url": "https://github.com/symfony/debug.git",
@ -12168,7 +12169,7 @@
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v5.1.6", "version": "v5.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",

View File

@ -1182,19 +1182,19 @@ class CreateUsersTable extends Migration
$table->timestamps(6); $table->timestamps(6);
$table->softDeletes(); $table->softDeletes();
$table->unsignedInteger('user_id'); $table->unsignedInteger('user_id');
$table->unsignedInteger('assigned_user_id'); $table->unsignedInteger('assigned_user_id')->nullable();
$table->unsignedInteger('company_id'); $table->unsignedInteger('company_id');
$table->unsignedInteger('currency_id')->nullable(); $table->unsignedInteger('currency_id')->nullable();
$table->string('name')->nullable(); $table->string('name')->nullable();
$table->string('address1'); $table->string('address1')->nullable();
$table->string('address2'); $table->string('address2')->nullable();
$table->string('city'); $table->string('city')->nullable();
$table->string('state'); $table->string('state')->nullable();
$table->string('postal_code'); $table->string('postal_code')->nullable();
$table->unsignedInteger('country_id')->nullable(); $table->unsignedInteger('country_id')->nullable();
$table->string('work_phone'); $table->string('work_phone')->nullable();
$table->text('private_notes'); $table->text('private_notes')->nullable();
$table->string('website'); $table->string('website')->nullable();
$table->tinyInteger('is_deleted')->default(0); $table->tinyInteger('is_deleted')->default(0);
$table->string('vat_number')->nullable(); $table->string('vat_number')->nullable();
$table->string('transaction_name')->nullable(); $table->string('transaction_name')->nullable();

View File

@ -10,7 +10,6 @@
*/ */
namespace Database\Seeders; namespace Database\Seeders;
use App\Models\PaymentTerm; use App\Models\PaymentTerm;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;