diff options
Diffstat (limited to 'src/administration.cpp')
| -rw-r--r-- | src/administration.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/administration.cpp b/src/administration.cpp index f8d53f9..09bb560 100644 --- a/src/administration.cpp +++ b/src/administration.cpp @@ -126,8 +126,8 @@ static void administration_get_random_billing_items(invoice* inv) tax_rate buffer[20]; - char* country_codes[1] = {inv->supplier.address.country_code}; - u32 rate_count = administration_tax_rate_get_by_country(buffer, 1, country_codes); + char* tax_country_codes[1] = {inv->supplier.address.country_code}; + u32 rate_count = administration_tax_rate_get_by_country(buffer, 1, tax_country_codes); tax_rate rand_rate = buffer[rand() % rate_count]; strops_copy(item.tax_rate_id, rand_rate.id, MAX_LEN_ID); @@ -1045,6 +1045,7 @@ a_err administration_contact_is_valid(contact data) { a_err result = A_ERR_SUCCESS; if (strlen(data.name) == 0) result |= A_ERR_MISSING_NAME; + if (strlen(data.email) == 0) result |= A_ERR_MISSING_EMAIL; if (strlen(data.address.city) == 0) result |= A_ERR_MISSING_CITY; if (strlen(data.address.postal) == 0) result |= A_ERR_MISSING_POSTAL; if (strlen(data.address.address1) == 0) result |= A_ERR_MISSING_ADDRESS1; @@ -1326,7 +1327,7 @@ a_err administration_tax_rate_add(tax_rate data) return A_ERR_SUCCESS; } -u32 administration_tax_rate_get_by_country(tax_rate* buffer, u32 code_count, char** country_codes) +u32 administration_tax_rate_get_by_country(tax_rate* buffer, u32 code_count, char** tax_country_codes) { assert(buffer); @@ -1342,7 +1343,7 @@ u32 administration_tax_rate_get_by_country(tax_rate* buffer, u32 code_count, cha } for (u32 x = 0; x < code_count; x++) { - if (strcmp(c.country_code, country_codes[x]) == 0) { + if (strcmp(c.country_code, tax_country_codes[x]) == 0) { buffer[write_cursor++] = c; continue; } @@ -1708,7 +1709,7 @@ static void administration_invoice_set_refs(invoice* inv) } else { - // Store customer id in invoice, (only id is stored to disk, supplier field is filled on load). + // Store customer id in invoice. strops_copy(inv->customer_id, inv->customer.id, sizeof(inv->customer_id)); } } @@ -1772,7 +1773,7 @@ a_err administration_invoice_add(invoice* inv) memcpy(new_inv, ©, sizeof(invoice)); - new_inv->payment_means.payment_method = PAYMENT_METHOD_DEBIT_TRANSFER; + new_inv->payment_means.payment_method = PAYMENT_METHOD_STANDING_AGREEMENT; strops_copy(new_inv->payment_means.payee_bank_account, inv->customer.bank_account, sizeof(new_inv->payment_means.payee_bank_account)); strops_copy(new_inv->payment_means.payee_account_name, inv->customer.name, sizeof(new_inv->payment_means.payee_account_name)); strops_copy(new_inv->payment_means.service_provider_id, "", sizeof(new_inv->payment_means.service_provider_id)); |
