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)
|
||||
Se ha adaptado a los nuevos contadores
|
||||
|
||||
===============================================================================
|
||||
}
|
||||
|
||||
@ -154,6 +155,7 @@ type
|
||||
function DarTiposOpDesTrimestral(var ListaCodigos: TStrings): TStrings;
|
||||
function ComprobarTrimestreFactura(CodigoFactura: String): Boolean;
|
||||
function AsignarTrimestre(CodigoFactura: String; CodigoTrimestre: String): Boolean;
|
||||
function ModificarSituacionFacturas(Codigos: TStrings; Situacion: String): Boolean;
|
||||
end;
|
||||
|
||||
var
|
||||
@ -1194,6 +1196,47 @@ begin
|
||||
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 }
|
||||
|
||||
procedure TDatosFacturaProveedor.AssignTo(Dest: TPersistent);
|
||||
|
||||
@ -84,13 +84,12 @@ object frCambiarSituacionFacturas: TfrCambiarSituacionFacturas
|
||||
object cbxSituacion: TcxComboBox
|
||||
Left = 96
|
||||
Top = 19
|
||||
Width = 169
|
||||
Height = 21
|
||||
ParentFont = False
|
||||
Properties.DropDownListStyle = lsFixedList
|
||||
Properties.ReadOnly = False
|
||||
Style.StyleController = dmConfiguracion.cxEstiloEditoresFondoClaro
|
||||
TabOrder = 0
|
||||
Width = 169
|
||||
end
|
||||
end
|
||||
object brDoble: TRdxBarraInferior
|
||||
|
||||
@ -29,7 +29,7 @@ uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
|
||||
cxDropDownEdit, StdCtrls, RdxBotones, RdxBarras, ExtCtrls,
|
||||
RdxPaneles, TablaTrimestres;
|
||||
RdxPaneles, TablaTrimestres, cxGraphics, Entidades;
|
||||
|
||||
type
|
||||
TfrCambiarSituacionFacturas = class(TForm)
|
||||
@ -46,12 +46,14 @@ type
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
private
|
||||
FEntidad: TRdxEntidad;
|
||||
FCodigosFacturas : TStringList;
|
||||
FSituacion : String;
|
||||
procedure SetSituacion(Value : String);
|
||||
public
|
||||
property CodigosFacturas : TStringList read FCodigosFacturas write FCodigosFacturas;
|
||||
property Situacion : String read FSituacion write SetSituacion;
|
||||
property Entidad: TRdxEntidad read FEntidad Write FEntidad;
|
||||
end;
|
||||
|
||||
var
|
||||
@ -60,16 +62,22 @@ var
|
||||
implementation
|
||||
|
||||
uses
|
||||
Mensajes, Literales, BaseDatos, Configuracion, Entidades, RdxEmpresaActiva,
|
||||
TablaFacturasCliente, StrFunc;
|
||||
Mensajes, Literales, BaseDatos, Configuracion, RdxEmpresaActiva,
|
||||
TablaFacturasCliente, TablaFacturasProveedor, StrFunc, Math;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrCambiarSituacionFacturas.bAceptarClick(Sender: TObject);
|
||||
var
|
||||
Indice :Integer;
|
||||
Resultado: Boolean;
|
||||
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
|
||||
dmBaseDatos.Rollback;
|
||||
exit;
|
||||
@ -81,6 +89,7 @@ end;
|
||||
procedure TfrCambiarSituacionFacturas.FormCreate(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
FEntidad := entFacturaCliente; //Por defecto tratara los documentos de facturas de cliente
|
||||
FCodigosFacturas := TStringList.Create;
|
||||
cbxSituacion.Properties.Items := dmTablaFacturasCliente.DarSituaciones;
|
||||
cbxSituacion.ItemIndex := 0;
|
||||
|
||||
@ -343,6 +343,7 @@ object frFacturasClientes: TfrFacturasClientes
|
||||
OptionsView.GridLines = glHorizontal
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.HeaderEndEllipsis = True
|
||||
OptionsView.NewItemRowInfoText = 'Click here to add a new row'
|
||||
OptionsView.RowSeparatorColor = 14280169
|
||||
Styles.StyleSheet = dmConfiguracion.StyleSheetGrid
|
||||
end
|
||||
|
||||
@ -468,6 +468,7 @@ var
|
||||
|
||||
begin
|
||||
fCambiarSituacionFacturas := TfrCambiarSituacionFacturas.Create(Self);
|
||||
fCambiarSituacionFacturas.Entidad := entFacturaCliente;
|
||||
|
||||
//Rellenamos la propiedad de la unidad CambiarSituacion con los códigos seleccionados
|
||||
IndiceCol1 := gridFacturasDBTableView1.GetColumnByFieldName('CODIGO').Index;
|
||||
|
||||
Binary file not shown.
@ -83,6 +83,8 @@ type
|
||||
eNombre: TLabel;
|
||||
Buscar: TcxTextEdit;
|
||||
bLimpiar: TRdxBoton;
|
||||
bFacturar: TRdxBoton;
|
||||
actCambiarSituacion: TAction;
|
||||
procedure RdxFrameFacturasProveedorShow(Sender: TObject);
|
||||
procedure actAnadirExecute(Sender: TObject);
|
||||
procedure actModificarExecute(Sender: TObject);
|
||||
@ -101,6 +103,7 @@ type
|
||||
procedure actRefrescarDatosExecute(Sender: TObject);
|
||||
procedure BuscarPropertiesChange(Sender: TObject);
|
||||
procedure bLimpiarClick(Sender: TObject);
|
||||
procedure actCambiarSituacionExecute(Sender: TObject);
|
||||
private
|
||||
procedure ActualizarBotones;
|
||||
protected
|
||||
@ -123,7 +126,7 @@ implementation
|
||||
|
||||
{ TfrFacturasProveedores }
|
||||
uses
|
||||
BaseDatos, TablaFacturasProveedor, IBDatabase,
|
||||
BaseDatos, TablaFacturasProveedor, IBDatabase, CambiarSituacionFacturas,
|
||||
IBCustomDataSet, Mensajes, Entidades, Variants,
|
||||
FacturaProveedor, Constantes, FacturasProveedorPendientes, TablaEmpresas,
|
||||
Configuracion;
|
||||
@ -332,4 +335,27 @@ begin
|
||||
Buscar.Text := '';
|
||||
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.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
ACANA DAVID T=david:t:\Codigo Acana\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 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 alcala=acana.dynalias.org:c:\rodax software\factuges acana\bd\acana.gdb
|
||||
|
||||
|
||||
Reference in New Issue
Block a user