From cb566e554ff16109c7a9d2472dedcca45c3098be Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 26 Sep 2023 15:47:55 +0000 Subject: [PATCH] fix tests --- .github/workflows/main.yml | 12 +++++++++++- Controller/ApiController.php | 9 +++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 53db0e3..f781ee9 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,16 @@ name: CI -on: [push, pull_request] +on: + push: + branches: + - master + - develop + pull_request: + branches: + - master + - develop + schedule: + - cron: '0 0 1,15 * *' jobs: general_module_workflow: diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 2eb2609..4e63e98 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -127,6 +127,7 @@ final class ApiController extends Controller } // @todo: check if old element existex -> removed/changed item + // @todo: we cannot have transaction->to and transaction->from be the id of client/supplier because the IDs can overlap $transaction = new StockMovement(); @@ -152,9 +153,9 @@ final class ApiController extends Controller // Handle to if (($bill->client?->id ?? 0) !== 0) { - $transaction->to = $bill->client->number; + $transaction->to = $bill->client->id; } elseif (($bill->supplier?->id ?? 0) !== 0) { - $transaction->to = $bill->supplier->number; + $transaction->to = $bill->supplier->id; } if ($bill->type->transferType === BillTransferType::SALES) { @@ -165,9 +166,9 @@ final class ApiController extends Controller } else { // Handle from if (($bill->client?->id ?? 0) !== 0) { - $transaction->from = $bill->client->number; + $transaction->from = $bill->client->id; } elseif (($bill->supplier?->id ?? 0) !== 0) { - $transaction->from = $bill->supplier->number; + $transaction->from = $bill->supplier->id; } // Handle to