First commit 14/02/1999
This commit is contained in:
77
BuscarEntreLineas.cpp
Normal file
77
BuscarEntreLineas.cpp
Normal file
@ -0,0 +1,77 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "BuscarEntreLineas.h"
|
||||
#include "TDlgBuscar.h"
|
||||
#include "TpvVntAlbPrint.h"
|
||||
#include "TpvVntFctPrint.h"
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma package(smart_init)
|
||||
#pragma resource "*.dfm"
|
||||
TForm1 *Form1;
|
||||
//---------------------------------------------------------------------------
|
||||
__fastcall TForm1::TForm1(TComponent* Owner)
|
||||
: TForm(Owner)
|
||||
{
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TForm1::Button2Click(TObject *Sender)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TForm1::Button1Click(TObject *Sender)
|
||||
{
|
||||
int CodFactura;
|
||||
// Mostramos la zona de busqueda de clientes...
|
||||
// Mostramos el dialogo, buscar Vendedores
|
||||
TDlgBuscar *DlgBuscar;
|
||||
|
||||
DlgBuscar = new TDlgBuscar(this);
|
||||
DlgBuscar -> DefaultField = "NombreProducto";
|
||||
DlgBuscar -> TbBusquedas -> TableName = "Ventas (cuerpo).db";
|
||||
DlgBuscar -> TbBusquedas -> Active = true;
|
||||
|
||||
DlgBuscar -> ShowModal();
|
||||
|
||||
if ( DlgBuscar -> ModalResult == mrOk )
|
||||
{
|
||||
CodFactura = DlgBuscar -> TbBusquedas -> FieldByName( "EnlaceFactura" ) -> AsInteger;
|
||||
TbVentasC -> Active = true;
|
||||
if ( ( TbVentasC -> Locate( "EnlaceFactura", CodFactura, TLocateOptions() << loCaseInsensitive ) ) )
|
||||
{
|
||||
if ( TbVentasC->FieldByName("CodFactura")->AsInteger <= 0 )
|
||||
{
|
||||
// Imprime Ticket
|
||||
TQRMDFacturaVnt1 *QRMDFacturaVnt;
|
||||
// Creamos una ficha del tipo TProductos
|
||||
// Guardando la referencia en la variable TProductos
|
||||
QRMDFacturaVnt = new TQRMDFacturaVnt1(this);
|
||||
// Mostrarla como modal y seg<65>n el valor devuelto
|
||||
QRMDFacturaVnt -> TbVntCabecera -> GotoCurrent( TbVentasC );
|
||||
QRMDFacturaVnt -> Preview();
|
||||
// Destruimos la ficha
|
||||
delete QRMDFacturaVnt;
|
||||
} else {
|
||||
// Imprime factura
|
||||
TQRMDFacturaVnt *QRMDFacturaVnt;
|
||||
// Creamos una ficha del tipo TProductos
|
||||
// Guardando la referencia en la variable TProductos
|
||||
QRMDFacturaVnt = new TQRMDFacturaVnt(this);
|
||||
// Mostrarla como modal y seg<65>n el valor devuelto
|
||||
QRMDFacturaVnt -> TbVntCabecera -> GotoCurrent( TbVentasC );
|
||||
QRMDFacturaVnt -> Preview();
|
||||
// Destruimos la ficha
|
||||
delete QRMDFacturaVnt;
|
||||
}
|
||||
TbVentasC -> Active = false;
|
||||
}
|
||||
}
|
||||
|
||||
delete DlgBuscar;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user