Sha256: d3d158d632f73ea8cf9ef2b13b4e45808c64cdd1c65f6c564be6d3340023bc23
Contents?: true
Size: 1.31 KB
Versions: 8
Compression:
Stored size: 1.31 KB
Contents
module Economic class Line < Base field :lineNumber field :description field :sortKey field :quantity field :unitNetPrice field :discountPercentage field :unitCostPrice field :marginInBaseCurrency field :marginPercentage field :totalNetAmount relation :product, fields: [] relation :unit, fields: [] relation :delivery, fields: [] relation :departmentalDistribution, fields: [] def self.build_from_soap_api(data) # This is not instantiated with the hash, as lines are never pulled out by themselves, but always as part of # a invoice or order { "lineNumber" => data[:number].to_i, "description" => data[:description], "quantity" => data[:quantity].to_f, "unitNetPrice" => data[:unit_net_price].to_f, "discountPercentage" => data[:discount_as_percent].to_f, "unitCostPrice" => data[:unit_cost_price].to_f, "totalNetAmount" => data[:total_net_amount].to_f, "marginPercentage" => data[:margin_as_percent].to_f, "marginInBaseCurrency" => data[:total_margin].to_f, "product" => {"productNumber" => data[:product_handle][:number]}, # Unmapped values in soap # delivery_date # :accrual_start_date => nil, # :accrual_end_date => nil } end end end
Version data entries
8 entries across 8 versions & 1 rubygems