GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
Loading...
Searching...
No Matches
AccountComboModel.cpp
Go to the documentation of this file.
1#line 2 "src/Eng/AccountComboModel.cpp"
2
3#include <Wt/WStandardItem.h>
4#include <Wt/WStandardItemModel.h>
5
6#include "../App.h"
7#include "../Dbo/Accounts/Accounts.h"
8#include "AccountComboModel.h"
9
12: Wt::WStandardItemModel( 0, 2 )
13{
14
15 Wt::Dbo::Transaction t( GCW::app()-> gnucashew_session() );
16 for( auto accountItem : GCW::Dbo::Accounts::allAccounts() )
17 {
18 std::vector< std::unique_ptr< Wt::WStandardItem > > row;
19 row.push_back( std::make_unique< Wt::WStandardItem >( accountItem-> guid() ) );
20 row.push_back( std::make_unique< Wt::WStandardItem >( GCW::Dbo::Accounts::fullName( accountItem-> guid() ) ) );
21 appendRow( std::move( row ) );
22
23 } // endfor( auto accountItem : GCW::Dbo::Accounts::allAccounts() )
24
25} // endAccountSuggestionModel()
26
27
void appendRow(std::vector< std::unique_ptr< WStandardItem > > items)
auto allAccounts() -> Item::Vector
Load all accounts.
auto fullName(const std::string &_guid) -> std::string
Account Fullname via GUID.
App * app()
Definition App.cpp:75