All Downloads are FREE. Search and download functionalities are using the official Maven repository.

coffeepot.br.sped.fiscal.arquivo.blocoC.RegC112 Maven / Gradle / Ivy

Go to download

Project to be used in Brazil to write file in accordance to local regulations. Este projeto é um mapeamento de classes Java para formatação e gravação do arquivo texto no layout definido para o SPED Fiscal.

There is a newer version: 1.0.0-Beta.21
Show newest version
/*
 * Copyright 2013 - Jeandeson O. Merelis
 */
package coffeepot.br.sped.fiscal.arquivo.blocoC;

import java.util.Date;

/*
 * #%L
 * coffeepot-br-sped-fiscal
 * %%
 * Copyright (C) 2013 Jeandeson O. Merelis
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */


import coffeepot.bean.wr.annotation.Field;
import coffeepot.bean.wr.annotation.Record;
import coffeepot.br.sped.fiscal.tipos.EnumCodificado;
import coffeepot.br.sped.fiscal.tipos.ParseException;
import lombok.Getter;
import lombok.Setter;

/**
 *
 * @author Jeandeson O. Merelis
 */
@Record(fields = {
    @Field(name = "", id=true, constantValue = "C112"),
    @Field(name = "codDa"),
    @Field(name = "uf"),
    @Field(name = "numDa"),
    @Field(name = "codAut"),
    @Field(name = "vlDa"),
    @Field(name = "dtVcto"),
    @Field(name = "dtPgto")
})
@Getter
@Setter
public class RegC112 {

    private DocumentoArrecadacao codDa;
    private String uf;
    private String numDa;
    private String codAut;
    private Double vlDa;
    private Date dtVcto;
    private Date dtPgto;

    public enum DocumentoArrecadacao implements EnumCodificado {

        ESTADUAL("0"),
        GNRE("1");
    	
        private String codigo;

        private DocumentoArrecadacao(String codigo) {
            this.codigo = codigo;
        }

        @Override
        public String getCodigo() {
            return codigo;
        }

        @Override
        public DocumentoArrecadacao parse(String codigo) throws ParseException {
            if ("0".equals(codigo)) {
                return ESTADUAL;
            }
            if ("1".equals(codigo)) {
                return GNRE;
            }
            throw new ParseException("Não foi possível converter o código \"" + codigo + "\" para o tipo RegC112.DocumentoArrecadacao");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy