From 962f4d4a8a2be05ddfc3e518a4b3e97c4252ec48 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 15 Nov 2023 17:49:01 +1100 Subject: [PATCH] V5.7.51 --- VERSION.txt | 2 +- .../Requests/Account/CreateAccountRequest.php | 5 +++++ app/Jobs/Util/Import.php | 18 ++++++++++++++++++ app/Models/Account.php | 14 +++++++------- config/ninja.php | 4 ++-- routes/client.php | 12 ++++++------ 6 files changed, 39 insertions(+), 16 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 4cc3a81cbf..f2d4438a11 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.7.50 \ No newline at end of file +5.7.51 \ No newline at end of file diff --git a/app/Http/Requests/Account/CreateAccountRequest.php b/app/Http/Requests/Account/CreateAccountRequest.php index 189e9a94d5..666db21ef8 100644 --- a/app/Http/Requests/Account/CreateAccountRequest.php +++ b/app/Http/Requests/Account/CreateAccountRequest.php @@ -49,6 +49,11 @@ class CreateAccountRequest extends Request 'email' => $email_rules, 'privacy_policy' => 'required|boolean', 'terms_of_service' => 'required|boolean', + 'utm_source' => 'sometimes|nullable|string', + 'utm_medium' => 'sometimes|nullable|string', + 'utm_campaign' => 'sometimes|nullable|string', + 'utm_term' => 'sometimes|nullable|string', + 'utm_content' => 'sometimes|nullable|string', ]; } diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index db4f2fe38b..1fa0d357d6 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -365,6 +365,24 @@ class Import implements ShouldQueue unset($data['plan_expires']); } } + else { + + if(isset($data['plan'])) + $account->plan = $data['plan']; + + if (isset($data['plan_term'])) + $account->plan_term = $data['plan_term']; + + if (isset($data['plan_paid'])) + $account->plan_paid = $data['plan_paid']; + + if (isset($data['plan_started'])) + $account->plan_started = $data['plan_started']; + + if (isset($data['plan_expires'])) + $account->plan_expires = $data['plan_expires']; + + } $account->fill($data); $account->save(); diff --git a/app/Models/Account.php b/app/Models/Account.php index 8bc8039a0e..439c42d80c 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -110,12 +110,13 @@ class Account extends BaseModel protected $presenter = AccountPresenter::class; protected $fillable = [ - 'plan', - 'plan_term', - 'plan_price', - 'plan_paid', - 'plan_started', - 'plan_expires', + // 'plan', + // 'plan_term', + // 'plan_price', + // 'plan_paid', + // 'plan_started', + // 'plan_expires', + // 'num_users', 'utm_source', 'utm_medium', 'utm_campaign', @@ -125,7 +126,6 @@ class Account extends BaseModel 'platform', 'set_react_as_default_ap', 'inapp_transaction_id', - 'num_users', ]; protected $casts = [ diff --git a/config/ninja.php b/config/ninja.php index ae4470c341..33f1b8dff7 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -15,8 +15,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => env('APP_VERSION','5.7.50'), - 'app_tag' => env('APP_TAG','5.7.50'), + 'app_version' => env('APP_VERSION','5.7.51'), + 'app_tag' => env('APP_TAG','5.7.51'), 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', false), diff --git a/routes/client.php b/routes/client.php index 8d2d4d1c56..61c0aeb7e6 100644 --- a/routes/client.php +++ b/routes/client.php @@ -125,12 +125,12 @@ Route::group(['middleware' => ['invite_db'], 'prefix' => 'client', 'as' => 'clie Route::get('invoice/{invitation_key}', [App\Http\Controllers\ClientPortal\InvitationController::class, 'invoiceRouter']); Route::get('quote/{invitation_key}', [App\Http\Controllers\ClientPortal\InvitationController::class, 'quoteRouter']); Route::get('credit/{invitation_key}', [App\Http\Controllers\ClientPortal\InvitationController::class, 'creditRouter']); - Route::get('recurring_invoice/{invitation_key}/download_pdf', [RecurringInvoiceController::class, 'downloadPdf'])->name('recurring_invoice.download_invitation_key')->middleware('token_auth'); - Route::get('invoice/{invitation_key}/download_pdf', [InvoiceController::class, 'downloadPdf'])->name('invoice.download_invitation_key')->middleware('token_auth'); - Route::get('invoice/{invitation_key}/download_e_invoice', [InvoiceController::class, 'downloadEInvoice'])->name('invoice.download_e_invoice')->middleware('token_auth'); - Route::get('quote/{invitation_key}/download_pdf', [QuoteController::class, 'downloadPdf'])->name('quote.download_invitation_key')->middleware('token_auth'); - Route::get('credit/{invitation_key}/download_pdf', [CreditController::class, 'downloadPdf'])->name('credit.download_invitation_key')->middleware('token_auth'); - Route::get('{entity}/{invitation_key}/download', [App\Http\Controllers\ClientPortal\InvitationController::class, 'routerForDownload'])->middleware('token_auth'); + Route::get('recurring_invoice/{invitation_key}/download_pdf', [RecurringInvoiceController::class, 'downloadPdf'])->name('recurring_invoice.download_invitation_key');//->middleware('token_auth'); + Route::get('invoice/{invitation_key}/download_pdf', [InvoiceController::class, 'downloadPdf'])->name('invoice.download_invitation_key');//->middleware('token_auth'); + Route::get('invoice/{invitation_key}/download_e_invoice', [InvoiceController::class, 'downloadEInvoice'])->name('invoice.download_e_invoice');//->middleware('token_auth'); + Route::get('quote/{invitation_key}/download_pdf', [QuoteController::class, 'downloadPdf'])->name('quote.download_invitation_key');//->middleware('token_auth'); + Route::get('credit/{invitation_key}/download_pdf', [CreditController::class, 'downloadPdf'])->name('credit.download_invitation_key');//->middleware('token_auth'); + Route::get('{entity}/{invitation_key}/download', [App\Http\Controllers\ClientPortal\InvitationController::class, 'routerForDownload']);//->middleware('token_auth'); Route::get('pay/{invitation_key}', [App\Http\Controllers\ClientPortal\InvitationController::class, 'payInvoice'])->name('pay.invoice'); Route::get('unsubscribe/{entity}/{invitation_key}', [App\Http\Controllers\ClientPortal\InvitationController::class, 'unsubscribe'])->name('unsubscribe');