diff options
Diffstat (limited to 'src/administration_reader.cpp')
| -rw-r--r-- | src/administration_reader.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/administration_reader.cpp b/src/administration_reader.cpp index 4fd1247..b7dfa8f 100644 --- a/src/administration_reader.cpp +++ b/src/administration_reader.cpp @@ -153,7 +153,7 @@ bool administration_reader_import_contact(char* buffer, size_t buffer_size) struct xml_node* root = xml_document_root(document); - contact data; + contact data = {0}; _get_xml_str(root, data.id, MAX_LEN_ID, "Id"); _get_xml_str(root, data.name, MAX_LEN_LONG_DESC, "Name"); data.type = (contact_type)_get_xml_s32(root, "Type"); @@ -186,7 +186,7 @@ bool administration_reader_import_project(char* buffer, size_t buffer_size) struct xml_node* root = xml_document_root(document); - project data; + project data = {0}; _get_xml_str(root, data.id, MAX_LEN_ID, "Id"); _get_xml_str(root, data.description, MAX_LEN_LONG_DESC, "Description"); data.state = (project_state)_get_xml_s32(root, "State"); @@ -209,7 +209,7 @@ bool administration_reader_import_cost_center(char* buffer, size_t buffer_size) struct xml_node* root = xml_document_root(document); - cost_center data; + cost_center data = {0}; _get_xml_str(root, data.id, MAX_LEN_ID, "Id"); _get_xml_str(root, data.code, MAX_LEN_CODE, "Code"); _get_xml_str(root, data.description, MAX_LEN_LONG_DESC, "Description"); @@ -230,7 +230,7 @@ bool administration_reader_import_tax_bracket(char* buffer, size_t buffer_size) struct xml_node* root = xml_document_root(document); - country_tax_bracket data; + country_tax_bracket data = {0}; _get_xml_str(root, data.id, MAX_LEN_ID, "Id"); _get_xml_str(root, data.country_code, MAX_LEN_COUNTRY_CODE, "CountryCode"); _get_xml_str(root, data.category_code, MAX_LEN_CODE, "Category"); @@ -252,13 +252,11 @@ bool administration_reader_import_administration_info(char* buffer, size_t buffe struct xml_node* root = xml_document_root(document); - administration* ad = administration_get(); - ad->next_id = _get_xml_s32(root, "NextId"); - ad->next_sequence_number = _get_xml_s32(root, "NextSequenceNumber"); - _get_xml_str(root, ad->company_info.id, MAX_LEN_ID, "CompanyInfoId"); + administration_set_next_id(_get_xml_s32(root, "NextId")); + administration_set_next_sequence_number(_get_xml_s32(root, "NextSequenceNumber")); - log_add("Loaded administration info in %.3fms. next_id=%d next_sequence_number=%d company_id=%s", - STOPWATCH_TIME, ad->next_id, ad->next_sequence_number, ad->company_info.id); + log_add("Loaded administration info in %.3fms. next_id=%d next_sequence_number=%d", + STOPWATCH_TIME, administration_get_next_id(), administration_get_next_sequence_number()); return true; }
\ No newline at end of file |
