webtranslateit-payday 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/payday/invoice.rb +3 -10
- data/lib/payday/line_item.rb +3 -10
- data/lib/payday.rb +6 -0
- data/payday.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d20c4b16690aff8ce6b55701f16bc9d4276b1cc5c0bc729a66d1b2a1b1e9551e
|
|
4
|
+
data.tar.gz: 3ca918d5b25fbc3c52aa6076d374013b576a8be33691b835a934d37f2b100198
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f531c74f975b2f33a89d3c0607a0143acf678572d4af2020e8444f1112e1326e7a214b349f0ca48089ec15433ee45b0c1996b0bc59939ef91ae3146dcd27c1f3
|
|
7
|
+
data.tar.gz: 005f6eaf3f2e619eaddc28f06c99293722c45a9a120cd2200a2f5c2158161ee8782691fa50b7ece4904fc31c215b42ce7672655ba1c287a5b2f780044e180069
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 2.1.2 (2026-11-08)
|
|
4
|
+
|
|
5
|
+
* Internal refactoring, no behaviour change: rates and line item values are parsed through one `Payday.to_decimal` (#323).
|
|
6
|
+
|
|
3
7
|
## 2.1.1 (2026-11-08)
|
|
4
8
|
|
|
5
9
|
* An invoice that defines `date_format` now has its dates formatted with it, the way it could already override `currency`, `invoice_logo`, `page_size`, `company_name` and `company_details`. Every one of those is read through the new `Config#value_for(invoice, property)` (#319, #321). `Payday::Invoice` has no `date_format`, so its output is unchanged.
|
data/lib/payday/invoice.rb
CHANGED
|
@@ -26,17 +26,17 @@ module Payday
|
|
|
26
26
|
|
|
27
27
|
# The tax rate that we're applying, as a BigDecimal
|
|
28
28
|
def tax_rate=(value)
|
|
29
|
-
@tax_rate =
|
|
29
|
+
@tax_rate = Payday.to_decimal(value)
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
# Shipping rate
|
|
33
33
|
def shipping_rate=(value)
|
|
34
|
-
@shipping_rate =
|
|
34
|
+
@shipping_rate = Payday.to_decimal(value)
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
# Retention rate (e.g. IRPF). Applied as a percentage of the subtotal and deducted from the total.
|
|
38
38
|
def retention_rate=(value)
|
|
39
|
-
@retention_rate =
|
|
39
|
+
@retention_rate = Payday.to_decimal(value)
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
# Adds a line item
|
|
@@ -44,13 +44,6 @@ module Payday
|
|
|
44
44
|
line_items << Payday::LineItem.new(options)
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
private
|
|
48
|
-
|
|
49
|
-
# A blank rate (nil, "", " ") is 0.
|
|
50
|
-
def to_rate(value)
|
|
51
|
-
BigDecimal(value.to_s.presence || 0)
|
|
52
|
-
end
|
|
53
|
-
|
|
54
47
|
end
|
|
55
48
|
|
|
56
49
|
end
|
data/lib/payday/line_item.rb
CHANGED
|
@@ -29,24 +29,17 @@ module Payday
|
|
|
29
29
|
|
|
30
30
|
# Sets the quantity of this {LineItem}
|
|
31
31
|
def quantity=(value)
|
|
32
|
-
@quantity = to_decimal(value)
|
|
32
|
+
@quantity = Payday.to_decimal(value)
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
# Sets the price for this {LineItem}
|
|
36
36
|
def price=(value)
|
|
37
|
-
@price = to_decimal(value)
|
|
37
|
+
@price = Payday.to_decimal(value)
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
# Sets the predefined_amount for this {LineItem}
|
|
41
41
|
def predefined_amount=(value)
|
|
42
|
-
@predefined_amount = to_decimal(value)
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
private
|
|
46
|
-
|
|
47
|
-
# A blank value (nil, "", " ") is 0.
|
|
48
|
-
def to_decimal(value)
|
|
49
|
-
BigDecimal(value.to_s.presence || 0)
|
|
42
|
+
@predefined_amount = Payday.to_decimal(value)
|
|
50
43
|
end
|
|
51
44
|
|
|
52
45
|
end
|
data/lib/payday.rb
CHANGED
data/payday.gemspec
CHANGED