1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Fixes for including company.quotes (#3173)

This commit is contained in:
David Bomba 2019-12-27 09:49:47 +11:00 committed by GitHub
parent d797799196
commit 8eb3c75eb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,12 +21,13 @@ use App\Models\CompanyUser;
use App\Models\GroupSetting;
use App\Models\Payment;
use App\Models\Product;
use App\Models\Quote;
use App\Models\TaxRate;
use App\Models\User;
use App\Utils\Traits\MakesHash;
/**
* Class AccountTranCompanyTransformersformer.
* Class CompanyTransformer.
*/
class CompanyTransformer extends EntityTransformer
{
@ -57,7 +58,8 @@ class CompanyTransformer extends EntityTransformer
'company_user',
'groups',
'company_gateways',
'activities'
'activities',
'quotes',
];
@ -150,6 +152,13 @@ class CompanyTransformer extends EntityTransformer
return $this->includeCollection($company->invoices, $transformer, Invoice::class);
}
public function includeQuotes(Company $company)
{
$transformer = new QuoteTransformer($this->serializer);
return $this->includeCollection($company->quotes, $transformer, Quote::class);
}
public function includeAccount(Company $company)
{