summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2025-10-12 15:55:10 +0200
committerAldrik Ramaekers <aldrikboy@gmail.com>2025-10-12 15:55:10 +0200
commit18b9e47b88ab483b8f6fa0b133519546846fbb5e (patch)
treee09a3a455641f4dfa1940cd96a576620f2b785e7
parent035bf5c318515406912678716e059b8e8546ce02 (diff)
docs work
-rw-r--r--README7
-rw-r--r--TODO22
-rw-r--r--include/strops.hpp10
-rw-r--r--manual/Doxyfile36
-rw-r--r--manual/OpenBooks_Manual.pdfbin75757 -> 127011 bytes
-rw-r--r--manual/new_header.tex6
-rw-r--r--tests/administration_validation_tests.cpp73
7 files changed, 53 insertions, 101 deletions
diff --git a/README b/README
index 2d0c386..0ec7d9b 100644
--- a/README
+++ b/README
@@ -2,15 +2,18 @@
OpenBooks - Accounting software
===============================
+OpenBooks is a simple and portable accounting tool. This tool aims to be EU VAT Directive compliant and has country specific compliance for invoice keeping and tax reporting.
+
Author: Aldrik Ramaekers <aldrik.ramaekers@gmail.com>
The master is hosted on github: https://github.com/aldrik-ramaekers/open-books
+Windows binaries can be downloaded from: https://github.com/aldrik-ramaekers/open-books/releases
-All documentation can be found inside manual/OpenBooks_Manual.pdf.
+All documentation can be found inside the source files, or manual/OpenBooks_Manual.pdf.
Dependencies
---------------
-Changes/patches have been made to most of these libraries.
+Changes/patches have been made to most of these libraries. Check the libs/ folder for each library's respective license.
- ImGui 1.92.1 (https://github.com/ocornut/imgui)
- simclist 1.5 (https://mij.oltrelinux.com/devel/simclist/)
diff --git a/TODO b/TODO
index 349f83d..b169b20 100644
--- a/TODO
+++ b/TODO
@@ -1,17 +1,25 @@
TODO:
+
+Testing:
+- write tests for all NL tax categories
+- write tests for strops.hpp
+- 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).
+
+Improvements:
+- There is alot of memory leakage
- for invoice importing using AI: all address data should be editable because import is not perfect
- for invoice importing using AI: file path should not be editable as it is imported
-- create invoice PDF for NL https://goedestartbelastingdienst.nl/wiki/view/50bdccd8-f9a0-4297-b57f-3a6651cbe05c/factuureisen
-- toggle on invoice form wether price is inclusive of tax.
-- retrieve available balance from AI api & show in settings/services.
-- let user choose the model to use in settings/services/ai
- real error logging for OpenAI and importing in general
-- write tests for strops.hpp
- log_set_depth function so data can be grouped
- log elapsed time for ai requests
- 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).
+
+Features:
+- create invoice PDF for NL https://goedestartbelastingdienst.nl/wiki/view/50bdccd8-f9a0-4297-b57f-3a6651cbe05c/factuureisen
+- toggle on invoice form wether price is inclusive of tax.
+- retrieve available balance from AI api & show in settings/services.
+- let user choose the model to use in settings/services/ai
- Send invoice by email
- create invoice from image of receipt
- create invoice from UBL file
diff --git a/include/strops.hpp b/include/strops.hpp
index 206aaee..537e058 100644
--- a/include/strops.hpp
+++ b/include/strops.hpp
@@ -18,11 +18,21 @@
#include "config.hpp"
+/// @brief Namespace for string operations.
namespace strops {
+ /// @brief Copy `src` into `dst`, with size check.
+ /// @return Size copied.
size_t copy(char *dst, const char *src, size_t size);
+
+ /// @brief Check if param `a` contains `b`.
+ /// @return Pointer to the match inside `a`. or `NULL` when no match is found.
char* contains(char* a, char* b);
+
+ /// @brief Check if `a` matches string `b`.
+ /// @return `true` when strings match, else `false`.
bool equals(const char* a, const char* b);
+
char* tokenize(char* a, const char* find);
s32 format_va(char* s, size_t n, const char* format, va_list args);
diff --git a/manual/Doxyfile b/manual/Doxyfile
index 3813738..5103bc8 100644
--- a/manual/Doxyfile
+++ b/manual/Doxyfile
@@ -135,7 +135,7 @@ BRIEF_MEMBER_DESC = YES
# brief descriptions will be completely suppressed.
# The default value is: YES.
-REPEAT_BRIEF = YES
+REPEAT_BRIEF = NO
# This tag implements a quasi-intelligent brief description abbreviator that is
# used to form the text in various listings. Each string in this list, if found
@@ -566,7 +566,7 @@ EXTRACT_STATIC = NO
# for Java sources.
# The default value is: YES.
-EXTRACT_LOCAL_CLASSES = YES
+EXTRACT_LOCAL_CLASSES = NO
# This flag is only useful for Objective-C code. If set to YES, local methods,
# which are defined in the implementation section but not in the interface are
@@ -607,7 +607,7 @@ HIDE_UNDOC_MEMBERS = NO
# if EXTRACT_ALL is enabled.
# The default value is: NO.
-HIDE_UNDOC_CLASSES = NO
+HIDE_UNDOC_CLASSES = YES
# If the HIDE_UNDOC_NAMESPACES tag is set to YES, Doxygen will hide all
# undocumented namespaces that are normally visible in the namespace hierarchy.
@@ -629,7 +629,7 @@ HIDE_FRIEND_COMPOUNDS = NO
# blocks will be appended to the function's detailed documentation block.
# The default value is: NO.
-HIDE_IN_BODY_DOCS = NO
+HIDE_IN_BODY_DOCS = YES
# The INTERNAL_DOCS tag determines if documentation that is typed after a
# \internal command is included. If the tag is set to NO then the documentation
@@ -673,13 +673,13 @@ HIDE_COMPOUND_REFERENCE= NO
# will show which file needs to be included to use the class.
# The default value is: YES.
-SHOW_HEADERFILE = YES
+SHOW_HEADERFILE = NO
# If the SHOW_INCLUDE_FILES tag is set to YES then Doxygen will put a list of
# the files that are included by a file in the documentation of that file.
# The default value is: YES.
-SHOW_INCLUDE_FILES = YES
+SHOW_INCLUDE_FILES = NO
# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
# grouped member an include statement to the documentation, telling the reader
@@ -705,7 +705,7 @@ INLINE_INFO = YES
# name. If set to NO, the members will appear in declaration order.
# The default value is: YES.
-SORT_MEMBER_DOCS = YES
+SORT_MEMBER_DOCS = NO
# If the SORT_BRIEF_DOCS tag is set to YES then Doxygen will sort the brief
# descriptions of file, namespace and class members alphabetically by member
@@ -758,19 +758,19 @@ STRICT_PROTO_MATCHING = NO
# list. This list is created by putting \todo commands in the documentation.
# The default value is: YES.
-GENERATE_TODOLIST = YES
+GENERATE_TODOLIST = NO
# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
# list. This list is created by putting \test commands in the documentation.
# The default value is: YES.
-GENERATE_TESTLIST = YES
+GENERATE_TESTLIST = NO
# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
# list. This list is created by putting \bug commands in the documentation.
# The default value is: YES.
-GENERATE_BUGLIST = YES
+GENERATE_BUGLIST = NO
# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
# the deprecated list. This list is created by putting \deprecated commands in
@@ -801,21 +801,21 @@ MAX_INITIALIZER_LINES = 30
# list will mention the files that were used to generate the documentation.
# The default value is: YES.
-SHOW_USED_FILES = YES
+SHOW_USED_FILES = NO
# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
# will remove the Files entry from the Quick Index and from the Folder Tree View
# (if specified).
# The default value is: YES.
-SHOW_FILES = YES
+SHOW_FILES = NO
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
# page. This will remove the Namespaces entry from the Quick Index and from the
# Folder Tree View (if specified).
# The default value is: YES.
-SHOW_NAMESPACES = YES
+SHOW_NAMESPACES = NO
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# Doxygen should invoke to get the current version for each file (typically from
@@ -991,7 +991,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
-INPUT = "..\manual"
+INPUT = ../manual ../include
# This tag can be used to specify the character encoding of the source files
# that Doxygen parses. Internally Doxygen uses the UTF-8 encoding. Doxygen uses
@@ -1031,11 +1031,9 @@ INPUT_FILE_ENCODING =
# provided as Doxygen C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
# *.f18, *.f, *.for, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.
-FILE_PATTERNS = *.c \
- *.cc \
+FILE_PATTERNS = *.cc \
*.cxx \
*.cxxm \
- *.cpp \
*.cppm \
*.ccm \
*.c++ \
@@ -1086,7 +1084,7 @@ FILE_PATTERNS = *.c \
# be searched for input files as well.
# The default value is: NO.
-RECURSIVE = NO
+RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
@@ -1311,7 +1309,7 @@ USE_HTAGS = NO
# See also: Section \class.
# The default value is: YES.
-VERBATIM_HEADERS = YES
+VERBATIM_HEADERS = NO
# If the CLANG_ASSISTED_PARSING tag is set to YES then Doxygen will use the
# clang parser (see:
diff --git a/manual/OpenBooks_Manual.pdf b/manual/OpenBooks_Manual.pdf
index 9c5c6a1..8b92215 100644
--- a/manual/OpenBooks_Manual.pdf
+++ b/manual/OpenBooks_Manual.pdf
Binary files differ
diff --git a/manual/new_header.tex b/manual/new_header.tex
index 0c34f4c..758020f 100644
--- a/manual/new_header.tex
+++ b/manual/new_header.tex
@@ -177,6 +177,12 @@
\markright{\thesection\ #1}%
}
+ % Used for parameters within a detailed function description
+ \renewcommand{\DoxyParamCaption}{%
+ \renewcommand{\item}[3][]{\hspace*{0.0cm} ##1 {\em ##2}##3}%
+ }{%
+ }
+
% ToC, LoF, LoT, bibliography, and index
% Indices & bibliography
\usepackage[numbers]{natbib}
diff --git a/tests/administration_validation_tests.cpp b/tests/administration_validation_tests.cpp
index 7ebe48e..ca523f3 100644
--- a/tests/administration_validation_tests.cpp
+++ b/tests/administration_validation_tests.cpp
@@ -14,20 +14,6 @@ TEST _administration_validate_project_add(void)
PASS();
}
-TEST _administration_validate_project_import(void)
-{
- administration::create_empty("");
- project p1 = administration::project_create_empty();
-
- ASSERT_EQ(administration::project_import(p1), A_ERR_MISSING_DESCRIPTION);
-
- strops::copy(p1.description, "test project", sizeof(p1.description));
- ASSERT_EQ(administration::project_import(p1), A_ERR_SUCCESS);
-
- PASS();
-}
-
-
TEST _administration_validate_project_update(void)
{
administration::create_empty("");
@@ -89,17 +75,6 @@ TEST _administration_validate_taxrate_add(void)
PASS();
}
-TEST _administration_validate_taxrate_import(void)
-{
- administration::create_empty("");
- tax_rate p1 = administration::tax_rate_create_empty();
-
- ASSERT_EQ(administration::tax_rate_import(p1), A_ERR_SUCCESS);
-
- PASS();
-}
-
-
TEST _administration_validate_taxrate_update(void)
{
administration::create_empty("");
@@ -133,23 +108,6 @@ TEST _administration_validate_costcenter_add(void)
PASS();
}
-TEST _administration_validate_costcenter_import(void)
-{
- administration::create_empty("");
- cost_center p1 = administration::cost_center_create_empty();
- strops::copy(p1.code, "TEST", sizeof(p1.code));
- strops::copy(p1.description, "description", sizeof(p1.description));
- ASSERT_EQ(administration::cost_center_import(p1), A_ERR_SUCCESS);
-
- ASSERT_EQ(administration::cost_center_import(p1), A_ERR_CODE_EXISTS);
- strops::copy(p1.code, "", sizeof(p1.code));
- ASSERT_EQ(administration::cost_center_import(p1), A_ERR_MISSING_CODE);
- strops::copy(p1.description, "", sizeof(p1.description));
- ASSERT_EQ(administration::cost_center_import(p1), A_ERR_MISSING_CODE|A_ERR_MISSING_DESCRIPTION);
-
- PASS();
-}
-
TEST _administration_validate_costcenter_update(void)
{
@@ -238,33 +196,6 @@ TEST _administration_validate_contact_add(void)
PASS();
}
-TEST _administration_validate_contact_import(void)
-{
-
- administration::create_empty("");
- contact p1 = _create_test_contact();
-
- ASSERT_EQ(administration::contact_import(p1), A_ERR_SUCCESS);
-
- strops::copy(p1.name, "", sizeof(p1.name));
- ASSERT_EQ(administration::contact_import(p1), A_ERR_MISSING_NAME);
- strops::copy(p1.address.address1, "", sizeof(p1.address.address1));
- ASSERT_EQ(administration::contact_import(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1);
- strops::copy(p1.address.city, "", sizeof(p1.address.city));
- ASSERT_EQ(administration::contact_import(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY);
- strops::copy(p1.address.postal, "", sizeof(p1.address.postal));
- ASSERT_EQ(administration::contact_import(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|A_ERR_MISSING_POSTAL);
- strops::copy(p1.address.country_code, "", sizeof(p1.address.country_code));
- ASSERT_EQ(administration::contact_import(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|A_ERR_MISSING_POSTAL|A_ERR_MISSING_COUNTRYCODE);
-
- p1.type = contact_type::CONTACT_BUSINESS;
- ASSERT_EQ(administration::contact_import(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|
- A_ERR_MISSING_POSTAL|A_ERR_MISSING_COUNTRYCODE|A_ERR_MISSING_TAXID|A_ERR_MISSING_BUSINESSID);
-
- PASS();
-}
-
-
TEST _administration_validate_contact_update(void)
{
administration::create_empty("");
@@ -345,22 +276,18 @@ TEST _administration_validate_contact_isvalid(void)
SUITE(administration_validate) {
RUN_TEST(_administration_validate_project_add);
- RUN_TEST(_administration_validate_project_import);
RUN_TEST(_administration_validate_project_update);
RUN_TEST(_administration_validate_project_remove);
RUN_TEST(_administration_validate_project_isvalid);
RUN_TEST(_administration_validate_taxrate_add);
- RUN_TEST(_administration_validate_taxrate_import);
RUN_TEST(_administration_validate_taxrate_update);
RUN_TEST(_administration_validate_costcenter_add);
- RUN_TEST(_administration_validate_costcenter_import);
RUN_TEST(_administration_validate_costcenter_update);
RUN_TEST(_administration_validate_costcenter_isvalid);
RUN_TEST(_administration_validate_contact_add);
- RUN_TEST(_administration_validate_contact_import);
RUN_TEST(_administration_validate_contact_update);
RUN_TEST(_administration_validate_contact_remove);
RUN_TEST(_administration_validate_contact_isvalid);