Mejora, poder cambiar situacion de facturas de proveedor
git-svn-id: https://192.168.0.254/svn/Proyectos.Miguelo_FactuGES/trunk@11 172823e9-465a-9d4b-80ba-0a9f016f4eb1
This commit is contained in:
parent
e451d22121
commit
a0df0f55df
@ -20,6 +20,7 @@
|
|||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
02-02-2004 Se ha eliminado el atributo SERIE (P8 MULTIEMPRESA)
|
02-02-2004 Se ha eliminado el atributo SERIE (P8 MULTIEMPRESA)
|
||||||
Se ha adaptado a los nuevos contadores
|
Se ha adaptado a los nuevos contadores
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,6 +155,7 @@ type
|
|||||||
function DarTiposOpDesTrimestral(var ListaCodigos: TStrings): TStrings;
|
function DarTiposOpDesTrimestral(var ListaCodigos: TStrings): TStrings;
|
||||||
function ComprobarTrimestreFactura(CodigoFactura: String): Boolean;
|
function ComprobarTrimestreFactura(CodigoFactura: String): Boolean;
|
||||||
function AsignarTrimestre(CodigoFactura: String; CodigoTrimestre: String): Boolean;
|
function AsignarTrimestre(CodigoFactura: String; CodigoTrimestre: String): Boolean;
|
||||||
|
function ModificarSituacionFacturas(Codigos: TStrings; Situacion: String): Boolean;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -1195,6 +1197,47 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TdmTablaFacturasProveedor.ModificarSituacionFacturas(Codigos: TStrings; Situacion: String): Boolean;
|
||||||
|
var
|
||||||
|
oSQL : TIBSQL;
|
||||||
|
Indice : Integer;
|
||||||
|
Cadena : String;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
if Codigos.Count = 0 then
|
||||||
|
Exit;
|
||||||
|
|
||||||
|
//Formateamos los códigos para optimizar la sentencia SQL
|
||||||
|
for Indice:=0 to Codigos.Count-1 do
|
||||||
|
begin
|
||||||
|
if (Indice <> 0) then
|
||||||
|
Cadena := Cadena + ',';
|
||||||
|
Cadena := Cadena + '''' + Codigos.Strings[Indice] + '''';
|
||||||
|
end;
|
||||||
|
|
||||||
|
oSQL := TIBSQL.Create(Self);
|
||||||
|
with oSQL do
|
||||||
|
begin
|
||||||
|
Database := dmBaseDatos.BD;
|
||||||
|
Transaction := dmBaseDatos.Transaccion;
|
||||||
|
SQL.Add('update FACTURASPROVEEDOR ');
|
||||||
|
SQL.Add('set SITUACION = :SITUACION ');
|
||||||
|
SQL.Add('where CODIGOEMPRESA = :CODIGOEMPRESA ');
|
||||||
|
SQL.Add('and CODIGO IN (' + Cadena + ')');
|
||||||
|
ParamByName('CODIGOEMPRESA').AsInteger := EmpresaActiva.Codigo;
|
||||||
|
ParamByName('SITUACION').AsString := Situacion;
|
||||||
|
try
|
||||||
|
Prepare;
|
||||||
|
ExecQuery;
|
||||||
|
Result := True;
|
||||||
|
finally
|
||||||
|
Close;
|
||||||
|
Transaction := NIL;
|
||||||
|
Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TDatosFacturaProveedor }
|
{ TDatosFacturaProveedor }
|
||||||
|
|
||||||
procedure TDatosFacturaProveedor.AssignTo(Dest: TPersistent);
|
procedure TDatosFacturaProveedor.AssignTo(Dest: TPersistent);
|
||||||
|
|||||||
@ -84,13 +84,12 @@ object frCambiarSituacionFacturas: TfrCambiarSituacionFacturas
|
|||||||
object cbxSituacion: TcxComboBox
|
object cbxSituacion: TcxComboBox
|
||||||
Left = 96
|
Left = 96
|
||||||
Top = 19
|
Top = 19
|
||||||
Width = 169
|
|
||||||
Height = 21
|
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
Properties.DropDownListStyle = lsFixedList
|
Properties.DropDownListStyle = lsFixedList
|
||||||
Properties.ReadOnly = False
|
Properties.ReadOnly = False
|
||||||
Style.StyleController = dmConfiguracion.cxEstiloEditoresFondoClaro
|
Style.StyleController = dmConfiguracion.cxEstiloEditoresFondoClaro
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
|
Width = 169
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object brDoble: TRdxBarraInferior
|
object brDoble: TRdxBarraInferior
|
||||||
|
|||||||
@ -29,7 +29,7 @@ uses
|
|||||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
Dialogs, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
|
Dialogs, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
|
||||||
cxDropDownEdit, StdCtrls, RdxBotones, RdxBarras, ExtCtrls,
|
cxDropDownEdit, StdCtrls, RdxBotones, RdxBarras, ExtCtrls,
|
||||||
RdxPaneles, TablaTrimestres;
|
RdxPaneles, TablaTrimestres, cxGraphics, Entidades;
|
||||||
|
|
||||||
type
|
type
|
||||||
TfrCambiarSituacionFacturas = class(TForm)
|
TfrCambiarSituacionFacturas = class(TForm)
|
||||||
@ -46,12 +46,14 @@ type
|
|||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure FormDestroy(Sender: TObject);
|
procedure FormDestroy(Sender: TObject);
|
||||||
private
|
private
|
||||||
|
FEntidad: TRdxEntidad;
|
||||||
FCodigosFacturas : TStringList;
|
FCodigosFacturas : TStringList;
|
||||||
FSituacion : String;
|
FSituacion : String;
|
||||||
procedure SetSituacion(Value : String);
|
procedure SetSituacion(Value : String);
|
||||||
public
|
public
|
||||||
property CodigosFacturas : TStringList read FCodigosFacturas write FCodigosFacturas;
|
property CodigosFacturas : TStringList read FCodigosFacturas write FCodigosFacturas;
|
||||||
property Situacion : String read FSituacion write SetSituacion;
|
property Situacion : String read FSituacion write SetSituacion;
|
||||||
|
property Entidad: TRdxEntidad read FEntidad Write FEntidad;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -60,16 +62,22 @@ var
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Mensajes, Literales, BaseDatos, Configuracion, Entidades, RdxEmpresaActiva,
|
Mensajes, Literales, BaseDatos, Configuracion, RdxEmpresaActiva,
|
||||||
TablaFacturasCliente, StrFunc;
|
TablaFacturasCliente, TablaFacturasProveedor, StrFunc, Math;
|
||||||
|
|
||||||
{$R *.dfm}
|
{$R *.dfm}
|
||||||
|
|
||||||
procedure TfrCambiarSituacionFacturas.bAceptarClick(Sender: TObject);
|
procedure TfrCambiarSituacionFacturas.bAceptarClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
Indice :Integer;
|
Indice :Integer;
|
||||||
|
Resultado: Boolean;
|
||||||
begin
|
begin
|
||||||
if not dmTablaFacturasCliente.ModificarSituacionFacturas(CodigosFacturas, cbxSituacion.Text) then
|
if Entidad = entFacturaProveedor then
|
||||||
|
Resultado := dmTablaFacturasProveedor.ModificarSituacionFacturas(CodigosFacturas, cbxSituacion.Text)
|
||||||
|
else
|
||||||
|
Resultado := dmTablaFacturasCliente.ModificarSituacionFacturas(CodigosFacturas, cbxSituacion.Text);
|
||||||
|
|
||||||
|
if not Resultado then
|
||||||
begin
|
begin
|
||||||
dmBaseDatos.Rollback;
|
dmBaseDatos.Rollback;
|
||||||
exit;
|
exit;
|
||||||
@ -81,6 +89,7 @@ end;
|
|||||||
procedure TfrCambiarSituacionFacturas.FormCreate(Sender: TObject);
|
procedure TfrCambiarSituacionFacturas.FormCreate(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
FEntidad := entFacturaCliente; //Por defecto tratara los documentos de facturas de cliente
|
||||||
FCodigosFacturas := TStringList.Create;
|
FCodigosFacturas := TStringList.Create;
|
||||||
cbxSituacion.Properties.Items := dmTablaFacturasCliente.DarSituaciones;
|
cbxSituacion.Properties.Items := dmTablaFacturasCliente.DarSituaciones;
|
||||||
cbxSituacion.ItemIndex := 0;
|
cbxSituacion.ItemIndex := 0;
|
||||||
|
|||||||
@ -468,6 +468,7 @@ var
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
fCambiarSituacionFacturas := TfrCambiarSituacionFacturas.Create(Self);
|
fCambiarSituacionFacturas := TfrCambiarSituacionFacturas.Create(Self);
|
||||||
|
fCambiarSituacionFacturas.Entidad := entFacturaCliente;
|
||||||
|
|
||||||
//Rellenamos la propiedad de la unidad CambiarSituacion con los códigos seleccionados
|
//Rellenamos la propiedad de la unidad CambiarSituacion con los códigos seleccionados
|
||||||
IndiceCol1 := gridFacturasDBTableView1.GetColumnByFieldName('CODIGO').Index;
|
IndiceCol1 := gridFacturasDBTableView1.GetColumnByFieldName('CODIGO').Index;
|
||||||
|
|||||||
Binary file not shown.
@ -83,6 +83,8 @@ type
|
|||||||
eNombre: TLabel;
|
eNombre: TLabel;
|
||||||
Buscar: TcxTextEdit;
|
Buscar: TcxTextEdit;
|
||||||
bLimpiar: TRdxBoton;
|
bLimpiar: TRdxBoton;
|
||||||
|
bFacturar: TRdxBoton;
|
||||||
|
actCambiarSituacion: TAction;
|
||||||
procedure RdxFrameFacturasProveedorShow(Sender: TObject);
|
procedure RdxFrameFacturasProveedorShow(Sender: TObject);
|
||||||
procedure actAnadirExecute(Sender: TObject);
|
procedure actAnadirExecute(Sender: TObject);
|
||||||
procedure actModificarExecute(Sender: TObject);
|
procedure actModificarExecute(Sender: TObject);
|
||||||
@ -101,6 +103,7 @@ type
|
|||||||
procedure actRefrescarDatosExecute(Sender: TObject);
|
procedure actRefrescarDatosExecute(Sender: TObject);
|
||||||
procedure BuscarPropertiesChange(Sender: TObject);
|
procedure BuscarPropertiesChange(Sender: TObject);
|
||||||
procedure bLimpiarClick(Sender: TObject);
|
procedure bLimpiarClick(Sender: TObject);
|
||||||
|
procedure actCambiarSituacionExecute(Sender: TObject);
|
||||||
private
|
private
|
||||||
procedure ActualizarBotones;
|
procedure ActualizarBotones;
|
||||||
protected
|
protected
|
||||||
@ -123,7 +126,7 @@ implementation
|
|||||||
|
|
||||||
{ TfrFacturasProveedores }
|
{ TfrFacturasProveedores }
|
||||||
uses
|
uses
|
||||||
BaseDatos, TablaFacturasProveedor, IBDatabase,
|
BaseDatos, TablaFacturasProveedor, IBDatabase, CambiarSituacionFacturas,
|
||||||
IBCustomDataSet, Mensajes, Entidades, Variants,
|
IBCustomDataSet, Mensajes, Entidades, Variants,
|
||||||
FacturaProveedor, Constantes, FacturasProveedorPendientes, TablaEmpresas,
|
FacturaProveedor, Constantes, FacturasProveedorPendientes, TablaEmpresas,
|
||||||
Configuracion;
|
Configuracion;
|
||||||
@ -222,7 +225,7 @@ end;
|
|||||||
procedure TfrFacturasProveedores.RdxFrameFacturasProveedorShow(
|
procedure TfrFacturasProveedores.RdxFrameFacturasProveedorShow(
|
||||||
Sender: TObject);
|
Sender: TObject);
|
||||||
begin
|
begin
|
||||||
gridFacturas.SetFocus;
|
gridFacturas.SetFocus
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrFacturasProveedores.actAnadirExecute(Sender: TObject);
|
procedure TfrFacturasProveedores.actAnadirExecute(Sender: TObject);
|
||||||
@ -332,4 +335,27 @@ begin
|
|||||||
Buscar.Text := '';
|
Buscar.Text := '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrFacturasProveedores.actCambiarSituacionExecute(Sender: TObject);
|
||||||
|
var
|
||||||
|
IndiceCol1 : Integer;
|
||||||
|
IndiceSel : Integer;
|
||||||
|
fCambiarSituacionFacturas : TfrCambiarSituacionFacturas;
|
||||||
|
|
||||||
|
begin
|
||||||
|
fCambiarSituacionFacturas := TfrCambiarSituacionFacturas.Create(Self);
|
||||||
|
fCambiarSituacionFacturas.Entidad := entFacturaProveedor;
|
||||||
|
|
||||||
|
//Rellenamos la propiedad de la unidad CambiarSituacion con los códigos seleccionados
|
||||||
|
IndiceCol1 := gridFacturasDBTableView1.GetColumnByFieldName('CODIGO').Index;
|
||||||
|
for IndiceSel:=0 to gridFacturasDBTableView1.Controller.SelectedRowCount-1 do
|
||||||
|
fCambiarSituacionFacturas.CodigosFacturas.Append(gridFacturasDBTableView1.Controller.SelectedRows[IndiceSel].Values[IndiceCol1]);
|
||||||
|
|
||||||
|
try
|
||||||
|
fCambiarSituacionFacturas.ShowModal;
|
||||||
|
finally
|
||||||
|
fCambiarSituacionFacturas.Free;
|
||||||
|
bRefrescar.Click;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
[BD]
|
[BD]
|
||||||
MIGUELO RIVAS=david:D:\Proyectos\FactuGES (Miguelo)\Codigo\bd\miguelo.gdb
|
MIGUELO RIVAS=david:D:\Proyectos\FactuGES (Miguelo)\Codigo\bd\miguelo.gdb
|
||||||
ACANA DAVID=david:D:\Proyectos\FactuGES 2000 v2 (Acana)\Codigo\bd\acana.gdb
|
ACANA DAVID=david:D:\Proyectos\FactuGES 2000 v2 (Acana)\Codigo\bd\acana.gdb
|
||||||
MIGUELO ROBERTO=roberto:E:\Miguelo\bd\miguelo.gdb
|
MIGUELO ROBERTO=roberto:T:\Miguelo\bd\miguelo.gdb
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user