diff options
Diffstat (limited to 'src/administration_writer.cpp')
| -rw-r--r-- | src/administration_writer.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/administration_writer.cpp b/src/administration_writer.cpp index ebc0056..aae264b 100644 --- a/src/administration_writer.cpp +++ b/src/administration_writer.cpp @@ -427,10 +427,7 @@ bool administration_writer::save_invoice_blocking(invoice inv) strops::replace_float(tax_entry_file_content, tax_entry_buf_length, "{{TAXABLE_AMOUNT}}", subtotal.net, 2); strops::replace_float(tax_entry_file_content, tax_entry_buf_length, "{{TAX_AMOUNT}}", subtotal.tax, 2); - char tax_category[10]; - tax_category[0] = 0; // TODO get tax category - - strops::replace(tax_entry_file_content, tax_entry_buf_length, "{{TAX_CATEGORY}}", tax_category); + strops::replace(tax_entry_file_content, tax_entry_buf_length, "{{TAX_CATEGORY}}", tax_rate_buffer[i].category_code); strops::replace_float(tax_entry_file_content, tax_entry_buf_length, "{{TAX_PERCENT}}", tax_rate_buffer[i].rate, 2); u32 content_len = (u32)strlen(tax_entry_file_content); @@ -475,7 +472,7 @@ bool administration_writer::save_invoice_blocking(invoice inv) strops::replace(billing_item_file_content, billing_item_buf_length, "{{LINE_ID}}", bi.id); strops::replace(billing_item_file_content, billing_item_buf_length, "{{LINE_TAX_ID}}", bi.tax_internal_code); strops::replace(billing_item_file_content, billing_item_buf_length, "{{ITEM_NAME}}", bi.description); - strops::replace(billing_item_file_content, billing_item_buf_length, "{{LINE_TAX_CATEGORY}}", "S"); // TODO get from tax code + strops::replace(billing_item_file_content, billing_item_buf_length, "{{LINE_TAX_CATEGORY}}", rate.category_code); strops::replace_float(billing_item_file_content, billing_item_buf_length, "{{LINE_TAX_PERCENT}}", rate.rate, 2); strops::replace_float(billing_item_file_content, billing_item_buf_length, "{{LINE_AMOUNT}}", bi.net, 2); // line amount = net_per_item * items_count - discount strops::replace_float(billing_item_file_content, billing_item_buf_length, "{{QUANTITY}}", bi.amount, 2); @@ -670,7 +667,8 @@ bool administration_writer::save_tax_rate_blocking(tax_rate rate) strops::replace(file_content, buf_length, "{{TAXBRACKET_INTERNAL_CODE}}", rate.internal_code); strops::replace_float(file_content, buf_length, "{{TAXBRACKET_RATE}}", rate.rate, 2); - strops::replace_int32(file_content, buf_length, "{{TAXBRACKET_TYPE}}", static_cast<int>(rate.type)); + strops::replace_int32(file_content, buf_length, "{{TAXBRACKET_TYPE}}", static_cast<int>(rate.type)); + strops::replace(file_content, buf_length, "{{TAXBRACKET_CATEGORY}}", rate.category_code); char tax_sections_buffer[MAX_LEN_LONG_DESC]; char* write_cursor = tax_sections_buffer; |
