mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Fixed QU conversion factor selection (API)
This commit is contained in:
parent
dd5bd3852a
commit
629333e1ab
@ -769,7 +769,7 @@ class StockService extends BaseService
|
|||||||
$quConversionFactorPurchaseToStock = 1.0;
|
$quConversionFactorPurchaseToStock = 1.0;
|
||||||
if ($product->qu_id_stock != $product->qu_id_purchase)
|
if ($product->qu_id_stock != $product->qu_id_purchase)
|
||||||
{
|
{
|
||||||
$conversion = $this->getDatabase()->quantity_unit_conversions()->where('product_id = :1 AND from_qu_id = :2 AND to_qu_id = :3', $product->id, $product->qu_id_purchase, $product->qu_id_stock)->fetch();
|
$conversion = $this->getDatabase()->quantity_unit_conversions_resolved()->where('product_id = :1 AND from_qu_id = :2 AND to_qu_id = :3', $product->id, $product->qu_id_purchase, $product->qu_id_stock)->fetch();
|
||||||
if ($conversion != null)
|
if ($conversion != null)
|
||||||
{
|
{
|
||||||
$quConversionFactorPurchaseToStock = $conversion->factor;
|
$quConversionFactorPurchaseToStock = $conversion->factor;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user