Class: Declaration232::Line
- Inherits:
-
Data
- Object
- Data
- Declaration232::Line
- Defined in:
- app/services/declaration232.rb
Overview
One declaration line = one commercial-invoice line.
Instance Attribute Summary collapse
-
#coo ⇒ Object
readonly
Returns the value of attribute coo.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#hts ⇒ Object
readonly
Returns the value of attribute hts.
-
#ln ⇒ Object
readonly
Returns the value of attribute ln.
-
#steel_melt_pour ⇒ Object
readonly
Returns the value of attribute steel_melt_pour.
-
#steel_value ⇒ Object
readonly
Returns the value of attribute steel_value.
-
#steel_weight_kg ⇒ Object
readonly
Returns the value of attribute steel_weight_kg.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#weight_kg ⇒ Object
readonly
Returns the value of attribute weight_kg.
Instance Method Summary collapse
-
#rows ⇒ Object
The template mandates a NON-STEEL/STEEL row pair per line, with the steel share broken out of the entered value and metal weight.
Instance Attribute Details
#coo ⇒ Object (readonly)
Returns the value of attribute coo
38 39 40 |
# File 'app/services/declaration232.rb', line 38 def coo @coo end |
#description ⇒ Object (readonly)
Returns the value of attribute description
38 39 40 |
# File 'app/services/declaration232.rb', line 38 def description @description end |
#hts ⇒ Object (readonly)
Returns the value of attribute hts
38 39 40 |
# File 'app/services/declaration232.rb', line 38 def hts @hts end |
#ln ⇒ Object (readonly)
Returns the value of attribute ln
38 39 40 |
# File 'app/services/declaration232.rb', line 38 def ln @ln end |
#steel_melt_pour ⇒ Object (readonly)
Returns the value of attribute steel_melt_pour
38 39 40 |
# File 'app/services/declaration232.rb', line 38 def steel_melt_pour @steel_melt_pour end |
#steel_value ⇒ Object (readonly)
Returns the value of attribute steel_value
38 39 40 |
# File 'app/services/declaration232.rb', line 38 def steel_value @steel_value end |
#steel_weight_kg ⇒ Object (readonly)
Returns the value of attribute steel_weight_kg
38 39 40 |
# File 'app/services/declaration232.rb', line 38 def steel_weight_kg @steel_weight_kg end |
#value ⇒ Object (readonly)
Returns the value of attribute value
38 39 40 |
# File 'app/services/declaration232.rb', line 38 def value @value end |
#weight_kg ⇒ Object (readonly)
Returns the value of attribute weight_kg
38 39 40 |
# File 'app/services/declaration232.rb', line 38 def weight_kg @weight_kg end |
Instance Method Details
#rows ⇒ Object
The template mandates a NON-STEEL/STEEL row pair per line, with the
steel share broken out of the entered value and metal weight.
42 43 44 45 46 47 48 49 |
# File 'app/services/declaration232.rb', line 42 def rows [ { ln:, category: 'NON-STEEL CONTENT', description:, hts:, coo:, value: [(value - steel_value).round(2), 0].max, weight_kg: [(weight_kg - steel_weight_kg).round(2), 0].max, melt_pour: nil }, { ln:, category: 'STEEL CONTENT', description:, hts:, coo:, value: steel_value, weight_kg: steel_weight_kg, melt_pour: steel_melt_pour } ] end |