MIT

Fórum sobre desenvolvimento de software para atender as exigências da legislação fiscal e tributária (NFe, NFCe, NFSe, SPEED, Projeto ACBr, TEF, ECD, EFD, etc.)

Moderador: Moderadores

JUDIVAN CONTABIL
Usuário Nível 2
Usuário Nível 2
Mensagens: 55
Registrado em: 20 Mai 2011 07:42
Localização: IMACULADA-PB

MIT

Mensagem por JUDIVAN CONTABIL »

Bom dia

Pessoal alguem tem algum exemplo de como desenvolver o MIT?
Ana Mitoooo
Usuário Nível 3
Usuário Nível 3
Mensagens: 118
Registrado em: 17 Out 2018 10:00
Localização: Sobradinho/DF

MIT

Mensagem por Ana Mitoooo »

Segue o código base:

Código: Selecionar todos

Proc Mit_Json()

   Local hMit := hb_Hash()
   Local cFile := "C:\Temp\" + ; // Pasta
            "00000000" + ; // CNPJ
            "-MIT-" + ;    // -MIT-
            StrZero( Year( Date() ), 2 ) + ;    // Ano
            StrZero( Month( Date() ), 2 ) + ;   // Mes
            '.json'
   
   hMit[ "$schema" ] := "http://json-schema.org/draft-07/schema#"
   hMit[ "PeriodoApuracao" ] := hb_Hash()
   hMit[ "PeriodoApuracao" ][ "MesApuracao" ] := StrZero( Month( Date() ), 2 )
   hMit[ "PeriodoApuracao" ][ "AnoApuracao" ] := StrZero( Year( Date() ), 2 )
   hMit[ "ListaEventosEspeciais" ] := hb_Hash()
   hMit[ "ListaEventosEspeciais" ][ "items" ] := hb_Hash()
   hMit[ "ListaEventosEspeciais" ][ "items" ][ "IdEvento" ] := 1   // 1..5
   hMit[ "ListaEventosEspeciais" ][ "items" ][ "DiaEvento" ] := 1  // 1..31
   hMit[ "ListaEventosEspeciais" ][ "items" ][ "TipoEvento" ] := 1 // 1..6
   hMit[ "DadosIniciais" ] := hb_Hash()
   hMit[ "DadosIniciais" ][ "SemMovimento" ] := .F.
   hMit[ "DadosIniciais" ][ "QualificacaoPj" ] := 1      // 1..12
   hMit[ "DadosIniciais" ][ "TributacaoLucro" ] := 1     // 1..7
   hMit[ "DadosIniciais" ][ "VariacoesMonetarias" ] := 1 // 1..3
   hMit[ "DadosIniciais" ][ "RegimePisCofins" ] := 1     // 1..4
   hMit[ "DadosIniciais" ][ "ResponsavelApuracao" ] := hb_Hash()
   hMit[ "DadosIniciais" ][ "ResponsavelApuracao" ][ "CpfResponsavel" ] := 'CPF'
   hMit[ "DadosIniciais" ][ "ResponsavelApuracao" ][ "TelResponsavel" ] := hb_Hash()
   hMit[ "DadosIniciais" ][ "ResponsavelApuracao" ][ "TelResponsavel" ][ "Ddd" ] := 'Ddd'
   hMit[ "DadosIniciais" ][ "ResponsavelApuracao" ][ "TelResponsavel" ][ "NumTelefone" ] := 'FONE'
   hMit[ "DadosIniciais" ][ "ResponsavelApuracao" ][ "EmailResponsavel" ] := 'FONE'
   hMit[ "DadosIniciais" ][ "ResponsavelApuracao" ][ "RegistroCrc" ] := hb_Hash()
   hMit[ "DadosIniciais" ][ "ResponsavelApuracao" ][ "RegistroCrc" ][ "UfRegistro" ] := ''
   hMit[ "DadosIniciais" ][ "ResponsavelApuracao" ][ "RegistroCrc" ][ "NumRegistro" ] := ''
   hMit[ "Debitos" ] := hb_Hash()
   hMit[ "Debitos" ][ "BalancoLucroReal" ] := .F. // Bool
   hMit[ "Debitos" ][ "Irpj" ] := hb_Hash()
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitos" ] := hb_Hash()
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitos" ][ "IdDebito" ] := 1         // 1..Z
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitos" ][ "IdEventoDebito" ] := 1   // 1..5
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitos" ][ "CodigoDebito" ] := ''    // nnnnnn
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitos" ][ "AnoPostergado" ] := ''  // nnnn
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitos" ][ "TrimPostergado" ] := 1   // 1..4
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitos" ][ "AnoDebito" ] := StrZero( Year( Date() ), 2 )   // nnnn
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitos" ][ "CnpjScp" ] := ''   // 1..4
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitos" ][ "ValorDebito" ] := 0   // v
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitosAposEvento" ] := hb_Hash()
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitosAposEvento" ][ "IdDebito" ] := 1         // 1..Z
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitosAposEvento" ][ "IdEventoDebito" ] := 1   // 1..5
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitosAposEvento" ][ "CodigoDebito" ] := ''    // nnnnnn
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitosAposEvento" ][ "AnoPostergado" ] := NIL  // nnnn
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitosAposEvento" ][ "TrimPostergado" ] := 1   // 1..4
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitosAposEvento" ][ "AnoDebito" ] := StrZero( Year( Date() ), 2 ) // nnnn
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitosAposEvento" ][ "CnpjScp" ] := ''         // 1..4
   hMit[ "Debitos" ][ "Irpj" ][ "ListaDebitosAposEvento" ][ "ValorDebito" ] := 0      // v
   hMit[ "Debitos" ][ "Csll" ] := hb_Hash()
   hMit[ "Debitos" ][ "Irrf" ] := hb_Hash()
   hMit[ "Debitos" ][ "Ipi" ] := hb_Hash()
   hMit[ "Debitos" ][ "Iof" ] := hb_Hash()
   hMit[ "Debitos" ][ "PisPasep" ] := hb_Hash()
   hMit[ "Debitos" ][ "Cofins" ] := hb_Hash()
   hMit[ "Debitos" ][ "ContribuicoesDiversas" ] := hb_Hash()
   hMit[ "Debitos" ][ "Cpss" ] := hb_Hash()
   hMit[ "RetPagamentoUnificado" ] := hb_Hash()

   hb_MemoWrit( cFile, hb_JsonEncode( hMit ) )

   Return
Responder