23-01-2026
This commit is contained in:
parent
a939cd51ef
commit
a8b395e20d
248 changed files with 29342 additions and 4805 deletions
|
|
@ -4,11 +4,11 @@
|
|||
|
||||
<div class="d-flex justify-content-between align-items-center py-2 mb-4">
|
||||
<h4 class="font-weight-bold mb-0">
|
||||
<i class="fas fa-box text-primary"></i>
|
||||
<i class="fas fa-box {{ $shipment->type == 'return' ? 'text-warning' : 'text-primary' }}"></i>
|
||||
DHL Sendung #{{ $shipment->id }}
|
||||
@if($shipment->type == 'return')
|
||||
<span class="badge badge-info ml-2">
|
||||
<i class="fas fa-undo"></i> Retoure
|
||||
<span class="badge badge-warning ml-2" style="font-size: 1rem; font-weight: 700; padding: 0.5rem 1rem;">
|
||||
<i class="fas fa-undo"></i> RETOURE
|
||||
</span>
|
||||
@endif
|
||||
</h4>
|
||||
|
|
@ -157,17 +157,8 @@
|
|||
<i class="fas fa-download"></i> Label herunterladen
|
||||
</a>
|
||||
@endif
|
||||
{{-- Todo: Add tracking button
|
||||
@if($shipment->canCancel())
|
||||
<button type="button"
|
||||
class="btn btn-warning mr-2"
|
||||
id="cancel-shipment-btn"
|
||||
data-shipment-id="{{ $shipment->id }}">
|
||||
<i class="fas fa-ban"></i> Sendung stornieren
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if($shipment->type == 'outbound' && !$shipment->relatedShipment)
|
||||
@if($shipment->type == 'outbound' && !$shipment->returns->count())
|
||||
<button type="button"
|
||||
class="btn btn-info mr-2"
|
||||
id="create-return-btn"
|
||||
|
|
@ -175,14 +166,23 @@
|
|||
<i class="fas fa-undo"></i> Retourenlabel erstellen
|
||||
</button>
|
||||
@endif
|
||||
--}}
|
||||
@if($shipment->dhl_shipment_no)
|
||||
<button type="button"
|
||||
class="btn btn-secondary mr-2"
|
||||
<button type="button"
|
||||
class="btn btn-secondary mr-2"
|
||||
id="update-tracking-btn"
|
||||
data-shipment-id="{{ $shipment->id }}">
|
||||
<i class="fas fa-sync"></i> Tracking aktualisieren
|
||||
</button>
|
||||
|
||||
@if($shipment->canSendTrackingEmail())
|
||||
<button type="button"
|
||||
class="btn {{ $shipment->wasTrackingEmailSent() ? 'btn-success' : 'btn-info' }} mr-2"
|
||||
id="send-tracking-email-btn"
|
||||
data-shipment-id="{{ $shipment->id }}">
|
||||
<i class="fas fa-envelope"></i>
|
||||
{{ $shipment->wasTrackingEmailSent() ? 'Tracking-E-Mail erneut senden' : 'Tracking-E-Mail senden' }}
|
||||
</button>
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -345,6 +345,14 @@
|
|||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@if($shipment->recipient && isset($shipment->recipient['street']))
|
||||
<tr>
|
||||
<td class="font-weight-semibold">Straße:</td>
|
||||
<td>
|
||||
{{ $shipment->recipient['street'] }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
<tr>
|
||||
<td class="font-weight-semibold">Straße:</td>
|
||||
<td>
|
||||
|
|
@ -492,6 +500,42 @@
|
|||
<div class="col-lg-4">
|
||||
|
||||
|
||||
<!-- Email Status -->
|
||||
@if($shipment->dhl_shipment_no)
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">
|
||||
<i class="fas fa-envelope text-{{ $shipment->wasTrackingEmailSent() ? 'success' : 'secondary' }}"></i>
|
||||
Tracking-E-Mail Status
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if($shipment->wasTrackingEmailSent())
|
||||
<div class="alert alert-success mb-0">
|
||||
<i class="fas fa-check-circle"></i>
|
||||
<strong>E-Mail gesendet</strong><br>
|
||||
<small>
|
||||
Am {{ $shipment->tracking_email_sent_at->format('d.m.Y \u\m H:i') }} Uhr
|
||||
({{ $shipment->tracking_email_type === 'auto' ? 'automatisch' : 'manuell' }})
|
||||
</small>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-secondary mb-0">
|
||||
<i class="fas fa-clock"></i>
|
||||
<strong>Noch nicht gesendet</strong><br>
|
||||
<small>
|
||||
@if($shipment->canSendTrackingEmail())
|
||||
Klicken Sie auf "Tracking-E-Mail senden" um den Kunden zu benachrichtigen.
|
||||
@else
|
||||
E-Mail kann nicht gesendet werden (keine Empfänger-E-Mail verfügbar).
|
||||
@endif
|
||||
</small>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Tracking Information -->
|
||||
@if($shipment->tracking_status || $shipment->dhl_shipment_no)
|
||||
<div class="card mb-4">
|
||||
|
|
@ -709,6 +753,42 @@ $(document).ready(function() {
|
|||
});
|
||||
});
|
||||
|
||||
// Send tracking email
|
||||
$('#send-tracking-email-btn').click(function() {
|
||||
var shipmentId = $(this).data('shipment-id');
|
||||
var btn = $(this);
|
||||
|
||||
if (!confirm('Tracking-E-Mail an den Kunden senden?')) {
|
||||
return;
|
||||
}
|
||||
|
||||
btn.prop('disabled', true).html('<i class="fas fa-spinner fa-spin"></i> Wird gesendet...');
|
||||
|
||||
$.ajax({
|
||||
url: `/admin/dhl/shipment/${shipmentId}/send-tracking-email`,
|
||||
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);
|
||||
resetButton(btn, '<i class="fas fa-envelope"></i> Tracking-E-Mail senden');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
var errorMsg = xhr.responseJSON ? xhr.responseJSON.message : 'Fehler beim Senden der Tracking-E-Mail.';
|
||||
showAlert('error', errorMsg);
|
||||
resetButton(btn, '<i class="fas fa-envelope"></i> Tracking-E-Mail senden');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Helper functions
|
||||
function resetButton(btn, originalText) {
|
||||
btn.prop('disabled', false).html(originalText);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue