<commit_before>{% extends "administrative/supplier.twig" %}

{% import '_default/macro.base.twig' as base %}
{% import '_default/form.base.twig' as form %}

{% block tab %}
		<form class="form form-horizontal form-condensed" method="post" action="/administrative/supplier/detail?action=edit&id={{ supplier.id }}">

			{% if errors is defined and errors|length == 1 and errors.vat is defined %}
				<div class="alert alert-warning">
					<button type="submit" class="btn btn-xs btn-warning pull-right" name="ignore_vat">
						{% trans "Confirm VAT number" %}
					</button>

					{% trans "The VAT number could not be verified." %} {% trans "If you still want to save this VAT number, please confirm." %}
				</div>
			{% elseif errors is defined %}
				<div class="alert alert-danger">
					{% trans "The form contains mistakes. Please correct them." %}
				</div>
			{% elseif env.sticky_session.message is defined %}
				{{ base.display_flash_message(env.sticky_session.message, 'supplier') }}
			{% endif %}

			<div class="form-group{% if 'company' in errors|keys %} has-error{% endif %}">
				<label for="company" class="control-label col-xs-3">{% trans "Company" %}</label>
				<div class="col-xs-5">
					<input type="text" name="supplier[company]" id="company" class="form-control" value="{{ supplier.company }}">
					{{ form.invalid_input('company', errors) }}
				</div>
			</div>

			<div class="form-group">
				<label class="col-xs-3 control-label">{% trans "Street" %}</label>
				<div class="col-xs-5"><input type="text" name="supplier[street]" class="form-control" value="{{ supplier.street }}" /></div>
			</div>

			<div class="form-group">
				<label class="col-xs-3 control-label">{% trans "Housenumber" %}</label>
				<div class="col-xs-5"><input type="text" name="supplier[housenumber]" class="form-control" value="{{ supplier.housenumber }}"/></div>
			</div>
			<div class="form-group">
				<label class="col-xs-3 control-label">{% trans "Zipcode" %}</label>
				<div class="col-xs-5"><input type="text" name="supplier[zipcode]" class="form-control" value="{{ supplier.zipcode }}" /></div>
			</div>

			<div class="form-group">
				<label class="col-xs-3 control-label">{% trans "City" %}</label>
				<div class="col-xs-5"><input type="text" name="supplier[city]" class="form-control" value="{{ supplier.city }}" /></div>
			</div>

			<div class="form-group{% if 'country_id' in errors|keys %} has-error{% endif %}">
				<label for="country_id" class="col-xs-3 control-label">{% trans "Country" %}</label>
				<div class="col-xs-5">
					<select name="supplier[country_id]" class="form-control" onchange="change_country();">
					{% for group in countries|keys  %}
						{% if group == 'european' %}
							<optgroup label="{% trans "European" %}">
						{% else %}
							<optgroup label="{% trans "Rest of the world" %}">
						{% endif %}

						{% for country in countries[group] %}
							<option value="{{ country.id }}" data-iso2="{{ country.iso2 }}" {% if supplier.country_id == country.id %}selected="selected"{% endif %}>{{ attribute(country, 'text_' ~ env.language.name_short ~ '_name') }}</option>
						{% endfor %}
						</optgroup>
					{% endfor %}
					</select>
				</div>
			</div>

			<div class="form-group{% if 'vat' in errors|keys %} has-error{% endif %}">
				<label for="vat" class="control-label col-xs-3">{% trans "Vat" %}</label>
				<div class="col-xs-1"><input type="text" class="form-control" id="vat_prefix" readonly value="AT" /></div>
				<div class="col-xs-4">
					<input type="text" name="supplier[vat]" id="vat" class="form-control" value="{{ supplier.vat }}">
					{{ form.invalid_input('vat', errors) }}
				</div>
			</div>

			<div class="form-group{% if 'accounting_identifier' in errors|keys %} has-error{% endif %}">
				<label for="accounting_identifier" class="control-label col-xs-3">{% trans "Accounting identifier" %}</label>
				<div class="col-xs-5">
					<input type="text" name="supplier[accounting_identifier]" class="form-control" value="{{ supplier.accounting_identifier }}">
					{{ form.invalid_input('accounting_identifier', errors) }}
				</div>
			</div>

			<div class="form-group{% if 'iban' in errors|keys %} has-error{% endif %}">
				<label for="accounting_identifier" class="control-label col-xs-3">{% trans "IBAN" %}</label>
				<div class="col-xs-5">
					<input type="text" name="supplier[iban]" id="iban" class="form-control" value="{{ supplier.iban }}">
					{{ form.invalid_input('iban', errors) }}
				</div>
			</div>

			<div class="form-group{% if 'bic' in errors|keys %} has-error{% endif %}">
				<label for="accounting_identifier" class="control-label col-xs-3">{% trans "BIC" %}</label>
				<div class="col-xs-5">
					<input type="text" name="supplier[bic]" id="bic" class="form-control" value="{{ supplier.bic }}">
					{{ form.invalid_input('bic', errors) }}
				</div>
			</div>

			<div class="form-group">
			    <label class="col-xs-3 control-label">{% trans "Comments" %}</label>
			    <div class="col-xs-5">
			        <textarea name="supplier[comment]" class="form-control">{{ supplier.comment }}</textarea>
			    </div>
			</div>

			<div class="form-group">
				<div class="col-xs-3 col-xs-offset-3">
					<button class="btn btn-primary">
						{% trans "Save" %}
					</button>
				</div>
			</div>
		</form>
		<script type="text/javascript">
			$(document).ready(function() {
				$('input[name="supplier[iban]"]').mask('SSAA AAAA 0000 0000 0000 0000 00000', { placeholder: '____ ____ ____ ____ ____ ____ ____'  });
			});

			function change_country() {<commit_msg>F#23140 Changed js mask, so that a 34 character IBan is allowed<commit_after>{% extends "administrative/supplier.twig" %}

{% import '_default/macro.base.twig' as base %}
{% import '_default/form.base.twig' as form %}

{% block tab %}
		<form class="form form-horizontal form-condensed" method="post" action="/administrative/supplier/detail?action=edit&id={{ supplier.id }}">

			{% if errors is defined and errors|length == 1 and errors.vat is defined %}
				<div class="alert alert-warning">
					<button type="submit" class="btn btn-xs btn-warning pull-right" name="ignore_vat">
						{% trans "Confirm VAT number" %}
					</button>

					{% trans "The VAT number could not be verified." %} {% trans "If you still want to save this VAT number, please confirm." %}
				</div>
			{% elseif errors is defined %}
				<div class="alert alert-danger">
					{% trans "The form contains mistakes. Please correct them." %}
				</div>
			{% elseif env.sticky_session.message is defined %}
				{{ base.display_flash_message(env.sticky_session.message, 'supplier') }}
			{% endif %}

			<div class="form-group{% if 'company' in errors|keys %} has-error{% endif %}">
				<label for="company" class="control-label col-xs-3">{% trans "Company" %}</label>
				<div class="col-xs-5">
					<input type="text" name="supplier[company]" id="company" class="form-control" value="{{ supplier.company }}">
					{{ form.invalid_input('company', errors) }}
				</div>
			</div>

			<div class="form-group">
				<label class="col-xs-3 control-label">{% trans "Street" %}</label>
				<div class="col-xs-5"><input type="text" name="supplier[street]" class="form-control" value="{{ supplier.street }}" /></div>
			</div>

			<div class="form-group">
				<label class="col-xs-3 control-label">{% trans "Housenumber" %}</label>
				<div class="col-xs-5"><input type="text" name="supplier[housenumber]" class="form-control" value="{{ supplier.housenumber }}"/></div>
			</div>
			<div class="form-group">
				<label class="col-xs-3 control-label">{% trans "Zipcode" %}</label>
				<div class="col-xs-5"><input type="text" name="supplier[zipcode]" class="form-control" value="{{ supplier.zipcode }}" /></div>
			</div>

			<div class="form-group">
				<label class="col-xs-3 control-label">{% trans "City" %}</label>
				<div class="col-xs-5"><input type="text" name="supplier[city]" class="form-control" value="{{ supplier.city }}" /></div>
			</div>

			<div class="form-group{% if 'country_id' in errors|keys %} has-error{% endif %}">
				<label for="country_id" class="col-xs-3 control-label">{% trans "Country" %}</label>
				<div class="col-xs-5">
					<select name="supplier[country_id]" class="form-control" onchange="change_country();">
					{% for group in countries|keys  %}
						{% if group == 'european' %}
							<optgroup label="{% trans "European" %}">
						{% else %}
							<optgroup label="{% trans "Rest of the world" %}">
						{% endif %}

						{% for country in countries[group] %}
							<option value="{{ country.id }}" data-iso2="{{ country.iso2 }}" {% if supplier.country_id == country.id %}selected="selected"{% endif %}>{{ attribute(country, 'text_' ~ env.language.name_short ~ '_name') }}</option>
						{% endfor %}
						</optgroup>
					{% endfor %}
					</select>
				</div>
			</div>

			<div class="form-group{% if 'vat' in errors|keys %} has-error{% endif %}">
				<label for="vat" class="control-label col-xs-3">{% trans "Vat" %}</label>
				<div class="col-xs-1"><input type="text" class="form-control" id="vat_prefix" readonly value="AT" /></div>
				<div class="col-xs-4">
					<input type="text" name="supplier[vat]" id="vat" class="form-control" value="{{ supplier.vat }}">
					{{ form.invalid_input('vat', errors) }}
				</div>
			</div>

			<div class="form-group{% if 'accounting_identifier' in errors|keys %} has-error{% endif %}">
				<label for="accounting_identifier" class="control-label col-xs-3">{% trans "Accounting identifier" %}</label>
				<div class="col-xs-5">
					<input type="text" name="supplier[accounting_identifier]" class="form-control" value="{{ supplier.accounting_identifier }}">
					{{ form.invalid_input('accounting_identifier', errors) }}
				</div>
			</div>

			<div class="form-group{% if 'iban' in errors|keys %} has-error{% endif %}">
				<label for="accounting_identifier" class="control-label col-xs-3">{% trans "IBAN" %}</label>
				<div class="col-xs-5">
					<input type="text" name="supplier[iban]" id="iban" class="form-control" value="{{ supplier.iban }}">
					{{ form.invalid_input('iban', errors) }}
				</div>
			</div>

			<div class="form-group{% if 'bic' in errors|keys %} has-error{% endif %}">
				<label for="accounting_identifier" class="control-label col-xs-3">{% trans "BIC" %}</label>
				<div class="col-xs-5">
					<input type="text" name="supplier[bic]" id="bic" class="form-control" value="{{ supplier.bic }}">
					{{ form.invalid_input('bic', errors) }}
				</div>
			</div>

			<div class="form-group">
			    <label class="col-xs-3 control-label">{% trans "Comments" %}</label>
			    <div class="col-xs-5">
			        <textarea name="supplier[comment]" class="form-control">{{ supplier.comment }}</textarea>
			    </div>
			</div>

			<div class="form-group">
				<div class="col-xs-3 col-xs-offset-3">
					<button class="btn btn-primary">
						{% trans "Save" %}
					</button>
				</div>
			</div>
		</form>
		<script type="text/javascript">
			$(document).ready(function() {
				$('input[name="supplier[iban]"]').mask('SSAA AAAA 0000 0000 0000 0000 0000 0000 00', { placeholder: '____ ____ ____ ____ ____ ____ ____ ____ __'  });
			});

			function change_country() {
{'fraction_non_alphanumeric': 0.20769983106606207, 'fraction_numerical': 0.009780385880679292, 'mean_word_length': 3.79045996592845, 'pattern_counts': {'":': 0, '<': 207, '<?xml version=': 0, '>': 207, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4819282', 'n_tokens_mistral': 4606, 'n_tokens_neox': 3611, 'n_words': 845}