ydim 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5799a076ddcb592dd3c58dcf3b66e1bb73d1fcd
4
- data.tar.gz: f0652bdf5e23d2a58ed0f25bc89f8b5d243a0300
3
+ metadata.gz: 46e6d36c539ca68440088c2792c44d9b9915b27a
4
+ data.tar.gz: 2c8e5d48ea0acb9ee159f7e38929876dcb565b7b
5
5
  SHA512:
6
- metadata.gz: 64014cab48920fcee5f11de39dd6cfc448219159f96da842a319b39de5a491c733e1df8b1a036adf5fce11644a0baf6315ba00e2d91cdbc76f95c5e5518e3945
7
- data.tar.gz: 4f56513aab7e625450e0d1992e2fa4b5a81ba4b0823b4e339361a8c694a557499ba73efa91d7672fdba48d5d19205559e697c2e928041729c0eef14526c87b3e
6
+ metadata.gz: 1099d4d4da58ca3c7e9cdf86795f31757f925ea833e56b45005b792250657a8073d9f5bb3b2fef187012c98677c857f7c01ee2c2b486da4a50220fc8619ffb9c
7
+ data.tar.gz: d29c220a2628613cf5e4ac9c14ba572fffc4addc22f3640eecf1f138f05f77ebb1815db2ae7213d8e6e5843253eb5ad7b94ef19eb19a4622c28be661e5b8b887
@@ -1,3 +1,9 @@
1
+ === 1.0.8 / 09.01.2018
2
+
3
+ * Replace config['tax'] by vat_rate
4
+ * Fix loading config for sending mail
5
+
6
+
1
7
  === 1.0.7 / 08.01.2018
2
8
 
3
9
  * Fix loading the desired config early
@@ -31,7 +31,6 @@ module PdfInvoice
31
31
  },
32
32
  'logo_path' => nil,
33
33
  'logo_link' => nil,
34
- 'tax' => 0,
35
34
  'texts' => {
36
35
  'date' => 'Date',
37
36
  'description' => 'Description',
@@ -116,7 +116,7 @@ module PdfInvoice
116
116
  }
117
117
  table.data = @items.collect { |line|
118
118
  item_total = line.at(3).to_f * line.at(4).to_f
119
- vat += line[5] || @config.tax.to_f * item_total
119
+ vat += line[5] || (@config.vat_rate.to_f * item_total / 100)
120
120
  total += item_total
121
121
  date = line.at(0).strftime(@config.formats['date'])
122
122
  cw = pdf.text_width(date) * PDF::SimpleTable::WIDTH_FACTOR
@@ -106,9 +106,7 @@ module YDIM
106
106
  config.formats['quantity'] = "%1.#{@precision}f"
107
107
  config.formats['total'] = "#{@currency} %1.2f"
108
108
  if(item = @items[0])
109
- if((item.vat_rate - YDIM::Server.config.vat_rate).abs > 0.1)
110
- config.texts['tax'] = "MwSt 7.6%"
111
- end
109
+ config.texts['tax'] = sprintf("MwSt %0.1f%%", item.vat_rate)
112
110
  end
113
111
  invoice = PdfInvoice::Invoice.new(config)
114
112
  invoice.date = @date
@@ -6,6 +6,7 @@ require 'mail'
6
6
  module YDIM
7
7
  module Mail
8
8
  config = YDIM::Server.config
9
+ config.load(config.config)
9
10
  ::Mail.defaults do
10
11
  delivery_method :smtp, {
11
12
  :address => config.smtp_server,
@@ -1,3 +1,3 @@
1
1
  module YDIM
2
- VERSION = '1.0.7'
2
+ VERSION = '1.0.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ydim
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaomi Hatakeyama, Zeno R.R. Davatz, Niklaus Giger