package com.tofly.feesapi.common.dzfp;


import lombok.Data;

import java.math.BigDecimal;
@Data
public class InvoiceAmounts {
    /**
     *  不含税金额
     */
    private BigDecimal taxExcludedAmount;

    /**
     *  税额
     */
    private BigDecimal tax;

    /**
     *  汇总金额(含税)
     */
    private BigDecimal taxIncludedAmount;

    public InvoiceAmounts(BigDecimal taxExcludedAmount, BigDecimal tax, BigDecimal taxIncludedAmount) {
        this.taxExcludedAmount = taxExcludedAmount;
        this.tax = tax;
        this.taxIncludedAmount = taxIncludedAmount;
    }

    public InvoiceAmounts(InvoiceAmounts oldIa, InvoiceAmounts newIa) {
        this.taxExcludedAmount = oldIa.getTaxExcludedAmount().add(newIa.getTaxExcludedAmount());
        this.tax = oldIa.getTax().add(newIa.getTax());
        this.taxIncludedAmount = oldIa.getTaxIncludedAmount().add(newIa.getTaxIncludedAmount());
    }

}
