improved performance

This commit is contained in:
Denis Duliçi
2020-06-06 21:47:02 +03:00
parent f003f99d71
commit 657c86a29c
11 changed files with 22 additions and 22 deletions

View File

@ -171,7 +171,7 @@ abstract class DocumentModel extends Model
{
$amount = $this->amount;
$this->totals()->where('code', 'tax')->each(function ($tax) use(&$amount) {
collect($this->totals)->where('code', 'tax')->each(function ($tax) use(&$amount) {
$amount -= $tax->amount;
});