summaryrefslogtreecommitdiff
path: root/tests/test_helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_helper.cpp')
-rw-r--r--tests/test_helper.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_helper.cpp b/tests/test_helper.cpp
index 1dbb2b2..167cb15 100644
--- a/tests/test_helper.cpp
+++ b/tests/test_helper.cpp
@@ -162,6 +162,34 @@ static billing_item _create_bi6(invoice *inv)
return item;
}
+static billing_item _create_bi(float amount, float npi, char* taxrate)
+{
+ billing_item item = administration::billing_item_create_empty();
+ item.amount = amount;
+ item.amount_is_percentage = 0;
+ strops::copy(item.description, "#", MAX_LEN_LONG_DESC);
+ item.net_per_item = npi;
+ item.discount = 0.0f;
+ item.discount_is_percentage = 0;
+ tax_rate rate;
+ administration::tax_rate_get_by_shorthandle(&rate, taxrate);
+ strops::copy(item.tax_rate_id, rate.id, MAX_LEN_ID);
+ return item;
+}
+
+static invoice _create_nl_b2b_inv_outgoing()
+{
+ invoice inv = administration::invoice_create_empty();
+ inv.supplier = administration::company_info_get();
+ inv.customer = _create_nl_business();
+ inv.is_outgoing = 1;
+ inv.status = invoice_status::INVOICE_CONCEPT;
+ inv.issued_at = time(NULL);
+ inv.delivered_at = inv.issued_at;
+ inv.expires_at = inv.issued_at + 1000;
+ return inv;
+}
+
static bool _test_peppol_file(char* id)
{
bool result = 1;