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



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

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



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

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

#debitor_name(model) ⇒ Object



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

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

#initObject



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

def init
	super
	error_message
end

#payment_period(model) ⇒ Object



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

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

#precision(model) ⇒ Object



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

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



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

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