fix tests

This commit is contained in:
Dennis Eichhorn 2023-09-26 15:47:55 +00:00
parent 36ff0332b2
commit cb566e554f
2 changed files with 16 additions and 5 deletions

View File

@ -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:

View File

@ -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