Skip to content

Commit cc14acf

Browse files
committed
fix:dev: standardrb
1 parent 268632b commit cc14acf

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

lib/secretariat/export/zugferd_pdf.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def self.logger
1313

1414
# @@logger ||= Logger.new(File.join(log_directory, "export.log"))
1515

16-
@@logger ||= Logger.new(STDOUT)
16+
@@logger ||= Logger.new($stdout)
1717
end
1818

1919
def self.convert_a1_to_a3_params(pdf_a1, output_file_path)

lib/secretariat/invoice.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def valid?
7373
@errors = []
7474
tax = BigDecimal(tax_amount)
7575
basis = BigDecimal(basis_amount)
76-
calc_tax = basis * BigDecimal(tax_percent) / BigDecimal("100")
76+
calc_tax = basis * BigDecimal(tax_percent) / BigDecimal(100)
7777
calc_tax = calc_tax.round(2)
7878
if tax != calc_tax
7979
@errors << "Tax amount and calculated tax amount deviate: #{tax} / #{calc_tax}"
@@ -85,7 +85,7 @@ def valid?
8585
@errors << "Grand total amount and calculated grand total amount deviate: #{grand_total} / #{calc_grand_total}"
8686
return false
8787
end
88-
line_item_sum = line_items.inject(BigDecimal("0")) do |m, item|
88+
line_item_sum = line_items.inject(BigDecimal(0)) do |m, item|
8989
m + BigDecimal(item.charge_amount)
9090
end
9191
if line_item_sum != basis
@@ -306,12 +306,12 @@ def to_xml(version: 1, skip_validation: false, mode: :zugferd)
306306
Helpers.currency_element(xml, "ram", "LineTotalAmount", basis_amount, currency_code, add_currency: version == 1)
307307
# TODO: Fix this!
308308
# Zuschuesse
309-
unless BigDecimal("0").to_f.zero?
310-
Helpers.currency_element(xml, "ram", "ChargeTotalAmount", BigDecimal("0"), currency_code, add_currency: version == 1)
309+
unless BigDecimal(0).to_f.zero?
310+
Helpers.currency_element(xml, "ram", "ChargeTotalAmount", BigDecimal(0), currency_code, add_currency: version == 1)
311311
end
312312
# Rabatte
313-
unless BigDecimal("0").to_f.zero?
314-
Helpers.currency_element(xml, "ram", "AllowanceTotalAmount", BigDecimal("0"), currency_code, add_currency: version == 1)
313+
unless BigDecimal(0).to_f.zero?
314+
Helpers.currency_element(xml, "ram", "AllowanceTotalAmount", BigDecimal(0), currency_code, add_currency: version == 1)
315315
end
316316
Helpers.currency_element(xml, "ram", "TaxBasisTotalAmount", basis_amount, currency_code, add_currency: version == 1)
317317
unless tax_amount.to_f.zero?

lib/secretariat/line_item.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def valid?
6464
end
6565
end
6666

67-
calculated_tax = charge_price * BigDecimal(tax_percent) / BigDecimal("100")
67+
calculated_tax = charge_price * BigDecimal(tax_percent) / BigDecimal(100)
6868
calculated_tax = calculated_tax.round(2)
6969
if calculated_tax != tax
7070
@errors << "Tax and calculated tax deviate: #{tax} / #{calculated_tax}"

0 commit comments

Comments
 (0)