try {
final Invoice invoice = new Invoice();
String userNumber = getNextUserNumber(Invoice.class);
invoice.setDataFromTransaction(this.getDeliveryNote(), userNumber);
JbsOptionPane dialog = JbsOptionPane.showMessageDialog(this, JbsL10N.getString("DeliveryNote.msgToInvoice"), JbsL10N.getString("Offer.messageBoxTitle"), JbsOptionPane.INFORMATION_MESSAGE);
dialog.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
FmInvoiceEdit fmInvoiceEdit = new FmInvoiceEdit();
fmInvoiceEdit.showForm(DlgState.dsCopy, invoice);
addAction(PnDeliveryNoteEdit.ACTION_TOINVOICE);