
org.beigesoft.acc.mdlb.TxDtLn Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of beige-acc Show documentation
Show all versions of beige-acc Show documentation
It consists of double entry accounting and trading (web-store) business logic.
It's based on previous beigesoft-accounting and beigesoft-webstore projects.
The newest version!
/*
BSD 2-Clause License
Copyright (c) 2019, Beigesoft™
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.beigesoft.acc.mdlb;
import java.math.BigDecimal;
import org.beigesoft.mdlp.AOrId;
import org.beigesoft.acc.mdlp.TxCt;
import org.beigesoft.acc.mdlp.TxCtLn;
/**
* Model of tax data line for intermediate calculation
* and it's base model of invoice line.
*
* @author Yury Demidenko
*/
public class TxDtLn extends AOrId {
/**
* Tax category, nullable.
**/
private TxCt txCt;
/**
* Subtotal.
**/
private BigDecimal subt = BigDecimal.ZERO;
/**
* Subtotal in foreign currency.
**/
private BigDecimal suFc = BigDecimal.ZERO;
/**
* Total taxes.
**/
private BigDecimal toTx = BigDecimal.ZERO;
/**
* Total taxes in foreign currency.
**/
private BigDecimal txFc = BigDecimal.ZERO;
/**
* Total.
**/
private BigDecimal tot = BigDecimal.ZERO;
/**
* Total in foreign currency.
**/
private BigDecimal toFc = BigDecimal.ZERO;
/**
* Explanation.
**/
@Override
public final String toString() {
StringBuffer tc;
if (this.txCt == null) {
tc = new StringBuffer("NULL!!!");
} else {
tc = new StringBuffer("TC ID/[tax/rate]: " + this.txCt.getIid() + "/[");
if (this.txCt.getTxs() != null) {
for (TxCtLn txl : this.txCt.getTxs()) {
tc.append(txl.getTax().getNme() + "/" + txl.getRate() + "/");
}
} else {
tc.append("NULL!!!");
}
tc.append("]/");
}
return tc.toString() + this.subt + "/" + this.suFc + "/"
+ this.tot + "/" + this.toFc + "/" + this.toTx + "/" + this.txFc;
}
//Simple getters and setters:
/**
* Getter for txCt.
* @return TxCt
**/
public final TxCt getTxCt() {
return this.txCt;
}
/**
* Setter for txCt.
* @param pTxCt reference
**/
public final void setTxCt(final TxCt pTxCt) {
this.txCt = pTxCt;
}
/**
* Getter for subt.
* @return BigDecimal
**/
public final BigDecimal getSubt() {
return this.subt;
}
/**
* Setter for subt.
* @param pSubt reference
**/
public final void setSubt(final BigDecimal pSubt) {
this.subt = pSubt;
}
/**
* Getter for suFc.
* @return BigDecimal
**/
public final BigDecimal getSuFc() {
return this.suFc;
}
/**
* Setter for suFc.
* @param pSuFc reference
**/
public final void setSuFc(final BigDecimal pSuFc) {
this.suFc = pSuFc;
}
/**
* Getter for toTx.
* @return BigDecimal
**/
public final BigDecimal getToTx() {
return this.toTx;
}
/**
* Setter for toTx.
* @param pToTx reference
**/
public final void setToTx(final BigDecimal pToTx) {
this.toTx = pToTx;
}
/**
* Getter for txFc.
* @return BigDecimal
**/
public final BigDecimal getTxFc() {
return this.txFc;
}
/**
* Setter for txFc.
* @param pTxFc reference
**/
public final void setTxFc(final BigDecimal pTxFc) {
this.txFc = pTxFc;
}
/**
* Getter for tot.
* @return BigDecimal
**/
public final BigDecimal getTot() {
return this.tot;
}
/**
* Setter for tot.
* @param pTot reference
**/
public final void setTot(final BigDecimal pTot) {
this.tot = pTot;
}
/**
* Getter for toFc.
* @return BigDecimal
**/
public final BigDecimal getToFc() {
return this.toFc;
}
/**
* Setter for toFc.
* @param pToFc reference
**/
public final void setToFc(final BigDecimal pToFc) {
this.toFc = pToFc;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy