1 | <?php |
2 | |
3 | require_once __DIR__ . "/../lib/php/fetchAll.php"; |
4 | |
5 | function detVentaConsulta(PDO $pdo, int $ventaId) |
6 | { |
7 | return fetchAll( |
8 | $pdo->query( |
9 | "SELECT |
10 | DV.PROD_ID, |
11 | P.PROD_NOMBRE, |
12 | P.PROD_EXISTENCIAS, |
13 | P.PROD_PRECIO, |
14 | DV.DTV_CANTIDAD, |
15 | DV.DTV_PRECIO |
16 | FROM DET_VENTA DV, PRODUCTO P |
17 | WHERE |
18 | DV.PROD_ID = P.PROD_ID |
19 | AND DV.VENT_ID = :VENT_ID |
20 | ORDER BY P.PROD_NOMBRE" |
21 | ), |
22 | [":VENT_ID" => $ventaId] |
23 | ); |
24 | } |
25 |