try {
final CreditNote creditNote = new CreditNote();
String userNumber = getNextUserNumber(CreditNote.class);
creditNote.setDataFromTransaction(getInvoice(), userNumber);
JbsOptionPane dialog = JbsOptionPane.showMessageDialog(this, JbsL10N.getString("Invoice.msgToCreditNote"), JbsL10N.getString("Offer.messageBoxTitle"), JbsOptionPane.INFORMATION_MESSAGE);
dialog.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
FmCreditNoteEdit fmCreditNoteEdit = new FmCreditNoteEdit();
fmCreditNoteEdit.showForm(DlgState.dsCopy, creditNote);
addAction(PnInvoiceEdit.ACTION_TOCREDITNOTE);