mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-02 22:57:33 -05:00 
			
		
		
		
	Merge pull request #4096 from turbo124/v2
Improve email templates customizations
This commit is contained in:
		
						commit
						e8ef0851d0
					
				@ -71,6 +71,7 @@ class BaseController extends Controller
 | 
				
			|||||||
          'company.clients.gateway_tokens',
 | 
					          'company.clients.gateway_tokens',
 | 
				
			||||||
          'company.clients.documents',
 | 
					          'company.clients.documents',
 | 
				
			||||||
          'company.products',
 | 
					          'company.products',
 | 
				
			||||||
 | 
					          'company.products.documents',
 | 
				
			||||||
          'company.recurring_invoices',
 | 
					          'company.recurring_invoices',
 | 
				
			||||||
          'company.invoices.invitations.contact',
 | 
					          'company.invoices.invitations.contact',
 | 
				
			||||||
          'company.invoices.invitations.company',
 | 
					          'company.invoices.invitations.company',
 | 
				
			||||||
@ -92,6 +93,7 @@ class BaseController extends Controller
 | 
				
			|||||||
          'company.tasks',
 | 
					          'company.tasks',
 | 
				
			||||||
          'company.projects',
 | 
					          'company.projects',
 | 
				
			||||||
          'company.designs',
 | 
					          'company.designs',
 | 
				
			||||||
 | 
					          'company.documents',
 | 
				
			||||||
          'company.webhooks',
 | 
					          'company.webhooks',
 | 
				
			||||||
          'company.tokens_hashed',
 | 
					          'company.tokens_hashed',
 | 
				
			||||||
        ];
 | 
					        ];
 | 
				
			||||||
@ -202,7 +204,7 @@ class BaseController extends Controller
 | 
				
			|||||||
        $query->with(
 | 
					        $query->with(
 | 
				
			||||||
          [
 | 
					          [
 | 
				
			||||||
            'company' => function ($query) use ($updated_at) {
 | 
					            'company' => function ($query) use ($updated_at) {
 | 
				
			||||||
                $query->whereNotNull('updated_at');
 | 
					                $query->whereNotNull('updated_at')->with('documents');
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            'company.clients' => function ($query) use ($updated_at) {
 | 
					            'company.clients' => function ($query) use ($updated_at) {
 | 
				
			||||||
                $query->where('clients.updated_at', '>=', $updated_at)->with('contacts', 'gateway_tokens','documents');
 | 
					                $query->where('clients.updated_at', '>=', $updated_at)->with('contacts', 'gateway_tokens','documents');
 | 
				
			||||||
@ -217,7 +219,7 @@ class BaseController extends Controller
 | 
				
			|||||||
                $query->whereNotNull('updated_at');
 | 
					                $query->whereNotNull('updated_at');
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            'company.products' => function ($query) use ($updated_at) {
 | 
					            'company.products' => function ($query) use ($updated_at) {
 | 
				
			||||||
                $query->where('updated_at', '>=', $updated_at);
 | 
					                $query->where('updated_at', '>=', $updated_at)->with('documents');
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
            'company.recurring_invoices'=> function ($query) use ($updated_at) {
 | 
					            'company.recurring_invoices'=> function ($query) use ($updated_at) {
 | 
				
			||||||
                $query->where('updated_at', '>=', $updated_at)->with('company');
 | 
					                $query->where('updated_at', '>=', $updated_at)->with('company');
 | 
				
			||||||
 | 
				
			|||||||
@ -700,7 +700,7 @@ class InvoiceController extends BaseController
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            case 'email':
 | 
					            case 'email':
 | 
				
			||||||
                //check query paramater for email_type and set the template else use calculateTemplate
 | 
					                //check query parameter for email_type and set the template else use calculateTemplate
 | 
				
			||||||
                if (request()->has('email_type') && property_exists($invoice->company->settings, request()->input('email_type'))) {
 | 
					                if (request()->has('email_type') && property_exists($invoice->company->settings, request()->input('email_type'))) {
 | 
				
			||||||
                    $this->reminder_template = $invoice->client->getSetting(request()->input('email_type'));
 | 
					                    $this->reminder_template = $invoice->client->getSetting(request()->input('email_type'));
 | 
				
			||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
 | 
				
			|||||||
@ -92,6 +92,7 @@ class UserEmailChanged extends BaseMailerJob implements ShouldQueue
 | 
				
			|||||||
            'button' => ctrans('texts.account_login'),
 | 
					            'button' => ctrans('texts.account_login'),
 | 
				
			||||||
            'signature' => $this->company->owner()->signature,
 | 
					            'signature' => $this->company->owner()->signature,
 | 
				
			||||||
            'logo' => $this->company->present()->logo(),
 | 
					            'logo' => $this->company->present()->logo(),
 | 
				
			||||||
 | 
					            'settings' => $this->settings,
 | 
				
			||||||
        ];
 | 
					        ];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -56,7 +56,7 @@ class SendFailedEmails implements ShouldQueue
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    private function processEmails()
 | 
					    private function processEmails()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        \Log::error('processing emails');
 | 
					        //\Log::error('processing emails');
 | 
				
			||||||
        //info("process emails");
 | 
					        //info("process emails");
 | 
				
			||||||
        //@todo check that the quota is available for the job
 | 
					        //@todo check that the quota is available for the job
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -84,6 +84,8 @@ class EntitySentObject
 | 
				
			|||||||
            'button' => ctrans("texts.view_{$this->entity_type}"),
 | 
					            'button' => ctrans("texts.view_{$this->entity_type}"),
 | 
				
			||||||
            'signature' => $settings->email_signature,
 | 
					            'signature' => $settings->email_signature,
 | 
				
			||||||
            'logo' => $this->company->present()->logo(),
 | 
					            'logo' => $this->company->present()->logo(),
 | 
				
			||||||
 | 
					            'settings' => $settings,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ];
 | 
					        ];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -84,6 +84,8 @@ class EntityViewedObject
 | 
				
			|||||||
            'button' => ctrans("texts.view_{$this->entity_type}"),
 | 
					            'button' => ctrans("texts.view_{$this->entity_type}"),
 | 
				
			||||||
            'signature' => $settings->email_signature,
 | 
					            'signature' => $settings->email_signature,
 | 
				
			||||||
            'logo' => $this->company->present()->logo(),
 | 
					            'logo' => $this->company->present()->logo(),
 | 
				
			||||||
 | 
					            'settings' => $settings,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ];
 | 
					        ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return $data;
 | 
					        return $data;
 | 
				
			||||||
 | 
				
			|||||||
@ -76,6 +76,8 @@ class PaymentFailureObject
 | 
				
			|||||||
            ),
 | 
					            ),
 | 
				
			||||||
            'signature' => $signature,
 | 
					            'signature' => $signature,
 | 
				
			||||||
            'logo' => $this->company->present()->logo(),
 | 
					            'logo' => $this->company->present()->logo(),
 | 
				
			||||||
 | 
					            'settings' => $this->client->getMergedSettings(),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ];
 | 
					        ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return $data;
 | 
					        return $data;
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,13 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://opensource.org/licenses/AAL
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace App\Notifications\Admin;
 | 
					namespace App\Notifications\Admin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,13 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://opensource.org/licenses/AAL
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace App\Notifications\Admin;
 | 
					namespace App\Notifications\Admin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,13 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://opensource.org/licenses/AAL
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace App\Notifications\Admin;
 | 
					namespace App\Notifications\Admin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,13 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://opensource.org/licenses/AAL
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace App\Notifications\Admin;
 | 
					namespace App\Notifications\Admin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,13 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://opensource.org/licenses/AAL
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace App\Notifications\Admin;
 | 
					namespace App\Notifications\Admin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,13 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://opensource.org/licenses/AAL
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace App\Notifications\Admin;
 | 
					namespace App\Notifications\Admin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,13 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://opensource.org/licenses/AAL
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace App\Notifications;
 | 
					namespace App\Notifications;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -114,6 +123,7 @@ class BaseNotification extends Notification implements ShouldQueue
 | 
				
			|||||||
            'view_text' => ctrans('texts.view_'.$this->entity_string),
 | 
					            'view_text' => ctrans('texts.view_'.$this->entity_string),
 | 
				
			||||||
            'logo' => $this->entity->company->present()->logo(),
 | 
					            'logo' => $this->entity->company->present()->logo(),
 | 
				
			||||||
            'signature' => $this->settings->email_signature,
 | 
					            'signature' => $this->settings->email_signature,
 | 
				
			||||||
 | 
					            'settings' => $this->settings,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ];
 | 
					        ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,13 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://opensource.org/licenses/AAL
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace App\Notifications;
 | 
					namespace App\Notifications;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,13 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://opensource.org/licenses/AAL
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace App\Notifications;
 | 
					namespace App\Notifications;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,13 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://opensource.org/licenses/AAL
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace App\Notifications;
 | 
					namespace App\Notifications;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,13 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://opensource.org/licenses/AAL
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace App\Notifications;
 | 
					namespace App\Notifications;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,13 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://opensource.org/licenses/AAL
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace App\Notifications\Ninja;
 | 
					namespace App\Notifications\Ninja;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,13 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://opensource.org/licenses/AAL
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace App\Notifications\Ninja;
 | 
					namespace App\Notifications\Ninja;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,13 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://opensource.org/licenses/AAL
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace App\Notifications;
 | 
					namespace App\Notifications;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -225,6 +225,7 @@ class EventServiceProvider extends ServiceProvider
 | 
				
			|||||||
        ],
 | 
					        ],
 | 
				
			||||||
        InvoiceWasPaid::class => [
 | 
					        InvoiceWasPaid::class => [
 | 
				
			||||||
           InvoicePaidActivity::class,
 | 
					           InvoicePaidActivity::class,
 | 
				
			||||||
 | 
					           CreateInvoicePdf::class,
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        InvoiceWasViewed::class => [
 | 
					        InvoiceWasViewed::class => [
 | 
				
			||||||
            InvoiceViewedActivity::class,
 | 
					            InvoiceViewedActivity::class,
 | 
				
			||||||
@ -238,6 +239,7 @@ class EventServiceProvider extends ServiceProvider
 | 
				
			|||||||
        ],
 | 
					        ],
 | 
				
			||||||
        InvoiceWasDeleted::class => [
 | 
					        InvoiceWasDeleted::class => [
 | 
				
			||||||
            InvoiceDeletedActivity::class,
 | 
					            InvoiceDeletedActivity::class,
 | 
				
			||||||
 | 
					            CreateInvoicePdf::class,
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        InvoiceWasArchived::class => [
 | 
					        InvoiceWasArchived::class => [
 | 
				
			||||||
            InvoiceArchivedActivity::class,
 | 
					            InvoiceArchivedActivity::class,
 | 
				
			||||||
@ -247,6 +249,7 @@ class EventServiceProvider extends ServiceProvider
 | 
				
			|||||||
        ],
 | 
					        ],
 | 
				
			||||||
        InvoiceWasReversed::class => [
 | 
					        InvoiceWasReversed::class => [
 | 
				
			||||||
            InvoiceReversedActivity::class,
 | 
					            InvoiceReversedActivity::class,
 | 
				
			||||||
 | 
					            CreateInvoicePdf::class,
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        InvoiceWasCancelled::class => [
 | 
					        InvoiceWasCancelled::class => [
 | 
				
			||||||
            InvoiceCancelledActivity::class,
 | 
					            InvoiceCancelledActivity::class,
 | 
				
			||||||
 | 
				
			|||||||
@ -206,6 +206,9 @@ class InvoiceService
 | 
				
			|||||||
        if($this->invoice->balance == 0)
 | 
					        if($this->invoice->balance == 0)
 | 
				
			||||||
            $this->setStatus(Invoice::STATUS_PAID);
 | 
					            $this->setStatus(Invoice::STATUS_PAID);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if($this->invoice->balance > 0 && $this->invoice->balance < $this->invoice->amount)
 | 
				
			||||||
 | 
					            $this->setStatus(Invoice::STATUS_PARTIAL);
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
        return $this;
 | 
					        return $this;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -73,6 +73,8 @@ class UpdateInvoicePayment
 | 
				
			|||||||
            $pivot_invoice->pivot->amount = $paid_amount;
 | 
					            $pivot_invoice->pivot->amount = $paid_amount;
 | 
				
			||||||
            $pivot_invoice->pivot->save();
 | 
					            $pivot_invoice->pivot->save();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            $this->payment->applied += $paid_amount;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $invoice->service() //caution what if we amount paid was less than partial - we wipe it!
 | 
					            $invoice->service() //caution what if we amount paid was less than partial - we wipe it!
 | 
				
			||||||
                ->clearPartial()
 | 
					                ->clearPartial()
 | 
				
			||||||
                ->updateBalance($paid_amount * -1)
 | 
					                ->updateBalance($paid_amount * -1)
 | 
				
			||||||
@ -83,6 +85,8 @@ class UpdateInvoicePayment
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 | 
					        $this->payment->save();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return $this->payment;
 | 
					        return $this->payment;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,13 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://opensource.org/licenses/AAL
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace App\Utils\ClientPortal\CustomMessage;
 | 
					namespace App\Utils\ClientPortal\CustomMessage;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,13 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://opensource.org/licenses/AAL
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace App\Utils\ClientPortal\CustomMessage;
 | 
					namespace App\Utils\ClientPortal\CustomMessage;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -31,6 +31,28 @@
 | 
				
			|||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                    <div>
 | 
					                    <div>
 | 
				
			||||||
                        <dl>
 | 
					                        <dl>
 | 
				
			||||||
 | 
					                            
 | 
				
			||||||
 | 
					                            <div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
 | 
				
			||||||
 | 
					                                <dt class="text-sm leading-5 font-medium text-gray-500">
 | 
				
			||||||
 | 
					                                    {{ ctrans('texts.subtotal') }}
 | 
				
			||||||
 | 
					                                </dt>
 | 
				
			||||||
 | 
					                                <dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
 | 
				
			||||||
 | 
					                                    {{ App\Utils\Number::formatMoney($total['invoice_totals'], $client) }}
 | 
				
			||||||
 | 
					                                </dd>
 | 
				
			||||||
 | 
					                                <dt class="text-sm leading-5 font-medium text-gray-500">
 | 
				
			||||||
 | 
					                                    {{ ctrans('texts.gateway_fees') }}
 | 
				
			||||||
 | 
					                                </dt>
 | 
				
			||||||
 | 
					                                <dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
 | 
				
			||||||
 | 
					                                    {{ App\Utils\Number::formatMoney($total['fee_total'], $client) }}
 | 
				
			||||||
 | 
					                                </dd>
 | 
				
			||||||
 | 
					                                <dt class="text-sm leading-5 font-medium text-gray-500">
 | 
				
			||||||
 | 
					                                    {{ ctrans('texts.total') }}
 | 
				
			||||||
 | 
					                                </dt>
 | 
				
			||||||
 | 
					                                <dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
 | 
				
			||||||
 | 
					                                    {{ App\Utils\Number::formatMoney($total['amount_with_fee'], $client) }}
 | 
				
			||||||
 | 
					                                </dd>
 | 
				
			||||||
 | 
					                            </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            @if($token)
 | 
					                            @if($token)
 | 
				
			||||||
                                <div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 flex items-center">
 | 
					                                <div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 flex items-center">
 | 
				
			||||||
                                    <dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
 | 
					                                    <dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user