Fix Rubocop styling issues

This commit is contained in:
Karl Erik Õunapuu 2020-02-27 11:32:29 +02:00
parent 86889b6432
commit 5816ae1663
3 changed files with 6 additions and 5 deletions

View file

@ -13,7 +13,7 @@ module BookKeeping
'customer_code': accounting_customer_code, 'customer_code': accounting_customer_code,
'language': language, 'language': language,
'currency': activities.first.currency, 'currency': activities.first.currency,
'date': month.end_of_month.strftime('%Y-%m-%d') 'date': month.end_of_month.strftime('%Y-%m-%d'),
}.as_json }.as_json
lines = [] lines = []
@ -65,7 +65,7 @@ module BookKeeping
'product_id': DOMAIN_TO_PRODUCT[price.zone_name.to_sym], 'product_id': DOMAIN_TO_PRODUCT[price.zone_name.to_sym],
'quantity': 1, 'quantity': 1,
'price': yearly ? (price.price.amount / price.duration.to_i) : price.price.amount, 'price': yearly ? (price.price.amount / price.duration.to_i) : price.price.amount,
'unit': language == 'en' ? 'pc' : 'tk' 'unit': language == 'en' ? 'pc' : 'tk',
} }
line['description'] = description_in_language(price: price, yearly: yearly) line['description'] = description_in_language(price: price, yearly: yearly)
@ -106,7 +106,7 @@ module BookKeeping
'description': language == 'en' ? 'Domains prepayment' : 'Domeenide ettemaks', 'description': language == 'en' ? 'Domains prepayment' : 'Domeenide ettemaks',
'quantity': -1, 'quantity': -1,
'price': total, 'price': total,
'unit': language == 'en' ? 'pc' : 'tk' 'unit': language == 'en' ? 'pc' : 'tk',
} }
end end

View file

@ -27,7 +27,7 @@ class DirectoInvoiceForwardJob < Que::Job
end end
def send_monthly_invoices def send_monthly_invoices
month = Time.now month = Time.zone.now - 1.month
Registrar.where.not(test_registrar: true).find_each do |registrar| Registrar.where.not(test_registrar: true).find_each do |registrar|
next unless registrar.cash_account next unless registrar.cash_account

View file

@ -112,7 +112,8 @@ class Invoice < ApplicationRecord
'product_id': Setting.directo_receipt_product_name, 'product_id': Setting.directo_receipt_product_name,
'description': order, 'description': order,
'quantity': 1, 'quantity': 1,
'price': ActionController::Base.helpers.number_with_precision(subtotal, precision: 2, separator: ".") 'price': ActionController::Base.helpers
.number_with_precision(subtotal, precision: 2, separator: '.'),
}].as_json }].as_json
inv inv