Sha256: 728a6fb2cad392d56a3ec7b7e4ec6a17a61a7ab6f37aea48dd62cfd03a456052

Contents?: true

Size: 567 Bytes

Versions: 10

Compression:

Stored size: 567 Bytes

Contents

require 'killbill/invoice'

# See invoice_plugin_api_spec.rb
module Killbill
  module Plugin
    class InvoiceTest < Invoice

      def get_additional_invoice_items(invoice, properties, context)
        additional_items = []
        invoice.invoice_items.each do |original_item|
          additional_items << build_item(original_item, original_item.amount * 7 / 100, 'Tax item', :TAX)
          additional_items << build_item(original_item, original_item.amount * 2, 'Charge item', :EXTERNAL_CHARGE)
        end

        additional_items
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
killbill-5.1.0 spec/killbill/invoice_test.rb
killbill-5.0.0 spec/killbill/invoice_test.rb
killbill-4.4.0 spec/killbill/invoice_test.rb
killbill-4.3.0 spec/killbill/invoice_test.rb
killbill-4.2.0 spec/killbill/invoice_test.rb
killbill-4.1.0 spec/killbill/invoice_test.rb
killbill-4.0.0 spec/killbill/invoice_test.rb
killbill-3.2.4 spec/killbill/invoice_test.rb
killbill-3.2.3 spec/killbill/invoice_test.rb
killbill-3.2.2 spec/killbill/invoice_test.rb