* @return the default-accout
* @throws JAXBException
* if account-creation fails-
*/
protected GnucashWritableAccount getDefaultAccount() throws JAXBException {
GnucashWritableFile writableFile = getMyAccount().getWritableGnucashFile();
String accountID = getMyProperties().getProperty(
getPluginName() + SETTINGS_DEFAULTTARGETACCOUNT);
GnucashWritableAccount account = accountID == null ? null
: (GnucashWritableAccount) writableFile.getAccountByIDorName(
accountID, accountID);
if (account == null) {
account = writableFile.getAccountByName("Ausgleichskonto-EUR");
}
if (account == null) {
account = writableFile.createWritableAccount();
account.setName("Ausgleichskonto-EUR");
}
return account;
}