/** * <p>Retrieve entity from DB by given ID.</p> * @param pAddParam additional param * @param pId ID * @return entity or null * @throws Exception - an exception **/ @Override public final T retrieveEntityById(final Map<String, Object> pAddParam, final Object pId) throws Exception { addAccSettingsIntoAttrs(pAddParam); T entity = getSrvOrm().retrieveEntityById(getEntityClass(), pId); @SuppressWarnings("unchecked") Map<String, String[]> parameterMap = (Map<String, String[]>) pAddParam. get("parameterMap"); if (parameterMap.get("actionAdd") != null && "full".equals(parameterMap.get("actionAdd")[0])) { IAttributes attributes = (IAttributes) pAddParam.get("attributes"); attributes.setAttribute("accEntries", srvAccEntry .retrieveAccEntriesFor(pAddParam, entity)); } retrieveOtherDataFor(pAddParam, entity); return entity; }
reversed.setReversedIdDatabaseBirth(pEntity.getIdDatabaseBirth()); getSrvOrm().updateEntity(reversed); srvAccEntry.reverseEntries(pAddParam, pEntity, reversed); srvAccEntry.makeEntries(pAddParam, pEntity); //it will update this doc
/** * <p>Make other entries include reversing if it's need when save.</p> * @param pAddParam additional param * @param pEntity entity * @param pIsNew if entity was new * @throws Exception - an exception **/ @Override public final void makeOtherEntries(final Map<String, Object> pAddParam, final Manufacture pEntity, final boolean pIsNew) throws Exception { //always new ManufactureForDraw manufactureForDraw = new ManufactureForDraw(pEntity); if (pEntity.getReversedId() != null) { //reverse draw product in process from warehouse getSrvWarehouseEntry().reverseDraw(pAddParam, manufactureForDraw); //reverse draw product in process from manufacturing process useMaterialReverse(pEntity); //reverse acc.entries already done } else { //draw product in process from warehouse getSrvWarehouseEntry().withdrawal(pAddParam, manufactureForDraw, pEntity.getWarehouseSiteFo()); //draw product in process from manufacturing process useMaterial(pEntity); //it will update this doc: getSrvAccEntry().makeEntries(pAddParam, pEntity); } //load(put) or reverse product or created material on warehouse getSrvWarehouseEntry().load(pAddParam, pEntity, pEntity.getWarehouseSite()); }
pReversed.setReversedIdDatabaseBirth(pReversing.getIdDatabaseBirth()); getSrvOrm().updateEntity(pReqVars, pReversed); this.srvAccEntry.reverseEntries(pReqVars, pReversing, pReversed);
reversed.setReversedIdDatabaseBirth(pEntity.getIdDatabaseBirth()); getSrvOrm().updateEntity(pAddParam, reversed); srvAccEntry.reverseEntries(pAddParam, pEntity, reversed); this.srvAccEntry.makeEntries(pAddParam, pEntity);
getSrvAccEntry().makeEntries(pAddParam, pEntity);
prep.setDescription(makeDescrForCreated(pBsl, pDateFormat, pLangDef)); getSrvOrm().insertEntity(pReqVars, prep); this.srvAccEntry.makeEntries(pReqVars, prep); resultRecordId = prep.getItsId(); resultDescription = makeBslResDescr(resultAction, pDateFormat, prep, prep.setDescription(makeDescrForCreated(pBsl, pDateFormat, pLangDef)); getSrvOrm().insertEntity(pReqVars, prep); this.srvAccEntry.makeEntries(pReqVars, prep); resultRecordId = prep.getItsId(); resultDescription = makeBslResDescr(resultAction, pDateFormat, prep,
/** * <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 T process( final Map<String, Object> pAddParam, final T pEntity, final IRequestData pRequestData) throws Exception { T entity = this.prcAccEntityRetrieve .process(pAddParam, pEntity, pRequestData); String actionAdd = pRequestData.getParameter("actionAdd"); if ("full".equals(actionAdd)) { pRequestData.setAttribute("accEntries", this.srvAccEntry .retrieveAccEntriesFor(pAddParam, entity)); pRequestData.setAttribute("classAccountingEntry", AccountingEntry.class); } return entity; }
pay.setDescription(makeDescrForCreated(pBsl, pDateFormat, pLangDef)); getSrvOrm().insertEntity(pReqVars, pay); this.srvAccEntry.makeEntries(pReqVars, pay); this.prcSalesInvoiceSave.calculateTotalPayment(pReqVars, pay .getSalesInvoice()); pay.setDescription(makeDescrForCreated(pBsl, pDateFormat, pLangDef)); getSrvOrm().insertEntity(pReqVars, pay); this.srvAccEntry.makeEntries(pReqVars, pay); this.prcPurchaseInvoiceSave.calculateTotalPayment(pReqVars, pay.getPurchaseInvoice());
/** * <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 T process( final Map<String, Object> pAddParam, final T pEntity, final IRequestData pRequestData) throws Exception { T entity = this.prcAccEntityWithSubaccRetrieve .process(pAddParam, pEntity, pRequestData); String actionAdd = pRequestData.getParameter("actionAdd"); if ("full".equals(actionAdd)) { pRequestData.setAttribute("accEntries", this.srvAccEntry .retrieveAccEntriesFor(pAddParam, entity)); pRequestData.setAttribute("classAccountingEntry", AccountingEntry.class); } return entity; }