send the document clone to event

This commit is contained in:
Denis Duliçi 2020-08-15 17:48:37 +03:00
parent c63515c21c
commit 87548609a6

View File

@ -117,12 +117,12 @@ abstract class DocumentModel extends Model
$this->setAttribute('reconciled', $reconciled); $this->setAttribute('reconciled', $reconciled);
// TODO: find a cleaner way compatible with observer pattern // TODO: find a cleaner way compatible with observer pattern
$i = new \stdClass(); $invoice = clone $this;
$i->paid = $paid; $invoice->paid_amount = $paid;
event(new InvoicePaidCalculated($i)); event(new InvoicePaidCalculated($invoice));
return round($i->paid, $precision); return round($invoice->paid_amount, $precision);
} }
/** /**
* Get the status label. * Get the status label.