<?php 

use Jackiedo\DotenvEditor\Facades\DotenvEditor;

$editor = DotenvEditor::load(storage_path('app/settings.env'));

?>
<form id="new_invoice_item">
    <input type="hidden" name="data[_items_at_hwplus_invoices]" value="{{$model->getAttribute('_items_at_hwplus_invoices')}}">
    
    <div class="form-group">
        <div class="input-group mb-3">
            <textarea class="form-control" placeholder="Bezeichnung" name="data[descriptor]" autocomplete="off"></textarea>
        </div>
  </div>
   
 
  <div class="form-group">
    <input type="text" class="form-control" name="data[amount]" placeholder="Menge" autocomplete="off" oninput="this.value = this.value.replace(/[^\d,]+/g, '')">
  </div>
  
   
  <div class="input-group">
    <select class="custom-select" name="data[unit]" style="width:10%;">
    @foreach(\Runtime::make('hwplus_units')->where('groupname', 'time')->get() AS $unit)
    <option value="{{$unit->descriptor}}">{{$unit->descriptor}}</option>
    @endforeach
  </select>
  </div>
  
  
  <hr class="mt-3 mb-3">
  
  <div class="input-group">
  
  <select class="custom-select" id="vat_rate" name="data[vat]" style="width:10%;">
    @if(!$editor->getValue('COMPANY_SBLAW'))
    @foreach(\Runtime::make('hwplus_vat_rates')->get() AS $rate)
    <option value="{{$rate->rate}}" @if($rate->flag_default) selected @endif>{{$rate->descriptor}}</option>
    @endforeach
    @else
    <option value="0">0%</option>
    @endif
  </select>
   <input type="text" class="form-control" name="data[netprice]" placeholder="Einzelpreis" autocomplete="off" oninput="this.value = this.value.replace(/[^\d,-]+/g, '')">
   <div class="input-group-append">
    <span class="input-group-text">€</span>
   </div>
  </div>
  
</form>

