
org.beigesoft.acc.mdlp.MnfPrc Maven / Gradle / Ivy
Show all versions of beige-acc Show documentation
/*
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.mdlp;
import java.util.List;
import java.util.Date;
import java.math.BigDecimal;
import org.beigesoft.acc.mdl.EDocTy;
import org.beigesoft.acc.mdl.EDocDriTy;
import org.beigesoft.acc.mdlb.ADoci;
import org.beigesoft.acc.mdlb.IDcDri;
import org.beigesoft.acc.mdlb.IItmSrc;
/**
* Model of manufacturing process that makes product in progress from
* used materials and additional costs (expenses).
*
* @author Yury Demidenko
*/
public class MnfPrc extends ADoci implements IDcDri, IItmSrc {
/**
* Item.
**/
private Itm itm;
/**
* Unit of measure.
**/
private Uom uom;
/**
* Quantity.
**/
private BigDecimal quan = BigDecimal.ZERO;
/**
* Price.
**/
private BigDecimal pri = BigDecimal.ZERO;
/**
* Items left (the rest) to draw, loads by the quantity,
* draws by sales, losses etc.
**/
private BigDecimal itLf = BigDecimal.ZERO;
/**
* Total left (the rest) to draw, loads by the total,
* draws by sales, losses etc.
* !For current implementation it is zero after loading (only itLf=quan),
* so for the first withdrawal drawer should set it as total-withdrawal!
**/
private BigDecimal toLf = BigDecimal.ZERO;
/**
* Warehouse place.
**/
private WrhPl wrhp;
/**
* Material cost.
**/
private BigDecimal maCs = BigDecimal.ZERO;
/**
* Additional (services) cost.
**/
private BigDecimal adCs = BigDecimal.ZERO;
/**
* If completed.
**/
private Boolean cmpl;
/**
* Material lines.
**/
private List maLns;
/**
* Additional cost lines.
**/
private List acLns;
/**
* Constant of code type 13.
* @return 13
**/
@Override
public final Integer cnsTy() {
return 13;
}
/**
* Getter of EDocTy.
* @return EDocTy
**/
@Override
public final EDocTy getDocTy() {
return EDocTy.ITSRDRAWLN;
}
/**
* Getter for has draw items document type.
* @return has draw items document type
**/
@Override
public final EDocDriTy getDocDriTy() {
return EDocDriTy.COGSDRIT;
}
/**
* Getter for itm.
* @return Itm
**/
@Override
public final Itm getItm() {
return this.itm;
}
/**
* Setter for itm.
* @param pItm reference
**/
@Override
public final void setItm(final Itm pItm) {
this.itm = pItm;
}
/**
* Getter for uom.
* @return Uom
**/
@Override
public final Uom getUom() {
return this.uom;
}
/**
* Setter for uom.
* @param pUom reference
**/
@Override
public final void setUom(final Uom pUom) {
this.uom = pUom;
}
/**
* Getter for quan.
* @return BigDecimal
**/
@Override
public final BigDecimal getQuan() {
return this.quan;
}
/**
* Setter for quan.
* @param pQuan reference
**/
@Override
public final void setQuan(final BigDecimal pQuan) {
this.quan = pQuan;
}
/**
* Getter for itLf.
* @return BigDecimal
**/
@Override
public final BigDecimal getItLf() {
return this.itLf;
}
/**
* Setter for itLf.
* @param pItLf reference
**/
@Override
public final void setItLf(final BigDecimal pItLf) {
this.itLf = pItLf;
}
/**
* Getter for toLf.
* @return BigDecimal
**/
@Override
public final BigDecimal getToLf() {
return this.toLf;
}
/**
* Setter for toLf.
* @param pToLf reference
**/
@Override
public final void setToLf(final BigDecimal pToLf) {
this.toLf = pToLf;
}
/**
* Getter for initial total to withdraw.
* This is because of complex tax calculation. For invoice basis subtotal
* of a line maybe changed (adjusted) after inserting new one
* in case of price inclusive of tax.
* @return BigDecimal
**/
@Override
public final BigDecimal getIniTo() {
return getMaCs();
}
/**
* Getter for document date (own or owner's).
* @return Date
**/
@Override
public final Date getDocDt() {
return getDat();
}
/**
* Setter for owner date if exist.
* Quick and cheap solution for draw item service.
* @param pDocDt owner date from SQL query
**/
@Override
public final void setDocDt(final Date pDocDt) {
setDat(pDocDt);
}
/**
* Getter for owner ID if exist.
* @return ID
**/
@Override
public final Long getOwnrId() {
return null;
}
/**
* Setter for owner ID if exist.
* Quick and cheap solution for draw item service.
* @param pOwnrId owner ID from SQL query
**/
@Override
public final void setOwnrId(final Long pOwnrId) {
//stub
}
/**
* Getter for owner type.
* @return null
**/
@Override
public final Integer getOwnrTy() {
return null;
}
/**
* Getter for wrhp.
* @return WrhPl
**/
@Override
public final WrhPl getWrhp() {
return this.wrhp;
}
/**
* Setter for wrhp.
* @param pWrhp reference
**/
@Override
public final void setWrhp(final WrhPl pWrhp) {
this.wrhp = pWrhp;
}
//Simple getters and setters:
/**
* Getter for pri.
* @return BigDecimal
**/
public final BigDecimal getPri() {
return this.pri;
}
/**
* Setter for pri.
* @param pPri reference
**/
public final void setPri(final BigDecimal pPri) {
this.pri = pPri;
}
/**
* Getter for maCs.
* @return BigDecimal
**/
public final BigDecimal getMaCs() {
return this.maCs;
}
/**
* Setter for maCs.
* @param pMaCs reference
**/
public final void setMaCs(final BigDecimal pMaCs) {
this.maCs = pMaCs;
}
/**
* Getter for adCs.
* @return BigDecimal
**/
public final BigDecimal getAdCs() {
return this.adCs;
}
/**
* Setter for adCs.
* @param pAdCs reference
**/
public final void setAdCs(final BigDecimal pAdCs) {
this.adCs = pAdCs;
}
/**
* Getter for maLns.
* @return List
**/
public final List getMaLns() {
return this.maLns;
}
/**
* Setter for maLns.
* @param pMaLns reference
**/
public final void setMaLns(final List pMaLns) {
this.maLns = pMaLns;
}
/**
* Getter for acLns.
* @return List
**/
public final List getAcLns() {
return this.acLns;
}
/**
* Setter for acLns.
* @param pAcLns reference
**/
public final void setAcLns(final List pAcLns) {
this.acLns = pAcLns;
}
/**
* Getter for cmpl.
* @return Boolean
**/
public final Boolean getCmpl() {
return this.cmpl;
}
/**
* Setter for cmpl.
* @param pCmpl reference
**/
public final void setCmpl(final Boolean pCmpl) {
this.cmpl = pCmpl;
}
}