details: /erp/devel/int/rev/4940c63db907 changeset: 7095:4940c63db907 user: Harikrishnan Raja <harikrishnan.raja <at> openbravo.com> date: Tue Apr 20 13:39:41 2010 +0530 summary: Fixes for inserting the license in java file.
details: /erp/devel/int/rev/b5f915fde1b4 changeset: 7096:b5f915fde1b4 user: Gorka Ion Damián <gorkaion.damian <at> openbravo.com> date: Tue Apr 20 10:44:30 2010 +0200 summary: Related to issue 13048. Changed done to avoid api break on updateInvoice method. diffstat: src-util/modulescript/src/org/openbravo/modulescript/CreateDoctypeTemplate.java | 18 ++++++++++ src/org/openbravo/erpCommon/ad_actionButton/InvoicePaymentMonitor.java | 6 ++- src/org/openbravo/erpCommon/ad_process/PaymentMonitor.java | 16 ++++++-- src/org/openbravo/erpCommon/ad_process/PaymentMonitorProcess.java | 3 +- 4 files changed, 34 insertions(+), 9 deletions(-) diffs (83 lines): diff -r 0b04dd591f7e -r b5f915fde1b4 src-util/modulescript/src/org/openbravo/modulescript/CreateDoctypeTemplate.java --- a/src-util/modulescript/src/org/openbravo/modulescript/CreateDoctypeTemplate.java Tue Apr 20 08:59:59 2010 +0200 +++ b/src-util/modulescript/src/org/openbravo/modulescript/CreateDoctypeTemplate.java Tue Apr 20 10:44:30 2010 +0200 @@ -1,3 +1,21 @@ +/* + ************************************************************************* + * 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) 2010 Openbravo SLU + * All Rights Reserved. + * Contributor(s): ______________________________________. + ************************************************************************ + */ package org.openbravo.modulescript; import java.sql.Connection; diff -r 0b04dd591f7e -r b5f915fde1b4 src/org/openbravo/erpCommon/ad_actionButton/InvoicePaymentMonitor.java --- a/src/org/openbravo/erpCommon/ad_actionButton/InvoicePaymentMonitor.java Tue Apr 20 08:59:59 2010 +0200 +++ b/src/org/openbravo/erpCommon/ad_actionButton/InvoicePaymentMonitor.java Tue Apr 20 10:44:30 2010 +0200 @@ -84,9 +84,11 @@ OBError myError = null; try { Invoice invoice = OBDal.getInstance().get(Invoice.class, strKey); - if (invoice.isProcessed()) { + // Extra check for PaymentMonitor-disabling switch, to build correct message for users + if (Utility.getPropertyValue("PaymentMonitor", vars.getClient(), invoice.getOrganization() + .getId()) == null + && invoice.isProcessed()) PaymentMonitor.updateInvoice(invoice); - } myError = new OBError(); myError.setType("Success"); diff -r 0b04dd591f7e -r b5f915fde1b4 src/org/openbravo/erpCommon/ad_process/PaymentMonitor.java --- a/src/org/openbravo/erpCommon/ad_process/PaymentMonitor.java Tue Apr 20 08:59:59 2010 +0200 +++ b/src/org/openbravo/erpCommon/ad_process/PaymentMonitor.java Tue Apr 20 10:44:30 2010 +0200 @@ -28,13 +28,19 @@ /** * Updates payment monitor information + * + * Users of this method should check for existence of the PaymentMonitor property (disabling it) + * to be able to provide the user with a relevant message. */ - public static void updateInvoice(Invoice invoice) throws PropertyException { - // Don't update the payment monitor information if there is an installed extension module that - // manages it. - if (Utility.getPropertyValue("PaymentMonitor", invoice.getClient().getId(), invoice - .getOrganization().getId()) != null) + public static void updateInvoice(Invoice invoice) { + // Check for PaymentMonitor-disabling switch. + try { + if (Utility.getPropertyValue("PaymentMonitor", invoice.getClient().getId(), invoice + .getOrganization().getId()) != null) + return; + } catch (PropertyException e) { return; + } final boolean prevMode = OBContext.getOBContext().setInAdministratorMode(true); try { List<DebtPayment> payments = invoice.getFinancialMgmtDebtPaymentList(); diff -r 0b04dd591f7e -r b5f915fde1b4 src/org/openbravo/erpCommon/ad_process/PaymentMonitorProcess.java --- a/src/org/openbravo/erpCommon/ad_process/PaymentMonitorProcess.java Tue Apr 20 08:59:59 2010 +0200 +++ b/src/org/openbravo/erpCommon/ad_process/PaymentMonitorProcess.java Tue Apr 20 10:44:30 2010 +0200 @@ -21,8 +21,7 @@ public void doExecute(ProcessBundle bundle) throws Exception { logger = bundle.getLogger(); - // Don't update the payment monitor information if there is an installed extension module that - // manages it. + // Extra check for PaymentMonitor-disabling switch, to build correct message for users try { if (Utility.getPropertyValue("PaymentMonitor", bundle.getContext().getClient(), bundle .getContext().getOrganization()) != null) { ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Openbravo-commits mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbravo-commits
