formatting
This commit is contained in:
+13
-9
@@ -57,20 +57,24 @@ public final class JournalEntryCommandFromApiJsonDeserializer extends AbstractFr
|
|||||||
final String comments = this.fromApiJsonHelper.extractStringNamed(JournalEntryJsonInputParams.COMMENTS.getValue(), element);
|
final String comments = this.fromApiJsonHelper.extractStringNamed(JournalEntryJsonInputParams.COMMENTS.getValue(), element);
|
||||||
final LocalDate transactionDate = this.fromApiJsonHelper.extractLocalDateNamed(
|
final LocalDate transactionDate = this.fromApiJsonHelper.extractLocalDateNamed(
|
||||||
JournalEntryJsonInputParams.TRANSACTION_DATE.getValue(), element);
|
JournalEntryJsonInputParams.TRANSACTION_DATE.getValue(), element);
|
||||||
final String referenceNumber = this.fromApiJsonHelper.extractStringNamed(
|
final String referenceNumber = this.fromApiJsonHelper.extractStringNamed(JournalEntryJsonInputParams.REFERENCE_NUMBER.getValue(),
|
||||||
JournalEntryJsonInputParams.REFERENCE_NUMBER.getValue(), element);
|
element);
|
||||||
final Boolean isPredefinedRuleEntry = this.fromApiJsonHelper.extractBooleanNamed(JournalEntryJsonInputParams.USE_ACCOUNTING_RULE.getValue(), element);
|
final Boolean isPredefinedRuleEntry = this.fromApiJsonHelper.extractBooleanNamed(
|
||||||
final Boolean useAccountingRule = isPredefinedRuleEntry==null?false:isPredefinedRuleEntry;
|
JournalEntryJsonInputParams.USE_ACCOUNTING_RULE.getValue(), element);
|
||||||
|
final Boolean useAccountingRule = isPredefinedRuleEntry == null ? false : isPredefinedRuleEntry;
|
||||||
|
|
||||||
final JsonObject topLevelJsonElement = element.getAsJsonObject();
|
final JsonObject topLevelJsonElement = element.getAsJsonObject();
|
||||||
final Locale locale = this.fromApiJsonHelper.extractLocaleParameter(topLevelJsonElement);
|
final Locale locale = this.fromApiJsonHelper.extractLocaleParameter(topLevelJsonElement);
|
||||||
|
|
||||||
if(useAccountingRule) {
|
if (useAccountingRule) {
|
||||||
final Long accountingRuleId = this.fromApiJsonHelper.extractLongNamed(JournalEntryJsonInputParams.ACCOUNTING_RULE.getValue(), element);
|
final Long accountingRuleId = this.fromApiJsonHelper.extractLongNamed(JournalEntryJsonInputParams.ACCOUNTING_RULE.getValue(),
|
||||||
final BigDecimal amount = this.fromApiJsonHelper.extractBigDecimalNamed(JournalEntryJsonInputParams.AMOUNT.getValue(), element, locale);
|
element);
|
||||||
return new JournalEntryCommand(officeId, transactionDate, comments, referenceNumber, useAccountingRule, accountingRuleId, amount);
|
final BigDecimal amount = this.fromApiJsonHelper.extractBigDecimalNamed(JournalEntryJsonInputParams.AMOUNT.getValue(), element,
|
||||||
|
locale);
|
||||||
|
return new JournalEntryCommand(officeId, transactionDate, comments, referenceNumber, useAccountingRule, accountingRuleId,
|
||||||
|
amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
SingleDebitOrCreditEntryCommand[] credits = null;
|
SingleDebitOrCreditEntryCommand[] credits = null;
|
||||||
SingleDebitOrCreditEntryCommand[] debits = null;
|
SingleDebitOrCreditEntryCommand[] debits = null;
|
||||||
if (element.isJsonObject()) {
|
if (element.isJsonObject()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user