From fe4e0bd3a118484b74e37b7384d8377a109702d4 Mon Sep 17 00:00:00 2001 From: Rob Van Keilegom Date: Wed, 3 Jul 2024 20:01:34 +0200 Subject: [PATCH] :sparkles: #24 - Add option to disable tags --- app/Firefly.php | 5 ++++- config/app.php | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Firefly.php b/app/Firefly.php index 4a66c5b..2ac26d5 100644 --- a/app/Firefly.php +++ b/app/Firefly.php @@ -186,11 +186,14 @@ public function push(Transaction $transaction): bool // 'destination_name' =>, 'notes' => $transaction->description, 'external_id' => $transaction->pp_id, - 'tags' => [$this->tag], ], ], ]; + if (config('app.enable_tags')) { + $data['transactions'][0]['tags'] = [$this->tag]; + } + if (! is_null($conversion)) { $data['transactions'][0]['foreign_amount'] = abs($conversion->value); $data['transactions'][0]['foreign_currency_code'] = $conversion->currency; diff --git a/config/app.php b/config/app.php index a6be6f5..ae9947d 100644 --- a/config/app.php +++ b/config/app.php @@ -4,4 +4,6 @@ 'version' => '0.3.4', 'currency' => env('CURRENCY', 'EUR'), + + 'enable_tags' => env('ENABLE_TAGS', true), ];