From aaefe7dc51a95c0ed204ed1632aeeaf8cae3c466 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 7 Feb 2025 14:21:59 +0100 Subject: [PATCH] Extend incoming for better usage. --- .../Controllers/Api/SupplierController.php | 17 +++++ app/Models/Incomingtax.php | 13 ++++ lang/de/incoming.php | 2 + resources/views/incoming/create.blade.php | 55 ++++++++++++-- resources/views/incoming/edit.blade.php | 74 ++++++++++++++++--- routes/api.php | 2 + 6 files changed, 147 insertions(+), 16 deletions(-) create mode 100644 app/Http/Controllers/Api/SupplierController.php diff --git a/app/Http/Controllers/Api/SupplierController.php b/app/Http/Controllers/Api/SupplierController.php new file mode 100644 index 0000000..b40d4a7 --- /dev/null +++ b/app/Http/Controllers/Api/SupplierController.php @@ -0,0 +1,17 @@ +get(); + return response()->json($suppliers); + } + +} diff --git a/app/Models/Incomingtax.php b/app/Models/Incomingtax.php index b104bb7..8284a18 100644 --- a/app/Models/Incomingtax.php +++ b/app/Models/Incomingtax.php @@ -22,6 +22,19 @@ class Incomingtax extends Model 'currency', ]; + /** + * The attributes that are appended with attribute getters. + * + * @var string[] + */ + protected $appends = [ + 'gross', + ]; + + public function getGrossAttribute() { + return number_format($this->taxable_amount + $this->amount, 2); + } + /** * Get the incoming invoice this tax belongs to. */ diff --git a/lang/de/incoming.php b/lang/de/incoming.php index c579f95..51943c0 100644 --- a/lang/de/incoming.php +++ b/lang/de/incoming.php @@ -23,5 +23,7 @@ return [ 'Existing invoices' => 'Bestehende Eingangsrechnungen', 'Edit incoming' => 'Bestehende Eingangsrechnungen bearbeiten', 'Incoming data' => 'Daten der Eingangsrechnung', + 'Select supplier' => 'Lieferant wählen', + 'Create incoming' => 'Neue Eingangsrechnung anlegen', ]; diff --git a/resources/views/incoming/create.blade.php b/resources/views/incoming/create.blade.php index 4631498..5ccb781 100644 --- a/resources/views/incoming/create.blade.php +++ b/resources/views/incoming/create.blade.php @@ -1,7 +1,7 @@

- {{ __('incoming.Edit incoming') }} + {{ __('incoming.Create incoming') }}

@@ -105,8 +105,18 @@
+
+ + +
+
-
+
+ @@ -211,14 +222,19 @@
-
@@ -290,29 +299,30 @@
+ - +