Fiz um ajuste no arquivo Betha.Provider.pas para ler o numero da nota e link do PDF após a consulta.
Também foi necessário um ajuste na Unit PadraoNacional.GravarXml.pas para gerar a TAG pAliq antes da tpRetISSQN. Pois da forma como estava o Betha rejeitava o DPS.
Neste caso talvez tenha que parametrizar, pois pode afetar para quando envio direto para o padrão nacional.
function TNFSeW_PadraoNacional.GerarXMLTributacaoMunicipal: TACBrXmlNode;
begin
Result := CreateElement('tribMun');
Result.AppendChild(AddNode(tcStr, '#1', 'tribISSQN', 1, 1, 1,
tribISSQNToStr(NFSe.Servico.Valores.tribMun.tribISSQN), ''));
if NFSe.Servico.Valores.tribMun.cPaisResult > 0 then
Result.AppendChild(AddNode(tcStr, '#1', 'cPaisResult', 2, 2, 0,
CodIBGEPaisToSiglaISO2(NFSe.Servico.Valores.tribMun.cPaisResult), ''));
if NFSe.Servico.Valores.tribMun.tribISSQN = tiImunidade then
Result.AppendChild(AddNode(tcStr, '#1', 'tpImunidade', 1, 1, 0,
tpImunidadeToStr(NFSe.Servico.Valores.tribMun.tpImunidade), ''));
Result.AppendChild(GerarXMLExigibilidadeSuspensa);
Result.AppendChild(GerarXMLBeneficioMunicipal);
Result.AppendChild(AddNode(tcDe2, '#1', 'pAliq', 1, 3, 0,
NFSe.Servico.Valores.tribMun.pAliq, ''));
Result.AppendChild(AddNode(tcStr, '#1', 'tpRetISSQN', 2, 2, 1,
tpRetISSQNToStr(NFSe.Servico.Valores.tribMun.tpRetISSQN), ''));
end;
Betha.Provider.pas