X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fhomebank;a=blobdiff_plain;f=src%2Fhb-transaction.h;h=988e89b1ca57f73bc2f8f90df6f5b309a577a440;hp=ca6666ee146e5d243fdc1234dc6a49647c06f70b;hb=996fa4ab9f6b836001f8ad0eecbfd3821687fea7;hpb=27f6e3b112df235c8e9afc9911b1f6bce208a001 diff --git a/src/hb-transaction.h b/src/hb-transaction.h index ca6666e..988e89b 100644 --- a/src/hb-transaction.h +++ b/src/hb-transaction.h @@ -1,5 +1,5 @@ /* HomeBank -- Free, easy, personal accounting for everyone. - * Copyright (C) 1995-2014 Maxime DOYEN + * Copyright (C) 1995-2016 Maxime DOYEN * * This file is part of HomeBank. * @@ -17,25 +17,16 @@ * along with this program. If not, see . */ + #ifndef __HB_TRANSACTION_H__ #define __HB_TRANSACTION_H__ -#include "hb-archive.h" +#include "hb-split.h" -#define TXN_MAX_SPLIT 10 -typedef struct _split Split; typedef struct _transaction Transaction; -struct _split -{ - guint32 kcat; - gdouble amount; - gchar *memo; -}; - - struct _transaction { gdouble amount; @@ -48,28 +39,40 @@ struct _transaction guint32 date; gushort pos; + gushort status; gchar *info; guint32 *tags; - guint32 kxfer; //internal xfer key + guint32 kxfer; //strong link xfer key guint32 kxferacc; Split *splits[TXN_MAX_SPLIT+1]; /* unsaved datas */ GList *same; //used for import todo: change this + guint32 kcur; gdouble balance; }; -#define OF_VALID (1<<0) +#include "hb-archive.h" + +#define OF_OLDVALID (1<<0) //deprecated since 5.x #define OF_INCOME (1<<1) -#define OF_AUTO (1<<2) //tmp flag scheduled +#define OF_AUTO (1<<2) //scheduled #define OF_ADDED (1<<3) //tmp flag #define OF_CHANGED (1<<4) //tmp flag -#define OF_REMIND (1<<5) +#define OF_OLDREMIND (1<<5) //deprecated since 5.x #define OF_CHEQ2 (1<<6) #define OF_LIMIT (1<<7) //scheduled #define OF_SPLIT (1<<8) +typedef enum { + TXN_STATUS_NONE, + TXN_STATUS_CLEARED, + TXN_STATUS_RECONCILED, + TXN_STATUS_REMIND, + //TXN_VOID +} HbTxnStatus; + Transaction *da_transaction_malloc(void); Transaction *da_transaction_copy(Transaction *src_txn, Transaction *dst_txn); @@ -79,13 +82,13 @@ void da_transaction_clean(Transaction *item); void da_transaction_free(Transaction *item); GList *da_transaction_new(void); -void da_transaction_destroy(GList *list); +void da_transaction_destroy(void); +void da_transaction_queue_sort(GQueue *queue); GList *da_transaction_sort(GList *list); gboolean da_transaction_prepend(Transaction *item); gboolean da_transaction_insert_sorted(Transaction *item); -guint32 da_transaction_get_max_kxfer(void); /* ** transaction edit type @@ -97,29 +100,22 @@ enum TRANSACTION_EDIT_MODIFY }; -void da_transaction_splits_append(Transaction *txn, Split *split); -void da_transaction_splits_free(Transaction *txn); -guint da_transaction_splits_count(Transaction *txn); -void da_transaction_splits_clone(Transaction *stxn, Transaction *dtxn); - -Split *da_split_new(guint32 kcat, gdouble amount, gchar *memo); -guint transaction_splits_parse(Transaction *ope, gchar *cats, gchar *amounts, gchar *memos); -guint transaction_splits_tostring(Transaction *ope, gchar **cats, gchar **amounts, gchar **memos); +guint da_transaction_length(void); void transaction_add_treeview(Transaction *ope, GtkWidget *treeview, guint32 accnum); void transaction_add(Transaction *ope, GtkWidget *treeview, guint32 accnum); -Transaction *transaction_strong_get_child_transfer(Transaction *src); -GList *transaction_match_get_child_transfer(Transaction *src); -Transaction *ui_dialog_transaction_xfer_select_child(GList *matchlist); -void transaction_xfer_search_or_add_child(Transaction *ope, GtkWidget *treeview); -void transaction_xfer_create_child(Transaction *ope, GtkWidget *treeview); +gboolean transaction_acc_move(Transaction *txn, guint32 okacc, guint32 nkacc); + +Transaction *transaction_xfer_child_strong_get(Transaction *src); +void transaction_xfer_search_or_add_child(GtkWindow *parentwindow, Transaction *ope, gboolean manual); void transaction_xfer_change_to_child(Transaction *ope, Transaction *child); void transaction_xfer_sync_child(Transaction *ope, Transaction *child); -void transaction_xfer_delete_child(Transaction *src); +void transaction_xfer_remove_child(Transaction *src); Transaction *transaction_old_get_child_transfer(Transaction *src); guint transaction_tags_count(Transaction *ope); +void transaction_tags_clone(Transaction *src_txn, Transaction *dst_txn); guint transaction_tags_parse(Transaction *ope, const gchar *tagstring); gchar *transaction_tags_tostring(Transaction *ope); gint transaction_auto_assign(GList *ope_list, guint32 key);