Class: YDIM::Html::View::InvoiceInnerComposite

Inherits:
HtmlGrid::Composite show all
Includes:
HtmlGrid::ErrorMessage
Defined in:
lib/ydim/html/view/invoice.rb

Direct Known Subclasses

AutoInvoiceInnerComposite

Constant Summary collapse

COMPONENTS =
{
  [0,0]		=>	:unique_id,
  [0,1,0]	=>	:debitor_name,
  [1,1,1]	=>	'dash',
  [1,1,2]	=>	:debitor_email,
  [0,2]		=>	:description,
  [0,3]		=>	:date,
  [1,3]		=>	:payment_period,
  [0,4]		=>	:currency,
  [0,5]		=>	:precision,
  [0,6]   =>  :suppress_vat,
}
COMPONENT_CSS_MAP =
{
	[0,2]	=>	'extralarge',
	[0,5]	=>	'small',
}
DEFAULT_CLASS =
HtmlGrid::Value
LABELS =
true
SYMBOL_MAP =
{
	:date					      =>	HtmlGrid::InputDate,
	:description	      =>	HtmlGrid::InputText,
   :invoice_interval   =>  HtmlGrid::Select,
   :reminder_subject   =>  HtmlGrid::InputText,
}

Constants inherited from HtmlGrid::Composite

HtmlGrid::Composite::LEGACY_INTERFACE

Instance Method Summary collapse

Instance Method Details

#currency(model) ⇒ Object



121
122
123
124
125
126
127
# File 'lib/ydim/html/view/invoice.rb', line 121

def currency(model)
	select = HtmlGrid::Select.new(:currency, model, @session, self)
	if(model.unique_id)
		select.set_attribute('onChange', "reload_form('invoice', 'ajax_invoice');")
	end
	select
end

#debitor_email(model) ⇒ Object



128
129
130
# File 'lib/ydim/html/view/invoice.rb', line 128

def debitor_email(model)
	email(model.debitor)
end

#debitor_name(model) ⇒ Object



131
132
133
134
135
# File 'lib/ydim/html/view/invoice.rb', line 131

def debitor_name(model)
	link = name(model.debitor)
	link.label = true
	link
end

#initObject



117
118
119
120
# File 'lib/ydim/html/view/invoice.rb', line 117

def init
	super
	error_message
end

#payment_period(model) ⇒ Object



136
137
138
# File 'lib/ydim/html/view/invoice.rb', line 136

def payment_period(model)
  @lookandfeel.lookup(:payment_period, model.payment_period.to_i)
end

#precision(model) ⇒ Object



139
140
141
142
143
144
145
# File 'lib/ydim/html/view/invoice.rb', line 139

def precision(model)
	input = HtmlGrid::InputText.new(:precision, model, @session, self)
	if(model.unique_id)
		input.set_attribute('onChange', "reload_form('invoice', 'ajax_invoice');")
	end
	input
end

#suppress_vat(model) ⇒ Object



146
147
148
149
150
151
152
# File 'lib/ydim/html/view/invoice.rb', line 146

def suppress_vat(model)
  input = HtmlGrid::InputCheckbox.new(:suppress_vat, model, @session, self)
if(model.unique_id)
	input.set_attribute('onClick', "reload_form('invoice', 'ajax_invoice');")
end
  input
end