summaryrefslogtreecommitdiff
path: root/include/administration.hpp
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2025-08-09 11:18:02 +0200
committerAldrik Ramaekers <aldrikboy@gmail.com>2025-08-09 11:18:02 +0200
commit2cf031b91d5248561fbeff78ceccb0b2d6c73809 (patch)
tree0fdd8d1a3aaf3f937b01d708fb334116833fdecb /include/administration.hpp
parent432f24319319fe040e142059eb83279c53f90ab8 (diff)
refactors, working on settings view
Diffstat (limited to 'include/administration.hpp')
-rw-r--r--include/administration.hpp77
1 files changed, 73 insertions, 4 deletions
diff --git a/include/administration.hpp b/include/administration.hpp
index 9506246..79ca6ab 100644
--- a/include/administration.hpp
+++ b/include/administration.hpp
@@ -5,11 +5,23 @@
typedef struct
{
- char id[16];
- char name[64];
+ char country_code[3];
+ float rate;
+ char description[16];
+} country_tax_bracket;
+
+typedef struct
+{
char address1[128];
char address2[128];
char country[128];
+} address;
+
+typedef struct
+{
+ char id[16];
+ char name[64];
+ address address;
char taxid[32];
char businessid[32];
char email[64];
@@ -33,16 +45,70 @@ typedef struct
time_t end_date;
} project;
+typedef enum
+{
+ INVOICE_PAID,
+ INVOICE_EXPIRED,
+ INVOICE_CANCELLED,
+ INVOICE_REFUNDED,
+ INVOICE_CORRECTED,
+} invoice_status;
+
+typedef struct
+{
+ char id[16];
+ char invoice_id[16];
+ char description[128];
+ country_tax_bracket tax_bracket;
+ char tax_section[16];
+ s32 amount;
+ s32 net_per_item;
+ s32 net;
+ s32 discount;
+ s32 tax;
+ bool is_intra_community;
+ bool is_triangulation;
+ char currency[16];
+ char internal_code[64];
+} billing_item;
+
+typedef struct
+{
+ char id[16];
+ char sequential_number[16];
+ char customer_id[16];
+ char supplier_id[16];
+ time_t issued_at;
+ time_t delivered_at;
+ time_t expires_at;
+ char document[255];
+ list_t billing_items;
+ char project_id[16];
+ char cost_center_id[16];
+ char cost_unit_id[16];
+ s32 total;
+ s32 tax;
+ s32 net;
+ invoice_status status;
+ address shipping_address;
+ char currency[16];
+ time_t keep_untill;
+ time_t payment_on_account_date;
+ char tax_representative[64];
+ char corrected_sequential_number[16];
+} invoice;
+
typedef struct
{
contact company_info;
s32 next_id;
char path[4096];
char program_version[10];
- char country_code[2];
+ char country_code[3];
list_t contacts;
list_t projects;
- // invoices
+ list_t invoices;
+ list_t tax_brackets;
char ai_service[16];
char ai_key[32];
char email_service[16];
@@ -55,6 +121,9 @@ void administration_destroy();
char* administration_get_file_path();
s32 administration_create_id();
+contact administration_get_company_info();
+void administration_set_company_info(contact data);
+
bool administration_remove_contact(contact data);
bool administration_create_contact(contact data);
bool administration_update_contact(contact data);