logger.debug("Creating invoice for new RecurredOffer");
// TODO set problem key instead of assert (which throws an exception and thus rolls the whole transaction back).
organisationAuthority.assertContainsRoleRef(userID, org.nightlabs.jfire.accounting.RoleConstants.editInvoice);
Accounting accounting = Accounting.getAccounting(pm);
Invoice invoice = accounting.createInvoice(user, recurredOffer.getArticles(), null);
logger.debug("Successfully created Invoice " + JDOHelper.getObjectId(invoice));
accounting.validateInvoice(invoice);
if(recurringOffer.getRecurringOfferConfiguration().isBookInvoice())
accounting.signalInvoice((InvoiceID)JDOHelper.getObjectId(invoice), JbpmConstantsInvoice.Vendor.TRANSITION_NAME_BOOK_IMPLICITELY);
}
}
else
//Mark the Error