[OpenbravoERP-commits] devel/pi: Related to issue 28909
details: https://code.openbravo.com/erp/devel/pi/rev/e20da585bb7e changeset: 26140:e20da585bb7e user: Eduardo Argal Guibert 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 diffstat: src/org/openbravo/materialmgmt/CSResponseGetStockParam.java | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diffs (13 lines): diff -r 9e1c26ee24ab -r e20da585bb7e src/org/openbravo/materialmgmt/CSResponseGetStockParam.java --- a/src/org/openbravo/materialmgmt/CSResponseGetStockParam.java Fri Mar 06 15:03:31 2015 + +++ b/src/org/openbravo/materialmgmt/CSResponseGetStockParam.java Fri Mar 06 16:52:17 2015 +0100 @@ -19,6 +19,6 @@ package org.openbravo.materialmgmt; public class CSResponseGetStockParam { - String p_result; - String p_message; + public String p_result; + public String p_message; } \ No newline at end of file -- 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
[OpenbravoERP-commits] devel/pi: Fixes issue 28939
details: https://code.openbravo.com/erp/devel/pi/rev/b9fc7e8e60ae changeset: 26141:b9fc7e8e60ae user: Eduardo Argal Guibert 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. diffstat: 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 +++ 4 files changed, 96 insertions(+), 5 deletions(-) diffs (143 lines): diff -r e20da585bb7e -r b9fc7e8e60ae src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateBpPaymentLine.class Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateBpPaymentLine.class has changed diff -r e20da585bb7e -r b9fc7e8e60ae src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateBpPaymentLineData.class Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateBpPaymentLineData.class has changed diff -r e20da585bb7e -r b9fc7e8e60ae src-util/modulescript/src/org/openbravo/modulescript/UpdateBpPaymentLine.java --- a/src-util/modulescript/src/org/openbravo/modulescript/UpdateBpPaymentLine.java Fri Mar 06 16:52:17 2015 +0100 +++ b/src-util/modulescript/src/org/openbravo/modulescript/UpdateBpPaymentLine.java Fri Mar 06 17:03:04 2015 +0100 @@ -19,23 +19,53 @@ package org.openbravo.modulescript; import org.apache.log4j.Logger; +import org.openbravo.data.UtilSql; import org.openbravo.database.ConnectionProvider; import org.openbravo.modulescript.ModuleScript; +import java.io.FileInputStream; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Properties; + +import javax.servlet.ServletException; +/** + * This module script has ben created due to issue 28939. + * Due to some performance issues this module script sometimes + * has to create a primary key when it is missing. + * This should never be done but in really strange situations. + * + */ public class UpdateBpPaymentLine extends ModuleScript { - private static final Logger log4j = Logger.getLogger(UpdateBpPaymentLine.class); @Override public void execute() { try { ConnectionProvider cp = getConnectionProvider(); - boolean executed = UpdateBpPaymentLineData.isModuleScriptExecuted(cp); if (!executed) { - int count = 0; -count = UpdateBpPaymentLineData.updateBpPaymentLineInvoice(cp); -count += UpdateBpPaymentLineData.updateBpPaymentLineOrder(cp); +String strRDBMS = cp.getRDBMS(); +boolean missingIndex = false; +int count = 0; +try{ + if (strRDBMS.equalsIgnoreCase("POSTGRE")) { +missingIndex = !invoiceIndexExists(cp); +if(missingIndex){ + UpdateBpPaymentLineData.createInvoiceIndex(cp); + UpdateBpPaymentLineData.analyzeInvoice(cp); +} + } + count = UpdateBpPaymentLineData.updateBpPaymentLineInvoice(cp); + count += UpdateBpPaymentLineData.updateBpPaymentLineOrder(cp); +}finally{ + if (strRDBMS.equalsIgnoreCase("POSTGRE")) { +if(missingIndex){ + UpdateBpPaymentLineData.dropInvoiceIndex(cp); +} + } +} if (count > 0) log4j.info("Updated " + count + " Payment Scheduled Details."); UpdateBpPaymentLineData.createPreference(cp); @@ -44,5 +74,42 @@ handleError(e); } } + private static boolean invoiceIndexExists(ConnectionProvider connectionProvider)throws ServletException { +String strSql = ""; +strSql = strSql + + "select" + + "i.relname as index_name" + + "from" + + "pg_class i," + + "pg_index ix" + + "where i.oid = ix.indexrelid" + + "and i.relname = 'c_invoice_key'"; +ResultSet result; +boolean boolReturn = false; +PreparedStatement st = null; + +try { +st = connectionProvider.getPreparedStatement(strSql); + + result = st.executeQuery(); + if(result.next()) { +boolReturn = !UtilSql.getValue(result, "index_name").equals("0"); + } + result.close(); +} catch(SQLException e){ + log4j.error("SQL error in query: " + strSql + "Exception:"+ e); + throw new ServletException("@CODE=" + Integer
[OpenbravoERP-commits] devel/pi: 2 new changesets
details: https://code.openbravo.com/erp/devel/pi/rev/1601137b3c3d changeset: 26138:1601137b3c3d user: RM packaging bot openbravo.com> date: Fri Mar 06 14:42:49 2015 + summary: CI: update AD_MODULE to version 26133 details: https://code.openbravo.com/erp/devel/pi/rev/9e1c26ee24ab changeset: 26139:9e1c26ee24ab user: RM packaging bot openbravo.com> date: Fri Mar 06 15:03:31 2015 + summary: CI: merge back from main 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
[OpenbravoERP-commits] devel/main: 7 new changesets
details: https://code.openbravo.com/erp/devel/main/rev/1c75a6afca4e changeset: 26128:1c75a6afca4e user: Augusto Mauch openbravo.com> date: Thu Mar 05 10:49:36 2015 +0100 summary: Related with issue 29113: Avoid using isc in OB.Utilities.Number.roundJSNumber The OB.Utilities.Number.roundJSNumber function is used in the mobile core module, but smartclient is not available there. OB.Utilities.Number.roundJSNumber should not be used there (see [1]), but in the meantime we are going to avoid using smartclient functions in roundJSNumber. isc.isA.String has been replaced with (typeof num === 'string') [1] https://issues.openbravo.com/view.php?id=29139 details: https://code.openbravo.com/erp/devel/main/rev/a410732b5a7f changeset: 26129:a410732b5a7f user: Asier Lostalé openbravo.com> date: Thu Mar 05 16:04:13 2015 +0100 summary: fixed bug 29117: empty linked items if computed column points current entity Linked items section didn't receive any row and remained in "loading data" state when a computed column in any entity linked to the entity the section was used in. The problem was caused by an error when trying to deal with computed column in linked items. No error was shown nor in UI nor in openbravo.log. This fix: - Adds log in openbravo.log including stack trace in case of error computing linked items - NPE getMessage is null which caused not to be shown in the UI, it is casted to String - Computed Columns are properly ignored in linked items IMPORTANT NOTE: Computed Columns cannot be evaluated in linked items so they are ignored details: https://code.openbravo.com/erp/devel/main/rev/9a12a6271cdd changeset: 26130:9a12a6271cdd user: Asier Lostalé openbravo.com> date: Thu Mar 05 14:18:04 2015 +0100 summary: fixed bug 29127: PR14Q3 -> PR14Q4 update can fail activating FKs Added build validation to prevent this error. This build validation prevents issue #29127 by deleting rows in ad_process_run for executions of CostingRuleProcess which is removed but due to issue #29142 update database process is not able to properly handle. It is a temporary workaround and it should be removed one #29142 is resolved. It should have been implemented as ModuleScript because it is repairing data, but because ad_process_run and ad_process_request tables are recreated when updating from PR14Q3 to PR14Q4, module script would be executed without indexes nor DB statistics which might result, depending on the data volumes in these table, in slow executions due to poor query execution plans. Exceptionally, implementing it as build validation to be executed before actual database update allowing better plans. details: https://code.openbravo.com/erp/devel/main/rev/ec6a5bf6a16e changeset: 26131:ec6a5bf6a16e user: RM packaging bot openbravo.com> date: Thu Mar 05 16:00:48 2015 + summary: CI: merge back from main details: https://code.openbravo.com/erp/devel/main/rev/68dac1cb62fa changeset: 26132:68dac1cb62fa user: Asier Lostalé openbravo.com> date: Thu Mar 05 17:36:57 2015 +0100 summary: fixed bug 29140: selected credit selected is not used When adding a payment the selected records for used credit were not taken into account. The problem was credit_to_use._selection property was always sent as [] after fix for issue #28712. The problem was in the overwritten selectionChanged js method for this grid, which should invoke super's selectionChanged but it didn't do it correctly. details: https://code.openbravo.com/erp/devel/main/rev/486e7700e8d0 changeset: 26133:486e7700e8d0 user: Asier Lostalé openbravo.com> date: Fri Mar 06 08:10:31 2015 +0100 summary: fixed issue 29154: added log on table recreation when updating database details: https://code.openbravo.com/erp/devel/main/rev/1601137b3c3d changeset: 26134:1601137b3c3d user: RM packaging bot openbravo.com> date: Fri Mar 06 14:42:49 2015 + summary: CI: update AD_MODULE to version 26133 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 |2 +- 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_MODULE.xml |2 +- modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml |8 +- m
[OpenbravoERP-commits] devel/pi: 2 new changesets
details: https://code.openbravo.com/erp/devel/pi/rev/95f9c5ce6207 changeset: 26136:95f9c5ce6207 user: Eduardo Argal Guibert 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/pi/rev/ab393536c4bc changeset: 26137:ab393536c4bc user: Eduardo Argal Guibert 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. diffstat: src-core/src/org/openbravo/database/RDBMSIndependent.java | 2 +- src/org/openbravo/materialmgmt/CSResponseGetStockParam.java | 24 src/org/openbravo/materialmgmt/StockUtils.java | 47 src/org/openbravo/materialmgmt/StockUtils_data.xsql | 71 + 4 files changed, 143 insertions(+), 1 deletions(-) diffs (167 lines): diff -r d8ec9347e127 -r ab393536c4bc src-core/src/org/openbravo/database/RDBMSIndependent.java --- a/src-core/src/org/openbravo/database/RDBMSIndependent.java Fri Mar 06 08:51:40 2015 +0100 +++ b/src-core/src/org/openbravo/database/RDBMSIndependent.java Fri Mar 06 11:31:38 2015 +0100 @@ -73,7 +73,7 @@ String typeAux = types.elementAt(i); if (!typeAux.equalsIgnoreCase("out")) { iParameter++; -UtilSql.setValue(st, iParameter, 12, "Test", parameters.elementAt(i)); +UtilSql.setValue(st, iParameter, 12, null, parameters.elementAt(i)); } } } diff -r d8ec9347e127 -r ab393536c4bc src/org/openbravo/materialmgmt/CSResponseGetStockParam.java --- /dev/null Thu Jan 01 00:00:00 1970 + +++ b/src/org/openbravo/materialmgmt/CSResponseGetStockParam.java Fri Mar 06 11:31:38 2015 +0100 @@ -0,0 +1,24 @@ +/* + * + * The contents of this file are subject to the Openbravo Public License + * Version 1.1 (the "License"), being the Mozilla Public License + * Version 1.1 with a permitted attribution clause; you may not use this + * file except in compliance with the License. You may obtain a copy of + * the License at http://www.openbravo.com/legal/license.html + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + * License for the specific language governing rights and limitations + * under the License. + * The Original Code is Openbravo ERP. + * The Initial Developer of the Original Code is Openbravo SLU + * All portions are Copyright (C) 2015 Openbravo SLU + * All Rights Reserved. + * Contributor(s): __. + + */ +package org.openbravo.materialmgmt; + +public class CSResponseGetStockParam { + String p_result; + String p_message; +} \ No newline at end of file diff -r d8ec9347e127 -r ab393536c4bc src/org/openbravo/materialmgmt/StockUtils.java --- /dev/null Thu Jan 01 00:00:00 1970 + +++ b/src/org/openbravo/materialmgmt/StockUtils.javaFri Mar 06 11:31:38 2015 +0100 @@ -0,0 +1,47 @@ +/* + * + * The contents of this file are subject to the Openbravo Public License + * Version 1.0 (the "License"), being the Mozilla Public License + * Version 1.1 with a permitted attribution clause; you may not use this + * file except in compliance with the License. You may obtain a copy of + * the License at http://www.openbravo.com/legal/license.html + * Software distributed under the License is distributed on an "AS IS" + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + * License for the specific language governing rights and limitations + * under the License. + * The Original Code is Openbravo ERP. + * The Initial Developer of the Original Code is Openbravo SLU + * All portions are Copyright (C) 2015 Openbravo SLU + * All Rights Reserved. + * Contributor(s): __. + * + */ +package org.openbravo.materialmgmt; + +import java.math.BigDecimal; + +import javax.servlet.ServletException; + +import org.openbravo.dal.service.OBDal; +import org.openbravo.exception.NoConnectionAvailableException; +import org.openbravo.service.db.DalConnectionProvider; + +public class StockUtils { + /* + * Calls M_GET_STOCK_PARAM and retrieves result in a CSResponseGetStockParam object. Records will + * be created in M_STOCK_PROPOSAL with AD_PINSTASNCE_ID = uuid (parameter). + */ + public static CSResponseGetStockParam getStock(String uuid
[OpenbravoERP-commits] devel/pi: fixed issue 29157: code review issues for Process Defi...
details: https://code.openbravo.com/erp/devel/pi/rev/d8ec9347e127 changeset: 26135:d8ec9347e127 user: Asier Lostalé 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 diffstat: modules/org.openbravo.client.application/src-db/database/sourcedata/AD_FIELD.xml | 1 + 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 +- 5 files changed, 127 insertions(+), 81 deletions(-) diffs (truncated from 443 to 300 lines): diff -r 4ee0aae2bc57 -r d8ec9347e127 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 Wed Mar 04 17:07:47 2015 +0100 +++ b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_FIELD.xml Fri Mar 06 08:51:40 2015 +0100 @@ -5077,6 +5077,7 @@ + diff -r 4ee0aae2bc57 -r d8ec9347e127 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 Wed Mar 04 17:07:47 2015 +0100 +++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/report/BaseReportActionHandler.java Fri Mar 06 08:51:40 2015 +0100 @@ -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 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.endsWit
[OpenbravoERP-commits] devel/pi: Fixed bug 29124 It is not possible to create PaymentOu...
details: https://code.openbravo.com/erp/devel/pi/rev/4ee0aae2bc57 changeset: 26134:4ee0aae2bc57 user: Sandra Huguet 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. diffstat: modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js | 14 ++--- 1 files changed, 9 insertions(+), 5 deletions(-) diffs (31 lines): diff -r 486e7700e8d0 -r 4ee0aae2bc57 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 Wed Mar 04 17:07:47 2015 +0100 @@ -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); } -- 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