Mejora, poder cambiar situacion de facturas de proveedor
git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES/trunk@9 3f40d355-893c-4141-8e64-b1d9be72e7e7
This commit is contained in:
parent
4baabc24b0
commit
7c88065942
@ -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
|
||||||
@ -1194,6 +1196,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;
|
||||||
|
|||||||
@ -343,6 +343,7 @@ object frFacturasClientes: TfrFacturasClientes
|
|||||||
OptionsView.GridLines = glHorizontal
|
OptionsView.GridLines = glHorizontal
|
||||||
OptionsView.GroupByBox = False
|
OptionsView.GroupByBox = False
|
||||||
OptionsView.HeaderEndEllipsis = True
|
OptionsView.HeaderEndEllipsis = True
|
||||||
|
OptionsView.NewItemRowInfoText = 'Click here to add a new row'
|
||||||
OptionsView.RowSeparatorColor = 14280169
|
OptionsView.RowSeparatorColor = 14280169
|
||||||
Styles.StyleSheet = dmConfiguracion.StyleSheetGrid
|
Styles.StyleSheet = dmConfiguracion.StyleSheetGrid
|
||||||
end
|
end
|
||||||
|
|||||||
@ -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;
|
||||||
@ -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.
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
ACANA DAVID T=david:t:\Codigo Acana\bd\acana.gdb
|
ACANA DAVID T=david:t:\Codigo Acana\bd\acana.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
|
||||||
ACANA ALCALÁ LOCAL=david:D:\Proyectos\FactuGES 2000 v2 (Acana)\Codigo\bd\acana_alcala.gdb
|
ACANA ALCALÁ LOCAL=david:D:\Proyectos\FactuGES 2000 v2 (Acana)\Codigo\bd\acana_alcala.gdb
|
||||||
ACANA ROBERTO=ROBERTO:e:\codigo (acana)\bd\acana.gdb
|
ACANA ROBERTO=ROBERTO:T:\Acana\bd\acana.gdb
|
||||||
ACANA VALDEBERNARDO=acana2.dynalias.org:c:\rodax software\factuges acana\bd\acana.gdb
|
ACANA VALDEBERNARDO=acana2.dynalias.org:c:\rodax software\factuges acana\bd\acana.gdb
|
||||||
ACANA alcala=acana.dynalias.org:c:\rodax software\factuges acana\bd\acana.gdb
|
ACANA alcala=acana.dynalias.org:c:\rodax software\factuges acana\bd\acana.gdb
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user