summaryrefslogtreecommitdiff
path: root/include/administration.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/administration.hpp')
-rw-r--r--include/administration.hpp25
1 files changed, 14 insertions, 11 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);