Se arregla error en el módulo de referencias

git-svn-id: https://192.168.0.254/svn/Proyectos.Acana_FactuGES2/trunk@507 f4e31baf-9722-1c47-927c-6f952f962d4b
This commit is contained in:
roberto 2010-02-15 17:48:40 +00:00
parent d69666649c
commit c6e5b49604
2 changed files with 10 additions and 4 deletions

View File

@ -60,6 +60,9 @@ end;
procedure TReferenciasController.FiltrarEmpresa(AReferencias: IBizReferencia);
var
Condicion: TDAWhereExpression;
Condicion1: TDAWhereExpression;
Condicion2: TDAWhereExpression;
begin
if AReferencias.DataTable.Active then
AReferencias.DataTable.Active := False;
@ -67,9 +70,13 @@ begin
// Filtrar las facturas actuales por empresa
with AReferencias.DataTable.DynamicWhere do
begin
// (ID_EMPRESA >= ID)
Condicion := NewBinaryExpression(NewField('', fld_ReferenciasID_EMPRESA),
// (ID_EMPRESA = ID)
Condicion1 := NewBinaryExpression(NewField('', fld_ReferenciasID_EMPRESA),
NewConstant(AppFactuGES.EmpresaActiva.ID, datInteger), dboEqual);
// (ID_EMPRESA = NULL)
Condicion2 := NewBinaryExpression(NewField('', fld_ReferenciasID_EMPRESA), NewNull(), dboEqual);
Condicion := NewBinaryExpression(Condicion1, Condicion2, dboOr);
if IsEmpty then
Expression := Condicion

View File

@ -22,8 +22,7 @@ object srvReferencias: TsrvReferencias
Name = 'IBX'
SQL =
'SELECT '#10' ID, ID_EMPRESA, ID_TIENDA, CODIGO, VALOR, DESCRIPCIO' +
'N'#10' FROM'#10' REFERENCIAS'#10' WHERE ID_EMPRESA IS NULL'#10' OR {Where}' +
#10
'N'#10' FROM'#10' REFERENCIAS'#10' WHERE {Where}'#10
StatementType = stSQL
ColumnMappings = <
item