mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 10:14:36 -04:00
Fixes for observers
This commit is contained in:
parent
0cfe5bc39a
commit
dc116013d9
@ -203,7 +203,7 @@ class InvoiceSum
|
|||||||
{
|
{
|
||||||
//Build invoice values here and return Invoice
|
//Build invoice values here and return Invoice
|
||||||
$this->setCalculatedAttributes();
|
$this->setCalculatedAttributes();
|
||||||
$this->invoice->save();
|
$this->invoice->saveQuietly();
|
||||||
|
|
||||||
return $this->invoice;
|
return $this->invoice;
|
||||||
}
|
}
|
||||||
@ -211,7 +211,7 @@ class InvoiceSum
|
|||||||
public function getQuote()
|
public function getQuote()
|
||||||
{
|
{
|
||||||
$this->setCalculatedAttributes();
|
$this->setCalculatedAttributes();
|
||||||
$this->invoice->save();
|
$this->invoice->saveQuietly();
|
||||||
|
|
||||||
return $this->invoice;
|
return $this->invoice;
|
||||||
}
|
}
|
||||||
@ -219,7 +219,7 @@ class InvoiceSum
|
|||||||
public function getCredit()
|
public function getCredit()
|
||||||
{
|
{
|
||||||
$this->setCalculatedAttributes();
|
$this->setCalculatedAttributes();
|
||||||
$this->invoice->save();
|
$this->invoice->saveQuietly();
|
||||||
|
|
||||||
return $this->invoice;
|
return $this->invoice;
|
||||||
}
|
}
|
||||||
@ -230,7 +230,7 @@ class InvoiceSum
|
|||||||
$this->invoice->total_taxes = $this->getTotalTaxes();
|
$this->invoice->total_taxes = $this->getTotalTaxes();
|
||||||
$this->invoice->balance = $this->formatValue($this->getTotal(), $this->invoice->client->currency()->precision);
|
$this->invoice->balance = $this->formatValue($this->getTotal(), $this->invoice->client->currency()->precision);
|
||||||
|
|
||||||
$this->invoice->save();
|
$this->invoice->saveQuietly();
|
||||||
|
|
||||||
return $this->invoice;
|
return $this->invoice;
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ class InvoiceSumInclusive
|
|||||||
$this->invoice->total_taxes = $this->getTotalTaxes();
|
$this->invoice->total_taxes = $this->getTotalTaxes();
|
||||||
$this->invoice->balance = $this->formatValue($this->getTotal(), $this->invoice->client->currency()->precision);
|
$this->invoice->balance = $this->formatValue($this->getTotal(), $this->invoice->client->currency()->precision);
|
||||||
|
|
||||||
$this->invoice->save();
|
$this->invoice->saveQuietly();
|
||||||
|
|
||||||
return $this->invoice;
|
return $this->invoice;
|
||||||
}
|
}
|
||||||
@ -206,7 +206,7 @@ class InvoiceSumInclusive
|
|||||||
{
|
{
|
||||||
//Build invoice values here and return Invoice
|
//Build invoice values here and return Invoice
|
||||||
$this->setCalculatedAttributes();
|
$this->setCalculatedAttributes();
|
||||||
$this->invoice->save();
|
$this->invoice->saveQuietly();
|
||||||
|
|
||||||
return $this->invoice;
|
return $this->invoice;
|
||||||
}
|
}
|
||||||
@ -215,7 +215,7 @@ class InvoiceSumInclusive
|
|||||||
{
|
{
|
||||||
//Build invoice values here and return Invoice
|
//Build invoice values here and return Invoice
|
||||||
$this->setCalculatedAttributes();
|
$this->setCalculatedAttributes();
|
||||||
$this->invoice->save();
|
$this->invoice->saveQuietly();
|
||||||
|
|
||||||
return $this->invoice;
|
return $this->invoice;
|
||||||
}
|
}
|
||||||
@ -224,7 +224,7 @@ class InvoiceSumInclusive
|
|||||||
{
|
{
|
||||||
//Build invoice values here and return Invoice
|
//Build invoice values here and return Invoice
|
||||||
$this->setCalculatedAttributes();
|
$this->setCalculatedAttributes();
|
||||||
$this->invoice->save();
|
$this->invoice->saveQuietly();
|
||||||
|
|
||||||
return $this->invoice;
|
return $this->invoice;
|
||||||
}
|
}
|
||||||
|
@ -208,7 +208,7 @@ class RecurringInvoiceController extends BaseController
|
|||||||
|
|
||||||
$offset = $recurring_invoice->client->timezone_offset();
|
$offset = $recurring_invoice->client->timezone_offset();
|
||||||
$recurring_invoice->next_send_date = Carbon::parse($recurring_invoice->next_send_date)->startOfDay()->addSeconds($offset);
|
$recurring_invoice->next_send_date = Carbon::parse($recurring_invoice->next_send_date)->startOfDay()->addSeconds($offset);
|
||||||
$recurring_invoice->save();
|
$recurring_invoice->saveQuietly();
|
||||||
|
|
||||||
$recurring_invoice->service()
|
$recurring_invoice->service()
|
||||||
->triggeredActions($request)
|
->triggeredActions($request)
|
||||||
|
@ -23,7 +23,7 @@ class UpdateAutoBilling extends Component
|
|||||||
{
|
{
|
||||||
if ($this->invoice->auto_bill == 'optin' || $this->invoice->auto_bill == 'optout') {
|
if ($this->invoice->auto_bill == 'optin' || $this->invoice->auto_bill == 'optout') {
|
||||||
$this->invoice->auto_bill_enabled = !$this->invoice->auto_bill_enabled;
|
$this->invoice->auto_bill_enabled = !$this->invoice->auto_bill_enabled;
|
||||||
$this->invoice->save();
|
$this->invoice->saveQuietly();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ class CreateEntityPdf implements ShouldQueue
|
|||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$start = microtime(true);
|
$start = microtime(true);
|
||||||
nlog("Start ". $start);
|
// nlog("Start ". $start);
|
||||||
|
|
||||||
/* Forget the singleton*/
|
/* Forget the singleton*/
|
||||||
App::forgetInstance('translator');
|
App::forgetInstance('translator');
|
||||||
@ -154,7 +154,7 @@ class CreateEntityPdf implements ShouldQueue
|
|||||||
$html = new HtmlEngine($this->invitation);
|
$html = new HtmlEngine($this->invitation);
|
||||||
|
|
||||||
$design_time = microtime(true);
|
$design_time = microtime(true);
|
||||||
nlog("Design ". $design_time - $translate);
|
// nlog("Design ". $design_time - $translate);
|
||||||
|
|
||||||
if ($design->is_custom) {
|
if ($design->is_custom) {
|
||||||
$options = [
|
$options = [
|
||||||
@ -168,7 +168,7 @@ class CreateEntityPdf implements ShouldQueue
|
|||||||
$variables = $html->generateLabelsAndValues();
|
$variables = $html->generateLabelsAndValues();
|
||||||
|
|
||||||
$labels_time = microtime(true);
|
$labels_time = microtime(true);
|
||||||
nlog("Labels ". $labels_time - $design_time);
|
// nlog("Labels ". $labels_time - $design_time);
|
||||||
|
|
||||||
$state = [
|
$state = [
|
||||||
'template' => $template->elements([
|
'template' => $template->elements([
|
||||||
@ -194,7 +194,7 @@ class CreateEntityPdf implements ShouldQueue
|
|||||||
|
|
||||||
|
|
||||||
$template_time = microtime(true);
|
$template_time = microtime(true);
|
||||||
nlog("Template Build ". $template_time - $labels_time);
|
// nlog("Template Build ". $template_time - $labels_time);
|
||||||
|
|
||||||
$pdf = null;
|
$pdf = null;
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ class CreateEntityPdf implements ShouldQueue
|
|||||||
|
|
||||||
|
|
||||||
$pdf_time = microtime(true);
|
$pdf_time = microtime(true);
|
||||||
nlog("PDF time " . $pdf_time - $template_time);
|
// nlog("PDF time " . $pdf_time - $template_time);
|
||||||
|
|
||||||
if ($pdf) {
|
if ($pdf) {
|
||||||
|
|
||||||
|
@ -43,18 +43,19 @@ class WebhookHandler implements ShouldQueue
|
|||||||
|
|
||||||
public $deleteWhenMissingModels = true;
|
public $deleteWhenMissingModels = true;
|
||||||
|
|
||||||
|
private string $includes;
|
||||||
/**
|
/**
|
||||||
* Create a new job instance.
|
* Create a new job instance.
|
||||||
*
|
*
|
||||||
* @param $event_id
|
* @param $event_id
|
||||||
* @param $entity
|
* @param $entity
|
||||||
*/
|
*/
|
||||||
public function __construct($event_id, $entity, $company)
|
public function __construct($event_id, $entity, $company, $includes = '')
|
||||||
{
|
{
|
||||||
$this->event_id = $event_id;
|
$this->event_id = $event_id;
|
||||||
$this->entity = $entity;
|
$this->entity = $entity;
|
||||||
$this->company = $company;
|
$this->company = $company;
|
||||||
|
$this->includes = $includes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -90,6 +91,7 @@ class WebhookHandler implements ShouldQueue
|
|||||||
// generate JSON data
|
// generate JSON data
|
||||||
$manager = new Manager();
|
$manager = new Manager();
|
||||||
$manager->setSerializer(new ArraySerializer());
|
$manager->setSerializer(new ArraySerializer());
|
||||||
|
$manager->parseIncludes($this->includes);
|
||||||
|
|
||||||
$class = sprintf('App\\Transformers\\%sTransformer', class_basename($this->entity));
|
$class = sprintf('App\\Transformers\\%sTransformer', class_basename($this->entity));
|
||||||
|
|
||||||
|
@ -35,10 +35,8 @@ class InvoiceObserver
|
|||||||
->exists();
|
->exists();
|
||||||
|
|
||||||
if ($subscriptions) {
|
if ($subscriptions) {
|
||||||
|
|
||||||
$invoice->load('client');
|
|
||||||
|
|
||||||
WebhookHandler::dispatch(Webhook::EVENT_CREATE_INVOICE, $invoice, $invoice->company);
|
WebhookHandler::dispatch(Webhook::EVENT_CREATE_INVOICE, $invoice, $invoice->company, 'client');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,17 +48,14 @@ class InvoiceObserver
|
|||||||
*/
|
*/
|
||||||
public function updated(Invoice $invoice)
|
public function updated(Invoice $invoice)
|
||||||
{
|
{
|
||||||
|
|
||||||
$subscriptions = Webhook::where('company_id', $invoice->company_id)
|
$subscriptions = Webhook::where('company_id', $invoice->company_id)
|
||||||
->where('event_id', Webhook::EVENT_UPDATE_INVOICE)
|
->where('event_id', Webhook::EVENT_UPDATE_INVOICE)
|
||||||
->exists();
|
->exists();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($subscriptions) {
|
if ($subscriptions) {
|
||||||
|
|
||||||
$invoice->load('client');
|
WebhookHandler::dispatch(Webhook::EVENT_UPDATE_INVOICE, $invoice, $invoice->company, 'client');
|
||||||
|
|
||||||
WebhookHandler::dispatch(Webhook::EVENT_UPDATE_INVOICE, $invoice, $invoice->company);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,9 +75,7 @@ class InvoiceObserver
|
|||||||
|
|
||||||
if ($subscriptions) {
|
if ($subscriptions) {
|
||||||
|
|
||||||
$invoice->load('client');
|
WebhookHandler::dispatch(Webhook::EVENT_DELETE_INVOICE, $invoice, $invoice->company, 'client');
|
||||||
|
|
||||||
WebhookHandler::dispatch(Webhook::EVENT_DELETE_INVOICE, $invoice, $invoice->company);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,11 +29,8 @@ class PaymentObserver
|
|||||||
->where('event_id', Webhook::EVENT_CREATE_PAYMENT)
|
->where('event_id', Webhook::EVENT_CREATE_PAYMENT)
|
||||||
->exists();
|
->exists();
|
||||||
|
|
||||||
if($payment->invoices()->exists())
|
|
||||||
$payment->load('invoices');
|
|
||||||
|
|
||||||
if ($subscriptions) {
|
if ($subscriptions) {
|
||||||
WebhookHandler::dispatch(Webhook::EVENT_CREATE_PAYMENT, $payment, $payment->company);
|
WebhookHandler::dispatch(Webhook::EVENT_CREATE_PAYMENT, $payment, $payment->company, 'invoices');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +57,7 @@ class PaymentObserver
|
|||||||
->exists();
|
->exists();
|
||||||
|
|
||||||
if ($subscriptions) {
|
if ($subscriptions) {
|
||||||
WebhookHandler::dispatch(Webhook::EVENT_DELETE_PAYMENT, $payment, $payment->company);
|
WebhookHandler::dispatch(Webhook::EVENT_DELETE_PAYMENT, $payment, $payment->company, 'invoices');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,36 +12,8 @@
|
|||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use App\Http\Middleware\SetDomainNameDb;
|
use App\Http\Middleware\SetDomainNameDb;
|
||||||
use App\Models\Account;
|
|
||||||
use App\Models\Client;
|
|
||||||
use App\Models\Company;
|
|
||||||
use App\Models\CompanyGateway;
|
|
||||||
use App\Models\CompanyToken;
|
|
||||||
use App\Models\Credit;
|
|
||||||
use App\Models\Expense;
|
|
||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use App\Models\Payment;
|
|
||||||
use App\Models\Product;
|
|
||||||
use App\Models\Proposal;
|
use App\Models\Proposal;
|
||||||
use App\Models\Quote;
|
|
||||||
use App\Models\Subscription;
|
|
||||||
use App\Models\Task;
|
|
||||||
use App\Models\User;
|
|
||||||
use App\Observers\AccountObserver;
|
|
||||||
use App\Observers\ClientObserver;
|
|
||||||
use App\Observers\CompanyGatewayObserver;
|
|
||||||
use App\Observers\CompanyObserver;
|
|
||||||
use App\Observers\CompanyTokenObserver;
|
|
||||||
use App\Observers\CreditObserver;
|
|
||||||
use App\Observers\ExpenseObserver;
|
|
||||||
use App\Observers\InvoiceObserver;
|
|
||||||
use App\Observers\PaymentObserver;
|
|
||||||
use App\Observers\ProductObserver;
|
|
||||||
use App\Observers\ProposalObserver;
|
|
||||||
use App\Observers\QuoteObserver;
|
|
||||||
use App\Observers\SubscriptionObserver;
|
|
||||||
use App\Observers\TaskObserver;
|
|
||||||
use App\Observers\UserObserver;
|
|
||||||
use App\Utils\Ninja;
|
use App\Utils\Ninja;
|
||||||
use Illuminate\Cache\RateLimiting\Limit;
|
use Illuminate\Cache\RateLimiting\Limit;
|
||||||
use Illuminate\Database\Eloquent\Relations\Relation;
|
use Illuminate\Database\Eloquent\Relations\Relation;
|
||||||
@ -80,23 +52,6 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
Schema::defaultStringLength(191);
|
Schema::defaultStringLength(191);
|
||||||
|
|
||||||
Account::observe(AccountObserver::class);
|
|
||||||
Subscription::observe(SubscriptionObserver::class);
|
|
||||||
Client::observe(ClientObserver::class);
|
|
||||||
Company::observe(CompanyObserver::class);
|
|
||||||
CompanyGateway::observe(CompanyGatewayObserver::class);
|
|
||||||
CompanyToken::observe(CompanyTokenObserver::class);
|
|
||||||
Credit::observe(CreditObserver::class);
|
|
||||||
Expense::observe(ExpenseObserver::class);
|
|
||||||
Invoice::observe(InvoiceObserver::class);
|
|
||||||
Payment::observe(PaymentObserver::class);
|
|
||||||
Product::observe(ProductObserver::class);
|
|
||||||
Proposal::observe(ProposalObserver::class);
|
|
||||||
Quote::observe(QuoteObserver::class);
|
|
||||||
Task::observe(TaskObserver::class);
|
|
||||||
User::observe(UserObserver::class);
|
|
||||||
|
|
||||||
|
|
||||||
/* Handles setting the correct database with livewire classes */
|
/* Handles setting the correct database with livewire classes */
|
||||||
if(Ninja::isHosted())
|
if(Ninja::isHosted())
|
||||||
{
|
{
|
||||||
|
@ -202,6 +202,36 @@ use App\Listeners\User\DeletedUserActivity;
|
|||||||
use App\Listeners\User\RestoredUserActivity;
|
use App\Listeners\User\RestoredUserActivity;
|
||||||
use App\Listeners\User\UpdateUserLastLogin;
|
use App\Listeners\User\UpdateUserLastLogin;
|
||||||
use App\Listeners\User\UpdatedUserActivity;
|
use App\Listeners\User\UpdatedUserActivity;
|
||||||
|
use App\Models\Account;
|
||||||
|
use App\Models\Client;
|
||||||
|
use App\Models\Company;
|
||||||
|
use App\Models\CompanyGateway;
|
||||||
|
use App\Models\CompanyToken;
|
||||||
|
use App\Models\Credit;
|
||||||
|
use App\Models\Expense;
|
||||||
|
use App\Models\Invoice;
|
||||||
|
use App\Models\Payment;
|
||||||
|
use App\Models\Product;
|
||||||
|
use App\Models\Proposal;
|
||||||
|
use App\Models\Quote;
|
||||||
|
use App\Models\Subscription;
|
||||||
|
use App\Models\Task;
|
||||||
|
use App\Models\User;
|
||||||
|
use App\Observers\AccountObserver;
|
||||||
|
use App\Observers\ClientObserver;
|
||||||
|
use App\Observers\CompanyGatewayObserver;
|
||||||
|
use App\Observers\CompanyObserver;
|
||||||
|
use App\Observers\CompanyTokenObserver;
|
||||||
|
use App\Observers\CreditObserver;
|
||||||
|
use App\Observers\ExpenseObserver;
|
||||||
|
use App\Observers\InvoiceObserver;
|
||||||
|
use App\Observers\PaymentObserver;
|
||||||
|
use App\Observers\ProductObserver;
|
||||||
|
use App\Observers\ProposalObserver;
|
||||||
|
use App\Observers\QuoteObserver;
|
||||||
|
use App\Observers\SubscriptionObserver;
|
||||||
|
use App\Observers\TaskObserver;
|
||||||
|
use App\Observers\UserObserver;
|
||||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||||
use Illuminate\Mail\Events\MessageSending;
|
use Illuminate\Mail\Events\MessageSending;
|
||||||
use Illuminate\Mail\Events\MessageSent;
|
use Illuminate\Mail\Events\MessageSent;
|
||||||
@ -542,5 +572,21 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
parent::boot();
|
parent::boot();
|
||||||
|
|
||||||
|
Account::observe(AccountObserver::class);
|
||||||
|
Subscription::observe(SubscriptionObserver::class);
|
||||||
|
Client::observe(ClientObserver::class);
|
||||||
|
Company::observe(CompanyObserver::class);
|
||||||
|
CompanyGateway::observe(CompanyGatewayObserver::class);
|
||||||
|
CompanyToken::observe(CompanyTokenObserver::class);
|
||||||
|
Credit::observe(CreditObserver::class);
|
||||||
|
Expense::observe(ExpenseObserver::class);
|
||||||
|
Invoice::observe(InvoiceObserver::class);
|
||||||
|
Payment::observe(PaymentObserver::class);
|
||||||
|
Product::observe(ProductObserver::class);
|
||||||
|
Proposal::observe(ProposalObserver::class);
|
||||||
|
Quote::observe(QuoteObserver::class);
|
||||||
|
Task::observe(TaskObserver::class);
|
||||||
|
User::observe(UserObserver::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -326,6 +326,8 @@ class BaseRepository
|
|||||||
|
|
||||||
if($this->new_model)
|
if($this->new_model)
|
||||||
event('eloquent.created: App\Models\Invoice', $model);
|
event('eloquent.created: App\Models\Invoice', $model);
|
||||||
|
else
|
||||||
|
event('eloquent.updated: App\Models\Invoice', $model);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -339,6 +341,9 @@ class BaseRepository
|
|||||||
|
|
||||||
if($this->new_model)
|
if($this->new_model)
|
||||||
event('eloquent.created: App\Models\Credit', $model);
|
event('eloquent.created: App\Models\Credit', $model);
|
||||||
|
else
|
||||||
|
event('eloquent.updated: App\Models\Credit', $model);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($model instanceof Quote) {
|
if ($model instanceof Quote) {
|
||||||
@ -351,7 +356,8 @@ class BaseRepository
|
|||||||
|
|
||||||
if($this->new_model)
|
if($this->new_model)
|
||||||
event('eloquent.created: App\Models\Quote', $model);
|
event('eloquent.created: App\Models\Quote', $model);
|
||||||
|
else
|
||||||
|
event('eloquent.updated: App\Models\Quote', $model);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($model instanceof RecurringInvoice) {
|
if ($model instanceof RecurringInvoice) {
|
||||||
@ -364,6 +370,8 @@ class BaseRepository
|
|||||||
|
|
||||||
if($this->new_model)
|
if($this->new_model)
|
||||||
event('eloquent.created: App\Models\RecurringInvoice', $model);
|
event('eloquent.created: App\Models\RecurringInvoice', $model);
|
||||||
|
else
|
||||||
|
event('eloquent.updated: App\Models\RecurringInvoice', $model);
|
||||||
}
|
}
|
||||||
|
|
||||||
$model->save();
|
$model->save();
|
||||||
|
@ -356,9 +356,9 @@ class AutoBillInvoice extends AbstractService
|
|||||||
$items[] = $item;
|
$items[] = $item;
|
||||||
|
|
||||||
$this->invoice->line_items = $items;
|
$this->invoice->line_items = $items;
|
||||||
$this->invoice->save();
|
$this->invoice->saveQuietly();
|
||||||
|
|
||||||
$this->invoice = $this->invoice->calc()->getInvoice()->save();
|
$this->invoice = $this->invoice->calc()->getInvoice()->saveQuietly();
|
||||||
|
|
||||||
if ($starting_amount != $this->invoice->amount && $this->invoice->status_id != Invoice::STATUS_DRAFT) {
|
if ($starting_amount != $this->invoice->amount && $this->invoice->status_id != Invoice::STATUS_DRAFT) {
|
||||||
$this->invoice->client->service()->updateBalance($this->invoice->amount - $starting_amount)->save();
|
$this->invoice->client->service()->updateBalance($this->invoice->amount - $starting_amount)->save();
|
||||||
|
@ -75,7 +75,7 @@ class HandleCancellation extends AbstractService
|
|||||||
$backup = $this->invoice->backup;
|
$backup = $this->invoice->backup;
|
||||||
unset($backup->cancellation);
|
unset($backup->cancellation);
|
||||||
$this->invoice->backup = $backup;
|
$this->invoice->backup = $backup;
|
||||||
$this->invoice->save();
|
$this->invoice->saveQuietly();
|
||||||
|
|
||||||
return $this->invoice;
|
return $this->invoice;
|
||||||
}
|
}
|
||||||
@ -101,6 +101,6 @@ class HandleCancellation extends AbstractService
|
|||||||
$invoice_backup->cancellation = $cancellation;
|
$invoice_backup->cancellation = $cancellation;
|
||||||
|
|
||||||
$this->invoice->backup = $invoice_backup;
|
$this->invoice->backup = $invoice_backup;
|
||||||
$this->invoice->save();
|
$this->invoice->saveQuietly();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ nlog("second payment_amount = {$payment_amount}");
|
|||||||
else
|
else
|
||||||
$this->invoice->number = $new_invoice_number;
|
$this->invoice->number = $new_invoice_number;
|
||||||
|
|
||||||
$this->invoice->save();
|
$this->invoice->saveQuietly();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
nlog("I could not wind back the invoice number");
|
nlog("I could not wind back the invoice number");
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ class UpdateReminder extends AbstractService
|
|||||||
|
|
||||||
if (! $this->invoice->isPayable()) {
|
if (! $this->invoice->isPayable()) {
|
||||||
$this->invoice->next_send_date = null;
|
$this->invoice->next_send_date = null;
|
||||||
$this->invoice->save();
|
$this->invoice->saveQuietly();
|
||||||
|
|
||||||
return $this->invoice; //exit early
|
return $this->invoice; //exit early
|
||||||
}
|
}
|
||||||
|
@ -250,7 +250,7 @@ class RefundPayment
|
|||||||
$invoice->service()->setStatus(Invoice::STATUS_PARTIAL);
|
$invoice->service()->setStatus(Invoice::STATUS_PARTIAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
$invoice->save();
|
$invoice->saveQuietly();
|
||||||
|
|
||||||
$client = $invoice->client;
|
$client = $invoice->client;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user