details: https://code.openbravo.com/erp/devel/pi/rev/7c7f8dd38324 changeset: 30982:7c7f8dd38324 user: Sanjota <sanjota.nelagi <at> promantia.com> date: Mon Dec 19 16:05:02 2016 +0530 summary: Fixes issue 34718 :Reformat sourcecode using eclipse 3.7
diffstat: src-util/buildvalidation/build/classes/org/openbravo/buildvalidation/AccountingTabs.class | 0 src-util/buildvalidation/src/org/openbravo/buildvalidation/AccountingTabs.java | 95 ++++++--- 2 files changed, 61 insertions(+), 34 deletions(-) diffs (126 lines): diff -r 8a7ca1c913ed -r 7c7f8dd38324 src-util/buildvalidation/build/classes/org/openbravo/buildvalidation/AccountingTabs.class Binary file src-util/buildvalidation/build/classes/org/openbravo/buildvalidation/AccountingTabs.class has changed diff -r 8a7ca1c913ed -r 7c7f8dd38324 src-util/buildvalidation/src/org/openbravo/buildvalidation/AccountingTabs.java --- a/src-util/buildvalidation/src/org/openbravo/buildvalidation/AccountingTabs.java Mon Dec 19 10:34:03 2016 +0100 +++ b/src-util/buildvalidation/src/org/openbravo/buildvalidation/AccountingTabs.java Mon Dec 19 16:05:02 2016 +0530 @@ -33,7 +33,7 @@ private static final String alertGroupName = "Business Partner Category Duplicated Accounts"; private static final String alertCustomerName = "Customer Business Partner Duplicated Accounts"; private static final String alertVendorName = "Vendor Business Partner Duplicated Accounts"; - + @Override public List<String> execute() { ConnectionProvider cp = getConnectionProvider(); @@ -43,41 +43,66 @@ final int wrongCustomerAcct = Integer.parseInt(AccountingTabsData.countWrongCustomerAcct(cp)); final int wrongVendorAcct = Integer.parseInt(AccountingTabsData.countWrongVendorAcct(cp)); - if (wrongGroupAcct > 0 || wrongCustomerAcct > 0 || wrongVendorAcct > 0 ) { - errors.add("You can not apply this MP because your instance fails in the pre-validation phase: "); + if (wrongGroupAcct > 0 || wrongCustomerAcct > 0 || wrongVendorAcct > 0) { + errors + .add("You can not apply this MP because your instance fails in the pre-validation phase: "); - if (wrongGroupAcct > 0) { - errors - .add("It is not allowed to have more than one entry in Business Partner Category -> Accounting tab for the same accounting schema. Until 3.0MP11 it was allowed although it was wrong since the behaviour was unpredictable: any of the duplicated accounts could be used for the accounting of that business partner category. To fix this problem in your instance, you can know the duplicated entries by reviewing Alerts in your system (Alert Rule: "+ alertGroupName + "). Once you find the duplicated entries you should remove the wrong ones. After fixing all these entries you should be able to apply this MP."); + if (wrongGroupAcct > 0) { + errors + .add("It is not allowed to have more than one entry in Business Partner Category -> Accounting tab for the same accounting schema. Until 3.0MP11 it was allowed although it was wrong since the behaviour was unpredictable: any of the duplicated accounts could be used for the accounting of that business partner category. To fix this problem in your instance, you can know the duplicated entries by reviewing Alerts in your system (Alert Rule: " + + alertGroupName + + "). Once you find the duplicated entries you should remove the wrong ones. After fixing all these entries you should be able to apply this MP."); - if (AccountingTabsData.existsAlertRule(cp, alertGroupName).equals("0")) { - final String alertRuleId = AccountingTabsData.getUUID(cp); - AccountingTabsData.insertAlertRule(cp, alertRuleId, alertGroupName, "323", "select max(C_BP_Group_Acct_ID) as referencekey_id, ad_column_identifier('C_BP_Group_Acct',max(C_BP_Group_Acct_ID),'en_US') as record_id, 0 as ad_role_id, null as ad_user_id, 'Duplicated accounting Configuration entry. Please ensure just one entry exists per accounting schema for this business partner category' as description, 'Y' as isActive, max(ad_org_id) as ad_org_id, max(ad_client_id) as ad_client_id, now() as created, 0 as createdBy, now() as updated, 0 as updatedBy from C_BP_Group_Acct p group by c_acctschema_id, c_bp_group_id having count(*)>1"); - processAlert(alertRuleId, cp); - } - } + if (AccountingTabsData.existsAlertRule(cp, alertGroupName).equals("0")) { + final String alertRuleId = AccountingTabsData.getUUID(cp); + AccountingTabsData + .insertAlertRule( + cp, + alertRuleId, + alertGroupName, + "323", + "select max(C_BP_Group_Acct_ID) as referencekey_id, ad_column_identifier('C_BP_Group_Acct',max(C_BP_Group_Acct_ID),'en_US') as record_id, 0 as ad_role_id, null as ad_user_id, 'Duplicated accounting Configuration entry. Please ensure just one entry exists per accounting schema for this business partner category' as description, 'Y' as isActive, max(ad_org_id) as ad_org_id, max(ad_client_id) as ad_client_id, now() as created, 0 as createdBy, now() as updated, 0 as updatedBy from C_BP_Group_Acct p group by c_acctschema_id, c_bp_group_id having count(*)>1"); + processAlert(alertRuleId, cp); + } + } - if (wrongCustomerAcct > 0) { - errors - .add("It is not allowed to have more than one entry in Business Partner -> Customer -> Customer Accounting tab for the same accounting schema. Until 3.0MP11 it was allowed although it was wrong since the behaviour was unpredictable: any of the duplicated accounts could be used for the accounting of that business partner. To fix this problem in your instance, you can know the duplicated entries by reviewing Alerts in your system (Alert Rule: "+ alertCustomerName + "). Once you find the duplicated entries you should remove the wrong ones. After fixing all these entries you should be able to apply this MP."); - - if (AccountingTabsData.existsAlertRule(cp, alertCustomerName).equals("0")) { - final String alertRuleId = AccountingTabsData.getUUID(cp); - AccountingTabsData.insertAlertRule(cp, alertRuleId, alertCustomerName, "212", "select max(C_BP_CUSTOMER_ACCT_ID) as referencekey_id, ad_column_identifier('C_BP_CUSTOMER_ACCT',max(C_BP_CUSTOMER_ACCT_ID),'en_US') as record_id, 0 as ad_role_id, null as ad_user_id, 'Duplicated accounting Configuration entry. Please ensure just one entry exists per accounting schema for this business partner (customer)' as description, 'Y' as isActive, max(ad_org_id) as ad_org_id, max(ad_client_id) as ad_client_id, now() as created, 0 as createdBy, now() as updated, 0 as updatedBy from C_BP_CUSTOMER_ACCT p group by c_acctschema_id, c_bpartner_id having count(*)>1"); - processAlert(alertRuleId, cp); - } - } + if (wrongCustomerAcct > 0) { + errors + .add("It is not allowed to have more than one entry in Business Partner -> Customer -> Customer Accounting tab for the same accounting schema. Until 3.0MP11 it was allowed although it was wrong since the behaviour was unpredictable: any of the duplicated accounts could be used for the accounting of that business partner. To fix this problem in your instance, you can know the duplicated entries by reviewing Alerts in your system (Alert Rule: " + + alertCustomerName + + "). Once you find the duplicated entries you should remove the wrong ones. After fixing all these entries you should be able to apply this MP."); - if (wrongVendorAcct > 0) { - errors - .add("It is not allowed to have more than one entry in Business Partner -> Vendor -> Vendor Accounting tab for the same accounting schema. Until 3.0MP11 it was allowed although it was wrong since the behaviour was unpredictable: any of the duplicated accounts could be used for the accounting of that business partner. To fix this problem in your instance, you can know the duplicated entries by reviewing Alerts in your system (Alert Rule: "+ alertVendorName + "). Once you find the duplicated entries you should remove the wrong ones. After fixing all these entries you should be able to apply this MP."); - - if (AccountingTabsData.existsAlertRule(cp, alertVendorName).equals("0")) { - final String alertRuleId = AccountingTabsData.getUUID(cp); - AccountingTabsData.insertAlertRule(cp, alertRuleId, alertVendorName, "213", "select max(C_BP_VENDOR_ACCT_ID) as referencekey_id, ad_column_identifier('C_BP_VENDOR_ACCT',max(C_BP_VENDOR_ACCT_ID),'en_US') as record_id, 0 as ad_role_id, null as ad_user_id, 'Duplicated accounting Configuration entry. Please ensure just one entry exists per accounting schema for this business partner (vendor)' as description, 'Y' as isActive, max(ad_org_id) as ad_org_id, max(ad_client_id) as ad_client_id, now() as created, 0 as createdBy, now() as updated, 0 as updatedBy from C_BP_VENDOR_ACCT p group by c_acctschema_id, c_bpartner_id having count(*)>1"); - processAlert(alertRuleId, cp); - } - } + if (AccountingTabsData.existsAlertRule(cp, alertCustomerName).equals("0")) { + final String alertRuleId = AccountingTabsData.getUUID(cp); + AccountingTabsData + .insertAlertRule( + cp, + alertRuleId, + alertCustomerName, + "212", + "select max(C_BP_CUSTOMER_ACCT_ID) as referencekey_id, ad_column_identifier('C_BP_CUSTOMER_ACCT',max(C_BP_CUSTOMER_ACCT_ID),'en_US') as record_id, 0 as ad_role_id, null as ad_user_id, 'Duplicated accounting Configuration entry. Please ensure just one entry exists per accounting schema for this business partner (customer)' as description, 'Y' as isActive, max(ad_org_id) as ad_org_id, max(ad_client_id) as ad_client_id, now() as created, 0 as createdBy, now() as updated, 0 as updatedBy from C_BP_CUSTOMER_ACCT p group by c_acctschema_id, c_bpartner_id having count(*)>1"); + processAlert(alertRuleId, cp); + } + } + + if (wrongVendorAcct > 0) { + errors + .add("It is not allowed to have more than one entry in Business Partner -> Vendor -> Vendor Accounting tab for the same accounting schema. Until 3.0MP11 it was allowed although it was wrong since the behaviour was unpredictable: any of the duplicated accounts could be used for the accounting of that business partner. To fix this problem in your instance, you can know the duplicated entries by reviewing Alerts in your system (Alert Rule: " + + alertVendorName + + "). Once you find the duplicated entries you should remove the wrong ones. After fixing all these entries you should be able to apply this MP."); + + if (AccountingTabsData.existsAlertRule(cp, alertVendorName).equals("0")) { + final String alertRuleId = AccountingTabsData.getUUID(cp); + AccountingTabsData + .insertAlertRule( + cp, + alertRuleId, + alertVendorName, + "213", + "select max(C_BP_VENDOR_ACCT_ID) as referencekey_id, ad_column_identifier('C_BP_VENDOR_ACCT',max(C_BP_VENDOR_ACCT_ID),'en_US') as record_id, 0 as ad_role_id, null as ad_user_id, 'Duplicated accounting Configuration entry. Please ensure just one entry exists per accounting schema for this business partner (vendor)' as description, 'Y' as isActive, max(ad_org_id) as ad_org_id, max(ad_client_id) as ad_client_id, now() as created, 0 as createdBy, now() as updated, 0 as updatedBy from C_BP_VENDOR_ACCT p group by c_acctschema_id, c_bpartner_id having count(*)>1"); + processAlert(alertRuleId, cp); + } + } } } catch (Exception e) { return handleError(e); @@ -107,9 +132,11 @@ for (int i = 0; i < alert.length; i++) { boolean existsReference = false; if (AccountingTabsData.existsStatusColumn(cp)) { - existsReference = AccountingTabsData.existsReference(cp, adAlertruleId, alert[i].referencekeyId); + existsReference = AccountingTabsData.existsReference(cp, adAlertruleId, + alert[i].referencekeyId); } else { - existsReference = AccountingTabsData.existsReferenceOld(cp, adAlertruleId, alert[i].referencekeyId); + existsReference = AccountingTabsData.existsReferenceOld(cp, adAlertruleId, + alert[i].referencekeyId); } if (!existsReference) { AccountingTabsData.insertAlert(cp, alert[i].description, alertRule[0].adAlertruleId, ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits