User user = adminBean.getUser();
EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
InvoiceHeader invoiceHeader = (InvoiceHeader) em.find(InvoiceHeader.class, Format.getLong(form.getInvoiceHeaderId()));
CreditEngine creditEngine = new CreditEngine(invoiceHeader, user);
creditEngine.creditAll();
initOrder(form, invoiceHeader.getOrderHeader(), null, null, null, request);
form.setInvoiceHeaderId(invoiceHeader.getInvoiceHeaderId().toString());
CreditHeader creditHeader = creditEngine.getCreditHeader();
CreditHeaderDisplayForm creditHeaderDisplayForm = new CreditHeaderDisplayForm();
form.setCreditHeader(creditHeaderDisplayForm);