[% USE T8 %] [% USE HTML %] [% USE LxERP %] [% USE L %] [% USE P %] [% # Determine which shipping address to show if the delivery order has been shipped already. %] [% IF delivered; SET shipto_label = []; IF shipto_id; FOREACH row = ALL_SHIPTO ; IF row.shipto_id == shipto_id ; SET shipto_label = [ row.shiptoname, row.shiptodepartment_1, row.shiptostreet, row.shiptocity ] ; END ; END ; ELSE ; SET shipto_label = [ shiptoname, shiptodepartment_1, shiptostreet, shiptocity ] ; END ; SET shipto_label = shipto_label.grep('.') ; IF !shipto_label.size ; shipto_label = [ LxERP.t8('no shipping address') ] ; END ; END ; %]

[% title %]

[% IF vc == 'customer' %] [% SET is_customer = '1' %] [% ELSE %] [% SET vc = 'vendor' %] [% SET is_customer = '0' %] [% END %] [% SET vc_id = vc _ "_id" %] [% IF delivered %] [% SET DISABLED = ' disabled' %] [% END %] [% INCLUDE 'common/flash.html' %] [% INCLUDE 'generic/set_longdescription.html' %] [% IF ERRORS && ERRORS.size %]

[% ERRORS.join('
') %]

[% END %]
[% INCLUDE 'generic/toggle_wrapper.html' %] [% IF delivered %] [% END %] [% IF !id %] [% L.hidden_tag('form_validity_token', form_validity_token) %] [% END %] [% IF ALL_CONTACTS.size %] [% END %] [% IF (vc == 'customer') && VC_OBJ.additional_billing_addresses.as_list.size %] [% END %] [% IF business %] [% END %] [% IF max_dunning_level %] [% END %] [% IF ALL_LANGUAGES.size %] [% END %] [% IF ALL_DEPARTMENTS.size %] [% END %]
[% 'Customer & Order Information' | $T8 %]
[% IF is_customer %][% 'Customer' | $T8 %][% ELSE %][% 'Vendor' | $T8 %][% END %] [% IF RO %] [% P.hidden_tag(vc_id, $vc_id) %] [% HTML.escape(VC_OBJ.name) %] [% ELSE %] [% P.customer_vendor.picker(vc_id, $vc_id, type=vc, class="wi-wide tooltipstered", onchange="\$('#update_button').click()", title=VC_OBJ.name ) %] [% END %] [% #P.button_tag("show_vc_details('" _ HTML.escape(vc) _ "')", LxERP.t8("Details (one letter abbreviation)"), class="wi-tiny neutral", title=LxERP.t8('Detailed information about this contact') ) %] [% P.hidden_tag("previous_" _ vc_id, $vc_id) %]
[% 'Contact Person' | $T8 %] [% IF delivered %] [% IF cp_id == row.cp_id %] [% HTML.escape(row.cp_name) %][% IF row.cp_abteilung %] ([% HTML.escape(row.cp_abteilung) %])[% END -%] [% END %] [% ELSE %] [% L.select_tag('cp_id', ALL_CONTACTS, default = cp_id, value_key = 'cp_id', title_key = 'full_name_dep', with_empty = 1, class='wi-wide') %] [% END %]
[% 'Shipping Address' | $T8 %] [% IF delivered %] [% HTML.escape(shipto_label.join('; ')) %] [% ELSE %] [% IF ALL_SHIPTO.size %] [% shiptos = [ [ "", LxERP.t8("No/individual shipping address") ] ] ; L.select_tag('shipto_id', shiptos.import(ALL_SHIPTO), default=shipto_id, value_key='shipto_id', title_key='displayable_id', class='wi-wide') %] [% END %] [% L.button_tag("kivi.SalesPurchase.edit_custom_shipto()", LxERP.t8("Custom shipto"), class='button neutral below wi-wide') %] [% END %]
[% 'Custom Billing Address' | $T8 %] [% L.select_tag('billing_address_id', VC_OBJ.additional_billing_addresses, with_empty=1, default=billing_address_id, value_key='id', title_key='displayable_id', class='wi-wide') %]
[% IF is_customer %][% 'Customer type' | $T8 %][% ELSE %][% 'Vendor type' | $T8 %][% END %] [% HTML.escape(business) %]
[% 'Max. Dunning Level' | $T8 %] [% HTML.escape(max_dunning_level) %], [% 'Dunning Amount' | $T8 %]: [% HTML.escape(LxERP.format_amount(dunning_amount, 2)) %]
[% 'Language' | $T8 %] [% L.select_tag('language_id', ALL_LANGUAGES, default = language_id, title_key = 'description', with_empty = 1, style = 'width: 250px' )%]
[% 'Department' | $T8 %] [% IF ( delivered ) %] [% L.hidden_tag('department_id', department_id) %] [% ELSE %] [% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, class='wi-wide', disabled = delivered )%] [% END %]
[% 'Shipping Point' | $T8 %]
[% 'Ship via' | $T8 %]
[% 'Transaction description' | $T8 %] [% L.input_tag("transaction_description", transaction_description, class="wi-wide tooltipstered", "data-validate"=(INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : ''), readonly=delivered, title=transaction_description) %]
[% 'Internal Notes' | $T8 %] [% IF delivered %][% SET RO=' readonly' %][% END %] [% L.textarea_tag("notes", notes, wrap="soft", style="width: 350px; height: 150px", class="texteditor") %]
[% 'Delivery Terms' | $T8 %]
[% L.select_tag('delivery_term_id', ALL_DELIVERY_TERMS, default=delivery_term_id, with_empty=1, title_key='description', class='wi-wide') %]
[% 'Notes' | $T8 %]
[% IF delivered %] [% L.hidden_tag("notes", notes) %]
[% P.restricted_html(notes) %]
[% ELSE %] [% L.textarea_tag("notes", notes, wrap="soft", rows=3, cols=10, class="texteditor wi-wide") %] [% END %]
[% IF is_customer %] [% IF salesman_id %] [% SET the_salesman_id = salesman_id %] [% ELSE %] [% SET the_salesman_id = employee_id %] [% END %] [% END %] [% IF is_customer %] [% END %]
[% 'Status & Handling' | $T8 %]
[% 'Transfer Status' | $T8 %] [% IF delivered %] [% IF is_customer %] [% 'transferred out' | $T8 %] [% ELSE %] [% 'transferred in' | $T8 %] [% END %] [% ELSE %] [% IF is_customer %] [% 'not transferred out yet' | $T8 %] [% ELSE %] [% 'not transferred in yet' | $T8 %] [% END %] [% END %]
[% 'Status' | $T8 %] [% IF closed %][% 'Closed' | $T8 %][% ELSE %][% 'Open' | $T8 %][% END %]
[% 'Employee' | $T8 %] [% IF delivered %] [% FOREACH row = ALL_EMPLOYEES %] [% IF row.id == employee_id %] [% IF row.name %] [% HTML.escape(row.name) %] [% ELSE %] [% HTML.escape(row.login) %] [% END %] [% END %] [% END %] [% ELSE %] [% L.select_tag('employee_id', ALL_EMPLOYEES, default = employee_id, title_key = 'safe_name', class='wi-normal') %] [% END %]
[% 'Salesman' | $T8 %] [% IF delivered %] [% FOREACH row = ALL_SALESMEN %] [% IF row.id == the_salesman_id %] [% IF row.name %] [% HTML.escape(row.name) %][% ELSE %][% HTML.escape(row.login) %] [% END %] [% END %] [% END %] [% ELSE %] [% L.select_tag('salesman_id', ALL_SALESMEN, default = (salesman_id ? salesman_id : employee_id), title_key = 'safe_name', class='wi-normal') %] [% END %]
[% 'IDs & Dates' | $T8 %]
[% 'Delivery Order Number' | $T8 %] [% IF !is_customer || INSTANCE_CONF.get_sales_purchase_record_numbers_changeable %] [% L.input_tag("donumber", donumber, readonly=delivered, class="wi-mediumsmall") %] [% ELSIF id %] [% HTML.escape(donumber) %] [% L.hidden_tag("donumber", donumber) %] [% ELSE %] [% LxERP.t8("will be set upon saving") %] [% END %]
[% 'Order Number' | $T8 %]
[% IF is_customer %][% 'Customer Order Number' | $T8 %][% ELSE %][% 'Vendor Order Number' | $T8 %][% END %]
[% 'Project Number' | $T8 %] [% IF delivered %] [% FOREACH row = ALL_PROJECTS %] [% IF globalproject_id == row.id %][% HTML.escape(row.projectnumber) %][% END %] [% END %] [% ELSE %] [% END %]
[% 'Delivery Order Date' | $T8 %] [% L.date_tag('transdate', transdate, readonly => delivered, class='wi-small') %]
[% 'Reqdate' | $T8 %] [% L.date_tag('reqdate', reqdate, readonly => delivered, class='wi-small') %]
[% 'Insert Date' | $T8 %] [% insertdate %]