]> Dogcows Code - chaz/homebank/blob - src/hb-account.h
Merge branch 'upstream'
[chaz/homebank] / src / hb-account.h
1 /* HomeBank -- Free, easy, personal accounting for everyone.
2 * Copyright (C) 1995-2016 Maxime DOYEN
3 *
4 * This file is part of HomeBank.
5 *
6 * HomeBank is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * HomeBank is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef __HB_ACCOUNT_H__
21 #define __HB_ACCOUNT_H__
22
23
24
25 typedef struct _account Account;
26
27
28 struct _account
29 {
30 guint32 key;
31 gushort flags;
32 gushort type;
33 guint32 pos; //display position
34 guint32 kcur;
35 gchar *name;
36 gchar *number;
37 gchar *bankname;
38 gdouble initial;
39 gdouble warning;
40 gdouble minimum;
41 guint32 cheque1;
42 guint32 cheque2;
43 gchar *notes;
44
45 /* unsaved datas */
46 GQueue *txn_queue;
47 GtkWindow *window; //dsp_account window opened
48
49 gdouble bal_bank; //bank balance (reconciled transaction)
50 gdouble bal_today; //today balance (every transaction until today)
51 gdouble bal_future; //future balance (every transaction)
52
53 gboolean filter; //true if selected into filter
54
55 // import datas
56 gboolean imported;
57 guint32 imp_key; // 0 create new / x to map to existing
58 gchar *imp_name; // name in the file
59 };
60
61 // 0 is free
62 #define AF_CLOSED (1<<1)
63 #define AF_ADDED (1<<2)
64 #define AF_CHANGED (1<<3)
65 #define AF_NOSUMMARY (1<<4)
66 #define AF_NOBUDGET (1<<5)
67 #define AF_NOREPORT (1<<6)
68
69 #define AF_OLDBUDGET (1<<0)
70
71 enum
72 {
73 ACC_TYPE_NONE = 0,
74 ACC_TYPE_BANK = 1, //Banque
75 ACC_TYPE_CASH = 2, //Espèce
76 ACC_TYPE_ASSET = 3, //Actif (avoir)
77 ACC_TYPE_CREDITCARD = 4, //Carte crédit
78 ACC_TYPE_LIABILITY = 5, //Passif (dettes)
79 // ACC_TYPE_STOCK = 6, //Actions
80 // ACC_TYPE_MUTUALFUND = 7, //Fond de placement
81 // ACC_TYPE_INCOME = 8, //Revenus
82 // ACC_TYPE_EXPENSE = 9, //Dépenses
83 // ACC_TYPE_EQUITY = 10, //Capitaux propres
84 // ACC_TYPE_,
85 ACC_TYPE_MAXVALUE
86 };
87
88
89
90 Account *da_acc_malloc(void);
91 void da_acc_free(Account *item);
92 Account *da_acc_malloc(void);
93
94 void da_acc_destroy(void);
95 void da_acc_new(void);
96
97 guint da_acc_length(void);
98 gboolean da_acc_create_none(void);
99 gboolean da_acc_remove(guint32 key);
100 gboolean da_acc_insert(Account *acc);
101 gboolean da_acc_append(Account *item);
102 guint32 da_acc_get_max_key(void);
103 Account *da_acc_get_by_name(gchar *name);
104 Account *da_acc_get_by_imp_name(gchar *name);
105 Account *da_acc_get(guint32 key);
106 void da_acc_consistency(Account *item);
107
108
109 gboolean account_is_used(guint32 key);
110 gboolean account_exists(gchar *name);
111 gboolean account_rename(Account *item, gchar *newname);
112 void account_set_currency(Account *item, guint32 kcur);
113 void account_compute_balances(void);
114 gboolean account_balances_add(Transaction *trn);
115 gboolean account_balances_sub(Transaction *trn);
116
117 GList *account_glist_sorted(gint column);
118
119 void account_convert_euro(Account *acc);
120 #endif
This page took 0.035417 seconds and 4 git commands to generate.