diff options
Diffstat (limited to 'include/administration.hpp')
| -rw-r--r-- | include/administration.hpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/administration.hpp b/include/administration.hpp index b971e2c..fe3d7b2 100644 --- a/include/administration.hpp +++ b/include/administration.hpp @@ -25,6 +25,8 @@ #define MAX_LEN_PROJECT_REPORT_COSTCENTERS 50 #define MAX_BILLING_ITEMS 50 +#define MY_COMPANY_ID "C/1" + typedef struct { char id[MAX_LEN_ID]; // T/[id] @@ -63,7 +65,7 @@ typedef struct address address; contact_type type; char taxid[MAX_LEN_TAXID]; // Required for business contact - char businessid[MAX_LEN_TAXID]; // Required for business contact + char businessid[MAX_LEN_BUSINESSID]; // Required for business contact char email[MAX_LEN_EMAIL]; char phone_number[MAX_LEN_PHONE]; char bank_account[MAX_LEN_BANK]; @@ -308,6 +310,8 @@ typedef struct } income_statement; // Administration callback functions. +// These are called when adding/updating/deleting entries. +// These are NOT called when using import functions. typedef void (*data_changed_event)(); typedef void (*data_deleted_event)(char id[MAX_LEN_ID]); typedef void (*invoice_changed_event)(invoice* invoice); @@ -338,9 +342,10 @@ typedef struct // Setup functions. // ======================= -void administration_create(); -void administration_destroy(); +void administration_create(); // TODO remove and move into other setup functions +void administration_destroy(); // TODO remove and move into other setup functions void administration_create_empty(char* save_file); +void administration_create_from_file(char* save_file); // Callback functions. // ======================= @@ -357,6 +362,7 @@ void administration_set_project_changed_event_callback(project_changed_event administration* administration_get(); // TODO get rid of this and make indivual getters and setters char* administration_file_path_get(); contact administration_company_info_get(); +void administration_company_info_import(contact data); void administration_company_info_set(contact data); void administration_create_income_statement(income_statement* statement); char* administration_get_currency_symbol_from_currency(char* code); @@ -368,6 +374,7 @@ bool administration_has_save_path(); // ======================= u32 administration_contact_count(); contact administration_contact_create_empty(); +bool administration_contact_import(contact data); bool administration_contact_add(contact data); bool administration_contact_update(contact data); bool administration_contact_remove(contact data); @@ -385,6 +392,7 @@ u32 administration_contact_get_all(contact* buffer); // ======================= u32 administration_project_count(); project administration_project_create_empty(); +bool administration_project_import(project data); bool administration_project_add(project data); bool administration_project_update(project data); bool administration_project_remove(project data); @@ -400,6 +408,7 @@ bool administration_project_get_by_id(project* buffer, char* id); // Tax bracket functions. // ======================= u32 administration_tax_bracket_count(); +bool administration_tax_bracket_import(country_tax_bracket data); bool administration_tax_bracket_add(country_tax_bracket data); bool administration_tax_bracket_update(country_tax_bracket data); @@ -410,6 +419,7 @@ u32 administration_tax_bracket_get_by_country(country_tax_bracket* buffer, c // Cost center functions. // ======================= u32 administration_cost_center_count(); +bool administration_cost_center_import(cost_center data); bool administration_cost_center_add(cost_center data); bool administration_cost_center_update(cost_center data); |
