From 396db1dec4745f6e256677abcc0ed05ccd9e7943 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 1 Jan 2017 20:11:38 +0200 Subject: [PATCH] Changes to product description aren't logged in invoice history #1219 --- app/Listeners/ActivityListener.php | 4 ---- app/Models/Invoice.php | 29 +---------------------------- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/app/Listeners/ActivityListener.php b/app/Listeners/ActivityListener.php index ee016cbff39b..6c7b1d125ce9 100644 --- a/app/Listeners/ActivityListener.php +++ b/app/Listeners/ActivityListener.php @@ -127,10 +127,6 @@ class ActivityListener */ public function updatedInvoice(InvoiceWasUpdated $event) { - if (! $event->invoice->isChanged()) { - return; - } - $backupInvoice = Invoice::with('invoice_items', 'client.account', 'client.contacts') ->withArchived() ->find($event->invoice->id); diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 2e7b9287f23f..61fea0efdbd9 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -189,33 +189,6 @@ class Invoice extends EntityModel implements BalanceAffecting return floatval($this->amount) - floatval($this->getOriginal('amount')); } - /** - * @return bool - */ - public function isChanged() - { - if ($this->getRawAdjustment() != 0) { - return true; - } - - foreach ([ - 'invoice_number', - 'po_number', - 'invoice_date', - 'due_date', - 'terms', - 'public_notes', - 'invoice_footer', - 'partial', - ] as $field) { - if ($this->$field != $this->getOriginal($field)) { - return true; - } - } - - return false; - } - /** * @param bool $calculate * @return int|mixed @@ -597,7 +570,7 @@ class Invoice extends EntityModel implements BalanceAffecting return false; } - // it isn't considered overdue until the end of the day + // it isn't considered overdue until the end of the day return time() > (strtotime($dueDate) + (60*60*24)); }