use of name.abuchen.portfolio.datatransfer.actions.InsertAction in project portfolio by buchen.
the class CSVImportWizard method importItems.
private boolean importItems() {
InsertAction action = new InsertAction(client);
action.setConvertBuySellToDelivery(reviewPage.doConvertToDelivery());
boolean isDirty = false;
for (ExtractedEntry entry : reviewPage.getEntries()) {
if (entry.isImported()) {
entry.getItem().apply(action, reviewPage);
isDirty = true;
}
}
return isDirty;
}
use of name.abuchen.portfolio.datatransfer.actions.InsertAction in project portfolio by buchen.
the class ImportExtractedItemsWizard method performFinish.
@Override
public boolean performFinish() {
if (!pages.isEmpty()) {
boolean isDirty = false;
for (int index = 0; index < pages.size(); index++) {
ReviewExtractedItemsPage page = pages.get(index);
page.afterPage();
InsertAction action = new InsertAction(client);
action.setConvertBuySellToDelivery(page.doConvertToDelivery());
for (ExtractedEntry entry : page.getEntries()) {
if (entry.isImported()) {
entry.getItem().apply(action, page);
isDirty = true;
}
}
}
if (isDirty) {
client.markDirty();
// run consistency checks in case bogus transactions have been
// created (say: an outbound delivery of a security where there
// no held shares)
new ConsistencyChecksJob(client, false).schedule();
}
}
return true;
}
Aggregations