Mifosx-735 fixes
This commit is contained in:
Regular → Executable
+14
-2
@@ -33,6 +33,9 @@ public class GLAccountData {
|
||||
private final String description;
|
||||
private final String nameDecorated;
|
||||
private final CodeValueData tagId;
|
||||
private final Long officeRunningBalance;
|
||||
private final Long organizationRunningBalance;
|
||||
|
||||
|
||||
// templates
|
||||
final List<EnumOptionData> accountTypeOptions;
|
||||
@@ -50,7 +53,7 @@ public class GLAccountData {
|
||||
|
||||
public GLAccountData(final Long id, final String name, final Long parentId, final String glCode, final boolean disabled,
|
||||
final boolean manualEntriesAllowed, final EnumOptionData type, final EnumOptionData usage, final String description,
|
||||
final String nameDecorated, final CodeValueData tagId) {
|
||||
final String nameDecorated, final CodeValueData tagId,final Long officeRunningBalance,final Long organizationRunningBalance) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.parentId = parentId;
|
||||
@@ -62,6 +65,8 @@ public class GLAccountData {
|
||||
this.description = description;
|
||||
this.nameDecorated = nameDecorated;
|
||||
this.tagId = tagId;
|
||||
this.officeRunningBalance = officeRunningBalance;
|
||||
this.organizationRunningBalance = organizationRunningBalance;
|
||||
this.accountTypeOptions = null;
|
||||
this.usageOptions = null;
|
||||
this.assetHeaderAccountOptions = null;
|
||||
@@ -94,6 +99,8 @@ public class GLAccountData {
|
||||
this.description = accountData.description;
|
||||
this.nameDecorated = accountData.nameDecorated;
|
||||
this.tagId = accountData.tagId;
|
||||
this.officeRunningBalance = accountData.officeRunningBalance;
|
||||
this.organizationRunningBalance = accountData.organizationRunningBalance;
|
||||
this.accountTypeOptions = accountTypeOptions;
|
||||
this.usageOptions = usageOptions;
|
||||
this.assetHeaderAccountOptions = assetHeaderAccountOptions;
|
||||
@@ -125,7 +132,10 @@ public class GLAccountData {
|
||||
final String description = null;
|
||||
final String nameDecorated = null;
|
||||
final CodeValueData tagId = null;
|
||||
return new GLAccountData(id, name, parentId, glCode, disabled, manualEntriesAllowed, type, usage, description, nameDecorated, tagId);
|
||||
final Long officeRunningBalance = null;
|
||||
final Long organizationRunningBalance = null;
|
||||
|
||||
return new GLAccountData(id, name, parentId, glCode, disabled, manualEntriesAllowed, type, usage, description, nameDecorated, tagId,officeRunningBalance,organizationRunningBalance);
|
||||
}
|
||||
|
||||
public GLAccountData(final Long id, final String name, final String glCode) {
|
||||
@@ -140,6 +150,8 @@ public class GLAccountData {
|
||||
this.description = null;
|
||||
this.nameDecorated = null;
|
||||
this.tagId = null;
|
||||
this.officeRunningBalance = null;
|
||||
this.organizationRunningBalance = null;
|
||||
this.accountTypeOptions = null;
|
||||
this.usageOptions = null;
|
||||
this.assetHeaderAccountOptions = null;
|
||||
|
||||
Regular → Executable
+13
-8
@@ -40,13 +40,15 @@ public class GLAccountReadPlatformServiceImpl implements GLAccountReadPlatformSe
|
||||
}
|
||||
|
||||
private static final class GLAccountMapper implements RowMapper<GLAccountData> {
|
||||
|
||||
public String schema() {
|
||||
return " gl.id as id, name as name, parent_id as parentId, gl_code as glCode, disabled as disabled, manual_journal_entries_allowed as manualEntriesAllowed, "
|
||||
+ "classification_enum as classification, account_usage as accountUsage, description as description, "
|
||||
+ "classification_enum as classification, account_usage as accountUsage, gl.description as description, "
|
||||
+ nameDecoratedBaseOnHierarchy
|
||||
+ "as nameDecorated, "
|
||||
+ "cv.id as codeId, cv.code_value as codeValue from acc_gl_account gl left join m_code_value cv on tag_id=cv.id";
|
||||
+ "cv.id as codeId, cv.code_value as codeValue,gl_j.office_running_balance as officeRunningBalance,gl_j.organization_running_balance as organizationRunningBalance "
|
||||
+ "from acc_gl_account gl left join m_code_value cv on tag_id=cv.id "
|
||||
+ "left outer Join acc_gl_journal_entry gl_j on gl_j.account_id = gl.id";
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,8 +69,10 @@ public class GLAccountReadPlatformServiceImpl implements GLAccountReadPlatformSe
|
||||
final Long codeId = rs.wasNull() ? null : rs.getLong("codeId");
|
||||
final String codeValue = rs.getString("codeValue");
|
||||
final CodeValueData tagId = CodeValueData.instance(codeId, codeValue);
|
||||
final Long officeRunningBalance = rs.getLong("officeRunningBalance");
|
||||
final Long organizationRunningBalance = rs.getLong("organizationRunningBalance");
|
||||
return new GLAccountData(id, name, parentId, glCode, disabled, manualEntriesAllowed, accountType, usage, description,
|
||||
nameDecorated, tagId);
|
||||
nameDecorated, tagId, officeRunningBalance,organizationRunningBalance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,8 +153,9 @@ public class GLAccountReadPlatformServiceImpl implements GLAccountReadPlatformSe
|
||||
firstWhereConditionAdded = true;
|
||||
}
|
||||
}
|
||||
|
||||
sql = sql + " order by glCode";
|
||||
sql = sql + " and gl_j.id in (select t1.id from (SELECT t2.id , max(concat(t2.entry_date,t2.id)) " +
|
||||
"FROM acc_gl_journal_entry t2 " +
|
||||
"GROUP BY t2.account_id DESC) t1)";
|
||||
final Object[] finalObjectArray = Arrays.copyOf(paramaterArray, arrayPos);
|
||||
return this.jdbcTemplate.query(sql, rm, finalObjectArray);
|
||||
}
|
||||
@@ -160,9 +165,9 @@ public class GLAccountReadPlatformServiceImpl implements GLAccountReadPlatformSe
|
||||
try {
|
||||
|
||||
final GLAccountMapper rm = new GLAccountMapper();
|
||||
final String sql = "select " + rm.schema() + " where gl.id = ?";
|
||||
final String sql = "select " + rm.schema() + " where gl.id = gl_j.account_id and gl.id = ? ORDER BY entry_date DESC,id DESC LIMIT 1";
|
||||
|
||||
final GLAccountData glAccountData = this.jdbcTemplate.queryForObject(sql, rm, new Object[] { glAccountId });
|
||||
final GLAccountData glAccountData = this.jdbcTemplate.queryForObject(sql, rm, new Object[] { glAccountId});
|
||||
|
||||
return glAccountData;
|
||||
} catch (final EmptyResultDataAccessException e) {
|
||||
|
||||
Reference in New Issue
Block a user