GnuCash  5.6-150-g038405b370+
Data Fields
GNCPolicy Struct Reference

The Policy routines try to encapsulate the FIFO/LIFO-specific parts of the cap-gains routine, and can be replaced by something else for other policies. More...

#include <policy-p.h>

Data Fields

GNCLot *(* PolicyGetLot )(GNCPolicy *, Split *split)
 
Split *(* PolicyGetSplit )(GNCPolicy *, GNCLot *lot)
 
void(* PolicyGetLotOpening )(GNCPolicy *, GNCLot *lot, gnc_numeric *ret_amount, gnc_numeric *ret_value, gnc_commodity **ret_currency)
 
gboolean(* PolicyIsOpeningSplit )(GNCPolicy *, GNCLot *lot, Split *split)
 

Detailed Description

The Policy routines try to encapsulate the FIFO/LIFO-specific parts of the cap-gains routine, and can be replaced by something else for other policies.

The PolicyGetLot() routine returns a lot into which the indicated split should be placed.

The PolicyGetSplit() routine returns an unassigned split from the account that is appropriate for placing into the indicated lot. For the FIFO policy, that would be the earliest split that is not in any account, and is of the appropriate sign. For a LIFO, it would be the latest.

The PolicyIsOpeningSplit() predicate returns a true/false value, indicating if the indicated split was used to 'open' or 'grow' the lot.

The PolicyGetLotOpening() routine returns information about the opening balances for the lot. The 'opening balances' are the sum of all the splits used to grow (increase the size of) the lot. For a LIFO or FIFO policy, there is only one split that opens a lot.

Definition at line 64 of file policy-p.h.


The documentation for this struct was generated from the following file: