+ // suggest off-balance amount to a row and remove hints on other rows
+ Item receiver = null;
+ if (!itemsWithAccountAndEmptyAmount.isEmpty())
+ receiver = itemsWithAccountAndEmptyAmount.get(0);
+ else if (!itemsWithEmptyAmount.isEmpty())
+ receiver = itemsWithEmptyAmount.get(0);
+
+ for (Item item : items) {
+ if (item.equals(receiver)) {
+ Logger.debug("submittable",
+ String.format("Setting amount hint to %1.2f", -balance));
+ item.setAmountHint(String.format("%1.2f", -balance));
+ }
+ else
+ item.setAmountHint(null);
+ }
+ }
+
+ // 5) a row with an empty account name or empty amount is guaranteed to exist