From 947c1e2a12540019f61fb6b3d7fe59d296c91dd0 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 21 Jul 2017 13:43:42 +0300 Subject: [PATCH] Check default docs in hasDocs --- app/Models/Invoice.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 7bed6bc82021..bf69ebff6d87 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -1330,7 +1330,11 @@ class Invoice extends EntityModel implements BalanceAffecting */ public function hasDocuments() { - if (count($this->documents)) { + if ($this->documents->count()) { + return true; + } + + if ($this->account->defaultDocuments->count()) { return true; }