Sha256: 357bff0ba0210f1b15efd3b9bddf37ef2e4787d17cc8ba2b32dd53e44bd08419

Contents?: true

Size: 443 Bytes

Versions: 10

Compression:

Stored size: 443 Bytes

Contents

class Dorsale::BillingMachine::Invoice::Copy < ::Dorsale::Service
  attr_accessor :invoice, :copy

  def initialize(invoice)
    super()
    @invoice = invoice
  end

  def call
    @copy = invoice.dup

    @invoice.lines.each do |line|
      @copy.lines << line.dup
    end

    @copy.date         = Date.current
    @copy.due_date     = Date.current + 30.days
    @copy.unique_index = nil
    @copy.paid         = false

    @copy
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
dorsale-4.0.0 app/services/dorsale/billing_machine/invoice/copy.rb
dorsale-3.20.0 app/services/dorsale/billing_machine/invoice/copy.rb
dorsale-3.19.1 app/services/dorsale/billing_machine/invoice/copy.rb
dorsale-3.19.0 app/services/dorsale/billing_machine/invoice/copy.rb
dorsale-3.18.0 app/services/dorsale/billing_machine/invoice/copy.rb
dorsale-3.17.0 app/services/dorsale/billing_machine/invoice/copy.rb
dorsale-3.16.0 app/services/dorsale/billing_machine/invoice/copy.rb
dorsale-3.15.0 app/services/dorsale/billing_machine/invoice/copy.rb
dorsale-3.14.11 app/services/dorsale/billing_machine/invoice/copy.rb
dorsale-3.14.10 app/services/dorsale/billing_machine/invoice/copy.rb