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

View File

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