[APRM] Apply feedback after code review.
authorMikel Irurita <mikel.irurita@openbravo.com>
Fri, 12 Aug 2011 12:48:02 +0200
changeset 13522 14a8a048eec9
parent 13521 5da22cc510dd
child 13523 c094ddabc843
[APRM] Apply feedback after code review.
Boolean variable not needed, just return true or false.
Remove selectTablesMoreInfo sqlMethod and modify existing selectTables one
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java
src/org/openbravo/erpCommon/ad_forms/AcctServer_data.xsql
src/org/openbravo/erpCommon/ad_forms/CallAcctServer.java
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java	Fri Aug 12 11:17:32 2011 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java	Fri Aug 12 12:48:02 2011 +0200
@@ -351,19 +351,17 @@
    *         in other cases.
    */
   private boolean isPaymentMethodConfigured(Invoice invoice) {
-    boolean paymentMethodConfigOk = false;
     final FIN_FinancialAccount bpFinAccount = invoice.isSalesTransaction() ? invoice
         .getBusinessPartner().getAccount() : invoice.getBusinessPartner().getPOFinancialAccount();
     if (bpFinAccount != null) {
       for (final FinAccPaymentMethod bpFinAccPaymentMethod : bpFinAccount
           .getFinancialMgmtFinAccPaymentMethodList()) {
         if (bpFinAccPaymentMethod.getPaymentMethod().equals(invoice.getPaymentMethod())) {
-          paymentMethodConfigOk = true;
-          break;
+          return true;
         }
       }
     }
-    return paymentMethodConfigOk;
+    return false;
   }
 
   public String getServletInfo() {
--- a/src/org/openbravo/erpCommon/ad_forms/AcctServer_data.xsql	Fri Aug 12 11:17:32 2011 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/AcctServer_data.xsql	Fri Aug 12 12:48:02 2011 +0200
@@ -479,24 +479,6 @@
       <SqlMethodComment></SqlMethodComment>
       <Sql>
      SELECT DISTINCT(AD_Table.AD_Table_ID) as id,
-               (case when ad_table.po_window_id is null then '' else ad_column_identifier('AD_Window',TO_CHAR(ad_table.po_window_id),?) end)||(case when ad_table.po_window_id is null then '' else ' - ' end)||ad_column_identifier('AD_Window',TO_CHAR(ad_table.ad_window_id),?) as name
-        FROM AD_TABLE, C_ACCTSCHEMA_TABLE
-       WHERE AD_TABLE.AD_TABLE_ID = C_ACCTSCHEMA_TABLE.AD_TABLE_ID
-         AND AD_TABLE.ISACTIVE = 'Y'
-         AND C_ACCTSCHEMA_TABLE.ISACTIVE = 'Y'
-         AND C_ACCTSCHEMA_TABLE.AD_CLIENT_ID IN ('1')
-        order by name
-      </Sql>
-      <Parameter name="language"/>
-      <Parameter name="language"/>
-      <Parameter name="adUserClient" type="replace" optional="true" after="C_ACCTSCHEMA_TABLE.AD_CLIENT_ID IN (" text="'1'"/>
-   </SqlMethod>
-
-   <SqlMethod name="selectTablesMoreInfo" type="preparedStatement" return="multiple">
-      <SqlMethodComment>Same as selectTables sqlMethod but it concatenates information about the table database name.
-      Useful when several tabs of the same window referenced accounting tables (tables that will be posted).</SqlMethodComment>
-      <Sql>
-     SELECT DISTINCT(AD_Table.AD_Table_ID) as id,
                AD_Table.tablename || ' (' ||
                (case when ad_table.po_window_id is null then '' else ad_column_identifier('AD_Window',TO_CHAR(ad_table.po_window_id),?) end)
                || (case when ad_table.po_window_id is null then '' else ' - ' end)
--- a/src/org/openbravo/erpCommon/ad_forms/CallAcctServer.java	Fri Aug 12 11:17:32 2011 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/CallAcctServer.java	Fri Aug 12 12:48:02 2011 +0200
@@ -123,7 +123,7 @@
       xmlDocument.setParameter("body",
           (strMessage.equals("") ? "" : "alert('" + strMessage + "');"));
 
-      AcctServerData[] data = AcctServerData.selectTablesMoreInfo(this, vars.getLanguage(),
+      AcctServerData[] data = AcctServerData.selectTables(this, vars.getLanguage(),
           Utility.getContext(this, vars, "#User_Client", ""));
       if (log4j.isDebugEnabled())
         log4j.debug("select tables org:" + Utility.getContext(this, vars, "#User_Org", "")