diff options
Diffstat (limited to 'src/administration_writer.cpp')
| -rw-r--r-- | src/administration_writer.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/administration_writer.cpp b/src/administration_writer.cpp index 0ac0b40..6f58a21 100644 --- a/src/administration_writer.cpp +++ b/src/administration_writer.cpp @@ -35,10 +35,10 @@ mtx_t _save_file_mutex; static void on_administration_data_changed() { if (administration_writer_save_all_administration_info_blocking()) { - ui_set_status(localize("status.saved")); + ui_set_status(locale::get("status.saved")); } else { - ui_set_status(localize("status.saveFailed")); + ui_set_status(locale::get("status.saveFailed")); } } @@ -337,7 +337,7 @@ bool administration_writer_save_invoice_blocking(invoice inv) int buf_length = 150000; // Ballpark file content size. char* file_content = (char*)malloc(buf_length); memset(file_content, 0, buf_length); - memcpy(file_content, peppol_invoice_template, strlen(peppol_invoice_template)); + memcpy(file_content, file_template::peppol_invoice_template, strlen(file_template::peppol_invoice_template)); struct tm *tm_info = 0; char date_buffer[11]; // "YYYY-MM-DD" + null terminator @@ -412,7 +412,7 @@ bool administration_writer_save_invoice_blocking(invoice inv) tax_rate* tax_rate_buffer = (tax_rate*)malloc(sizeof(tax_rate)*administration_billing_item_count(&inv)); u32 tax_rate_count = administration_invoice_get_tax_rates(&inv, tax_rate_buffer); - u32 tax_subtotal_list_buffer_size = (u32)strlen(peppol_invoice_tax_subtotal_template) * 2 * tax_rate_count; // Ballpark list size. + u32 tax_subtotal_list_buffer_size = (u32)strlen(file_template::peppol_invoice_tax_subtotal_template) * 2 * tax_rate_count; // Ballpark list size. char* tax_subtotal_list_buffer = (char*)malloc(tax_subtotal_list_buffer_size); memset(tax_subtotal_list_buffer, 0, tax_subtotal_list_buffer_size); u32 tax_subtotal_list_buffer_cursor = 0; @@ -420,7 +420,7 @@ bool administration_writer_save_invoice_blocking(invoice inv) for (u32 i = 0; i < tax_rate_count; i++) { int tax_entry_buf_length = 0; - char* tax_entry_file_content = administration_writer_copy_template(peppol_invoice_tax_subtotal_template, &tax_entry_buf_length); + char* tax_entry_file_content = administration_writer_copy_template(file_template::peppol_invoice_tax_subtotal_template, &tax_entry_buf_length); tax_subtotal subtotal; administration_invoice_get_subtotal_for_tax_rate(&inv, tax_rate_buffer[i], &subtotal); @@ -455,7 +455,7 @@ bool administration_writer_save_invoice_blocking(invoice inv) billing_item* billing_item_buffer = (billing_item*)malloc(sizeof(billing_item) * administration_billing_item_count(&inv)); u32 billing_item_count = administration_billing_item_get_all_for_invoice(&inv, billing_item_buffer); - u32 billing_item_list_buffer_size = (u32)strlen(peppol_invoice_line_template) * 2 * billing_item_count; // Ballpark list size. + u32 billing_item_list_buffer_size = (u32)strlen(file_template::peppol_invoice_line_template) * 2 * billing_item_count; // Ballpark list size. char* billing_item_list_buffer = (char*)malloc(billing_item_list_buffer_size); memset(billing_item_list_buffer, 0, billing_item_list_buffer_size); u32 billing_item_list_buffer_cursor = 0; @@ -463,7 +463,7 @@ bool administration_writer_save_invoice_blocking(invoice inv) for (u32 i = 0; i < billing_item_count; i++) { int billing_item_buf_length = 0; - char* billing_item_file_content = administration_writer_copy_template(peppol_invoice_line_template, &billing_item_buf_length); + char* billing_item_file_content = administration_writer_copy_template(file_template::peppol_invoice_line_template, &billing_item_buf_length); billing_item bi = billing_item_buffer[i]; tax_rate rate; @@ -557,7 +557,7 @@ bool administration_writer_save_project_blocking(project project) bool result = 1; int buf_length = 0; - char* file_content = administration_writer_copy_template(project_save_template, &buf_length); + char* file_content = administration_writer_copy_template(file_template::project_save_template, &buf_length); struct tm *tm_info = 0; char date_buffer[11]; // "YYYY-MM-DD" + null terminator @@ -616,7 +616,7 @@ bool administration_writer_save_cost_center_blocking(cost_center cost) bool result = 1; int buf_length = 0; - char* file_content = administration_writer_copy_template(costcenter_save_template, &buf_length); + char* file_content = administration_writer_copy_template(file_template::costcenter_save_template, &buf_length); strops_replace(file_content, buf_length, "{{COSTCENTER_ID}}", cost.id); strops_replace(file_content, buf_length, "{{COSTCENTER_CODE}}", cost.code); @@ -664,7 +664,7 @@ bool administration_writer_save_tax_rate_blocking(tax_rate rate) bool result = 1; int buf_length = 0; - char* file_content = administration_writer_copy_template(taxrate_save_template, &buf_length); + char* file_content = administration_writer_copy_template(file_template::taxrate_save_template, &buf_length); strops_replace(file_content, buf_length, "{{TAXBRACKET_ID}}", rate.id); strops_replace(file_content, buf_length, "{{TAXBRACKET_COUNTRY}}", rate.country_code); @@ -715,7 +715,7 @@ bool administration_writer_save_contact_blocking(contact c) bool result = 1; int buf_length = 0; - char* file_content = administration_writer_copy_template(contact_save_template, &buf_length); + char* file_content = administration_writer_copy_template(file_template::contact_save_template, &buf_length); strops_replace(file_content, buf_length, "{{CONTACT_ID}}", c.id); strops_replace(file_content, buf_length, "{{CONTACT_NAME}}", c.name); @@ -779,11 +779,11 @@ bool administration_writer_save_all_administration_info_blocking() bool result = 1; int buf_length = 0; - char* file_content = administration_writer_copy_template(administration_save_template, &buf_length); + char* file_content = administration_writer_copy_template(file_template::administration_save_template, &buf_length); strops_replace_int32(file_content, buf_length, "{{NEXT_ID}}", administration_get_next_id()); strops_replace_int32(file_content, buf_length, "{{NEXT_SEQUENCE_NUMBER}}", administration_get_next_sequence_number()); - strops_replace(file_content, buf_length, "{{PROGRAM_VERSION}}", PROGRAM_VERSION); + strops_replace(file_content, buf_length, "{{PROGRAM_VERSION}}", config::PROGRAM_VERSION); ai_service ai_service = administration_get_ai_service(); strops_replace_int32(file_content, buf_length, "{{AI_SERVICE_PROVIDER}}", (s32)ai_service.provider); |
