This commit is contained in:
2024-04-27 09:23:34 +02:00
commit 11e713ca6f
11884 changed files with 3263371 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
<?php
$db = $GLOBALS['db'];
$products = $db->query("SELECT id, code, name FROM ecmproducts WHERE product_active='1'");
while ($product = $db->fetchByAssoc($products)) {
$price = $db->fetchByAssoc($db->query("
select (sum(price*quantity)/sum(quantity)) as avg_price from ecmstockstates
where product_id='".$product['id']."'"));
echo $product['code'].' '.$product['name'].' '.round($price['avg_price'],2).'<br><br>';
}