mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 01:17:30 -05:00 
			
		
		
		
	
						commit
						fdfea57665
					
				@ -1 +1 @@
 | 
			
		||||
5.3.62
 | 
			
		||||
5.3.63
 | 
			
		||||
@ -125,7 +125,7 @@ class InvitationController extends Controller
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        if (auth()->guard('contact') && ! request()->has('silent') && ! $invitation->viewed_date) {
 | 
			
		||||
        if (auth()->guard('contact')->user() && ! request()->has('silent') && ! $invitation->viewed_date) {
 | 
			
		||||
            $invitation->markViewed();
 | 
			
		||||
 | 
			
		||||
            event(new InvitationWasViewed($invitation->{$entity}, $invitation, $invitation->{$entity}->company, Ninja::eventVars()));
 | 
			
		||||
 | 
			
		||||
@ -159,6 +159,8 @@ class NinjaPlanController extends Controller
 | 
			
		||||
        $recurring_invoice->next_send_date = now()->addDays(14)->format('Y-m-d');
 | 
			
		||||
 | 
			
		||||
        $recurring_invoice->save();
 | 
			
		||||
        $recurring_invoice = $recurring_invoice->calc()->getRecurringInvoice();
 | 
			
		||||
 | 
			
		||||
        $recurring_invoice->service()->start();
 | 
			
		||||
 | 
			
		||||
        return redirect('/');
 | 
			
		||||
 | 
			
		||||
@ -123,6 +123,8 @@ class ContactKeyLogin
 | 
			
		||||
                    return redirect($this->setRedirectPath());
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        //28-02-2022 middleware should not allow this to progress as we should have redirected by this stage.
 | 
			
		||||
        abort(404, "Unable to authenticate.");
 | 
			
		||||
 | 
			
		||||
        return $next($request);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -46,6 +46,9 @@ class SetInviteDb
 | 
			
		||||
        if($entity == "pay")
 | 
			
		||||
            $entity = "invoice";
 | 
			
		||||
 | 
			
		||||
        if(!in_array($entity, ['invoice','quote','credit','recurring_invoice']))
 | 
			
		||||
            abort(404,'I could not find this resource.');
 | 
			
		||||
 | 
			
		||||
        /* Try and determine the DB from the invitation key STRING*/
 | 
			
		||||
        if (config('ninja.db.multi_db_enabled')) {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -125,7 +125,7 @@ class InvoiceTransformer extends BaseTransformer
 | 
			
		||||
						$this->getString($invoice_data, 'invoice.status')
 | 
			
		||||
					))
 | 
			
		||||
				] ?? Invoice::STATUS_SENT,
 | 
			
		||||
			'archived' => $status === 'archived',
 | 
			
		||||
			// 'archived' => $status === 'archived',
 | 
			
		||||
		];
 | 
			
		||||
 | 
			
		||||
		/* If we can't find the client, then lets try and create a client */
 | 
			
		||||
 | 
			
		||||
@ -110,13 +110,10 @@ class PaymentFailedMailer implements ShouldQueue
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        //add client payment failures here.
 | 
			
		||||
        nlog("pre client failure email");
 | 
			
		||||
 | 
			
		||||
        //
 | 
			
		||||
        if($contact = $this->client->primary_contact()->first())
 | 
			
		||||
        {
 | 
			
		||||
        
 | 
			
		||||
        nlog("inside failure");
 | 
			
		||||
 | 
			
		||||
            $mail_obj = (new ClientPaymentFailureObject($this->client, $this->error, $this->company, $this->payment_hash))->build();
 | 
			
		||||
 | 
			
		||||
            $nmo = new NinjaMailerObject;
 | 
			
		||||
 | 
			
		||||
@ -57,7 +57,6 @@ class ClientPaymentFailureObject
 | 
			
		||||
    public function build()
 | 
			
		||||
    {
 | 
			
		||||
        if(!$this->payment_hash){
 | 
			
		||||
            nlog("no payment has for failure notification - ClientPaymentFailureObject");
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -124,7 +123,6 @@ class ClientPaymentFailureObject
 | 
			
		||||
            'settings' => $this->client->getMergedSettings(),
 | 
			
		||||
            'whitelabel' => $this->company->account->isPaid() ? true : false,
 | 
			
		||||
            'url' => $this->invoices->first()->invitations->first()->getPaymentLink(),
 | 
			
		||||
            // 'button' => 'texts.pay_now',
 | 
			
		||||
            'button' => ctrans('texts.pay_now'),
 | 
			
		||||
            'additional_info' => false,
 | 
			
		||||
            'company' => $this->company,
 | 
			
		||||
 | 
			
		||||
@ -498,6 +498,20 @@ class Invoice extends BaseModel
 | 
			
		||||
        return $this->calc()->getTotal();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getPayableAmount()
 | 
			
		||||
    {
 | 
			
		||||
        if($this->partial > 0)
 | 
			
		||||
            return $this->partial;
 | 
			
		||||
 | 
			
		||||
        if($this->balance > 0)
 | 
			
		||||
            return $this->balance;
 | 
			
		||||
 | 
			
		||||
        if($this->status_id = 1)
 | 
			
		||||
            return $this->amount;
 | 
			
		||||
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function entityEmailEvent($invitation, $reminder_template, $template)
 | 
			
		||||
    {
 | 
			
		||||
        switch ($reminder_template) {
 | 
			
		||||
 | 
			
		||||
@ -228,10 +228,14 @@ class SubscriptionService
 | 
			
		||||
                                         ->where('is_deleted', 0)
 | 
			
		||||
                                         ->orderBy('id', 'desc')
 | 
			
		||||
                                         ->first();
 | 
			
		||||
        
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($outstanding->count() == 0){
 | 
			
		||||
        //need to ensure at this point that a refund is appropriate!!
 | 
			
		||||
        //28-02-2022
 | 
			
		||||
        if($recurring_invoice->invoices()->count() == 0){
 | 
			
		||||
            return $target->price;
 | 
			
		||||
        }
 | 
			
		||||
        elseif ($outstanding->count() == 0){
 | 
			
		||||
            //nothing outstanding
 | 
			
		||||
            return $target->price - $this->calculateProRataRefundForSubscription($outstanding_invoice);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -14,8 +14,8 @@ return [
 | 
			
		||||
    'require_https' => env('REQUIRE_HTTPS', true),
 | 
			
		||||
    'app_url' => rtrim(env('APP_URL', ''), '/'),
 | 
			
		||||
    'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
 | 
			
		||||
    'app_version' => '5.3.62',
 | 
			
		||||
    'app_tag' => '5.3.62',
 | 
			
		||||
    'app_version' => '5.3.63',
 | 
			
		||||
    'app_tag' => '5.3.63',
 | 
			
		||||
    'minimum_client_version' => '5.0.16',
 | 
			
		||||
    'terms_version' => '1.0.1',
 | 
			
		||||
    'api_secret' => env('API_SECRET', ''),
 | 
			
		||||
 | 
			
		||||
@ -4547,7 +4547,25 @@ $LANG = array(
 | 
			
		||||
    'to_view_entity_set_password' => 'To view the :entity you need to set password.',
 | 
			
		||||
    'unsubscribe' => 'Unsubscribe',
 | 
			
		||||
    'unsubscribed' => 'Unsubscribed',
 | 
			
		||||
    'unsubscribed_text' => 'You have been removed from notifications for this document'
 | 
			
		||||
    'unsubscribed_text' => 'You have been removed from notifications for this document',
 | 
			
		||||
    'client_shipping_state' => 'Client Shipping State',
 | 
			
		||||
    'client_shipping_city' => 'Client Shipping City',
 | 
			
		||||
    'client_shipping_postal_code' => 'Client Shipping Postal Code',
 | 
			
		||||
    'client_shipping_country' => 'Client Shipping Country',
 | 
			
		||||
    'load_pdf' => 'Load PDF',
 | 
			
		||||
    'start_free_trial' => 'Start Free Trial',
 | 
			
		||||
    'start_free_trial_message' => 'Start your FREE 14 day trial of the pro plan',
 | 
			
		||||
    'due_on_receipt' => 'Due on Receipt',
 | 
			
		||||
    'is_paid' => 'Is Paid',
 | 
			
		||||
    'age_group_paid' => 'Paid',
 | 
			
		||||
    'id' => 'Id',
 | 
			
		||||
    'convert_to' => 'Convert To',
 | 
			
		||||
    'client_currency' => 'Client Currency',
 | 
			
		||||
    'company_currency' => 'Company Currency',
 | 
			
		||||
    'custom_emails_disabled_help' => 'To prevent spam we require upgrading to a paid account to customize the email',
 | 
			
		||||
    'upgrade_to_add_company' => 'Upgrade your plan to add companies',
 | 
			
		||||
    'file_saved_in_downloads_folder' => 'The file has been saved in the downloads folder',
 | 
			
		||||
    'small' => 'Small',
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
return $LANG;
 | 
			
		||||
 | 
			
		||||
@ -59,7 +59,7 @@
 | 
			
		||||
                                @if($settings->client_portal_allow_under_payment || $settings->client_portal_allow_over_payment)
 | 
			
		||||
                                    <button class="button button-primary bg-primary">{{ ctrans('texts.pay_now') }}</button>
 | 
			
		||||
                                @else
 | 
			
		||||
                                    @livewire('pay-now-dropdown', ['total' => $invoice->partial > 0 ? $invoice->partial : $invoice->balance, 'company' => $company])
 | 
			
		||||
                                    @livewire('pay-now-dropdown', ['total' => $invoice->getPayableAmount(), 'company' => $company])
 | 
			
		||||
                                @endif
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user