Changes to product description aren't logged in invoice history #1219

This commit is contained in:
Hillel Coren 2017-01-01 20:11:38 +02:00
parent 3dc83ee481
commit 396db1dec4
2 changed files with 1 additions and 32 deletions

View File

@ -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);

View File

@ -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