Module: ODDB::InvoiceObserver

Defined in:
src/model/invoice_observer.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) address

Returns the value of attribute address



6
7
8
# File 'src/model/invoice_observer.rb', line 6

def address
  @address
end

- (Object) fullname

Returns the value of attribute fullname



6
7
8
# File 'src/model/invoice_observer.rb', line 6

def fullname
  @fullname
end

- (Object) location

Returns the value of attribute location



6
7
8
# File 'src/model/invoice_observer.rb', line 6

def location
  @location
end

- (Object) name

Returns the value of attribute name



6
7
8
# File 'src/model/invoice_observer.rb', line 6

def name
  @name
end

- (Object) name_first

Returns the value of attribute name_first



6
7
8
# File 'src/model/invoice_observer.rb', line 6

def name_first
  @name_first
end

- (Object) plz

Returns the value of attribute plz



6
7
8
# File 'src/model/invoice_observer.rb', line 6

def plz
  @plz
end

- (Object) salutation

Returns the value of attribute salutation



6
7
8
# File 'src/model/invoice_observer.rb', line 6

def salutation
  @salutation
end

- (Object) ydim_id

Returns the value of attribute ydim_id



6
7
8
# File 'src/model/invoice_observer.rb', line 6

def ydim_id
  @ydim_id
end

Instance Method Details

- (Object) add_invoice(invoice)



8
9
10
11
12
13
14
# File 'src/model/invoice_observer.rb', line 8

def add_invoice(invoice)
  self.invoices.push(invoice)
  @invoices.odba_isolated_store
  invoice.user_pointer = @pointer
  invoice.odba_isolated_store
  invoice
end

- (Object) contact



15
16
17
# File 'src/model/invoice_observer.rb', line 15

def contact
  [@name_first, @name].compact.join(' ')
end

- (Object) invoice(oid)



18
19
20
21
22
23
# File 'src/model/invoice_observer.rb', line 18

def invoice(oid)
  oid = oid.to_i
  self.invoices.find { |invoice|
    invoice.oid == oid
  }
end

- (Object) invoice_email



24
25
26
# File 'src/model/invoice_observer.rb', line 24

def invoice_email
  self.
end

- (Object) invoices



33
34
35
36
37
38
39
# File 'src/model/invoice_observer.rb', line 33

def invoices
  if(@invoices.nil?)
    @invoices = []
    odba_store
  end
  @invoices
end

- (Object) remove_invoice(invoice)



27
28
29
30
31
32
# File 'src/model/invoice_observer.rb', line 27

def remove_invoice(invoice)
  if(self.invoices.delete(invoice))
    @invoices.odba_isolated_store
    invoice
  end
end

- (Object) ydim_address_lines



40
41
42
# File 'src/model/invoice_observer.rb', line 40

def ydim_address_lines
  [@address].compact
end

- (Object) ydim_location



43
44
45
# File 'src/model/invoice_observer.rb', line 43

def ydim_location
  [@plz, @location].compact.join(' ')
end