- params.add_pair("_formid", "identify-add");
- if (token != null) params.add_pair("_token", token);
- params.add_pair("date", ltr.getDate());
- params.add_pair("description", ltr.getDescription());
- {
- Iterator<LedgerTransactionAccount> items = ltr.getAccountsIterator();
- while (items.hasNext()) {
- LedgerTransactionAccount item = items.next();
- params.add_pair("account", item.getAccountName());
- if (item.isAmountSet())
- params.add_pair("amount", String.format(Locale.US, "%1.2f", item.getAmount()));
- else params.add_pair("amount", "");
- }
+ params.addPair("_formid", "identify-add");
+ if (token != null) params.addPair("_token", token);
+ params.addPair("date", Globals.formatLedgerDate(ltr.getDate()));
+ params.addPair("description", ltr.getDescription());
+ for (LedgerTransactionAccount acc : ltr.getAccounts()) {
+ params.addPair("account", acc.getAccountName());
+ if (acc.isAmountSet())
+ params.addPair("amount", String.format(Locale.US, "%1.2f", acc.getAmount()));
+ else params.addPair("amount", "");