Live-Stand uebernommen: Uebersetzungen, Seiten, Basis-Migrationen

Beim Umstieg auf Git-Deploy mit dem Live-Server abgeglichen:
- resources/lang/de/website.php (Text Online-Streitbeilegung) und
  resources/lang/es.json (DIV): im Admin auf Live geaendert
- web/templates partner, ueber-uns, erreichbarkeit: lagen nur auf Live,
  ueber SiteController erreichbar, /partner im Footer verlinkt
- Migrationen create_dhl_shipments, create_user_invoice_credits,
  create_users_sales_volumes: auf Live ausgefuehrt, fehlten im Repository

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kevin 2026-10-07 11:22:49 +00:00
parent 3aecdbafec
commit ebf290e343
8 changed files with 675 additions and 124 deletions

View file

@ -0,0 +1,81 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUserInvoiceCreditsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('user_invoice_credits', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('auth_user_id')->index()->nullable();
$table->unsignedInteger('shopping_order_id')->index()->nullable();
$table->unsignedInteger('shopping_user_id')->index()->nullable();
//invoice //credit
$table->string('type', 7)->index();
$table->unsignedTinyInteger('month')->nullable();
$table->unsignedSmallInteger('year')->nullable();
$table->string('full_number', 255)->nullable();
$table->unsignedInteger('number')->nullable();
$table->decimal('net', 13, 2)->nullable();
$table->decimal('tax_rate', 8, 2)->nullable();
$table->decimal('tax', 8, 2)->nullable();
$table->decimal('total', 13, 2)->nullable();
$table->text('file')->nullable();
$table->text('contents')->nullable();
$table->text('infos')->nullable();
$table->string('subject')->nullable();
$table->text('address')->nullable();
$table->boolean('paid')->default(false);
$table->date('paid_date')->nullable();
$table->unsignedInteger('cancellation_id')->nullable();
$table->date('cancellation_date')->nullable();
$table->unsignedTinyInteger('status')->index()->default(0);
$table->timestamps();
$table->softDeletes();
$table->foreign('auth_user_id')
->references('id')
->on('users');
$table->foreign('shopping_order_id')
->references('id')
->on('shopping_orders');
$table->foreign('shopping_user_id')
->references('id')
->on('shopping_users');
$table->foreign('cancellation_id')
->references('id')
->on('user_invoice_credits');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('user_invoice_credits');
}
}

View file

@ -0,0 +1,56 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersSalesVolumesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users_sales_volumes', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id');
$table->unsignedInteger('shopping_order_id')->index()->nullable();
$table->unsignedTinyInteger('month')->nullable();
$table->unsignedSmallInteger('year')->nullable();
$table->date('date')->nullable();
$table->unsignedInteger('points')->nullable();
$table->unsignedInteger('month_points')->nullable();
$table->decimal('total_net', 13, 2)->nullable();
$table->decimal('month_total_net', 13, 2)->nullable();
$table->string('message', 255)->nullable();
$table->unsignedTinyInteger('status')->index()->default(0);
$table->timestamps();
$table->foreign('user_id')
->references('id')
->on('users');
$table->foreign('shopping_order_id')
->references('id')
->on('shopping_orders');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users_sales_volumes');
}
}

View file

@ -0,0 +1,109 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('dhl_shipments', function (Blueprint $table) {
$table->id();
// Relationship zu ShoppingOrder
$table->unsignedInteger('shopping_order_id'); // int(10) unsigned to match shopping_orders.id
$table->foreign('shopping_order_id')->references('id')->on('shopping_orders')->onDelete('cascade');
// DHL Shipment Daten
$table->string('shipment_number')->nullable(); // DHL Sendungsnummer
$table->string('tracking_number')->nullable(); // DHL Tracking-Nummer (kann identisch sein)
// Sendungstyp: 'outbound' (regulär) oder 'return' (Retoure)
$table->enum('type', ['outbound', 'return'])->default('outbound');
// Für Retouren: Verweis auf ursprüngliche Sendung
$table->unsignedBigInteger('related_shipment_id')->nullable(); // id() uses bigInteger
$table->foreign('related_shipment_id')->references('id')->on('dhl_shipments')->onDelete('set null');
// Paketdaten
$table->decimal('weight', 8, 2)->default(1.0); // in kg
$table->integer('length')->nullable(); // in cm
$table->integer('width')->nullable(); // in cm
$table->integer('height')->nullable(); // in cm
// DHL Service-Optionen
$table->string('product_code')->default('V01PAK'); // V01PAK = DHL Paket
$table->json('services')->nullable(); // Zusätzliche Services (Premium, etc.)
// Labels und Dokumente
$table->string('label_path')->nullable(); // Pfad zum generierten Label
$table->string('label_format')->default('PDF'); // PDF oder ZPL
$table->boolean('label_printed')->default(false);
// Status-Management
$table->enum('status', [
'created', // Sendung erstellt, noch nicht bei DHL
'submitted', // An DHL übertragen
'in_transit', // Unterwegs
'delivered', // Zugestellt
'returned', // Zurückgeschickt
'cancelled', // Storniert
'failed' // Fehler bei Erstellung/Übertragung
])->default('created');
// Tracking-Status (von DHL API)
$table->string('tracking_status')->nullable();
$table->text('tracking_details')->nullable(); // JSON für detaillierte Tracking-Info
$table->timestamp('last_tracked_at')->nullable();
// Empfängeradresse (Kopie für Archivierung)
$table->string('recipient_name');
$table->string('recipient_company')->nullable();
$table->string('recipient_street');
$table->string('recipient_street_number');
$table->string('recipient_postal_code');
$table->string('recipient_city');
$table->string('recipient_state')->nullable();
$table->string('recipient_country', 2)->default('DE');
$table->string('recipient_email')->nullable();
$table->string('recipient_phone')->nullable();
// API Response Data (für Debugging und Audit)
$table->json('api_request_data')->nullable(); // Gesendete Daten
$table->json('api_response_data')->nullable(); // Empfangene Antwort
$table->text('api_errors')->nullable(); // Fehlermeldungen
// Kosten und Abrechnung
$table->decimal('shipping_cost', 10, 2)->nullable(); // Versandkosten
$table->string('currency', 3)->default('EUR');
// Zusätzliche Metadaten
$table->text('notes')->nullable(); // Interne Notizen
$table->json('metadata')->nullable(); // Flexible zusätzliche Daten
// Timestamps
$table->timestamp('shipped_at')->nullable(); // Wann wurde versendet
$table->timestamp('delivered_at')->nullable(); // Wann zugestellt
$table->timestamps();
// Indizes für Performance
$table->index('shopping_order_id');
$table->index('shipment_number');
$table->index('tracking_number');
$table->index(['type', 'status']);
$table->index('created_at');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('dhl_shipments');
}
};