1#line 2 "src/Gui/BillPay/TableModel.cpp"
3#include <Wt/WStandardItem.h>
6#include "../Dbo/Vars/Vars.h"
14 {
"accountKey" ,
"120px" , Wt::AlignmentFlag::Left },
15 {
"last4" ,
"60px" , Wt::AlignmentFlag::Center },
16 {
"Nickname" ,
"100px" , Wt::AlignmentFlag::Left },
17 {
"Gp" ,
"50px" , Wt::AlignmentFlag::Center },
18 {
"Dy" ,
"50px" , Wt::AlignmentFlag::Center },
19 {
"Min" ,
"50px" , Wt::AlignmentFlag::Right },
20 {
"Bgt" ,
"50px" , Wt::AlignmentFlag::Right },
21 {
"Actual" ,
"75px" , Wt::AlignmentFlag::Right },
22 {
"Au" ,
"50px" , Wt::AlignmentFlag::Center },
23 {
"01" ,
"35px" , Wt::AlignmentFlag::Center },
24 {
"02" ,
"35px" , Wt::AlignmentFlag::Center },
25 {
"03" ,
"35px" , Wt::AlignmentFlag::Center },
26 {
"04" ,
"35px" , Wt::AlignmentFlag::Center },
27 {
"05" ,
"35px" , Wt::AlignmentFlag::Center },
28 {
"06" ,
"35px" , Wt::AlignmentFlag::Center },
29 {
"07" ,
"35px" , Wt::AlignmentFlag::Center },
30 {
"08" ,
"35px" , Wt::AlignmentFlag::Center },
31 {
"09" ,
"35px" , Wt::AlignmentFlag::Center },
32 {
"10" ,
"35px" , Wt::AlignmentFlag::Center },
33 {
"11" ,
"35px" , Wt::AlignmentFlag::Center },
34 {
"12" ,
"35px" , Wt::AlignmentFlag::Center },
37#define COLUMN_COUNT (sizeof(columns)/sizeof(GCW::Gui::BillPay::ColumnDef_t))
47 auto _toolTip = [&](
int _col )
49 return TR( std::string(
"gcw.billPay.ttp." ) + columns[ _col ].name );
97 Wt::Orientation::Horizontal,
105 while( rowCount() > 0 )
119 std::string yesNo =
"yes";
130 std::vector< GCW::Gui::BillPay::Item >
bpItems;
131 for(
auto item : items )
138 auto isActive =
bpItem.isActive () ==
"yes";
139 auto isVisible =
bpItem.isVisible() ==
"yes";
152 if( isActive && isVisible )
160 if(
bpItem.cb( _selectedMonth ) == yesNo )
177 if( !isActive || !isVisible )
200 auto accountName = std::make_unique< Wt::WStandardItem >();
201 auto accountGuid =
bpItem.accountGuid();
203 if( accountGuid !=
"" )
233 std::vector< std::unique_ptr< Wt::WStandardItem > > columns;
234 columns.push_back( std::move( accountName ) );
235 columns.push_back( std::make_unique< Wt::WStandardItem >(
bpItem.last4 () ) );
236 columns.push_back( std::make_unique< Wt::WStandardItem >(
bpItem.nickname () ) );
237 columns.push_back( std::make_unique< Wt::WStandardItem >(
bpItem.group () ) );
238 columns.push_back( std::make_unique< Wt::WStandardItem >(
bpItem.dueDay () ) );
239 columns.push_back( std::make_unique< Wt::WStandardItem >(
bpItem.minimum () ) );
240 columns.push_back( std::make_unique< Wt::WStandardItem >(
bpItem.budget () ) );
241 columns.push_back( std::make_unique< Wt::WStandardItem >(
bpItem.actual () ) );
242 columns.push_back( std::make_unique< Wt::WStandardItem >(
bpItem.autoPay () ) );
247 for(
int month=1; month<= 12; month++ )
249 auto cb = std::make_unique< Wt::WStandardItem >(
bpItem.cbtr( month ) );
259 if( _selectedMonth == month )
260 cb-> setStyleClass(
"colsel" );
262 columns.push_back( std::move( cb ) );
269 appendRow( std::move( columns ) );
284sort( std::vector< GCW::Gui::BillPay::Item > & _bpItems )->
void
308 return item1.sortValue()
#define GCW_GUI_BILLPAY_ITEM_CFY
auto columnDef(int _col) -> ColumnDef_t
Column Definition.
auto loadData(int _selectedMonth) -> void
Reload the data based on the selected month.
Status m_status
Model Status.
auto sort(std::vector< GCW::Gui::BillPay::Item > &_bpItems) -> void
Sorter.
TableModel(int _selectedMonth, Status _status)
ctor
static constexpr const int User
static constexpr const int ToolTip
static constexpr const int Display
virtual bool setHeaderData(int section, Orientation orientation, const cpp17::any &value, ItemDataRole role=ItemDataRole::Edit)
auto byGuid(const std::string &_guid) -> Item::Ptr
Load Account by GUID.
auto fullName(const std::string &_guid) -> std::string
Account Fullname via GUID.
auto getByCfy(const std::string &_cfyValue) -> GCW::Dbo::Vars::Item::Vector
auto bpItem(const std::string &_guid) -> GCW::Gui::BillPay::Item
Bill Pay Item.
auto bpItems() -> std::vector< GCW::Gui::BillPay::Item >
Bill Pay Items.
@ Inactive
Disabled Status.
auto asString(Status _status) -> std::string
Get Status as String.
auto toString(int _value) -> std::string
Convert Integer to String.