Ver Mensaje Individual
  #3  
Antiguo 22-03-2005
Chaja Chaja is offline
No confirmado
 
Registrado: ago 2004
Ubicación: Mar del Plata
Posts: 238
Reputación: 0
Chaja Va por buen camino
Drag an Drop

Bueno es un poc largo pero vamos a ver:
en la grilla source no pones nada (por ahora). En la grilla Target pone en

procedure TFormAplicacionesCCCompra_2.wwDBGMovCCDragOver(Sender, Source: TObject; X,
Y: Integer; State: TDragState; var Accept: Boolean);
var coord:TGridCoord;
begin
inherited;
IF Source=wwDBGActa THEN
accept:=True
ELSE
Accept:=False;
end;

y en

procedure TFormAplicacionesCCCompra_2.wwDBGMovCCDragDrop(Sender, Source: TObject; X,
Y: Integer);
begin
inherited;
IF (Moneda3D(' ',MascaraGral, wwCDSMovCCSALDO.Value))>0 Then
begin
wwCDSAplicaciones.Insert;
wwCDSAplicacionesID_MOV.Value := IBGId_AplicacionCCCompra.Increment(1);
wwCDSAplicacionesID_MOVCCCOMPRA.Value := wwCDSMovCCID_MOVCCCOMPRA.Value;
wwCDSAplicacionesAPLICA_ID_CPBTE.Value := wwCDSMovCCID_CPBTE.Value;
wwCDSAplicacionesAPLICA_TIPOCPBTE.Value := wwCDSMovCCTIPOCPBTE.Value;
wwCDSAplicacionesAPLICA_CLASECPBTE.Value:= wwCDSMovCCCLASECPBTE.Value;
wwCDSAplicacionesAPLICA_NROCPBTE.Value := wwCDSMovCCNROCPBTE.Value;
wwCDSAplicacionesDETALLE.Value := wwCDSMovCCDETALLE.Value;
with (Source as TwwDBGrid).DataSource.DataSet DO
begin
wwCDSAplicacionesIDMOVACTA.Value := wwCDSACtaID_MOV.Value;
wwCDSAplicacionesFECHA.Value := FieldByName('Fecha').Value;
wwCDSAplicacionesPROVEEDOR.Value := FieldByName('Proveedor').Value;
wwCDSAplicacionesID_CPBTE.Value := FieldByName('Id_Cpbte').Value;
wwCDSAplicacionesTIPOCPBTE.Value := FieldByName('TipoCpbte').Value;
wwCDSAplicacionesCLASECPBTE.Value := FieldByName('ClaseCpbte').Value;
wwCDSAplicacionesNUMEROCPBTE.Value := FieldByName('NumeroCpbte').Value;
IF Moneda3d(' ',MascaraGral, FieldByName('Importe').Value)<=Moneda3d(' ',MascaraGral, wwCDSMovCCSALDO.Value) Then
wwCDSAplicacionesIMPORTE.Value :=FieldByName('Importe').Value
else
wwCDSAplicacionesIMPORTE.Value :=wwCDSMovCCSALDO.Value;
end;
wwCDSAplicaciones.Post;
end
else
ShowMessage('Comprobante con saldo 0(cero), no se pude aplicar pagos');
end;

Moneda es una funcion mia para acotar los decimales en los reales; La propiedad del DragMode en Automatico.

espero se entienda...
Responder Con Cita