mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 17:28:18 +02:00
parent
7acd41595c
commit
c129598d2b
3 changed files with 12 additions and 15 deletions
|
@ -28,8 +28,9 @@ class Invoice < ActiveRecord::Base
|
|||
validates :billing_email, email_format: { message: :invalid }, allow_blank: true
|
||||
|
||||
validates :due_date, :currency, :seller_name,
|
||||
:seller_iban, :buyer_name, :invoice_items, :vat_rate, presence: true
|
||||
validates :vat_rate, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 99 }, allow_nil: true
|
||||
:seller_iban, :buyer_name, :invoice_items, presence: true
|
||||
validates :vat_rate, numericality: { greater_than_or_equal_to: 0, less_than: 100 },
|
||||
allow_nil: true
|
||||
|
||||
before_create :set_invoice_number, :check_vat
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ class Registrar < ActiveRecord::Base
|
|||
validates :vat_rate, presence: true, if: :vat_rate_required?
|
||||
validates :vat_rate, absence: true, if: :local_vat_payer?
|
||||
validates :vat_rate, absence: true, if: 'foreign_vat_payer? && vat_no?'
|
||||
validates :vat_rate, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 99.9 },
|
||||
validates :vat_rate, numericality: { greater_than_or_equal_to: 0, less_than: 100 },
|
||||
allow_nil: true
|
||||
|
||||
validate :forbid_special_code
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue