Compare commits

...

3 Commits

23 changed files with 728 additions and 581 deletions

View File

@ -20,6 +20,11 @@
---------------------------------------------------------------------------
02-02-2004 Se ha eliminado el atributo SERIE (P8 MULTIEMPRESA)
Se ha adaptado a los nuevos contadores
31-05-2007 Se cambia sentencia sqlConsultarGridFacturasProvContrato para que en el beneficio por contrato salgan las facturas
de proveedor de todas las empresas (A y B) así podré calcular el beneficio en general
teniendo en cuenta facturación en A y en B
===============================================================================
}
@ -154,6 +159,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
@ -672,7 +678,10 @@ begin
Add('where fac.codigoempresa = det.codigoempresa');
Add(' and fac.codigo = det.codigofactura');
Add(' and det.codigocontrato = :CODIGOCONTRATO');
Add(' and fac.codigoempresa = :CODIGOEMPRESA');
//Se cambia sentencia SQL para que en el beneficio por contrato salgan las facturas
//de proveedor de todas las empresas (A y B) así podré calcular el beneficio en general
//teniendo en cuenta facturación en A y en B
// Add(' and fac.codigoempresa = :CODIGOEMPRESA');
end;
end;
@ -1194,6 +1203,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);

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -114,7 +114,7 @@ IncludeVerInfo=1
AutoIncBuild=0
MajorVer=3
MinorVer=0
Release=4
Release=5
Build=0
Debug=0
PreRelease=0
@ -126,7 +126,7 @@ CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=3.0.4.0
FileVersion=3.0.5.0
InternalName=
LegalCopyright=
LegalTrademarks=

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@ -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.

View File

@ -1,3 +1,4 @@
[BD]
UECKO ARMARIOS DAVID=david:D:\Proyectos\FactuGES 2000 v2 (Uecko)\Codigo\BD\uecko.gdb
UECKO ARMARIOS ROBERTO T=roberto:T:\Uecko\bd\uecko.gdb

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.