<commit_before>{% extends "_default/layout.base.twig" %}

{% block content %}

	{% if action == 'edit' %}

		<ol class="breadcrumb">
			<li><a href="/">{% trans "Home" %}</a></li>
			<li><a href="/administrative/purchase">{% trans "Purchases" %}</a></li>
			<li class="active">{% trans "Edit purchase" %}</li>
		</ol>

		{% if errors is defined %}
		<div class="alert alert-danger">
			{% trans "The form contains mistakes. Please correct them." %}
		</div>
		{% elseif env.session_sticky.message is defined %}
			{{ base.display_flash_message(env.session_sticky.message, 'purchase') }}
		{% endif %}

		<form class="form" method="post" action="/administrative/purchase?action=edit&id={{ purchase.id }}">

			TODO

			<div class="form-group">
				<button class="btn btn-primary">
					{% trans "Save" %}
				</button>
			</div>
		</form>

	{% elseif action == 'add' %}

		<ol class="breadcrumb">
			<li><a href="/">{% trans "Home" %}</a></li>
			<li><a href="/administrative/purchase" title="">{% trans "Purchases" %}</a></li>
			<li class="active">{% trans "Create purchase" %}</li>
		</ol>

		{% if errors is defined %}
			<div class="alert alert-danger">
				{% trans "The form contains errors. Please correct them." %}
			</div>
		{% endif %}

		{% include 'administrative/purchase/modal.document.twig' with {id: 'select-document', modal_size: "lg"} %}

		<div class="panel panel-default"><commit_msg>- new migration: add date field for purchase - new interface: edit purchase<commit_after>{% extends "_default/layout.base.twig" %}

{% block content %}

	{% if action == 'edit' %}

		<ol class="breadcrumb">
			<li><a href="/">{% trans "Home" %}</a></li>
			<li><a href="/administrative/purchase">{% trans "Purchases" %}</a></li>
			<li class="active">{% trans "Edit purchase" %}</li>
		</ol>

		{% if 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, 'purchase') }}
		{% endif %}

		<form method="post" class="form-horizontal" action="/administrative/purchase?action=edit&id={{ purchase.id }}">
		<div class="panel panel-default">
			<div class="panel-heading">{% trans "Purchase settings" %}</div>
			<div class="panel-body">
				<div class="form-group">
					<label class="col-xs-3 control-label">{% trans "Supplier" %}</label>
					<div class="col-xs-9">
						<p class="form-control-static">{{ purchase.supplier.company }}</p>
					</div>
				</div>

				<div class="form-group">
					<label class="col-xs-3 control-label">{% trans "Price excl VAT" %}</label>
					<div class="col-xs-9">
						<div class="input-group">
							<span class="input-group-addon">&euro;</span>
							<input type="text" name="purchase[price_excl]" class="form-control" value="{{ purchase.price_excl }}" >
						</div>
					</div>
				</div>

				<div class="form-group">
					<label class="col-xs-3 control-label">{% trans "Price incl VAT" %}</label>
					<div class="col-xs-9">
						<div class="input-group">
							<span class="input-group-addon">&euro;</span>
							<input type="text" name="purchase[price_incl]" class="form-control" value="{{ purchase.price_incl }}" >
						</div>
					</div>
				</div>

				<div class="form-group">
					<label class="col-xs-3 control-label">{% trans "Date" %}</label>
					<div class="col-xs-9">
						<input type="text" class="form-control datepicker" name="purchase[date]" value="{{ purchase.date }}"/>
					</div>
				</div>

				<div class="form-group">
					<label class="col-xs-3 control-label">{% trans "Paid" %}</label>
					<div class="col-xs-9">
						<input type="checkbox" name="paid" id="paid" />
					</div>
				</div>


				<div class="form-group">
					<div class="col-xs-9 col-xs-offset-3">
						<button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
					</div>
				</div>

			</div>
		</div>
		</form>

	{% elseif action == 'add' %}

		<ol class="breadcrumb">
			<li><a href="/">{% trans "Home" %}</a></li>
			<li><a href="/administrative/purchase" title="">{% trans "Purchases" %}</a></li>
			<li class="active">{% trans "Create purchase" %}</li>
		</ol>

		{% if errors is defined %}
			<div class="alert alert-danger">
				{% trans "The form contains errors. Please correct them." %}
			</div>
		{% endif %}

		{% include 'administrative/purchase/modal.document.twig' with {id: 'select-document', modal_size: "lg"} %}

		<div class="panel panel-default">
{'fraction_non_alphanumeric': 0.2164971251658558, 'fraction_numerical': 0.0026536930561698365, 'mean_word_length': 3.4826560951437067, 'pattern_counts': {'":': 0, '<': 125, '<?xml version=': 0, '>': 125, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4145083', 'n_tokens_mistral': 1879, 'n_tokens_neox': 1510, 'n_words': 360}