Bom Dia Isaque,
Eu foi no código fonte do componente como vc sugeriu, fiz a checagem e o código está exatamente como vc mencionou no topico anterior. Porem fiz apenas um teste de tirar a condição que testa se a quantidade de registro é maior que zero pra ver o que aconteceria. então deixei o codigo assim:
unit AcBRSpedPisCofins linha 1745
// if Bloco_F.RegistroF550Count > 0 then
// begin
with New do
begin
REG_BLC := 'F550';
QTD_REG_BLC := Bloco_F.RegistroF550Count;
end;
//end;
Com este comentário a linha foi gerada |9900|F550|0| , mas com 0 (zero) registros.
Me parece que o problema possa estar onde a variavel RegistroF550Count é gerada. Pois no meu arquivo tenho 6 registros do tipo F550.
Vou postar aqui o codigo que estou usando para gerar este registro, talvez eu esteja fazendo de maneira errada.
procedure TFrmSPEDPisCofins.btnB_FClick(Sender: TObject);
var
intF550 :integer;
intF560 :integer;
DINICIAL, DFINAL :string;
aliq : double;
iCFOP,erro :integer;
begin
// Alimenta o componente com informações para gerar todos os registros do
// Bloco F.
DINICIAL := formatdatetime('dd/mm/yyyy', DtINICIAL.Date);
DFINAL := formatdatetime('dd/mm/yyyy', DtFINAL.Date);
with ACBrSPEDPisCofins1.Bloco_F do
begin
with RegistroF001New do
begin
IND_MOV := imComDados;
with RegistroF010New do
begin
CNPJ := DmsPED.quEmpresaCNPJ.AsString;
//
//
//OPERAÇÕES CON NOTAS FISCAIS DE SAÍDA
//MONTANTE DE NOTAS DE SAIDAAS
//não gerea nenhum registro no sped diretamente, apenas mostra na aba, produtos X cfop X Cst_Pis X Cst_Cofins
with DmSped.quNF_Saida do
begin
close;
parambyname('di').AsString := DINICIAL;
parambyname('df').AsString := DFINAL;
open;
First;
lbTotProdCfop.Caption:=inttostr(RecordCount);
end;
with DmSped.quRegF550 do
begin
close;
parambyname('di').AsString := DINICIAL;
parambyname('df').AsString := DFINAL;
open;
First;
end;
// criar rotina para tratar apenas a escrituração do mes
dmSped.quGravaRegF550.Open;
FOR intF550 := 1 to DmSped.quRegF550.RecordCount do
begin
with RegistroF550New do
begin
VL_REC_COMP := DmSped.quRegF550VLR_REC_COMP.Value ;
IF DmSped.quRegF550CST_PIS.Value = '01' then CST_PIS := stpisValorAliquotaNormal ;
IF DmSped.quRegF550CST_PIS.Value = '02' then CST_PIS := stpisValorAliquotaDiferenciada ;
IF DmSped.quRegF550CST_PIS.Value = '03' then CST_PIS := stpisQtdeAliquotaUnidade ;
IF DmSped.quRegF550CST_PIS.Value = '04' then CST_PIS := stpisMonofaticaAliquotaZero ;
IF DmSped.quRegF550CST_PIS.Value = '05' then CST_PIS := stpisValorAliquotaPorST ;
IF DmSped.quRegF550CST_PIS.Value = '06' then CST_PIS := stpisAliquotaZero ;
IF DmSped.quRegF550CST_PIS.Value = '07' then CST_PIS := stpisIsentaContribuicao ;
IF DmSped.quRegF550CST_PIS.Value = '08' then CST_PIS := stpisSemIncidenciaContribuicao ;
IF DmSped.quRegF550CST_PIS.Value = '09' then CST_PIS := stpisSuspensaoContribuicao ;
IF DmSped.quRegF550CST_PIS.Value = '49' then CST_PIS := stpisOutrasOperacoesSaida ;
IF DmSped.quRegF550CST_PIS.Value = '50' then CST_PIS := stpisOperCredExcRecTribMercInt ;
IF DmSped.quRegF550CST_PIS.Value = '51' then CST_PIS := stpisOperCredExcRecNaoTribMercInt ;
IF DmSped.quRegF550CST_PIS.Value = '52' then CST_PIS := stpisOperCredExcRecExportacao ;
IF DmSped.quRegF550CST_PIS.Value = '53' then CST_PIS := stpisOperCredRecTribNaoTribMercInt ;
IF DmSped.quRegF550CST_PIS.Value = '54' then CST_PIS := stpisOperCredRecTribMercIntEExportacao ;
IF DmSped.quRegF550CST_PIS.Value = '55' then CST_PIS := stpisOperCredRecNaoTribMercIntEExportacao ;
IF DmSped.quRegF550CST_PIS.Value = '56' then CST_PIS := stpisOperCredRecTribENaoTribMercIntEExportacao ;
IF DmSped.quRegF550CST_PIS.Value = '60' then CST_PIS := stpisCredPresAquiExcRecTribMercInt ;
IF DmSped.quRegF550CST_PIS.Value = '61' then CST_PIS := stpisCredPresAquiExcRecNaoTribMercInt ;
IF DmSped.quRegF550CST_PIS.Value = '62' then CST_PIS := stpisCredPresAquiExcExcRecExportacao ;
IF DmSped.quRegF550CST_PIS.Value = '63' then CST_PIS := stpisCredPresAquiRecTribNaoTribMercInt ;
IF DmSped.quRegF550CST_PIS.Value = '64' then CST_PIS := stpisCredPresAquiRecTribMercIntEExportacao ;
IF DmSped.quRegF550CST_PIS.Value = '65' then CST_PIS := stpisCredPresAquiRecNaoTribMercIntEExportacao ;
IF DmSped.quRegF550CST_PIS.Value = '66' then CST_PIS := stpisCredPresAquiRecTribENaoTribMercIntEExportacao ;
IF DmSped.quRegF550CST_PIS.Value = '67' then CST_PIS := stpisOutrasOperacoes_CredPresumido ;
IF DmSped.quRegF550CST_PIS.Value = '70' then CST_PIS := stpisOperAquiSemDirCredito ;
IF DmSped.quRegF550CST_PIS.Value = '71' then CST_PIS := stpisOperAquiComIsensao ;
IF DmSped.quRegF550CST_PIS.Value = '72' then CST_PIS := stpisOperAquiComSuspensao ;
IF DmSped.quRegF550CST_PIS.Value = '73' then CST_PIS := stpisOperAquiAliquotaZero ;
IF DmSped.quRegF550CST_PIS.Value = '74' then CST_PIS := stpisOperAqui_SemIncidenciaContribuicao ;
IF DmSped.quRegF550CST_PIS.Value = '75' then CST_PIS := stpisOperAquiPorST ;
IF DmSped.quRegF550CST_PIS.Value = '98' then CST_PIS := stpisOutrasOperacoesEntrada ;
IF DmSped.quRegF550CST_PIS.Value = '99' then CST_PIS := stpisOutrasOperacoes ;
VL_DESC_PIS := DmSped.quRegF550VL_DESC_PIS.Value ;
VL_BC_PIS := DmSped.quRegF550BC_PIS.Value ;
ALIQ_PIS := DmSped.quRegF550ALIQ_PIS.Value ;
VL_PIS := DmSped.quRegF550VL_PIS.Value ;
IF DmSped.quRegF550CST_COFINS.Value = '01' THEN CST_COFINS := stcofinsValorAliquotaNormal ;
IF DmSped.quRegF550CST_COFINS.Value = '02' THEN CST_COFINS := stcofinsValorAliquotaDiferenciada ;
IF DmSped.quRegF550CST_COFINS.Value = '03' THEN CST_COFINS := stcofinsQtdeAliquotaUnidade ;
IF DmSped.quRegF550CST_COFINS.Value = '04' THEN CST_COFINS := stcofinsMonofaticaAliquotaZero ;
IF DmSped.quRegF550CST_COFINS.Value = '05' THEN CST_COFINS := stcofinsValorAliquotaPorST ;
IF DmSped.quRegF550CST_COFINS.Value = '06' THEN CST_COFINS := stcofinsAliquotaZero ;
IF DmSped.quRegF550CST_COFINS.Value = '07' THEN CST_COFINS := stcofinsIsentaContribuicao ;
IF DmSped.quRegF550CST_COFINS.Value = '08' THEN CST_COFINS := stcofinsSemIncidenciaContribuicao ;
IF DmSped.quRegF550CST_COFINS.Value = '09' THEN CST_COFINS := stcofinsSuspensaoContribuicao ;
IF DmSped.quRegF550CST_COFINS.Value = '49' THEN CST_COFINS := stcofinsOutrasOperacoesSaida ;
IF DmSped.quRegF550CST_COFINS.Value = '50' THEN CST_COFINS := stcofinsOperCredExcRecTribMercInt ;
IF DmSped.quRegF550CST_COFINS.Value = '51' THEN CST_COFINS := stcofinsOperCredExcRecNaoTribMercInt ;
IF DmSped.quRegF550CST_COFINS.Value = '52' THEN CST_COFINS := stcofinsOperCredExcRecExportacao ;
IF DmSped.quRegF550CST_COFINS.Value = '53' THEN CST_COFINS := stcofinsOperCredRecTribNaoTribMercInt ;
IF DmSped.quRegF550CST_COFINS.Value = '54' THEN CST_COFINS := stcofinsOperCredRecTribMercIntEExportacao ;
IF DmSped.quRegF550CST_COFINS.Value = '55' THEN CST_COFINS := stcofinsOperCredRecNaoTribMercIntEExportacao ;
IF DmSped.quRegF550CST_COFINS.Value = '56' THEN CST_COFINS := stcofinsOperCredRecTribENaoTribMercIntEExportacao ;
IF DmSped.quRegF550CST_COFINS.Value = '60' THEN CST_COFINS := stcofinsCredPresAquiExcRecTribMercInt ;
IF DmSped.quRegF550CST_COFINS.Value = '61' THEN CST_COFINS := stcofinsCredPresAquiExcRecNaoTribMercInt ;
IF DmSped.quRegF550CST_COFINS.Value = '62' THEN CST_COFINS := stcofinsCredPresAquiExcExcRecExportacao ;
IF DmSped.quRegF550CST_COFINS.Value = '63' THEN CST_COFINS := stcofinsCredPresAquiRecTribNaoTribMercInt ;
IF DmSped.quRegF550CST_COFINS.Value = '64' THEN CST_COFINS := stcofinsCredPresAquiRecTribMercIntEExportacao ;
IF DmSped.quRegF550CST_COFINS.Value = '65' THEN CST_COFINS := stcofinsCredPresAquiRecNaoTribMercIntEExportacao ;
IF DmSped.quRegF550CST_COFINS.Value = '66' THEN CST_COFINS := stcofinsCredPresAquiRecTribENaoTribMercIntEExportacao ;
IF DmSped.quRegF550CST_COFINS.Value = '67' THEN CST_COFINS := stcofinsOutrasOperacoes_CredPresumido ;
IF DmSped.quRegF550CST_COFINS.Value = '70' THEN CST_COFINS := stcofinsOperAquiSemDirCredito ;
IF DmSped.quRegF550CST_COFINS.Value = '71' THEN CST_COFINS := stcofinsOperAquiComIsensao ;
IF DmSped.quRegF550CST_COFINS.Value = '72' THEN CST_COFINS := stcofinsOperAquiComSuspensao ;
IF DmSped.quRegF550CST_COFINS.Value = '73' THEN CST_COFINS := stcofinsOperAquiAliquotaZero ;
IF DmSped.quRegF550CST_COFINS.Value = '74' THEN CST_COFINS := stcofinsOperAqui_SemIncidenciaContribuicao ;
IF DmSped.quRegF550CST_COFINS.Value = '75' THEN CST_COFINS := stcofinsOperAquiPorST ;
IF DmSped.quRegF550CST_COFINS.Value = '98' THEN CST_COFINS := stcofinsOutrasOperacoesEntrada ;
IF DmSped.quRegF550CST_COFINS.Value = '99' THEN CST_COFINS := stcofinsOutrasOperacoes ;
VL_DESC_COFINS := mSped.quRegF550VL_DESC_COFINS.Value ;
VL_BC_COFINS := DmSped.quRegF550BC_COFINS.Value ;
ALIQ_COFINS := DmSped.quRegF550ALIQ_COFINS.Value ;
VL_COFINS := DmSped.quRegF550VL_COFINS.Value ;
COD_MOD := DmSped.quRegF550COD_MOD.Value ;
CFOP := strtoint(DmSped.quRegF550CFOP.Value) ;
COD_CTA := DmSped.quRegF550COD_CTA.Value ;
INFO_COMPL := DmSped.quRegF550INFO_COMPL.Value ;
end;
DmSped.quGravaRegF550.Append;
DmSped.quGravaRegF550VL_REC_COMP.Value := DmSped.quRegF550VLR_REC_COMP.Value ;
DmSped.quGravaRegF550CST_PIS.Value := DmSped.quRegF550CST_PIS.Value ;
DmSped.quGravaRegF550VL_DESC_PIS.Value := DmSped.quRegF550VL_DESC_PIS.Value ;
DmSped.quGravaRegF550VL_BC_PIS.Value := DmSped.quRegF550BC_PIS.Value ;
DmSped.quGravaRegF550ALIQ_PIS.Value := DmSped.quRegF550ALIQ_PIS.Value ;
DmSped.quGravaRegF550VL_PIS.Value := DmSped.quRegF550VL_PIS.Value ;
DmSped.quGravaRegF550CST_COFINS.Value := DmSped.quRegF550CST_COFINS.Value ;
DmSped.quGravaRegF550VL_DESC_COFINS.Value := DmSped.quRegF550VL_DESC_COFINS.Value ;
DmSped.quGravaRegF550VL_BC_COFINS.Value := DmSped.quRegF550BC_COFINS.Value ;
DmSped.quGravaRegF550ALIQ_COFINS.Value := DmSped.quRegF550ALIQ_COFINS.Value ;
DmSped.quGravaRegF550VL_COFINS.Value := DmSped.quRegF550VL_COFINS.Value ;
DmSped.quGravaRegF550COD_MOD.Value := DmSped.quRegF550COD_MOD.Value ;
DmSped.quGravaRegF550CFOP.Value := DmSped.quRegF550CFOP.value ;
DmSped.quGravaRegF550COD_CTA.Value := DmSped.quRegF550COD_CTA.Value ;
DmSped.quGravaRegF550INFO_COMPLEMENTAR.Value := DmSped.quRegF550INFO_COMPL.Value ;
DmSped.quGravaRegF550.Post;
DmSped.quRegF550.Next;
end;
dmSped.quGravaRegF550.close;
end;
end;
end;
btnB_F.Enabled := false;
end;