alt tag für Hauptlogo
[kivitendo-erp.git] / templates / webpages / ir / form_header.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %]
5 [%- SET follow_up_trans_info = invnumber _ ' (' _ vendor_name _ ')' %]
6 <script type="text/javascript" src="js/common.js"></script>
7 <script type="text/javascript" src="js/vendor_selection.js"></script>
8 <script type="text/javascript" src="js/calculate_qty.js"></script>
9 <script type="text/javascript" src="js/follow_up.js"></script>
10 <script type="text/javascript" src="js/customer_or_vendor_selection.js"></script>
11
12 <form method="post" name="invoice" action="[% script %]">
13
14 <p>[% saved_message %]</p>
15
16 [%- FOREACH key = HIDDENS %]
17 <input type="hidden" name="[% HTML.escape(key) %]" value="[% HTML.escape($key)  %]">
18 [%- END %]
19 <input type="hidden" name="follow_up_trans_id_1" value="[% id %]">
20 <input type="hidden" name="follow_up_trans_type_1" value="sales_invoice">
21 <input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
22 <input type="hidden" name="follow_up_rowcount" value="1">
23
24 <p><div class="listtop" width="100%">[% title %]</div></p>
25
26 [%- INCLUDE 'common/flash.html' %]
27
28 <table width="100%">
29   <tr>
30     <td valign="top">
31       <table>
32         <tr>
33           <th align="right">[% 'Vendor' | $T8 %]</th>
34           <td>
35             [%- INCLUDE 'generic/multibox.html'
36                  name          = 'vendor',
37                  style         = 'width: 250px',
38                  DATA          = ALL_VENDORS,
39                  id_sub        = 'vc_keys',
40                  label_key     = 'name',
41                  select        = vc_select,
42                  limit         = vclimit,
43                  allow_textbox = 1,
44                  onChange      = "document.getElementById('update_button').click();" -%]
45             <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('[% vc | html %]')">
46           </td>
47           <input type="hidden" name="vendor_klass" value="[% HTML.escape(vendor_klass) %]">
48           <input type="hidden" name="vendor_id" value="[% HTML.escape(vendor_id) %]">
49           <input type="hidden" name="oldvendor" value="[% HTML.escape(oldvendor) %]">
50           <input type="hidden" name="selectvendor" value="[% HTML.escape(selectvendor) %]">
51         </tr>
52 [%- IF ALL_CONTACTS.size %]
53         <tr>
54           <th align="right">[% 'Contact Person' | $T8 %]</th>
55           <td>
56             [% 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') %]
57           </td>
58         </tr>
59 [%- END %]
60         <tr>
61           <td align="right">[% 'Credit Limit' | $T8 %]</td>
62           <td>
63             [% LxERP.format_amount(creditlimit, 0, '0') %]; [% 'Remaining' | $T8 %]
64             <span class="plus[% IF is_credit_remaining_negativ %]0[% ELSE %]1[% END %]">[% LxERP.format_amount(creditremaining,0 ,'0') %]</span>
65           </td>
66         </tr>
67         <tr>
68           <th align="right" nowrap>[% 'Record in' | $T8 %]</th>
69           <td colspan="3"><select name="AP" style="width:250px;">[% selectAP %]</select></td>
70           <input type="hidden" name="selectAP" value="[% selectAP %]">
71         </tr>
72         <tr>
73           <th align="right">[% 'Steuersatz' | $T8 %]</th>
74           <td>
75             [%- INCLUDE 'generic/multibox.html'
76                  name       = 'taxzone_id'
77                  style      = 'width: 250px'
78                  DATA       = ALL_TAXZONES
79                  id_key     = 'id'
80                  readonly   = (id ? 1 : 0)
81                  label_key  = 'description' -%]
82           </td>
83   [%- IF id %]
84           <input type='hidden' name='taxzone_id' value='[% taxzone_id %]'>
85   [%- END %]
86         </tr>
87 [%- IF all_departments %]
88         <tr>
89           <th align="right" nowrap>[% 'Department' | $T8 %]</th>
90           <td colspan="3">
91             [%- INCLUDE 'generic/multibox.html'
92                  name       = 'department_id',
93                  style      = 'width: 250px',
94                  DATA       = all_departments,
95                  id_key     = 'id',
96                  label_sub  = 'department_labels',
97                  show_empty = 1 -%]
98           </td>
99         </tr>
100 [%- END %]
101 [%- IF currencies %]
102         <tr>
103           <th align="right">[% 'Currency' | $T8 %]</th>
104           <td>[% currencies %]</td>
105         </tr>
106 [%- END %]
107         <input type="hidden" name="fxgain_accno" value="[% fxgain_accno %]">
108         <input type="hidden" name="fxloss_accno" value="[% fxloss_accno %]">
109 [%- IF show_exchangerate %]
110         <tr>
111           <th align="right">[% 'Exchangerate' | $T8 %]</th>
112           <td>
113            [%- IF forex %]
114             [% LxERP.format_amount(exchangerate, 2) %]
115            [%- ELSE %]
116             <input name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
117            [%- END %]
118           </td>
119         </tr>
120 [%- END %]
121       </table>
122     </td>
123     <td align="right" valign="top">
124       <table>
125         <tr>
126           <th align="right">[% 'Employee' | $T8 %]</th>
127           <td>[% L.select_tag('employee_id', ALL_EMPLOYEES, default = employee_id, title_key = 'safe_name') %]</td>
128         </tr>
129
130 [%- IF is_type_credit_note %]
131         <tr>
132           <th align="right" nowrap>[% 'Credit Note Number' | $T8 %]</th>
133           <td colspan="3"><input size='11' name="invnumber" value="[% HTML.escape(invnumber) %]"></td>
134         </tr>
135         <tr>
136           <th align="right">[% 'Credit Note Date' | $T8 %]</th>
137           <td>[% L.date_tag('invdate', invdate, onBlur='check_right_date_format(this)', cal_align='BL', onChange='set_duedate(this)') %]</td>
138         </tr>
139 [%- ELSE %]
140         <tr>
141           <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
142           <td colspan="3"><input size='11' name="invnumber" value="[% HTML.escape(invnumber) %]"></td>
143         </tr>
144         <tr>
145           <th align="right">[% 'Invoice Date' | $T8 %]</th>
146           <td>[% L.date_tag('invdate', invdate, onBlur='check_right_date_format(this)', cal_align='BL', onChange='set_duedate(this)') %]</td>
147         </tr>
148         <tr>
149           <th align="right">[% 'Due Date' | $T8 %]</th>
150           <td>[% L.date_tag('duedate', duedate, onBlur='check_right_date_format(this)', cal_align='BL') %]</td>
151         </tr>
152 [%- END %]
153
154         <tr>
155           <th align="right" nowrap>[% 'Order Number' | $T8 %]</th>
156           <td colspan="3"><input size='11' name="ordnumber" value="[% HTML.escape(ordnumber) %]"></td>
157         </tr>
158         <tr>
159           <th align="right" nowrap>[% 'Order Date' | $T8 %]</th>
160           <td>[% L.date_tag('orddate', orddate, onBlur='check_right_date_format(this)', cal_align='BL') %]</td>
161         </tr>
162         <tr>
163           <th align="right" nowrap>[% 'Quotation Date' | $T8 %]</th>
164           <td>[% L.date_tag('quodate', quodate, onBlur='check_right_date_format(this)', cal_align='BL') %]</td>
165         </tr>
166         <tr>
167           <th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
168           <td>
169             [%- INCLUDE 'generic/multibox.html'
170                  name       = 'globalproject_id',
171                  DATA       = ALL_PROJECTS,
172                  id_key     = 'id',
173                  label_key  = 'projectnumber',
174                  show_empty = 1,
175                  onChange   = "document.getElementById('update_button').click();" -%]
176           </td>
177         </tr>
178       </table>
179     </td>
180   </tr>
181 </table>
182     </td>
183   </tr>
184   <tr>
185     <td>
186     </td>
187   </tr>
188   <script type="text/javascript" src="js/show_form_details.js"></script>
189   <script type="text/javascript" src="js/show_vc_details.js"></script>
190   <script type="text/javascript" src="js/show_history.js"></script>
191   <script type="text/javascript">
192    <!--
193      $('document').ready(function(){
194 [% IF creditwarning != '' %]
195        alert('[% 'Credit Limit exceeded!!!' | $T8 %]');
196 [% ELSE %]
197        focus();
198 [% END %]
199      });
200      function set_duedate() {
201        $.ajax({
202          url: 'ir.pl?action=get_duedate_vendor',
203          data: {
204            invdate:     $('#invdate').val(),
205            vendor_id:   $('input[name="vendor_id"]').val(),
206            old_duedate: $('#duedate').val(),
207          },
208          dataType: 'text',
209          success: function (data) { $('#duedate').val(data); }
210        })
211      }
212    //-->
213   </script>
214
215   <input type="hidden" name="webdav" value="[% webdav %]">