--- /dev/null
+[% USE HTML %][% USE L %][% USE LxERP %]
+
+<h1>[% FORM.title %] — [% LxERP.t8("Step #1/#2", 1, 2) %] — [% LxERP.t8("Basic Data") %]</h1>
+
+[%- INCLUDE 'common/flash.html' %]
+
+<form method="post" action="controller.pl" id="form">
+ [% L.hidden_tag("id", SELF.query.id) %]
+
+ <table>
+ <tr>
+ <th align="right">[%- LxERP.t8("Name") %]</th>
+ <td>[% L.input_tag("query.name", SELF.query.name, style="width: 800px", "data-validate"="required") %]</td>
+ </tr>
+
+ <tr>
+ <th align="right">[%- LxERP.t8("Required access right") %]</th>
+ <td>[% L.select_tag("query.access_right", SELF.access_rights, default=SELF.query.access_right, style="width: 800px") %]</td>
+ </tr>
+
+ <tr>
+ <th valign="top" align="right">[%- LxERP.t8("Description") %]</th>
+ <td valign="top">[% L.textarea_tag("query.description", SELF.query.description, rows=5, style="width: 800px") %]</td>
+ </tr>
+
+ <tr>
+ <th valign="top" align="right">[%- LxERP.t8("SQL query") %]</th>
+ <td valign="top">[% L.textarea_tag("query.sql_query", SELF.query.sql_query, rows=20, style="width: 800px", "data-validate"="required") %]</td>
+ </tr>
+ </table>
+</form>
+
+<p>
+ [% LxERP.t8("The SQL query can be parameterized with variables named as follows: <%name%>.") %]
+ [% LxERP.t8("On the next page the type of all variables can be set.") %]
+ [% LxERP.t8("Note that parameter names must not be quoted.") %]
+ [% LxERP.t8("Example") %]:
+</p>
+
+<pre>
+SELECT extract(YEAR FROM oe.transdate) AS "Jahr", SUM(oe.amount) AS "Angebotssumme"
+FROM oe
+LEFT JOIN employee ON (oe.employee_id = employee.id)
+WHERE (oe.customer_id IS NOT NULL)
+ AND COALESCE(oe.quotation, FALSE)
+ AND (employee.login = <%Benutzer-Login%>)
+GROUP BY "Jahr"
+ORDER BY "Jahr"
+</pre>