CarmaZone
17-01-2006, 19:41:22
Hola a todos, no sabia si poner aki el post o en otro hilo porque es de tablas y de programacion general. El codigo es este:
with DataModule_Fact_Albar do
begin
while not(Query_Alb.Eof) do
begin
Query_Alb.DisableControls;
Query_Lin_Alb.First;
while not(Query_Lin_Alb.Eof) do
begin
Query_Lin_Alb.DisableControls;
Query_Lin_Resum_Alb.Append;
Query_Lin_Resum_AlbNUM_ALB.Value:=Query_Resum_AlbNUM_ALB.Value;
Query_Lin_Resum_AlbCANTIDAD.Value:=Query_Lin_AlbCANTIDAD.Value;
Query_Lin_Resum_AlbCONCEPTO.Value:=Query_Lin_AlbCONCEPTO.Value;
Query_Lin_Resum_AlbPRECIO_UNIDAD.Value:=Query_Lin_AlbPRECIOUNIDAD.Value;
Query_Lin_Resum_AlbTOTAL.Value:=Query_Lin_AlbTOTAL.Value;
Query_Lin_Resum_Alb.Post;
Query_Lin_Alb.EnableControls;
Query_Lin_Alb.Next;
end;
Query_Alb.EnableControls;
Query_Alb.Next;
end;
end;
Me explico, el codigo me coge varios albaranes y me va recorriendo su cuerpo para hacerme una convercion de "Varios Albaranes"" --> "A uno Solo", esto me lo hace bien. EL problema viene a que quiero que cuando me recorre lso albaranes me vaya poniendo a "SI" el campo convertido del albaran, para que cuando realize conversiones posteriores solo me coja los "Albaranes NO Convertidos", por lo que añado el codigo:
DataModule_Fact_Albar.Query_AlbConvertido.value:='SI';
Pero no me lo hace bien, me pone a "SI", el 1º y 3º y el 2º lo deja a "NO" :eek:, he probado a poner en todas partes del bucle, incluso lo puesto 2 y 3 veces xDDD y siempre me hace lo mismo, y además de no ponerme a "SI" todos los "albaranes convertidos", la conversion tambien la hace mal y sin esa linea convierte bien :confused::confused::confused:
Estoy un poco desesperado porque nose ya que probar jeje.
Gracias de antemano y Salu2!!!
with DataModule_Fact_Albar do
begin
while not(Query_Alb.Eof) do
begin
Query_Alb.DisableControls;
Query_Lin_Alb.First;
while not(Query_Lin_Alb.Eof) do
begin
Query_Lin_Alb.DisableControls;
Query_Lin_Resum_Alb.Append;
Query_Lin_Resum_AlbNUM_ALB.Value:=Query_Resum_AlbNUM_ALB.Value;
Query_Lin_Resum_AlbCANTIDAD.Value:=Query_Lin_AlbCANTIDAD.Value;
Query_Lin_Resum_AlbCONCEPTO.Value:=Query_Lin_AlbCONCEPTO.Value;
Query_Lin_Resum_AlbPRECIO_UNIDAD.Value:=Query_Lin_AlbPRECIOUNIDAD.Value;
Query_Lin_Resum_AlbTOTAL.Value:=Query_Lin_AlbTOTAL.Value;
Query_Lin_Resum_Alb.Post;
Query_Lin_Alb.EnableControls;
Query_Lin_Alb.Next;
end;
Query_Alb.EnableControls;
Query_Alb.Next;
end;
end;
Me explico, el codigo me coge varios albaranes y me va recorriendo su cuerpo para hacerme una convercion de "Varios Albaranes"" --> "A uno Solo", esto me lo hace bien. EL problema viene a que quiero que cuando me recorre lso albaranes me vaya poniendo a "SI" el campo convertido del albaran, para que cuando realize conversiones posteriores solo me coja los "Albaranes NO Convertidos", por lo que añado el codigo:
DataModule_Fact_Albar.Query_AlbConvertido.value:='SI';
Pero no me lo hace bien, me pone a "SI", el 1º y 3º y el 2º lo deja a "NO" :eek:, he probado a poner en todas partes del bucle, incluso lo puesto 2 y 3 veces xDDD y siempre me hace lo mismo, y además de no ponerme a "SI" todos los "albaranes convertidos", la conversion tambien la hace mal y sin esa linea convierte bien :confused::confused::confused:
Estoy un poco desesperado porque nose ya que probar jeje.
Gracias de antemano y Salu2!!!