/** * <p>Process entity request.</p> * @param pAddParam additional param, e.g. return this line's * document in "nextEntity" for farther process * @param pRequestData Request Data * @param pEntity Entity to process * @return Entity processed for farther process or null * @throws Exception - an exception **/ @Override public final BeginningInventoryLine process( final Map<String, Object> pAddParam, final BeginningInventoryLine pEntityPb, final IRequestData pRequestData) throws Exception { BeginningInventoryLine entity = this.prcAccEntityPbCopy .process(pAddParam, pEntityPb, pRequestData); entity.setItsQuantity(BigDecimal.ZERO); entity.setItsCost(BigDecimal.ZERO); entity.setItsTotal(BigDecimal.ZERO); return entity; }
entity.setItsTotal(entity.getItsTotal().negate()); } else { entity.setItsQuantity(BigDecimal.ZERO); entity.setItsCost(BigDecimal.ZERO); entity.setItsTotal(BigDecimal.ZERO);
/** * <p>Process entity request.</p> * @param pAddParam additional param, e.g. return this line's * document in "nextEntity" for farther process * @param pRequestData Request Data * @param pEntity Entity to process * @return Entity processed for farther process or null * @throws Exception - an exception **/ @Override public final BeginningInventoryLine process( final Map<String, Object> pAddParam, final BeginningInventoryLine pEntityPb, final IRequestData pRequestData) throws Exception { BeginningInventoryLine entity = this.prcAccEntityPbCopy .process(pAddParam, pEntityPb, pRequestData); if (entity.getReversedId() != null) { throw new ExceptionWithCode(ExceptionWithCode.FORBIDDEN, "attempt_to_reverse_reversed"); } entity.setReversedId(pEntityPb.getItsId()); entity.setItsQuantity(entity.getItsQuantity().negate()); entity.setItsTotal(entity.getItsTotal().negate()); return entity; }
.lazyGetAccSettings(pAddParam).getRoundingMode())); pEntity.setTheRest(pEntity.getItsQuantity()); pEntity.setItsTotal(pEntity.getItsQuantity().multiply(pEntity .getItsCost()).setScale(getSrvAccSettings() .lazyGetAccSettings(pAddParam).getCostPrecision(), getSrvAccSettings()
reversingLine.setItsQuantity(reversedLine.getItsQuantity() .negate()); reversingLine.setItsTotal(reversedLine.getItsTotal().negate()); reversingLine.setIsNew(true); reversingLine.setItsOwner(pEntity);
.lazyGetAccSettings().getRoundingMode())); pEntity.setTheRest(pEntity.getItsQuantity()); pEntity.setItsTotal(pEntity.getItsTotal().setScale(getSrvAccSettings() .lazyGetAccSettings().getCostPrecision(), getSrvAccSettings() .lazyGetAccSettings().getRoundingMode()));
reversingLine.setItsQuantity(reversedLine.getItsQuantity() .negate()); reversingLine.setItsTotal(reversedLine.getItsTotal().negate()); reversingLine.setIsNew(true); reversingLine.setItsOwner(pEntity);