From bfb8a227e1ea00ba0e3397d6155acdf2f1e3b706 Mon Sep 17 00:00:00 2001 From: Thomas Mudrunka Date: Fri, 25 Nov 2011 02:15:52 +0100 Subject: [PATCH] Opravena haluz s wishlistem --- assistants/stats/reserve.inc.php | 7 ++++++- assistants/stats/stock.inc.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/assistants/stats/reserve.inc.php b/assistants/stats/reserve.inc.php index 8277814..e9f89c9 100644 --- a/assistants/stats/reserve.inc.php +++ b/assistants/stats/reserve.inc.php @@ -1,6 +1,11 @@ 'SELECT model_id,model_name,model_barcode,model_reserve,model_reserve as item_quantity_to_buy'. + ' FROM model'. + ' WHERE model_reserve>0 AND NOT EXISTS'. + ' (SELECT item_id FROM item WHERE model.model_id=item.model_id AND status_id=1)', + "Nakoupit: Dochází (WishList)" => 'SELECT room_id,room_name,model_id,model_name,model_barcode,model_reserve,'. ' COUNT(item_id),SUM(item_quantity),model_reserve-SUM(item_quantity) as item_quantity_to_buy'. ' FROM item LEFT JOIN model USING(model_id) LEFT JOIN room USING(room_id)'. diff --git a/assistants/stats/stock.inc.php b/assistants/stats/stock.inc.php index 8067a77..b71d022 100644 --- a/assistants/stats/stock.inc.php +++ b/assistants/stats/stock.inc.php @@ -1,6 +1,6 @@ 'SELECT room_id,room_name,model_id,model_name,model_barcode,model_price_out,COUNT(item_id),SUM(item_quantity)'. ' FROM item LEFT JOIN model USING(model_id) LEFT JOIN room USING(room_id)'. ' WHERE item_valid_till=0 AND status_id=1'. -- 2.30.2