Jump to content

dev botao

  • Este tópico foi criado há 4489 dias atrás.
  • Talvez seja melhor você criar um NOVO TÓPICO do que postar uma resposta aqui.

Recommended Posts

Posted

Olá, pessoal, estou tendo problemas na geração do registro F550 (lucro presumido),

o componente esta gerando registros a mais do que é informado.

Não estou conseguindo encontrar onde esta o erro

 

with ACBrSPEDPisCofins1.Bloco_F do

 begin

    with RegistroF001New do

    begin

      if Copy(ComboBox4.Text, 0,1 ) = '2' then

         IND_MOV     := imComDados

       else

         IND_MOV     := imSemDados;

    end;

    with RegistroF010New do

    begin

        CNPJ     := _DMPRINCIPAL.sdsusuarioCNPJ.Value;;

    end;

  if Copy(ComboBox4.Text, 0,1 ) = '2' then

  begin

   with  dmSPEDPisCofins do

   begin

     qryRegF550.Close;

     qryRegF550.ParamByName('ini').AsDate  := JvDateEdit1.Date;

     qryRegF550.ParamByName('fim').AsDate  := JvDateEdit2.Date;

     qryRegF550.Open;

     while not qryRegF550.Eof do

     begin

       case AnsiIndexStr(qryRegF550CST_PIS.Value,

        ['01', '02','03','04','05','06','07','08','09','49']) of

        0: RegistroF550New.CST_PIS    := stpisValorAliquotaNormal;

        1: RegistroF550New.CST_PIS    := stpisValorAliquotaDiferenciada;

        2: RegistroF550New.CST_PIS    := stpisQtdeAliquotaUnidade;

        3: RegistroF550New.CST_PIS    := stpisMonofaticaAliquotaZero;

        4: RegistroF550New.CST_PIS    := stpisValorAliquotaPorST;

        5: RegistroF550New.CST_PIS    := stpisAliquotaZero;

        6: RegistroF550New.CST_PIS    := stpisIsentaContribuicao;

        7: RegistroF550New.CST_PIS    := stpisSemIncidenciaContribuicao;

        8: RegistroF550New.CST_PIS    := stpisSuspensaoContribuicao;

        9: RegistroF550New.CST_PIS    := stpisOutrasOperacoesSaida;

       end;

       case AnsiIndexStr(qryRegF550CST_COFINS.Value,

        ['01', '02','03','04','05','06','07','08','09','49']) of

        0: RegistroF550New.CST_COFINS    := stcofinsValorAliquotaNormal;

        1: RegistroF550New.CST_COFINS    := stcofinsValorAliquotaDiferenciada;

        2: RegistroF550New.CST_COFINS    := stcofinsQtdeAliquotaUnidade;

        3: RegistroF550New.CST_COFINS    := stcofinsMonofaticaAliquotaZero;

        4: RegistroF550New.CST_COFINS    := stcofinsValorAliquotaPorST;

        5: RegistroF550New.CST_COFINS    := stcofinsAliquotaZero;

        6: RegistroF550New.CST_COFINS    := stcofinsIsentaContribuicao;

        7: RegistroF550New.CST_COFINS    := stcofinsSemIncidenciaContribuicao;

        8: RegistroF550New.CST_COFINS    := stcofinsSuspensaoContribuicao;

        9: RegistroF550New.CST_COFINS    := stcofinsOutrasOperacoesSaida;

       end;

         RegistroF550New.CFOP            := StrToInt(qryRegF550CFOP.Value);

         RegistroF550New.VL_BC_PIS       := qryRegF550BC_PIS.Value;

         RegistroF550New.VL_PIS          := qryRegF550PIS.Value;

         RegistroF550New.VL_BC_COFINS    := qryRegF550BC_COFINS.Value;

         RegistroF550New.VL_COFINS       := qryRegF550COFINS.Value;

         RegistroF550New.VL_REC_COMP     := qryRegF550PIS.Value + qryRegF550COFINS.Value;

         RegistroF550New.COD_MOD         := '55';

       qryRegF550.Next;

     end;

    end;

 end;   // fim f550

 

ao componente é informado apenas 16 registros :

CFOP  CST_PIS  CST_COFINS  BC_PIS     BC_COFINS  PIS      COFINS

1202  02               02                     225            225                1,46      6,75  

5102  02               02                    6842           6842              44,28    205,26  

5403  01               01                    5273,96      5273,96          86,98    400,81  

5403  02               02                    976790,94  976626,44      6337,74  29303,22  

5411  02               02                    2914,76      2914,76          18,9     87,41  

5903  02              02                    183             183                 1,18      5,49  

5933  01              01                    4500            4500              29,25       135  

5933  02              02                   329981,18   329981,18      2143,84    9898,6  

5949  02              02                   4272,06       4272,06          27,74    128,14  

6102  02              02                   57                 57                  0,36      1,71  

6402  02              02                   80                 80                  0,52       2,4  

6403  01              01                   5974,9          5974,9          98,54    454,06  

6403  01              1                    95,89             95,89            1,58      7,28  

6403  02              02                 106391,2       106391,2       690,73   3191,69  

6933  02              02                 59799,76       59799,76       388,58   1793,96  

6949  02              02                 5143,44         5143,44         33,42    154,28

 

mais é gerado o seguinte bloco com valores zerados:

 

|F550|0,00|02|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|02|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||5102|||

|F550|0,00|01|0,00|4638,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|30,10|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|4638,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|139,14||0000|||

|F550|169,24|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00|55|0000|||

|F550|0,00|02|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|02|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||5403|||

|F550|0,00|01|0,00|176986,57|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|1151,54|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|176986,57|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|5309,55||0000|||

|F550|6461,09|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00|55|0000|||

|F550|0,00|02|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|02|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||5933|||

|F550|0,00|01|0,00|58823,28|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|382,54|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|58823,28|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|1764,68||0000|||

|F550|2147,22|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00|55|0000|||

|F550|0,00|02|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|02|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||6402|||

|F550|0,00|01|0,00|80,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,52|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|80,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|2,40||0000|||

|F550|2,92|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00|55|0000|||

|F550|0,00|02|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|02|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||6403|||

|F550|0,00|01|0,00|11292,50|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|73,43|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|11292,50|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|338,77||0000|||

|F550|412,20|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00|55|0000|||

|F550|0,00|02|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|02|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||6933|||

|F550|0,00|01|0,00|660,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|4,29|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|660,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|19,80||0000|||

|F550|24,09|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00||0000|||

|F550|0,00|01|0,00|0,00|0,0000|0,00|01|0,00|0,00|0,0000|0,00|55|0000|||

 

 

 

 

  • Membros Pro
Posted

Rodrigo , ta muito zuada sua rotina campeão :

 

1 - vc esta informando com hierarquia errada , veja :

 

...errado :

 

with ACBrSPEDPisCofins1.Bloco_F do

 begin

    with RegistroF001New do

    begin

      if Copy(ComboBox4.Text, 0,1 ) = '2' then

         IND_MOV     := imComDados

       else

         IND_MOV     := imSemDados;

    end; // -- Vc fecha o registro pai (Hierarquia = 1)

    with RegistroF010New do   // Errado Registro Filho do F001 (Hierarquia = 2)

    begin

        CNPJ     := _DMPRINCIPAL.sdsusuarioCNPJ.Value;;

    end;

 

 

... correto :

 

with ACBrSPEDPisCofins1.Bloco_F do

 begin

    with RegistroF001New do

    begin

      if Copy(ComboBox4.Text, 0,1 ) = '2' then

         IND_MOV     := imComDados

         else

         IND_MOV     := imSemDados;

 

         with RegistroF010New do   // Coloque o Registro Filho F010 (Hierarquia = 2) dentro do F001 (Hierarquia = 1)

          begin

          CNPJ     := _DMPRINCIPAL.sdsusuarioCNPJ.Value;;

          end;

 

    end ;

 end;

 

 

2 - Isso aqui não existe  --->>>> RegistroF550New.CST_COFINS    := stcofinsValorAliquotaPorST ;

 

...todas as vezes que for informar um registro NEW com ACBrSped... é assim :

 

with RegistroF550New do  // Nesse formato para todos os Registros do Sped de todos os blocos !

  begin  

  VL_REC_COMP :=

  CST_PIS :=

  ... etc...

  end ;

 

  • Like 1
  • Este tópico foi criado há 4489 dias atrás.
  • Talvez seja melhor você criar um NOVO TÓPICO do que postar uma resposta aqui.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.