Auf CustomerVendor auf currency_id umgestellt
[kivitendo-erp.git] / templates / webpages / customer_vendor / form.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %]
5
6 [% cv_cvars = SELF.cv.cvars_by_config %]
7
8 <form method="post" action="controller.pl">
9   <div class="listtop">[% FORM.title %]</div>
10
11   [% L.hidden_tag('db', FORM.db) %]
12   [% L.hidden_tag('callback', FORM.callback) %]
13   [% L.hidden_tag('cv.id', SELF.cv.id) %]
14
15   [%- INCLUDE 'common/flash.html' %]
16
17   <div class="tabwidget">
18     <ul>
19       <li><a href="#billing">[% 'Billing Address' | $T8 %]</a></li>
20       <li><a href="#shipto">[% 'Shipping Address' | $T8 %]</a></li>
21       <li><a href="#contacts">[% 'Contacts' | $T8 %]</a></li>
22       [% IF ( SELF.cv.id ) %]
23         <li><a href="#deliveries">[% 'Supplies' | $T8 %]</a></li>
24       [% END %]
25       <li><a href="#vcnotes">[% 'Notes' | $T8 %]</a></li>
26
27       [% IF ( cv_cvars.size ) %]
28         <li><a href="#custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
29       [% END %]
30     </ul>
31
32     <div id="billing">
33       <table width="100%">
34
35         <tr height="5"></tr>
36
37         [% IF ( conf_vertreter ) %]<!-- == $::lx_office_conf{features}->{vertreter}; -->
38           <tr>
39             <th align="right">
40               [% IF SELF.is_vendor() %]
41                 [% 'Type of Vendor' | $T8 %]
42               [% ELSE %]
43                 [% 'Type of Customer' | $T8 %]
44               [% END %]
45             </th>
46
47             <td>
48               [% L.select_tag('cv.business_id', SELF.all_business, value_key = 'id', title_key = 'description', default = SELF.cv.business_id, with_empty = 1) %]
49             </td>
50           </tr>
51
52           <tr>
53             <th align="right">
54               [% 'Representative' | $T8 %]
55             </th>
56
57             <td>
58               <!-- TODO: ALL_SALESMAN_CUSTOMERS -->
59               [% L.select_tag('cv.salesman_id', SELF.all_employees, value_key = 'id', title_key = 'safe_name', with_empty = 1) %]
60             </td>
61           </tr>
62
63         [%- END %]
64
65         <tr>
66           [% IF SELF.is_vendor() %]
67             <th align="right" nowrap>[% 'Vendor Number' | $T8 %]</th>
68             <td>
69               [% L.input_tag('cv.vendornumber', SELF.cv.vendornumber) %]
70             </td>
71           [%- ELSE %]
72             <th align="right" nowrap>[% 'Customer Number' | $T8 %]</th>
73             <td>
74               [% L.input_tag('cv.customernumber', SELF.cv.customernumber) %]
75             </td>
76           [%- END %]
77         </tr>
78
79         <tr>
80           <th align="right" nowrap>[% 'Greeting' | $T8 %]</th>
81
82           <td>
83             [% L.input_tag('cv.greeting', SELF.cv.greeting) %]
84             [% L.select_tag('cv_greeting_select', SELF.all_greetings, default = SELF.cv.greeting, with_empty = 1, onchange = '$("#cv_greeting").val(this.value);') %]
85           </td>
86         </tr>
87
88         <tr>
89           <th align="right" nowrap>
90             [% IF SELF.is_vendor() %]
91               [% 'Vendor Name' | $T8 %]
92             [%- ELSE %]
93               [% 'Customer Name' | $T8 %]
94             [%- END %]
95           </th>
96
97           <td>
98             [% L.input_tag('cv.name', SELF.cv.name) %]
99           </td>
100         </tr>
101
102         <tr>
103           <th align="right" nowrap>[% 'Department' | $T8 %]</th>
104
105           <td>
106             [% L.input_tag('cv.department_1', SELF.cv.department_1, size = 16, maxlength = 75) %]
107             [% L.input_tag('cv.department_2', SELF.cv.department_2, size = 16, maxlength = 75) %]
108           </td>
109         </tr>
110
111         <tr>
112           <th align="right" nowrap>[% 'Street' | $T8 %]</th>
113
114           <td>
115             [% L.input_tag('cv.street', SELF.cv.street) %]
116             <a href="#" onclick="namespace('kivi.CustomerVendor').showMap('cv_');" title="[% 'Map' | $T8 %]">
117               <img src="image/map.png" alt="[% 'Map' | $T8 %]" />
118             </a>
119           </td>
120         </tr>
121
122         <tr>
123           <th align="right" nowrap>[% 'Zipcode' | $T8 %]/[% 'City' | $T8 %]</th>
124
125           <td>
126             [% L.input_tag('cv.zipcode', SELF.cv.zipcode, size = 5 maxlength = 10) %]
127             [% L.input_tag('cv.city', SELF.cv.city, size = 30 maxlength = 75) %]
128           </td>
129         </tr>
130
131         <tr>
132           <th align="right" nowrap>[% 'Country' | $T8 %]</th>
133
134           <td>
135             [% L.input_tag('cv.country', SELF.cv.country, size = 30 maxlength = 75) %]
136           </td>
137         </tr>
138
139         <tr>
140           <th align="right" nowrap>[% 'Contact' | $T8 %]</th>
141
142           <td>
143             [% L.input_tag('cv.contact', SELF.cv.contact, size = 28 maxlength = 75) %]
144           </td>
145         </tr>
146
147         <tr>
148           <th align="right" nowrap>[% 'Phone' | $T8 %]</th>
149
150           <td>
151             [% L.input_tag('cv.phone', SELF.cv.phone, size = 30) %]
152           </td>
153         </tr>
154
155         <tr>
156           <th align="right" nowrap>[% 'Fax' | $T8 %]</th>
157
158           <td>
159             [% L.input_tag('cv.fax', SELF.cv.fax, size = 30 maxlength = 30) %]
160           </td>
161         </tr>
162
163         <tr>
164           <th align="right" nowrap>[% 'E-mail' | $T8 %]</th>
165
166           <td>
167             [% L.input_tag('cv.email', SELF.cv.email, size = 45) %]
168           </td>
169         </tr>
170
171         <tr>
172           <th align="right" nowrap>
173             [% IF homepage %]
174               <a href="[% HTML.escape(SELF.cv.homepage) %]" title="[% 'Open this Website' | $T8 %]" target="_blank">[% 'Homepage' | $T8 %]</a>
175             [% ELSE %]
176               [% 'Homepage' | $T8 %]
177             [% END %]
178           </th>
179
180           <td>
181             [% L.input_tag('cv.homepage', SELF.cv.homepage, size = 45, title = LxERP.t8('Example: http://kivitendo.de')) %]
182           </td>
183         </tr>
184
185         <tr>
186           <th align="right" nowrap>[% 'Username' | $T8 %]</th>
187
188           <td>
189             [% L.input_tag('cv.username', SELF.cv.username, size = 45) %]
190           </td>
191         </tr>
192
193         <tr>
194           <th align="right" nowrap>[% 'Password' | $T8 %]</th>
195
196           <td>
197             [% L.input_tag('cv.user_password', SELF.cv.user_password, size = 45) %]
198           </td>
199         </tr>
200       </table>
201
202
203       <table>
204
205         <tr>
206           <th align="right">[% 'Credit Limit' | $T8 %]</th>
207
208           <td>
209             [% L.input_tag('cv.creditlimit_as_number', SELF.cv.creditlimit_as_number, size = 9) %]
210           </td>
211
212
213           <th align="right">[% 'Payment Terms' | $T8 %]</th>
214
215           <td>
216             [% L.select_tag('cv.payment_id', SELF.all_payment_terms, value_key = 'id', title_key = 'description', default = SELF.cv.payment_id, with_empty = 1) %]
217           </td>
218
219
220           <th align="right">[% 'Discount' | $T8 %]</th>
221
222           <td>
223             [% L.input_tag('cv.discount_as_percent', SELF.cv.discount_as_percent, size = 4) %]
224           </td>
225         </tr>
226
227         <tr>
228           <th align="right">[% 'Tax Number / SSN' | $T8 %]</th>
229
230           <td>
231             [% L.input_tag('cv.taxnumber', SELF.cv.taxnumber, size = 20) %]
232           </td>
233
234
235           <!-- Anm.: R&B 15.11.2008     VAT Reg No ist Ust-ID in GB, aber generell sollte es laut Richardson die sales tax id sein -->
236           <th align="right">[% 'sales tax identification number' | $T8 %]</th>
237
238           <td>
239             [% L.input_tag('cv.ustid', SELF.cv.ustid, maxlength = 14 size = 20 ) %]
240           </td>
241
242
243           [%- IF ( SELF.is_vendor() ) %]
244             <th align="right">[% 'Customer Number' | $T8 %]</th>
245             <td>
246               [% L.input_tag('cv.v_customer_id', SELF.cv.v_customer_id, size = 10) %]
247             </td>
248           [%- ELSE %]
249             <th align="right">[% 'our vendor number at customer' | $T8 %]</th>
250             <td>
251               [% L.input_tag('cv.c_vendor_id', SELF.cv.c_vendor_id, size = 10) %]
252             </td>
253           [%- END %]
254         </tr>
255
256         <tr>
257           <th align="right">[% 'Account Number' | $T8 %]</th>
258
259           <td>
260             [% L.input_tag('cv.account_number', SELF.cv.account_number, size = 10, maxlength = 100) %]
261           </td>
262
263
264           <th align="right">[% 'Bank Code Number' | $T8 %]</th>
265
266           <td>
267             [% L.input_tag('cv.bank_code', SELF.cv.bank_code, size = 10, maxlength = 100) %]
268           </td>
269
270
271           <th align="right">[% 'Bank' | $T8 %]</th>
272
273           <td>
274             [% L.input_tag('cv.bank', SELF.cv.bank, size = 20) %]
275           </td>
276         </tr>
277
278         <tr>
279           <th align="right">[% 'IBAN' | $T8 %]</th>
280
281           <td>
282             [% L.input_tag('cv.iban', SELF.cv.iban, size = 10, maxlength = 100) %]
283           </td>
284
285
286           <th align="right">[% 'BIC' | $T8 %]</th>
287           <td>
288             [% L.input_tag('cv.bic', SELF.cv.bic, size = 10, maxlength = 100) %]
289           </td>
290
291
292           [% IF ( SELF.all_currencies.size ) %]
293             <th align="right">[% 'Currency' | $T8 %]</th>
294
295             <td>
296               [% L.select_tag('cv.currency_id', SELF.all_currencies, title_key = 'name', value_key = 'id', default = SELF.cv.currency_id, with_empty = 1) %]
297             </td>
298           [% END %]
299         </tr>
300
301         <tr>
302           [% IF ( !conf_vertreter ) %]
303             <th align="right">
304               [% IF ( SELF.is_vendor() ) %]
305                 [% 'Type of Vendor' | $T8 %]
306               [% ELSE %]
307                 [% 'Type of Customer' | $T8 %]
308               [% END %]
309             </th>
310
311             <td>
312               [% L.select_tag('cv.business_id', SELF.all_business, default = SELF.cv.business_id, value_key = 'id', title_key = 'description', with_empty = 1) %]
313             </td>
314           [% END %]
315
316
317           <th align="right">[% 'Language' | $T8 %]</th>
318
319           <td>
320             [% L.select_tag('cv.language_id', SELF.all_languages, default = SELF.cv.language_id, value_key = 'id', title_key = 'description', with_empty = 1) %]
321           </td>
322
323
324           <th align="right">[% 'Bcc' | $T8 %]</th>
325
326           <td>
327             [% L.input_tag('cv.bcc', SELF.cv.bcc, size = 40) %]
328           </td>
329
330
331           [% IF ( SELF.is_customer() ) %]
332             <th align="right">[% 'Preisklasse' | $T8 %]</th>
333
334             <td>
335               [% L.select_tag('cv.klass', SELF.all_pricegroups, default = SELF.cv.klass, value_key = 'id', title_key = 'pricegroup', with_empty = 1) %]
336             </td>
337           [% END  %]
338         </tr>
339
340         <tr>
341           <td align="right">
342             <label for="cv_obsolete">[% 'Obsolete' | $T8 %]</label>
343           </td>
344
345           <td>
346             [% L.checkbox_tag('cv.obsolete', checked = SELF.cv.obsolete) %]
347           </td>
348
349
350           <td align="right">
351             <label for="cv_direct_debit">[% 'direct debit' | $T8 %]</label>
352           </td>
353
354           <td>
355             [% L.checkbox_tag('cv.direct_debit', checked = SELF.cv.direct_debit) %]
356           </td>
357         </tr>
358
359         <tr>
360           <th align="right">[% 'Steuersatz' | $T8 %]</th>
361
362           <td>
363             [% L.select_tag('cv.taxzone_id', SELF.all_taxzones, default = SELF.cv.taxzone_id, value_key = 'id', title_key = 'description') %]
364           </td>
365
366
367           [% IF ( SELF.is_customer() && !conf_vertreter ) %]
368             <th align="right">[% 'Salesman' | $T8 %]</th>
369
370             <td>
371               <!-- TODO: ALL_SALESMAN -->
372               [% L.select_tag('cv.salesman_id', SELF.all_employees, default = salesman_id, value_key = 'id', title_key = 'safe_name', with_empty = 1) %]
373             </td>
374
375             <td>[% 'taxincluded checked' | $T8 %]</td>
376
377             <td>
378               [% L.select_tag('cv.taxincluded_checked', [[undef, LxERP.t8('use user config')], ['1', LxERP.t8('Yes')], ['0', LxERP.t8('No')]], default = SELF.cv.taxincluded_checked) %]
379             </td>
380           [%- END %]
381         </tr>
382       </table>
383
384       <table>
385         <tr>
386           <th align="left" nowrap>[% 'Internal Notes' | $T8 %]</th>
387         </tr>
388
389         <tr>
390           <td>
391             [% L.textarea_tag('cv.notes', SELF.cv.notes, rows = 3 cols = 60 wrap = soft) %]
392           </td>
393         </tr>
394       </table>
395     </div>
396
397     <div id="shipto">
398       <table width="100%" id="shipto_table">
399         <tr>
400           <th align="right">[% 'Shipping Address' | $T8 %]</th>
401
402           <td>
403             [% L.select_tag(
404                  'shipto.shipto_id',
405                  SELF.shiptos,
406                  default = SELF.shipto.shipto_id,
407                  value_key = 'shipto_id',
408                  title_key = 'displayable_id',
409                  with_empty = 1,
410                  empty_title = LxERP.t8('New shipto'),
411                  onchange = "namespace('kivi.CustomerVendor').selectShipto();"
412                )
413             %]
414           </td>
415         </tr>
416
417         <tr>
418           <th align="right" nowrap>[% 'Name' | $T8 %]</th>
419
420           <td>
421             [% L.input_tag('shipto.shiptoname', SELF.shipto.shiptoname,  size = 35, maxlength = 75) %]
422           </td>
423         </tr>
424
425         <tr>
426           <th align="right" nowrap>[% 'Abteilung' | $T8 %]</th>
427
428           <td>
429             [% L.input_tag('shipto.shiptodepartment_1', SELF.shipto.shiptodepartment_1,  size = 16, maxlength = 75) %]
430             [% L.input_tag('shipto.shiptodepartment_2', SELF.shipto.shiptodepartment_2,  size = 16, maxlength = 75) %]
431           </td>
432         </tr>
433
434         <tr>
435           <th align="right" nowrap>[% 'Street' | $T8 %]</th>
436
437           <td>
438             [% L.input_tag('shipto.shiptostreet', SELF.shipto.shiptostreet,  size = 35, maxlength = 75) %]
439
440             <a href="#" onclick="namespace('kivi.CustomerVendor').showMap('shipto_shipto');" title="[% 'Map' | $T8 %]">
441               <img src="image/map.png" alt="[% 'Map' | $T8 %]" />
442             </a>
443           </td>
444         </tr>
445
446         <tr>
447           <th align="right" nowrap>[% 'Zipcode' | $T8 %]/[% 'City' | $T8 %]</th>
448
449           <td>
450             [% L.input_tag('shipto.shiptozipcode', SELF.shipto.shiptostreet,  size = 5, maxlength = 75) %]
451             [% L.input_tag('shipto.shiptocity', SELF.shipto.shiptocity,  size = 30, maxlength = 75) %]
452           </td>
453         </tr>
454
455         <tr>
456           <th align="right" nowrap>[% 'Country' | $T8 %]</th>
457
458           <td>
459             [% L.input_tag('shipto.shiptocountry', SELF.shipto.shiptocountry,  size = 35, maxlength = 75) %]
460           </td>
461         </tr>
462
463         <tr>
464           <th align="right" nowrap>[% 'Contact' | $T8 %]</th>
465
466           <td>
467             [% L.input_tag('shipto.shiptocontact', SELF.shipto.shiptocontact,  size = 30, maxlength = 75) %]
468           </td>
469         </tr>
470
471         <tr>
472           <th align="right" nowrap>[% 'Phone' | $T8 %]</th>
473
474           <td>
475             [% L.input_tag('shipto.shiptophone', SELF.shipto.shiptophone,  size = 30, maxlength = 30) %]
476           </td>
477         </tr>
478
479         <tr>
480           <th align="right" nowrap>[% 'Fax' | $T8 %]</th>
481
482           <td>
483             [% L.input_tag('shipto.shiptofax', SELF.shipto.shiptofax,  size = 30, maxlength = 30) %]
484           </td>
485         </tr>
486
487         <tr>
488           <th align="right" nowrap>[% 'E-mail' | $T8 %]</th>
489
490           <td>
491             [% L.input_tag('shipto.shiptoemail', SELF.shipto.shiptoemail,  size = 45) %]
492           </td>
493         </tr>
494       </table>
495
496       [% L.button_tag('submitInputButton(this);', LxERP.t8('Delete Shipto'), name = 'action_delete_shipto', class = 'submit') %]
497       [% IF ( !SELF.shipto.shipto_id ) %]
498         <script type="text/javascript">
499           $('#action_delete_shipto').hide();
500         </script>
501       [% END %]
502     </div>
503
504     <div id="contacts">
505       <table>
506         <tr>
507           <th align="left">[% 'Contacts' | $T8 %]</th>
508
509           <td>
510             [%
511               L.select_tag(
512                 'contact.cp_id',
513                 SELF.contacts,
514                 default = SELF.contact.cp_id,
515                 with_empty = 1,
516                 empty_title = LxERP.t8('New contact'),
517                 value_key = 'cp_id',
518                 title_key = 'full_name',
519                 onchange = "namespace('kivi.CustomerVendor').selectContact();")
520             %]
521           </td>
522         </tr>
523
524         <tr>
525           <th align="left" nowrap>[% 'Gender' | $T8 %]</th>
526
527           <td>
528             [%
529               L.select_tag(
530                 'contact.cp_gender',
531                 [['m', LxERP.t8('male')], ['f', LxERP.t8('female')]],
532                 default = SELF.contact.cp_gender
533               )
534             %]
535           </td>
536         </tr>
537
538         <tr>
539           <th align="left" nowrap>[% 'Title' | $T8 %]</th>
540
541           <td>
542             [% L.input_tag('contact.cp_title', SELF.contact.cp_title, size = 40 maxlength = 75) %]
543             [% L.select_tag('contact_cp_title_select', SELF.all_titles, with_empty = 1, onchange = '$("#contact_cp_title").val(this.value);') %]
544           </td>
545         </tr>
546
547         <tr>
548           <th align="left" nowrap>[% 'Department' | $T8 %]</th>
549
550           <td>
551             [% L.input_tag('contact.cp_abteilung', SELF.contact.cp_abteilung, size = 40) %]
552             [% L.select_tag('contact_cp_abteilung_select', SELF.all_departments, default = SELF.contact.cp_abteilung,  with_empty = 1, onchange = '$("#contact_cp_abteilung").val(this.value);') %]
553           </td>
554         </tr>
555
556         <tr>
557           <th align="left" nowrap>[% 'Function/position' | $T8 %]</th>
558
559           <td>
560             [% L.input_tag('contact.cp_position', SELF.contact.cp_position, size = 40, maxlength = 75) %]
561           </td>
562         </tr>
563
564         <tr>
565           <th align="left" nowrap>[% 'Given Name' | $T8 %]</th>
566
567           <td>
568             [% L.input_tag('contact.cp_givenname', SELF.contact.cp_givenname, size = 40, maxlength = 75) %]
569           </td>
570         </tr>
571
572         <tr>
573           <th align="left" nowrap>[% 'Name' | $T8 %]</th>
574
575           <td>
576             [% L.input_tag('contact.cp_name', SELF.contact.cp_name, size = 40, maxlength = 75) %]
577           </td>
578         </tr>
579
580         <tr>
581           <th align="left" nowrap>[% 'E-mail' | $T8 %]</th>
582
583           <td>
584             [% L.input_tag('contact.cp_email', SELF.contact.cp_email, size = 40) %]
585           </td>
586         </tr>
587
588         <tr>
589           <th align="left" nowrap>[% 'Phone1' | $T8 %]</th>
590
591           <td>
592             [% L.input_tag('contact.cp_phone1', SELF.contact.cp_phone1, size = 40, maxlength = 75) %]
593           </td>
594         </tr>
595
596         <tr>
597           <th align="left" nowrap>[% 'Phone2' | $T8 %]</th>
598
599           <td>
600             [% L.input_tag('contact.cp_phone2', SELF.contact.cp_phone2, size = 40, maxlength = 75) %]
601           </td>
602         </tr>
603
604         <tr>
605           <th align="left" nowrap>[% 'Fax' | $T8 %]</th>
606
607           <td>
608             [% L.input_tag('contact.cp_fax', SELF.contact.cp_fax, size = 40) %]
609           </td>
610         </tr>
611
612         <tr>
613           <th align="left" nowrap>[% 'Mobile1' | $T8 %]</th>
614
615           <td>
616             [% L.input_tag('contact.cp_mobile1', SELF.contact.cp_mobile1, size = 40) %]
617           </td>
618         </tr>
619
620         <tr>
621           <th align="left" nowrap>[% 'Mobile2' | $T8 %]</th>
622
623           <td>
624             [% L.input_tag('contact.cp_mobile2', SELF.contact.cp_mobile2, size = 40) %]
625           </td>
626         </tr>
627
628         <tr>
629           <th align="left" nowrap>[% 'Sat. Phone' | $T8 %]</th>
630
631           <td>
632             [% L.input_tag('contact.cp_satphone', SELF.contact.cp_satphone, size = 40) %]
633           </td>
634         </tr>
635
636         <tr>
637           <th align="left" nowrap>[% 'Sat. Fax' | $T8 %]</th>
638
639           <td>
640             [% L.input_tag('contact.cp_satfax', SELF.contact.cp_satfax, size = 40) %]
641           </td>
642         </tr>
643
644         <tr>
645           <th align="left" nowrap>[% 'Project' | $T8 %]</th>
646
647           <td>
648             [% L.input_tag('contact.cp_project', SELF.contact.cp_project, size = 40) %]
649           </td>
650         </tr>
651
652         <tr>
653           <th align="left" nowrap>[% 'Street' | $T8 %]</th>
654
655           <td>
656             [% L.input_tag('contact.cp_street', SELF.contact.cp_street, size = 40, maxlength = 75) %]
657
658             <a href="#" onclick="namespace('kivi.CustomerVendor').showMap('contact_cp_');" title="[% 'Map' | $T8 %]">
659               <img src="image/map.png" alt="[% 'Map' | $T8 %]" />
660             </a>
661           </td>
662         </tr>
663
664         <tr>
665           <th align="left" nowrap>[% 'Zip, City' | $T8 %]</th>
666
667           <td>
668             [% L.input_tag('contact.cp_zipcode', SELF.contact.cp_zipcode, size = 5, maxlength = 10) %]
669             [% L.input_tag('contact.cp_city', SELF.contact.cp_city, size = 25, maxlength = 75) %]
670           </td>
671         </tr>
672
673         <tr>
674           <th align="left" nowrap>[% 'Private Phone' | $T8 %]</th>
675
676           <td>
677             [% L.input_tag('contact.cp_privatphone', SELF.contact.cp_privatphone, size = 40) %]
678           </td>
679         </tr>
680
681         <tr>
682           <th align="left" nowrap>[% 'Private E-mail' | $T8 %]</th>
683
684           <td>
685             [% L.input_tag('contact.cp_privatemail', SELF.contact.cp_privatemail, size = 40) %]
686           </td>
687         </tr>
688
689         <tr>
690           <th align="left" nowrap>[% 'Birthday' | $T8 %]</th>
691
692           <td>
693             [% L.date_tag('contact.cp_birthday', SELF.contact.cp_birthday) %]
694           </td>
695         </tr>
696
697         [% contact_cvars = SELF.contact.cvars_by_config %]
698
699         [% IF ( contact_cvars.size ) %]
700           <tr>
701             <td colspan="2">
702               <hr>
703             </td>
704           </tr>
705
706           [% FOREACH var = contact_cvars %]
707             <tr>
708               <th align="left" valign="top" nowrap>[% var.config.description | html %]</th>
709
710               <td valign="top">
711                 [%
712                   INCLUDE 'customer_vendor/render_cvar_input.html'
713                           cvar_name_prefix = 'contact_cvars.'
714                 %]
715               </td>
716             </tr>
717           [% END %]
718         [% END %]
719
720       </table>
721
722       [% L.button_tag('submitInputButton(this);', LxERP.t8('Delete Contact'), name = 'action_delete_contact', class = 'submit') %]
723       [% IF ( !SELF.contact.cp_id ) %]
724         <script type="text/javascript">
725           $('#action_delete_contact').hide();
726         </script>
727       [% END %]
728     </div>
729
730     <div id="deliveries">
731       <table>
732         <tr>
733           <th align="right">[% 'Shipping Address' | $T8 %]</th>
734           <td colspan="3">
735             [% temp = [{shipto_id = 'all', displayable_id = LxERP.t8('All')}] %]
736             [% temp = temp.merge(SELF.shiptos) %]
737             [%
738               L.select_tag(
739                 'delivery_id',
740                 temp,
741                 value_key = 'shipto_id',
742                 title_key = 'displayable_id',
743                 with_empty = 1,
744                 onchange = "namespace('kivi.CustomerVendor').selectDelivery();"
745               )
746             %]
747           </td>
748         </tr>
749
750         <tr>
751           <th align="right" nowrap>[% 'From' | $T8 %]</th>
752
753           <td>
754             [%
755               L.date_tag(
756                 'delivery_from',
757                 FORM.delivery_from,
758                 onchange => "namespace('kivi.CustomerVendor').selectDelivery(this.form.delivery_from.value, this.form.delivery_to.value);"
759               )
760             %]
761           </td>
762
763
764           <th align="right" nowrap>[% 'To (time)' | $T8 %]</th>
765
766           <td>
767             [%
768               L.date_tag(
769                 'delivery_to',
770                 FORM.delivery_to,
771                 onchange => "namespace('kivi.CustomerVendor').selectDelivery(this.form.delivery_from.value, this.form.delivery_to.value);"
772               )
773             %]
774            </td>
775          </tr>
776
777          <tr>
778            <td colspan="4">
779              <div id="delivery"></div>
780            </td>
781          </tr>
782        </table>
783      </div>
784
785
786      <div id="vcnotes">
787        [% IF ( NOTES && NOTES.size ) %]
788          <p>
789            <table>
790             <tr>
791               <th class="listheading">[% 'Delete' | $T8 %]</th>
792               <th class="listheading">[% 'Subject' | $T8 %]</th>
793               <th class="listheading">[% 'Created on' | $T8 %]</th>
794               <th class="listheading">[% 'Created by' | $T8 %]</th>
795               <th class="listheading">[% 'Follow-Up Date' | $T8 %]</th>
796               <th class="listheading">[% 'Follow-Up for' | $T8 %]</th>
797               <th class="listheading">[% 'Follow-Up done' | $T8 %]</th>
798             </tr>
799
800             [%- FOREACH row = SELF.notes %]
801               <tr class="listrow[% loop.count % 2 %]">
802                 <td>
803                   [% L.hidden_tag('notes[+].id', row.id) %]
804                   [% IF ( !NOTE_id || (NOTE_id != row.id) ) %]
805                     [% L.checkbox_tag('notes[].delete', 0) %]
806                   [% END %]
807                 </td>
808
809                 <td>
810                   <a href="ct.pl?action=edit&db=[% HTML.url(db) %]&id=[% HTML.url(id) %]&edit_note_id=[% HTML.url(row.id) %]">[% HTML.escape(row.subject) %]</a>
811                 </td>
812
813                 <td>
814                   [% HTML.escape(row.created_on) %]
815                 </td>
816
817                 <td>
818                   [% IF ( row.created_by_name ) %]
819                     [% HTML.escape(row.created_by_name) %]
820                   [% ELSE %]
821                     [% HTML.escape(row.created_by_login) %]
822                   [% END %]
823                 </td>
824
825                 <td>
826                   [% HTML.escape(row.follow_up_date) %]
827                 </td>
828
829                 <td>
830                   [% IF ( row.created_for_name ) %]
831                     [% HTML.escape(row.created_for_name) %]
832                   [% ELSE %]
833                     [% HTML.escape(row.created_for_login) %]
834                   [% END %]
835                 </td>
836
837                 <td>
838                   [% IF ( row.follow_up_date ) %]
839                     [% IF ( row.follow_up_done ) %]
840                       [% 'Yes' | $T8 %]
841                     [% ELSE %]
842                       [% 'No' | $T8 %]
843                     [% END %]
844                   [% END %]
845                 </td>
846               </tr>
847             [% END %]
848           </table>
849         </p>
850       [% END %]
851
852       <div class="listtop">
853         [% IF ( NOTE_id ) %]
854           [% 'Edit note' | $T8 %]
855         [% ELSE %]
856           [% 'Add note' | $T8 %]
857         [% END %]
858       </div>
859
860       [% L.hidden_tag('note.id', SELF.note.id) %]
861
862       <p>
863         <table>
864           <tr>
865             <td valign="right">[% 'Subject' | $T8 %]</td>
866
867             <td>
868               [% L.input_tag('note.subject', SELF.note.subject, size = 50) %]
869             </td>
870           </tr>
871
872           <tr>
873             <td valign="right" align="top">[% 'Body' | $T8 %]</td>
874
875             <td align="top">
876               [% L.textarea_tag('note.body', SELF.note.body, cols = 50 rows = 10) %]
877             </td>
878           </tr>
879
880           <tr>
881             <td valign="right">[% 'Follow-Up On' | $T8 %]</td>
882
883             <td>
884               [% L.date_tag('note_followup.follow_up_date', SELF.note_followup.follow_up_date) %]
885               [% 'for' | $T8 %]
886               [% L.select_tag(
887                    'note_followup.created_for_user',
888                    SELF.all_employees,
889                    default = SELF.note_followup.created_for_user,
890                    title_key = 'safe_name'
891                  )
892               %]
893             </td>
894           </tr>
895
896           <tr>
897             <td>&nbsp;</td>
898
899             <td>
900               [% L.checkbox_tag('note_followup.done', checked = SELF.note_followup.done) %]
901               <label for="note_followup_done">[% 'Follow-Up done' | $T8 %]</label>
902             </td>
903           </tr>
904
905         </table>
906       </p>
907     </div>
908
909     [% IF ( cv_cvars.size ) %]
910       <div id="custom_variables">
911         <p>
912           <table>
913             [% FOREACH var = cv_cvars %]
914               <tr>
915                 <th align="left" valign="top" nowrap>[% var.config.description | html %]</th>
916
917                 <td valign="top">
918                   [%
919                     INCLUDE 'customer_vendor/render_cvar_input.html'
920                             cvar_name_prefix = 'cv_cvars.'
921                   %]
922                 </td>
923               </tr>
924             [% END %]
925           </table>
926         </p>
927       </div>
928     [% END %]
929   </div>
930
931   <br>
932
933   [% L.hidden_tag('action', 'CustomerVendor/dispatch') %]
934
935   [% L.submit_tag('action_save', LxERP.t8('Save'), onclick = "return check_taxzone_and_ustid()", accesskey = "s") %]
936   [% L.submit_tag('action_save_and_close', LxERP.t8('Save and Close'), onclick = "return check_taxzone_and_ustid()") %]
937
938   [%- IF ( SELF.is_vendor ) %]
939     [% L.submit_tag('action_save_and_ap_transaction', LxERP.t8('Save and AP Transaction'), onclick = "return check_taxzone_and_ustid()") %]
940   [%- ELSE %]
941     [% L.submit_tag('action_save_and_ar_transaction', LxERP.t8('Save and AR Transaction'), onclick = "return check_taxzone_and_ustid()") %]
942   [%- END %]
943
944   [% L.submit_tag('action_save_and_invoice', LxERP.t8('Save and Invoice'), onclick = "return check_taxzone_and_ustid()") %]
945   [% L.submit_tag('action_save_and_order', LxERP.t8('Save and Order'), onclick = "return check_taxzone_and_ustid()") %]
946
947   [%- IF ( SELF.is_vendor ) %]
948     [% L.submit_tag('action_save_and_rfq', LxERP.t8('Save and RFQ'), onclick = "return check_taxzone_and_ustid()") %]
949   [%- ELSE %]
950     [% L.submit_tag('action_save_and_quotation', LxERP.t8('Save and Quotation'), onclick = "return check_taxzone_and_ustid()") %]
951   [%- END %]
952
953   [%- IF ( SELF.cv.id && SELF.is_orphaned ) %]
954     [% L.submit_tag('action_delete', LxERP.t8('Delete'), confirm => LxERP.t8('Do you really want to delete this object?')) %]
955   [%- END %]
956
957   [%- IF ( SELF.cv.id ) %]
958     <input type="button" class="submit" onclick="namespace('kivi.CustomerVendor').showHistoryWindow([% SELF.cv.id %]);" name="history" id="history" value="[% 'history' | $T8 %]">
959   [%- END %]
960
961 </form>
962
963 <script type="text/javascript">
964 <!--
965   function submitInputButton(button)
966   {
967     var hidden = document.createElement("input");
968     hidden.setAttribute("type", "hidden");
969
970     if ( button.hasAttribute("name") )
971       hidden.setAttribute("name", button.getAttribute("name"));
972
973     if ( button.hasAttribute("value") )
974       hidden.setAttribute("value", button.getAttribute("value"));
975
976
977     button.form.appendChild(hidden);
978
979     button.disabled = true;
980
981     button.form.submit();
982   }
983
984   function check_taxzone_and_ustid() {
985     if ( ($('#cv_taxzone_id').val() == '1') && ($('#cv_ustid').val() == '') ) {
986       alert('[% LxERP.t8('Please enter the sales tax identification number.') %]');
987       return false;
988     }
989     return true;
990   }
991 -->
992 </script>
993