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