package it.integry.integrywmsnative.gest.prod_recupero_materiale.dto;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;

import it.integry.integrywmsnative.core.model.MtbAart;
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;

public class HistoryVersamentoProdULDTO {

    private String gestione;
    private String dataCollo;
    private String serCollo;
    private Integer numCollo;
    private String segno;
    private String codMart;
    private String codCol;
    private String codTagl;
    private String codJfas;
    private String descrizioneFase;
    private BigDecimal qtaCol;
    private BigDecimal numCnf;
    private String partitaMag;
    private String codJcom;
    private String datetimeRow;
    private String descrizioneArt;
    private String untMis;
    private String gestioneRif;
    private String dataColloRif;
    private String serColloRif;
    private Integer numColloRif;

    private List<HistoryVersamentoProdULDTO.OrdineDto> ordini;

    private MtbAart mtbAart;

    public BigDecimal getQtaCnf() {
        if(UtilityBigDecimal.equalsTo(numCnf, BigDecimal.ZERO)) return BigDecimal.ONE;
        return qtaCol.divide(numCnf, 3, RoundingMode.HALF_EVEN);
    }

    public String getGestione() {
        return gestione;
    }

    public HistoryVersamentoProdULDTO setGestione(String gestione) {
        this.gestione = gestione;
        return this;
    }

    public String getDataCollo() {
        return dataCollo;
    }

    public HistoryVersamentoProdULDTO setDataCollo(String dataCollo) {
        this.dataCollo = dataCollo;
        return this;
    }

    public String getSerCollo() {
        return serCollo;
    }

    public HistoryVersamentoProdULDTO setSerCollo(String serCollo) {
        this.serCollo = serCollo;
        return this;
    }

    public Integer getNumCollo() {
        return numCollo;
    }

    public HistoryVersamentoProdULDTO setNumCollo(Integer numCollo) {
        this.numCollo = numCollo;
        return this;
    }

    public String getSegno() {
        return segno;
    }

    public HistoryVersamentoProdULDTO setSegno(String segno) {
        this.segno = segno;
        return this;
    }

    public String getCodMart() {
        return codMart;
    }

    public HistoryVersamentoProdULDTO setCodMart(String codMart) {
        this.codMart = codMart;
        return this;
    }

    public String getCodCol() {
        return codCol;
    }

    public HistoryVersamentoProdULDTO setCodCol(String codCol) {
        this.codCol = codCol;
        return this;
    }

    public String getCodTagl() {
        return codTagl;
    }

    public HistoryVersamentoProdULDTO setCodTagl(String codTagl) {
        this.codTagl = codTagl;
        return this;
    }

    public String getCodJfas() {
        return codJfas;
    }

    public HistoryVersamentoProdULDTO setCodJfas(String codJfas) {
        this.codJfas = codJfas;
        return this;
    }

    public String getDescrizioneFase() {
        return descrizioneFase;
    }

    public HistoryVersamentoProdULDTO setDescrizioneFase(String descrizioneFase) {
        this.descrizioneFase = descrizioneFase;
        return this;
    }

    public BigDecimal getQtaCol() {
        return qtaCol;
    }

    public HistoryVersamentoProdULDTO setQtaCol(BigDecimal qtaCol) {
        this.qtaCol = qtaCol;
        return this;
    }

    public BigDecimal getNumCnf() {
        return numCnf;
    }

    public HistoryVersamentoProdULDTO setNumCnf(BigDecimal numCnf) {
        this.numCnf = numCnf;
        return this;
    }

    public String getPartitaMag() {
        return partitaMag;
    }

    public HistoryVersamentoProdULDTO setPartitaMag(String partitaMag) {
        this.partitaMag = partitaMag;
        return this;
    }

    public String getCodJcom() {
        return codJcom;
    }

    public HistoryVersamentoProdULDTO setCodJcom(String codJcom) {
        this.codJcom = codJcom;
        return this;
    }

    public String getDatetimeRow() {
        return datetimeRow;
    }

    public HistoryVersamentoProdULDTO setDatetimeRow(String datetimeRow) {
        this.datetimeRow = datetimeRow;
        return this;
    }

    public String getDescrizioneArt() {
        return descrizioneArt;
    }

    public HistoryVersamentoProdULDTO setDescrizioneArt(String descrizioneArt) {
        this.descrizioneArt = descrizioneArt;
        return this;
    }

    public String getUntMis() {
        return untMis;
    }

    public HistoryVersamentoProdULDTO setUntMis(String untMis) {
        this.untMis = untMis;
        return this;
    }

    public String getGestioneRif() {
        return gestioneRif;
    }

    public HistoryVersamentoProdULDTO setGestioneRif(String gestioneRif) {
        this.gestioneRif = gestioneRif;
        return this;
    }

    public String getDataColloRif() {
        return dataColloRif;
    }

    public HistoryVersamentoProdULDTO setDataColloRif(String dataColloRif) {
        this.dataColloRif = dataColloRif;
        return this;
    }

    public String getSerColloRif() {
        return serColloRif;
    }

    public HistoryVersamentoProdULDTO setSerColloRif(String serColloRif) {
        this.serColloRif = serColloRif;
        return this;
    }

    public Integer getNumColloRif() {
        return numColloRif;
    }

    public HistoryVersamentoProdULDTO setNumColloRif(Integer numColloRif) {
        this.numColloRif = numColloRif;
        return this;
    }

    public List<OrdineDto> getOrdini() {
        return ordini;
    }

    public HistoryVersamentoProdULDTO setOrdini(List<OrdineDto> ordini) {
        this.ordini = ordini;
        return this;
    }

    public MtbAart getMtbAart() {
        return mtbAart;
    }

    public HistoryVersamentoProdULDTO setMtbAart(MtbAart mtbAart) {
        this.mtbAart = mtbAart;
        return this;
    }

    public static class OrdineDto {
        private Integer numero;
        private Date data;
        private String gestione;
        private Integer rigaOrd;
        private BigDecimal qtaCol;
        private BigDecimal numCnf;
        private Integer percentageHr;

        public BigDecimal getQtaCnf() {
            return qtaCol.divide(numCnf, 3, RoundingMode.HALF_EVEN);
        }

        public Integer getNumero() {
            return numero;
        }

        public HistoryVersamentoProdULDTO.OrdineDto setNumero(Integer numero) {
            this.numero = numero;
            return this;
        }

        public Date getData() {
            return data;
        }

        public HistoryVersamentoProdULDTO.OrdineDto setData(Date data) {
            this.data = data;
            return this;
        }

        public String getGestione() {
            return gestione;
        }

        public HistoryVersamentoProdULDTO.OrdineDto setGestione(String gestione) {
            this.gestione = gestione;
            return this;
        }

        public Integer getRigaOrd() {
            return rigaOrd;
        }

        public OrdineDto setRigaOrd(Integer rigaOrd) {
            this.rigaOrd = rigaOrd;
            return this;
        }

        public BigDecimal getQtaCol() {
            return qtaCol;
        }

        public HistoryVersamentoProdULDTO.OrdineDto setQtaCol(BigDecimal qtaCol) {
            this.qtaCol = qtaCol;
            return this;
        }

        public BigDecimal getNumCnf() {
            return numCnf;
        }

        public HistoryVersamentoProdULDTO.OrdineDto setNumCnf(BigDecimal numCnf) {
            this.numCnf = numCnf;
            return this;
        }

        public Integer getPercentageHr() {
            return percentageHr;
        }

        public OrdineDto setPercentageHr(Integer percentageHr) {
            this.percentageHr = percentageHr;
            return this;
        }
    }
}
