Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creaciòn de una factura
Message
De
30/09/2004 21:29:04
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00947772
Message ID:
00947801
Vues:
13
>Hola amigos Foxuser's
>
>Necesito una rutina simple para crear una factyura utilizando una tabla de Cabeceras de factura, una tabla de detalle, una tabla de items a facturar, una tabla de clientes.
>
>Gracias por su ayuda

¿Qué quiere decir "crear una factura"? ¿Imprimir? Selecciona los datos a un solo cursor, y luego imprímelos. Tu reporte (informe) tiene que estar especialmente preparado para este fin.

En tu base de datos, la información está normalizada. Para el informe, creas una versión "denormalizada", que duplica cosas tales como el encabezado de la factura, y el cliente. Ejemplo:
* Tabla de cabecera
select NumFactura, Fecha, Cliente from Factura;
  where NumFactura = ThisForm.TxtNumFactura.Value;
  into cursor TempReport;
  nofilter
* Tabla de detalles
select TempReport.*, df.Item, df.Cantidad, df.PrecioUnitario;
  from TempReport join DetFactura df on TempReport.Factura = df.Factura;
  into cursor TempReport
* Cliente
select TempReport.*, cl.Nombres, cl.Direccion;
  from TempReport join Clientes cl on TempReport.Cliente = cl.Cliente;
  into cursor TempReport
report form Factura preview
Se puede combinar los SELECT en un solo comando, pero al tenerlo separado en varios comandos, tienes dos ventajas: 1) es menos confuso, 2) frecuentemente es más rápido.

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform