/** * <p>Retrieve owned list of entities for itsOwner. * E.g. invoices lines for invoice</p> * @param pAddParam additional param * @param pIdEntityItsOwner ID itsOwner * @return owned list of business objects * @throws Exception - an exception */ @Override public final List<PurchaseReturnLine> retrieveOwnedListById( final Map<String, Object> pAddParam, final Object pIdEntityItsOwner) throws Exception { return getSrvOrm().retrieveEntityOwnedlist(PurchaseReturnLine.class, PurchaseReturn.class, pIdEntityItsOwner); }
/** * <p>Lazy Get queryPurchaseReturnLineTaxes.</p> * @return String * @throws Exception - an exception **/ public final String lazyGetQueryPurchaseReturnLineTaxes() throws Exception { if (this.queryPurchaseReturnLineTaxes == null) { String flName = "/" + "accounting" + "/" + "trade" + "/" + "purchaseReturnLineTaxes.sql"; this.queryPurchaseReturnLineTaxes = loadString(flName); } return this.queryPurchaseReturnLineTaxes; }
getSrvAccSettings().lazyGetAccSettings().getQuantityPrecision(), getSrvAccSettings().lazyGetAccSettings().getRoundingMode())); pEntity.setPurchaseInvoiceLine(getSrvOrm().retrieveEntity(pEntity .getPurchaseInvoiceLine())); if (pEntity.getPurchaseInvoiceLine() == null) { pEntity.setPurchInvLnAppearance(getSrvI18n().getMsg(PurchaseInvoiceLine .class.getSimpleName() + "short") + " #" + pEntity .getPurchaseInvoiceLine().getIdDatabaseBirth() + "-" //local .getPurchaseInvoiceLine().getInvItem().getItsName() + ", " + pEntity .getPurchaseInvoiceLine().getUnitOfMeasure().getItsName() + ", " + getSrvI18n().getMsg("itsCost") + "=" + pEntity .getPurchaseInvoiceLine().getItsCost() + ", " + getSrvI18n() .getMsg("rest_was") + "=" + pEntity.getPurchaseInvoiceLine() .getTheRest()); pEntity.setSubtotal(pEntity.getItsQuantity().multiply(pEntity .getPurchaseInvoiceLine().getItsCost()).setScale(getSrvAccSettings() .lazyGetAccSettings().getPricePrecision(), getSrvAccSettings() .lazyGetAccSettings().getRoundingMode())); BigDecimal totalTaxes = BigDecimal.ZERO; if (getSrvAccSettings().lazyGetAccSettings() .getIsExtractSalesTaxFromPurchase()) { String taxesDescription = ""; if (pEntity.getPurchaseInvoiceLine().getInvItem() .getTaxCategory() != null) { List<InvItemTaxCategoryLine> pstl = getSrvOrm() .retrieveListWithConditions(
List<PurchaseReturnTaxLine> citl = getSrvOrm().retrieveListWithConditions( PurchaseReturnTaxLine.class, "where ITSOWNER=" + pOwnerId); String query = lazyGetQueryPurchaseReturnLineTaxes().replace(":ITSOWNER", pOwnerId.toString()); int countUpdatedSitl = 0; IRecordSet<RS> recordSet = null; try { recordSet = getSrvDatabase().retrieveRecords(query); if (recordSet.moveToFirst()) { do { Long taxId = getSrvDatabase().getSrvRecordRetriever() .getLong(recordSet.getRecordSet(), "TAXID"); Double totalTax = getSrvDatabase().getSrvRecordRetriever() .getDouble(recordSet.getRecordSet(), "TOTALTAX"); PurchaseReturnTaxLine cit; countUpdatedSitl++; } else { cit = getSrvOrm().createEntityWithOwner( PurchaseReturnTaxLine.class, PurchaseReturn.class, pOwnerId); cit.setTax(tax); cit.setItsTotal(BigDecimal.valueOf(totalTax).setScale( getSrvAccSettings().lazyGetAccSettings().getPricePrecision(), getSrvAccSettings().lazyGetAccSettings().getRoundingMode())); if (cit.getIsNew()) { getSrvOrm().insertEntity(cit);
/** * <p>Create entity with its itsOwner e.g. invoice line * for invoice.</p> * @param pAddParam additional param * @param pIdEntityItsOwner entity itsOwner ID * @return entity instance * @throws Exception - an exception **/ @Override public final PurchaseReturnLine createEntityWithOwnerById( final Map<String, Object> pAddParam, final Object pIdEntityItsOwner) throws Exception { PurchaseReturnLine entity = new PurchaseReturnLine(); entity.setIdDatabaseBirth(getSrvOrm().getIdDatabase()); entity.setIsNew(true); //line use its owner to get purchase invoice ID PurchaseReturn itsOwner = getSrvOrm() .retrieveEntityById(PurchaseReturn.class, pIdEntityItsOwner); entity.setItsOwner(itsOwner); addAccSettingsIntoAttrs(pAddParam); return entity; }
factoryAppBeans.getBeansMap().put(pSrvName, srvEntity); Object srvEntityLine = new SrvPurchaseReturnLine<RS>(factoryAppBeans.lazyGetSrvOrm(), factoryAppBeans.lazyGetSrvDatabase(), lazyGetSrvAccSettings(), lazyGetSrvWarehouseEntry(),
/** * <p>Create entity.</p> * @param pAddParam additional param * @return entity instance * @throws Exception - an exception **/ @Override public final PurchaseReturnLine createEntity( final Map<String, Object> pAddParam) throws Exception { PurchaseReturnLine entity = new PurchaseReturnLine(); entity.setIdDatabaseBirth(getSrvOrm().getIdDatabase()); entity.setIsNew(true); PurchaseReturn itsOwner = new PurchaseReturn(); entity.setItsOwner(itsOwner); addAccSettingsIntoAttrs(pAddParam); return entity; }
final Map<String, Object> pAddParam, final Object pId) throws Exception { PurchaseReturnLine entity = getSrvOrm().retrieveCopyEntity( PurchaseReturnLine.class, pId); @SuppressWarnings("unchecked") addAccSettingsIntoAttrs(pAddParam); return entity;
/** * <p>Retrieve owned list of entities for itsOwner. * E.g. invoices lines for invoice</p> * @param pAddParam additional param * @param pEntityItsOwner itsOwner * @return owned list of business objects * @throws Exception - an exception */ @Override public final List<PurchaseReturnLine> retrieveOwnedList( final Map<String, Object> pAddParam, final PurchaseReturn pEntityItsOwner) throws Exception { return getSrvOrm().retrieveEntityOwnedlist(PurchaseReturnLine.class, PurchaseReturn.class, pEntityItsOwner.getItsId()); }
/** * <p>Create entity with its itsOwner e.g. invoice line * for invoice.</p> * @param pAddParam additional param * @param pEntityItsOwner itsOwner * @return entity instance * @throws Exception - an exception **/ @Override public final PurchaseReturnLine createEntityWithOwner( final Map<String, Object> pAddParam, final PurchaseReturn pEntityItsOwner) throws Exception { PurchaseReturnLine entity = new PurchaseReturnLine(); entity.setIsNew(true); entity.setIdDatabaseBirth(getSrvOrm().getIdDatabase()); //BeigeORM refresh: PurchaseReturn entityItsOwner = getSrvOrm() .retrieveEntity(pEntityItsOwner); entity.setItsOwner(entityItsOwner); return entity; }