274 lines
15 KiB
PHP
274 lines
15 KiB
PHP
<form id="modal-create-shipment-form" method="POST" action="{{ route('admin.dhl.store') }}">
|
|
@csrf
|
|
<input type="hidden" name="order_id" value="{{ $order->id }}">
|
|
<input type="hidden" id="dhl-preflight-confirmed" value="0">
|
|
|
|
<div class="modal-body">
|
|
<div class="row">
|
|
{{-- Left Column: Order Info --}}
|
|
<div class="col-md-6">
|
|
<h6 class="text-primary mb-3">
|
|
<i class="fas fa-info-circle"></i>
|
|
Bestellinformationen
|
|
</h6>
|
|
|
|
<div class="card bg-light">
|
|
<div class="card-body">
|
|
<h6 class="card-title">Bestellung #{{ $order->id }}</h6>
|
|
<div class="row">
|
|
<div class="col-6">
|
|
<small class="text-muted d-block">Kunde:</small>
|
|
<strong>{{ $order->shopping_user->billing_firstname ?? '' }}
|
|
{{ $order->shopping_user->billing_lastname ?? '' }}</strong>
|
|
</div>
|
|
<div class="col-6">
|
|
<small class="text-muted d-block">Datum:</small>
|
|
<strong>{{ $order->created_at->format('d.m.Y') }}</strong>
|
|
</div>
|
|
<div class="col-6 mt-2">
|
|
<small class="text-muted d-block">Wert:</small>
|
|
<strong>{{ number_format($order->total, 2, ',', '.') }} €</strong>
|
|
</div>
|
|
<div class="col-6 mt-2">
|
|
<small class="text-muted d-block">Artikel:</small>
|
|
<strong>{{ $order->shopping_order_items->count() }} Stück</strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- Right Column: Shipment Config --}}
|
|
<div class="col-md-6">
|
|
<h6 class="text-primary mb-3">
|
|
<i class="fas fa-cog"></i>
|
|
Sendungskonfiguration
|
|
</h6>
|
|
|
|
<div class="form-group">
|
|
<label for="modal-weight" class="font-weight-semibold">
|
|
<i class="fas fa-weight"></i>
|
|
Gewicht (kg) <span class="text-danger">*</span>
|
|
</label>
|
|
<input type="number" class="form-control" id="modal-weight" name="weight" min="0.1"
|
|
max="31.5" step="0.1" value="{{ number_format($orderWeight, 1) }}" required>
|
|
<small class="form-text text-muted">
|
|
Berechnetes DHL-Gewicht inkl. Kompensationsprodukten: {{ number_format($orderWeight, 3, ',', '.') }} kg
|
|
</small>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="modal-product-code" class="font-weight-semibold">
|
|
<i class="fas fa-cube"></i>
|
|
Produktcode
|
|
</label>
|
|
<select class="form-control custom-select" id="modal-product-code" name="product_code">
|
|
@foreach ($productCodes as $code => $name)
|
|
<option value="{{ $code }}" {{ ($selectedProductCode ?? null) === $code ? 'selected' : '' }}>
|
|
{{ $code }} - {{ $name }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
<small class="form-text text-muted">
|
|
Das Produkt wird anhand des Ziellandes vorgeschlagen und kann bei erlaubten Kombinationen angepasst werden.
|
|
</small>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="modal-priority" class="font-weight-semibold">
|
|
<i class="fas fa-exclamation-triangle"></i>
|
|
Priorität
|
|
</label>
|
|
<select class="form-control custom-select" id="modal-priority" name="priority">
|
|
<option value="normal">Normal</option>
|
|
<option value="high">Hoch</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="custom-control custom-checkbox">
|
|
<input type="checkbox" class="custom-control-input" id="modal-auto-track" name="auto_track"
|
|
value="1" checked>
|
|
<label class="custom-control-label" for="modal-auto-track">
|
|
Automatisches Tracking
|
|
</label>
|
|
</div>
|
|
|
|
<div class="form-group mt-3">
|
|
<label for="modal-reference" class="font-weight-semibold">
|
|
<i class="fas fa-tag"></i>
|
|
Referenz <small class="text-muted">(optional)</small>
|
|
</label>
|
|
<input type="text" class="form-control" id="modal-reference" name="reference"
|
|
value="{{ 'Order-' . $order->id }}" maxlength="35"
|
|
placeholder="z.B. Nachlieferung, Ersatz, Order-{{ $order->id }}">
|
|
<small class="form-text text-muted">
|
|
Wird als DHL refNo uebertragen und an der Sendung gespeichert. Maximal 35 Zeichen.
|
|
</small>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
{{-- Shipping Address Section --}}
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<h6 class="text-primary mb-3">
|
|
<i class="fas fa-map-marker-alt"></i>
|
|
Lieferadresse
|
|
@if (!empty($warnings))
|
|
<small class="text-warning">(Bitte Adresse prüfen)</small>
|
|
@else
|
|
<small class="text-muted">(zur Not anpassbar)</small>
|
|
@endif
|
|
</h6>
|
|
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
<label for="shipping_firstname">Vorname <span class="text-danger">*</span></label>
|
|
<input type="text"
|
|
class="form-control {{ empty($shippingAddress['firstname']) ? 'is-invalid' : '' }}"
|
|
name="shipping_firstname" id="shipping_firstname"
|
|
value="{{ $shippingAddress['firstname'] ?? '' }}" required>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
<label for="shipping_lastname">Nachname <span class="text-danger">*</span></label>
|
|
<input type="text"
|
|
class="form-control {{ empty($shippingAddress['lastname']) ? 'is-invalid' : '' }}"
|
|
name="shipping_lastname" id="shipping_lastname"
|
|
value="{{ $shippingAddress['lastname'] ?? '' }}" required>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="form-group">
|
|
<label for="shipping_company">Firma <small class="text-muted">(optional)</small></label>
|
|
<input type="text" class="form-control" name="shipping_company" id="shipping_company"
|
|
value="{{ $shippingAddress['company'] ?? '' }}">
|
|
</div>
|
|
</div>
|
|
<div class="col-md-8">
|
|
<div class="form-group">
|
|
<label for="shipping_address">Straße <span class="text-danger">*</span></label>
|
|
<input type="text"
|
|
class="form-control {{ empty($shippingAddress['address']) ? 'is-invalid' : '' }}"
|
|
name="shipping_address" id="shipping_address"
|
|
value="{{ $shippingAddress['address'] ?? '' }}" required>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<label for="shipping_houseNumber">Nr./Zusatz <span class="text-danger">*</span></label>
|
|
<input type="text"
|
|
class="form-control {{ empty($shippingAddress['houseNumber']) ? 'border-warning' : '' }}"
|
|
name="shipping_houseNumber" id="shipping_houseNumber"
|
|
value="{{ $shippingAddress['houseNumber'] ?? '' }}" required>
|
|
@if (empty($shippingAddress['houseNumber']))
|
|
<small class="text-warning">Hausnummer benötigt</small>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group">
|
|
<label for="shipping_zipcode">PLZ <span class="text-danger">*</span></label>
|
|
<input type="text"
|
|
class="form-control {{ empty($shippingAddress['zipcode']) ? 'is-invalid' : '' }}"
|
|
name="shipping_zipcode" id="shipping_zipcode"
|
|
value="{{ $shippingAddress['zipcode'] ?? '' }}" required>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-8">
|
|
<div class="form-group">
|
|
<label for="shipping_city">Ort <span class="text-danger">*</span></label>
|
|
<input type="text"
|
|
class="form-control {{ empty($shippingAddress['city']) ? 'is-invalid' : '' }}"
|
|
name="shipping_city" id="shipping_city" value="{{ $shippingAddress['city'] ?? '' }}"
|
|
required>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
<label for="shipping_country">Land <span class="text-danger">*</span></label>
|
|
<select class="form-control custom-select" name="shipping_country_id"
|
|
id="shipping_country" required>
|
|
@foreach ($availableCountries as $countryOption)
|
|
<option value="{{ $countryOption->id }}"
|
|
data-country-code="{{ $countryOption->code }}"
|
|
{{ $shippingAddress['country'] && $shippingAddress['country']->id == $countryOption->id ? 'selected' : '' }}>
|
|
{{ $countryOption->getLocated() }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
<label for="shipping_phone">Telefon <small class="text-muted">(empfohlen)</small></label>
|
|
<input type="text" class="form-control" name="shipping_phone" id="shipping_phone"
|
|
value="{{ $shippingAddress['phone'] ?? '' }}">
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
<label for="shipping_email">E-Mail <span class="text-danger">*</span></label>
|
|
<input type="email"
|
|
class="form-control {{ empty($shippingAddress['email']) ? 'border-warning' : '' }}"
|
|
name="shipping_email"
|
|
id="shipping_email"
|
|
value="{{ $shippingAddress['email'] ?? $order->shopping_user->email ?? '' }}"
|
|
required>
|
|
<small class="form-text text-muted">
|
|
Wird für DHL Benachrichtigungen und Tracking-E-Mails verwendet.
|
|
</small>
|
|
</div>
|
|
</div>
|
|
|
|
{{-- DHL Packstation/Paketbox --}}
|
|
<div class="col-md-12 mt-2">
|
|
<hr>
|
|
<h6 class="text-muted mb-2">
|
|
<i class="fas fa-cube"></i>
|
|
Packstation / Paketbox
|
|
<small class="text-muted">(nur wenn zutreffend)</small>
|
|
</h6>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="form-group">
|
|
<label for="shipping_postnumber">DHL Postnummer <small class="text-muted">(optional)</small></label>
|
|
<input type="text" class="form-control" name="shipping_postnumber" id="shipping_postnumber"
|
|
value="{{ $shippingAddress['postnumber'] ?? '' }}" maxlength="20"
|
|
placeholder="z.B. 12345678">
|
|
<small class="form-text text-muted">
|
|
Nur bei Lieferung an Packstation/Paketbox. Im Feld "Straße" dann "Packstation XXX" eintragen.
|
|
</small>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="dhl-preflight-status" class="card border-secondary mt-3 mb-0">
|
|
<div class="card-header d-flex align-items-center">
|
|
<i class="fas fa-clipboard-check text-secondary mr-2"></i>
|
|
<strong>Vorabprüfung vor Labelerstellung</strong>
|
|
</div>
|
|
<div class="card-body">
|
|
<p class="text-muted mb-0">
|
|
Bitte führen Sie vor der Labelerstellung die Vorabprüfung aus. Dabei werden Produktcode, nationale/internationale Sendungsart und Lieferadresse geprüft.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">
|
|
<i class="fas fa-times"></i> Abbrechen
|
|
</button>
|
|
<button type="submit" class="btn btn-primary" id="create-shipment-btn"
|
|
{{ !empty($errors) ? 'disabled' : '' }}>
|
|
<i class="fas fa-clipboard-check"></i> Vorabprüfung durchführen
|
|
</button>
|
|
</div>
|
|
</form>
|