mivita/resources/views/admin/product/form.blade.php
2026-02-20 17:55:06 +01:00

478 lines
No EOL
26 KiB
PHP

<div class="card mb-2">
<h5 class="card-header bg-primary text-white">
{{ __('Product') }}
</h5>
<div class="card-body">
<div class="form-group">
<label class="custom-control custom-checkbox float-right">
{!! Form::checkbox('active', 1, $product->active, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('activ')}}</span>
</label>
<label class="form-label">{{ __('Produktname / Titel') }}*</label>
{{ Form::text('name', $product->getLang('name'), array('placeholder'=>__('Name'), 'class'=>'form-control', 'id'=>'name', 'required')) }}
</div>
<div class="form-row">
<div class="form-group col-sm-6">
<label class="form-label" for="number">{{ __('Artikelnummer') }}</label>
{{ Form::text('number', $product->number, array('placeholder'=>__('number'), 'class'=>'form-control', 'id'=>'number')) }}
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="ean">{{ __('EAN Code') }}</label>
{{ Form::text('ean', $product->ean, array('placeholder'=>__('EAN'), 'class'=>'form-control', 'id'=>'ean')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-sm-10">
<label class="form-label" for="title">{{ __('Kategorie (Mehrfachauswahl)') }}*</label>
<select class="selectpicker" name="categories[]" id="categories" data-style="btn-light" data-live-search="false" multiple required>
{!! HTMLHelper::getCategoriesOptions($product->categories()->pluck('category_id')->toArray(), false) !!}
</select>
</div>
<div class="form-group col-sm-2">
<label class="form-label" for="pos">{{ __('Listenposition') }}</label>
{{ Form::text('pos', $product->pos, array('placeholder'=>__('1, 2, 3, etc'), 'class'=>'form-control', 'id'=>'pos')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-md-10">
<label class="form-label" for="show_on">{{ __('Produkt anzeigen (Mehrfachauswahl)') }}</label>
{{ Form::select('show_on[]', $product->showONs, $product->show_on, array('data-live-search'=>'false', 'class'=>'selectpicker', 'id'=>'show_on', 'multiple') ) }}
</div>
</div>
<div class="form-group">
<label class="form-label" for="copy">{{ __('Produktbeschreibung') }}</label>
{{ Form::textarea('copy', $product->copy , array('placeholder'=>__('Produktbeschreibung'), 'class'=>'form-control summernote', 'id'=>'copy')) }}
</div>
<label class="custom-control custom-checkbox float-right">
{!! Form::checkbox('shipping_addon', 1, $product->shipping_addon, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">Kompensationprodukt beim Versand für Berater (KP)</span>
</label>
</div>
</div>
<div class="card mb-2">
<h5 class="card-header bg-primary text-white">
{{ __('Preise in EUR') }}
</h5>
<div class="card-body">
<div class="form-row">
<div class="form-group col-sm-4 col-md-3">
<label class="form-label" for="price">{{ __('Preis VK in EUR (Brutto)') }}</label>
{{ Form::text('price', $product->getFormattedPrice(), array('placeholder'=>__('Preis VK in EUR (Brutto)'), 'class'=>'form-control', 'id'=>'price')) }}
</div>
<div class="form-group col-sm-4 col-md-3">
<label class="form-label" for="price_ek">{{ __('Preis EK in EUR') }}</label>
{{ Form::text('price_ek', $product->getFormattedPriceEk(), array('placeholder'=>__('Preis EK in EUR'), 'class'=>'form-control', 'id'=>'price_ek')) }}
</div>
<div class="form-group col-sm-4 col-md-3">
<label class="form-label" for="tax">{{ __('MwSt in %') }}</label>
{{ Form::text('tax', $product->getFormattedTax(), array('placeholder'=>__('MwSt in %'), 'class'=>'form-control', 'id'=>'tax')) }}
</div>
<div class="form-group col-sm-4 col-md-3">
<label class="form-label" for="price_old">{{ __('Streichpreis in EUR (wenn > 0)') }}</label>
{{ Form::text('price_old', $product->getFormattedPriceOld(), array('placeholder'=>__('Streichpreis'), 'class'=>'form-control', 'id'=>'price_old')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-sm-4">
<label class="form-label" for="weight">{{ __('Gewicht in g') }}</label>
{{ Form::text('weight', $product->weight, array('placeholder'=>__('Gewicht in g'), 'class'=>'form-control', 'id'=>'weight')) }}
</div>
<div class="form-group col-sm-4">
<label class="form-label" for="points">{{ __('Points pro Produkt') }}</label>
{{ Form::text('points', $product->getFormattedPoints(), array('placeholder'=>__('Points pro Produkt'), 'class'=>'form-control', 'id'=>'points')) }}
</div>
<div class="form-group col-sm-4">
<label class="form-label" for="amount">{{ __('Anzahl/Verfügbarkeit') }}</label>
{{ Form::text('amount', $product->amount, array('placeholder'=>__('Anzahl/Verfügbarkeit'), 'class'=>'form-control', 'id'=>'amount')) }}
</div>
</div>
<hr>
<div class="form-row">
<div class="form-group col-sm-12">
<label class="form-label">Keine Provision (NoP.)</label>
<label class="custom-control custom-checkbox">
{!! Form::checkbox('no_commission', 1, $product->no_commission, ['class'=>'custom-control-input', 'id'=>'no_commission']) !!}
<span class="custom-control-label">Dieses Produkt ist nicht provisionsfähig.</span>
</label>
</div>
</div>
<hr>
<div class="form-row">
<div class="form-group col-sm-12">
<label class="form-label">Kein versandkostenfreis Produkt (NoF.)</label>
<label class="custom-control custom-checkbox">
{!! Form::checkbox('no_free_shipping', 1, $product->no_free_shipping, ['class'=>'custom-control-input', 'id'=>'no_free_shipping']) !!}
<span class="custom-control-label">Für dieses Produkt immer Versandkosten berechnen.</span>
</label>
</div>
</div>
<hr>
<div class="form-row">
<div class="form-group col-sm-12">
<label class="form-label">Versandkostenfrei für Berater (FcB.)</label>
<label class="custom-control custom-checkbox">
{!! Form::checkbox('free_shipping_consultant', 1, $product->free_shipping_consultant, ['class'=>'custom-control-input', 'id'=>'free_shipping_consultant']) !!}
<span class="custom-control-label">Versandkosten für Berater sind bei diesem Produkt immer 0 (z.B. Starterpakete).</span>
</label>
</div>
</div>
<hr>
<div class="form-row">
<div class="form-group col-sm-12">
<label class="form-label">Reine Mitgliedschaft (MoP.)</label>
<label class="custom-control custom-checkbox">
{!! Form::checkbox('is_membership_only', 1, $product->is_membership_only, ['class'=>'custom-control-input', 'id'=>'is_membership_only']) !!}
<span class="custom-control-label">Dieses Produkt ist eine reine Mitgliedschaft ohne Starterpaket (Warnung im Wizard).</span>
</label>
</div>
</div>
<hr>
<div class="form-row">
<div class="form-group col-sm-8">
<label class="form-label">Kaufeinschränkung Berater</label>
<label class="custom-control custom-checkbox">
{!! Form::checkbox('buying_restriction', 1, $product->buying_restriction, ['class'=>'custom-control-input', 'id'=>'buying_restriction']) !!}
<span class="custom-control-label">Für dieses Produkt ist für Berater nur 1x käuflich (z.B. Starter-Kit).</span>
</label>
</div>
</div>
<hr>
<div class="form-row">
<div class="form-group col-sm-12">
<label class="custom-control custom-checkbox">
{!! Form::checkbox('sponsor_buying_points', 1, $product->sponsor_buying_points, ['class'=>'custom-control-input', 'id'=>'sponsor_buying_points']) !!}
<span class="custom-control-label">Sponsor erhält beim Kauf Points (z.B. Starter-Kit).</span>
</label>
</div>
<div class="form-group col-md-3 col-sm-6">
{{ Form::text('sponsor_buying_points_amount', $product->sponsor_buying_points_amount, array('placeholder'=>__('Anzahl KU'), 'class'=>'form-control', 'id'=>'sponsor_buying_points_amount')) }}
</div>
</div>
</div>
</div>
<div class="card mb-2">
<h5 class="card-header bg-primary text-white">
Landesspezifische Preise
</h5>
<div class="card-body pt-0">
@foreach($country_for_prices as $country)
{{ Form::hidden('country_prices[]', $country->id) }}
<div class="card-header bg-light pb-0 mt-3">
<h6>{{$country->de}}</h6>
</div>
<div class="bg-lighter p-2">
@if($country->own_eur)
<div class="form-row">
<div class="form-group col-sm-4 col-md-3">
<label class="form-label">Land hat eigenen EURO Preis</label>
<p></p>
</div>
<div class="form-group col-sm-4 col-md-3">
<label class="form-label" for="price">{{ __('Preis VK in EUR Brutto') }}</label>
{{ Form::text('c_price['.$country->id.']', formatNumber($product->getCPrice($country)), array('placeholder'=>__('Preis VK in EUR Brutto'), 'class'=>'form-control', 'id'=>'c_price_'.$country->id)) }}
</div>
<div class="form-group col-sm-4 col-md-3">
<label class="form-label" for="tax">{{ __('MwSt in %') }}</label>
{{ Form::text('c_tax['.$country->id.']', formatNumber($product->getCTax($country)), array('placeholder'=>__('MwSt in %'), 'class'=>'form-control', 'id'=>'c_tax'.$country->id)) }}
</div>
<div class="form-group col-sm-4 col-md-3">
<label class="form-label" for="price_old">{{ __('Streichpreis (wenn > 0)') }}</label>
{{ Form::text('c_price_old['.$country->id.']', formatNumber($product->getCPriceOld($country)), array('placeholder'=>__('Streichpreis'), 'class'=>'form-control', 'id'=>'c_price_old'.$country->id)) }}
</div>
</div>
@endif
@if($country->currency)
<div class="form-row">
<div class="form-group col-sm-4 col-md-3">
<label class="form-label">Land hat eigene Währung</label>
<p>@if($country->currency_calc) Preis Berechnung automatisch @else Preis manuell
angegeben @endif</p>
</div>
{{-- NUR Anzeige vom automatisch berechneten Preis currency_faktor
Auf Basis vom price
Wenn own_eur auf basis vom own_eur price
--}}
<div class="form-group col-sm-4 col-md-3">
<label class="form-label">Preis VK in {{ $country->currency_unit }}</label>
{{ Form::text('c_currency['.$country->id.']', formatNumber($product->getRealPrice($country) * $country->currency_faktor), array('class'=>'form-control', 'readonly')) }}
</div>
{{--@if($country->currency_calc)
@else
Eingabe
Währungs Namen aus currency_name
currency_faktor als Hinweis ausgeben
Auf Basis vom price
Wenn own_eur auf basis vom own_eur price
<div class="form-group col-sm-4 col-md-3">
<label class="form-label">{{__('Preis VK in ')}} {{ $country->currency_unit }} ({{formatNumber($product->getRealPrice($country) * $country->currency_faktor)}})</label>
{{ Form::text('c_currency['.$country->id.']', formatNumber($product->getCCurrency($country->id)), array('placeholder'=>__('Preis VK in ').$country->currency_unit, 'class'=>'form-control')) }}
</div>
@endif --}}
<div class="form-group col-sm-4 col-md-2">
<label class="form-label">{{ __('Währungs Faktor' ) }}</label>
{{ Form::text('currency_faktor['.$country->id.']', formatNumber($country->currency_faktor, 4), array('class'=>'form-control', 'readonly')) }}
</div>
<div class="form-group col-sm-4 col-md-2">
<label class="form-label">{{ __('Preis VK in EUR ') }}</label>
{{ Form::text('preis_eur['.$country->id.']', formatNumber($product->getRealPrice($country)), array('class'=>'form-control', 'readonly')) }}
</div>
<div class="form-group col-sm-4 col-md-2">
<label class="form-label">{{ __('Währung') }}</label>
{{ Form::text('currency_unit['.$country->id.']', $country->currency_unit, array('class'=>'form-control', 'readonly')) }}
</div>
</div>
@endif
</div>
@endforeach
<em class="float-right text-muted small">für die Einstellung von landesspezifischen Preisen müssen diese unter
<a href="{{route('admin_countries')}}">Länder</a> -> Land aktiviert werden.</em>
</div>
</div>
<div class="card mb-2">
<h5 class="card-header bg-primary text-white">
{{ __('Details') }}
</h5>
<div class="card-body">
<div class="form-row">
<div class="form-group col-sm-5">
<label class="form-label" for="contents">{{ __('Menge Inhalt (ml / g) als Text') }}</label>
{{ Form::text('contents', $product->contents, array('placeholder'=>__('Bsp: 150 ml'), 'class'=>'form-control', 'id'=>'contents')) }}
</div>
<div class="form-group col-sm-3">
<label class="form-label" for="contents_total">{{ __('Gesamter Inhalt (ml / g) als Zahl') }}</label>
{{ Form::text('contents_total', $product->contents_total, array('placeholder'=>__('Bsp: 150'), 'class'=>'form-control', 'id'=>'contents_total')) }}
</div>
<div class="form-group col-sm-2">
<label class="form-label" for="contents">{{ __('Grundpreis Einheit') }}</label>
{{ Form::select('unit', $product->unitTypes, $product->unit, array('data-live-search'=>'false', 'class'=>'selectpicker', 'id'=>'unit') ) }}
</div>
<div class="form-group col-sm-2">
<label class="form-label" for="base_price">{{ __('Grundpreis') }}</label>
{{ Form::text('base_price', $product->getBasePriceFormattedFull(), array('placeholder'=>__(''), 'class'=>'form-control', 'id'=>'base_price', 'readonly')) }}
</div>
{{-- <div class="form-group col-sm-4">
<label class="form-label" for="title">{{ __('Attribute') }}</label>
<select class="selectpicker" name="attributes[]" id="attributes" data-style="btn-light"
data-live-search="false" multiple>
{!! HTMLHelper::getAttributesOptions($product->attributes()->pluck('attribute_id')->toArray()) !!}
</select>
</div>
--}}
</div>
<div class="form-group">
<label class="form-label" for="description">{{ __('Beschreibung') }}</label>
{{ Form::textarea('description', $product->description , array('placeholder'=>__('description'), 'class'=>'form-control summernote', 'id'=>'description')) }}
</div>
<div class="form-group">
<label class="form-label" for="usage">{{ __('Anwendung') }}</label>
{{ Form::textarea('usage', $product->usage , array('placeholder'=>__('usage'), 'class'=>'form-control summernote', 'id'=>'usage')) }}
</div>
<div class="form-group">
<label class="form-label" for="ingredients">{{ __('Hinweise') }}</label>
{{ Form::textarea('ingredients', $product->ingredients , array('placeholder'=>__('ingredients'), 'class'=>'form-control summernote', 'id'=>'ingredients')) }}
</div>
<div class="form-row">
<div class="form-group col-sm-6">
<label class="form-label" for="icons">{{ __('Produkt Icon') }}</label>
{{ Form::select('icons', [null=>'Kein Icon', 'product_icons_1.png'=>'product_icons_1.png','product_icons_2.jpg'=>'product_icons_2.jpg'], $product->icons, array('data-live-search'=>'false', 'class'=>'selectpicker', 'id'=>'icons') ) }}
</div>
<div class="form-group col-sm-6">
<img src="/assets/images/{{ $product->icons }}" alt="" class="img-responsive" width="200">
</div>
</div>
</div>
</div>
<div class="card mb-2">
<h5 class="card-header bg-primary text-white">
{{ __('order.contents') }}
</h5>
<div class="card-body">
<div class="card-datatable table-responsive pt-0">
<table class="datatables-style table table-striped table-bordered">
<thead>
<tr>
<th>{{__('Name')}}</th>
<th>{{__('INCI')}}</th>
<th>{{__('Wirkung') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($product->p_ingredients as $ingredient)
<tr>
<td>{{ $ingredient->name }}</td>
<td>{{ $ingredient->inci }}</td>
<td>{{ $ingredient->effect }}</td>
<td><a class="text-danger" href="{{ route('admin_product_delete', [$product->id, 'ingredient', $ingredient->id]) }}" onclick="return confirm('{{__('Eintrag entfernen?')}}');"><i class="fa fa-trash-alt"></i></a></td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="form-row">
<div class="form-group col-sm-10">
<label class="form-label" for="title">{{ __('Inhaltsstoffe hinzufügen (Mehrfachauswahl)') }}</label>
<select class="selectpicker" name="product_ingredients[]" id="product_ingredients" data-style="btn-light" data-live-search="false" multiple>
{!! HTMLHelper::getProductIngredientsOptions($product->p_ingredients()->pluck('ingredient_id')->toArray()) !!}
</select>
<a class="btn btn-default btn-xs mt-2" href="{{route('admin_product_ingredients')}}">Inhaltsstoffe anlegen</a>
</div>
<div class="form-group col-sm-2">
<button type="submit" class="btn btn-submit mt-0 mt-sm-4">{{ __('save') }}</button>&nbsp;
</div>
</div>
</div>
</div>
<div class="card mb-2">
<h5 class="card-header bg-primary text-white">
{{ __('Set/Kit Inhalte') }}
@if($product->bundleItems->count() > 0)
<span class="badge badge-primary ml-2">{{ $product->bundleItems->count() }} Produkt(e)</span>
@endif
</h5>
<div class="card-body">
<p class="text-muted small mb-3">
<i class="fa fa-info-circle"></i>
Hier können Sie Produkte definieren, die in diesem Set/Kit enthalten sind.
Diese werden auf Rechnungen und Lieferscheinen unter dem Hauptprodukt aufgelistet.
</p>
@if($product->bundleItems->count() > 0)
<div class="card-datatable table-responsive pt-0">
<table class="datatables-style table table-striped table-bordered">
<thead>
<tr>
<th style="width: 80px">{{__('Art.-Nr.')}}</th>
<th>{{__('Produktname')}}</th>
<th style="width: 100px" class="text-center">{{__('Menge')}}</th>
<th style="width: 100px" class="text-right">{{__('Preis VK')}}</th>
<th style="width: 80px" class="text-center">{{__('Punkte')}}</th>
<th style="width: 50px"></th>
</tr>
</thead>
<tbody>
@foreach($product->bundleItems as $bundleItem)
<tr>
<td>{{ $bundleItem->number }}</td>
<td>{{ $bundleItem->name }}</td>
<td class="text-center">
<input type="hidden" name="bundle_quantities[{{ $bundleItem->id }}][id]" value="{{ $bundleItem->id }}">
<input type="number" name="bundle_quantities[{{ $bundleItem->id }}][qty]"
value="{{ $bundleItem->pivot->quantity }}"
min="1" max="999"
class="form-control form-control-sm text-center"
style="width: 70px; display: inline-block;">
</td>
<td class="text-right">{{ $bundleItem->getFormattedPrice() }} </td>
<td class="text-center">{{ $bundleItem->getFormattedPoints() }}</td>
<td class="text-center">
<a class="text-danger" href="{{ route('admin_product_delete', [$product->id, 'bundle', $bundleItem->id]) }}" onclick="return confirm('{{__('Produkt aus Set entfernen?')}}');">
<i class="fa fa-trash-alt"></i>
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@else
<div class="alert alert-light border mb-3">
<i class="fa fa-box-open text-muted"></i>
Dieses Produkt enthält noch keine Bundle-Produkte.
</div>
@endif
<div class="form-row">
<div class="form-group col-sm-10">
<label class="form-label">{{ __('Produkte zum Set hinzufügen (Mehrfachauswahl)') }}</label>
<select class="selectpicker" name="product_bundles[]" id="product_bundles" data-style="btn-light" data-live-search="true" multiple>
{!! HTMLHelper::getProductBundleOptions($product->bundleItems()->pluck('bundle_product_id')->toArray(), $product->id) !!}
</select>
</div>
<div class="form-group col-sm-2">
<button type="submit" class="btn btn-submit mt-0 mt-sm-4">{{ __('save') }}</button>&nbsp;
</div>
</div>
</div>
</div>
@if(Auth::user()->isSuperAdmin())
<div class="card mb-2">
<h5 class="card-header bg-secondary">
{{ __('SuperAdmin Einstellungen') }}
</h5>
<div class="card-body">
<div class="form-row">
<div class="form-group col-sm-6">
<label class="form-label" for="action">{{ __('Aktion beim Zahlungsprozess') }}</label>
{{ Form::select('action[]', $product->actionNames, $product->action, array('data-live-search'=>'false', 'class'=>'selectpicker', 'id'=>'action', 'multiple') ) }}
</div>
<div class="form-group col-sm-6">
<label class="form-label" for="identifier">{{ __('Anzeigeoptionen Zahlung Mitglieder-Accounts') }}</label>
{{ Form::select('identifier', $product->identifiers_types, $product->identifier, array('data-live-search'=>'false', 'class'=>'selectpicker', 'id'=>'identifier') ) }}
</div>
<div class="form-group col-sm-2">
<label class="form-label" for="upgrade_to_id">{{ __('Bei Upgrade auf ID') }}</label>
{{ Form::text('upgrade_to_id', $product->upgrade_to_id, array('placeholder'=>__('Upgrade-ID'), 'class'=>'form-control', 'id'=>'upgrade_to_id')) }}
</div>
<div class="form-group col-sm-6">
@if($product->action && is_array($product->action))
@foreach ($product->action as $do )
@if($product->getActionName($do) === 'payment_for_shop_upgrade')
<label class="form-label" for="">{{ __('Upgrade auf das Produkt') }} <span class="small">(Wird nach dem Speichern aktualisiert)</span></label>
<div class="mt-2"><strong>{{ $product->getUpgradeToIdName('payment_for_shop_upgrade') }}</strong></div>
@endif
@if($product->getActionName($do) === 'payment_for_lead_upgrade')
<label class="form-label" for="">{{ __('Upgrade auf Karriere Level') }} <span class="small">(Wird nach dem Speichern aktualisiert)</span></label>
<div class="mt-2"><strong>{{ $product->getUpgradeToIdName('payment_for_lead_upgrade') }}</strong></div>
@endif
@endforeach
@endif
</div>
</div>
<div class="form-row">
<div class="form-group col-sm-5">
<label class="form-label" for="wp_number">WP Artikel Number (als Zahl ohne Leerzeichen für die WP-API)</label>
{{ Form::text('wp_number', $product->wp_number, array('placeholder'=>__('WP Number'), 'class'=>'form-control', 'id'=>'wp_number')) }}
</div>
</div>
</div>
</div>
@endif