From 5816ae16637c27d7dceaa216410e9a138df70187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Thu, 27 Feb 2020 11:32:29 +0200 Subject: [PATCH] Fix Rubocop styling issues --- app/controllers/concerns/book_keeping.rb | 6 +++--- app/jobs/directo_invoice_forward_job.rb | 2 +- app/models/invoice.rb | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/concerns/book_keeping.rb b/app/controllers/concerns/book_keeping.rb index e9d3e9ee9..486a3c82c 100644 --- a/app/controllers/concerns/book_keeping.rb +++ b/app/controllers/concerns/book_keeping.rb @@ -13,7 +13,7 @@ module BookKeeping 'customer_code': accounting_customer_code, 'language': language, 'currency': activities.first.currency, - 'date': month.end_of_month.strftime('%Y-%m-%d') + 'date': month.end_of_month.strftime('%Y-%m-%d'), }.as_json lines = [] @@ -65,7 +65,7 @@ module BookKeeping 'product_id': DOMAIN_TO_PRODUCT[price.zone_name.to_sym], 'quantity': 1, '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) @@ -106,7 +106,7 @@ module BookKeeping 'description': language == 'en' ? 'Domains prepayment' : 'Domeenide ettemaks', 'quantity': -1, 'price': total, - 'unit': language == 'en' ? 'pc' : 'tk' + 'unit': language == 'en' ? 'pc' : 'tk', } end diff --git a/app/jobs/directo_invoice_forward_job.rb b/app/jobs/directo_invoice_forward_job.rb index cd228fdaf..4daa65058 100644 --- a/app/jobs/directo_invoice_forward_job.rb +++ b/app/jobs/directo_invoice_forward_job.rb @@ -27,7 +27,7 @@ class DirectoInvoiceForwardJob < Que::Job end def send_monthly_invoices - month = Time.now + month = Time.zone.now - 1.month Registrar.where.not(test_registrar: true).find_each do |registrar| next unless registrar.cash_account diff --git a/app/models/invoice.rb b/app/models/invoice.rb index a1fb4cdb7..70053b59c 100644 --- a/app/models/invoice.rb +++ b/app/models/invoice.rb @@ -112,7 +112,8 @@ class Invoice < ApplicationRecord 'product_id': Setting.directo_receipt_product_name, 'description': order, '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 inv