From fad9076913a43ad32b1d8997734dc19ccccae2f4 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Sun, 6 Mar 2016 14:57:10 +0100 Subject: [PATCH] Add a config option to map tax rates to GnuCash tax table names --- config.yaml.example | 3 +++ stoptime.rb | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/config.yaml.example b/config.yaml.example index 8d5b841..44daac8 100644 --- a/config.yaml.example +++ b/config.yaml.example @@ -13,6 +13,9 @@ # The VAT rate #vat_rate: 21.0 +# VAT rate to Gnucash tax table name mapping +#gnucash_vat_table: {} + # The invoice ID format (see strftime(3) and %N for the sequence number) #invoice_id: %Y%N diff --git a/stoptime.rb b/stoptime.rb index 62dd4f6..93c66ef 100644 --- a/stoptime.rb +++ b/stoptime.rb @@ -162,12 +162,13 @@ module StopTime::Models # The default configuration. Note that the configuration of the root # will be merged with this configuration. - DefaultConfig = { "invoice_id" => "%Y%N", - "invoice_template" => "invoice", - "hourly_rate" => 20.0, - "time_resolution" => 1, - "date_new_entry" => "today", - "vat_rate" => 21.0 } + DefaultConfig = { "gnucash_vat_table" => {}, + "invoice_id" => "%Y%N", + "invoice_template" => "invoice", + "hourly_rate" => 20.0, + "time_resolution" => 1, + "date_new_entry" => "today", + "vat_rate" => 21.0 } # Creates a new configuration object and loads the configuation. # by reading the file +config.yaml+ on disk (see {ConfigFile}, parsing