piecash.core.transaction module¶
-
class
piecash.core.transaction.
Split
(account, value, quantity=None, transaction=None, memo='', action='', reconcile_date=None, reconcile_state='n', lot=None)[source]¶ Bases:
piecash._declbase.DeclarativeBaseGuid
A GnuCash Split.
Note
A split used in a scheduled transaction has its main attributes in form of slots.
-
transaction
¶ transaction of the split
-
account
¶ account of the split
-
lot
¶ lot to which the split pertains
- Type
piecash.business.Lot
-
value
¶ amount express in the currency of the transaction of the split
- Type
-
quantity
¶ amount express in the commodity of the account of the split
- Type
-
reconcile_date
¶ time
- Type
-
action
¶ describe the type of action behind the split (free form string but with dropdown in the GUI
- Type
-
object_to_validate
(change)[source]¶ yield the objects to validate when the object is modified (change=”new” “deleted” or “dirty”).
For instance, if the object is a Split, if it changes, we want to revalidate not the split but its transaction and its lot (if any). split.object_to_validate should yeild both split.transaction and split.lot
-
-
class
piecash.core.transaction.
Transaction
(currency, description='', notes=None, splits=None, enter_date=None, post_date=None, num='')[source]¶ Bases:
piecash._declbase.DeclarativeBaseGuid
A GnuCash Transaction.
-
currency
¶ currency of the transaction. This attribute is write-once (i.e. one cannot change it after being set)
-
enter_date
¶ datetimetime at which transaction is entered
- Type
-
post_date
¶ day on which transaction is posted
- Type
-
scheduled_transaction
¶ scheduled transaction behind the transaction
- Type
-
object_to_validate
(change)[source]¶ yield the objects to validate when the object is modified (change=”new” “deleted” or “dirty”).
For instance, if the object is a Split, if it changes, we want to revalidate not the split but its transaction and its lot (if any). split.object_to_validate should yeild both split.transaction and split.lot
-
-
class
piecash.core.transaction.
ScheduledTransaction
(*args, **kwargs)[source]¶ Bases:
piecash._declbase.DeclarativeBaseGuid
A GnuCash Scheduled Transaction.
- Attributes
adv_creation (int) : days to create in advance (0 if disabled) adv_notify (int) : days to notify in advance (0 if disabled) auto_create (bool) : auto_notify (bool) : enabled (bool) : start_date (
datetime.datetime
) : date to start the scheduled transaction last_occur (datetime.datetime
) : date of last occurence of the schedule transaction end_date (datetime.datetime
) : date to end the scheduled transaction (num/rem_occur should be 0) instance_count (int) : name (str) : name of the scheduled transaction num_occur (int) : number of occurences in total (end_date should be null) rem_occur (int) : number of remaining occurences (end_date should be null) template_account (piecash.core.account.Account
): template account of the transaction
-
class
piecash.core.transaction.
Lot
(title, account, notes='', splits=None, is_closed=0)[source]¶ Bases:
piecash._declbase.DeclarativeBaseGuid
A GnuCash Lot. Each lot is linked to an account. Splits in this account can be associated to a Lot. Whenever the balance of the splits goes to 0, the Lot is closed (otherwise it is opened)
-
account
¶ account of the Lot
-
splits
¶ splits associated to the Lot
-
object_to_validate
(change)[source]¶ yield the objects to validate when the object is modified (change=”new” “deleted” or “dirty”).
For instance, if the object is a Split, if it changes, we want to revalidate not the split but its transaction and its lot (if any). split.object_to_validate should yeild both split.transaction and split.lot
-