1 | <?php |
2 | |
3 | require_once __DIR__ . "/../lib/php/ejecutaServicio.php"; |
4 | require_once __DIR__ . "/../lib/php/recuperaIdEntero.php"; |
5 | require_once __DIR__ . "/../lib/php/devuelveNoContent.php"; |
6 | require_once __DIR__ . "/../lib/php/delete.php"; |
7 | require_once __DIR__ . "/Bd.php"; |
8 | require_once __DIR__ . "/TABLA_VENTA.php"; |
9 | require_once __DIR__ . "/TABLA_PRODUCTO.php"; |
10 | require_once __DIR__ . "/TABLA_DET_VENTA.php"; |
11 | require_once __DIR__ . "/ventaEnCapturaBusca.php"; |
12 | |
13 | ejecutaServicio(function () { |
14 | |
15 | $prodId = recuperaIdEntero("prodId"); |
16 | |
17 | $pdo = Bd::pdo(); |
18 | |
19 | $venta = ventaEnCapturaBusca($pdo); |
20 | if ($venta !== false) { |
21 | delete( |
22 | pdo: $pdo, |
23 | from: DET_VENTA, |
24 | where: [VENT_ID => $venta[VENT_ID], PROD_ID => $prodId] |
25 | ); |
26 | } |
27 | devuelveNoContent(); |
28 | }); |
29 | |