Oprava statistiky
authorThomas Mudrunka <tomas@mudrunka.cz>
Wed, 25 Jul 2012 21:51:24 +0000 (23:51 +0200)
committerThomas Mudrunka <tomas@mudrunka.cz>
Wed, 25 Jul 2012 21:51:24 +0000 (23:51 +0200)
assistants/stats/reserve.inc.php

index d8e92dbcbf35f4a1e565a45effb4b3ef8a52ce29..f161fa4a07436503c586ddcc2a122facd43259a7 100644 (file)
@@ -1,10 +1,10 @@
 <?php
 $queries += array(
        "Nakoupit: Došlo úplně (Urgent WishList)"
-               => 'SELECT model_id,model_name,barcode_name,model_reserve,model_reserve as item_quantity_to_buy'.
-               ' FROM model LEFT JOIN barcode USING(model_id)'.
+               => 'SELECT model_id,model_name,model_reserve,model_reserve as item_quantity_to_buy'.
+               ' FROM model'.
                ' WHERE model_reserve>0 AND NOT EXISTS'.
-               ' (SELECT item_id FROM item WHERE barcode.barcode_id=item.barcode_id AND status_id=1 AND item_quantity>0 AND item_valid_till=0)',
+               ' (SELECT item_id FROM item LEFT JOIN barcode USING(barcode_id) WHERE barcode.model_id=model.model_id AND status_id=1 AND item_quantity>0 AND item_valid_till=0)',
        "Nakoupit: Dochází (WishList)"
                => 'SELECT model_id,model_name,barcode_name,model_reserve,'.
                ' COUNT(item_id),SUM(item_quantity),model_reserve-SUM(item_quantity) as item_quantity_to_buy'.
This page took 0.12141 seconds and 4 git commands to generate.