mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Added payment terms to API
This commit is contained in:
parent
30218479ff
commit
e0468571a4
@ -501,6 +501,14 @@ class Account extends Eloquent
|
|||||||
return $this->hasMany('App\Models\Project', 'account_id', 'id')->withTrashed();
|
return $this->hasMany('App\Models\Project', 'account_id', 'id')->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||||
|
*/
|
||||||
|
public function custom_payment_terms()
|
||||||
|
{
|
||||||
|
return $this->hasMany('App\Models\PaymentTerm', 'account_id', 'id')->withTrashed();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
|
@ -61,6 +61,7 @@ class UserAccountTransformer extends EntityTransformer
|
|||||||
'tax_rates',
|
'tax_rates',
|
||||||
'expense_categories',
|
'expense_categories',
|
||||||
'account_email_settings',
|
'account_email_settings',
|
||||||
|
'custom_payment_terms',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $tokenName;
|
protected $tokenName;
|
||||||
@ -84,6 +85,18 @@ class UserAccountTransformer extends EntityTransformer
|
|||||||
*
|
*
|
||||||
* @return \League\Fractal\Resource\Collection
|
* @return \League\Fractal\Resource\Collection
|
||||||
*/
|
*/
|
||||||
|
public function includeCustomPaymentTerms(User $user)
|
||||||
|
{
|
||||||
|
$transformer = new PaymentTermTransformer($this->account, $this->serializer);
|
||||||
|
|
||||||
|
return $this->includeCollection($this->account->custom_payment_terms, $transformer, 'payment_terms');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Account $account
|
||||||
|
*
|
||||||
|
* @return \League\Fractal\Resource\Collection
|
||||||
|
*/
|
||||||
public function includeUsers(User $user)
|
public function includeUsers(User $user)
|
||||||
{
|
{
|
||||||
$transformer = new UserTransformer($this->account, $this->serializer);
|
$transformer = new UserTransformer($this->account, $this->serializer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user