2018-04-11 19:49:35 +02:00
< ? php
namespace Grocy\Controllers ;
2021-06-12 17:21:12 +02:00
use Grocy\Helpers\Grocycode ;
2020-10-31 10:25:33 -05:00
use Grocy\Services\RecipesService ;
2025-01-12 13:58:47 +01:00
use DI\Container ;
2023-05-13 14:43:51 +02:00
use Psr\Http\Message\ResponseInterface as Response ;
use Psr\Http\Message\ServerRequestInterface as Request ;
2020-10-31 10:25:33 -05:00
2018-04-11 19:49:35 +02:00
class StockController extends BaseController
{
2021-07-16 17:32:08 +02:00
use GrocycodeTrait ;
2025-01-12 13:58:47 +01:00
public function __construct ( Container $container )
{
parent :: __construct ( $container );
try
{
$externalBarcodeLookupPluginName = $this -> getStockService () -> GetExternalBarcodeLookupPluginName ();
}
catch ( \Exception )
{
$externalBarcodeLookupPluginName = '' ;
}
finally
{
$this -> View -> set ( 'ExternalBarcodeLookupPluginName' , $externalBarcodeLookupPluginName );
}
}
2023-05-13 14:43:51 +02:00
public function Consume ( Request $request , Response $response , array $args )
2018-04-11 19:49:35 +02:00
{
2020-03-01 23:47:47 +07:00
return $this -> renderPage ( $response , 'consume' , [
2021-07-06 19:31:55 +02:00
'products' => $this -> getDatabase () -> products () -> where ( 'active = 1' ) -> where ( 'id IN (SELECT product_id from stock_current WHERE amount_aggregated > 0)' ) -> orderBy ( 'name' ),
2020-12-20 16:00:14 +01:00
'barcodes' => $this -> getDatabase () -> product_barcodes_comma_separated (),
2020-11-17 19:11:02 +01:00
'recipes' => $this -> getDatabase () -> recipes () -> where ( 'type' , RecipesService :: RECIPE_TYPE_NORMAL ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'locations' => $this -> getDatabase () -> locations () -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'quantityUnits' => $this -> getDatabase () -> quantity_units () -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2023-08-06 13:28:14 +02:00
'quantityUnitConversionsResolved' => $this -> getDatabase () -> cache__quantity_unit_conversions_resolved ()
2018-04-11 19:49:35 +02:00
]);
}
2023-05-13 14:43:51 +02:00
public function Inventory ( Request $request , Response $response , array $args )
2018-04-11 19:49:35 +02:00
{
2020-03-01 23:47:47 +07:00
return $this -> renderPage ( $response , 'inventory' , [
2022-04-01 18:49:17 +02:00
'products' => $this -> getDatabase () -> products () -> where ( 'active = 1 AND no_own_stock = 0' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-12-20 16:00:14 +01:00
'barcodes' => $this -> getDatabase () -> product_barcodes_comma_separated (),
2023-05-13 14:24:52 +02:00
'shoppinglocations' => $this -> getDatabase () -> shopping_locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'locations' => $this -> getDatabase () -> locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-11-17 19:11:02 +01:00
'quantityUnits' => $this -> getDatabase () -> quantity_units () -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2023-08-06 13:28:14 +02:00
'quantityUnitConversionsResolved' => $this -> getDatabase () -> cache__quantity_unit_conversions_resolved (),
2022-03-30 17:32:53 +02:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'stock' )
2018-04-11 19:49:35 +02:00
]);
}
2023-05-13 14:43:51 +02:00
public function Journal ( Request $request , Response $response , array $args )
2019-12-19 12:48:36 -06:00
{
2021-07-13 19:29:23 +02:00
if ( isset ( $request -> getQueryParams ()[ 'months' ]) && filter_var ( $request -> getQueryParams ()[ 'months' ], FILTER_VALIDATE_INT ) !== false )
{
$months = $request -> getQueryParams ()[ 'months' ];
$where = " row_created_timestamp > DATE(DATE('now', 'localtime'), '- $months months') " ;
}
else
{
// Default 6 months
$where = " row_created_timestamp > DATE(DATE('now', 'localtime'), '-6 months') " ;
}
if ( isset ( $request -> getQueryParams ()[ 'product' ]) && filter_var ( $request -> getQueryParams ()[ 'product' ], FILTER_VALIDATE_INT ) !== false )
{
$productId = $request -> getQueryParams ()[ 'product' ];
$where .= " AND product_id = $productId " ;
}
2020-11-17 19:11:02 +01:00
$usersService = $this -> getUsersService ();
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'stockjournal' , [
2021-07-13 19:29:23 +02:00
'stockLog' => $this -> getDatabase () -> uihelper_stock_journal () -> where ( $where ) -> orderBy ( 'row_created_timestamp' , 'DESC' ),
2020-11-17 19:11:02 +01:00
'products' => $this -> getDatabase () -> products () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'locations' => $this -> getDatabase () -> locations () -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'users' => $usersService -> GetUsersAsDto (),
2022-03-30 17:32:53 +02:00
'transactionTypes' => GetClassConstants ( '\Grocy\Services\StockService' , 'TRANSACTION_TYPE_' ),
'userfieldsStock' => $this -> getUserfieldsService () -> GetFields ( 'stock' ),
'userfieldValuesStock' => $this -> getUserfieldsService () -> GetAllValues ( 'stock' )
2019-12-19 12:48:36 -06:00
]);
}
2023-05-13 14:43:51 +02:00
public function LocationContentSheet ( Request $request , Response $response , array $args )
2018-04-11 19:49:35 +02:00
{
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'locationcontentsheet' , [
2020-11-17 19:11:02 +01:00
'products' => $this -> getDatabase () -> products () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'quantityunits' => $this -> getDatabase () -> quantity_units () -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'locations' => $this -> getDatabase () -> locations () -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2022-04-01 21:55:06 +02:00
'currentStockLocationContent' => $this -> getStockService () -> GetCurrentStockLocationContent ( isset ( $request -> getQueryParams ()[ 'include_out_of_stock' ]))
2018-04-11 19:49:35 +02:00
]);
}
2023-05-13 14:43:51 +02:00
public function LocationEditForm ( Request $request , Response $response , array $args )
2018-10-20 14:55:49 +02:00
{
2020-08-31 20:40:31 +02:00
if ( $args [ 'locationId' ] == 'new' )
{
return $this -> renderPage ( $response , 'locationform' , [
'mode' => 'create' ,
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'locations' )
]);
}
else
{
return $this -> renderPage ( $response , 'locationform' , [
'location' => $this -> getDatabase () -> locations ( $args [ 'locationId' ]),
'mode' => 'edit' ,
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'locations' )
]);
}
2018-10-20 14:55:49 +02:00
}
2023-05-13 14:43:51 +02:00
public function LocationsList ( Request $request , Response $response , array $args )
2018-04-11 19:49:35 +02:00
{
2023-05-13 14:24:52 +02:00
if ( isset ( $request -> getQueryParams ()[ 'include_disabled' ]))
{
$locations = $this -> getDatabase () -> locations () -> orderBy ( 'name' , 'COLLATE NOCASE' );
}
else
{
$locations = $this -> getDatabase () -> locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' );
}
2020-03-01 23:47:47 +07:00
return $this -> renderPage ( $response , 'locations' , [
2023-05-13 14:24:52 +02:00
'locations' => $locations ,
2020-03-01 23:47:47 +07:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'locations' ),
'userfieldValues' => $this -> getUserfieldsService () -> GetAllValues ( 'locations' )
2018-04-11 19:49:35 +02:00
]);
}
2023-05-13 14:43:51 +02:00
public function Overview ( Request $request , Response $response , array $args )
2020-03-25 19:34:56 +01:00
{
2020-08-31 20:40:31 +02:00
$usersService = $this -> getUsersService ();
2025-01-17 17:22:37 +01:00
$userSettings = $usersService -> GetUserSettings ( GROCY_USER_ID );
$nextXDays = $userSettings [ 'stock_due_soon_days' ];
2020-03-25 19:34:56 +01:00
2025-01-15 21:44:45 +01:00
$where = 'is_in_stock_or_below_min_stock = 1' ;
2025-01-17 17:22:37 +01:00
if ( boolval ( $userSettings [ 'stock_overview_show_all_out_of_stock_products' ]))
2025-01-15 21:44:45 +01:00
{
$where = '1=1' ;
}
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'stockoverview' , [
2025-01-15 21:44:45 +01:00
'currentStock' => $this -> getDatabase () -> uihelper_stock_current_overview () -> where ( $where ),
2023-05-13 14:24:52 +02:00
'locations' => $this -> getDatabase () -> locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-08-31 20:40:31 +02:00
'currentStockLocations' => $this -> getStockService () -> GetCurrentStockLocations (),
'nextXDays' => $nextXDays ,
2023-05-13 14:24:52 +02:00
'productGroups' => $this -> getDatabase () -> product_groups () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-08-31 20:40:31 +02:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'products' ),
'userfieldValues' => $this -> getUserfieldsService () -> GetAllValues ( 'products' )
2018-09-24 13:02:52 +02:00
]);
}
2023-05-13 14:43:51 +02:00
public function ProductBarcodesEditForm ( Request $request , Response $response , array $args )
2018-04-11 19:49:35 +02:00
{
2020-08-31 20:40:31 +02:00
$product = null ;
if ( isset ( $request -> getQueryParams ()[ 'product' ]))
{
$product = $this -> getDatabase () -> products ( $request -> getQueryParams ()[ 'product' ]);
}
if ( $args [ 'productBarcodeId' ] == 'new' )
{
2020-11-10 18:11:33 +01:00
return $this -> renderPage ( $response , 'productbarcodeform' , [
2020-08-31 20:40:31 +02:00
'mode' => 'create' ,
'barcodes' => $this -> getDatabase () -> product_barcodes () -> orderBy ( 'barcode' ),
'product' => $product ,
2023-05-13 14:24:52 +02:00
'shoppinglocations' => $this -> getDatabase () -> shopping_locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-11-17 19:11:02 +01:00
'quantityUnits' => $this -> getDatabase () -> quantity_units () -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2023-08-06 13:28:14 +02:00
'quantityUnitConversionsResolved' => $this -> getDatabase () -> cache__quantity_unit_conversions_resolved (),
2020-11-17 19:11:02 +01:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'product_barcodes' )
2020-08-31 20:40:31 +02:00
]);
}
else
{
2020-11-10 18:11:33 +01:00
return $this -> renderPage ( $response , 'productbarcodeform' , [
2020-08-31 20:40:31 +02:00
'mode' => 'edit' ,
'barcode' => $this -> getDatabase () -> product_barcodes ( $args [ 'productBarcodeId' ]),
'product' => $product ,
2023-05-13 14:24:52 +02:00
'shoppinglocations' => $this -> getDatabase () -> shopping_locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-11-17 19:11:02 +01:00
'quantityUnits' => $this -> getDatabase () -> quantity_units () -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2023-08-06 13:28:14 +02:00
'quantityUnitConversionsResolved' => $this -> getDatabase () -> cache__quantity_unit_conversions_resolved (),
2020-11-17 19:11:02 +01:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'product_barcodes' )
2020-08-31 20:40:31 +02:00
]);
}
2018-04-11 19:49:35 +02:00
}
2023-05-13 14:43:51 +02:00
public function ProductEditForm ( Request $request , Response $response , array $args )
2018-04-11 19:49:35 +02:00
{
if ( $args [ 'productId' ] == 'new' )
{
2020-03-01 23:47:47 +07:00
return $this -> renderPage ( $response , 'productform' , [
2023-05-13 14:24:52 +02:00
'locations' => $this -> getDatabase () -> locations () -> where ( 'active = 1' ) -> orderBy ( 'name' ),
2020-08-31 20:40:31 +02:00
'barcodes' => $this -> getDatabase () -> product_barcodes () -> orderBy ( 'barcode' ),
2023-05-13 14:24:52 +02:00
'quantityunits' => $this -> getDatabase () -> quantity_units () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2022-03-13 17:09:07 +01:00
'quantityunitsStock' => $this -> getDatabase () -> quantity_units () -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2023-05-13 14:24:52 +02:00
'referencedQuantityunits' => $this -> getDatabase () -> quantity_units () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'shoppinglocations' => $this -> getDatabase () -> shopping_locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'productgroups' => $this -> getDatabase () -> product_groups () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-03-01 23:47:47 +07:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'products' ),
2020-11-17 19:11:02 +01:00
'products' => $this -> getDatabase () -> products () -> where ( 'parent_product_id IS NULL and active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2019-09-14 17:34:36 +02:00
'isSubProductOfOthers' => false ,
2018-04-11 19:49:35 +02:00
'mode' => 'create'
]);
}
else
{
2020-03-01 23:47:47 +07:00
$product = $this -> getDatabase () -> products ( $args [ 'productId' ]);
2019-09-14 17:34:36 +02:00
2020-03-01 23:47:47 +07:00
return $this -> renderPage ( $response , 'productform' , [
2020-08-31 20:40:31 +02:00
'product' => $product ,
2023-05-13 14:24:52 +02:00
'locations' => $this -> getDatabase () -> locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-08-31 20:40:31 +02:00
'barcodes' => $this -> getDatabase () -> product_barcodes () -> orderBy ( 'barcode' ),
2023-05-13 14:24:52 +02:00
'quantityunits' => $this -> getDatabase () -> quantity_units () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2023-08-06 13:28:14 +02:00
'quantityunitsStock' => $this -> getDatabase () -> quantity_units () -> where ( 'id IN (SELECT to_qu_id FROM cache__quantity_unit_conversions_resolved WHERE product_id = :1) OR NOT EXISTS(SELECT 1 FROM stock_log WHERE product_id = :1)' , $product -> id ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'referencedQuantityunits' => $this -> getDatabase () -> quantity_units () -> where ( 'active = 1' ) -> where ( 'id IN (SELECT to_qu_id FROM cache__quantity_unit_conversions_resolved WHERE product_id = :1)' , $product -> id ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2023-05-13 14:24:52 +02:00
'shoppinglocations' => $this -> getDatabase () -> shopping_locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'productgroups' => $this -> getDatabase () -> product_groups () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-03-01 23:47:47 +07:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'products' ),
2020-11-17 19:11:02 +01:00
'products' => $this -> getDatabase () -> products () -> where ( 'id != :1 AND parent_product_id IS NULL and active = 1' , $product -> id ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-03-01 23:47:47 +07:00
'isSubProductOfOthers' => $this -> getDatabase () -> products () -> where ( 'parent_product_id = :1' , $product -> id ) -> count () !== 0 ,
2019-09-15 16:40:54 +02:00
'mode' => 'edit' ,
2022-12-04 20:25:33 +01:00
'quConversions' => $this -> getDatabase () -> quantity_unit_conversions () -> where ( 'product_id' , $product -> id ),
2020-11-17 19:11:02 +01:00
'productBarcodeUserfields' => $this -> getUserfieldsService () -> GetFields ( 'product_barcodes' ),
'productBarcodeUserfieldValues' => $this -> getUserfieldsService () -> GetAllValues ( 'product_barcodes' )
2018-04-11 19:49:35 +02:00
]);
}
}
2023-05-13 14:43:51 +02:00
public function ProductGrocycodeImage ( Request $request , Response $response , array $args )
2021-06-12 17:21:12 +02:00
{
2021-07-13 19:29:23 +02:00
$gc = new Grocycode ( Grocycode :: PRODUCT , $args [ 'productId' ]);
2021-07-16 17:32:08 +02:00
return $this -> ServeGrocycodeImage ( $request , $response , $gc );
2021-06-12 17:21:12 +02:00
}
2023-05-13 14:43:51 +02:00
public function ProductGroupEditForm ( Request $request , Response $response , array $args )
2018-04-11 19:49:35 +02:00
{
2020-08-31 20:40:31 +02:00
if ( $args [ 'productGroupId' ] == 'new' )
2018-04-11 19:49:35 +02:00
{
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'productgroupform' , [
2019-04-22 22:16:35 +02:00
'mode' => 'create' ,
2020-08-31 20:40:31 +02:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'product_groups' )
2018-04-11 19:49:35 +02:00
]);
}
else
{
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'productgroupform' , [
'group' => $this -> getDatabase () -> product_groups ( $args [ 'productGroupId' ]),
2019-04-22 22:16:35 +02:00
'mode' => 'edit' ,
2020-08-31 20:40:31 +02:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'product_groups' )
2018-04-11 19:49:35 +02:00
]);
}
}
2023-05-13 14:43:51 +02:00
public function ProductGroupsList ( Request $request , Response $response , array $args )
2020-03-25 19:34:56 +01:00
{
2023-05-13 14:24:52 +02:00
if ( isset ( $request -> getQueryParams ()[ 'include_disabled' ]))
{
$productGroups = $this -> getDatabase () -> product_groups () -> orderBy ( 'name' , 'COLLATE NOCASE' );
}
else
{
$productGroups = $this -> getDatabase () -> product_groups () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' );
}
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'productgroups' , [
2023-05-13 14:24:52 +02:00
'productGroups' => $productGroups ,
2020-11-17 19:11:02 +01:00
'products' => $this -> getDatabase () -> products () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-08-31 20:40:31 +02:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'product_groups' ),
'userfieldValues' => $this -> getUserfieldsService () -> GetAllValues ( 'product_groups' )
]);
}
2023-05-13 14:43:51 +02:00
public function ProductsList ( Request $request , Response $response , array $args )
2020-08-31 20:40:31 +02:00
{
2021-07-06 20:08:02 +02:00
$products = $this -> getDatabase () -> products ();
if ( ! isset ( $request -> getQueryParams ()[ 'include_disabled' ]))
2020-12-07 19:48:33 +01:00
{
2021-07-06 20:08:02 +02:00
$products = $products -> where ( 'active = 1' );
2020-12-07 19:48:33 +01:00
}
2021-07-06 20:08:02 +02:00
if ( isset ( $request -> getQueryParams ()[ 'only_in_stock' ]))
2020-12-07 19:48:33 +01:00
{
2021-07-06 20:08:02 +02:00
$products = $products -> where ( 'id IN (SELECT product_id from stock_current WHERE amount_aggregated > 0)' );
2020-12-07 19:48:33 +01:00
}
2023-04-13 20:28:28 +02:00
if ( isset ( $request -> getQueryParams ()[ 'only_out_of_stock' ]))
{
$products = $products -> where ( 'id NOT IN (SELECT product_id from stock_current WHERE amount_aggregated > 0)' );
}
2020-12-07 19:48:33 +01:00
2021-07-06 20:08:02 +02:00
$products = $products -> orderBy ( 'name' , 'COLLATE NOCASE' );
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'products' , [
2020-12-07 19:48:33 +01:00
'products' => $products ,
2020-11-17 19:11:02 +01:00
'locations' => $this -> getDatabase () -> locations () -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'quantityunits' => $this -> getDatabase () -> quantity_units () -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2023-05-13 14:24:52 +02:00
'productGroups' => $this -> getDatabase () -> product_groups () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-12-19 10:51:07 +01:00
'shoppingLocations' => $this -> getDatabase () -> shopping_locations () -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-08-31 20:40:31 +02:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'products' ),
'userfieldValues' => $this -> getUserfieldsService () -> GetAllValues ( 'products' )
]);
}
2023-05-13 14:43:51 +02:00
public function Purchase ( Request $request , Response $response , array $args )
2020-08-31 20:40:31 +02:00
{
return $this -> renderPage ( $response , 'purchase' , [
2022-04-01 18:49:17 +02:00
'products' => $this -> getDatabase () -> products () -> where ( 'active = 1 AND no_own_stock = 0' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-12-20 16:00:14 +01:00
'barcodes' => $this -> getDatabase () -> product_barcodes_comma_separated (),
2023-05-13 14:24:52 +02:00
'shoppinglocations' => $this -> getDatabase () -> shopping_locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'locations' => $this -> getDatabase () -> locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'quantityUnits' => $this -> getDatabase () -> quantity_units () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2023-08-06 13:28:14 +02:00
'quantityUnitConversionsResolved' => $this -> getDatabase () -> cache__quantity_unit_conversions_resolved (),
2022-03-30 17:32:53 +02:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'stock' )
2020-08-31 20:40:31 +02:00
]);
}
2023-05-13 14:43:51 +02:00
public function QuantityUnitConversionEditForm ( Request $request , Response $response , array $args )
2020-08-31 20:40:31 +02:00
{
$product = null ;
if ( isset ( $request -> getQueryParams ()[ 'product' ]))
2020-03-25 19:34:56 +01:00
{
2020-08-31 20:40:31 +02:00
$product = $this -> getDatabase () -> products ( $request -> getQueryParams ()[ 'product' ]);
2020-03-25 19:34:56 +01:00
}
2020-08-31 20:40:31 +02:00
$defaultQuUnit = null ;
if ( isset ( $request -> getQueryParams ()[ 'qu-unit' ]))
2020-03-25 19:34:56 +01:00
{
2020-08-31 20:40:31 +02:00
$defaultQuUnit = $this -> getDatabase () -> quantity_units ( $request -> getQueryParams ()[ 'qu-unit' ]);
2020-03-25 19:34:56 +01:00
}
2020-08-31 20:40:31 +02:00
if ( $args [ 'quConversionId' ] == 'new' )
2018-09-24 13:02:52 +02:00
{
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'quantityunitconversionform' , [
2019-04-22 22:16:35 +02:00
'mode' => 'create' ,
2020-08-31 20:40:31 +02:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'quantity_unit_conversions' ),
2023-05-13 14:24:52 +02:00
'quantityunits' => $this -> getDatabase () -> quantity_units () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-08-31 20:40:31 +02:00
'product' => $product ,
'defaultQuUnit' => $defaultQuUnit
2018-09-24 13:02:52 +02:00
]);
}
else
{
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'quantityunitconversionform' , [
'quConversion' => $this -> getDatabase () -> quantity_unit_conversions ( $args [ 'quConversionId' ]),
2019-04-22 22:16:35 +02:00
'mode' => 'edit' ,
2020-08-31 20:40:31 +02:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'quantity_unit_conversions' ),
2023-05-13 14:24:52 +02:00
'quantityunits' => $this -> getDatabase () -> quantity_units () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-08-31 20:40:31 +02:00
'product' => $product ,
'defaultQuUnit' => $defaultQuUnit
2018-09-24 13:02:52 +02:00
]);
}
}
2023-05-13 14:43:51 +02:00
public function QuantityUnitEditForm ( Request $request , Response $response , array $args )
2018-04-11 19:49:35 +02:00
{
if ( $args [ 'quantityunitId' ] == 'new' )
{
2020-03-01 23:47:47 +07:00
return $this -> renderPage ( $response , 'quantityunitform' , [
2019-04-22 22:16:35 +02:00
'mode' => 'create' ,
2020-03-01 23:47:47 +07:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'quantity_units' ),
'pluralCount' => $this -> getLocalizationService () -> GetPluralCount (),
'pluralRule' => $this -> getLocalizationService () -> GetPluralDefinition ()
2018-04-11 19:49:35 +02:00
]);
}
else
{
2020-03-01 23:47:47 +07:00
$quantityUnit = $this -> getDatabase () -> quantity_units ( $args [ 'quantityunitId' ]);
2019-09-15 16:40:54 +02:00
2020-03-01 23:47:47 +07:00
return $this -> renderPage ( $response , 'quantityunitform' , [
2020-08-31 20:40:31 +02:00
'quantityUnit' => $quantityUnit ,
2019-04-22 22:16:35 +02:00
'mode' => 'edit' ,
2020-03-01 23:47:47 +07:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'quantity_units' ),
'pluralCount' => $this -> getLocalizationService () -> GetPluralCount (),
'pluralRule' => $this -> getLocalizationService () -> GetPluralDefinition (),
'defaultQuConversions' => $this -> getDatabase () -> quantity_unit_conversions () -> where ( 'from_qu_id = :1 AND product_id IS NULL' , $quantityUnit -> id ),
'quantityUnits' => $this -> getDatabase () -> quantity_units ()
2018-04-11 19:49:35 +02:00
]);
}
2020-08-31 20:40:31 +02:00
}
2023-05-13 14:43:51 +02:00
public function QuantityUnitPluralFormTesting ( Request $request , Response $response , array $args )
2020-08-31 20:40:31 +02:00
{
return $this -> renderPage ( $response , 'quantityunitpluraltesting' , [
2023-05-13 14:24:52 +02:00
'quantityUnits' => $this -> getDatabase () -> quantity_units () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' )
2020-08-31 20:40:31 +02:00
]);
}
2023-05-13 14:43:51 +02:00
public function QuantityUnitsList ( Request $request , Response $response , array $args )
2020-08-31 20:40:31 +02:00
{
2023-05-13 14:24:52 +02:00
if ( isset ( $request -> getQueryParams ()[ 'include_disabled' ]))
{
$quantityUnits = $this -> getDatabase () -> quantity_units () -> orderBy ( 'name' , 'COLLATE NOCASE' );
}
else
{
$quantityUnits = $this -> getDatabase () -> quantity_units () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' );
}
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'quantityunits' , [
2023-05-13 14:24:52 +02:00
'quantityunits' => $quantityUnits ,
2020-08-31 20:40:31 +02:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'quantity_units' ),
'userfieldValues' => $this -> getUserfieldsService () -> GetAllValues ( 'quantity_units' )
]);
}
2023-05-13 14:43:51 +02:00
public function ShoppingList ( Request $request , Response $response , array $args )
2020-08-31 20:40:31 +02:00
{
$listId = 1 ;
if ( isset ( $request -> getQueryParams ()[ 'list' ]))
{
$listId = $request -> getQueryParams ()[ 'list' ];
}
return $this -> renderPage ( $response , 'shoppinglist' , [
2024-11-08 16:40:30 +01:00
'listItems' => $this -> getDatabase () -> uihelper_shopping_list () -> where ( 'shopping_list_id = :1' , $listId ) -> orderBy ( 'product_name' , 'COLLATE NOCASE' ),
2020-11-17 19:11:02 +01:00
'products' => $this -> getDatabase () -> products () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'quantityunits' => $this -> getDatabase () -> quantity_units () -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-08-31 20:40:31 +02:00
'missingProducts' => $this -> getStockService () -> GetMissingProducts (),
2024-02-12 20:36:33 +01:00
'shoppingLists' => $this -> getDatabase () -> shopping_lists_view () -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-08-31 20:40:31 +02:00
'selectedShoppingListId' => $listId ,
2023-08-06 13:28:14 +02:00
'quantityUnitConversionsResolved' => $this -> getDatabase () -> cache__quantity_unit_conversions_resolved (),
2020-11-17 19:11:02 +01:00
'productUserfields' => $this -> getUserfieldsService () -> GetFields ( 'products' ),
'productUserfieldValues' => $this -> getUserfieldsService () -> GetAllValues ( 'products' ),
2022-12-18 20:56:02 +01:00
'productGroupUserfields' => $this -> getUserfieldsService () -> GetFields ( 'product_groups' ),
'productGroupUserfieldValues' => $this -> getUserfieldsService () -> GetAllValues ( 'product_groups' ),
2020-11-17 19:11:02 +01:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'shopping_list' ),
'userfieldValues' => $this -> getUserfieldsService () -> GetAllValues ( 'shopping_list' )
2020-08-31 20:40:31 +02:00
]);
}
2023-05-13 14:43:51 +02:00
public function ShoppingListEditForm ( Request $request , Response $response , array $args )
2020-08-31 20:40:31 +02:00
{
if ( $args [ 'listId' ] == 'new' )
{
return $this -> renderPage ( $response , 'shoppinglistform' , [
2020-11-17 19:11:02 +01:00
'mode' => 'create' ,
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'shopping_lists' )
2020-08-31 20:40:31 +02:00
]);
}
else
{
return $this -> renderPage ( $response , 'shoppinglistform' , [
'shoppingList' => $this -> getDatabase () -> shopping_lists ( $args [ 'listId' ]),
2020-11-17 19:11:02 +01:00
'mode' => 'edit' ,
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'shopping_lists' )
2020-08-31 20:40:31 +02:00
]);
}
2018-04-11 19:49:35 +02:00
}
2023-05-13 14:43:51 +02:00
public function ShoppingListItemEditForm ( Request $request , Response $response , array $args )
2018-04-11 19:49:35 +02:00
{
if ( $args [ 'itemId' ] == 'new' )
{
2020-03-01 23:47:47 +07:00
return $this -> renderPage ( $response , 'shoppinglistitemform' , [
2020-11-17 19:11:02 +01:00
'products' => $this -> getDatabase () -> products () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2022-07-12 19:00:40 +02:00
'barcodes' => $this -> getDatabase () -> product_barcodes_comma_separated (),
2020-11-17 19:11:02 +01:00
'shoppingLists' => $this -> getDatabase () -> shopping_lists () -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-11-09 22:15:25 +01:00
'mode' => 'create' ,
2023-05-13 14:24:52 +02:00
'quantityUnits' => $this -> getDatabase () -> quantity_units () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2023-08-06 13:28:14 +02:00
'quantityUnitConversionsResolved' => $this -> getDatabase () -> cache__quantity_unit_conversions_resolved (),
2020-11-17 19:11:02 +01:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'shopping_list' )
2018-04-11 19:49:35 +02:00
]);
}
else
{
2020-03-01 23:47:47 +07:00
return $this -> renderPage ( $response , 'shoppinglistitemform' , [
2020-08-31 20:40:31 +02:00
'listItem' => $this -> getDatabase () -> shopping_list ( $args [ 'itemId' ]),
2020-11-17 19:11:02 +01:00
'products' => $this -> getDatabase () -> products () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2022-07-12 19:00:40 +02:00
'barcodes' => $this -> getDatabase () -> product_barcodes_comma_separated (),
2020-11-17 19:11:02 +01:00
'shoppingLists' => $this -> getDatabase () -> shopping_lists () -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-11-09 22:15:25 +01:00
'mode' => 'edit' ,
2023-05-13 14:24:52 +02:00
'quantityUnits' => $this -> getDatabase () -> quantity_units () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2023-08-06 13:28:14 +02:00
'quantityUnitConversionsResolved' => $this -> getDatabase () -> cache__quantity_unit_conversions_resolved (),
2020-11-17 19:11:02 +01:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'shopping_list' )
2018-04-11 19:49:35 +02:00
]);
}
}
2018-10-27 17:26:00 +02:00
2023-05-13 14:43:51 +02:00
public function ShoppingListSettings ( Request $request , Response $response , array $args )
2019-04-20 17:04:40 +02:00
{
2022-04-03 13:00:14 +02:00
return $this -> renderPage ( $response , 'shoppinglistsettings' , [
'shoppingLists' => $this -> getDatabase () -> shopping_lists () -> orderBy ( 'name' , 'COLLATE NOCASE' )
]);
2020-08-31 20:40:31 +02:00
}
2023-05-13 14:43:51 +02:00
public function ShoppingLocationEditForm ( Request $request , Response $response , array $args )
2020-08-31 20:40:31 +02:00
{
if ( $args [ 'shoppingLocationId' ] == 'new' )
2019-04-20 17:04:40 +02:00
{
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'shoppinglocationform' , [
'mode' => 'create' ,
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'shopping_locations' )
2019-04-20 17:04:40 +02:00
]);
}
else
{
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'shoppinglocationform' , [
2023-05-13 14:24:52 +02:00
'shoppingLocation' => $this -> getDatabase () -> shopping_locations ( $args [ 'shoppingLocationId' ]),
2020-08-31 20:40:31 +02:00
'mode' => 'edit' ,
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'shopping_locations' )
2019-04-20 17:04:40 +02:00
]);
}
}
2023-05-13 14:43:51 +02:00
public function ShoppingLocationsList ( Request $request , Response $response , array $args )
2020-02-01 12:54:05 +01:00
{
2023-05-13 14:24:52 +02:00
if ( isset ( $request -> getQueryParams ()[ 'include_disabled' ]))
{
$shoppingLocations = $this -> getDatabase () -> shopping_locations () -> orderBy ( 'name' , 'COLLATE NOCASE' );
}
else
{
$shoppingLocations = $this -> getDatabase () -> shopping_locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' );
}
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'shoppinglocations' , [
2023-05-13 14:24:52 +02:00
'shoppinglocations' => $shoppingLocations ,
2020-08-31 20:40:31 +02:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'shopping_locations' ),
'userfieldValues' => $this -> getUserfieldsService () -> GetAllValues ( 'shopping_locations' )
]);
2020-02-01 12:54:05 +01:00
}
2023-05-13 14:43:51 +02:00
public function StockEntryEditForm ( Request $request , Response $response , array $args )
2018-10-27 17:26:00 +02:00
{
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'stockentryform' , [
'stockEntry' => $this -> getDatabase () -> stock () -> where ( 'id' , $args [ 'entryId' ]) -> fetch (),
2020-11-17 19:11:02 +01:00
'products' => $this -> getDatabase () -> products () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2023-05-13 14:24:52 +02:00
'shoppinglocations' => $this -> getDatabase () -> shopping_locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'locations' => $this -> getDatabase () -> locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2022-04-06 19:08:17 +02:00
'userfields' => $this -> getUserfieldsService () -> GetFields ( 'stock' )
2018-10-27 17:26:00 +02:00
]);
}
2019-08-10 16:34:29 +02:00
2023-05-13 14:43:51 +02:00
public function StockEntryGrocycodeImage ( Request $request , Response $response , array $args )
2021-06-12 17:21:12 +02:00
{
$stockEntry = $this -> getDatabase () -> stock () -> where ( 'id' , $args [ 'entryId' ]) -> fetch ();
$gc = new Grocycode ( Grocycode :: PRODUCT , $stockEntry -> product_id , [ $stockEntry -> stock_id ]);
2021-07-16 17:32:08 +02:00
return $this -> ServeGrocycodeImage ( $request , $response , $gc );
2021-06-12 17:21:12 +02:00
}
2023-05-13 14:43:51 +02:00
public function StockEntryGrocycodeLabel ( Request $request , Response $response , array $args )
2021-06-12 17:21:12 +02:00
{
$stockEntry = $this -> getDatabase () -> stock () -> where ( 'id' , $args [ 'entryId' ]) -> fetch ();
return $this -> renderPage ( $response , 'stockentrylabel' , [
'stockEntry' => $stockEntry ,
'product' => $this -> getDatabase () -> products ( $stockEntry -> product_id ),
]);
}
2023-05-13 14:43:51 +02:00
public function StockSettings ( Request $request , Response $response , array $args )
2019-08-10 16:34:29 +02:00
{
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'stocksettings' , [
2023-05-13 14:24:52 +02:00
'locations' => $this -> getDatabase () -> locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'quantityunits' => $this -> getDatabase () -> quantity_units () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'productGroups' => $this -> getDatabase () -> product_groups () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' )
2019-08-10 16:34:29 +02:00
]);
}
2019-09-15 16:40:54 +02:00
2023-05-13 14:43:51 +02:00
public function Stockentries ( Request $request , Response $response , array $args )
2020-08-17 14:47:33 -05:00
{
2020-08-31 20:40:31 +02:00
$usersService = $this -> getUsersService ();
2020-11-15 19:53:44 +01:00
$nextXDays = $usersService -> GetUserSettings ( GROCY_USER_ID )[ 'stock_due_soon_days' ];
2020-08-17 14:47:33 -05:00
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'stockentries' , [
2020-11-17 19:11:02 +01:00
'products' => $this -> getDatabase () -> products () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2023-05-13 14:24:52 +02:00
'quantityunits' => $this -> getDatabase () -> quantity_units () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'locations' => $this -> getDatabase () -> locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'shoppinglocations' => $this -> getDatabase () -> shopping_locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2022-12-25 19:48:22 +01:00
'stockEntries' => $this -> getDatabase () -> uihelper_stock_entries () -> orderBy ( 'product_id' ),
2020-08-31 20:40:31 +02:00
'currentStockLocations' => $this -> getStockService () -> GetCurrentStockLocations (),
'nextXDays' => $nextXDays ,
2022-03-30 17:32:53 +02:00
'userfieldsProducts' => $this -> getUserfieldsService () -> GetFields ( 'products' ),
'userfieldValuesProducts' => $this -> getUserfieldsService () -> GetAllValues ( 'products' ),
'userfieldsStock' => $this -> getUserfieldsService () -> GetFields ( 'stock' ),
'userfieldValuesStock' => $this -> getUserfieldsService () -> GetAllValues ( 'stock' )
2020-08-31 20:40:31 +02:00
]);
2020-08-17 14:47:33 -05:00
}
2023-05-13 14:43:51 +02:00
public function Transfer ( Request $request , Response $response , array $args )
2019-09-15 16:40:54 +02:00
{
2020-08-31 20:40:31 +02:00
return $this -> renderPage ( $response , 'transfer' , [
2022-04-01 18:49:17 +02:00
'products' => $this -> getDatabase () -> products () -> where ( 'active = 1' ) -> where ( 'no_own_stock = 0 AND id IN (SELECT product_id from stock_current WHERE amount_aggregated > 0)' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2020-12-20 16:00:14 +01:00
'barcodes' => $this -> getDatabase () -> product_barcodes_comma_separated (),
2023-05-13 14:24:52 +02:00
'locations' => $this -> getDatabase () -> locations () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'quantityUnits' => $this -> getDatabase () -> quantity_units () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2023-08-06 13:28:14 +02:00
'quantityUnitConversionsResolved' => $this -> getDatabase () -> cache__quantity_unit_conversions_resolved ()
2020-08-31 20:40:31 +02:00
]);
2019-09-15 16:40:54 +02:00
}
2019-09-18 20:21:09 +02:00
2023-05-13 14:43:51 +02:00
public function JournalSummary ( Request $request , Response $response , array $args )
2020-09-06 13:18:51 +02:00
{
$entries = $this -> getDatabase () -> uihelper_stock_journal_summary ();
if ( isset ( $request -> getQueryParams ()[ 'product_id' ]))
{
$entries = $entries -> where ( 'product_id' , $request -> getQueryParams ()[ 'product_id' ]);
}
if ( isset ( $request -> getQueryParams ()[ 'user_id' ]))
{
$entries = $entries -> where ( 'user_id' , $request -> getQueryParams ()[ 'user_id' ]);
}
if ( isset ( $request -> getQueryParams ()[ 'transaction_type' ]))
{
$entries = $entries -> where ( 'transaction_type' , $request -> getQueryParams ()[ 'transaction_type' ]);
}
2020-11-17 19:11:02 +01:00
$usersService = $this -> getUsersService ();
2020-09-06 13:18:51 +02:00
return $this -> renderPage ( $response , 'stockjournalsummary' , [
2020-11-17 19:11:02 +01:00
'entries' => $entries ,
'products' => $this -> getDatabase () -> products () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
'users' => $usersService -> GetUsersAsDto (),
'transactionTypes' => GetClassConstants ( '\Grocy\Services\StockService' , 'TRANSACTION_TYPE_' )
2020-09-06 13:18:51 +02:00
]);
}
2022-12-04 19:02:15 +01:00
2023-05-13 14:43:51 +02:00
public function QuantityUnitConversionsResolved ( Request $request , Response $response , array $args )
2022-12-04 19:02:15 +01:00
{
$product = null ;
if ( isset ( $request -> getQueryParams ()[ 'product' ]))
{
$product = $this -> getDatabase () -> products ( $request -> getQueryParams ()[ 'product' ]);
2023-08-06 13:28:14 +02:00
$quantityUnitConversionsResolved = $this -> getDatabase () -> cache__quantity_unit_conversions_resolved () -> where ( 'product_id' , $product -> id );
2022-12-04 19:02:15 +01:00
}
else
{
2023-08-06 13:28:14 +02:00
$quantityUnitConversionsResolved = $this -> getDatabase () -> cache__quantity_unit_conversions_resolved () -> where ( 'product_id IS NULL' );
2022-12-04 19:02:15 +01:00
}
return $this -> renderPage ( $response , 'quantityunitconversionsresolved' , [
'product' => $product ,
2023-05-13 14:24:52 +02:00
'quantityUnits' => $this -> getDatabase () -> quantity_units () -> where ( 'active = 1' ) -> orderBy ( 'name' , 'COLLATE NOCASE' ),
2022-12-04 19:02:15 +01:00
'quantityUnitConversionsResolved' => $quantityUnitConversionsResolved
]);
}
2018-04-11 19:49:35 +02:00
}