mirror of
https://github.com/Karaka-Management/oms-StockTaking.git
synced 2026-02-18 18:38:42 +00:00
test fixes
This commit is contained in:
parent
aa2ef25ebc
commit
5108868776
|
|
@ -101,10 +101,9 @@ final class ApiController extends Controller
|
||||||
// It is a little bit unfortunate that we cannot use attributes but it is what it is.
|
// It is a little bit unfortunate that we cannot use attributes but it is what it is.
|
||||||
|
|
||||||
// Get distributions based on type and stock filter
|
// Get distributions based on type and stock filter
|
||||||
$stockTypeList = $request->getDataList('types') ?? [];
|
$stockTypeList = $request->getDataList('types');
|
||||||
$stockList = $request->getDataList('stocks') ?? [];
|
$stockList = $request->getDataList('stocks');
|
||||||
|
|
||||||
$stocks = [];
|
|
||||||
$stockMapper = StockMapper::getAll()
|
$stockMapper = StockMapper::getAll()
|
||||||
->with('locations')
|
->with('locations')
|
||||||
->with('locations/type')
|
->with('locations/type')
|
||||||
|
|
@ -118,6 +117,9 @@ final class ApiController extends Controller
|
||||||
$stockMapper->where('id', $stockList);
|
$stockMapper->where('id', $stockList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @var \Modules\WarehouseManagement\Models\Stock[] $stocks */
|
||||||
|
$stocks = $stockMapper->executeGetArray();
|
||||||
|
|
||||||
foreach ($stocks as $idx => $stock) {
|
foreach ($stocks as $idx => $stock) {
|
||||||
if (empty($stock->locations)) {
|
if (empty($stock->locations)) {
|
||||||
unset($stocks[$idx]);
|
unset($stocks[$idx]);
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||||
* @link https://jingga.app
|
* @link https://jingga.app
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*
|
*
|
||||||
* @template T of Stock
|
* @template T of StockTaking
|
||||||
* @extends DataMapperFactory<T>
|
* @extends DataMapperFactory<T>
|
||||||
*/
|
*/
|
||||||
final class StockTakingMapper extends DataMapperFactory
|
final class StockTakingMapper extends DataMapperFactory
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user