public function execute() { $config = $this->getConfig(); $formEntradaBodega = filter_input_array(INPUT_POST)['entradaBodega']; $entradaBodega = new entradaSalidaBodegaTable($config); $entradaBodega->setTipoDocumentoId($formEntradaBodega['tipo_documento_id']); $entradaBodega->setTerceroIdElabora($formEntradaBodega['tercero_id_elabora']); $entradaBodega->setTerceroIdSolicita($formEntradaBodega['tercero_id_solicita']); $entradaBodega->setFecha($formEntradaBodega['fecha']); $entradaBodega->setObservacion($formEntradaBodega['observacion']); // $detalle = new detalleEntradaSalidaBodegaTable($config); $cod_art = filter_input_array(INPUT_POST)['cod_art']; $tpd = filter_input_array(INPUT_POST)['tpd']; $unm = filter_input_array(INPUT_POST)['unm']; $cant = filter_input_array(INPUT_POST)['cant']; $precio = filter_input_array(INPUT_POST)['precio']; $contador = filter_input_array(INPUT_POST)['cta_campos']; $this->objEntradaBodega = $entradaBodega->save(); $id = $entradaBodega->consById(); for ($i = 0; $i < $contador; $i++) { $detalleEntradaBodega = new detalleEntradaSalidaBodegaTable($config); $detalleEntradaBodega->setEntradaSalidaBodegaId($id[0]->id); $detalleEntradaBodega->setProductoId($cod_art[$i]); $detalleEntradaBodega->setTpd_id(1); $detalleEntradaBodega->setUnidadMedidaId($unm[$i]); $detalleEntradaBodega->setCantidad($cant[$i]); $detalleEntradaBodega->setPrecio($precio[$i]); // Se guarda el registro en la tabla detalle $this->ObjFactura = $detalleEntradaBodega->save(); } header('Location: ' . $config->getUrl() . 'index.php/entradaBodega/index'); }
public function execute() { $config = $this->getConfig(); $formRegistroEntradaBodega = filter_input_array(INPUT_POST)['entradaBodega']; $registroEntradaBodega = new entradaSalidaBodegaTable($config); $registroEntradaBodega->setId($formRegistroEntradaBodega['id']); $registroEntradaBodega->setTerceroIdElabora($formRegistroEntradaBodega['tercero_id_elabora']); $registroEntradaBodega->setTerceroIdSolicita($formRegistroEntradaBodega['tercero_id_solicita']); $registroEntradaBodega->setTipoDocumentoId($formRegistroEntradaBodega['tipo_documento_id']); $registroEntradaBodega->setFecha($formRegistroEntradaBodega['fecha']); $registroEntradaBodega->setObservacion($formRegistroEntradaBodega['observacion']); // $detalle = new detalleEntradaSalidaBodegaTable($config); $cod_art = filter_input_array(INPUT_POST)['cod_art']; $unm = filter_input_array(INPUT_POST)['unm']; $cant = filter_input_array(INPUT_POST)['cant']; $precio = filter_input_array(INPUT_POST)['precio']; $this->objRegistroEntradaBodega = $registroEntradaBodega->update(); $id = $registroEntradaBodega->consById(); $detalleEntradaSalidaBodega = new detalleEntradaSalidaBodegaTable($config); $detalleEntradaSalidaBodega->setEntradaSalidaBodegaId($id[0]->id); $detalleEntradaSalidaBodega->setProductoId($cod_art); $detalleEntradaSalidaBodega->setUnidadMedidaId($unm); $detalleEntradaSalidaBodega->setCantidad($cant); $detalleEntradaSalidaBodega->setPrecio($precio); // Se guarda el registro en la tabla detalle $this->objRegistroEntradaBodegaD = $detalleEntradaSalidaBodega->update(); header('Location: ' . $config->getUrl() . 'index.php/registroEntradaBodega/index'); }
public function execute() { $config = $this->getConfig(); $entradaBodga = new entradaSalidaBodegaTable($config); $this->objEntradaBodega = $entradaBodga->consById(); $tercero = new terceroTable($config); $this->objTercero = $tercero->getAll(); $producto = new productoTable($config); $this->objProducto = $producto->getAll(); $unm = new unidadMedidaTable($config); $this->objUnm = $unm->getAll(); $this->defineView('entradaBodega', 'nuevo', 'html'); }