e12f0da9b798737070a31f6aa61770c0ac63a371
[kivitendo-erp.git] / templates / webpages / do / form_header.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %]
5 <body onload="on_load()">
6
7  <script type="text/javascript" src="js/show_form_details.js"></script>
8  <script type="text/javascript" src="js/show_history.js"></script>
9  <script type="text/javascript" src="js/show_vc_details.js"></script>
10  <script type="text/javascript" src="js/common.js"></script>
11  <script type="text/javascript" src="js/delivery_customer_selection.js"></script>
12  <script type="text/javascript" src="js/vendor_selection.js"></script>
13  <script type="text/javascript" src="js/calculate_qty.js"></script>
14  <script type="text/javascript" src="js/stock_in_out.js"></script>
15  <script type="text/javascript" src="js/follow_up.js"></script>
16
17  <script type="text/javascript">
18   <!--
19       function on_load() {
20         [% IF onload %][% onload %];[% END %]
21         setupDateFormat('[% myconfig_dateformat %]', '[% 'Falsches Datumsformat!' | $T8 %]');
22         setupPoints('[% myconfig_numberformat %]', '[% 'wrongformat' | $T8 %]');
23       }
24     -->
25  </script>
26
27  <style type="text/css">
28   .fixed_width {
29     width: 250px;
30   }
31  </style>
32
33  [%- IF vc == 'customer' %]
34  [%- SET vc = 'customer' %]
35  [%- SET the_vc_id = customer_id %]
36  [%- SET the_vc = customer %]
37  [%- SET the_oldvc = oldcustomer %]
38  [%- SET is_customer = '1' %]
39  [%- ELSE %]
40  [%- SET vc = 'vendor' %]
41  [%- SET the_vc_id = vendor_id %]
42  [%- SET the_vc = vendor %]
43  [%- SET the_oldvc = oldvendor %]
44  [%- SET is_customer = '0' %]
45  [%- END %]
46  [%- IF delivered %]
47  [%- SET DISABLED = ' disabled' %]
48  [%- END %]
49
50  <div class="listtop">[% title %]</div>
51
52 [%- INCLUDE 'common/flash.html' %]
53
54  [%- IF ERRORS && ERRORS.size %]
55  <p><font color="#ff0000">[% ERRORS.join('<br>') %]</font></p>
56  [%- END %]
57
58  <form method="post" name="do" action="do.pl">
59
60   <input type="hidden" name="follow_up_trans_id_1" value="[% HTML.escape(id) %]">
61   <input type="hidden" name="follow_up_trans_type_1" value="[% HTML.escape(type) %]">
62   <input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
63   <input type="hidden" name="follow_up_rowcount" value="1">
64
65
66   <input type="hidden" name="action" value="[% HTML.escape(action) %]">
67   <input type="hidden" name="bcc" value="[% HTML.escape(bcc) %]">
68   <input type="hidden" name="business" value="[% HTML.escape(business) %]">
69   <input type="hidden" name="cc" value="[% HTML.escape(cc) %]">
70   <input type="hidden" name="closed" value="[% HTML.escape(closed) %]">
71   <input type="hidden" name="convert_from_oe_ids" value="[% HTML.escape(convert_from_oe_ids) %]">
72   <input type="hidden" name="currency" value="[% HTML.escape(currency) %]">
73   <input type="hidden" name="customer_klass" value="[% HTML.escape(customer_klass) %]">
74   <input type="hidden" name="discount" value="[% HTML.escape(discount) %]">
75   <input type="hidden" name="dunning_amount" value="[% HTML.escape(dunning_amount) %]">
76   <input type="hidden" name="email" value="[% HTML.escape(email) %]">
77   <input type="hidden" name="emailed" value="[% HTML.escape(emailed) %]">
78   <input type="hidden" name="format" value="[% HTML.escape(format) %]">
79   <input type="hidden" name="formname" value="[% HTML.escape(formname) %]">
80   <input type="hidden" name="id" value="[% HTML.escape(id) %]">
81   <input type="hidden" name="max_dunning_level" value="[% HTML.escape(max_dunning_level) %]">
82   <input type="hidden" name="media" value="[% HTML.escape(media) %]">
83   <input type="hidden" name="message" value="[% HTML.escape(message) %]">
84   <input type="hidden" name="printed" value="[% HTML.escape(printed) %]">
85   <input type="hidden" name="proforma" value="[% HTML.escape(proforma) %]">
86   <input type="hidden" name="queued" value="[% HTML.escape(queued) %]">
87   <input type="hidden" name="saved_donumber" value="[% HTML.escape(saved_donumber) %]">
88   <input type="hidden" name="shiptocity" value="[% HTML.escape(shiptocity) %]">
89   <input type="hidden" name="shiptocontact" value="[% HTML.escape(shiptocontact) %]">
90   <input type="hidden" name="shiptocp_gender" value="[% HTML.escape(shiptocp_gender) %]">
91   <input type="hidden" name="shiptocountry" value="[% HTML.escape(shiptocountry) %]">
92   <input type="hidden" name="shiptodepartment_1" value="[% HTML.escape(shiptodepartment_1) %]">
93   <input type="hidden" name="shiptodepartment_2" value="[% HTML.escape(shiptodepartment_2) %]">
94   <input type="hidden" name="shiptoemail" value="[% HTML.escape(shiptoemail) %]">
95   <input type="hidden" name="shiptofax" value="[% HTML.escape(shiptofax) %]">
96   <input type="hidden" name="shiptoname" value="[% HTML.escape(shiptoname) %]">
97   <input type="hidden" name="shiptophone" value="[% HTML.escape(shiptophone) %]">
98   <input type="hidden" name="shiptostreet" value="[% HTML.escape(shiptostreet) %]">
99   <input type="hidden" name="shiptozipcode" value="[% HTML.escape(shiptozipcode) %]">
100   <input type="hidden" name="shiptocp_gender" value="[% HTML.escape(shiptocp_gender) %]">
101   <input type="hidden" name="subject" value="[% HTML.escape(subject) %]">
102   <input type="hidden" name="taxincluded" value="[% HTML.escape(taxincluded) %]">
103   <input type="hidden" name="taxzone_id" value="[% HTML.escape(taxzone_id) %]">
104   <input type="hidden" name="terms" value="[% HTML.escape(terms) %]">
105   <input type="hidden" name="title" value="[% HTML.escape(title) %]">
106   <input type="hidden" name="type" value="[% HTML.escape(type) %]">
107   <input type="hidden" name="vc" value="[% HTML.escape(vc) %]">
108
109   <p>
110    <table width="100%">
111     <tr valign="top">
112      <td>
113       <table width="100%">
114        <tr>
115         <input type="hidden" name="[% vc %]_id" value="[% HTML.escape(the_vc_id) %]">
116         <input type="hidden" name="old[% vc %]" value="[% HTML.escape(the_oldvc) %]">
117         <th align="right">[% IF is_customer %][% 'Customer' | $T8 %][% ELSE %][% 'Vendor' | $T8 %][% END %]</th>
118         <td>
119          [%- UNLESS !delivered && SHOW_VC_DROP_DOWN %]
120          <input type="text" value="[% HTML.escape(oldvcname) %]" name="[% HTML.escape(vc) %]"[% RO %]>
121          [%- ELSE %]
122          <select name="[% vc %]" class="fixed_width" onchange="document.do.update_button.click();"[% RO %]>
123           [%- FOREACH row = ALL_VC %]
124           <option value="[% HTML.escape(row.value) %]" [% IF the_oldvc == row.value %] selected[% END %]>[% HTML.escape(row.name) %]</option>
125           [%- END %]
126          </select>
127          <input type="hidden" name="select[% vc %]" value="1">
128          [%- END %]
129          <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('[% vc %]')">
130         </td>
131
132         [%- IF ALL_CONTACTS.size %]
133         <tr>
134          <th align="right">[% 'Contact Person' | $T8 %]</th>
135          <td>
136           [%- IF delivered %]
137           <input type="hidden" name="cp_id" value="[% HTML.escape(cp_id) %]">
138           [%- IF cp_id == row.cp_id %]
139           [%- HTML.escape(row.cp_name) %][%- IF row.cp_abteilung %] ([% HTML.escape(row.cp_abteilung) %])[% END -%]
140           [%- END %]
141           [%- ELSE %]
142             [% L.select_tag('cp_id', ALL_CONTACTS, default = cp_id, value_key = 'cp_id', title_key = 'full_name_dep', with_empty = 1, style='width: 250px') %]
143           [%- END %]
144          </td>
145         </tr>
146         [%- END %]
147
148         [%- IF ALL_SHIPTO.size %]
149         <tr>
150          <th align="right">[% 'Shipping Address' | $T8 %]</th>
151          <td>
152           [%- IF delivered %]
153           <input type="hidden" name="shipto_id" value="[% HTML.escape(shipto_id) %]">
154           [%- FOREACH row = ALL_SHIPTO %]
155           [%- IF shipto_id == row.shipto_id %]
156           [%- HTML.escape(row.shiptoname) -%]
157           [%- IF row.shiptodepartment_1 %]; [% HTML.escape(row.shiptodepartment_1) -%][% END -%]
158           [%- IF row.shiptostreet %]; [% HTML.escape(row.shiptostreet) -%][% END -%]
159           [%- IF row.shiptocity %]; [% HTML.escape(row.shiptocity) -%][% END -%]
160           [%- END %]
161           [%- END %]
162
163           [%- ELSE %]
164             [% L.select_tag('shipto_id', ALL_SHIPTO, default = shipto_id, value_key = 'shipto_id', title_key = 'displayable_id', with_empty = 1, class = 'fixed_width') %]
165           [%- END %]
166          </td>
167         </tr>
168         [%- END %]
169
170         [%- IF business %]
171         <tr>
172          <th align="right">[% IF is_customer %][% 'Customer type' | $T8 %][% ELSE %][% 'Vendor type' | $T8 %][% END %]</th>
173          <td>[% HTML.escape(business) %]</td>
174         </tr>
175         [%- END %]
176
177         [%- IF max_dunning_level %]
178         <tr>
179          <th align="right">[% 'Max. Dunning Level' | $T8 %]</th>
180          <td>
181           <b>[% HTML.escape(max_dunning_level) %]</b>; [% 'Dunning Amount' | $T8 %]:
182           <b>[% HTML.escape(LxERP.format_amount(dunning_amount, 2)) %]</b>
183          </td>
184         </tr>
185         [%- END %]
186        </tr>
187
188        [%- IF ALL_DEPARTMENTS.size %]
189        <tr>
190         <th align="right" nowrap>[% 'Department' | $T8 %]</th>
191         <td colspan="3">
192           [% IF ( delivered ) %]
193             [% L.hidden_tag('department_id', department_id) %]
194           [% END %]
195           [% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, style = 'width: 250px', disabled = delivered )%]
196        </td>
197        </tr>
198        [%- END %]
199
200        <tr>
201         <th align="right">[% 'Shipping Point' | $T8 %]</th>
202         <td colspan="3"><input name="shippingpoint" size="35" value="[% HTML.escape(shippingpoint) %]"[% RO %]></td>
203        </tr>
204
205        <tr>
206         <th align="right">[% 'Ship via' | $T8 %]</th>
207         <td colspan="3"><input name="shipvia" size="35" value="[% HTML.escape(shipvia) %]"[% RO %]></td>
208        </tr>
209
210        <tr>
211         <th align="right">[% 'Transaction description' | $T8 %]</th>
212         <td colspan="3"><input name="transaction_description" size="35" value="[% HTML.escape(transaction_description) %]"[% RO %]></td>
213        </tr>
214
215       </table>
216      </td>
217
218      <td align="right">
219       <table>
220
221        <tr>
222         <td colspan="2" align="center">
223          [%- IF delivered %]
224           [%- IF is_customer %]
225           [% 'transferred out' | $T8 %]
226           [%- ELSE %]
227           [% 'transferred in' | $T8 %]
228           [%- END %]
229          [%- ELSE %]
230           [%- IF is_customer %]
231           [% 'not transferred out yet' | $T8 %]
232           [%- ELSE %]
233           [% 'not transferred in yet' | $T8 %]
234           [%- END %]
235          [%- END %]
236          ;
237          [%- IF closed %]
238           [% 'Closed' | $T8 %]
239          [%- ELSE %]
240           [% 'Open' | $T8 %]
241          [%- END %]
242         </td>
243        </tr>
244
245        <input type="hidden" name="delivered" value="[% HTML.escape(delivered) %]">
246
247        <tr>
248         <th align="right">[% 'Employee' | $T8 %]</th>
249         <td>
250          [%- IF delivered %]
251          <input type="hidden" name="employee_id" value="[% HTML.escape(employee_id) %]">
252          [%- FOREACH row = ALL_EMPLOYEES %]
253          [% IF row.id == employee_id %][%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %][% END %]
254          [%- END %]
255          [%- ELSE %]
256            [% L.select_tag('employee_id', ALL_EMPLOYEES, default = employee_id, title_key = 'safe_name') %]
257          [%- END %]
258         </td>
259        </tr>
260
261        [%- IF is_customer %]
262        [%- IF salesman_id %]
263        [%- SET the_salesman_id = salesman_id %]
264        [%- ELSE %]
265        [%- SET the_salesman_id = employee_id %]
266        [%- END %]
267        <tr>
268         <th align="right">[% 'Salesman' | $T8 %]</th>
269         <td>
270          [%- IF delivered %]
271          <input type="hidden" name="salesman_id" value="[% HTML.escape(salesman_id) %]">
272          [%- FOREACH row = ALL_SALESMEN %]
273          [% IF row.id == the_salesman_id %][%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %][% END %]
274          [%- END %]
275          [%- ELSE %]
276           [% L.select_tag('salesman_id', ALL_SALESMEN, default = (salesman_id ? salesman_id : employee_id), title_key = 'safe_name') %]
277          [%- END %]
278         </td>
279        </tr>
280        [%- END %]
281
282        <tr>
283         <th width="70%" align="right" nowrap>[% 'Delivery Order Number' | $T8 %]</th>
284         <td><input name="donumber" size="11" value="[% HTML.escape(donumber) %]"[% RO %]></td>
285        </tr>
286
287        <tr>
288         <th width="70%" align="right" nowrap>[% 'Order Number' | $T8 %]</th>
289         <td><input name="ordnumber" size="11" value="[% HTML.escape(ordnumber) %]"[% RO %]></td>
290        </tr>
291
292        <tr>
293         <th width="70%" align="right" nowrap>[% IF is_customer %][% 'Customer Order Number' | $T8 %][% ELSE %][% 'Vendor Order Number' | $T8 %][% END %]</th>
294         <td><input name="cusordnumber" size="11" value="[% HTML.escape(cusordnumber) %]"[% RO %]></td>
295        </tr>
296
297        <tr>
298         <th align="right" nowrap>[% 'Delivery Order Date' | $T8 %]</th>
299         <td nowrap>
300          [% L.date_tag('transdate', transdate, readonly => delivered) %]
301         </td>
302        </tr>
303
304        <tr>
305         <th width="70%" align="right" nowrap>[% 'Project Number' | $T8 %]</th>
306         <td>
307          [%- IF delivered %]
308          <input type="hidden" name="globalproject_id" value="[% HTML.escape(globalproject_id) %]">
309          [%- FOREACH row = ALL_PROJECTS %]
310          [% IF globalproject_id == row.id %][% HTML.escape(row.projectnumber) %][% END %]
311          [%- END %]
312          [%- ELSE %]
313          <select name="globalproject_id">
314           <option></option>
315           [%- FOREACH row = ALL_PROJECTS %]
316           <option value="[% HTML.escape(row.id) %]"[% IF globalproject_id == row.id %] selected[% END %]>[% HTML.escape(row.projectnumber) %]</option>
317           [%- END %]
318          </select>
319          [%- END %]
320         </td>
321        </tr>
322       </table>
323      </td>
324     </tr>
325    </table>