From 8d66ca7fe791ed15428be1534e5f2d168be6eaa6 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 6 Feb 2013 10:10:26 -0500 Subject: [PATCH] IDEMPIERE-610 Import of BankStatement does not work (can not create new bank statements) - thanks to Thomas Bayen --- .../org/compiere/process/ImportBankStatement.java | 13 ++++++++----- .../src/org/compiere/model/MBankStatement.java | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/ImportBankStatement.java b/org.adempiere.base.process/src/org/compiere/process/ImportBankStatement.java index f608302731..d3ba73baf2 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ImportBankStatement.java +++ b/org.adempiere.base.process/src/org/compiere/process/ImportBankStatement.java @@ -433,14 +433,17 @@ public class ImportBankStatement extends SvrProcess statement.setEndingBalance(Env.ZERO); // Copy statement data - if (imp.getName() != null) - { + if (imp.getName() != null) { statement.setName(imp.getName()); } - if (imp.getStatementDate() != null) - { + if (imp.getStatementDate() != null) { statement.setStatementDate(imp.getStatementDate()); } + if (imp.getDateAcct() != null) { + statement.setDateAcct(imp.getDateAcct()); + } else { + statement.setDateAcct(statement.getStatementDate()); + } statement.setDescription(imp.getDescription()); statement.setEftStatementReference(imp.getEftStatementReference()); statement.setEftStatementDate(imp.getEftStatementDate()); @@ -460,7 +463,7 @@ public class ImportBankStatement extends SvrProcess line.setReferenceNo(imp.getReferenceNo()); line.setDescription(imp.getLineDescription()); line.setStatementLineDate(imp.getStatementLineDate()); - line.setDateAcct(imp.getStatementLineDate()); + // line.setDateAcct(imp.getStatementLineDate()); // set on beforeSave line.setValutaDate(imp.getValutaDate()); line.setIsReversal(imp.isReversal()); line.setC_Currency_ID(imp.getC_Currency_ID()); diff --git a/org.adempiere.base/src/org/compiere/model/MBankStatement.java b/org.adempiere.base/src/org/compiere/model/MBankStatement.java index fff3eb2bfb..d5a41708dc 100644 --- a/org.adempiere.base/src/org/compiere/model/MBankStatement.java +++ b/org.adempiere.base/src/org/compiere/model/MBankStatement.java @@ -100,6 +100,7 @@ public class MBankStatement extends X_C_BankStatement implements DocAction setClientOrg(account); setC_BankAccount_ID(account.getC_BankAccount_ID()); setStatementDate(new Timestamp(System.currentTimeMillis())); + setDateAcct(new Timestamp(System.currentTimeMillis())); setBeginningBalance(account.getCurrentBalance()); setName(getStatementDate().toString()); setIsManual(isManual);