206 lines
7.0 KiB
C++
206 lines
7.0 KiB
C++
//---------------------------------------------------------------------------
|
|
#ifndef TpvCmpH
|
|
#define TpvCmpH
|
|
//---------------------------------------------------------------------------
|
|
#include "TDlgBuscar.h"
|
|
#include <Buttons.hpp>
|
|
#include <Classes.hpp>
|
|
#include <ComCtrls.hpp>
|
|
#include <Controls.hpp>
|
|
#include <Db.hpp>
|
|
#include <DBCtrls.hpp>
|
|
#include <DBGrids.hpp>
|
|
#include <DBTables.hpp>
|
|
#include <ExtCtrls.hpp>
|
|
#include <Grids.hpp>
|
|
#include <Mask.hpp>
|
|
#include <StdCtrls.hpp>
|
|
#include <ToolWin.hpp>
|
|
#include "ElastFrm.hpp"
|
|
|
|
|
|
#define DFechaFact 0
|
|
#define DNumFact 1
|
|
#define DNumProv 2
|
|
|
|
//---------------------------------------------------------------------------
|
|
class TTpvCmp1 : public TForm
|
|
{
|
|
__published: // IDE-managed Components
|
|
TPanel *Panel2;
|
|
TSpeedButton *SpeedButton4;
|
|
TSpeedButton *SpeedButton5;
|
|
TSpeedButton *SpeedButton6;
|
|
TSpeedButton *BusqAnt;
|
|
TSpeedButton *BuscarFicha;
|
|
TSpeedButton *BusqSig;
|
|
TSpeedButton *btFacturar;
|
|
TDBNavigator *DBNavigator1;
|
|
TDBGrid *DBGrid1;
|
|
TStatusBar *StatusBar1;
|
|
TDataSource *DsFacturasD;
|
|
TLabel *Label6;
|
|
TLabel *TotalCompra;
|
|
TSpeedButton *SpeedButton1;
|
|
TTable *TbFacturasD;
|
|
TDBGrid *DBGrid2;
|
|
TDataSource *DsFacturasC;
|
|
TTable *TbFacturasC;
|
|
TLabel *Label10;
|
|
|
|
|
|
TStringField *TbFacturasCProveedor;
|
|
TIntegerField *TbFacturasCCodProveedor;
|
|
TStringField *TbFacturasCCodFactura;
|
|
TDateField *TbFacturasCFechaFactura;
|
|
TStringField *TbFacturasCProvPersona;
|
|
TStringField *TbFacturasCProvCIF;
|
|
TStringField *TbFacturasCProvTlf;
|
|
TStringField *TbFacturasCProvFax;
|
|
TAutoIncField *TbFacturasCEnlaceFactura;
|
|
TSmallintField *TbFacturasCNumeroPagos;
|
|
TPageControl *PageControl1;
|
|
TTabSheet *TabSheet1;
|
|
TTabSheet *TabSheet2;
|
|
TBevel *Bevel1;
|
|
TDBText *DBText1;
|
|
TLabel *Label2;
|
|
TDBText *DBText2;
|
|
TLabel *Label4;
|
|
TDBText *DBText3;
|
|
TLabel *Label5;
|
|
TDBText *DBText4;
|
|
TDBText *DBText5;
|
|
TDBText *DBText8;
|
|
TLabel *Label9;
|
|
TDBEdit *DBEdit1;
|
|
TEdit *Edit1;
|
|
TBevel *Bevel2;
|
|
TLabel *Label8;
|
|
TLabel *Label11;
|
|
TLabel *SUMAcompra;
|
|
TLabel *Scantidad;
|
|
TLabel *Label14;
|
|
TLabel *IVAcompra;
|
|
TDBText *DBText6;
|
|
TLabel *Label3;
|
|
TButton *Button1;
|
|
TDBText *DBText7;
|
|
TDBGrid *dbgFraccion;
|
|
TBevel *Bevel3;
|
|
TLabel *Label1;
|
|
TDataSource *DsCartera;
|
|
TTable *TbCartera;
|
|
TDateTimePicker *FechaFactura;
|
|
TTable *TbProveedor;
|
|
TBooleanField *TbFacturasCContabilizada;
|
|
TStringField *TbFacturasCDescripcion;
|
|
TLabel *Label7;
|
|
TDBEdit *DBEdit3;
|
|
TSpeedButton *SpeedButton2;
|
|
TLabel *Label12;
|
|
TEdit *Edit2;
|
|
TComboBox *ComboVox;
|
|
TIntegerField *TbFacturasDEnlaceFactura;
|
|
TStringField *TbFacturasDCodProducto;
|
|
TStringField *TbFacturasDNombreProducto;
|
|
TSmallintField *TbFacturasDIVA;
|
|
TCurrencyField *TbFacturasDPrecioC;
|
|
TFloatField *TbFacturasDCantidad;
|
|
TCurrencyField *TbFacturasDTotal;
|
|
TIntegerField *TbCarteraEnlaceFactura;
|
|
TDateField *TbCarteraFecha;
|
|
TCurrencyField *TbCarteraImporte;
|
|
TCurrencyField *TbCarteraIncremento;
|
|
TSmallintField *TbCarteraFormaPago;
|
|
TBooleanField *TbCarteraPagado;
|
|
TCurrencyField *TbCarteraTotal;
|
|
TDateField *TbFacturasCUltimoPago;
|
|
TCurrencyField *TbFacturasCTotalSin;
|
|
TCurrencyField *TbFacturasCTotalIva;
|
|
TCurrencyField *TbFacturasCTotalFrac;
|
|
TSmallintField *TbFacturasCBanco_Entidad;
|
|
TSmallintField *TbFacturasCBanco_Sucursal;
|
|
TSmallintField *TbFacturasCBanco_DC;
|
|
TStringField *TbFacturasCBanco_NumCuenta;
|
|
TSmallintField *TbFacturasCFormaPago;
|
|
TIntegerField *TbFacturasCCod_Abono_Albaran;
|
|
TBooleanField *TbFacturasCAbono_o_Albaran;
|
|
TComboBox *cbFormaPago;
|
|
TElasticForm *ElasticForm1;
|
|
void __fastcall SpeedButton5Click(TObject *Sender);
|
|
void __fastcall SpeedButton4Click(TObject *Sender);
|
|
void __fastcall SpeedButton6Click(TObject *Sender);
|
|
void __fastcall BuscarFichaClick(TObject *Sender);
|
|
void __fastcall BusqAntClick(TObject *Sender);
|
|
void __fastcall BusqSigClick(TObject *Sender);
|
|
void __fastcall SpeedButton1Click(TObject *Sender);
|
|
void __fastcall DsFacturasDDataChange(TObject *Sender, TField *Field);
|
|
void __fastcall DsFacturasCDataChange(TObject *Sender, TField *Field);
|
|
void __fastcall TbFacturasCNewRecord(TDataSet *DataSet);
|
|
void __fastcall Button1Click(TObject *Sender);
|
|
void __fastcall DBEdit1KeyPress(TObject *Sender, char &Key);
|
|
void __fastcall TbFacturasCBeforeDelete(TDataSet *DataSet);
|
|
void __fastcall TbFacturasDBeforeInsert(TDataSet *DataSet);
|
|
void __fastcall DBGrid1EditButtonClick(TObject *Sender);
|
|
void __fastcall TbFacturasDCalcFields(TDataSet *DataSet);
|
|
void __fastcall DBGrid1KeyPress(TObject *Sender, char &Key);
|
|
void __fastcall TbFacturasDCantidadSetText(TField *Sender,
|
|
const AnsiString Text);
|
|
void __fastcall TbFacturasDPrecioCSetText(TField *Sender,
|
|
const AnsiString Text);
|
|
void __fastcall TbFacturasDIVASetText(TField *Sender, const AnsiString Text);
|
|
void __fastcall TbFacturasDCodProductoSetText(TField *Sender,
|
|
const AnsiString Text);
|
|
|
|
void __fastcall DBGrid1ColExit(TObject *Sender);
|
|
void __fastcall TbFacturasDBeforeDelete(TDataSet *DataSet);
|
|
|
|
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
|
|
void __fastcall FechaFacturaChange(TObject *Sender);
|
|
void __fastcall TbFacturasDNombreProductoSetText(TField *Sender,
|
|
const AnsiString Text);
|
|
void __fastcall btFacturarClick(TObject *Sender);
|
|
|
|
void __fastcall SpeedButton2Click(TObject *Sender);
|
|
|
|
|
|
void __fastcall DsCarteraDataChange(TObject *Sender, TField *Field);
|
|
void __fastcall Edit2Change(TObject *Sender);
|
|
void __fastcall Edit1Change(TObject *Sender);
|
|
void __fastcall cbFormaPagoChange(TObject *Sender);
|
|
void __fastcall TbCarteraNewRecord(TDataSet *DataSet);
|
|
void __fastcall TbCarteraBeforeDelete(TDataSet *DataSet);
|
|
void __fastcall TbCarteraCalcFields(TDataSet *DataSet);
|
|
void __fastcall dbgFraccionDrawColumnCell(TObject *Sender,
|
|
const TRect &Rect, int DataCol, TColumn *Column,
|
|
TGridDrawState State);
|
|
void __fastcall DBGrid2DrawColumnCell(TObject *Sender,
|
|
const TRect &Rect, int DataCol, TColumn *Column,
|
|
TGridDrawState State);
|
|
void __fastcall TbCarteraBeforeInsert(TDataSet *DataSet);
|
|
void __fastcall TbCarteraFechaChange(TField *Sender);
|
|
private: // User declarations
|
|
bool BusqManual;
|
|
Graphics::TBitmap *BtmOK; // Imagen OK!
|
|
Graphics::TBitmap *BtmLockOpen;
|
|
Graphics::TBitmap *BtmLockShut;
|
|
|
|
TDlgBuscar *DlgBuscarProd;
|
|
|
|
bool CambioCantidad5;
|
|
TDateTime FechaFacturaA;
|
|
Currency SUMAcompraC, IVAcompraC;
|
|
void __fastcall ReajustaFiltro(void);
|
|
void __fastcall ActualizaStock( AnsiString CodProducto, int Cantidad, int CodProveedor );
|
|
// Indica si estamos cambiando de factura en este momento....
|
|
bool CambiandoFactura;
|
|
|
|
public: // User declarations
|
|
__fastcall TTpvCmp1(TComponent* Owner);
|
|
};
|
|
//---------------------------------------------------------------------------
|
|
extern TTpvCmp1 *TpvCmp1;
|
|
//---------------------------------------------------------------------------
|
|
#endif
|
|
|