Commit f99957ab authored by Ralf Habacker's avatar Ralf Habacker
Browse files

tools/xea2kmt: Ignore multiple opening balance account and print a warning

CCBUG:429229
parent 0c37dba7
......@@ -228,6 +228,7 @@ public:
QString longDescription;
QString shortDescription;
TemplateAccount::List accounts;
TemplateAccount *openingBalanceAccount{nullptr};
bool read(QXmlStreamReader &xml)
{
......@@ -301,10 +302,15 @@ public:
}
}
if (account->slotList.contains("equity-type") && account->slotList["equity-type"] == "opening-balance") {
if (openingBalanceAccount) {
qWarning() << "template already has specified '" << openingBalanceAccount->name << "' as opening balance account";
continue;
}
xml.writeStartElement("flag");
xml.writeAttribute("name","OpeningBalanceAccount");
xml.writeAttribute("value","Yes");
xml.writeEndElement();
openingBalanceAccount = account;
}
}
index++;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment