setDefaultSorting(['id' => 'DESC']);
}
/**
* @param SelectQuery $query
*
* @return void
*/
public function configureQuery(SelectQuery $query)
{
$query
->cols([
'f.id',
'IF(o.display_name <> "", o.display_name, o.name) AS organization',
'p.name',
'CONCAT(f.tss_description, " (", f.tss_uuid, ")", IF(f.is_test_environment = 1," (TEST-Client)","")) AS tss_description',
'CONCAT(f.client_description, " (", f.client_uuid, ")") AS client_description',
'CONCAT(\'\') as menu'
])
->from('fiskaly_pos_mapping AS f')
->leftJoin('fiskaly_organization AS o', 'f.organization_id = o.fiskaly_organization_id')
->leftJoin('projekt AS p', 'f.pos_id = p.id');
}
/**
* @param ColumnCollection $columns
*
* @return void
*/
public function configureColumns(ColumnCollection $columns)
{
$columns->add(Column::hidden('id', 'id'));
$columns->add(Column::searchable('organization', 'Filiale'));
$columns->add(Column::searchable('name', 'POS Projekt'));
$columns->add(Column::searchable('tss_description', 'TSS'));
$columns->add(Column::searchable('client_description', 'Client'));
$columns->add(Column::fixed('menu', 'MenĂ¼'));
}
/**
* @param FeatureCollection $features
*
* @return void
*/
public function configureFeatures(FeatureCollection $features)
{
parent::configureFeatures($features);
$features->remove(StateSaveFeature::class);
}
}