FINERACT-2198: Extend Manual Journal entry to support Asset Externalization
This commit is contained in:
committed by
Adam Saghy
parent
4feee70a7a
commit
0c1ca2baba
+1
@@ -71,6 +71,7 @@ public interface JournalEntryMapper {
|
||||
@Mapping(target = "debits", ignore = true)
|
||||
@Mapping(target = "transactionDetails", ignore = true)
|
||||
@Mapping(target = "savingTransactionId", ignore = true)
|
||||
@Mapping(target = "externalAssetOwner", ignore = true)
|
||||
JournalEntryData map(JournalEntry journalEntry);
|
||||
|
||||
@Named("entityType")
|
||||
|
||||
+2
-1
@@ -43,7 +43,8 @@ public enum JournalEntryJsonInputParams {
|
||||
CHECK_NUMBER("checkNumber"), //
|
||||
ROUTING_CODE("routingCode"), //
|
||||
RECEIPT_NUMBER("receiptNumber"), //
|
||||
BANK_NUMBER("bankNumber"); //
|
||||
BANK_NUMBER("bankNumber"), //
|
||||
EXTERNAL_ASSET_OWNER("externalAssetOwner"); //
|
||||
|
||||
private final String value;
|
||||
|
||||
|
||||
+4
@@ -54,6 +54,7 @@ public class JournalEntryCommand {
|
||||
private final SingleDebitOrCreditEntryCommand[] debits;
|
||||
private final String locale;
|
||||
private final String dateFormat;
|
||||
private final String externalAssetOwner;
|
||||
|
||||
public void validateForCreate() {
|
||||
|
||||
@@ -75,6 +76,9 @@ public class JournalEntryCommand {
|
||||
|
||||
baseDataValidator.reset().parameter("paymentTypeId").value(this.paymentTypeId).ignoreIfNull().longGreaterThanZero();
|
||||
|
||||
baseDataValidator.reset().parameter(JournalEntryJsonInputParams.EXTERNAL_ASSET_OWNER.getValue()).value(this.externalAssetOwner)
|
||||
.ignoreIfNull().notExceedingLengthOf(100);
|
||||
|
||||
// validation for credit array elements
|
||||
if (this.credits != null) {
|
||||
if (this.credits.length == 0) {
|
||||
|
||||
+5
-3
@@ -94,6 +94,7 @@ public class JournalEntryData {
|
||||
private String routingCode;
|
||||
private String receiptNumber;
|
||||
private String bankNumber;
|
||||
private String externalAssetOwner;
|
||||
private transient Long savingTransactionId;
|
||||
|
||||
public JournalEntryData() {}
|
||||
@@ -191,7 +192,7 @@ public class JournalEntryData {
|
||||
final EnumOptionData entityType, final Long entityId, final Long createdByUserId, final LocalDate submittedOnDate,
|
||||
final String createdByUserName, final String comments, final Boolean reversed, final String referenceNumber,
|
||||
final BigDecimal officeRunningBalance, final BigDecimal organizationRunningBalance, final Boolean runningBalanceComputed,
|
||||
final TransactionDetailData transactionDetailData, final CurrencyData currency) {
|
||||
final TransactionDetailData transactionDetailData, final CurrencyData currency, final String externalAssetOwner) {
|
||||
this.id = id;
|
||||
this.officeId = officeId;
|
||||
this.officeName = officeName;
|
||||
@@ -218,6 +219,7 @@ public class JournalEntryData {
|
||||
this.runningBalanceComputed = runningBalanceComputed;
|
||||
this.transactionDetails = transactionDetailData;
|
||||
this.currency = currency;
|
||||
this.externalAssetOwner = externalAssetOwner;
|
||||
}
|
||||
|
||||
public static JournalEntryData importInstance(Long officeId, LocalDate transactionDate, String currencyCode, Long paymentTypeId,
|
||||
@@ -259,10 +261,11 @@ public class JournalEntryData {
|
||||
final Boolean runningBalanceComputed = null;
|
||||
final TransactionDetailData transactionDetailData = null;
|
||||
final CurrencyData currency = null;
|
||||
final String externalAssetOwner = null;
|
||||
return new JournalEntryData(id, officeId, officeName, glAccountName, glAccountId, glAccountCode, glAccountClassification,
|
||||
transactionDate, entryType, amount, transactionId, manualEntry, entityType, entityId, createdByUserId, submittedOnDate,
|
||||
createdByUserName, comments, reversed, referenceNumber, officeRunningBalance, organizationRunningBalance,
|
||||
runningBalanceComputed, transactionDetailData, currency);
|
||||
runningBalanceComputed, transactionDetailData, currency, externalAssetOwner);
|
||||
}
|
||||
|
||||
public Integer getRowIndex() {
|
||||
@@ -274,7 +277,6 @@ public class JournalEntryData {
|
||||
}
|
||||
|
||||
public void addDebits(CreditDebit debit) {
|
||||
|
||||
this.debits.add(debit);
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -84,6 +84,8 @@ public final class JournalEntryCommandFromApiJsonDeserializer extends AbstractFr
|
||||
element);
|
||||
final String bankNumber = this.fromApiJsonHelper.extractStringNamed(JournalEntryJsonInputParams.BANK_NUMBER.getValue(), element);
|
||||
final String routingCode = this.fromApiJsonHelper.extractStringNamed(JournalEntryJsonInputParams.ROUTING_CODE.getValue(), element);
|
||||
final String externalAssetOwner = this.fromApiJsonHelper
|
||||
.extractStringNamed(JournalEntryJsonInputParams.EXTERNAL_ASSET_OWNER.getValue(), element);
|
||||
|
||||
SingleDebitOrCreditEntryCommand[] credits = null;
|
||||
SingleDebitOrCreditEntryCommand[] debits = null;
|
||||
@@ -99,7 +101,8 @@ public final class JournalEntryCommandFromApiJsonDeserializer extends AbstractFr
|
||||
}
|
||||
String dateFormat = this.fromApiJsonHelper.extractStringNamed(JournalEntryJsonInputParams.DATE_FORMAT.getValue(), element);
|
||||
return new JournalEntryCommand(officeId, currencyCode, transactionDate, comments, referenceNumber, accountingRuleId, amount,
|
||||
paymentTypeId, accountNumber, checkNumber, receiptNumber, bankNumber, routingCode, credits, debits, localeStr, dateFormat);
|
||||
paymentTypeId, accountNumber, checkNumber, receiptNumber, bankNumber, routingCode, credits, debits, localeStr, dateFormat,
|
||||
externalAssetOwner);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user