/** * <p>Get InvoiceReportPdf (create and put into map).</p> * @param pAddParam additional param * @return requested InvoiceReportPdf * @throws Exception - an exception */ protected final InvoiceReportPdf<RS, WI> lazyGetInvoiceReportPdf( final Map<String, Object> pAddParam) throws Exception { @SuppressWarnings("unchecked") InvoiceReportPdf<RS, WI> rep = (InvoiceReportPdf<RS, WI>) this.reportersMap .get(InvoiceReportPdf.class.getSimpleName()); if (rep == null) { rep = new InvoiceReportPdf<RS, WI>(); rep.setSrvAccSettings(getSrvAccSettings()); rep.setSrvNumberToString(getSrvNumberToString()); rep.setSrvI18n(getSrvI18n()); rep.setSrvOrm(getSrvOrm()); rep.setPdfFactory(this.pdfFactory); //assigning fully initialized object: this.reportersMap.put(InvoiceReportPdf.class.getSimpleName(), rep); } return rep; }
/** * <p>Evaluate I18N overseas sales invoice service lines query.</p> * @param pItsOwnerId ID of sales invoice * @param pLang lang * @return query * @throws Exception - an exception **/ public final String evalSalesInvOverseaseServiceLinesSql( final String pItsOwnerId, final String pLang) throws Exception { if (this.salesInvOverseaseServiceLinesSql == null) { synchronized (this) { if (this.salesInvOverseaseServiceLinesSql == null) { String flName = "/accounting/trade/salesInvOverseaseServiceLines.sql"; this.salesInvOverseaseServiceLinesSql = loadString(flName); } } } String query = this.salesInvOverseaseServiceLinesSql.replace(":ITSOWNER", pItsOwnerId).replace(":LANG", pLang); return query; }
DateFormat dateFormat = DateFormat .getDateInstance(DateFormat.MEDIUM, new Locale(lang)); SalesInvoice inv = retrieveEntity(pReqVars, pInvoice, lang, !lang.equals(langDef)); boolean isInvoiceBasis = false; doc.setBorder(widthNdot); doc.setContentPadding(0.0); doc.setContentPaddingBottom(mmToDocUom(1.0, doc.getUnitOfMeasure())); DocTable<WI> tblOwner = docMaker.addDocTableNoBorder(doc, 1, 1); I18nAccounting i18nAccounting = tblTitle.getItsCells().get(0).setFontNumber(1); tblTitle.setAlignHorizontal(EAlignHorizontal.CENTER); doc.setContainerMarginBottom(mmToDocUom(1.0, doc.getUnitOfMeasure())); docMaker.makeDocTableWrapping(tblTitle); DocTable<WI> tblCustomer = docMaker.addDocTableNoBorder(doc, 1, 1); I18nBuyer i18nBuyer = null; if (!lang.equals(langDef)) { i18nBuyer = getSrvOrm().retrieveEntityById(pReqVars, I18nBuyer.class, inv.getCustomer()); BigDecimal total; if (inv.getItsLines() != null && inv.getItsLines().size() > 0) { doc.setContainerMarginBottom(mmToDocUom(2.0, doc.getUnitOfMeasure())); DocTable<WI> tblTiGoods = docMaker.addDocTableNoBorder(doc, 1, 1); tblTiGoods.getItsCells().get(0).setItsContent(this.srvI18n tblTiGoods.setAlignHorizontal(EAlignHorizontal.CENTER);
pReqVars.put("InvItemneededFields", ndFlItUm); pReqVars.put("UnitOfMeasureneededFields", ndFlItUm); inv.setItsLines(getSrvOrm().retrieveListByQuery(pReqVars, SalesInvoiceLine.class, evalSalesInvOverseaseLinesSql(inv.getItsId().toString(), pLang))); pReqVars.remove("SalesInvoiceLineneededFields"); pReqVars.remove("InvItemneededFields"); } else { pReqVars.put("SalesInvoiceLineitsOwnerdeepLevel", 1); //only ID inv.setItsLines(getSrvOrm(). retrieveListWithConditions(pReqVars, SalesInvoiceLine.class, "where REVERSEDID is null and ITSOWNER=" + inv.getItsId())); sitl.setItsOwner(inv); pReqVars.put("SalesInvoiceTaxLineitsOwnerdeepLevel", 1); //only ID inv.setTaxesLines(getSrvOrm(). retrieveListForField(pReqVars, sitl, "itsOwner")); pReqVars.remove("SalesInvoiceTaxLineitsOwnerdeepLevel"); pReqVars.put("ServiceToSaleneededFields", ndFlItUm); pReqVars.put("UnitOfMeasureneededFields", ndFlItUm); inv.setServices(getSrvOrm().retrieveListByQuery(pReqVars, SalesInvoiceServiceLine.class, evalSalesInvOverseaseServiceLinesSql( inv.getItsId().toString(), pLang))); pReqVars.remove("SalesInvoiceServiceLineneededFields"); sisl.setItsOwner(inv); pReqVars.put("SalesInvoiceServiceLineitsOwnerdeepLevel", 1); //only ID
/** * <p>Evaluate I18N overseas sales invoice lines query.</p> * @param pItsOwnerId ID of sales invoice * @param pLang lang * @return query * @throws Exception - an exception **/ public final String evalSalesInvOverseaseLinesSql( final String pItsOwnerId, final String pLang) throws Exception { if (this.salesInvOverseaseLinesSql == null) { synchronized (this) { if (this.salesInvOverseaseLinesSql == null) { String flName = "/accounting/trade/salesInvOverseaseLines.sql"; this.salesInvOverseaseLinesSql = loadString(flName); } } } String query = this.salesInvOverseaseLinesSql.replace(":ITSOWNER", pItsOwnerId).replace(":LANG", pLang); return query; }