added currency transformer to incomes/expenses api
This commit is contained in:
@ -27,6 +27,11 @@ class BillPayment extends Model
|
||||
return $this->belongsTo('App\Models\Banking\Account');
|
||||
}
|
||||
|
||||
public function currency()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Setting\Currency', 'currency_code', 'code');
|
||||
}
|
||||
|
||||
public function bill()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Expense\Bill');
|
||||
|
@ -27,6 +27,11 @@ class InvoicePayment extends Model
|
||||
return $this->belongsTo('App\Models\Banking\Account');
|
||||
}
|
||||
|
||||
public function currency()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Setting\Currency', 'currency_code', 'code');
|
||||
}
|
||||
|
||||
public function invoice()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Income\Invoice');
|
||||
|
@ -38,6 +38,11 @@ class Currency extends Model
|
||||
return $this->hasMany('App\Models\Income\Invoice', 'currency_code', 'code');
|
||||
}
|
||||
|
||||
public function invoice_payments()
|
||||
{
|
||||
return $this->hasMany('App\Models\Income\InvoicePayment', 'currency_code', 'code');
|
||||
}
|
||||
|
||||
public function revenues()
|
||||
{
|
||||
return $this->hasMany('App\Models\Income\Revenue', 'currency_code', 'code');
|
||||
@ -48,6 +53,11 @@ class Currency extends Model
|
||||
return $this->hasMany('App\Models\Expense\Bill', 'currency_code', 'code');
|
||||
}
|
||||
|
||||
public function bill_payments()
|
||||
{
|
||||
return $this->hasMany('App\Models\Expense\BillPayment', 'currency_code', 'code');
|
||||
}
|
||||
|
||||
public function payments()
|
||||
{
|
||||
return $this->hasMany('App\Models\Expense\Payment', 'currency_code', 'code');
|
||||
|
Reference in New Issue
Block a user