[%- USE T8 %]
[%- USE HTML %]
[%- USE LxERP %]
-[%- USE L %]
+[%- USE L %][%- USE P -%]
<h1>[% title %]</h1>
-[%- SET follow_up_trans_info = invnumber _ ' (' _ vendor_name _ ')' %]
+[%- SET follow_up_trans_info = invnumber _ ' (' _ vendor_obj.name _ ')' %]
<script type="text/javascript" src="js/common.js"></script>
-<script type="text/javascript" src="js/vendor_selection.js"></script>
<script type="text/javascript" src="js/calculate_qty.js"></script>
<script type="text/javascript" src="js/follow_up.js"></script>
-<script type="text/javascript" src="js/customer_or_vendor_selection.js"></script>
-<form method="post" name="invoice" action="[% script %]">
+<form id='form' method="post" name="invoice" action="[% script %]">
<p>[% saved_message %]</p>
<input type="hidden" name="[% HTML.escape(key) %]" value="[% HTML.escape($key) %]">
[%- END %]
<input type="hidden" name="follow_up_trans_id_1" value="[% id %]">
-<input type="hidden" name="follow_up_trans_type_1" value="sales_invoice">
+<input type="hidden" name="follow_up_trans_type_1" value="purchase_invoice">
<input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
<input type="hidden" name="follow_up_rowcount" value="1">
<input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
<li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
[%- END %]
[%- IF id %]
+ [%- IF INSTANCE_CONF.get_doc_storage %]
+ <li><a href="controller.pl?action=File/list&file_type=document&object_type=purchase_invoice&object_id=[% HTML.url(id) %]">[% 'Documents' | $T8 %]</a></li>
+ <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=purchase_invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
+ [%- END %]
[%- IF AUTH.assert('record_links', 1) %]
<li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=PurchaseInvoice&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
[%- END %]
<tr>
<th align="right">[% 'Vendor' | $T8 %]</th>
<td>
- [%- INCLUDE 'generic/multibox.html'
- id = 'vendor',
- name = 'vendor',
- style = 'width: 250px',
- class = 'initial_focus',
- DATA = ALL_VENDORS,
- id_sub = 'vc_keys',
- label_key = 'name',
- select = vc_select,
- limit = vclimit,
- allow_textbox = 1,
- onChange = "document.getElementById('update_button').click();" -%]
- <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('[% vc | html %]')">
+ [% P.customer_vendor.picker("vendor_id", vendor_id, type="vendor", style="width: 250px", class="initial_focus", onchange="\$('#update_button').click()") %]
+ [% P.button_tag("show_vc_details('vendor')", LxERP.t8('Details (one letter abbreviation)')) %]
+ [% P.hidden_tag("previous_vendor_id", vendor_id) %]
</td>
- <input type="hidden" name="vendor_id" value="[% HTML.escape(vendor_id) %]">
- <input type="hidden" name="oldvendor" value="[% HTML.escape(oldvendor) %]">
- <input type="hidden" name="selectvendor" value="[% HTML.escape(selectvendor) %]">
</tr>
[%- IF ALL_CONTACTS.size %]
<tr>
<tr>
<th align="right">[% 'Steuersatz' | $T8 %]</th>
<td>
- [%- INCLUDE 'generic/multibox.html'
- name = 'taxzone_id'
- style = 'width: 250px'
- DATA = ALL_TAXZONES
- id_key = 'id'
- readonly = (id ? 1 : 0)
- label_key = 'description' -%]
+ [% 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();") %]
+ [%- IF id %]
+ <input type='hidden' name='taxzone_id' value='[% taxzone_id %]'>
+ [%- END %]
</td>
[%- IF id %]
<input type='hidden' name='taxzone_id' value='[% taxzone_id %]'>
[%- END %]
</tr>
-[%- IF all_departments %]
+[%- IF ALL_DEPARTMENTS.as_list.size %]
<tr>
<th align="right" nowrap>[% 'Department' | $T8 %]</th>
- <td colspan="3">
- [%- INCLUDE 'generic/multibox.html'
- name = 'department_id',
- style = 'width: 250px',
- DATA = all_departments,
- id_key = 'id',
- label_sub = 'department_labels',
- show_empty = 1 -%]
- </td>
+ <td colspan="3">[% P.select_tag("department_id", ALL_DEPARTMENTS, with_empty=1, default=department_id, title_key="description", style="width: 250px") %]</td>
</tr>
[%- END %]
[%- IF currencies %]
</tr>
<tr>
<th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
- <td>
- [%- INCLUDE 'generic/multibox.html'
- name = 'globalproject_id',
- DATA = ALL_PROJECTS,
- id_key = 'id',
- label_key = 'projectnumber',
- show_empty = 1,
- onChange = "document.getElementById('update_button').click();" -%]
- </td>
+ <td>[% P.project.picker('globalproject_id', globalproject_id) %]</td>
</tr>
</table>
</td>