Merge branch 'master' of github.com:akaunting/akaunting

This commit is contained in:
Cüneyt Şentürk 2021-01-14 12:30:49 +03:00
commit ca7c5b120e
3 changed files with 4 additions and 3 deletions

View File

@ -11,7 +11,7 @@ class BillTransactions extends Export implements WithColumnFormatting
{
public function collection()
{
$model = Model::with('account', 'category', 'contact', 'document')->bill()->isDocument()->usingSearchString(request('search'));
$model = Model::with('account', 'category', 'contact', 'document')->expense()->isDocument()->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('document_id', (array) $this->ids);

View File

@ -13,7 +13,7 @@ class InvoiceTransactions extends Export implements WithColumnFormatting
{
public function collection()
{
$model = Model::with('account', 'category', 'contact', 'document')->invoice()->isDocument()->usingSearchString(request('search'));
$model = Model::with('account', 'category', 'contact', 'document')->income()->isDocument()->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('document_id', (array) $this->ids);

View File

@ -131,7 +131,8 @@ class Document extends Model
public function transactions()
{
return $this->hasMany('App\Models\Banking\Transaction', 'document_id')->where('type', 'income');
return $this->hasMany('App\Models\Banking\Transaction', 'document_id')
->where('type', config('type.' . $this->type . '.transaction_type'));
}
public function totals_sorted()