$tipoDoc = 'Factura'; } $objV->dni = rtrim($_POST['ruc']); $objV->serie = rtrim($_POST['serie']); $objV->numero = rtrim($_POST['numero']); $objV->fecha = $fecha; $objV->tipo = $tipoDoc; $objV->monto = $Total; $mensaje1 = $objV->Add_Ventas(); foreach ($_SESSION['carrito_ventas'] as $key) { $objV->IdP = $key['Id']; $objV->PVenta = $key['Precio']; $objV->Cantidad = $key['Cantidad']; $objV->SubTotal = $key['SubTotal']; $objV->Igv = $key['Igv']; $mensaje2 = $objV->Add_DetalleVentas(); } if ($mensaje2 == $mensaje1) { if ($_POST['tipoPer'] == "Natural") { echo '<script>window.location="comprobante/boleta/' . rtrim($_POST["numero"]) . '/";</script>'; } else { echo '<script>window.location="comprobante/factura/' . rtrim($_POST["numero"]) . '/";</script>'; } unset($_SESSION['carrito_ventas']); ?> <div class='alert alert-success' role='alert'> <button type='button' class='close' data-dismiss='alert'>×</button> <i class='glyphicon glyphicon-ok'></i> <?php echo $mensaje2; ?> </div>