diff --git a/app/Http/Controllers/CustomerController.php b/app/Http/Controllers/CustomerController.php index 76526d3..703c66c 100644 --- a/app/Http/Controllers/CustomerController.php +++ b/app/Http/Controllers/CustomerController.php @@ -4,7 +4,7 @@ use App\Models\Customer; use App\Support\ApiDataTransformer; -use Pest\ArchPresets\Custom; +use Illuminate\Support\Facades\Storage; class CustomerController extends Controller { @@ -51,4 +51,20 @@ public static function generateCustomerNumber() } } } + + // // Beispiel für das Hochladen eines Kundenlogos + // if ($request->hasFile('customer_logo')) { + // $path = $request->file('customer_logo')->store('customer_logos', 'public'); + // // Speichere den Pfad in der Datenbank + // $customer->logo_path = $path; + // $customer->save(); + // } + + // // Beispiel für das Hochladen eines Kontakt-Avatars + // if ($request->hasFile('contact_avatar')) { + // $path = $request->file('contact_avatar')->store('contact_avatars', 'public'); + // // Speichere den Pfad in der Datenbank + // $contact->avatar_path = $path; + // $contact->save(); + // } } diff --git a/app/Models/Customer.php b/app/Models/Customer.php index 5121d83..c743f00 100644 --- a/app/Models/Customer.php +++ b/app/Models/Customer.php @@ -21,6 +21,7 @@ class Customer extends Model 'tax_id', // Tax identification number 'global_id', // Global Location Number (GLN) or other identification 'legal_registration_id', // Legal registration ID + 'url', 'email', 'phone', 'billing_address', diff --git a/database/factories/CustomerFactory.php b/database/factories/CustomerFactory.php index 614e944..1583f02 100644 --- a/database/factories/CustomerFactory.php +++ b/database/factories/CustomerFactory.php @@ -19,6 +19,7 @@ public function definition() 'tax_id' => $this->faker->numerify('DE##########'), 'global_id' => $this->faker->numerify('############'), 'legal_registration_id' => $this->faker->numerify('##########'), + 'url' => $this->faker->url(), 'email' => $this->faker->unique()->safeEmail(), 'phone' => $this->faker->phoneNumber(), 'billing_address' => [ diff --git a/database/migrations/2025_09_17_000000_create_customers_table.php b/database/migrations/2025_09_17_000000_create_customers_table.php index d934626..84b18c4 100644 --- a/database/migrations/2025_09_17_000000_create_customers_table.php +++ b/database/migrations/2025_09_17_000000_create_customers_table.php @@ -16,6 +16,7 @@ public function up() $table->string('tax_id', 50)->nullable(); $table->string('global_id', 50)->nullable(); $table->string('legal_registration_id', 50)->nullable(); + $table->string('url', 100)->nullable(); $table->string('email', 100)->nullable(); $table->string('phone', 20)->nullable(); $table->json('billing_address')->nullable(); diff --git a/resources/css/app.css b/resources/css/app.css index 25a311c..f957684 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -111,7 +111,7 @@ :root { --secondary-foreground: hsl(0 0% 9%); --muted: var(--color-slate-50); --muted-foreground: var(--color-slate-400); - --accent: var(--color-slate-100); + --accent: var(--color-stone-50); --accent-foreground: hsl(0 0% 9%); --destructive: var(--color-red-500); --destructive-foreground: hsl(0 0% 98%); diff --git a/resources/js/components/AppSidebar.vue b/resources/js/components/AppSidebar.vue index fa3cb49..6e5df03 100644 --- a/resources/js/components/AppSidebar.vue +++ b/resources/js/components/AppSidebar.vue @@ -86,13 +86,13 @@ const footerNavItems: NavItem[] = [ - + - + diff --git a/resources/js/components/CustomerDialog.vue b/resources/js/components/CustomerDialog.vue index 83f76ee..f4fa69d 100644 --- a/resources/js/components/CustomerDialog.vue +++ b/resources/js/components/CustomerDialog.vue @@ -34,12 +34,12 @@ watch(() => props.customerData as Customer, isDirty.value = false isLoading.value = true - console.log("customerData", "Dirty: " + isDirty.value, "loading: " + isLoading.value) + // console.log("customerData", "Dirty: " + isDirty.value, "loading: " + isLoading.value) } ) watch(customer, (newValue) => { - console.log(newValue) + // console.log(newValue) }) const saveChanges = () => { @@ -101,7 +101,7 @@ const cancelChanges = (event: Event | null) => {
-
Edit profile @@ -110,6 +110,14 @@ const cancelChanges = (event: Event | null) => {
+ +
+ Customer Form hier +
+ +
+ Contacts hier +
diff --git a/resources/js/components/documents/InvoiceDialog.vue b/resources/js/components/documents/InvoiceDialog.vue index 2281251..0ef82bc 100644 --- a/resources/js/components/documents/InvoiceDialog.vue +++ b/resources/js/components/documents/InvoiceDialog.vue @@ -84,8 +84,10 @@ watch(invoice, (newValue, oldValue) => { if (isLoading.value) { + if (!invoice.value) return; + // Initial load of invoice data - if (invoice.value && !invoice.value.billingData) { + if (!invoice.value.billingData) { // Set default billing data from customer invoice.value.billingData = { companyName: invoice.value.customer?.companyName || "", @@ -104,7 +106,7 @@ watch(invoice, } } - if (invoice.value && invoice.value.customer?.id !== 0) { + if (invoice.value.customer?.id !== 0) { importCustomer.value = invoice.value.customer as Customer // console.log("billingData contact", invoice.value?.billingData?.contactFirstName, invoice.value?.billingData?.contactLastName) @@ -120,7 +122,6 @@ watch(invoice, } value.value = fromDate(new Date(invoice.value.invoiceDate), getLocalTimeZone()) - } else { isDirty.value = true diff --git a/resources/js/components/documents/LineItemTable.vue b/resources/js/components/documents/LineItemTable.vue index 016e50f..274106f 100644 --- a/resources/js/components/documents/LineItemTable.vue +++ b/resources/js/components/documents/LineItemTable.vue @@ -133,7 +133,7 @@ const recalculatePositions = () => { - diff --git a/resources/js/components/ui/alert-dialog/AlertDialogContent.vue b/resources/js/components/ui/alert-dialog/AlertDialogContent.vue index 3fbbb50..b9c6f5d 100644 --- a/resources/js/components/ui/alert-dialog/AlertDialogContent.vue +++ b/resources/js/components/ui/alert-dialog/AlertDialogContent.vue @@ -28,7 +28,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits) v-bind="forwarded" :class=" cn( - 'fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-bottom-[5%] data-[state=open]:slide-in-from-bottom-[5%] sm:rounded-lg', + 'fixed left-1/2 top-1/2 z-50 grid max-w-lg -translate-x-1/2 -translate-y-1/2 gap-8 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-bottom-[5%] data-[state=open]:slide-in-from-bottom-[5%] sm:rounded-lg', props.class, ) " diff --git a/resources/js/components/ui/number-input/NumberInput.vue b/resources/js/components/ui/number-input/NumberInput.vue index ec46787..0c43b39 100644 --- a/resources/js/components/ui/number-input/NumberInput.vue +++ b/resources/js/components/ui/number-input/NumberInput.vue @@ -56,7 +56,7 @@ export default defineComponent({