update 20.10.2025
This commit is contained in:
parent
8ccd81b770
commit
a67740d6ef
612 changed files with 84540 additions and 4008 deletions
306
resources/views/admin/dhl/modal_in_shipment_info.blade.php
Normal file
306
resources/views/admin/dhl/modal_in_shipment_info.blade.php
Normal file
|
|
@ -0,0 +1,306 @@
|
|||
{{-- Shipment Information Display when shipments already exist --}}
|
||||
<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 Summary --}}
|
||||
<div class="col-md-6">
|
||||
<h6 class="text-primary mb-3">
|
||||
<i class="fas fa-shipping-fast"></i>
|
||||
Sendungsübersicht
|
||||
</h6>
|
||||
|
||||
<div class="card bg-light">
|
||||
<div class="card-body">
|
||||
<div class="text-center mb-3">
|
||||
<i class="fas fa-box fa-2x text-success"></i>
|
||||
<h5 class="mt-2">{{ count($existingShipments) }} Sendung(en) erstellt</h5>
|
||||
</div>
|
||||
|
||||
<div class="row text-center">
|
||||
<div class="col-6">
|
||||
<small class="text-muted d-block">Letzte Sendung:</small>
|
||||
<strong>{{ date('d.m.Y H:i', strtotime($existingShipments[0]['created_at'])) }}</strong>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<small class="text-muted d-block">Status:</small>
|
||||
<span class="badge badge-{{ $existingShipments[0]['status'] == 'created' ? 'success' : 'warning' }}">
|
||||
{{ $existingShipments[0]['status_translated'] }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
{{-- Shipment Details --}}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h6 class="text-primary mb-3">
|
||||
<i class="fas fa-list"></i>
|
||||
Sendungsdetails
|
||||
</h6>
|
||||
|
||||
@foreach($existingShipments as $index => $shipment)
|
||||
<div class="card mb-3 {{ $shipment['type'] == 'outbound' ? 'border-primary' : 'border-info' }}">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="d-flex justify-content-between align-items-start mb-2">
|
||||
<h6 class="mb-0">
|
||||
@if($shipment['type'] == 'outbound')
|
||||
<i class="fas fa-arrow-right text-primary"></i>
|
||||
Ausgehende Sendung
|
||||
@else
|
||||
<i class="fas fa-undo text-info"></i>
|
||||
Retoure
|
||||
@endif
|
||||
@if($index === 0)
|
||||
<span class="badge badge-primary ml-2">Neueste</span>
|
||||
@endif
|
||||
</h6>
|
||||
<span class="badge badge-{{ $shipment['status'] == 'created' ? 'success' : 'warning' }}">
|
||||
{{ $shipment['status_translated'] }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<small class="text-muted d-block">Sendungsnummer:</small>
|
||||
@if($shipment['shipment_number'])
|
||||
<code class="text-success">{{ $shipment['shipment_number'] }}</code>
|
||||
@else
|
||||
<span class="text-muted">Nicht verfügbar</span>
|
||||
@endif
|
||||
</div>
|
||||
{{--
|
||||
<div class="col-sm-6">
|
||||
<small class="text-muted d-block">Tracking-Nummer:</small>
|
||||
@if($shipment['tracking_number'])
|
||||
<code class="text-info">{{ $shipment['tracking_number'] }}</code>
|
||||
@else
|
||||
<span class="text-muted">Nicht verfügbar</span>
|
||||
@endif
|
||||
</div>
|
||||
--}}
|
||||
<div class="col-sm-6 mt-2">
|
||||
<small class="text-muted d-block">Produktcode:</small>
|
||||
<code>{{ $shipment['product_code'] }}</code>
|
||||
</div>
|
||||
<div class="col-sm-6 mt-2">
|
||||
<small class="text-muted d-block">Gewicht:</small>
|
||||
<strong>{{ number_format($shipment['weight'], 2) }} kg</strong>
|
||||
</div>
|
||||
<div class="col-sm-6 mt-2">
|
||||
<small class="text-muted d-block">Erstellt:</small>
|
||||
<strong>{{ date('d.m.Y H:i', strtotime($shipment['created_at'])) }}</strong>
|
||||
</div>
|
||||
@if($shipment['tracking_status'])
|
||||
<div class="col-sm-6 mt-2">
|
||||
<small class="text-muted d-block">Tracking-Status:</small>
|
||||
<span class="badge badge-info">{{ $shipment['tracking_status_translated'] }}</span>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 text-right">
|
||||
<div class="btn-group-vertical w-100">
|
||||
@if($shipment['label_path'])
|
||||
<a href="{{ route('admin.dhl.download-label', $shipment['id']) }}"
|
||||
class="btn btn-success btn-sm mb-2">
|
||||
<i class="fas fa-download"></i> Label herunterladen
|
||||
</a>
|
||||
@endif
|
||||
|
||||
<a href="{{ route('admin.dhl.show', $shipment['id']) }}"
|
||||
class="btn btn-outline-primary btn-sm mb-2" target="_blank">
|
||||
<i class="fas fa-eye"></i> Details anzeigen
|
||||
</a>
|
||||
{{-- Todo: Add tracking button
|
||||
@if($shipment['can_cancel'])
|
||||
<button type="button"
|
||||
class="btn btn-outline-warning btn-sm mb-2"
|
||||
onclick="cancelShipment({{ $shipment['id'] }})">
|
||||
<i class="fas fa-ban"></i> Stornieren
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if($shipment['type'] == 'outbound' && !$shipment['is_delivered'])
|
||||
<button type="button"
|
||||
class="btn btn-outline-info btn-sm"
|
||||
onclick="createReturnLabel({{ $shipment['id'] }})">
|
||||
<i class="fas fa-undo"></i> Retoure erstellen
|
||||
</button>
|
||||
@endif
|
||||
--}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Action Buttons --}}
|
||||
<div class="row mt-4">
|
||||
<div class="col-12 text-center">
|
||||
<div class="alert alert-info">
|
||||
<i class="fas fa-info-circle"></i>
|
||||
<strong>Hinweis:</strong> Für diese Bestellung wurden bereits DHL-Sendungen erstellt.
|
||||
Sie können weitere Sendungen erstellen oder bestehende verwalten.
|
||||
</div>
|
||||
|
||||
<button type="button"
|
||||
class="btn btn-primary mr-2"
|
||||
onclick="createAdditionalShipment()">
|
||||
<i class="fas fa-plus"></i> Weitere Sendung erstellen
|
||||
</button>
|
||||
|
||||
<a href="{{ route('admin.dhl.cockpit') }}"
|
||||
class="btn btn-outline-secondary">
|
||||
<i class="fas fa-list"></i> Zum DHL-Cockpit
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">
|
||||
<i class="fas fa-times"></i> Schließen
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function cancelShipment(shipmentId) {
|
||||
if (!confirm('Möchten Sie diese Sendung wirklich stornieren?\n\nDieser Vorgang kann nicht rückgängig gemacht werden.')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: `/admin/dhl/shipment/${shipmentId}/cancel`,
|
||||
method: 'DELETE',
|
||||
data: {
|
||||
_token: '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
showAlert('success', response.message);
|
||||
setTimeout(function() {
|
||||
location.reload();
|
||||
}, 2000);
|
||||
} else {
|
||||
showAlert('error', response.message);
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
showAlert('error', 'Fehler beim Stornieren der Sendung.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function createReturnLabel(shipmentId) {
|
||||
if (!confirm('Möchten Sie ein Retourenlabel für diese Sendung erstellen?')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: `/admin/dhl/shipment/${shipmentId}/return-label`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
_token: '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
showAlert('success', response.message);
|
||||
setTimeout(function() {
|
||||
location.reload();
|
||||
}, 2000);
|
||||
} else {
|
||||
showAlert('error', response.message);
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
showAlert('error', 'Fehler beim Erstellen des Retourenlabels.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function createAdditionalShipment() {
|
||||
// Reload modal in create mode
|
||||
$.post('{{ route('modal_load') }}', {
|
||||
action: 'create-dhl-shipment',
|
||||
id: {{ $order->id }},
|
||||
force_create: true,
|
||||
_token: '{{ csrf_token() }}'
|
||||
}).done(function(response) {
|
||||
$('#modals-load-content .modal-dialog').html(response.html);
|
||||
}).fail(function() {
|
||||
alert('Fehler beim Laden des Erstellungsformulars.');
|
||||
});
|
||||
}
|
||||
|
||||
window.showAlert = function(type, message) {
|
||||
var alertClass = type === 'success' ? 'alert-success' : 'alert-danger';
|
||||
var iconClass = type === 'success' ? 'fas fa-check-circle' : 'fas fa-exclamation-circle';
|
||||
|
||||
var alertHtml = `
|
||||
<div class="alert ${alertClass} alert-dismissible fade show" role="alert">
|
||||
<i class="${iconClass}"></i>
|
||||
${message}
|
||||
<button type="button" class="close" data-dismiss="alert">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
`;
|
||||
|
||||
$('.modal-body').prepend(alertHtml);
|
||||
|
||||
// Auto-hide success alerts after 5 seconds
|
||||
if (type === 'success') {
|
||||
setTimeout(function() {
|
||||
$('.alert-success').alert('close');
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize modal
|
||||
$(document).ready(function() {
|
||||
// Modal is ready for interaction
|
||||
});
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue