diff options
| -rw-r--r-- | include/administration.hpp | 2 | ||||
| -rw-r--r-- | include/administration_writer.hpp | 2 | ||||
| -rw-r--r-- | include/countries.hpp | 12 | ||||
| -rw-r--r-- | include/importer.hpp | 4 | ||||
| -rw-r--r-- | libs/ImGuiDatePicker/ImGuiDatePicker.cpp | 2 | ||||
| -rwxr-xr-x | run_linux64.sh | 12 | ||||
| -rw-r--r-- | src/administration.cpp | 4 | ||||
| -rw-r--r-- | src/administration_writer.cpp | 87 | ||||
| -rw-r--r-- | src/ai_providers/DeepSeek.cpp | 2 | ||||
| -rw-r--r-- | src/ai_providers/openAI.cpp | 6 | ||||
| -rw-r--r-- | src/countries.cpp | 12 | ||||
| -rw-r--r-- | src/countries/nl.cpp | 12 | ||||
| -rw-r--r-- | src/importer.cpp | 2 | ||||
| -rw-r--r-- | src/main_linux.cpp | 6 | ||||
| -rw-r--r-- | src/ui/ui_contacts.cpp | 6 | ||||
| -rw-r--r-- | src/ui/ui_invoices.cpp | 2 | ||||
| -rw-r--r-- | src/ui/ui_projects.cpp | 4 |
17 files changed, 93 insertions, 84 deletions
diff --git a/include/administration.hpp b/include/administration.hpp index c099318..31044f5 100644 --- a/include/administration.hpp +++ b/include/administration.hpp @@ -489,7 +489,7 @@ namespace administration { // Tax functions. // ======================= - tax_line* get_tax_line_from_report(tax_report* quarter, char* category); + tax_line* get_tax_line_from_report(tax_report* quarter, const char* category); void create_tax_statement(tax_statement* statement); // Other functions. diff --git a/include/administration_writer.hpp b/include/administration_writer.hpp index e1a651e..5c5ced2 100644 --- a/include/administration_writer.hpp +++ b/include/administration_writer.hpp @@ -35,7 +35,7 @@ namespace administration_writer { bool start_new(); // Individual entity writing. - bool delete_entry(char* id); + bool delete_entry(const char* id); bool save_project_blocking(project project); bool save_cost_center_blocking(cost_center cost); bool save_tax_rate_blocking(tax_rate rate); diff --git a/include/countries.hpp b/include/countries.hpp index 5364eff..7a15a32 100644 --- a/include/countries.hpp +++ b/include/countries.hpp @@ -20,7 +20,7 @@ typedef struct { - char* country_code; + const char* country_code; bool is_EU; bool enabled; // true = can be used as operating country. @@ -37,16 +37,16 @@ typedef struct namespace country { s32 get_count(); - char* get_code_by_index(s32 index); + const char* get_code_by_index(s32 index); time_t get_default_invoice_expire_duration(char* country_code); - bool is_EU(char* country_code); - bool is_enabled(char* country_code); - bool tax_is_implemented(char* country_code); + bool is_EU(const char* country_code); + bool is_enabled(const char* country_code); + bool tax_is_implemented(const char* country_code); void fill_tax_report_with_categories(char* country_code, tax_report* report); bool add_billing_item_to_tax_report(char* country_code, tax_report* report, invoice* inv, billing_item* item); float calculate_tax_report_final(char* country_code, tax_report* report); time_t get_invoice_date_to_use_for_tax_report(char* country_code, invoice* inv); - u32 get_available_tax_rates(char* country_code, tax_rate* buffer, u32 buffer_size); + u32 get_available_tax_rates(const char* country_code, tax_rate* buffer, u32 buffer_size); }
\ No newline at end of file diff --git a/include/importer.hpp b/include/importer.hpp index a27ed8e..1d97c12 100644 --- a/include/importer.hpp +++ b/include/importer.hpp @@ -66,8 +66,8 @@ namespace importer { char* provider_name; char* default_model; bool (*upload_file)(char* file_path, char* file_id, size_t file_id_len); - bool (*query_with_file)(char* query, size_t query_length, char* file_id, char** response); - bool (*batch_query_with_file)(char** queries, size_t query_count, char* file_id, invoice* buffer, batch_query_response_handler response_handler); + bool (*query_with_file)(const char* query, size_t query_length, char* file_id, char** response); + bool (*batch_query_with_file)(const char** queries, size_t query_count, char* file_id, invoice* buffer, batch_query_response_handler response_handler); bool (*get_available_models)(model_list_request* buffer); } ai_provider_impl; diff --git a/libs/ImGuiDatePicker/ImGuiDatePicker.cpp b/libs/ImGuiDatePicker/ImGuiDatePicker.cpp index c69c8ba..f340b95 100644 --- a/libs/ImGuiDatePicker/ImGuiDatePicker.cpp +++ b/libs/ImGuiDatePicker/ImGuiDatePicker.cpp @@ -209,7 +209,7 @@ namespace ImGui ImGui::PushFont(altFont); if (ImGui::BeginCombo(label.c_str(), items[v].c_str())) { - for (int i = 0; i < items.size(); ++i) + for (unsigned int i = 0; i < items.size(); ++i) { bool selected = (items[v] == items[i]); if (ImGui::Selectable(items[i].c_str(), &selected)) diff --git a/run_linux64.sh b/run_linux64.sh index 719e1d7..b84875b 100755 --- a/run_linux64.sh +++ b/run_linux64.sh @@ -1,11 +1,5 @@ #!/bin/bash -# Function to print errors and exit -function error_exit { - echo "$1" - exit 1 -} - # Set environment variables OUT_DIR="build" OUT_EXE="accounting" @@ -20,7 +14,7 @@ libs/timer_lib/*.c \ libs/tinyfiledialogs/tinyfiledialogs.c" SOURCES="src/*.cpp src/ui/*.cpp src/locales/*.cpp src/ai_providers/*.cpp" LIBS="-lstdc++ -lglfw -lGL -lm -lssl -lcrypto" -FLAGS="--no-warnings -g" +FLAGS="-Wall -Wno-changes-meaning -Wno-write-strings -Wno-attributes -Wno-unused-variable -fpermissive -Wno-format-zero-length -g" INCLUDE_DIRS="-Ilibs/imgui-1.92.1 \ -Ilibs/imgui-1.92.1/backends \ -Ilibs/openssl-3.6.0-beta1/x64/include \ @@ -37,7 +31,7 @@ DEFINITIONS="-D_PLATFORM_=\"linux64\"" # Check for test flag if [ "$1" == "-t" ]; then - SOURCES="tests/main_linux.cpp src/administration.cpp src/administration_writer.cpp src/administration_reader.cpp src/strops.cpp src/logger.cpp src/locales.cpp src/locales/*.cpp src/ai_providers/*.cpp src/importer.cpp src/memops.cpp src/countries.cpp" + SOURCES="tests/main.cpp src/administration.cpp src/administration_writer.cpp src/administration_reader.cpp src/strops.cpp src/logger.cpp src/locales.cpp src/locales/*.cpp src/ai_providers/*.cpp src/importer.cpp src/memops.cpp src/countries.cpp" OUT_EXE="accounting_tests" DEFINITIONS="-D_PLATFORM_=\"linux64\" -D_TESTING_MODE_" fi @@ -47,7 +41,7 @@ gcc $FLAGS $INCLUDE_DIRS $DEFINITIONS $SOURCES $LIB_SOURCES -o $OUT_DIR/$OUT_EXE # Run commands based on input arguments if [ "$1" == "-r" ]; then - "$OUT_DIR/$OUT_EXE" "/path/to/example.openbook" + "$OUT_DIR/$OUT_EXE" "/home/aldrik/Downloads/example.openbook" elif [ "$1" == "-t" ]; then "$OUT_DIR/$OUT_EXE" -v elif [ "$1" == "-d" ]; then diff --git a/src/administration.cpp b/src/administration.cpp index d7e4eed..b4f626e 100644 --- a/src/administration.cpp +++ b/src/administration.cpp @@ -431,7 +431,7 @@ void administration::create_tax_statement(tax_statement* statement) logger::info("Created tax statement in %.3fms.", STOPWATCH_TIME); } -tax_line* administration::get_tax_line_from_report(tax_report* quarter, char* category) +tax_line* administration::get_tax_line_from_report(tax_report* quarter, const char* category) { for (u32 t = 0; t < quarter->line_count; t++) { @@ -1899,6 +1899,8 @@ a_err administration::billing_item_add_to_invoice(invoice* invoice, billing_item memops::copy(tb, &item, sizeof(billing_item)); strops::format(tb->id, sizeof(tb->id), "B/%d", create_id()); strops::copy(tb->currency, invoice->currency, MAX_LEN_CURRENCY); // Set billing item currency to invoice currency. + + logger::info("XD: %s\n", tb->tax_internal_code); administration_recalculate_billing_item_totals(tb); if (!list_append(&invoice->billing_items, tb)) { diff --git a/src/administration_writer.cpp b/src/administration_writer.cpp index f12cf1f..45c8cdd 100644 --- a/src/administration_writer.cpp +++ b/src/administration_writer.cpp @@ -241,7 +241,7 @@ static char* copy_template(const char* template_str, int* buf_size) return file_content; } -static bool zip_entry_exists(char* entry) +static bool zip_entry_exists(const char* entry) { mtx_lock(&_save_file_mutex); @@ -255,7 +255,7 @@ static bool zip_entry_exists(char* entry) return result == 0; } -static bool delete_entry_by_name(char* entry) +static bool delete_entry_by_name(const char* entry) { STOPWATCH_START; @@ -265,8 +265,8 @@ static bool delete_entry_by_name(char* entry) struct zip_t *zip_write = zip_open(administration::get_file_path(), 0, 'a'); if (!zip_write) zip_write = zip_open(administration::get_file_path(), 0, 'w'); - char* indices[1] = {entry}; - if (zip_entries_delete(zip_write, indices, 1) < 0) result = 0; + const char* indices[1] = {entry}; + if (zip_entries_delete(zip_write, (char* const*)indices, 1) < 0) result = 0; zip_close(zip_write); if (result) logger::info("Deleted entry '%s' in %.3fms.", entry, STOPWATCH_TIME); @@ -277,7 +277,7 @@ static bool delete_entry_by_name(char* entry) return result; } -bool administration_writer::delete_entry(char* id) +bool administration_writer::delete_entry(const char* id) { char final_path[50]; strops::format(final_path, 50, "%s.xml", id); @@ -285,7 +285,7 @@ bool administration_writer::delete_entry(char* id) return delete_entry_by_name(final_path); } -static bool write_to_zip(char* entry_to_replace, char* orig_content, int final_length) +static bool write_to_zip(const char* entry_to_replace, char* orig_content, int final_length) { mtx_lock(&_save_file_mutex); @@ -318,53 +318,54 @@ static bool write_to_zip(char* entry_to_replace, char* orig_content, int final_l //// Invoices ///////////////////////////// -static char* get_eas_id_for_contact(contact contact) +static const char* get_eas_id_for_contact(contact *contact) { - if (contact.type == contact_type::CONTACT_CONSUMER) { + //return contact.businessid; + if (contact->type == contact_type::CONTACT_CONSUMER) { return "[CONSUMER]"; } // https://docs.peppol.eu/poacc/billing/3.0/codelist/eas/ - char* country_code = contact.address.country_code; + char* country_code = contact->address.country_code; // Countries using tax identification numbers. - if (strops::equals(country_code, "AT")) return contact.taxid; // Austria - if (strops::equals(country_code, "BE")) return contact.taxid; // Belgium - if (strops::equals(country_code, "BG")) return contact.taxid; // Bulgaria - if (strops::equals(country_code, "CY")) return contact.taxid; // Cyprus - if (strops::equals(country_code, "CZ")) return contact.taxid; // Czech Republic - if (strops::equals(country_code, "DE")) return contact.taxid; // Germany - if (strops::equals(country_code, "EE")) return contact.taxid; // Estonia - if (strops::equals(country_code, "FR")) return contact.taxid; // France - if (strops::equals(country_code, "GR")) return contact.taxid; // Greece - if (strops::equals(country_code, "HR")) return contact.taxid; // Croatia - if (strops::equals(country_code, "HU")) return contact.taxid; // Hungary - if (strops::equals(country_code, "IE")) return contact.taxid; // Ireland - if (strops::equals(country_code, "LU")) return contact.taxid; // Luxembourg - if (strops::equals(country_code, "LV")) return contact.taxid; // Latvia - if (strops::equals(country_code, "MT")) return contact.taxid; // Malta - if (strops::equals(country_code, "PL")) return contact.taxid; // Poland - if (strops::equals(country_code, "PT")) return contact.taxid; // Portugal - if (strops::equals(country_code, "RO")) return contact.taxid; // Romania - if (strops::equals(country_code, "SI")) return contact.taxid; // Slovenia - if (strops::equals(country_code, "SK")) return contact.taxid; // Slovakia - if (strops::equals(country_code, "ES")) return contact.taxid; // Spain + if (strops::equals(country_code, "AT")) return contact->taxid; // Austria + if (strops::equals(country_code, "BE")) return contact->taxid; // Belgium + if (strops::equals(country_code, "BG")) return contact->taxid; // Bulgaria + if (strops::equals(country_code, "CY")) return contact->taxid; // Cyprus + if (strops::equals(country_code, "CZ")) return contact->taxid; // Czech Republic + if (strops::equals(country_code, "DE")) return contact->taxid; // Germany + if (strops::equals(country_code, "EE")) return contact->taxid; // Estonia + if (strops::equals(country_code, "FR")) return contact->taxid; // France + if (strops::equals(country_code, "GR")) return contact->taxid; // Greece + if (strops::equals(country_code, "HR")) return contact->taxid; // Croatia + if (strops::equals(country_code, "HU")) return contact->taxid; // Hungary + if (strops::equals(country_code, "IE")) return contact->taxid; // Ireland + if (strops::equals(country_code, "LU")) return contact->taxid; // Luxembourg + if (strops::equals(country_code, "LV")) return contact->taxid; // Latvia + if (strops::equals(country_code, "MT")) return contact->taxid; // Malta + if (strops::equals(country_code, "PL")) return contact->taxid; // Poland + if (strops::equals(country_code, "PT")) return contact->taxid; // Portugal + if (strops::equals(country_code, "RO")) return contact->taxid; // Romania + if (strops::equals(country_code, "SI")) return contact->taxid; // Slovenia + if (strops::equals(country_code, "SK")) return contact->taxid; // Slovakia + if (strops::equals(country_code, "ES")) return contact->taxid; // Spain // Countries using business identification numbers. - if (strops::equals(country_code, "NL")) return contact.businessid; // Netherlands - if (strops::equals(country_code, "SE")) return contact.businessid; // Sweden - if (strops::equals(country_code, "LT")) return contact.businessid; // Lithuania - if (strops::equals(country_code, "IT")) return contact.businessid; // Italy - if (strops::equals(country_code, "FI")) return contact.businessid; // Finland - if (strops::equals(country_code, "DK")) return contact.businessid; // Denmark - - return contact.businessid; // Unknown country code + if (strops::equals(country_code, "NL")) return contact->businessid; // Netherlands + if (strops::equals(country_code, "SE")) return contact->businessid; // Sweden + if (strops::equals(country_code, "LT")) return contact->businessid; // Lithuania + if (strops::equals(country_code, "IT")) return contact->businessid; // Italy + if (strops::equals(country_code, "FI")) return contact->businessid; // Finland + if (strops::equals(country_code, "DK")) return contact->businessid; // Denmark + + return contact->businessid; // Unknown country code } -static char* get_eas_scheme_for_contact(contact contact) +static const char* get_eas_scheme_for_contact(contact contact) { if (contact.type == contact_type::CONTACT_CONSUMER) { - return "0203"; // Hack + return "0203"; // @Hack } address addr = contact.address; @@ -399,7 +400,7 @@ static char* get_eas_scheme_for_contact(contact contact) if (strops::equals(country_code, "SK")) return "9950"; // Slovakia if (strops::equals(country_code, "ES")) return "9920"; // Spain - return "0203"; // Hack + return "0203"; // @Hack } bool isEmptyTag(const char *start, const char *end) { @@ -518,7 +519,7 @@ bool administration_writer::save_invoice_blocking(invoice inv) // Supplier data strops::replace(file_content, buf_length, "{{SUPPLIER_ENDPOINT_SCHEME}}", get_eas_scheme_for_contact(inv.supplier)); - strops::replace(file_content, buf_length, "{{SUPPLIER_ENDPOINT_ID}}", get_eas_id_for_contact(inv.supplier)); + strops::replace(file_content, buf_length, "{{SUPPLIER_ENDPOINT_ID}}", get_eas_id_for_contact(&inv.supplier)); strops::replace(file_content, buf_length, "{{SUPPLIER_ID}}", inv.supplier.id); strops::replace(file_content, buf_length, "{{SUPPLIER_NAME}}", inv.supplier.name); strops::replace(file_content, buf_length, "{{SUPPLIER_STREET}}", inv.supplier.address.address1); @@ -535,7 +536,7 @@ bool administration_writer::save_invoice_blocking(invoice inv) // Customer data strops::replace(file_content, buf_length, "{{CUSTOMER_ENDPOINT_SCHEME}}", get_eas_scheme_for_contact(inv.customer)); - strops::replace(file_content, buf_length, "{{CUSTOMER_ENDPOINT_ID}}", get_eas_id_for_contact(inv.customer)); + strops::replace(file_content, buf_length, "{{CUSTOMER_ENDPOINT_ID}}", get_eas_id_for_contact(&inv.customer)); strops::replace(file_content, buf_length, "{{CUSTOMER_ID}}", inv.customer.id); strops::replace(file_content, buf_length, "{{CUSTOMER_NAME}}", inv.customer.name); strops::replace(file_content, buf_length, "{{CUSTOMER_STREET}}", inv.customer.address.address1); diff --git a/src/ai_providers/DeepSeek.cpp b/src/ai_providers/DeepSeek.cpp index ede31f8..c34e299 100644 --- a/src/ai_providers/DeepSeek.cpp +++ b/src/ai_providers/DeepSeek.cpp @@ -24,7 +24,7 @@ #define QUERY_BUFFER_SIZE 1000000 char* query_buffer = 0; -static bool _DeepSeek_query_with_file(char* query, size_t query_length, char* file_id, char** response) +static bool _DeepSeek_query_with_file(const char* query, size_t query_length, char* file_id, char** response) { (void)file_id; (void)query_length; diff --git a/src/ai_providers/openAI.cpp b/src/ai_providers/openAI.cpp index 3e5104d..d1495dc 100644 --- a/src/ai_providers/openAI.cpp +++ b/src/ai_providers/openAI.cpp @@ -24,7 +24,7 @@ #include "logger.hpp" #include "importer.hpp" -static bool _openAI_batch_query_with_file(char** queries, size_t query_count, char* file_id, invoice* buffer, importer::batch_query_response_handler response_handler) +static bool _openAI_batch_query_with_file(const char** queries, size_t query_count, char* file_id, invoice* buffer, importer::batch_query_response_handler response_handler) { const char *api_key = administration::get_ai_service().api_key_public; httplib::SSLClient cli("api.openai.com", 443); @@ -94,7 +94,7 @@ static bool _openAI_batch_query_with_file(char** queries, size_t query_count, ch return 1; } -static bool _openAI_query_with_file(char* query, size_t query_length, char* file_id, char** response) +static bool _openAI_query_with_file(const char* query, size_t query_length, char* file_id, char** response) { const char *api_key = administration::get_ai_service().api_key_public; @@ -102,7 +102,7 @@ static bool _openAI_query_with_file(char* query, size_t query_length, char* file //cli.enable_server_certificate_verification(false); char* query_escaped = strops::prep_str_for_json(query, query_length); - memops::unalloc(query); + //memops::unalloc(query); size_t body_size = query_length + 200; char* body = (char*)memops::alloc(body_size); diff --git a/src/countries.cpp b/src/countries.cpp index 34aacf1..5d1ea5a 100644 --- a/src/countries.cpp +++ b/src/countries.cpp @@ -226,12 +226,12 @@ s32 country::get_count() return country_map_count; } -char* country::get_code_by_index(s32 index) +const char* country::get_code_by_index(s32 index) { return country_map[index].country_code; } -static s32 get_index_by_country_code(char* country_code) +static s32 get_index_by_country_code(const char* country_code) { for (u32 i = 0; i < country_map_count; i++) { @@ -242,7 +242,7 @@ static s32 get_index_by_country_code(char* country_code) return -1; } -bool country::is_EU(char* country_code) +bool country::is_EU(const char* country_code) { s32 index = get_index_by_country_code(country_code); if (index == -1) return 0; @@ -250,7 +250,7 @@ bool country::is_EU(char* country_code) return country_map[index].is_EU; } -bool country::is_enabled(char* country_code) +bool country::is_enabled(const char* country_code) { s32 index = get_index_by_country_code(country_code); if (index == -1) return 0; @@ -266,7 +266,7 @@ time_t country::get_default_invoice_expire_duration(char* country_code) return country_map[index].get_default_invoice_expire_duration(); } -bool country::tax_is_implemented(char* country_code) +bool country::tax_is_implemented(const char* country_code) { s32 index = get_index_by_country_code(country_code); if (index == -1) return false; @@ -307,7 +307,7 @@ time_t country::get_invoice_date_to_use_for_tax_report(char* country_code, invoi return country_map[index].get_invoice_date_to_use_for_tax_report(inv); } -u32 country::get_available_tax_rates(char* country_code, tax_rate* buffer, u32 buffer_size) +u32 country::get_available_tax_rates(const char* country_code, tax_rate* buffer, u32 buffer_size) { s32 index = get_index_by_country_code(country_code); assert(index != -1); diff --git a/src/countries/nl.cpp b/src/countries/nl.cpp index 8a56e71..ac44ad9 100644 --- a/src/countries/nl.cpp +++ b/src/countries/nl.cpp @@ -145,7 +145,7 @@ time_t _nl_get_invoice_date_to_use_for_tax_report(invoice* inv) return inv->issued_at; } -static tax_rate _create_tax_rate(tax_rate_type type, char* internal_code, char* category_code, float rate, ...) +static tax_rate _create_tax_rate(tax_rate_type type, const char* internal_code, const char* category_code, float rate, ...) { tax_rate result; result.type = type; @@ -170,7 +170,7 @@ static tax_rate _create_tax_rate(tax_rate_type type, char* internal_code, char* return result; } -static tax_rate _create_tax_rate(tax_rate_type type, char* internal_code, float rate, ...) +static tax_rate _create_tax_rate(tax_rate_type type, const char* internal_code, float rate, ...) { tax_rate result; memops::zero(&result, sizeof(tax_rate)); @@ -201,7 +201,13 @@ u32 _nl_get_available_tax_rates(tax_rate* buffer, u32 buffer_size) assert(buffer); u32 cc = 0; - #define ADD(_line) if (cc < buffer_size) buffer[cc++] = _line; else assert(0); + #define ADD(_line) \ + if (cc < buffer_size) \ + { \ + tax_rate data = _line;\ + memops::copy(&buffer[cc++], (const void*)&data, sizeof(tax_rate)); \ + } \ + else assert(0); // Outgoing ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/21", "S", 21.00, "NL/1a", 0)); diff --git a/src/importer.cpp b/src/importer.cpp index e3d8048..3c56062 100644 --- a/src/importer.cpp +++ b/src/importer.cpp @@ -219,7 +219,7 @@ static int _ai_document_to_invoice_t(void *arg) request->status = importer::status::IMPORT_WAITING_FOR_RESPONSE; - char* queries[] = { + const char* queries[] = { "What is the invoice number/ID? Return json containing sequential_number (string), query_id = 1 (string)", "When was this invoice issued? Return json containing issued_at (time_t value), query_id = 2 (string). If not found, issued_at = 0", "When does this invoice expire? Return json containing expires_at (time_t value), query_id = 3 (string). If not found, expires_at = 0", diff --git a/src/main_linux.cpp b/src/main_linux.cpp index f30f063..e1dd7f6 100644 --- a/src/main_linux.cpp +++ b/src/main_linux.cpp @@ -74,9 +74,9 @@ int main(int argc, char** argv) ImGui_ImplOpenGL2_Init(); style.FontSizeBase = 18.0f; - io.Fonts->AddFontFromFileTTF("build/Segoe UI.ttf"); - ui::fontBold = io.Fonts->AddFontFromFileTTF("build/Segoe UI Bold.ttf"); - ui::fontBig = io.Fonts->AddFontFromFileTTF("build/Segoe UI Bold.ttf", 30); + io.Fonts->AddFontFromFileTTF("build/Roboto-Regular.ttf"); + ui::fontBold = io.Fonts->AddFontFromFileTTF("build/Roboto-Bold.ttf"); + ui::fontBig = io.Fonts->AddFontFromFileTTF("build/Roboto-Bold.ttf", 30); ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f); diff --git a/src/ui/ui_contacts.cpp b/src/ui/ui_contacts.cpp index 5d92f8a..a9559c5 100644 --- a/src/ui/ui_contacts.cpp +++ b/src/ui/ui_contacts.cpp @@ -31,7 +31,7 @@ static contact active_contact; void ui::setup_contacts() { current_view_state = ui::view_state::LIST_ALL; - active_contact = active_contact = administration::contact_create_empty(); + active_contact = administration::contact_create_empty(); memops::zero(&selected_for_removal, sizeof(contact)); } @@ -87,7 +87,7 @@ static void draw_contact_list() ImGui::TableSetupColumn(locale::get("contact.table.identifier"), ImGuiTableColumnFlags_WidthFixed, 80); ImGui::TableSetupColumn(locale::get("contact.table.name"), ImGuiTableColumnFlags_WidthStretch); ImGui::TableSetupColumn(locale::get("contact.table.address"), ImGuiTableColumnFlags_WidthStretch); - ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, 160); + ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, 170); ImGui::TableHeadersRow(); contact contact_list[items_per_page]; @@ -214,5 +214,7 @@ void ui::draw_contacts() ImGui::ContactForm(&active_contact, true, false); break; + + default: break; } }
\ No newline at end of file diff --git a/src/ui/ui_invoices.cpp b/src/ui/ui_invoices.cpp index ff3c73b..c4d393c 100644 --- a/src/ui/ui_invoices.cpp +++ b/src/ui/ui_invoices.cpp @@ -545,5 +545,7 @@ void ui::draw_invoices() case ui::view_state::CREATE: draw_invoice_create(); break; case ui::view_state::EDIT_EXISTING: draw_invoice_update(); break; case ui::view_state::VIEW_EXISTING: draw_invoice_view(); break; + + default: break; } }
\ No newline at end of file diff --git a/src/ui/ui_projects.cpp b/src/ui/ui_projects.cpp index 94f2be6..42dba92 100644 --- a/src/ui/ui_projects.cpp +++ b/src/ui/ui_projects.cpp @@ -122,7 +122,7 @@ static void draw_project_list() ImGui::TableSetupColumn(locale::get("project.table.identifier"), ImGuiTableColumnFlags_WidthFixed, 80); ImGui::TableSetupColumn(locale::get("project.table.status"), ImGuiTableColumnFlags_WidthFixed, 140); ImGui::TableSetupColumn(locale::get("project.table.description"), ImGuiTableColumnFlags_WidthStretch); - ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, 160); + ImGui::TableSetupColumn("", ImGuiTableColumnFlags_WidthFixed, 175); ImGui::TableHeadersRow(); project project_list[items_per_page]; @@ -198,5 +198,7 @@ void ui::draw_projects() case ui::view_state::CREATE: draw_project_form(); break; case ui::view_state::EDIT_EXISTING: draw_project_form(); break; case ui::view_state::VIEW_EXISTING: draw_project_form(); break; + + default: break; } }
\ No newline at end of file |
