<div ng-cloak>
	<span ng-init="vat = {{\Config::get('settings.vat')}}"></span>
	<button class="btn btn-warning" ng-click="showModal()" eat-click><i class="fa fa-truck"></i> Order non-existing  part</button>
	<div class="modal hide fade">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
			<h3>Place an order for a part that doesn't exist</h3>
		</div>
		<form name="secondHandPartForm" class="form-horizontal" ng-submit="save()">
			<div class="modal-body">
				<div class="alert alert-warning">
					<i class="fa fa-exclamation-triangle"></i> Use this feature only if you are placing an order for a part that is not in stock.
				</div>
				<div class="alert alert-danger" ng-if="errors">
					<i class="fa fa-exclamation-triangle"></i> {[{ errors }]}
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label" for="inputPartTitle">Part Name</label>
					<div class="col-sm-9">
						<input type="text" class="form-control" name="title" ng-model="data.name" id="inputPartTitle" required>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label" for="inputPartExpectedPrice">Expected price </label>
					<div class="col-sm-9">
						<input type="text" class="form-control" numbers-only name="expected_price" ng-model="data.price_excluding_vat" id="inputPartExpectedPrice" ng-init="data.cost = 0">
					</div>
				</div>
				<div class="form-group">
                        <label class="col-sm-3 control-label">Price include <strong>VAT</strong></label>
                        <div class="col-sm-9">
	                        <label class="radio-inline">
	                            <input type="radio" name="price_vat_included" value="1" ng-model="data.price_vat_included" required> Yes
	                        </label>
	                        <label class="radio-inline">
	                            <input type="radio" name="price_vat_included" value="0" ng-model="data.price_vat_included"> No
	                        </label>
                        </div>
                </div>
				<div class="form-group">
					<label class="col-sm-3 control-label" for="inputPartQuantity">Quantity</label>
					<div class="col-sm-9">
						<input type="number" name="quantity" ng-model="data.quantity" id="inputPartQuantity" ng-init="data.quantity = 1">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label" for="inputPartUrgency">Urgency</label>
					<div class="col-sm-9">
						<select name="severity_id" ng-model="data.severity_id" ng-init="data.severity_id = 2" class="form-control" required>
							<option value="">Select Urgency</option>
							@foreach(\App\Models\Severity::all()->pluck('name', 'id') as $id => $name)
								<option value="{{ $id }}">{{ $name }}</option>
							@endforeach
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label" for="inputPartQuantity">Notes</label>
					<div class="col-sm-9">
						<textarea rows="5" name="problem" class="form-control" ng-model="data.notes" required></textarea>
					</div>
				</div>
			</div>
			<div class="modal-footer">
				<button class="btn btn-default" data-dismiss="modal" aria-hidden="true" eat-click>Close</button>
				<button class="btn btn-primary">Request</button>
			</div>
		</form>
	</div>
</div>