details: https://code.openbravo.com/erp/devel/pi/rev/e586785fbceb
changeset: 21393:e586785fbceb
user: Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at>
openbravo.com>
date: Tue Oct 29 11:48:39 2013 +0530
summary: Backout Issue 24848: Closed period verification should not be
performed
diffstat:
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java
| 150 +--------
1 files changed, 18 insertions(+), 132 deletions(-)
diffs (196 lines):
diff -r 0c5a121a79dd -r e586785fbceb
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java
---
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java
Fri Oct 25 15:53:42 2013 -0400
+++
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java
Tue Oct 29 11:48:39 2013 +0530
@@ -11,16 +11,14 @@
* 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-2013 Openbravo SLU
+ * All portions are Copyright (C) 2010-2011 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
*************************************************************************
*/
package org.openbravo.advpaymentmngt.process;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
@@ -35,18 +33,13 @@
import org.openbravo.erpCommon.utility.OBDateUtils;
import org.openbravo.erpCommon.utility.OBError;
import org.openbravo.erpCommon.utility.Utility;
-import
org.openbravo.model.financialmgmt.accounting.FIN_FinancialAccountAccounting;
import org.openbravo.model.financialmgmt.payment.FIN_BankStatement;
-import org.openbravo.model.financialmgmt.payment.FIN_FinaccTransaction;
-import org.openbravo.model.financialmgmt.payment.FIN_Payment;
import org.openbravo.model.financialmgmt.payment.FIN_Reconciliation;
import org.openbravo.model.financialmgmt.payment.FIN_ReconciliationLine_v;
-import org.openbravo.model.financialmgmt.payment.FinAccPaymentMethod;
import org.openbravo.scheduling.ProcessBundle;
public class FIN_ReconciliationProcess implements
org.openbravo.scheduling.Process {
private static AdvPaymentMngtDao dao;
- Set<FIN_FinaccTransaction> transactionsToBePosted = new
HashSet<FIN_FinaccTransaction>();
public void execute(ProcessBundle bundle) throws Exception {
dao = new AdvPaymentMngtDao();
@@ -85,35 +78,24 @@
bundle.setResult(msg);
return;
} else {
- if (getDocumentConfirmation(conProvider, recordID)) {
- for (FIN_ReconciliationLine_v recLine :
reconciliation.getFINReconciliationLineVList()) {
- boolean orgLegalWithAccounting =
FIN_Utility.periodControlOpened(recLine
-
.getFinancialAccountTransaction().getReconciliation().TABLE_NAME, recLine
-
.getFinancialAccountTransaction().getReconciliation().getId(), recLine
-
.getFinancialAccountTransaction().getReconciliation().TABLE_NAME + "_ID", "LE");
- if
(!FIN_Utility.isPeriodOpen(recLine.getFinancialAccountTransaction().getClient()
- .getId(), AcctServer.DOCTYPE_Reconciliation, recLine
- .getFinancialAccountTransaction().getOrganization().getId(),
-
OBDateUtils.formatDate(recLine.getFinancialAccountTransaction().getDateAcct()))
- && orgLegalWithAccounting) {
- msg.setType("Error");
- msg.setTitle(Utility.messageBD(conProvider, "Error",
language));
-
msg.setMessage(String.format(Utility.parseTranslation(conProvider, vars,
language,
- "@APRM_PeriodNotAvailableClearedItem@"),
recLine.getIdentifier()));
- bundle.setResult(msg);
- OBDal.getInstance().rollbackAndClose();
- return;
- }
+ for (FIN_ReconciliationLine_v recLine :
reconciliation.getFINReconciliationLineVList()) {
+ boolean orgLegalWithAccounting =
FIN_Utility.periodControlOpened(recLine
+
.getFinancialAccountTransaction().getReconciliation().TABLE_NAME, recLine
+ .getFinancialAccountTransaction().getReconciliation().getId(),
recLine
+
.getFinancialAccountTransaction().getReconciliation().TABLE_NAME + "_ID", "LE");
+ if
(!FIN_Utility.isPeriodOpen(recLine.getFinancialAccountTransaction().getClient()
+ .getId(), AcctServer.DOCTYPE_Reconciliation, recLine
+ .getFinancialAccountTransaction().getOrganization().getId(),
+
OBDateUtils.formatDate(recLine.getFinancialAccountTransaction().getDateAcct()))
+ && orgLegalWithAccounting) {
+ msg.setType("Error");
+ msg.setTitle(Utility.messageBD(conProvider, "Error", language));
+
msg.setMessage(String.format(Utility.parseTranslation(conProvider, vars,
language,
+ "@APRM_PeriodNotAvailableClearedItem@"),
recLine.getIdentifier()));
+ bundle.setResult(msg);
+ OBDal.getInstance().rollbackAndClose();
+ return;
}
- } else {
- msg.setType("Error");
- msg.setTitle(Utility.messageBD(conProvider, "Error", language));
- msg.setMessage(String.format(Utility.parseTranslation(conProvider,
vars, language,
- "@DocumentDisabled@")));
- bundle.setResult(msg);
- OBDal.getInstance().rollbackAndClose();
- return;
-
}
}
reconciliation.setProcessed(true);
@@ -171,102 +153,6 @@
}
}
- public List<FIN_FinaccTransaction> getTransactionList(FIN_Reconciliation
reconciliation) {
- OBContext.setAdminMode();
- List<FIN_FinaccTransaction> transactions = null;
- try {
- OBCriteria<FIN_FinaccTransaction> trans =
OBDal.getInstance().createCriteria(
- FIN_FinaccTransaction.class);
- trans.add(Restrictions.eq(FIN_FinaccTransaction.PROPERTY_RECONCILIATION,
reconciliation));
- trans.setFilterOnReadableClients(false);
- trans.setFilterOnReadableOrganization(false);
- transactions = trans.list();
- } finally {
- OBContext.restorePreviousMode();
- }
- return transactions;
- }
-
- /*
- * Checks if this step (Reconciliation) is configured to generate accounting
for the selected
- * financial account
- */
- public boolean getDocumentConfirmation(ConnectionProvider conn, String
strRecordId) {
- OBContext.setAdminMode();
- try {
- FIN_Reconciliation reconciliation =
OBDal.getInstance().get(FIN_Reconciliation.class,
- strRecordId);
- List<FIN_FinaccTransaction> transactions =
getTransactionList(reconciliation);
- List<FIN_FinancialAccountAccounting> accounts =
reconciliation.getAccount()
- .getFINFinancialAccountAcctList();
- for (FIN_FinaccTransaction transaction : transactions) {
- FIN_Payment payment = transaction.getFinPayment();
- // If payment exists, check Payment Method + financial Account
Configuration
- if (payment != null) {
- OBCriteria<FinAccPaymentMethod> obCriteria =
OBDal.getInstance().createCriteria(
- FinAccPaymentMethod.class);
- obCriteria.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_ACCOUNT,
- reconciliation.getAccount()));
-
obCriteria.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_PAYMENTMETHOD,
- payment.getPaymentMethod()));
- obCriteria.setFilterOnReadableClients(false);
- obCriteria.setFilterOnReadableOrganization(false);
- List<FinAccPaymentMethod> lines = obCriteria.list();
- for (FIN_FinancialAccountAccounting account : accounts) {
- if (payment.isReceipt()) {
- if (("INT").equals(lines.get(0).getINUponClearingUse())
- && account.getInTransitPaymentAccountIN() != null) {
- transactionsToBePosted.add(transaction);
- } else if (("DEP").equals(lines.get(0).getINUponClearingUse())
- && account.getDepositAccount() != null) {
- transactionsToBePosted.add(transaction);
- } else if (("CLE").equals(lines.get(0).getINUponClearingUse())
- && account.getClearedPaymentAccount() != null) {
- transactionsToBePosted.add(transaction);
- }
- } else {
- if (("INT").equals(lines.get(0).getOUTUponClearingUse())
- && account.getFINOutIntransitAcct() != null) {
- transactionsToBePosted.add(transaction);
- } else if (("WIT").equals(lines.get(0).getOUTUponClearingUse())
- && account.getWithdrawalAccount() != null) {
- transactionsToBePosted.add(transaction);
- } else if (("CLE").equals(lines.get(0).getOUTUponClearingUse())
- && account.getClearedPaymentAccountOUT() != null) {
- transactionsToBePosted.add(transaction);
- }
- }
- }
- } else if (transaction.getGLItem() != null) {
- for (FIN_FinancialAccountAccounting account : accounts) {
- if ("BPD".equals(transaction.getTransactionType())
- && account.getClearedPaymentAccount() != null) {
- transactionsToBePosted.add(transaction);
- } else if ("BPW".equals(transaction.getTransactionType())
- && account.getClearedPaymentAccountOUT() != null) {
- transactionsToBePosted.add(transaction);
- }
- }
- } else {
- for (FIN_FinancialAccountAccounting account : accounts) {
- if ("BF".equals(transaction.getTransactionType())
- && account.getClearedPaymentAccountOUT() != null) {
- transactionsToBePosted.add(transaction);
- }
- }
- }
- }
- } catch (Exception e) {
- return false;
- } finally {
- OBContext.restorePreviousMode();
- }
- if (transactionsToBePosted.size() == 0) {
- return false;
- }
- return true;
- }
-
private boolean isLastReconciliation(FIN_Reconciliation reconciliation) {
final OBCriteria<FIN_Reconciliation> obc =
OBDal.getInstance().createCriteria(
FIN_Reconciliation.class);
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits