Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | $queries += array( | |
3 | "Nutno koupit" | |
4 | => 'SELECT room_id,room_name,model_id,model_name,model_barcode,model_reserve,'. | |
5 | ' COUNT(item_id),SUM(item_quantity),model_reserve-SUM(item_quantity) as item_quantity_to_buy'. | |
6 | ' FROM item LEFT JOIN model USING(model_id) LEFT JOIN room USING(room_id)'. | |
7 | ' WHERE item_valid_till=0 AND status_id=1'. | |
8 | ' GROUP BY model_id,room_id'. | |
9 | ' HAVING SUM(item_quantity)<model_reserve'. | |
10 | ' ORDER BY room_id,model_id;', | |
11 | ); |