summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2025-09-27 10:04:33 +0200
committerAldrik Ramaekers <aldrikboy@gmail.com>2025-09-27 10:04:33 +0200
commit94636b871f0272b518dbb38ce0eb75f9e18bea8b (patch)
tree11810f1f009366cc7d3a203f0d981a3cf9b3d346
parent58edcf619ee9d589dd7b54b8a9cbd4271740c13b (diff)
refactor
-rw-r--r--docs/CHANGES.rst3
-rw-r--r--include/administration.hpp1
-rw-r--r--src/administration.cpp7
-rw-r--r--src/ui/ui_contacts.cpp11
4 files changed, 6 insertions, 16 deletions
diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst
index 39a011c..64bd317 100644
--- a/docs/CHANGES.rst
+++ b/docs/CHANGES.rst
@@ -4,7 +4,8 @@ TODO:
- refactor _add functions to use _import functions
- write tests that check error handling for corrupt files. (e.g. references to tax rates, project and cost center that failed to load)
- it is possible a referenced tax rate is loaded after an invoice is loaded. This means all invoices need to be recalculated after file load. (try to write a test for this).
-
+- invoice sequential number should be modifyable (for external invoices being imported)
+- allow cost centers to be deleted that have 0 references
- Send invoice by email
- create invoice from PDF file
- create invoice from image of receipt
diff --git a/include/administration.hpp b/include/administration.hpp
index ad01193..b3f453e 100644
--- a/include/administration.hpp
+++ b/include/administration.hpp
@@ -422,7 +422,6 @@ a_err administration_contact_remove(contact data);
a_err administration_addressee_is_valid(delivery_info data);
a_err administration_contact_is_valid(contact data);
-bool administration_contact_can_be_deleted(contact data);
bool administration_contact_equals(contact c1, contact c2);
a_err administration_contact_get_by_id(contact* buffer, char* id);
diff --git a/src/administration.cpp b/src/administration.cpp
index af276f3..c451f9b 100644
--- a/src/administration.cpp
+++ b/src/administration.cpp
@@ -733,13 +733,6 @@ a_err administration_contact_add(contact data)
return A_ERR_SUCCESS;
}
-bool administration_contact_can_be_deleted(contact data)
-{
- (void)data;
- // TODO
- return true;
-}
-
a_err administration_contact_update(contact data)
{
a_err result = administration_contact_is_valid(data);
diff --git a/src/ui/ui_contacts.cpp b/src/ui/ui_contacts.cpp
index fc03e84..ffed39a 100644
--- a/src/ui/ui_contacts.cpp
+++ b/src/ui/ui_contacts.cpp
@@ -178,13 +178,10 @@ static void draw_contact_list()
}
ImGui::SameLine();
- if (administration_contact_can_be_deleted(c))
- {
- snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.delete"), i);
- if (ImGui::Button(btn_name)) {
- selected_for_removal = c;
- ImGui::OpenPopup("ConfirmDeletePopup");
- }
+ snprintf(btn_name, sizeof(btn_name), "%s##%d", localize("form.delete"), i);
+ if (ImGui::Button(btn_name)) {
+ selected_for_removal = c;
+ ImGui::OpenPopup("ConfirmDeletePopup");
}
}