mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 12:12:48 +01:00
Merge branch 'master' of https://github.com/turbo124/invoiceninja
This commit is contained in:
commit
a612dcde86
@ -26,7 +26,6 @@ The self-host zip includes all third party libraries whereas downloading the cod
|
||||
* [StackOverflow](https://stackoverflow.com/tags/invoice-ninja/)
|
||||
|
||||
## Referral Program
|
||||
* Earn 50% of Pro & Enterprise Plans up to 4 years - [Learn more](https://www.invoiceninja.com/referral-program/)
|
||||
|
||||
## Mobile App
|
||||
* [iPhone](https://itunes.apple.com/us/app/invoice-ninja/id1435514417?ls=1&mt=8)
|
||||
|
@ -361,7 +361,7 @@ if (! defined('APP_NAME')) {
|
||||
define('NINJA_APP_URL', env('NINJA_APP_URL', 'https://app.invoiceninja.com'));
|
||||
define('NINJA_DOCS_URL', env('NINJA_DOCS_URL', 'https://invoice-ninja.readthedocs.io/en/latest'));
|
||||
define('NINJA_DATE', '2000-01-01');
|
||||
define('NINJA_VERSION', '4.5.46' . env('NINJA_VERSION_SUFFIX'));
|
||||
define('NINJA_VERSION', '4.5.49' . env('NINJA_VERSION_SUFFIX'));
|
||||
define('NINJA_TERMS_VERSION', '1.0.1');
|
||||
|
||||
define('SOCIAL_LINK_FACEBOOK', env('SOCIAL_LINK_FACEBOOK', 'https://www.facebook.com/invoiceninja'));
|
||||
|
@ -140,7 +140,7 @@ class ClientPortalController extends BaseController
|
||||
$paymentURL = '';
|
||||
if (count($paymentTypes) == 1) {
|
||||
$paymentURL = $paymentTypes[0]['url'];
|
||||
if (in_array($paymentTypes[0]['gatewayTypeId'], [GATEWAY_TYPE_CUSTOM1, GATEWAY_TYPE_CUSTOM2, GATEWAY_TYPE_CUSTOM3])) {
|
||||
if (array_key_exists('gatewayTypeId', $paymentTypes[0]) && in_array($paymentTypes[0]['gatewayTypeId'], [GATEWAY_TYPE_CUSTOM1, GATEWAY_TYPE_CUSTOM2, GATEWAY_TYPE_CUSTOM3])) {
|
||||
// do nothing
|
||||
} elseif (! $account->isGatewayConfigured(GATEWAY_PAYPAL_EXPRESS)) {
|
||||
$paymentURL = URL::to($paymentURL);
|
||||
@ -162,6 +162,11 @@ class ClientPortalController extends BaseController
|
||||
$showApprove = false;
|
||||
}
|
||||
|
||||
$gatewayTypeIdCast = false;
|
||||
|
||||
if(count($paymentTypes) >= 1 && array_key_exists('gatewayTypeId', $paymentTypes[0]))
|
||||
$gatewayTypeIdCast = $paymentTypes[0]['gatewayTypeId'];
|
||||
|
||||
$data += [
|
||||
'account' => $account,
|
||||
'showApprove' => $showApprove,
|
||||
@ -173,7 +178,7 @@ class ClientPortalController extends BaseController
|
||||
'paymentTypes' => $paymentTypes,
|
||||
'paymentURL' => $paymentURL,
|
||||
'phantomjs' => Request::has('phantomjs'),
|
||||
'gatewayTypeId' => count($paymentTypes) == 1 ? $paymentTypes[0]['gatewayTypeId'] : false,
|
||||
'gatewayTypeId' => count($paymentTypes) == 1 ? $gatewayTypeIdCast : false,
|
||||
];
|
||||
|
||||
if ($invoice->canBePaid()) {
|
||||
|
@ -25,9 +25,9 @@ use App\Services\RecurringInvoiceService;
|
||||
use Auth;
|
||||
use Cache;
|
||||
use DB;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Redirect;
|
||||
use Request;
|
||||
use Session;
|
||||
use URL;
|
||||
use Utils;
|
||||
use View;
|
||||
@ -427,7 +427,7 @@ class InvoiceController extends BaseController
|
||||
$response = $this->emailRecurringInvoice($invoice);
|
||||
} else {
|
||||
$userId = Auth::user()->id;
|
||||
$this->dispatch(new SendInvoiceEmail($invoice, $userId, $reminder, $template));
|
||||
dispatch(new SendInvoiceEmail($invoice, $userId, $reminder, $template));
|
||||
$response = true;
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ class StepsController extends BaseController
|
||||
|
||||
$body = [
|
||||
'account_key' => $account->account_key,
|
||||
'email' => \Auth::user()->email,
|
||||
'email' => $account->getPrimaryUser()->email,
|
||||
'plan' => $account->company->plan,
|
||||
'plan_term' =>$account->company->plan_term,
|
||||
'plan_started' =>$account->company->plan_started,
|
||||
|
@ -21,7 +21,7 @@ class SendInvoiceEmail extends Job implements ShouldQueue
|
||||
/**
|
||||
* @var Invoice
|
||||
*/
|
||||
protected $invoice;
|
||||
public $invoice;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
|
@ -2,51 +2,53 @@
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Models\Traits\SerialisesDeletedModels;
|
||||
use App\Models\User;
|
||||
use App\Ninja\Mailers\UserMailer;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use App\Models\Traits\SerialisesDeletedModels;
|
||||
|
||||
/**
|
||||
* Class SendInvoiceEmail.
|
||||
*/
|
||||
class SendNotificationEmail extends Job implements ShouldQueue
|
||||
{
|
||||
use InteractsWithQueue, SerializesModels, SerialisesDeletedModels {
|
||||
SerialisesDeletedModels::getRestoredPropertyValue insteadof SerializesModels;
|
||||
}
|
||||
use InteractsWithQueue;
|
||||
|
||||
public $deleteWhenMissingModels = true;
|
||||
|
||||
/**
|
||||
* @var User
|
||||
*/
|
||||
protected $user;
|
||||
public User $user;
|
||||
|
||||
/**
|
||||
* @var Invoice
|
||||
*/
|
||||
protected $invoice;
|
||||
public Invoice $invoice;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $type;
|
||||
public $type;
|
||||
|
||||
/**
|
||||
* @var Payment
|
||||
*/
|
||||
protected $payment;
|
||||
public ?Payment $payment;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $notes;
|
||||
public $notes;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $server;
|
||||
public $server;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
@ -59,7 +61,7 @@ class SendNotificationEmail extends Job implements ShouldQueue
|
||||
* @param mixed $type
|
||||
* @param mixed $payment
|
||||
*/
|
||||
public function __construct($user, $invoice, $type, $payment, $notes)
|
||||
public function __construct(User $user, Invoice $invoice, $type, ?Payment $payment, $notes)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->invoice = $invoice;
|
||||
|
@ -1,17 +1,20 @@
|
||||
<?php namespace App\Listeners;
|
||||
<?php
|
||||
|
||||
namespace App\Listeners;
|
||||
|
||||
use App\Ninja\Mailers\UserMailer;
|
||||
use App\Ninja\Mailers\ContactMailer;
|
||||
use App\Events\InvoiceWasEmailed;
|
||||
use App\Events\QuoteWasEmailed;
|
||||
use App\Events\InvoiceInvitationWasViewed;
|
||||
use App\Events\QuoteInvitationWasViewed;
|
||||
use App\Events\QuoteInvitationWasApproved;
|
||||
use App\Events\InvoiceWasEmailed;
|
||||
use App\Events\PaymentWasCreated;
|
||||
use App\Services\PushService;
|
||||
use App\Events\QuoteInvitationWasApproved;
|
||||
use App\Events\QuoteInvitationWasViewed;
|
||||
use App\Events\QuoteWasEmailed;
|
||||
use App\Jobs\SendNotificationEmail;
|
||||
use App\Jobs\SendPaymentEmail;
|
||||
use App\Models\Invoice;
|
||||
use App\Ninja\Mailers\ContactMailer;
|
||||
use App\Ninja\Mailers\UserMailer;
|
||||
use App\Notifications\PaymentCreated;
|
||||
use App\Services\PushService;
|
||||
|
||||
/**
|
||||
* Class NotificationListener
|
||||
@ -49,7 +52,7 @@ class NotificationListener
|
||||
* @param $type
|
||||
* @param null $payment
|
||||
*/
|
||||
private function sendNotifications($invoice, $type, $payment = null, $notes = false)
|
||||
private function sendNotifications(Invoice $invoice, $type, $payment = null, $notes = false)
|
||||
{
|
||||
foreach ($invoice->account->users as $user)
|
||||
{
|
||||
|
@ -73,7 +73,7 @@ class UserMailer extends Mailer
|
||||
User $user,
|
||||
Invoice $invoice,
|
||||
$notificationType,
|
||||
Payment $payment = null,
|
||||
?Payment $payment,
|
||||
$notes = false
|
||||
) {
|
||||
if (! $user->shouldNotify($invoice)) {
|
||||
|
@ -33,7 +33,7 @@ class PaymentCreated extends Notification implements ShouldQueue
|
||||
*/
|
||||
public function via($notifiable)
|
||||
{
|
||||
return ['slack'];
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -206,7 +206,6 @@ trait GenerateMigrationResources
|
||||
'client_number_pattern' => $this->account->client_number_pattern ?: '',
|
||||
'payment_number_pattern' => '',
|
||||
'payment_number_counter' => 0,
|
||||
'payment_terms' => $this->account->payment_terms ?: '',
|
||||
'reset_counter_frequency_id' => $this->account->reset_counter_frequency_id ? (string) $this->transformFrequencyId
|
||||
($this->account->reset_counter_frequency_id) : '0',
|
||||
'payment_type_id' => $this->account->payment_type_id ? (string) $this->transformPaymentType($this->account->payment_type_id) : '1',
|
||||
@ -800,8 +799,8 @@ trait GenerateMigrationResources
|
||||
'due_date_days' => $this->transformDueDate($invoice),
|
||||
'remaining_cycles' => $this->getRemainingCycles($invoice),
|
||||
'invitations' => $this->getResourceInvitations($invoice->invitations, 'recurring_invoice_id'),
|
||||
'auto_bill_enabled' => $this->calcAutoBillEnabled($invoice),
|
||||
'auto_bill' => $this->calcAutoBill($invoice),
|
||||
'auto_bill_enabled' => $this->calcAutoBill($invoice),
|
||||
'auto_bill' => $this->calcAutoBillEnabled($invoice),
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ author = u'Invoice Ninja'
|
||||
# The short X.Y version.
|
||||
version = u'4.5'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = u'4.5.46'
|
||||
release = u'4.5.49'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
@ -34,7 +34,7 @@ require __DIR__.'/../bootstrap/autoload.php';
|
||||
|
||||
$app = require_once __DIR__.'/../bootstrap/app.php';
|
||||
|
||||
require_once __DIR__.'/../app/Constants.php';
|
||||
// require_once __DIR__.'/../app/Constants.php';
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Run The Application
|
||||
|
@ -79,11 +79,6 @@
|
||||
$referralCounts['pro'] . ' ' . trans('texts.pro') .
|
||||
'<a href="'.REFERRAL_PROGRAM_URL.'" target="_blank" title="'.trans('texts.learn_more').'">' . Icon::create('question-sign') . '</a> ')
|
||||
->value(NINJA_APP_URL . '/invoice_now?rc=' . $user->referral_code) !!}
|
||||
@else
|
||||
{!! Former::checkbox('referral_code')
|
||||
->help(trans('texts.referral_code_help'))
|
||||
->text(trans('texts.enable') . ' <a href="'.REFERRAL_PROGRAM_URL.'" target="_blank" title="'.trans('texts.learn_more').'">' . Icon::create('question-sign') . '</a>')
|
||||
->value(1) !!}
|
||||
@endif
|
||||
@endif
|
||||
|
||||
|
@ -412,4 +412,4 @@ if (Utils::isNinjaDev())
|
||||
*/
|
||||
|
||||
// Include static app constants
|
||||
// require_once app_path() . '/Constants.php';
|
||||
require_once app_path() . '/Constants.php';
|
||||
|
Loading…
Reference in New Issue
Block a user