summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2025-08-16 15:36:17 +0200
committerAldrik Ramaekers <aldrikboy@gmail.com>2025-08-16 15:36:17 +0200
commit50848b2dd97093dd407ed7199118bca011f1aa4c (patch)
tree176a0aa8a1ce966123a56e0988511f6ddfcd42eb /include
parentb2a5ae0b5b628cca712bb80d485393800de34172 (diff)
more refactor work
Diffstat (limited to 'include')
-rw-r--r--include/administration.hpp25
-rw-r--r--include/ui.hpp5
2 files changed, 15 insertions, 15 deletions
diff --git a/include/administration.hpp b/include/administration.hpp
index e617166..219ece0 100644
--- a/include/administration.hpp
+++ b/include/administration.hpp
@@ -120,17 +120,20 @@ typedef struct
time_t expires_at;
time_t delivered_at;
char document[MAX_LEN_PATH]; // path to copy of document for incomming invoice.
- char project_id[MAX_LEN_ID];
- char cost_center_id[MAX_LEN_ID];
+ char project_id[MAX_LEN_ID]; // For incomming invoices. optional.
+ char cost_center_id[MAX_LEN_ID]; // For incomming invoices. optional.
list_t billing_items;
+
+ // Total, tax and net are calculated from billing items.
float total;
float tax;
float net;
+
char currency[MAX_LEN_CURRENCY];
- bool is_triangulation;
+ bool is_triangulation; // True of addressee != customer
+ invoice_status status;
bool is_intra_community; // TODO
- invoice_status status; // TODO
time_t payment_on_account_date; // TODO
char tax_representative[MAX_LEN_LONG_DESC]; // TODO
char corrected_sequential_number[MAX_LEN_ID]; // TODO
@@ -142,13 +145,12 @@ typedef struct
typedef struct
{
- // Company info used for invoices. User should not be able to create invoices when this is empty.
- contact company_info;
-
- s32 next_id; // Shared across all objects that have an ID.
- s32 next_sequence_number; // Sequence number for generating invoice numbers.
- char path[MAX_LEN_PATH];
- char program_version[10];
+ contact company_info; // Company info used for invoices. User cannot create invoices when this is empty/invalid.
+ s32 next_id; // Id increment shared across all objects that have an ID.
+ s32 next_sequence_number; // Sequence number for generating invoice numbers.
+ char path[MAX_LEN_PATH]; // Full path to save file of current administration file.
+ char program_version[10]; // Program version of exe that stored the save path file.
+
list_t contacts;
list_t projects;
list_t invoices;
@@ -223,6 +225,7 @@ invoice administration_invoice_create_empty();
bool administration_invoice_add(invoice* invoice);
bool administration_invoice_update(invoice* invoice);
void administration_invoice_set_currency(invoice* invoice, char* currency);
+invoice administration_invoice_create_copy(invoice* invoice);
bool administration_invoice_is_valid(invoice* invoice);
diff --git a/include/ui.hpp b/include/ui.hpp
index c482eb7..67e0529 100644
--- a/include/ui.hpp
+++ b/include/ui.hpp
@@ -9,9 +9,6 @@ typedef enum
} view_state;
void ui_helper_draw_required_tag();
-void ui_helper_show_toast(const char* msg);
-void ui_helper_draw_toasts();
-
void ui_draw_main();
void ui_draw_contacts();
@@ -25,4 +22,4 @@ void ui_setup_projects();
void ui_setup_settings();
// Custom imgui widgets.
-int ui_helper_TextInputWithAutocomplete(const char* label, const char* hint, char* buffer, size_t buf_size, char** suggestions, int suggestion_count); \ No newline at end of file
+int TextInputWithAutocomplete(const char* label, const char* hint, char* buffer, size_t buf_size, char** suggestions, int suggestion_count); \ No newline at end of file