OSB_LIB::BaseAmount Class Reference

Inheritance diagram for OSB_LIB::BaseAmount:

Inheritance graph
[legend]
Collaboration diagram for OSB_LIB::BaseAmount:

Collaboration graph
[legend]
List of all members.

Detailed Description

BaseAmount is the base class for Amount and Subtotal. This way these two types can be used polymorphically. (E.g., a list of Amounts and Subtotals or a Subtotal of a Subtotal.).

List of amounts will be sumed up when only it is needed. The reason is that the amount in the list can be changed at anytime.

Definition at line 115 of file amount.h.

Public Types

Public Member Functions

Private Attributes


Member Typedef Documentation

typedef std::map<TaxIdVs, TaxAmount*> OSB_LIB::BaseAmount::Taxes

List of tax amount.

Definition at line 184 of file amount.h.

typedef Taxes::const_iterator OSB_LIB::BaseAmount::TaxesCI

Definition at line 185 of file amount.h.

typedef Taxes::iterator OSB_LIB::BaseAmount::TaxesI

Definition at line 186 of file amount.h.


Constructor & Destructor Documentation

OSB_LIB::BaseAmount::BaseAmount (  )  [inline]

c'tor.

Definition at line 118 of file amount.h.

OSB_LIB::BaseAmount::BaseAmount ( const ChargeTraits ct,
const Date dt = Date() 
) [inline]

c'tor II.

Parameters:
ct Charge traits to use.
dt Date to use.

Definition at line 125 of file amount.h.

virtual OSB_LIB::BaseAmount::~BaseAmount (  )  [pure virtual]

d'tor.

OSB_LIB::BaseAmount::BaseAmount ( const BaseAmount rhs  ) 

c'tor III.


Member Function Documentation

virtual bool OSB_LIB::BaseAmount::accumulateTaxes (  )  [pure virtual]

Accumulate all the tax amount.

Returns:
true if taxesReady_ is true. See taxesReady_ definition below.

Implemented in OSB_LIB::Amount, and OSB_LIB::Subtotal.

void OSB_LIB::BaseAmount::addTax ( const TaxAmount bta  ) 

Add a new tax element to the Taxes (copy argument).

void OSB_LIB::BaseAmount::deleteTaxes (  ) 

Delete all elements from the Taxes.

void OSB_LIB::BaseAmount::gross ( MoneyList ml  )  const

Returns gross amounts (rounded amount + tax) by currency.

void OSB_LIB::BaseAmount::net ( MoneyList ml  )  const

Returns net amounts (rounded amount without tax) by currency.

BaseAmount& OSB_LIB::BaseAmount::operator= ( const BaseAmount rhs  ) 

c'tor IV.

virtual void OSB_LIB::BaseAmount::precise ( MoneyList ml  )  const [pure virtual]

Returns precise amounts by currency.

Implemented in OSB_LIB::Amount, and OSB_LIB::Subtotal.

virtual Date OSB_LIB::BaseAmount::refDate (  )  const [inline, virtual]

Returns the reference date.

Reimplemented in OSB_LIB::Subtotal.

Definition at line 163 of file amount.h.

References refDate_.

Referenced by OSB_LIB::Subtotal::dateByType().

virtual void OSB_LIB::BaseAmount::rounded ( MoneyList ml  )  const [pure virtual]

Returns rounded amounts by currency.

Implemented in OSB_LIB::Amount, and OSB_LIB::Subtotal.

void OSB_LIB::BaseAmount::setTaxesReady ( bool  flag = true  )  [inline]

Set taxesReady_.

Definition at line 182 of file amount.h.

References taxesReady_.

virtual void OSB_LIB::BaseAmount::setTraits ( const ChargeTraits ct,
const Date dt = Date() 
) [virtual]

Set charge traits.

Parameters:
ct Charge traits to use.
dt Reference date to use.

Reimplemented in OSB_LIB::Subtotal.

Referenced by OSB_LIB::Subtotal::setTraits().

void OSB_LIB::BaseAmount::taxed ( MoneyList ml,
TaxIdVs   
) const

Returns the amount of given tax id.

TaxesI OSB_LIB::BaseAmount::taxesBegin (  )  [inline]

Definition at line 189 of file amount.h.

References taxes_.

TaxesCI OSB_LIB::BaseAmount::taxesBegin (  )  const [inline]

Definition at line 188 of file amount.h.

References taxes_.

TaxesI OSB_LIB::BaseAmount::taxesEnd (  )  [inline]

Definition at line 191 of file amount.h.

References taxes_.

TaxesCI OSB_LIB::BaseAmount::taxesEnd (  )  const [inline]

Definition at line 190 of file amount.h.

References taxes_.

TaxesCI OSB_LIB::BaseAmount::taxesFind ( TaxIdVs  ti  )  const [inline]

Definition at line 192 of file amount.h.

References taxes_.

virtual bool OSB_LIB::BaseAmount::taxesReady (  )  const [inline, virtual]

Returns taxesReady_. See taxesReady_ definition below.

Reimplemented in OSB_LIB::Subtotal.

Definition at line 159 of file amount.h.

References taxesReady_.

Referenced by OSB_LIB::Amount::accumulateTaxes().

void OSB_LIB::BaseAmount::totalTax ( MoneyList ml  )  const

Returns tax totals by currency if taxesReady_ is true else it returns 0.

virtual ChargeTraits OSB_LIB::BaseAmount::traits (  )  const [inline, virtual]

Returns the charge traits.

Reimplemented in OSB_LIB::Subtotal.

Definition at line 161 of file amount.h.

References traits_.

Referenced by OSB_LIB::Subtotal::traitsByType().

virtual std::ostream& OSB_LIB::BaseAmount::write ( std::ostream &  o  )  const [pure virtual]

Implemented in OSB_LIB::Amount, and OSB_LIB::Subtotal.


Member Data Documentation

Date OSB_LIB::BaseAmount::refDate_ [private]

Reference date for tax calculation.

This date determines which tax-version to use.

Definition at line 200 of file amount.h.

Referenced by refDate().

Taxes OSB_LIB::BaseAmount::taxes_ [private]

Taxes.

Definition at line 208 of file amount.h.

Referenced by taxesBegin(), taxesEnd(), and taxesFind().

bool OSB_LIB::BaseAmount::taxesReady_ [private]

Indicates if taxes have been calculated at the amount or subtotal.

For subtotals, this means that the taxes were applied to the subtotal itself, rather than accumulated from its list of amounts.

Definition at line 206 of file amount.h.

Referenced by setTaxesReady(), and taxesReady().

ChargeTraits OSB_LIB::BaseAmount::traits_ [private]

Charge traits.

Definition at line 196 of file amount.h.

Referenced by traits().


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:09:22 2006 for OSB Library by  doxygen 1.4.7