details: https://code.openbravo.com/erp/devel/main/rev/4ee0aae2bc57 changeset: 26135:4ee0aae2bc57 user: Sandra Huguet <sandra.huguet <at> openbravo.com> date: Wed Mar 04 17:07:47 2015 +0100 summary: Fixed bug 29124 It is not possible to create PaymentOut from "match statement"
It is not possible to create Payment Out from "match statement" using a G/L item. details: https://code.openbravo.com/erp/devel/main/rev/d8ec9347e127 changeset: 26136:d8ec9347e127 user: Asier Lostalé <asier.lostale <at> openbravo.com> date: Fri Mar 06 08:51:40 2015 +0100 summary: fixed issue 29157: code review issues for Process Definition Reporting Tool Fixes include: * Security: prevent traversal attack. BaseReportActionHandler could be invoked to download any file in the system. Fixed by: - Now it only accepts file name instead of full path, looking for this file in the temporary directory. - Filename is parsed to ensure it is a valid generated jasper file name, preventing in this manner downloads of any arbitrary file in the temporary directory. * ReportSemaphoreHandling changes: - Modified to make use of standard java.util.concurrent.Semaphore implementation rather than implementing its own semaphore. - Property to read maximum number of concurrent executions is read on initialization instead of when acquiring. This way acquisition is faster. * When a Jasper report is generated with a virtualizer, it's finally cleaned up. * When downloading a report, temporary file is deleted on a finally block to ensure deletion even on failure. * Changes in javadoc to fix some typos + prevent undocumented parameters. * Defensive coding: when generating/downloading a report, don't assume if type is not pdf then it is xls, but do check all the types and raise an exception in case of unsupported type. * UI: in process definition window, don't show Can Add Records flag for process definitions of type report details: https://code.openbravo.com/erp/devel/main/rev/95f9c5ce6207 changeset: 26137:95f9c5ce6207 user: Eduardo Argal Guibert <eduardo.argal <at> openbravo.com> date: Fri Mar 06 11:21:26 2015 +0100 summary: Fixes issue 29168 getCallableResult broken when using null parameters. Removed TEST value for default details: https://code.openbravo.com/erp/devel/main/rev/ab393536c4bc changeset: 26138:ab393536c4bc user: Eduardo Argal Guibert <eduardo.argal <at> openbravo.com> date: Fri Mar 06 11:31:38 2015 +0100 summary: Related to issue 28909 can't create orders in Oracle. Created StockUtils class to enable calls to M_GET_STOCK_PARAM procedure getting out params H : Enter commit message. Lines beginning with 'HG:' are removed. details: https://code.openbravo.com/erp/devel/main/rev/9e1c26ee24ab changeset: 26139:9e1c26ee24ab user: RM packaging bot <staff.rm <at> openbravo.com> date: Fri Mar 06 15:03:31 2015 +0000 summary: CI: merge back from main details: https://code.openbravo.com/erp/devel/main/rev/e20da585bb7e changeset: 26140:e20da585bb7e user: Eduardo Argal Guibert <eduardo.argal <at> openbravo.com> date: Fri Mar 06 16:52:17 2015 +0100 summary: Related to issue 28909 Change variable definition to public to be able to retrieve the value details: https://code.openbravo.com/erp/devel/main/rev/b9fc7e8e60ae changeset: 26141:b9fc7e8e60ae user: Eduardo Argal Guibert <eduardo.argal <at> openbravo.com> date: Fri Mar 06 17:03:04 2015 +0100 summary: Fixes issue 28939 Perfromance problem running module script in environments with large amount of transactions (invoices and orders). New index is added in postgres environments when this is not present. Problem comes from table recreation, so impacts those who update from a version that requires invoice table rebuilding. details: https://code.openbravo.com/erp/devel/main/rev/7a7adf930de6 changeset: 26142:7a7adf930de6 user: Reinaldo Guerra <reinaldo.guerra <at> peoplewalking.com> date: Fri Nov 07 23:24:39 2014 -0500 summary: Fixed bug 27313: D-U-N-S number should not be mandatory D-U-N-S number column in organization's information table was changed to non mandatory. Now when introducing data in organization's information tab it is not necessary to fill D-U-N-S number as it is something that is not used in all the goberments/companies. details: https://code.openbravo.com/erp/devel/main/rev/17996ec1f87f changeset: 26143:17996ec1f87f user: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com> date: Tue Mar 03 18:19:16 2015 +0100 summary: Related to bug 27313: Duns field in AD_ORGINFO will not be filled automatically AD_ORG_TRG trigger has been modified in order not to set automatically '?' value to duns column in AD_ORGINFO table details: https://code.openbravo.com/erp/devel/main/rev/ef8a16dd11b3 changeset: 26144:ef8a16dd11b3 user: RM packaging bot <staff.rm <at> openbravo.com> date: Mon Mar 09 16:26:11 2015 +0000 summary: CI: update AD_MODULE to version 26143 diffstat: modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 4 +- modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js | 14 +- modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 2 +- modules/org.openbravo.client.application/src-db/database/sourcedata/AD_FIELD.xml | 1 + modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 8 +- modules/org.openbravo.client.application/src/org/openbravo/client/application/report/BaseReportActionHandler.java | 96 +++++---- modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportSemaphoreHandling.java | 65 +++-- modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportingUtils.java | 42 +++- modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-action-def.js | 4 +- modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 2 +- modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 6 +- modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 4 +- modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 2 +- modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 2 +- modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 2 +- modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 2 +- modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 10 +- modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 4 +- modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 2 +- modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 2 +- modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 12 +- modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 2 +- modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 6 +- modules/org.openbravo.utility.cleanup.log/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.utility.cleanup.log/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 2 +- modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 6 +- modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 24 +- modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE.xml | 2 +- modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml | 20 +- src-core/src/org/openbravo/database/RDBMSIndependent.java | 2 +- src-db/database/model/tables/AD_ORGINFO.xml | 2 +- src-db/database/model/triggers/AD_ORG_TRG.xml | 4 +- src-db/database/sourcedata/AD_COLUMN.xml | 2 +- src-db/database/sourcedata/AD_MODULE.xml | 4 +- src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateBpPaymentLine.class | 0 src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateBpPaymentLineData.class | 0 src-util/modulescript/src/org/openbravo/modulescript/UpdateBpPaymentLine.java | 77 +++++++- src-util/modulescript/src/org/openbravo/modulescript/UpdateBpPaymentLine_data.xsql | 24 ++ src/org/openbravo/materialmgmt/CSResponseGetStockParam.java | 24 ++ src/org/openbravo/materialmgmt/StockUtils.java | 47 ++++ src/org/openbravo/materialmgmt/StockUtils_data.xsql | 71 +++++++ 60 files changed, 464 insertions(+), 181 deletions(-) diffs (truncated from 1723 to 300 lines): diff -r 486e7700e8d0 -r ef8a16dd11b3 modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml --- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml Fri Mar 06 08:10:31 2015 +0100 +++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml Mon Mar 09 16:26:11 2015 +0000 @@ -6,7 +6,7 @@ <!--A918E3331C404B889D69AA9BFAFB23AC--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> <!--A918E3331C404B889D69AA9BFAFB23AC--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--A918E3331C404B889D69AA9BFAFB23AC--> <NAME><![CDATA[Advanced Payables and Receivables Mngmt]]></NAME> -<!--A918E3331C404B889D69AA9BFAFB23AC--> <VERSION><![CDATA[3.0.26126]]></VERSION> +<!--A918E3331C404B889D69AA9BFAFB23AC--> <VERSION><![CDATA[3.0.26143]]></VERSION> <!--A918E3331C404B889D69AA9BFAFB23AC--> <DESCRIPTION><![CDATA[Managing your finances with an ERP does not have to be difficult. Enjoy a radically improved user experience that combines the power of an enterprise grade financial application with the simplicity and ease of a web 2.0 personal accounting service.]]></DESCRIPTION> <!--A918E3331C404B889D69AA9BFAFB23AC--> <HELP><![CDATA[Advanced Payables and Receivables Management simplifies and automates the business processes around the management of financial accounts, from the receipt and issue of payment, to the reconciliation of those events with bank statements. If you would like to help shape this module you are welcome to take part in the forum discussions or register feature requests or issues in the corresponding (Forum and Bug Tracking) sections in the Advanced Payables and Receivable project in the OB Forge.]]></HELP> diff -r 486e7700e8d0 -r ef8a16dd11b3 modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml --- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml Fri Mar 06 08:10:31 2015 +0100 +++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml Mon Mar 09 16:26:11 2015 +0000 @@ -7,7 +7,7 @@ <!--89326AE95DAD449D85DFAB2C5B1C6683--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--89326AE95DAD449D85DFAB2C5B1C6683--> <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID> <!--89326AE95DAD449D85DFAB2C5B1C6683--> <AD_DEPENDENT_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_DEPENDENT_MODULE_ID> -<!--89326AE95DAD449D85DFAB2C5B1C6683--> <STARTVERSION><![CDATA[2.1.26126]]></STARTVERSION> +<!--89326AE95DAD449D85DFAB2C5B1C6683--> <STARTVERSION><![CDATA[2.1.26143]]></STARTVERSION> <!--89326AE95DAD449D85DFAB2C5B1C6683--> <ISINCLUDED><![CDATA[N]]></ISINCLUDED> <!--89326AE95DAD449D85DFAB2C5B1C6683--> <DEPENDANT_MODULE_NAME><![CDATA[User Interface Selector]]></DEPENDANT_MODULE_NAME> <!--89326AE95DAD449D85DFAB2C5B1C6683--> <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT> @@ -21,7 +21,7 @@ <!--B97FC854C6DD41E692161585645A900F--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--B97FC854C6DD41E692161585645A900F--> <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID> <!--B97FC854C6DD41E692161585645A900F--> <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID> -<!--B97FC854C6DD41E692161585645A900F--> <STARTVERSION><![CDATA[3.0.26126]]></STARTVERSION> +<!--B97FC854C6DD41E692161585645A900F--> <STARTVERSION><![CDATA[3.0.26143]]></STARTVERSION> <!--B97FC854C6DD41E692161585645A900F--> <ISINCLUDED><![CDATA[N]]></ISINCLUDED> <!--B97FC854C6DD41E692161585645A900F--> <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME> <!--B97FC854C6DD41E692161585645A900F--> <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT> diff -r 486e7700e8d0 -r ef8a16dd11b3 modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js --- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js Fri Mar 06 08:10:31 2015 +0100 +++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js Mon Mar 09 16:26:11 2015 +0000 @@ -622,11 +622,7 @@ expectedPayment.setValue(Number('0')); } if (!issotrx) { - if ((bslamount.compareTo(BigDecimal.prototype.ZERO) !== 0) && (totalAmount.compareTo(BigDecimal.prototype.ZERO) === 0)) { - actpayment = totalAmount.add(glitemtotal).add(generateCredit).add(bslamount.abs()); - } else { - actpayment = totalAmount.add(glitemtotal).add(generateCredit); - } + actpayment = totalAmount.add(glitemtotal).add(generateCredit); actualPayment.setValue(Number(actpayment)); if (credit.compareTo(BigDecimal.prototype.ZERO) > 0) { if (credit.compareTo(actpayment) > 0) { @@ -635,6 +631,14 @@ actualPayment.setValue(Number(actpayment.subtract(credit))); } } + if ((bslamount.compareTo(BigDecimal.prototype.ZERO) !== 0)) { + if (actpayment.compareTo(BigDecimal.prototype.ZERO) === 0) { + actpayment = actpayment.add(bslamount.abs()); + } else { + actpayment = bslamount.abs(); + } + actualPayment.setValue(Number(actpayment)); + } OB.APRM.AddPayment.updateDifference(form); OB.APRM.AddPayment.updateConvertedAmount(null, form, false); } diff -r 486e7700e8d0 -r ef8a16dd11b3 modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml --- a/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml Fri Mar 06 08:10:31 2015 +0100 +++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml Mon Mar 09 16:26:11 2015 +0000 @@ -6,7 +6,7 @@ <!--C70732EA90A14EC0916078B85CC33D2D--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> <!--C70732EA90A14EC0916078B85CC33D2D--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--C70732EA90A14EC0916078B85CC33D2D--> <NAME><![CDATA[JBoss Weld]]></NAME> -<!--C70732EA90A14EC0916078B85CC33D2D--> <VERSION><![CDATA[1.1.26126]]></VERSION> +<!--C70732EA90A14EC0916078B85CC33D2D--> <VERSION><![CDATA[1.1.26143]]></VERSION> <!--C70732EA90A14EC0916078B85CC33D2D--> <DESCRIPTION><![CDATA[JBoss Weld]]></DESCRIPTION> <!--C70732EA90A14EC0916078B85CC33D2D--> <HELP><![CDATA[Provides the JBoss Weld framework: Java Contexts and Dependency Injection for the Java EE platform (CDI). For more information see http://seamframework.org/Weld]]></HELP> <!--C70732EA90A14EC0916078B85CC33D2D--> <URL><![CDATA[http://forge.openbravo.com/projects/weld]]></URL> diff -r 486e7700e8d0 -r ef8a16dd11b3 modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml --- a/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml Fri Mar 06 08:10:31 2015 +0100 +++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml Mon Mar 09 16:26:11 2015 +0000 @@ -7,7 +7,7 @@ <!--8BDE81545C1A43EAAC4BA3C5ED754DC8--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--8BDE81545C1A43EAAC4BA3C5ED754DC8--> <AD_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_MODULE_ID> <!--8BDE81545C1A43EAAC4BA3C5ED754DC8--> <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID> -<!--8BDE81545C1A43EAAC4BA3C5ED754DC8--> <STARTVERSION><![CDATA[3.0.26126]]></STARTVERSION> +<!--8BDE81545C1A43EAAC4BA3C5ED754DC8--> <STARTVERSION><![CDATA[3.0.26143]]></STARTVERSION> <!--8BDE81545C1A43EAAC4BA3C5ED754DC8--> <ISINCLUDED><![CDATA[N]]></ISINCLUDED> <!--8BDE81545C1A43EAAC4BA3C5ED754DC8--> <DEPENDANT_MODULE_NAME><![CDATA[Core]]></DEPENDANT_MODULE_NAME> <!--8BDE81545C1A43EAAC4BA3C5ED754DC8--> <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT> diff -r 486e7700e8d0 -r ef8a16dd11b3 modules/org.openbravo.client.application/src-db/database/sourcedata/AD_FIELD.xml --- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_FIELD.xml Fri Mar 06 08:10:31 2015 +0100 +++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_FIELD.xml Mon Mar 09 16:26:11 2015 +0000 @@ -5077,6 +5077,7 @@ <!--F33844ACDC3A40ABAA83E614E659FC8F--> <AD_COLUMN_ID><![CDATA[8C5CC70F805F41B9BE4999E2A5E70C26]]></AD_COLUMN_ID> <!--F33844ACDC3A40ABAA83E614E659FC8F--> <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD> <!--F33844ACDC3A40ABAA83E614E659FC8F--> <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED> +<!--F33844ACDC3A40ABAA83E614E659FC8F--> <DISPLAYLOGIC><![CDATA[@Uipattern@='OBUIAPP_PickAndExecute']]></DISPLAYLOGIC> <!--F33844ACDC3A40ABAA83E614E659FC8F--> <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH> <!--F33844ACDC3A40ABAA83E614E659FC8F--> <ISREADONLY><![CDATA[N]]></ISREADONLY> <!--F33844ACDC3A40ABAA83E614E659FC8F--> <SEQNO><![CDATA[160]]></SEQNO> diff -r 486e7700e8d0 -r ef8a16dd11b3 modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml --- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml Fri Mar 06 08:10:31 2015 +0100 +++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml Mon Mar 09 16:26:11 2015 +0000 @@ -6,7 +6,7 @@ <!--9BA0836A3CD74EE4AB48753A47211BCC--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID> <!--9BA0836A3CD74EE4AB48753A47211BCC--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--9BA0836A3CD74EE4AB48753A47211BCC--> <NAME><![CDATA[User Interface Application]]></NAME> -<!--9BA0836A3CD74EE4AB48753A47211BCC--> <VERSION><![CDATA[2.1.26126]]></VERSION> +<!--9BA0836A3CD74EE4AB48753A47211BCC--> <VERSION><![CDATA[2.1.26143]]></VERSION> <!--9BA0836A3CD74EE4AB48753A47211BCC--> <DESCRIPTION><![CDATA[Provides the main application components for the openbravo user interface]]></DESCRIPTION> <!--9BA0836A3CD74EE4AB48753A47211BCC--> <HELP><![CDATA[Provides the main application components for the openbravo user interface. The main layout incorporates a navigation bar and a main view area.]]></HELP> <!--9BA0836A3CD74EE4AB48753A47211BCC--> <URL><![CDATA[http://forge.openbravo.com/projects/clientapplication]]></URL> diff -r 486e7700e8d0 -r ef8a16dd11b3 modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml --- a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml Fri Mar 06 08:10:31 2015 +0100 +++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml Mon Mar 09 16:26:11 2015 +0000 @@ -7,7 +7,7 @@ <!--15D7CE8D95D043189162DBABA54A1F61--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--15D7CE8D95D043189162DBABA54A1F61--> <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID> <!--15D7CE8D95D043189162DBABA54A1F61--> <AD_DEPENDENT_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_DEPENDENT_MODULE_ID> -<!--15D7CE8D95D043189162DBABA54A1F61--> <STARTVERSION><![CDATA[2.1.26126]]></STARTVERSION> +<!--15D7CE8D95D043189162DBABA54A1F61--> <STARTVERSION><![CDATA[2.1.26143]]></STARTVERSION> <!--15D7CE8D95D043189162DBABA54A1F61--> <ISINCLUDED><![CDATA[N]]></ISINCLUDED> <!--15D7CE8D95D043189162DBABA54A1F61--> <DEPENDANT_MODULE_NAME><![CDATA[JSON Datasource]]></DEPENDANT_MODULE_NAME> <!--15D7CE8D95D043189162DBABA54A1F61--> <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT> @@ -21,7 +21,7 @@ <!--60A170212F36499D83B8AD38D01F46B3--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--60A170212F36499D83B8AD38D01F46B3--> <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID> <!--60A170212F36499D83B8AD38D01F46B3--> <AD_DEPENDENT_MODULE_ID><![CDATA[4B828F4D03264080AA1D2057B13F613C]]></AD_DEPENDENT_MODULE_ID> -<!--60A170212F36499D83B8AD38D01F46B3--> <STARTVERSION><![CDATA[2.1.26126]]></STARTVERSION> +<!--60A170212F36499D83B8AD38D01F46B3--> <STARTVERSION><![CDATA[2.1.26143]]></STARTVERSION> <!--60A170212F36499D83B8AD38D01F46B3--> <ISINCLUDED><![CDATA[N]]></ISINCLUDED> <!--60A170212F36499D83B8AD38D01F46B3--> <DEPENDANT_MODULE_NAME><![CDATA[User Interface Client Kernel]]></DEPENDANT_MODULE_NAME> <!--60A170212F36499D83B8AD38D01F46B3--> <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT> @@ -35,7 +35,7 @@ <!--824D60CB352E4099B1D8C903CA139DAE--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--824D60CB352E4099B1D8C903CA139DAE--> <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID> <!--824D60CB352E4099B1D8C903CA139DAE--> <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID> -<!--824D60CB352E4099B1D8C903CA139DAE--> <STARTVERSION><![CDATA[3.0.26126]]></STARTVERSION> +<!--824D60CB352E4099B1D8C903CA139DAE--> <STARTVERSION><![CDATA[3.0.26143]]></STARTVERSION> <!--824D60CB352E4099B1D8C903CA139DAE--> <ISINCLUDED><![CDATA[N]]></ISINCLUDED> <!--824D60CB352E4099B1D8C903CA139DAE--> <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME> <!--824D60CB352E4099B1D8C903CA139DAE--> <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT> @@ -49,7 +49,7 @@ <!--E8FD820AFE3D4FE08C02FC47769026AD--> <ISACTIVE><![CDATA[Y]]></ISACTIVE> <!--E8FD820AFE3D4FE08C02FC47769026AD--> <AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID> <!--E8FD820AFE3D4FE08C02FC47769026AD--> <AD_DEPENDENT_MODULE_ID><![CDATA[EC356CEE3D46416CA1EBEEB9AB82EDB9]]></AD_DEPENDENT_MODULE_ID> -<!--E8FD820AFE3D4FE08C02FC47769026AD--> <STARTVERSION><![CDATA[8.1.26126]]></STARTVERSION> +<!--E8FD820AFE3D4FE08C02FC47769026AD--> <STARTVERSION><![CDATA[8.1.26143]]></STARTVERSION> <!--E8FD820AFE3D4FE08C02FC47769026AD--> <ISINCLUDED><![CDATA[N]]></ISINCLUDED> <!--E8FD820AFE3D4FE08C02FC47769026AD--> <DEPENDANT_MODULE_NAME><![CDATA[Smartclient]]></DEPENDANT_MODULE_NAME> <!--E8FD820AFE3D4FE08C02FC47769026AD--> <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT> diff -r 486e7700e8d0 -r ef8a16dd11b3 modules/org.openbravo.client.application/src/org/openbravo/client/application/report/BaseReportActionHandler.java --- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/BaseReportActionHandler.java Fri Mar 06 08:10:31 2015 +0100 +++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/BaseReportActionHandler.java Mon Mar 09 16:26:11 2015 +0000 @@ -68,13 +68,18 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * Action Handler used as base for jasper reports generated from process defition. This handler can + * be extended to customize its behavior. + * + */ public class BaseReportActionHandler extends BaseProcessActionHandler { private static final Logger log = LoggerFactory.getLogger(BaseReportActionHandler.class); private static final String JASPER_PARAM_PROCESS = "jasper_process"; /** - * execute() method overridden to add the logic to download the report file stored in the temporal - * folder. + * execute() method overridden to add the logic to download the report file stored in the + * temporary folder. */ @Override public void execute() { @@ -144,49 +149,58 @@ } /** - * Downloads the file with the report result. The file is stored in a temporal folder with a + * Downloads the file with the report result. The file is stored in a temporary folder with a * generated name. It is renamed and download as an attachment of the response. Once it is * finished the file is removed from the server. - * - * @param request - * @param parameters - * Map with the needed parameters to download the report. - * @throws IOException */ private void doDownload(HttpServletRequest request, Map<String, Object> parameters) throws IOException { final String strFileName = (String) parameters.get("fileName"); - final String strFilePath = (String) parameters.get("filePath"); + final String tmpFileName = (String) parameters.get("tmpfileName"); ExportType expType = null; - if (strFileName.endsWith("pdf")) { + + if (strFileName.endsWith("." + ExportType.PDF.getExtension())) { expType = ExportType.PDF; + } else if (strFileName.endsWith("." + ExportType.XLS.getExtension())) { + expType = ExportType.XLS; } else { - expType = ExportType.XLS; + throw new IllegalArgumentException("Trying to download report file with unsupported type " + + strFileName); } - FileUtility fileUtil = new FileUtility(); - final File file = new File(strFilePath); - fileUtil = new FileUtility(file.getParent(), file.getName(), false, true); - - final HttpServletResponse response = RequestContext.get().getResponse(); - - response.setHeader("Content-Type", expType.getContentType()); - response.setContentType(expType.getContentType()); - response.setCharacterEncoding("UTF-8"); - // TODO: Compatibility code with IE8. To be reviewed when its support is stopped. - String userAgent = request.getHeader("user-agent"); - if (userAgent.contains("MSIE")) { - response.setHeader("Content-Disposition", - "attachment; filename=\"" + URLEncoder.encode(strFileName, "utf-8") + "\""); - } else { - response.setHeader("Content-Disposition", - "attachment; filename=\"" + MimeUtility.encodeWord(strFileName, "utf-8", "Q") + "\""); + if (!expType.isValidTemporaryFileName(tmpFileName)) { + throw new IllegalArgumentException("Trying to download report with invalid name " + + strFileName); } - fileUtil.dumpFile(response.getOutputStream()); - response.getOutputStream().flush(); - response.getOutputStream().close(); - file.delete(); + final String tmpDirectory = ReportingUtils.getTempFolder(); + final File file = new File(tmpDirectory, tmpFileName); + FileUtility fileUtil = new FileUtility(tmpDirectory, tmpFileName, false, true); + try { + final HttpServletResponse response = RequestContext.get().getResponse(); + + response.setHeader("Content-Type", expType.getContentType()); + response.setContentType(expType.getContentType()); + response.setCharacterEncoding("UTF-8"); + // TODO: Compatibility code with IE8. To be reviewed when its support is stopped. + // see issue #29109 + String userAgent = request.getHeader("user-agent"); + if (userAgent.contains("MSIE")) { + response.setHeader("Content-Disposition", + "attachment; filename=\"" + URLEncoder.encode(strFileName, "utf-8") + "\""); + } else { + response.setHeader("Content-Disposition", + "attachment; filename=\"" + MimeUtility.encodeWord(strFileName, "utf-8", "Q") + "\""); + } + + fileUtil.dumpFile(response.getOutputStream()); + response.getOutputStream().flush(); + response.getOutputStream().close(); + } finally { + if (file.exists()) { + file.delete(); + } + } } /** @@ -201,7 +215,6 @@ * JSONObject with the values set in the filter parameters. * @param action * String with the output type of the report. - * @throws JSONException * @throws OBException * Exception thrown when a validation fails. */ @@ -225,6 +238,9 @@ } case PDF: strJRPath = report.getPDFTemplate(); + break; + default: + throw new OBException(OBMessageUtils.messageBD("OBUIAPP_UnsupportedAction")); } if (StringUtils.isEmpty(strJRPath)) { throw new OBException(OBMessageUtils.messageBD("OBUIAPP_NoJRTemplateFound")); @@ -236,7 +252,7 @@ loadReportParams(jrParams, report, jrTemplatePath, jsonContent); log.debug("Report: {}. Start export JR process.", report.getId()); long t1 = System.currentTimeMillis(); - String strFilePath = doJRExport(jrTemplatePath, expType, jrParams, strTmpFileName); + doJRExport(jrTemplatePath, expType, jrParams, strTmpFileName); log.debug("Report: {}. Finish export JR process. Elapsed time: {}", report.getId(), System.currentTimeMillis() - t1); @@ -245,7 +261,7 @@ params.put("reportId", parameters.get("reportId")); params.put("actionHandler", this.getClass().getName()); recordInfo.put("processParameters", params); - recordInfo.put("filePath", strFilePath); + recordInfo.put("tmpfileName", strTmpFileName); recordInfo.put("fileName", strFileName); final JSONObject reportAction = new JSONObject(); @@ -280,7 +296,6 @@ ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits