Sha256: 0f286566b9332ba0a957568b11902260d3e4e50c29097a2b4e056eafbf275d51

Contents?: true

Size: 613 Bytes

Versions: 9

Compression:

Stored size: 613 Bytes

Contents

module Xsys
  module Model
    class SalesPosition
      attr_accessor :shop_code, :business_unit, :amount_taxes_21,
        :amount_taxes_10_5, :amount_total, :extra_payments_total

      def initialize(attributes={})
        attributes.each do |k,v|
          self.send("#{k}=", v) if self.respond_to?(k)
        end
      end

      def sales_grand_total
        amount_total + extra_payments_total
      end

      def extra_payments_avg
        (extra_payments_total / sales_grand_total).round(2)
      end

      def taxes_grand_total
        amount_taxes_21 + amount_taxes_10_5
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
xsys-0.0.27 lib/xsys/model/sales_position.rb
xsys-0.0.26 lib/xsys/model/sales_position.rb
xsys-0.0.25 lib/xsys/model/sales_position.rb
xsys-0.0.24 lib/xsys/model/sales_position.rb
xsys-0.0.23 lib/xsys/model/sales_position.rb
xsys-0.0.22 lib/xsys/model/sales_position.rb
xsys-0.0.21 lib/xsys/model/sales_position.rb
xsys-0.0.20 lib/xsys/model/sales_position.rb
xsys-0.0.19 lib/xsys/model/sales_position.rb