14. srv / bd / ventaEnCapturaBusca.php

1<?php
2
3require_once __DIR__ . "/../modelo/Venta.php";
4require_once __DIR__ . "/Bd.php";
5require_once __DIR__ . "/detalleDeVentaConsulta.php";
6
7function ventaEnCapturaBusca()
8{
9 $con = Bd::getConexion();
10 $stmt = $con->query(
11 "SELECT VENT_ID as id
12 FROM VENTA
13 WHERE VENT_EN_CAPTURA = 1"
14 );
15 $stmt->setFetchMode(PDO::FETCH_OBJ);
16 $obj = $stmt->fetch();
17 if ($obj === false) {
18 return false;
19 } else {
20 $venta = new Venta(id: $obj->id, enCaptura: true);
21 $venta->detalles = detalleDeVentaConsulta($venta);
22 return $venta;
23 }
24}
25
skip_previous skip_next