Class: Xsys::Model::SalesPosition
- Inherits:
-
Object
- Object
- Xsys::Model::SalesPosition
- Defined in:
- lib/xsys/model/sales_position.rb
Instance Attribute Summary collapse
-
#amount_taxes_10_5 ⇒ Object
Returns the value of attribute amount_taxes_10_5.
-
#amount_taxes_21 ⇒ Object
Returns the value of attribute amount_taxes_21.
-
#amount_total ⇒ Object
Returns the value of attribute amount_total.
-
#business_unit ⇒ Object
Returns the value of attribute business_unit.
-
#extra_payments_total ⇒ Object
Returns the value of attribute extra_payments_total.
-
#shop_code ⇒ Object
Returns the value of attribute shop_code.
Instance Method Summary collapse
- #extra_payments_avg ⇒ Object
-
#initialize(attributes = {}) ⇒ SalesPosition
constructor
A new instance of SalesPosition.
- #sales_grand_total ⇒ Object
- #taxes_grand_total ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ SalesPosition
Returns a new instance of SalesPosition.
7 8 9 10 11 |
# File 'lib/xsys/model/sales_position.rb', line 7 def initialize(attributes={}) attributes.each do |k,v| self.send("#{k}=", v) if self.respond_to?(k) end end |
Instance Attribute Details
#amount_taxes_10_5 ⇒ Object
Returns the value of attribute amount_taxes_10_5.
4 5 6 |
# File 'lib/xsys/model/sales_position.rb', line 4 def amount_taxes_10_5 @amount_taxes_10_5 end |
#amount_taxes_21 ⇒ Object
Returns the value of attribute amount_taxes_21.
4 5 6 |
# File 'lib/xsys/model/sales_position.rb', line 4 def amount_taxes_21 @amount_taxes_21 end |
#amount_total ⇒ Object
Returns the value of attribute amount_total.
4 5 6 |
# File 'lib/xsys/model/sales_position.rb', line 4 def amount_total @amount_total end |
#business_unit ⇒ Object
Returns the value of attribute business_unit.
4 5 6 |
# File 'lib/xsys/model/sales_position.rb', line 4 def business_unit @business_unit end |
#extra_payments_total ⇒ Object
Returns the value of attribute extra_payments_total.
4 5 6 |
# File 'lib/xsys/model/sales_position.rb', line 4 def extra_payments_total @extra_payments_total end |
#shop_code ⇒ Object
Returns the value of attribute shop_code.
4 5 6 |
# File 'lib/xsys/model/sales_position.rb', line 4 def shop_code @shop_code end |
Instance Method Details
#extra_payments_avg ⇒ Object
17 18 19 |
# File 'lib/xsys/model/sales_position.rb', line 17 def extra_payments_avg (extra_payments_total / sales_grand_total).round(2) end |
#sales_grand_total ⇒ Object
13 14 15 |
# File 'lib/xsys/model/sales_position.rb', line 13 def sales_grand_total amount_total + extra_payments_total end |
#taxes_grand_total ⇒ Object
21 22 23 |
# File 'lib/xsys/model/sales_position.rb', line 21 def taxes_grand_total amount_taxes_21 + amount_taxes_10_5 end |