Ver Mensaje Individual
  #939  
Antiguo 18-12-2023
nincillo nincillo is offline
Miembro
 
Registrado: may 2017
Posts: 151
Reputación: 8
nincillo Va por buen camino
Cita:
Empezado por nincillo Ver Mensaje
Me funcionó el "truco" que me sugeriste. Muchas gracias de nuevo.
Ahora he atascado en otro punto.
A ver si alguien me puede ayudar.
Estoy empezando a rellenar los diferentes apartados de la factura antes de enviarla y he atascado al llegar al punto "Desglose", que se supone que es un Array of Detail.

Este es el código que llevo desarrollado hasta ahora.

Código:
procedure TForm2.BtnEnvioFacturaClick(Sender: TObject);
var
  regFactura : FacturasEmitidasType;
  result : Array_Of_RespuestaExpedidaType;
  arrayFacturas : Array_Of_FacturasEmitidasType;
  arrayDetalles : array of DetalleType;
  detalle : DetalleType;
begin

  regFactura := FacturasEmitidasType.Create;
  regFactura.DatosControl := DatosControlType.Create;

  regFactura.RegistroFacturacion := RegistroFacturacionType.Create;

    regFactura.RegistroFacturacion.PeriodoLiquidacion := PeriodoLiquidacion.Create;
      regFactura.RegistroFacturacion.PeriodoLiquidacion.Ejercicio := '23';
      regFactura.RegistroFacturacion.PeriodoLiquidacion.Periodo := TipoPeriodoType(1); // Empieza a contar desde 0

    regFactura.RegistroFacturacion.IDFactura := IDFacturaExpedidaType.Create;
      regFactura.RegistroFacturacion.IDFactura.NumSerieFacturaEmisor := '23/123456';
      regFactura.RegistroFacturacion.IDFactura.FechaExpedicionFacturaEmisor := '31/12/23';
      regFactura.RegistroFacturacion.IDFactura.IDEmisorFactura := IDEmisorFactura2.Create;
        regFactura.RegistroFacturacion.IDFactura.IDEmisorFactura.NIF := '3333333';

    regFactura.RegistroFacturacion.DescripcionOperacion := 'vneta de mercaderías';

      regFactura.RegistroFacturacion.Desglose := DesgloseType.Create();

        detalle:= DetalleType.Create;
          detalle.CuotaRepercutida := '100';
          detalle.TipoImpositivo := '21';

        SetLength(arrayDetalles, 1);
        arrayDetalles[0] := detalle;

        regFactura.RegistroFacturacion.Desglose[0] := detalle;

  try
    SetLength(arrayFacturas, 1);
    arrayFacturas[0] := regFactura;
    result := GetsfSOAP(true, '', HTTPRIO1).AltaFactuSistemaFacturacion(arrayFacturas);
  finally
    regFactura.Destroy;
  end;


end;
Me respondo a mi mismo por si le puede servir a alguién:

Código:
          // <- Rellenos los datos de las diferentes bases DetalleType
            detalle1:= DetalleType.Create;
              detalle1.ClaveRegimen := IdOperacionesTrascendenciaTributariaType._01;                                
              detalle1.CalificacionOperacion := CalificacionOperacionType.S1;                                       
              detalle1.OperacionExenta := OperacionExentaType.E0;                                                      
              detalle1.TipoImpositivo := '21';
              detalle1.BaseImponibleOimporteNoSujeto := '123';
              detalle1.BaseImponibleACoste := '111';                                                                  
              detalle1.CuotaRepercutida := '100';
              detalle1.TipoRecargoEquivalencia := '0';
              detalle1.CuotaRecargoEquivalencia := '0';


            detalle2:= DetalleType.Create;
              detalle2.CuotaRepercutida := '200';
              detalle2.TipoImpositivo := '10';

            // Los añado todos en un array
            SetLength(arrayDetalles, 2);
              arrayDetalles[0] := detalle1;
              arrayDetalles[1] := detalle2;

            // Cargo el array con todas las posibles bases en el apartado Desglose
            regFactura.RegistroFacturacion.Desglose := arrayDetalles; // := deta .Create;


Por favor, ¿alguien que tenga Delphi 2007 podría intentar cargar a día de hoy los WSDL haber si puede o si le da error de "Document Empty"?.

Yo recuerdo haberlos importado hace unos meses sin problema, pero algo han modificado desde entonces que ahora no soy capaz.

Gracias.
Responder Con Cita