April 2026 waren Wirtschaft Feedback
This commit is contained in:
parent
02f2a4c23e
commit
9ce711d6b2
167 changed files with 25278 additions and 8518 deletions
|
|
@ -1,14 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\User;
|
||||
use App\Services\Invoice;
|
||||
use App\Models\ShoppingOrder;
|
||||
use App\Services\Invoice;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Storage;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
||||
class MailLogistic extends Mailable
|
||||
{
|
||||
|
|
@ -18,65 +17,66 @@ class MailLogistic extends Mailable
|
|||
|
||||
public $subject;
|
||||
|
||||
|
||||
public function __construct(ShoppingOrder $shopping_order)
|
||||
{
|
||||
$this->shopping_order = $shopping_order;
|
||||
$name = $shopping_order->shopping_user->billing_firstname . ' ' . $shopping_order->shopping_user->billing_lastname;
|
||||
$name = $shopping_order->shopping_user->billing_firstname.' '.$shopping_order->shopping_user->billing_lastname;
|
||||
$company = $shopping_order->shopping_user->billing_company ?? '';
|
||||
|
||||
$hasWhiteLabel = $shopping_order->user_white_label || $shopping_order->hasWhitelabelProducts();
|
||||
|
||||
$this->subject = 'Partner';
|
||||
if($shopping_order->user_white_label){
|
||||
//Bei allen, die ein eigenes Logo haben
|
||||
if ($hasWhiteLabel) {
|
||||
// Bei allen, die ein eigenes Logo haben
|
||||
$this->subject .= ' (mit Logo)';
|
||||
}else{
|
||||
//Bei allen, die kein Tattoostudio sind
|
||||
} else {
|
||||
// Bei allen, die kein Tattoostudio sind
|
||||
$this->subject = ' - ';
|
||||
}
|
||||
if($shopping_order->shopping_user->same_as_billing){
|
||||
//Rechnungsadresse und Lieferadresse sind gleich
|
||||
if ($shopping_order->shopping_user->same_as_billing) {
|
||||
// Rechnungsadresse und Lieferadresse sind gleich
|
||||
$this->subject = '';
|
||||
}else{
|
||||
//hat eine andere Lieferadresse
|
||||
} else {
|
||||
// hat eine andere Lieferadresse
|
||||
$this->subject = ' Lieferadresse';
|
||||
}
|
||||
$this->subject .= ' '.$company.' (' . $name . ')';
|
||||
$this->subject .= ' '.$company.' ('.$name.')';
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function build()
|
||||
{
|
||||
$title = false;
|
||||
$title = false;
|
||||
$copy1line = false;
|
||||
|
||||
$filename = Invoice::getFilename($this->shopping_order);
|
||||
$filename = Invoice::getFilename($this->shopping_order);
|
||||
$path = Invoice::getDownloadPath($this->shopping_order);
|
||||
if (!Storage::disk('public')->exists($path)) {
|
||||
if (! Storage::disk('public')->exists($path)) {
|
||||
return;
|
||||
}
|
||||
$file = Storage::disk('public')->path($path);
|
||||
$mime = Storage::disk('public')->mimeType($path);
|
||||
|
||||
|
||||
$mail = $this->view('emails.logistic')->with([
|
||||
'title' => $title,
|
||||
'copy1line' => $copy1line,
|
||||
])->attach($file,[
|
||||
'copy1line' => $copy1line,
|
||||
])->attach($file, [
|
||||
'as' => $filename,
|
||||
'mime' => $mime,
|
||||
]);
|
||||
|
||||
//Wenn das Logo gesetzt ist und die Rechnungsadresse und Lieferadresse unterschiedlich sind, dann wird der Lieferschein angehängt
|
||||
if($this->shopping_order->user_white_label && !$this->shopping_order->shopping_user->same_as_billing){
|
||||
|
||||
// Wenn mindestens ein White-Label-Produkt enthalten ist, wird der Lieferschein (Etikett-Infos) mit angehängt
|
||||
$hasWhiteLabel = $this->shopping_order->user_white_label || $this->shopping_order->hasWhitelabelProducts();
|
||||
if ($hasWhiteLabel) {
|
||||
$filenameDelivery = Invoice::getDeliveryFilename($this->shopping_order);
|
||||
$pathDelivery = Invoice::getDownloadPathDelivery($this->shopping_order);
|
||||
if (!Storage::disk('public')->exists($pathDelivery)) {
|
||||
if (! Storage::disk('public')->exists($pathDelivery)) {
|
||||
return;
|
||||
}
|
||||
$fileDelivery = Storage::disk('public')->path($pathDelivery);
|
||||
$mimeDelivery = Storage::disk('public')->mimeType($pathDelivery);
|
||||
|
||||
$mail->attach($fileDelivery,[
|
||||
$mail->attach($fileDelivery, [
|
||||
'as' => $filenameDelivery,
|
||||
'mime' => $mimeDelivery,
|
||||
]); // attach file;
|
||||
|
|
@ -84,4 +84,4 @@ class MailLogistic extends Mailable
|
|||
|
||||
return $mail;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue