Rechnungen: resubmit dispatching gefixt
[kivitendo-erp.git] / templates / webpages / is / form_header.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %]
5 [%- SET follow_up_trans_info = invnumber _ ' (' _ customer_name _ ')' %]
6 <script type="text/javascript" src="js/common.js"></script>
7 <script type="text/javascript" src="js/delivery_customer_selection.js"></script>
8 <script type="text/javascript" src="js/vendor_selection.js"></script>
9 <script type="text/javascript" src="js/calculate_qty.js"></script>
10 <script type="text/javascript" src="js/follow_up.js"></script>
11 <script type="text/javascript" src="js/customer_or_vendor_selection.js"></script>
12
13 <form method="post" name="invoice" action="[% script %]">
14
15 [%- FOREACH key = HIDDENS %]
16 <input type="hidden" name="[% HTML.escape(key) %]" value="[% HTML.escape($key)  %]">
17 [%- END %]
18 <input type="hidden" name="follow_up_trans_id_1" value="[% id %]">
19 <input type="hidden" name="follow_up_trans_type_1" value="sales_invoice">
20 <input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
21 <input type="hidden" name="follow_up_rowcount" value="1">
22 <input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
23
24 <h1>[% title %]</h1>
25
26 <p>[% saved_message %]</p>
27
28 [%- INCLUDE 'common/flash.html' %]
29 [%- INCLUDE 'generic/set_longdescription.html' %]
30
31 <div id="is_tabs" class="tabwidget">
32  <ul>
33   <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
34 [%- IF INSTANCE_CONF.get_webdav %]
35   <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
36 [%- END %]
37 [%- IF id %]
38   <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Invoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
39   [%- IF AUTH.assert('general_ledger', 1) %]
40   <li><a href="[% 'controller.pl?action=AccTrans/list_transactions&trans_id=' _ HTML.url(id) | html %]">[% LxERP.t8('Transactions') %]</a></li>
41   [%- END %]
42 [%- END %]
43  </ul>
44
45 <div id="ui-tabs-basic-data">
46 <table width="100%">
47   <tr>
48     <td valign="top">
49       <table>
50         <tr>
51           <th align="right">[% 'Customer' | $T8 %]</th>
52           <td>
53             [%- INCLUDE 'generic/multibox.html'
54                  id            = 'customer',
55                  name          = 'customer',
56                  style         = 'width: 250px',
57                  class         = 'initial_focus',
58                  DATA          = ALL_CUSTOMERS,
59                  id_sub        = 'vc_keys',
60                  label_key     = 'name',
61                  select        = vc_select,
62                  limit         = vclimit,
63                  allow_textbox = 1,
64                  onChange      = "document.getElementById('update_button').click();" -%]
65             <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('[% HTML.escape(vc) %]')">
66           <input type="hidden" name="customer_klass" value="[% HTML.escape(customer_klass) %]">
67           <input type="hidden" name="customer_id" value="[% HTML.escape(customer_id) %]">
68           <input type="hidden" name="oldcustomer" value="[% HTML.escape(oldcustomer) %]">
69           <input type="hidden" name="selectcustomer" value="[% HTML.escape(selectcustomer) %]">
70           </td>
71         </tr>
72 [%- IF ALL_CONTACTS.size %]
73         <tr>
74           <th align="right">[% 'Contact Person' | $T8 %]</th>
75           <td>
76             [% 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') %]
77           </td>
78         </tr>
79 [%- END %]
80 [%- IF ALL_SHIPTO.size %]
81         <tr>
82           <th align="right">[% 'Shipping Address' | $T8 %]</th>
83           <td>
84             [% shiptos = [ [ "", LxERP.t8("No/individual shipping address") ] ] ;
85                L.select_tag('shipto_id', shiptos.import(ALL_SHIPTO), default=shipto_id, value_key='shipto_id', title_key='displayable_id', style='width: 250px') %]
86           </td>
87         </tr>
88 [%- END %]
89         <tr>
90           <td align="right">[% 'Credit Limit' | $T8 %]</td>
91           <td>
92             [% LxERP.format_amount(creditlimit, 0, '0') %]; [% 'Remaining' | $T8 %]
93             <span class="plus[% IF is_credit_remaining_negativ %]0[% ELSE %]1[% END %]">[% LxERP.format_amount(creditremaining,0 ,'0') %]</span>
94           </td>
95         </tr>
96 [%- IF max_dunning_level || dunning_description  %]
97         <tr>
98           <th align="right" valign="top">[% LxERP.t8("Dunning status") %]</th>
99           <td valign="top">
100            [% IF dunning_description %]
101             <span class="dunned_invoice">[% LxERP.t8("This invoice's dunning level: #1", dunning_description) %]</span>
102             [% IF max_dunning_level %]<br>[% END %]
103            [% END %]
104            [% IF max_dunning_level %]
105             <span class="customer_dunning_level">
106              [% LxERP.t8("Customer's current maximum dunning level: #1", max_dunning_level) %]
107              <br>
108              [% LxERP.t8("Dunned open amount: #1", LxERP.format_amount(dunning_amount, 2)) %]
109             </span>
110            [% END %]
111           </td>
112         </tr>
113 [%- END %]
114 [%- IF invoice_obj.sepa_exports.as_list.size %]
115         <tr>
116           <th align="right">[% LxERP.t8("SEPA exports") %]</th>
117           <td>
118            [% FOREACH export = invoice_obj.sepa_exports.as_list %]
119             <a href="sepa.pl?action=bank_transfer_edit&vc=customer&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
120             [% UNLESS loop.last %], [% END %]
121            [% END %]
122           </td>
123         </tr>
124 [%- END %]
125 [%- IF business %]
126         <tr>
127           <th align="right">[% 'Customer type' | $T8 %]</th>
128           <td>[% business %]; [% 'Trade Discount' | $T8 %] [% LxERP.format_amount(tradediscount * 100) %] %</td>
129         </tr>
130 [%- END %]
131         <tr>
132           <th align="right" nowrap>[% 'Record in' | $T8 %]</th>
133           <td colspan="3">
134             <select name="AR" style="width:250px;">[% selectAR %]</select>
135             <input type="hidden" name="selectAR" value="[% selectAR | html %]">
136           </td>
137         </tr>
138         <tr>
139           <th align="right">[% 'Steuersatz' | $T8 %]</th>
140           <td>
141             [% L.select_tag('taxzone_id', ( id ? ALL_TAXZONES : ALL_ACTIVE_TAXZONES) , default = taxzone_id, title_key = 'description', disabled = (id ? 1 : 0), style='width: 250px', onchange = "document.getElementById('update_button').click();") %]
142   [%- IF id %]
143           <input type='hidden' name='taxzone_id' value='[% taxzone_id %]'>
144   [%- END %]
145           </td>
146         </tr>
147 [%- IF all_departments %]
148         <tr>
149           <th align="right" nowrap>[% 'Department' | $T8 %]</th>
150           <td colspan="3">
151             [% L.select_tag('department_id', all_departments, default = department_id, title_sub = \department_labels, with_empty = 1, style = 'width:250px') %]
152           </td>
153         </tr>
154 [%- END %]
155 [%- IF currencies %]
156         <tr>
157           <th align="right">[% 'Currency' | $T8 %]</th>
158           <td>[% currencies %]</td>
159         </tr>
160 [%- END %]
161         <tr style='display:none'>
162           <td>
163             <input type="hidden" name="fxgain_accno" value="[% fxgain_accno %]">
164             <input type="hidden" name="fxloss_accno" value="[% fxloss_accno %]">
165             <input type="hidden" name="rndgain_accno" value="[% rndgain_accno %]">
166             <input type="hidden" name="rndloss_accno" value="[% rndloss_accno %]">
167           </td>
168         </tr>
169 [%- IF show_exchangerate %]
170         <tr>
171           <th align="right">[% 'Exchangerate' | $T8 %]</th>
172           <td>
173            [%- IF forex %]
174             [% LxERP.format_amount(exchangerate, 2) %]
175            [%- ELSE %]
176             <input name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
177            [%- END %]
178           </td>
179         </tr>
180 [%- END %]
181         <tr>
182           <th align="right" nowrap>[% 'Shipping Point' | $T8 %]</th>
183           <td colspan="3"><input size='35' name="shippingpoint" value="[% HTML.escape(shippingpoint) %]"></td>
184         </tr>
185         <tr>
186           <th align="right" nowrap>[% 'Ship via' | $T8 %]</th>
187           <td colspan="3"><input size='35' name="shipvia" value="[% HTML.escape(shipvia) %]"></td>
188         </tr>
189         <tr>
190           <th align="right">[% 'Transaction description' | $T8 %]</th>
191           <td colspan="3"><input size='35' name="transaction_description" id="transaction_description" value="[% HTML.escape(transaction_description) %]"></td>
192         </tr>
193       </table>
194     </td>
195     <td align="right" valign="top">
196       <table>
197         <tr>
198           <th align="right">[% 'Employee' | $T8 %]</th>
199           <td>
200             [% L.select_tag('employee_id', ALL_EMPLOYEES, default = employee_id, title_key = 'safe_name') %]
201           </td>
202         </tr>
203 [%- IF ALL_SALESMEN.size %]
204         <tr>
205           <th align="right">[% 'Salesman' | $T8 %]</th>
206           <td>
207             [% L.select_tag('salesman_id', ALL_SALESMEN, default = (salesman_id ? salesman_id : employee_id), title_key = 'safe_name') %]
208           </td>
209         </tr>
210 [%- END %]
211
212 [%- IF is_type_credit_note %]
213         <tr>
214           <th align="right" nowrap>[% 'Credit Note Number' | $T8 %]</th>
215           <td colspan="3"><input size='11' name="invnumber" value="[% HTML.escape(invnumber) %]"></td>
216         </tr>
217         <tr>
218           <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
219           <td colspan="3"><input size='11' name="invnumber_for_credit_note" value="[% HTML.escape(invnumber_for_credit_note) %]"></td>
220         </tr>
221         <tr>
222           <th align="right">[% 'Credit Note Date' | $T8 %]</th>
223           <td>[% L.date_tag('invdate', invdate, onchange='kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate")') %]</td>
224         </tr>
225 [%- ELSE %]
226         <tr>
227           <th align="right" nowrap>[% 'Invoice Number' | $T8 %]</th>
228           <td colspan="3"><input size='11' name="invnumber" value="[% HTML.escape(invnumber) %]"></td>
229         </tr>
230         <tr>
231           <th align="right">[% 'Invoice Date' | $T8 %]</th>
232           <td>[% L.date_tag('invdate', invdate, onchange='kivi.SalesPurchase.set_duedate_on_reference_date_change("invdate")') %]</td>
233         </tr>
234         <tr>
235           <th align="right">[% 'Due Date' | $T8 %]</th>
236           <td>
237            <span id="duedate_container"[% IF payment_terms_obj.auto_calculation %] style="display:none"[% END %]>[% L.date_tag('duedate', duedate) %]</span>
238            <span id="duedate_fixed"[% IF !payment_terms_obj.auto_calculation %] style="display:none"[% END %]>[% HTML.escape(duedate) %]</span>
239           </td>
240         </tr>
241         <tr>
242         <th align="right" nowrap>[% 'Delivery Order Number' | $T8 %]</th>
243           <td colspan="3"><input size='11' name="donumber" value="[% HTML.escape(donumber) %]"></td>
244         </tr>
245 [%- END %]
246         <tr>
247           <th align="right">[% 'Delivery Date' | $T8 %]</th>
248           <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
249         </tr>
250         <tr>
251           <th align="right" nowrap>[% 'Order Number' | $T8 %]</th>
252           <td colspan="3"><input size='11' name="ordnumber" value="[% HTML.escape(ordnumber) %]"></td>
253         </tr>
254         <tr>
255           <th align="right" nowrap>[% 'Order Date' | $T8 %]</th>
256           <td>[% L.date_tag('orddate', orddate) %]</td>
257         </tr>
258         <tr>
259           <th align="right" nowrap>[% 'Quotation Number' | $T8 %]</th>
260           <td colspan="3"><input size='11' name="quonumber" value="[% HTML.escape(quonumber) %]"></td>
261         </tr>
262         <tr>
263           <th align="right" nowrap>[% 'Quotation Date' | $T8 %]</th>
264           <td>[% L.date_tag('quodate', quodate) %]</td>
265         </tr>
266         <tr>
267           <th align="right" nowrap>[% 'Customer Order Number' | $T8 %]</th>
268           <td colspan="3"><input size='11' name="cusordnumber" value="[% HTML.escape(cusordnumber) %]"></td>
269         </tr>
270         <tr>
271           <th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
272           <td>
273             [%- L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = '1', onChange = "document.getElementById('update_button').click();") %]
274           </td>
275         </tr>
276       </table>
277     </td>
278   </tr>
279   <tr style='display:none'>
280     <td>
281       <input type="hidden" name="webdav" value="[% webdav %]">
282     </td>
283   </tr>
284 </table>
285
286   <script type="text/javascript" src="js/show_form_details.js"></script>
287   <script type="text/javascript" src="js/show_vc_details.js"></script>
288   <script type="text/javascript" src="js/show_history.js"></script>
289   <script type="text/javascript">
290    <!--
291      $('document').ready(function(){
292 [% IF resubmit && is_format_html %]
293        window.open('about:blank','Beleg');
294        document.invoice.target = 'Beleg';
295        $('#action_print').click();
296 [% ELSIF resubmit %]
297        $('#action_print').click();
298 [% ELSIF creditwarning != '' %]
299        alert('[% 'Credit Limit exceeded!!!' | $T8 %]');
300 [% ELSE %]
301 [% END %]
302      });
303    //-->
304   </script>
305 <table width="100%">