mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Changes to product description aren't logged in invoice history #1219
This commit is contained in:
parent
3dc83ee481
commit
396db1dec4
@ -127,10 +127,6 @@ class ActivityListener
|
|||||||
*/
|
*/
|
||||||
public function updatedInvoice(InvoiceWasUpdated $event)
|
public function updatedInvoice(InvoiceWasUpdated $event)
|
||||||
{
|
{
|
||||||
if (! $event->invoice->isChanged()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$backupInvoice = Invoice::with('invoice_items', 'client.account', 'client.contacts')
|
$backupInvoice = Invoice::with('invoice_items', 'client.account', 'client.contacts')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->find($event->invoice->id);
|
->find($event->invoice->id);
|
||||||
|
@ -189,33 +189,6 @@ class Invoice extends EntityModel implements BalanceAffecting
|
|||||||
return floatval($this->amount) - floatval($this->getOriginal('amount'));
|
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
|
* @param bool $calculate
|
||||||
* @return int|mixed
|
* @return int|mixed
|
||||||
@ -597,7 +570,7 @@ class Invoice extends EntityModel implements BalanceAffecting
|
|||||||
return false;
|
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));
|
return time() > (strtotime($dueDate) + (60*60*24));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user