if (!CVUtility.isModuleVisible("InvoiceHistory", userID, this.dataSource))
throw new AuthorizationFailedException("Invoice- deleteInvoice");
try {
InitialContext ic = CVUtility.getInitialContext();
InvoiceLocalHome home = (InvoiceLocalHome) ic.lookup("local/Invoice");
InvoiceLocal invoice = home.findByPrimaryKey(new InvoicePK(invoiceId, this.dataSource));
invoice.setDataSource(this.dataSource);
invoice.remove();
} catch (RemoveException re) {
throw new EJBException(re);
} catch (FinderException fe) {
throw new EJBException(fe);
}