formatting

This commit is contained in:
Keith Woodlock
2013-05-23 23:30:45 +01:00
parent ee43ea9643
commit 6c5b751f10
@@ -57,18 +57,22 @@ 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;