/** * <p>Added accounting settings to attributes.</p> * @param pAddParam additional param * @throws Exception - an exception */ public final void addAccSettingsIntoAttrs( final Map<String, Object> pAddParam) throws Exception { IAttributes attributes = (IAttributes) pAddParam.get("attributes"); attributes.setAttribute("accSettings", srvAccSettings.lazyGetAccSettings()); }
/** * <p>Added accounting settings to attributes.</p> * @param pAddParam additional param * @throws Exception - an exception */ public final void addAccSettingsIntoAttrs( final Map<String, Object> pAddParam) throws Exception { IAttributes attributes = (IAttributes) pAddParam.get("attributes"); attributes.setAttribute("accSettings", srvAccSettings.lazyGetAccSettings()); }
/** * <p>Added accounting settings to attributes.</p> * @param pAddParam additional param * @throws Exception - an exception */ public final void addAccSettingsIntoAttrs( final Map<String, Object> pAddParam) throws Exception { IAttributes attributes = (IAttributes) pAddParam.get("attributes"); attributes.setAttribute("accSettings", srvAccSettings.lazyGetAccSettings()); }
/** * <p>Added accounting settings to attributes.</p> * @param pAddParam additional param * @throws Exception - an exception */ public final void addAccSettingsIntoAttrs( final Map<String, Object> pAddParam) throws Exception { IAttributes attributes = (IAttributes) pAddParam.get("attributes"); attributes.setAttribute("accSettings", srvAccSettings.lazyGetAccSettings()); }
/** * <p>Added accounting settings to attributes.</p> * @param pAddParam additional param * @throws Exception - an exception */ public final void addAccSettingsIntoAttrs( final Map<String, Object> pAddParam) throws Exception { IAttributes attributes = (IAttributes) pAddParam.get("attributes"); attributes.setAttribute("accSettings", srvAccSettings.lazyGetAccSettings()); }
/** * <p>Added accounting settings to attributes.</p> * @param pAddParam additional param * @throws Exception - an exception */ public final void addAccSettingsIntoAttrs( final Map<String, Object> pAddParam) throws Exception { IAttributes attributes = (IAttributes) pAddParam.get("attributes"); attributes.setAttribute("accSettings", srvAccSettings.lazyGetAccSettings()); }
/** * <p>Get draw item sources.</p> * @return draw item sources * @throws Exception - an exception **/ @Override public final List<? extends ADrawItemSourcesLine> getDrawItemSources() throws Exception { return getSrvAccSettings().lazyGetAccSettings() .getCogsItemSources(); } }
/** * <p>Get draw item sources.</p> * @return draw item sources * @throws Exception - an exception **/ @Override public final List<? extends ADrawItemSourcesLine> getDrawItemSources() throws Exception { return getSrvAccSettings().lazyGetAccSettings() .getDrawMaterialSources(); } }
/** * <p>Get draw item sources.</p> * @param pAddParam additional param * @return draw item sources * @throws Exception - an exception **/ @Override public final List<? extends ADrawItemSourcesLine> getDrawItemSources( final Map<String, Object> pAddParam) throws Exception { return getSrvAccSettings().lazyGetAccSettings(pAddParam) .getDrawMaterialSources(); } }
/** * <p>Get draw item sources.</p> * @param pAddParam additional param * @return draw item sources * @throws Exception - an exception **/ @Override public final List<? extends ADrawItemSourcesLine> getDrawItemSources( final Map<String, Object> pAddParam) throws Exception { return getSrvAccSettings().lazyGetAccSettings(pAddParam) .getCogsItemSources(); } }
getSrvAccSettings().lazyGetAccSettings().getPricePrecision(), getSrvAccSettings().lazyGetAccSettings().getRoundingMode())); pItsOwner.setTotalTaxes(BigDecimal.valueOf(totals[1]).setScale( getSrvAccSettings().lazyGetAccSettings().getPricePrecision(), getSrvAccSettings().lazyGetAccSettings().getRoundingMode())); pItsOwner.setItsTotal(pItsOwner.getSubtotal(). add(pItsOwner.getTotalTaxes())); getSrvOrm().updateEntity(pItsOwner); if (getSrvAccSettings().lazyGetAccSettings() .getIsExtractSalesTaxFromPurchase()) { updateTaxLines(pItsOwner.getItsId());
/** * <p>Insert immutable line into DB.</p> * @param pAddParam additional param * @param pEntity entity * @throws Exception - an exception **/ public final void updateOwner(final Map<String, Object> pAddParam, final WageLine pEntity) throws Exception { String query = "select sum(GROSSWAGE) as GROSSWAGE from " + WageLine.class .getSimpleName().toUpperCase() + " where ITSOWNER=" + pEntity.getItsOwner().getItsId(); Double total = getSrvDatabase().evalDoubleResult(query, "GROSSWAGE"); if (total == null) { total = 0d; } pEntity.getItsOwner().setItsTotal(BigDecimal.valueOf(total).setScale( getSrvAccSettings().lazyGetAccSettings(pAddParam).getPricePrecision(), getSrvAccSettings().lazyGetAccSettings(pAddParam).getRoundingMode())); getSrvOrm().updateEntity(pAddParam, pEntity.getItsOwner()); }
/** * <p>Insert immutable line into DB.</p> * @param pEntity entity * @throws Exception - an exception **/ public final void updateOwner( final WageLine pEntity) throws Exception { String query = "select sum(GROSSWAGE) as GROSSWAGE from " + WageLine.class .getSimpleName().toUpperCase() + " where ITSOWNER=" + pEntity.getItsOwner().getItsId(); Double total = getSrvDatabase().evalDoubleResult(query, "GROSSWAGE"); if (total == null) { total = 0d; } pEntity.getItsOwner().setItsTotal(BigDecimal.valueOf(total).setScale( getSrvAccSettings().lazyGetAccSettings().getPricePrecision(), getSrvAccSettings().lazyGetAccSettings().getRoundingMode())); getSrvOrm().updateEntity(pEntity.getItsOwner()); }
/** * <p>Insert immutable line into DB.</p> * @param pAddParam additional param * @param pEntity entity * @throws Exception - an exception **/ public final void updateOwner(final Map<String, Object> pAddParam, final WageLine pEntity) throws Exception { String query = "select sum(GROSSWAGE) as GROSSWAGE from " + WageLine.class .getSimpleName().toUpperCase() + " where ITSOWNER=" + pEntity.getItsOwner().getItsId(); Double total = getSrvDatabase().evalDoubleResult(query, "GROSSWAGE"); if (total == null) { total = 0d; } pEntity.getItsOwner().setItsTotal(BigDecimal.valueOf(total).setScale( getSrvAccSettings().lazyGetAccSettings(pAddParam).getPricePrecision(), getSrvAccSettings().lazyGetAccSettings(pAddParam).getRoundingMode())); getSrvOrm().updateEntity(pAddParam, pEntity.getItsOwner()); }
/** * <p>Insert immutable line into DB.</p> * @param pAddParam additional param * @param pEntity entity * @throws Exception - an exception **/ public final void updateOwner(final Map<String, Object> pAddParam, final AdditionCostLine pEntity) throws Exception { String query = "select sum(ITSTOTAL) as ITSTOTAL from" + " ADDITIONCOSTLINE where ITSOWNER=" + pEntity.getItsOwner().getItsId(); Double total = getSrvDatabase().evalDoubleResult(query, "ITSTOTAL"); pEntity.getItsOwner().setTotalAdditionCost(BigDecimal.valueOf(total) .setScale(getSrvAccSettings().lazyGetAccSettings(pAddParam).getCostPrecision(), getSrvAccSettings().lazyGetAccSettings(pAddParam).getRoundingMode())); pEntity.getItsOwner().setItsTotal(pEntity.getItsOwner() .getTotalMaterialsCost().add(pEntity.getItsOwner() .getTotalAdditionCost()).setScale(getSrvAccSettings() .lazyGetAccSettings(pAddParam).getCostPrecision(), getSrvAccSettings().lazyGetAccSettings(pAddParam).getRoundingMode())); pEntity.getItsOwner().setItsCost(pEntity.getItsOwner().getItsTotal() .divide(pEntity.getItsOwner().getItsQuantity(), getSrvAccSettings().lazyGetAccSettings(pAddParam).getCostPrecision(), getSrvAccSettings().lazyGetAccSettings(pAddParam).getRoundingMode())); getSrvOrm().updateEntity(pAddParam, pEntity.getItsOwner()); }
/** * <p>Insert immutable line into DB.</p> * @param pAddParam additional param * @param pEntity entity * @throws Exception - an exception **/ public final void updateOwner(final Map<String, Object> pAddParam, final AdditionCostLine pEntity) throws Exception { String query = "select sum(ITSTOTAL) as ITSTOTAL from" + " ADDITIONCOSTLINE where ITSOWNER=" + pEntity.getItsOwner().getItsId(); Double total = getSrvDatabase().evalDoubleResult(query, "ITSTOTAL"); pEntity.getItsOwner().setTotalAdditionCost(BigDecimal.valueOf(total) .setScale(getSrvAccSettings().lazyGetAccSettings(pAddParam).getCostPrecision(), getSrvAccSettings().lazyGetAccSettings(pAddParam).getRoundingMode())); pEntity.getItsOwner().setItsTotal(pEntity.getItsOwner() .getTotalMaterialsCost().add(pEntity.getItsOwner() .getTotalAdditionCost()).setScale(getSrvAccSettings() .lazyGetAccSettings(pAddParam).getCostPrecision(), getSrvAccSettings().lazyGetAccSettings(pAddParam).getRoundingMode())); pEntity.getItsOwner().setItsCost(pEntity.getItsOwner().getItsTotal() .divide(pEntity.getItsOwner().getItsQuantity(), getSrvAccSettings().lazyGetAccSettings(pAddParam).getCostPrecision(), getSrvAccSettings().lazyGetAccSettings(pAddParam).getRoundingMode())); getSrvOrm().updateEntity(pAddParam, pEntity.getItsOwner()); }
/** * <p>Evaluate period of stored balances according settings, * if it's changed then it switch on "current balances are dirty".</p> * @return pPeriod EPeriod e.g. MONTHLY * @throws Exception - an exception **/ @Override public final synchronized EPeriod evalBalanceStorePeriod() throws Exception { if (!lazyGetBalanceAtAllDirtyCheck().getBalanceStorePeriod() .equals(getSrvAccSettings().lazyGetAccSettings() .getBalanceStorePeriod())) { getLogger().info(SrvBalanceStd.class, SrvBalanceStd.class.getSimpleName() + ": changing period from " + lazyGetBalanceAtAllDirtyCheck() .getBalanceStorePeriod() + " to " + getSrvAccSettings() .lazyGetAccSettings().getBalanceStorePeriod()); lazyGetBalanceAtAllDirtyCheck() .setBalanceStorePeriod(getSrvAccSettings().lazyGetAccSettings() .getBalanceStorePeriod()); lazyGetBalanceAtAllDirtyCheck().setIsPeriodChanged(true); lazyGetBalanceAtAllDirtyCheck() .setCurrentBalanceDate(new Date(157766400000L)); } return lazyGetBalanceAtAllDirtyCheck().getBalanceStorePeriod(); }
/** * <p>Insert immutable line into DB.</p> * @param pEntity entity * @throws Exception - an exception **/ public final void updateOwner( final AdditionCostLine pEntity) throws Exception { String query = "select sum(ITSTOTAL) as ITSTOTAL from" + " ADDITIONCOSTLINE where ITSOWNER=" + pEntity.getItsOwner().getItsId(); Double total = getSrvDatabase().evalDoubleResult(query, "ITSTOTAL"); pEntity.getItsOwner().setTotalAdditionCost(BigDecimal.valueOf(total)); pEntity.getItsOwner().setItsTotal(pEntity.getItsOwner() .getTotalMaterialsCost().add(pEntity.getItsOwner() .getTotalAdditionCost())); pEntity.getItsOwner().setItsCost(pEntity.getItsOwner().getItsTotal() .divide(pEntity.getItsOwner().getItsQuantity(), getSrvAccSettings().lazyGetAccSettings().getCostPrecision(), getSrvAccSettings().lazyGetAccSettings().getRoundingMode())); getSrvOrm().updateEntity(pEntity.getItsOwner()); }
this.srvAccSettings.lazyGetAccSettings(pAddParam)); return pEntity;
/** * <p>Handle request.</p> * @param pReqVars Request scoped variables * @param pRequestData Request Data * @throws Exception - an exception */ @Override public final void handle(final Map<String, Object> pReqVars, final IRequestData pRequestData) throws Exception { try { this.srvDatabase.setIsAutocommit(false); this.srvDatabase. setTransactionIsolation(ISrvDatabase.TRANSACTION_READ_UNCOMMITTED); this.srvDatabase.beginTransaction(); Date date2 = srvDate .fromIso8601DateTimeNoTz(pRequestData.getParameter("date2"), null); BalanceSheet balanceSheet = getSrvBalanceSheet() .retrieveBalance(pReqVars, date2); pRequestData.setAttribute("balanceSheet", balanceSheet); pRequestData.setAttribute("accSettings", srvAccSettings .lazyGetAccSettings(pReqVars)); this.srvDatabase.commitTransaction(); } catch (Exception ex) { this.srvDatabase.rollBackTransaction(); throw ex; } finally { this.srvDatabase.releaseResources(); } }