Class: RussianInvoices::CertificateOfCompletion

Inherits:
BaseModel
  • Object
show all
Defined in:
app/models/russian_invoices/certificate_of_completion.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

create, #initialize, #landscape?, #persisted?, #save, #save!

Constructor Details

This class inherits a constructor from RussianInvoices::BaseModel

Instance Attribute Details

#customer_addressObject

Returns the value of attribute customer_address.



3
4
5
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 3

def customer_address
  @customer_address
end

#customer_innObject

Returns the value of attribute customer_inn.



3
4
5
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 3

def customer_inn
  @customer_inn
end

#customer_kppObject

Returns the value of attribute customer_kpp.



3
4
5
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 3

def customer_kpp
  @customer_kpp
end

#customer_nameObject

Returns the value of attribute customer_name.



3
4
5
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 3

def customer_name
  @customer_name
end

#from_dateObject

Returns the value of attribute from_date.



3
4
5
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 3

def from_date
  @from_date
end

#goodsObject

Returns the value of attribute goods.



3
4
5
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 3

def goods
  @goods
end

#ndsObject

Returns the value of attribute nds.



3
4
5
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 3

def nds
  @nds
end

#numberObject

Returns the value of attribute number.



3
4
5
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 3

def number
  @number
end

#performer_addressObject

Returns the value of attribute performer_address.



3
4
5
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 3

def performer_address
  @performer_address
end

#performer_innObject

Returns the value of attribute performer_inn.



3
4
5
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 3

def performer_inn
  @performer_inn
end

#performer_kppObject

Returns the value of attribute performer_kpp.



3
4
5
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 3

def performer_kpp
  @performer_kpp
end

#performer_nameObject

Returns the value of attribute performer_name.



3
4
5
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 3

def performer_name
  @performer_name
end

#performer_signatureObject

Returns the value of attribute performer_signature.



3
4
5
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 3

def performer_signature
  @performer_signature
end

#performer_stampObject

Returns the value of attribute performer_stamp.



3
4
5
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 3

def performer_stamp
  @performer_stamp
end

#summObject

Returns the value of attribute summ.



3
4
5
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 3

def summ
  @summ
end

Instance Method Details

#nds_summObject



17
18
19
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 17

def nds_summ
  (total_summ * nds / 100).round(2)
end

#total_summObject



13
14
15
# File 'app/models/russian_invoices/certificate_of_completion.rb', line 13

def total_summ
  goods.sum{ |good| good[:quantity]*good[:price] }.round(2)
end