git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES/trunk@4 3f40d355-893c-4141-8e64-b1d9be72e7e7
169 lines
5.2 KiB
ObjectPascal
169 lines
5.2 KiB
ObjectPascal
{
|
|
===============================================================================
|
|
Copyright (©) 2004. Rodax Software.
|
|
===============================================================================
|
|
Los contenidos de este fichero son propiedad de Rodax Software titular del
|
|
copyright. Este fichero sólo podrá ser copiado, distribuido y utilizado,
|
|
en su totalidad o en parte, con el permiso escrito de Rodax Software, o de
|
|
acuerdo con los términos y condiciones establecidas en el acuerdo/contrato
|
|
bajo el que se suministra.
|
|
-----------------------------------------------------------------------------
|
|
Web: www.rodax-software.com
|
|
===============================================================================
|
|
Fecha primera versión: 25-12-2002
|
|
Versión actual: 1.0.1
|
|
Fecha versión actual: 02-02-2004
|
|
===============================================================================
|
|
Modificaciones:
|
|
|
|
Fecha Comentarios
|
|
---------------------------------------------------------------------------
|
|
02-02-2004 Se ha eliminado el atributo SERIE (P8 MULTIEMPRESA)
|
|
===============================================================================
|
|
}
|
|
|
|
unit FacturasProveedorPendientes;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
Dialogs, CalendarioPagos, RdxFrame, RdxTitulos, ExtCtrls, DB,
|
|
IBCustomDataSet, IBQuery, Configuracion, StdCtrls, cxStyles,
|
|
cxCustomData, cxGraphics, cxFilter, cxData, cxEdit, cxDBData,
|
|
cxGridLevel, cxClasses, cxControls, cxGridCustomView,
|
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGrid,
|
|
cxContainer, cxTextEdit, cxMaskEdit, cxDropDownEdit,
|
|
|
|
RdxEmpresaActiva, cxDataStorage;
|
|
|
|
type
|
|
TfrFacturasProveedorPendientes = class(TRdxFrame)
|
|
frCalendarioPagos1: TfrCalendarioPagos;
|
|
Titulo: TRdxPanelTituloOperacion;
|
|
Panel1: TPanel;
|
|
Splitter1: TSplitter;
|
|
TablaCalendario: TIBQuery;
|
|
eTextoListaFacturas: TLabel;
|
|
Panel2: TPanel;
|
|
gridFacturas: TcxGrid;
|
|
gridFacturasDBTableView1: TcxGridDBTableView;
|
|
gridFacturasLevel1: TcxGridLevel;
|
|
Panel3: TPanel;
|
|
TablaFacturasPendientes: TIBQuery;
|
|
dsFacturasPendientes: TDataSource;
|
|
gridFacturasDBTableView1DBColumn1: TcxGridDBColumn;
|
|
gridFacturasDBTableView1DBColumn2: TcxGridDBColumn;
|
|
gridFacturasDBTableView1DBColumn3: TcxGridDBColumn;
|
|
procedure RdxFrameShow(Sender: TObject);
|
|
private
|
|
{ Private declarations }
|
|
procedure FOnDrawDia(Sender : TObject; ADate : TDate; var ABackColor : TColor; var AFont : TFont; var Caption : TCaption; var Hint : String);
|
|
procedure FOnClickDia(Sender : TObject; ADate : TDate);
|
|
procedure Refrescar;
|
|
public
|
|
{ Public declarations }
|
|
constructor Create(AOwne : TComponent); override;
|
|
destructor Destroy; override;
|
|
end;
|
|
|
|
var
|
|
frFacturasProveedorPendientes: TfrFacturasProveedorPendientes;
|
|
|
|
implementation
|
|
|
|
uses BaseDatos, Constantes, TablaFacturasProveedor, TablaEmpresas;
|
|
|
|
{$R *.dfm}
|
|
|
|
{ TfrPagosPendientes }
|
|
|
|
constructor TfrFacturasProveedorPendientes.Create(AOwne: TComponent);
|
|
begin
|
|
inherited;
|
|
|
|
with TablaCalendario do
|
|
begin
|
|
Database := dmBaseDatos.BD;
|
|
Transaction := dmBaseDatos.Transaccion;
|
|
end;
|
|
|
|
with TablaFacturasPendientes do
|
|
begin
|
|
Database := dmBaseDatos.BD;
|
|
Transaction := dmBaseDatos.Transaccion;
|
|
end;
|
|
|
|
dmTablaFacturasProveedor.InicializarGridFacturasPendientes(gridFacturas);
|
|
end;
|
|
|
|
destructor TfrFacturasProveedorPendientes.Destroy;
|
|
begin
|
|
TablaFacturasPendientes.Close;
|
|
TablaCalendario.Close;
|
|
inherited;
|
|
end;
|
|
|
|
procedure TfrFacturasProveedorPendientes.FOnClickDia(Sender: TObject; ADate: TDate);
|
|
begin
|
|
eTextoListaFacturas.Caption := 'Facturas pendientes del ' + DateToStr(ADate);
|
|
with TablaFacturasPendientes do
|
|
begin
|
|
try
|
|
DisableControls;
|
|
Close;
|
|
ParamByName('FECHAVENCIMIENTO').AsDate := ADate;
|
|
ParamByName('CODIGOEMPRESA').AsInteger := EmpresaActiva.Codigo;
|
|
Prepare;
|
|
Open;
|
|
dmTablaFacturasProveedor.InicializarTablaFacturas(@TablaFacturasPendientes);
|
|
finally
|
|
EnableControls;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
procedure TfrFacturasProveedorPendientes.FOnDrawDia(Sender: TObject; ADate: TDate;
|
|
var ABackColor : TColor; var AFont : TFont; var Caption: TCaption; var Hint : String);
|
|
begin
|
|
with TablaCalendario do
|
|
begin
|
|
First;
|
|
Caption := '';
|
|
while not Eof do
|
|
begin
|
|
if FieldByName('FECHAVENCIMIENTO').AsString = DateToStr(ADate) then
|
|
begin
|
|
Caption := FormatFloat(DISPLAY_EUROS2, FieldByName('TOTAL').AsFloat) + ' ';
|
|
ABackColor := $00C2F0FF;
|
|
AFont.Color := clBlack;
|
|
AFont.Style := [fsBold];
|
|
break;
|
|
end;
|
|
Next;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
procedure TfrFacturasProveedorPendientes.RdxFrameShow(Sender: TObject);
|
|
begin
|
|
Refrescar;
|
|
end;
|
|
|
|
procedure TfrFacturasProveedorPendientes.Refrescar;
|
|
begin
|
|
frCalendarioPagos1.OnDrawDay := NIL;
|
|
frCalendarioPagos1.OnClickDay := NIL;
|
|
with TablaCalendario do
|
|
begin
|
|
Close;
|
|
ParamByName('CODIGOEMPRESA').AsInteger := EmpresaActiva.Codigo;
|
|
Prepare;
|
|
Open;
|
|
end;
|
|
frCalendarioPagos1.OnDrawDay := FOnDrawDia;
|
|
frCalendarioPagos1.OnClickDay := FOnClickDia;
|
|
end;
|
|
|
|
end.
|