FreeDebks  1.0.3
 All Classes Files Functions Variables Friends Pages
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
FdItemJournal Class Reference

Entries, items for FdModelJournal. More...

#include <FdItemJournal.hpp>

Public Member Functions

 FdItemJournal (QDate date, QString object="", QString label="", FdItemCoa_p debit=FdItemCoa_p(0), FdItemCoa_p credit=FdItemCoa_p(0), double amount=0)
QDate date () const
QString object () const
QString label () const
FdItemCoa_p debit () const
FdItemCoa_p credit () const
double amount () const
void setDate (QDate date)
void setObject (QString object)
void setLabel (QString label)
void setDebit (FdItemCoa_p account)
void setCredit (FdItemCoa_p account)
void setAmount (double amount)
bool isEmpty () const
bool isValid () const
bool breakDown () const
QDomElement toXml (QDomDocument &document) const

Static Public Member Functions

static FdItemJournal_p pointer (FdSubWindow *subwindow, QDomElement &entry)

Private Attributes

QDate mDate
QString mObject
QString mLabel
FdItemCoa_p mDebit
FdItemCoa_p mCredit
double mAmount

Detailed Description

Entries, items for FdModelJournal.

An entry is a line in of the journal (a table) and a field is a column, which are :

Those fields can be completed by the user (see FdModelJournal::setData()).

See Also
FdModelJournal and FdViewJournal.

Definition at line 47 of file FdItemJournal.hpp.

Constructor & Destructor Documentation

FdItemJournal::FdItemJournal ( QDate  date,
QString  object = "",
QString  label = "",
FdItemCoa_p  debit = FdItemCoa_p(0),
FdItemCoa_p  credit = FdItemCoa_p(0),
double  amount = 0 
)

Definition at line 25 of file FdItemJournal.cpp.

Member Function Documentation

double FdItemJournal::amount ( ) const

Definition at line 68 of file FdItemJournal.cpp.

bool FdItemJournal::breakDown ( ) const

Modify debit and credit accounts by mAmount. If any of this account is missing, it returns false.

Definition at line 129 of file FdItemJournal.cpp.

FdItemCoa_p FdItemJournal::credit ( ) const

Definition at line 63 of file FdItemJournal.cpp.

QDate FdItemJournal::date ( ) const

Definition at line 43 of file FdItemJournal.cpp.

FdItemCoa_p FdItemJournal::debit ( ) const

Definition at line 58 of file FdItemJournal.cpp.

bool FdItemJournal::isEmpty ( ) const

Returns true if there is no label, mDebit and mCredit are null and the amout is 0, false otherwise.

Definition at line 107 of file FdItemJournal.cpp.

bool FdItemJournal::isValid ( ) const

Returns true if the entry is valid, false otherwise. An entry can be invalid if its amount is not 0 and there one account missing.

Definition at line 118 of file FdItemJournal.cpp.

QString FdItemJournal::label ( ) const

Definition at line 53 of file FdItemJournal.cpp.

QString FdItemJournal::object ( ) const

Definition at line 48 of file FdItemJournal.cpp.

FdItemJournal_p FdItemJournal::pointer ( FdSubWindow subwindow,
QDomElement &  entry 
)
static

Creates a new item from the xml source.

Definition at line 33 of file FdItemJournal.cpp.

void FdItemJournal::setAmount ( double  amount)

Definition at line 98 of file FdItemJournal.cpp.

void FdItemJournal::setCredit ( FdItemCoa_p  account)

Definition at line 93 of file FdItemJournal.cpp.

void FdItemJournal::setDate ( QDate  date)

Definition at line 73 of file FdItemJournal.cpp.

void FdItemJournal::setDebit ( FdItemCoa_p  account)

Definition at line 88 of file FdItemJournal.cpp.

void FdItemJournal::setLabel ( QString  label)

Definition at line 83 of file FdItemJournal.cpp.

void FdItemJournal::setObject ( QString  object)

Definition at line 78 of file FdItemJournal.cpp.

QDomElement FdItemJournal::toXml ( QDomDocument &  document) const

Definition at line 141 of file FdItemJournal.cpp.

Member Data Documentation

double FdItemJournal::mAmount
private

The amount of the entry.

Access functions :

Definition at line 103 of file FdItemJournal.hpp.

FdItemCoa_p FdItemJournal::mCredit
private

A pointer to the credit account used in the entry.

Access functions :

Definition at line 94 of file FdItemJournal.hpp.

QDate FdItemJournal::mDate
private

Date of the entry.

Access functions :

Definition at line 58 of file FdItemJournal.hpp.

FdItemCoa_p FdItemJournal::mDebit
private

A pointer to the debit account used in the entry.

Access functions :

Definition at line 85 of file FdItemJournal.hpp.

QString FdItemJournal::mLabel
private

A brief description of the entry.

Access functions :

Definition at line 76 of file FdItemJournal.hpp.

QString FdItemJournal::mObject
private

Object of the entry, a reference to an eventual physical sheet (bill, ...) that certifies the entry.

Access functions :

Definition at line 67 of file FdItemJournal.hpp.


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