Merge upstream/v5-develop

This commit is contained in:
Benjamin Beganović 2021-03-15 13:08:43 +01:00
commit dade7bad0a
17 changed files with 35641 additions and 35373 deletions

View File

@ -1 +1 @@
5.1.24
5.1.25

View File

@ -136,7 +136,8 @@ class ConnectedAccountController extends BaseController
//$ct = CompanyUser::whereUserId(auth()->user()->id);
//return $this->listResponse($ct);
return $this->listResponse(auth()->user());
return $this->itemResponse(auth()->user());
// return $this->listResponse(auth()->user());
}
return response()

View File

@ -47,11 +47,13 @@ class TwoFactorController extends BaseController
public function enableTwoFactor()
{
$google2fa = new Google2FA();
$user = auth()->user();
$secret = request()->input('secret');
$oneTimePassword = request()->input('one_time_password');
if (! $secret || ! \Google2FA::verifyKey($secret, $oneTimePassword)) {
if (! $secret || ! $google2fa->verifyKey($secret, $oneTimePassword)) {
return response()->json('message' > ctrans('texts.invalid_one_time_password'));
} elseif (! $user->google_2fa_secret && $user->phone && $user->confirmed) {
$user->google_2fa_secret = encrypt($secret);

View File

@ -11,6 +11,7 @@
namespace App\Models;
use App\Services\BillingSubscription\BillingSubscriptionService;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
@ -53,6 +54,11 @@ class BillingSubscription extends BaseModel
'deleted_at' => 'timestamp',
];
public function service()
{
return new BillingSubscriptionService($this);
}
public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Company::class);

View File

@ -136,7 +136,7 @@ class PayPalExpressPaymentDriver extends BaseDriver
$payment = $this->createPayment($data, \App\Models\Payment::STATUS_COMPLETED);
SystemLogger::dispatch(
['response' => $response, 'data' => $data],
['response' => (array)$response->getData(), 'data' => $data],
SystemLog::CATEGORY_GATEWAY_RESPONSE,
SystemLog::EVENT_GATEWAY_SUCCESS,
SystemLog::TYPE_PAYPAL,

View File

@ -0,0 +1,43 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Services\BillingSubscription;
class BillingSubscriptionService
{
private $billing_subscription;
public function __construct(BillingSubscription $billing_subscription)
{
$this->billing_subscription = $billing_subscription;
}
public function createInvoice($payment_hash)
{
//create the invoice if necessary ie. only is a payment was actually processed
}
public function createClientSubscription($payment_hash)
{
//create the client sub record
}
public function triggerWebhook($payment_hash)
{
//hit the webhook to after a successful onboarding
}
public function fireNotifications()
{
//scan for any notification we are required to send
}
}

View File

@ -285,6 +285,8 @@ class HtmlEngine
$data['$company.website'] = ['value' => $this->settings->website ?: '&nbsp;', 'label' => ctrans('texts.website')];
$data['$company.address'] = ['value' => $this->company->present()->address($this->settings) ?: '&nbsp;', 'label' => ctrans('texts.address')];
$data['$signature'] = ['value' => $this->settings->email_signature ?: '&nbsp;', 'label' => ''];
$data['$spc_qr_code'] = ['value' => $this->company->present()->getSpcQrCode($this->client->currency()->code, $this->entity->number, $this->entity->balance), 'label' => ''];
$logo = $this->company->present()->logo($this->settings);

View File

@ -38,7 +38,7 @@
"coconutcraig/laravel-postmark": "^2.10",
"composer/composer": "^2",
"czproject/git-php": "^3.17",
"dacastro4/laravel-gmail": "dev-master",
"dacastro4/laravel-gmail": "^5.1",
"doctrine/dbal": "^2.10",
"fideloper/proxy": "^4.2",
"fzaninotto/faker": "^1.4",

739
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@ return [
'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', ''),
'app_version' => '5.1.24',
'app_version' => '5.1.25',
'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', false),

View File

@ -30,7 +30,7 @@ const RESOURCES = {
"assets/packages/material_design_icons_flutter/lib/fonts/materialdesignicons-webfont.ttf": "3e722fd57a6db80ee119f0e2c230ccff",
"assets/FontManifest.json": "cf3c681641169319e61b61bd0277378f",
"/": "23224b5e03519aaa87594403d54412cf",
"main.dart.js": "c11c4d2efa9e671a88eb792d18c2296e",
"main.dart.js": "0c23e414413fb1fc8aa4a898cd035a38",
"version.json": "b7c8971e1ab5b627fd2a4317c52b843e",
"favicon.png": "dca91c54388f52eded692718d5a98b8b"
};

70170
public/main.dart.js vendored

File diff suppressed because one or more lines are too long

View File

@ -22,10 +22,6 @@
@lang($button)
@endcomponent
@slot('signature')
{{ $signature }}
@endslot
@if(isset($whitelabel) && !$whitelabel)
@slot('footer')
@component('email.components.footer', ['url' => 'https://invoiceninja.com', 'url_text' => '&copy; InvoiceNinja'])

View File

@ -6,10 +6,12 @@
{!! $body !!}
@slot('below_card')
@if($signature)
{{ $signature }}
@endif
@endslot
@if($signature)
<br>
<br>
<p>
{{ $signature }}
</p>
@endif
@endcomponent

View File

@ -6,10 +6,12 @@
{!! $body !!}
@slot('below_card')
@if($signature)
{{ $signature }}
@endif
@endslot
@if($signature)
<br>
<br>
<p>
{{ $signature }}
</p>
@endif
@endcomponent

View File

@ -24,6 +24,13 @@
</table>
</td>
</tr>
@if($signature)
<tr>
<td>
<p>{{ $signature }}</p>
</td>
</tr>
@endif
<tr>
@isset($whitelabel)
@if(!$whitelabel)

View File

@ -20,7 +20,7 @@
-- Commands to create a MySQL database and user
CREATE SCHEMA `db-ninja-01` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'ninja'@'localhost' IDENTIFIED BY 'ninja';
GRANT ALL PRIVILEGES ON `ninja`.* TO 'ninja'@'localhost';
GRANT ALL PRIVILEGES ON `db-ninja-01`.* TO 'ninja'@'localhost';
FLUSH PRIVILEGES;
</pre>
</details>