Remove unused attribute

#772
This commit is contained in:
Artur Beljajev 2018-03-10 16:33:35 +02:00
parent 3704345d02
commit efaac16cee
10 changed files with 25 additions and 8 deletions

View file

@ -3,7 +3,7 @@ class Directo < ActiveRecord::Base
belongs_to :item, polymorphic: true
def self.send_receipts
new_trans = Invoice.where(invoice_type: "DEB", in_directo: false).where(cancelled_at: nil)
new_trans = Invoice.where(in_directo: false).where(cancelled_at: nil)
total = new_trans.count
counter = 0
Rails.logger.info("[DIRECTO] Will try to send #{total} invoices")

View file

@ -27,7 +27,7 @@ class Invoice < ActiveRecord::Base
attr_accessor :billing_email
validates :billing_email, email_format: { message: :invalid }, allow_blank: true
validates :invoice_type, :due_date, :currency, :seller_name,
validates :due_date, :currency, :seller_name,
:seller_iban, :buyer_name, :invoice_items, :vat_prc, presence: true
before_create :set_invoice_number, :check_vat

View file

@ -76,7 +76,6 @@ class Registrar < ActiveRecord::Base
# rubocop:disable Metrics/AbcSize
def issue_prepayment_invoice(amount, description = nil)
invoices.create(
invoice_type: 'DEB',
due_date: (Time.zone.now.to_date + Setting.days_to_keep_invoices_active.days).end_of_day,
payment_term: 'prepayment',
description: description,