From b1e9340b42801fffe8e2ec93dc3a3b24b8cddbce Mon Sep 17 00:00:00 2001 From: Josh Crawford Date: Wed, 24 Jul 2024 19:02:16 +1000 Subject: [PATCH 1/3] Fixed saving a code with a decimal value being cast to an int --- src/controllers/CodesController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/CodesController.php b/src/controllers/CodesController.php index 15d2e7c..38cbed7 100755 --- a/src/controllers/CodesController.php +++ b/src/controllers/CodesController.php @@ -112,8 +112,8 @@ public function actionSave(): ?Response $code->id = (int)$request->getBodyParam('codeId'); $code->enabled = (bool)$request->getBodyParam('enabled'); - $code->originalAmount = $request->getBodyParam('originalAmount'); - $code->currentAmount = (int)$request->getBodyParam('currentAmount'); + $code->originalAmount = (float)$request->getBodyParam('originalAmount'); + $code->currentAmount = (float)$request->getBodyParam('currentAmount'); $code->expiryDate = (($date = $request->getParam('expiryDate')) !== false ? (DateTimeHelper::toDateTime($date) ?: null) : $code->expiryDate); if (!$code->originalAmount) { From 1bb685f408693a0a2f62a88a7b1ca0fb544e58a5 Mon Sep 17 00:00:00 2001 From: Josh Crawford Date: Wed, 7 Aug 2024 13:52:01 +1000 Subject: [PATCH 2/3] Update readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 48e2c49..e8a6873 100644 --- a/README.md +++ b/README.md @@ -23,5 +23,5 @@ Get in touch with us via the [Gift Voucher Support page](https://verbb.io/craft-

- + Verbb From 125201841afc8d284994d666b0e5c5e6128348c9 Mon Sep 17 00:00:00 2001 From: Josh Crawford Date: Wed, 7 Aug 2024 13:56:55 +1000 Subject: [PATCH 3/3] Update readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e8a6873..4fb707a 100644 --- a/README.md +++ b/README.md @@ -23,5 +23,5 @@ Get in touch with us via the [Gift Voucher Support page](https://verbb.io/craft-

- Verbb + Verbb