This commit is contained in:
2026-04-02 12:00:38 +02:00
parent 46dae22a71
commit e743245cee
21 changed files with 2105 additions and 196 deletions

View File

@@ -55,6 +55,23 @@ class FinanceRepository
return $this -> mdb -> select( 'crm_client', [ 'id', 'firm' ], [ 'ORDER' => [ 'firm' => 'ASC' ] ] );
}
public function categoriesFlatList()
{
return $this -> mdb -> select( 'finance_categories', [ 'id', 'name', 'group_id', 'parent_id' ], [
'ORDER' => [ 'name' => 'ASC' ]
] );
}
public function clientExists( $clientId )
{
return (bool)$this -> mdb -> has( 'crm_client', [ 'id' => (int)$clientId ] );
}
public function categoryExists( $categoryId )
{
return (bool)$this -> mdb -> has( 'finance_categories', [ 'id' => (int)$categoryId ] );
}
public function clientsWithRevenue( $date_from, $date_to, $group_id )
{
return $this -> mdb -> query(