Overview | File | Class | Tree | Index | Help
| The Gravey Framework and RATS RIA
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class BalanceListModel

    Object
       |
       +--GrvObject
             |
             +--MVCObserver
                   |
                   +--MVCModel
                         |
                         +--MVCListModel
                               |
                               +--BalanceListModel

class BalanceListModel
extends MVCListModel

DOMAIN-OBJECT: This class encapsulates the data model for the Balance list of a particular Account. This model subscribes to a AccountSelectionModel so that a new balance list can be downloaded whenever a new account is selected. Secondarily, this model implements the MVCBoolModel.isTrue() interface where the value reflects whether this model is "dirty".
Version: 2.0
Author: Bruce Wallace (PolyGlotInc.com)
See:

- konstructor()

Defined in rats.js

Constructor Summary
`BalanceListModel ()`

Method Summary
`int` | `appendTransaction( <int> sIndex )` append a new blank transaction associated with the specified balance
`boolean` | `canBalanceToggle(<int> i)` return whether the specified balance can expand/collapse
`boolean` | `canToggle( <boolean> doAllFlag, <int> si )` return whether balance(s) can expand/collapse
`int` | `createTransaction( <int> sIndex, <int> rIndex )` insert a new blank transaction associated with the specified balance
`void` | `deleteTransaction( <int> sIndex, <int> rIndex )` delete the specified transaction
`void` | `editTransaction( <int> sIndex, <int> rIndex )` enable editing on the specified transaction
`Object` | `getAccountKey()` return opaque key of our Account
`Float` | `getDiffA(<int> i)` return unreconciled balance A for specified balance
`Float` | `getDiffB(<int> i)` return unreconciled balance B for specified balance
`Float` | `getDiffC(<int> i)` return unreconciled balance C for specified balance
`Float` | `getDiffD(<int> i)` return unreconciled balance D for specified balance
`Float` | `getDiffTotal(<int> i)` return total of unreconciled amount for specified balance
`Float` | `getNetA()` return unreconciled balance A for the whole Account
`Float` | `getNetB()` return unreconciled balance B for the whole Account
`Float` | `getNetC()` return unreconciled balance C for the whole Account
`Float` | `getNetD()` return unreconciled balance D for the whole Account
`Float` | `getNetTotal()` return total unreconciled balances for the whole Account
`Transaction` | `getTransaction( <int> sIndex, <int> rIndex )` return the specified transaction
`int` | `getTransactionCount(<int> i)` return how many transactions are associated with the specified balance
`boolean` | `hasAllZeroDiff(<int> i)` return true iff all unreconciled amounts for specified balance are zero
`boolean` | `isAccountReconciled()` is the whole Account (i.e.
`boolean` | `isBalanceDirty(<int> i)` return whether the specified balance is being reconciled
`boolean` | `isBalanceExpanded(<int> i)` return whether the specified balance is expanded
`boolean` | `isBalanceOpen(<int> i)` return whether the specified balance is collapsed or open
`boolean` | `isBalanceReconciled(<int> i)` return whether the specified balance is reconciled and update the balance todo flag as a side effect.
`boolean` | `isDirty()` return whether any transactions are changed for the whole Account
`boolean` | `isTrue()` MVCBoolModel API: return "I am modified" flag
`Float` | `isValid()` return whether all transactions are valid for the whole Account
`void` | `konstructor( <AccountSelectionModel> accountSelectionModel )`
`Transaction` | `newTransaction()` return a new blank transaction
`Transaction` | `openTransaction( <int> sIndex, <int> rIndex )` return the specified transaction with the intent to change its attributes
`void` | `save()` save all of the edits into the database via service layer
`void` | `toggleOpen( <boolean> doAllFlag, <int> si )` toggle the "open" flag of the specified balance.
`void` | `undeleteTransaction( <int> sIndex, <int> rIndex )` undelete the specified transaction
`void` | `uneditTransaction( <int> sIndex, <int> rIndex )` rollback edit on the specified transaction
`void` | `update()` handle update events from the Account Selection Model

Methods inherited from class MVCListModel
`clone, dump, hash, _pop, _push, _del, _reset, getCount, getItem, getItemStr, addItem, delItem, reset, iterate, addBefore, getMemento, setMemento`

Methods inherited from class MVCModel
`dumpSubscribers, toString, dirty, clean, neverChanged, publish, GET, _SET, SET, updateStamp, BeginTransaction, EndTransaction, reloaded, addObserver, delObserver, notifyObservers`

Methods inherited from class MVCObserver
`subscribe`

Methods inherited from class GrvObject
`souper`

Constructor Detail

### BalanceListModel

    BalanceListModel()

Version: 2.0
Author: Bruce Wallace (PolyGlotInc.com)
See:

- konstructor()

Method Detail

### appendTransaction

    int appendTransaction( <int> sIndex )

append a new blank transaction associated with the specified balance

Parameters:

`sIndex` - index into "this" balance list

Returns:

index of new transaction

### canBalanceToggle

    boolean canBalanceToggle(<int> i)

return whether the specified balance can expand/collapse

Parameters:

`i` - index into "this" balance list

### canToggle

    boolean canToggle( <boolean> doAllFlag, <int> si )

return whether balance(s) can expand/collapse

Parameters:

`doAllFlag` - if true, check all of the balances

`si` - index into "this" balance list

### createTransaction

    int createTransaction( <int> sIndex, <int> rIndex )

insert a new blank transaction associated with the specified balance

Parameters:

`sIndex` - index into "this" balance list

`rIndex` - index into transaction list for specified balance

Returns:

index of new transaction

### deleteTransaction

    void deleteTransaction( <int> sIndex, <int> rIndex )

delete the specified transaction

Parameters:

`sIndex` - index into "this" balance list

`rIndex` - index into transaction list for specified balance

### editTransaction

    void editTransaction( <int> sIndex, <int> rIndex )

enable editing on the specified transaction

Parameters:

`sIndex` - index into "this" balance list

`rIndex` - index into transaction list for specified balance

### getAccountKey

    Object getAccountKey()

return opaque key of our Account

### getDiffA

    Float getDiffA(<int> i)

return unreconciled balance A for specified balance

Parameters:

`i` - index into "this" balance list

### getDiffB

    Float getDiffB(<int> i)

return unreconciled balance B for specified balance

Parameters:

`i` - index into "this" balance list

### getDiffC

    Float getDiffC(<int> i)

return unreconciled balance C for specified balance

Parameters:

`i` - index into "this" balance list

### getDiffD

    Float getDiffD(<int> i)

return unreconciled balance D for specified balance

Parameters:

`i` - index into "this" balance list

### getDiffTotal

    Float getDiffTotal(<int> i)

return total of unreconciled amount for specified balance

Parameters:

`i` - index into "this" balance list

### getNetA

    Float getNetA()

return unreconciled balance A for the whole Account

### getNetB

    Float getNetB()

return unreconciled balance B for the whole Account

### getNetC

    Float getNetC()

return unreconciled balance C for the whole Account

### getNetD

    Float getNetD()

return unreconciled balance D for the whole Account

### getNetTotal

    Float getNetTotal()

return total unreconciled balances for the whole Account

### getTransaction

    Transaction getTransaction( <int> sIndex, <int> rIndex )

return the specified transaction

Parameters:

`sIndex` - index into "this" balance list

`rIndex` - index into transaction list for specified balance

### getTransactionCount

    int getTransactionCount(<int> i)

return how many transactions are associated with the specified balance

Parameters:

`i` - index into "this" balance list

### hasAllZeroDiff

    boolean hasAllZeroDiff(<int> i)

return true iff all unreconciled amounts for specified balance are zero

Parameters:

`i` - index into "this" balance list

### isAccountReconciled

    boolean isAccountReconciled()

is the whole Account (i.e. this whole balance list) reconciled?

### isBalanceDirty

    boolean isBalanceDirty(<int> i)

return whether the specified balance is being reconciled

Parameters:

`i` - index into "this" balance list

### isBalanceExpanded

    boolean isBalanceExpanded(<int> i)

return whether the specified balance is expanded

Parameters:

`i` - index into "this" balance list

### isBalanceOpen

    boolean isBalanceOpen(<int> i)

return whether the specified balance is collapsed or open

Parameters:

`i` - index into "this" balance list

Returns:

true if open

### isBalanceReconciled

    boolean isBalanceReconciled(<int> i)

return whether the specified balance is reconciled and update the balance todo flag as a side effect.

Parameters:

`i` - index into "this" balance list

### isDirty

    boolean isDirty()

return whether any transactions are changed for the whole Account

### isTrue

    boolean isTrue()

MVCBoolModel API: return "I am modified" flag

### isValid

    Float isValid()

return whether all transactions are valid for the whole Account

### konstructor

    void konstructor( <AccountSelectionModel> accountSelectionModel )

Parameters:

`accountSelectionModel` - model of which account is selected

### newTransaction

    Transaction newTransaction()

return a new blank transaction

### openTransaction

    Transaction openTransaction( <int> sIndex, <int> rIndex )

return the specified transaction with the intent to change its attributes

Parameters:

`sIndex` - index into "this" balance list

`rIndex` - index into transaction list for specified balance

### save

    void save()

save all of the edits into the database via service layer

### toggleOpen

    void toggleOpen( <boolean> doAllFlag, <int> si )

toggle the "open" flag of the specified balance.

Parameters:

`doAllFlag` - if true, set all of the balances to new value

`si` - index into "this" balance list

### undeleteTransaction

    void undeleteTransaction( <int> sIndex, <int> rIndex )

undelete the specified transaction

Parameters:

`sIndex` - index into "this" balance list

`rIndex` - index into transaction list for specified balance

### uneditTransaction

    void uneditTransaction( <int> sIndex, <int> rIndex )

rollback edit on the specified transaction

Parameters:

`sIndex` - index into "this" balance list

`rIndex` - index into transaction list for specified balance

### update

    void update()

handle update events from the Account Selection Model

Overview | File | Class | Tree | Index | Help
| The Gravey Framework and RATS RIA
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Sun Feb 11 13:31:25 2007