GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
GCW::Gui::AccountRegister::Model Class Reference

Account Register Model. More...

#include <Model.h>

+ Inheritance diagram for GCW::Gui::AccountRegister::Model:

Public Member Functions

 Model ()
 ctor
 
auto setAccountGuid (const std::string &_accountGuid) -> void
 
auto refreshFromDisk () -> void
 Refresh From Disk.
 
auto saveToDisk () -> void
 
auto viewMode () const -> ViewMode
 
auto setViewMode (ViewMode _viewMode) -> void
 
auto doubleLine () const -> bool
 
auto setDoubleLine (bool _doubleLine) -> void
 
auto splitCount () -> int
 Split Count.
 
auto isDeletable (const Wt::WModelIndex &_index) -> bool
 Is Read Only.
 
auto isJumpable (const Wt::WModelIndex &_index) -> bool
 Is Jumpable.
 
auto isReadOnly () -> bool
 
auto isReadOnly (int _row) -> bool
 
auto isReadOnly (const Wt::WModelIndex &_index) -> bool
 
auto setReadOnly (bool _state)
 
auto getSplitGuid (const Wt::WModelIndex &_index) -> std::string
 Get GUID from row.
 
auto getSplitGuid (int _row) -> std::string
 
auto getDate (const Wt::WModelIndex &_index) -> Wt::WDateTime
 Get Date from the index.
 
auto getAction (const Wt::WModelIndex &_index) -> std::string
 Get Action.
 
auto getDescription (const Wt::WModelIndex &_index) -> std::string
 Get Description.
 
auto getTransferText (const Wt::WModelIndex &_index) -> std::string
 Get Transfer Account Text.
 
auto getTransferGuid (const Wt::WModelIndex &_index) -> std::string
 Get Transfer Account GUID.
 
auto getReconcile (const Wt::WModelIndex &_index) -> std::string
 Get Reconciliation.
 
auto getNumeric (const Wt::WModelIndex &_index) -> GCW_NUMERIC
 Get numeric value.
 
auto getDebit (const Wt::WModelIndex &_index) -> GCW_NUMERIC
 Get Debit value.
 
auto getCredit (const Wt::WModelIndex &_index) -> GCW_NUMERIC
 Get Credit value.
 
auto getValue (const Wt::WModelIndex &_index) -> GCW_NUMERIC
 Get Value (positive or negative)
 
auto getBalance (const Wt::WModelIndex &_index) -> GCW_NUMERIC
 Get Balance (positive or negative)
 
auto present () const -> GCW_NUMERIC
 
auto future () const -> GCW_NUMERIC
 
auto cleared () const -> GCW_NUMERIC
 
auto reconciled () const -> GCW_NUMERIC
 
auto projected () const -> GCW_NUMERIC
 
auto makeRow (const std::string &_splitGuid) -> RowItem
 
auto suggestionsFromColumn (int _column) const -> std::set< std::string >
 Column Suggestions.
 
auto setData (const Wt::WModelIndex &_index, const Wt::cpp17::any &_value, Wt::ItemDataRole _role) -> bool
 
auto goneDirty () -> Wt::Signal< Wt::WModelIndex > &
 
- Public Member Functions inherited from Wt::WStandardItemModel
 WStandardItemModel ()
 
 WStandardItemModel (int rows, int columns)
 
 ~WStandardItemModel ()
 
void clear ()
 
WStandardIteminvisibleRootItem () const
 
WModelIndex indexFromItem (const WStandardItem *item) const
 
WStandardItemitemFromIndex (const WModelIndex &index) const
 
void appendColumn (std::vector< std::unique_ptr< WStandardItem > > items)
 
void insertColumn (int column, std::vector< std::unique_ptr< WStandardItem > > items)
 
void appendRow (std::vector< std::unique_ptr< WStandardItem > > items)
 
void insertRow (int row, std::vector< std::unique_ptr< WStandardItem > > items)
 
void appendRow (std::unique_ptr< WStandardItem > item)
 
void insertRow (int row, std::unique_ptr< WStandardItem > item)
 
WStandardItemitem (int row, int column=0) const
 
void setItem (int row, int column, std::unique_ptr< WStandardItem > item)
 
WStandardItemitemPrototype () const
 
void setItemPrototype (std::unique_ptr< WStandardItem > item)
 
std::vector< std::unique_ptr< WStandardItem > > takeColumn (int column)
 
std::vector< std::unique_ptr< WStandardItem > > takeRow (int row)
 
std::unique_ptr< WStandardItemtakeItem (int row, int column=0)
 
void setHeaderFlags (int section, Orientation orientation, WFlags< HeaderFlag > flags)
 
void setSortRole (ItemDataRole role)
 
ItemDataRole sortRole () const
 
virtual void sort (int column, SortOrder order=SortOrder::Ascending) override
 
Signal< WStandardItem * > & itemChanged ()
 
bool insertRow (int row, const WModelIndex &parent=WModelIndex())
 
bool insertColumn (int column, const WModelIndex &parent=WModelIndex())
 
- Public Member Functions inherited from Wt::WAbstractItemModel
 WAbstractItemModel ()
 
virtual int columnCount (const WModelIndex &parent=WModelIndex()) const=0
 
virtual int rowCount (const WModelIndex &parent=WModelIndex()) const=0
 
virtual WFlags< ItemFlagflags (const WModelIndex &index) const
 
virtual WFlags< HeaderFlagheaderFlags (int section, Orientation orientation=Orientation::Horizontal) const
 
virtual bool hasChildren (const WModelIndex &index) const
 
virtual WModelIndex parent (const WModelIndex &index) const=0
 
virtual cpp17::any data (const WModelIndex &index, ItemDataRole role=ItemDataRole::Display) const=0
 
virtual DataMap itemData (const WModelIndex &index) const
 
virtual cpp17::any headerData (int section, Orientation orientation=Orientation::Horizontal, ItemDataRole role=ItemDataRole::Display) const
 
virtual WModelIndex index (int row, int column, const WModelIndex &parent=WModelIndex()) const=0
 
virtual WModelIndexList match (const WModelIndex &start, ItemDataRole role, const cpp17::any &value, int hits=-1, WFlags< MatchFlag > flags=WFlags< MatchFlag >(MatchFlag::StartsWith|MatchFlag::Wrap)) const
 
cpp17::any data (int row, int column, ItemDataRole role=ItemDataRole::Display, const WModelIndex &parent=WModelIndex()) const
 
virtual bool hasIndex (int row, int column, const WModelIndex &parent=WModelIndex()) const
 
virtual bool insertColumns (int column, int count, const WModelIndex &parent=WModelIndex())
 
virtual bool insertRows (int row, int count, const WModelIndex &parent=WModelIndex())
 
virtual bool removeColumns (int column, int count, const WModelIndex &parent=WModelIndex())
 
virtual bool removeRows (int row, int count, const WModelIndex &parent=WModelIndex())
 
virtual bool setData (const WModelIndex &index, const cpp17::any &value, ItemDataRole role=ItemDataRole::Edit)
 
virtual bool setItemData (const WModelIndex &index, const DataMap &values)
 
virtual bool setHeaderData (int section, Orientation orientation, const cpp17::any &value, ItemDataRole role=ItemDataRole::Edit)
 
bool setHeaderData (int section, const cpp17::any &value)
 
virtual void expandColumn (int column)
 
virtual void collapseColumn (int column)
 
virtual void * toRawIndex (const WModelIndex &index) const
 
virtual WModelIndex fromRawIndex (void *rawIndex) const
 
virtual std::string mimeType () const
 
virtual std::vector< std::string > acceptDropMimeTypes () const
 
virtual void dropEvent (const WDropEvent &e, DropAction action, int row, int column, const WModelIndex &parent)
 
virtual void dropEvent (const WDropEvent &e, DropAction action, const WModelIndex &index, Wt::Side side)
 
bool insertColumn (int column, const WModelIndex &parent=WModelIndex())
 
bool insertRow (int row, const WModelIndex &parent=WModelIndex())
 
bool removeColumn (int column, const WModelIndex &parent=WModelIndex())
 
bool removeRow (int row, const WModelIndex &parent=WModelIndex())
 
bool setData (int row, int column, const cpp17::any &value, ItemDataRole role=ItemDataRole::Edit, const WModelIndex &parent=WModelIndex())
 
virtual Signal< WModelIndex, int, int > & columnsAboutToBeInserted ()
 
virtual Signal< WModelIndex, int, int > & columnsAboutToBeRemoved ()
 
virtual Signal< WModelIndex, int, int > & columnsInserted ()
 
virtual Signal< WModelIndex, int, int > & columnsRemoved ()
 
virtual Signal< WModelIndex, int, int > & rowsAboutToBeInserted ()
 
virtual Signal< WModelIndex, int, int > & rowsAboutToBeRemoved ()
 
virtual Signal< WModelIndex, int, int > & rowsInserted ()
 
virtual Signal< WModelIndex, int, int > & rowsRemoved ()
 
virtual Signal< WModelIndex, WModelIndex > & dataChanged ()
 
virtual Signal< Orientation, int, int > & headerDataChanged ()
 
virtual SignallayoutAboutToBeChanged ()
 
virtual SignallayoutChanged ()
 
virtual SignalmodelReset ()
 
- Public Member Functions inherited from Wt::WObject
void addChild (std::unique_ptr< WObject > child)
 
Child * addChild (std::unique_ptr< Child > child)
 
std::unique_ptr< WObjectremoveChild (WObject *child)
 
std::unique_ptr< Child > removeChild (Child *child)
 
virtual const std::string id () const
 
virtual void setObjectName (const std::string &name)
 
virtual std::string objectName () const
 
void resetLearnedSlots ()
 
void resetLearnedSlot (void(T::*method)())
 
WStatelessSlot * implementStateless (void(T::*method)())
 
WStatelessSlot * implementStateless (void(T::*method)(), void(T::*undoMethod)())
 
void isNotStateless ()
 
WStatelessSlot * implementJavaScript (void(T::*method)(), const std::string &jsCode)
 
- Public Member Functions inherited from Wt::Core::observable
 observable () noexcept
 
virtual ~observable ()
 
auto bindSafe (void(C::*method)(Args...)) noexcept
 
auto bindSafe (void(C::*method)(Args...) const) const noexcept
 
auto bindSafe (const Function &function) noexcept
 

Private Types

using RowItem = std::vector< std::unique_ptr< Wt::WStandardItem > >
 
using ColItem = Wt::WStandardItem *
 

Private Member Functions

auto setStyleClass (int _row, const std::string &_class) -> void
 
auto removeStyleClass (int _row, const std::string &_class) -> void
 
auto getString (const Wt::WModelIndex &_index, int column) -> std::string
 
auto saveToDisk (const Wt::WModelIndex &_index) -> void
 

Private Attributes

Wt::Signal< Wt::WModelIndexm_goneDirty
 
bool m_readOnly = false
 Editable Indicator.
 
ViewMode m_viewMode = ViewMode::BASIC_LEDGER
 
bool m_doubleLine = false
 
std::string m_accountGuid
 Account GUID.
 
Wt::WDateTime m_lastDate
 
int m_splitCount
 Accumulators.
 
GCW_NUMERIC m_balance
 
GCW_NUMERIC m_present
 
GCW_NUMERIC m_future
 
GCW_NUMERIC m_cleared
 
GCW_NUMERIC m_reconciled
 
GCW_NUMERIC m_projected
 

Friends

class Eng::Transaction::Manager
 

Additional Inherited Members

- Public Types inherited from Wt::WAbstractItemModel
typedef std::map< ItemDataRole, cpp17::any > DataMap
 
- Public Types inherited from Wt::WObject
typedef void(WObject::* Method) ()
 
- Protected Member Functions inherited from Wt::WStandardItemModel
virtual void copyData (const WModelIndex &sIndex, const WModelIndex &dIndex) override
 
- Protected Member Functions inherited from Wt::WAbstractItemModel
void reset ()
 
WModelIndex createIndex (int row, int column, void *ptr) const
 
WModelIndex createIndex (int row, int column, ::uint64_t id) const
 
void beginInsertColumns (const WModelIndex &parent, int first, int last)
 
void beginInsertRows (const WModelIndex &parent, int first, int last)
 
void beginRemoveColumns (const WModelIndex &parent, int first, int last)
 
void beginRemoveRows (const WModelIndex &parent, int first, int last)
 
void endInsertColumns ()
 
void endInsertRows ()
 
void endRemoveColumns ()
 
void endRemoveRows ()
 
- Protected Member Functions inherited from Wt::WObject
virtual WStatelessSlot * getStateless (Method method)
 

Detailed Description

Account Register Model.

This model is used to present account details to the 'editor register' (the spreadsheet-looking book-like-looking thing that the user posts transactions through.

Definition at line 28 of file Model.h.

Member Typedef Documentation

◆ ColItem

Definition at line 32 of file Model.h.

◆ RowItem

using GCW::Gui::AccountRegister::Model::RowItem = std::vector< std::unique_ptr< Wt::WStandardItem > >
private

Definition at line 31 of file Model.h.

Constructor & Destructor Documentation

◆ Model()

GCW::Gui::AccountRegister::Model::Model ( )

Member Function Documentation

◆ cleared()

auto GCW::Gui::AccountRegister::Model::cleared ( ) const -> GCW_NUMERIC
inline

Definition at line 170 of file Model.h.

References m_cleared.

◆ doubleLine()

auto GCW::Gui::AccountRegister::Model::doubleLine ( ) const -> bool
inline

Definition at line 50 of file Model.h.

References m_doubleLine.

◆ future()

auto GCW::Gui::AccountRegister::Model::future ( ) const -> GCW_NUMERIC
inline

Definition at line 169 of file Model.h.

References m_future.

◆ getAction()

auto GCW::Gui::AccountRegister::Model::getAction ( const Wt::WModelIndex _index) -> std::string

Get Action.

Definition at line 255 of file Model.cpp.

References GCW::Gui::AccountRegister::ACTION, and GCW::Gui::AccountRegister::asInt().

◆ getBalance()

auto GCW::Gui::AccountRegister::Model::getBalance ( const Wt::WModelIndex _index) -> GCW_NUMERIC

Get Balance (positive or negative)

◆ getCredit()

auto GCW::Gui::AccountRegister::Model::getCredit ( const Wt::WModelIndex _index) -> GCW_NUMERIC

Get Credit value.

Definition at line 318 of file Model.cpp.

References GCW::Gui::AccountRegister::asInt(), and GCW::Gui::AccountRegister::CREDIT.

◆ getDate()

auto GCW::Gui::AccountRegister::Model::getDate ( const Wt::WModelIndex _index) -> Wt::WDateTime

Get Date from the index.

This pulls the 'date' column out and returns it as a WDateTime value.

Note
This will 'force' the 'time' component to be equal to the default time of '10:59:00', since the 'date' column does not support a time component... this seems to be consistent with GnuCash.

Definition at line 235 of file Model.cpp.

References GCW::Gui::AccountRegister::asInt(), GCW::Gui::AccountRegister::DATE, Wt::WDateTime::fromString(), GCW_DATE_DEFAULT_TIME, GCW_DATE_FORMAT_DISPLAY, and Wt::WDateTime::setTime().

◆ getDebit()

auto GCW::Gui::AccountRegister::Model::getDebit ( const Wt::WModelIndex _index) -> GCW_NUMERIC

Get Debit value.

Definition at line 309 of file Model.cpp.

References GCW::Gui::AccountRegister::asInt(), and GCW::Gui::AccountRegister::DEBIT.

◆ getDescription()

auto GCW::Gui::AccountRegister::Model::getDescription ( const Wt::WModelIndex _index) -> std::string

Get Description.

Definition at line 263 of file Model.cpp.

References GCW::Gui::AccountRegister::asInt(), and GCW::Gui::AccountRegister::DESCRIPTION.

◆ getNumeric()

auto GCW::Gui::AccountRegister::Model::getNumeric ( const Wt::WModelIndex _index) -> GCW_NUMERIC

Get numeric value.

This returns the numeric value of the line. This is suitable for querying either the debit or credit column values (and is really intended for internal use). The 'value' is pulled from the Display value of the index and converted to a GCW_NUMERIC value.

Definition at line 296 of file Model.cpp.

References Wt::asString(), Wt::ItemDataRole::Display, GCW_NUMERIC, and Wt::WString::toUTF8().

◆ getReconcile()

auto GCW::Gui::AccountRegister::Model::getReconcile ( const Wt::WModelIndex _index) -> std::string

Get Reconciliation.

Definition at line 288 of file Model.cpp.

References GCW::Gui::AccountRegister::asInt(), and GCW::Gui::AccountRegister::RECONCILE.

◆ getSplitGuid() [1/2]

auto GCW::Gui::AccountRegister::Model::getSplitGuid ( const Wt::WModelIndex _index) -> std::string

Get GUID from row.

This will retrieve the GUID value from the row.

Definition at line 342 of file Model.cpp.

References GCW::Gui::AccountRegister::asInt(), Wt::asString(), GCW::Gui::AccountRegister::DATE, and Wt::ItemDataRole::User.

◆ getSplitGuid() [2/2]

auto GCW::Gui::AccountRegister::Model::getSplitGuid ( int  _row) -> std::string

◆ getString()

auto GCW::Gui::AccountRegister::Model::getString ( const Wt::WModelIndex _index,
int  column 
) -> std::string
private

Definition at line 221 of file Model.cpp.

References Wt::asString(), and Wt::ItemDataRole::Display.

◆ getTransferGuid()

auto GCW::Gui::AccountRegister::Model::getTransferGuid ( const Wt::WModelIndex _index) -> std::string

Get Transfer Account GUID.

Definition at line 279 of file Model.cpp.

References GCW::Dbo::Accounts::byFullName().

◆ getTransferText()

auto GCW::Gui::AccountRegister::Model::getTransferText ( const Wt::WModelIndex _index) -> std::string

Get Transfer Account Text.

Definition at line 271 of file Model.cpp.

References GCW::Gui::AccountRegister::asInt(), and GCW::Gui::AccountRegister::TRANSFER.

◆ getValue()

auto GCW::Gui::AccountRegister::Model::getValue ( const Wt::WModelIndex _index) -> GCW_NUMERIC

Get Value (positive or negative)

The value that gets stored in the back-end database is either positive for debit, and negative for credit. This function will read-out the debit and credit columns in the register display and figure out if the returned value should be returned positive or negative corrected.

This function always positive for debit, and negative for credit values.

Definition at line 327 of file Model.cpp.

References GCW_NUMERIC.

◆ goneDirty()

auto GCW::Gui::AccountRegister::Model::goneDirty ( ) -> Wt::Signal< Wt::WModelIndex > &
inline

Definition at line 187 of file Model.h.

References m_goneDirty.

◆ isDeletable()

auto GCW::Gui::AccountRegister::Model::isDeletable ( const Wt::WModelIndex _index) -> bool

Is Read Only.

This returns .true. if the item can be deleted.

If this transaction split has no guid then it's a new row, and cannot be deleted

If this transaction split is reconciled, then it is considered not deletable

Definition at line 101 of file Model.cpp.

References GCW::Dbo::Splits::byGuid(), and split().

◆ isJumpable()

auto GCW::Gui::AccountRegister::Model::isJumpable ( const Wt::WModelIndex _index) -> bool

Is Jumpable.

This returns .true. if the item can be jumped to the other account in the split

If this transaction split has no guid then it's a new row, and cannot be jumped

Need to have another split to be jumpable

Definition at line 127 of file Model.cpp.

◆ isReadOnly() [1/3]

auto GCW::Gui::AccountRegister::Model::isReadOnly ( ) -> bool

Definition at line 154 of file Model.cpp.

◆ isReadOnly() [2/3]

auto GCW::Gui::AccountRegister::Model::isReadOnly ( const Wt::WModelIndex _index) -> bool

If this transaction split has no guid then it's a new row, and can be edited

If this transaction split is reconciled, then it is considered not editable.

We have to convert this _index in to the proper split that represents it, and then query that split to see if it is reconciled or not. We use the transaction manager to get this done, as it encapsulates a bunch of different tools for manipulating the data.

Definition at line 161 of file Model.cpp.

◆ isReadOnly() [3/3]

auto GCW::Gui::AccountRegister::Model::isReadOnly ( int  _row) -> bool

Definition at line 205 of file Model.cpp.

◆ makeRow()

auto GCW::Gui::AccountRegister::Model::makeRow ( const std::string &  _splitGuid) -> RowItem

Definition at line 810 of file Model.cpp.

◆ present()

auto GCW::Gui::AccountRegister::Model::present ( ) const -> GCW_NUMERIC
inline

Definition at line 168 of file Model.h.

References m_present.

◆ projected()

auto GCW::Gui::AccountRegister::Model::projected ( ) const -> GCW_NUMERIC
inline

Definition at line 172 of file Model.h.

References m_projected.

◆ reconciled()

auto GCW::Gui::AccountRegister::Model::reconciled ( ) const -> GCW_NUMERIC
inline

Definition at line 171 of file Model.h.

References m_reconciled.

◆ refreshFromDisk()

auto GCW::Gui::AccountRegister::Model::refreshFromDisk ( ) -> void

Refresh From Disk.

This procedure reads from the gnucash storage source (either postgres or sqlite) and loads all of the transactions and their associated splits in to the model suitable for editing within an automatic table view.

Before refreshing from disk, the entire contents of the model are cleared, so it is important to make sure anything to be saved from the model is done first.

In order to produce a proper 'register' of items, it is important to load the data from the 'splits' side of the transaction rather than the transaction itself.

Note that when the splits are loaded based on the account ID, they are returned in a std::vector(sorted_by_date) that is sorted based on the transction date. This chosen sort method insures that the running balance can be accurately calculated on the fly, since each item is pulled from the vector in a sorted order, and the running balance is included in the model row. The user can sort the user interface later and still have the line-item-balance remain accurate.

Each item is processed from the vector in sequential order. In this process we grab the contents of the split, and generate a model item row containing all of the column values. Maintain a running balance as we go along to keep the balance reflected within the view. The result is a multi-column row item that is added to the model. This allows the model to be subsequently re-sorted or subset-extracted without affecting the running balances and so forth.

After all the split items are loaded, an additional ~blank~ item is included at the end of the vector, for coding new entries.

poke all the header labels in. Note that some of the labels change depending on the account debit/credit type. We get those from the accountDef.

Bug:
Needs work this is modified a bit to allow for a default account def. this is necessary since it is possible to ask for an account register that is not (yet) associated to an account... this can happen in the BillPay module when setting up a new account for bill-pay functions. (kind of sloppy doing it here) The first item at(0) represents the default-register settings, suitable for any register view.

Definition at line 603 of file Model.cpp.

References GCW::Eng::Transaction::Manager::appendRow(), GCW::Dbo::Splits::byAccount(), GCW::Dbo::Accounts::byGuid(), GCW::Dbo::Accounts::ACCOUNTDEF_S::colAccount, GCW::Dbo::Accounts::ACCOUNTDEF_S::colCr, GCW::Dbo::Accounts::ACCOUNTDEF_S::colDr, Wt::ItemDataRole::Edit, Wt::Editable, GCW_NUMERIC, GCW_RECONCILE_YES, GCW::Dbo::Prefrences::get(), GCW::Dbo::Accounts::s_accountDefs, GCW::Eng::Transaction::Manager::setReadOnly(), GCW::Eng::Transaction::Manager::setSplitItem(), TR, and GCW::Eng::Transaction::Manager::transactionItem().

◆ removeStyleClass()

auto GCW::Gui::AccountRegister::Model::removeStyleClass ( int  _row,
const std::string &  _class 
) -> void
private

Definition at line 843 of file Model.cpp.

◆ saveToDisk() [1/2]

auto GCW::Gui::AccountRegister::Model::saveToDisk ( ) -> void

Definition at line 213 of file Model.cpp.

References FUNCTION_HEADER.

◆ saveToDisk() [2/2]

auto GCW::Gui::AccountRegister::Model::saveToDisk ( const Wt::WModelIndex _index) -> void
private

◆ setAccountGuid()

auto GCW::Gui::AccountRegister::Model::setAccountGuid ( const std::string &  _accountGuid) -> void

Definition at line 66 of file Model.cpp.

◆ setData()

auto GCW::Gui::AccountRegister::Model::setData ( const Wt::WModelIndex _index,
const Wt::cpp17::any &  _value,
Wt::ItemDataRole  _role 
) -> bool

◆ setDoubleLine()

auto GCW::Gui::AccountRegister::Model::setDoubleLine ( bool  _doubleLine) -> void

Definition at line 84 of file Model.cpp.

◆ setReadOnly()

auto GCW::Gui::AccountRegister::Model::setReadOnly ( bool  _state)
inline

Definition at line 83 of file Model.h.

References m_readOnly.

◆ setStyleClass()

auto GCW::Gui::AccountRegister::Model::setStyleClass ( int  _row,
const std::string &  _class 
) -> void
private

Definition at line 835 of file Model.cpp.

◆ setViewMode()

auto GCW::Gui::AccountRegister::Model::setViewMode ( ViewMode  _viewMode) -> void

Definition at line 75 of file Model.cpp.

◆ splitCount()

auto GCW::Gui::AccountRegister::Model::splitCount ( ) -> int

Split Count.

This is ~slightly~ different than the rowCount() since rowCount will return the number of rows in the model, and splitCount will return the number of splits used to build the model.

Definition at line 93 of file Model.cpp.

◆ suggestionsFromColumn()

auto GCW::Gui::AccountRegister::Model::suggestionsFromColumn ( int  _column) const -> std::set< std::string >

Column Suggestions.

This produces a unique-set of items that represent all the text-values for that particular column. This is used to produce a suggestion-box for the register.

Definition at line 820 of file Model.cpp.

References Wt::asString(), and Wt::WString::toUTF8().

◆ viewMode()

auto GCW::Gui::AccountRegister::Model::viewMode ( ) const -> ViewMode
inline

Definition at line 47 of file Model.h.

References m_viewMode.

Friends And Related Symbol Documentation

◆ Eng::Transaction::Manager

friend class Eng::Transaction::Manager
friend

Definition at line 273 of file Model.h.

Member Data Documentation

◆ m_accountGuid

std::string GCW::Gui::AccountRegister::Model::m_accountGuid
private

Account GUID.

The model is associated with a single account.

Definition at line 234 of file Model.h.

◆ m_balance

GCW_NUMERIC GCW::Gui::AccountRegister::Model::m_balance
private

Definition at line 266 of file Model.h.

◆ m_cleared

GCW_NUMERIC GCW::Gui::AccountRegister::Model::m_cleared
private

Definition at line 269 of file Model.h.

Referenced by cleared().

◆ m_doubleLine

bool GCW::Gui::AccountRegister::Model::m_doubleLine = false
private

Definition at line 227 of file Model.h.

Referenced by doubleLine().

◆ m_future

GCW_NUMERIC GCW::Gui::AccountRegister::Model::m_future
private

Definition at line 268 of file Model.h.

Referenced by future().

◆ m_goneDirty

Wt::Signal< Wt::WModelIndex > GCW::Gui::AccountRegister::Model::m_goneDirty
private

Definition at line 212 of file Model.h.

Referenced by goneDirty().

◆ m_lastDate

Wt::WDateTime GCW::Gui::AccountRegister::Model::m_lastDate
private

Definition at line 240 of file Model.h.

Referenced by Model().

◆ m_present

GCW_NUMERIC GCW::Gui::AccountRegister::Model::m_present
private

Definition at line 267 of file Model.h.

Referenced by present().

◆ m_projected

GCW_NUMERIC GCW::Gui::AccountRegister::Model::m_projected
private

Definition at line 271 of file Model.h.

Referenced by projected().

◆ m_readOnly

bool GCW::Gui::AccountRegister::Model::m_readOnly = false
private

Editable Indicator.

The model can be either R/W (read-write) or R/O (read-only).

Definition at line 224 of file Model.h.

Referenced by setReadOnly().

◆ m_reconciled

GCW_NUMERIC GCW::Gui::AccountRegister::Model::m_reconciled
private

Definition at line 270 of file Model.h.

Referenced by reconciled().

◆ m_splitCount

int GCW::Gui::AccountRegister::Model::m_splitCount
private

Accumulators.

Todo:
these are additional values that need to be available

balance balance limit balance (Period) balance usd cleared cleared usd fiture minimum future minimum usa last num last reconcile date opening balance present present usd reconciled reconciled usd total total period total usd

Definition at line 265 of file Model.h.

◆ m_viewMode

ViewMode GCW::Gui::AccountRegister::Model::m_viewMode = ViewMode::BASIC_LEDGER
private

Definition at line 226 of file Model.h.

Referenced by viewMode().


The documentation for this class was generated from the following files: