use of eu.ggnet.dwoss.redtapext.ee.RedTapeWorker.Addresses in project dwoss by gg-net.
the class DossierCreateAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
Ui.exec(() -> {
Dossier dos = Dl.remote().lookup(RedTapeWorker.class).create(customer.getId(), dispatch, Dl.local().lookup(Guardian.class).getUsername());
// This is safe, as a create will return exactly one document.
Document doc = dos.getDocuments().iterator().next();
Addresses addresses = Dl.remote().lookup(RedTapeWorker.class).requestAdressesByCustomer(customer.getId());
doc.setInvoiceAddress(addresses.getInvoice());
doc.setShippingAddress(addresses.getShipping());
Ui.exec(() -> {
Ui.build().parent(controller.getView()).swing().eval(() -> {
DocumentUpdateView docView = new DocumentUpdateView(doc);
docView.setController(new DocumentUpdateController(docView, doc));
docView.setCustomerValues(customer.getId());
return OkCancelWrap.vetoResult(docView);
}).opt().filter(r -> handleFailure(r, doc)).map(Reply::getPayload).ifPresent(this::handleSuccesses);
});
});
}
use of eu.ggnet.dwoss.redtapext.ee.RedTapeWorker.Addresses in project dwoss by gg-net.
the class DocumentUpdateController method resetAddressesToCustomerData.
public void resetAddressesToCustomerData() {
if (view.getCustomerId() <= 0) {
JOptionPane.showMessageDialog(view, "Ein Kunde muss ausgewählt sein.");
return;
}
Addresses addresses = Dl.remote().lookup(RedTapeWorker.class).requestAdressesByCustomer(view.getCustomerId());
document.setInvoiceAddress(addresses.getInvoice());
document.setShippingAddress(addresses.getShipping());
view.refreshAddressArea();
}
use of eu.ggnet.dwoss.redtapext.ee.RedTapeWorker.Addresses in project dwoss by gg-net.
the class DocumentSupporterFlagIT method changeInvoiceAddress.
private void changeInvoiceAddress(Document doc) {
cgo.scrambleAddress(customerId, AddressType.INVOICE);
Addresses addresses = redTapeWorker.requestAdressesByCustomer(customerId);
doc.setInvoiceAddress(addresses.getInvoice());
}
Aggregations