Class: YDIM::Html::State::CreateInvoice

Inherits:
Global
  • Object
show all
Includes:
InvoiceKeys
Defined in:
lib/ydim/html/state/invoice.rb

Direct Known Subclasses

CreateAutoInvoice

Constant Summary collapse

VIEW =
Html::View::Invoice

Constants inherited from Global

Global::EVENT_MAP

Instance Attribute Summary collapse

Attributes inherited from Global

#sort_reverse, #sortby

Instance Method Summary collapse

Methods included from InvoiceKeys

#invoice_key, #invoice_keys, #invoice_mandatory

Methods inherited from Global

#_create_invoice, #autoinvoice, #create_autoinvoice, #create_debitor, #create_invoice, #debitor, #invoice, #logout, #pdf, #send_invoice

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



34
35
36
# File 'lib/ydim/html/state/invoice.rb', line 34

def model
  @model
end

Instance Method Details

#_update(nextclass) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/ydim/html/state/invoice.rb', line 38

def _update(nextclass)
	input = user_input(invoice_keys, invoice_mandatory)
	input[:precision] = (input[:precision] || 2).to_i
	unless(error?)
		@model = @session.send("create_#{invoice_key}",
                            @model.debitor.unique_id)
     @model.payment_period = 30
		input.each { |key, val|
			@model.send("#{key}=", val)
		}
		@model.odba_store
		nextclass.new(@session, @model)
	end
end

#updateObject



35
36
37
# File 'lib/ydim/html/state/invoice.rb', line 35

def update
  _update(Invoice)
end