Search in sources :

Example 31 with Dossier

use of eu.ggnet.dwoss.redtape.ee.entity.Dossier in project dwoss by gg-net.

the class RedTapeController method reloadSelectionOnStateChange.

/**
 * Updates the selection in case of data change.
 *
 * @param dos
 */
public void reloadSelectionOnStateChange(Dossier dos) {
    Dossier oldDos = model.getSelectedDossier();
    dossierTableController.getModel().update(oldDos, dos);
    model.setSelectedDossier(null);
    model.setSelectedDossier(dos);
}
Also used : Dossier(eu.ggnet.dwoss.redtape.ee.entity.Dossier)

Example 32 with Dossier

use of eu.ggnet.dwoss.redtape.ee.entity.Dossier in project dwoss by gg-net.

the class RedTapeController method openEditComment.

/**
 * Opens a dialog to edit a dossiers comment.
 * <p/>
 * If Dossier.id equals 0, a wrapped Dossier from an old Sopo Auftrag is assumed and no change can be made.
 * <p/>
 * @param dossier the dossier from wich the comment will be changed
 */
public void openEditComment(Dossier dossier) {
    if (model.getSelectedDossier() == null) {
        JOptionPane.showMessageDialog(view, "Kein Auftrag ausgewählt");
        return;
    }
    StringAreaView sav = new StringAreaView(dossier.getComment());
    OkCancelDialog<StringAreaView> dialog = new OkCancelDialog<>(parent(), Dialog.ModalityType.DOCUMENT_MODAL, "Bemerkungen editieren", sav);
    dialog.setVisible(true);
    if (dialog.getCloseType() == CloseType.OK) {
        try {
            Dossier dos = Dl.remote().lookup(RedTapeWorker.class).updateComment(model.getSelectedDossier(), sav.getText());
            reloadSelectionOnStateChange(dos);
        } catch (UserInfoException ex) {
            Ui.handle(ex);
        }
    }
}
Also used : StringAreaView(eu.ggnet.dwoss.redtapext.ui.cao.common.StringAreaView) Dossier(eu.ggnet.dwoss.redtape.ee.entity.Dossier)

Example 33 with Dossier

use of eu.ggnet.dwoss.redtape.ee.entity.Dossier in project dwoss by gg-net.

the class DossierTest method sampleOpenDossierWithClosedInvoice.

private Dossier sampleOpenDossierWithClosedInvoice() {
    Dossier dos = new Dossier(PaymentMethod.ADVANCE_PAYMENT, true, 1);
    Document d1 = new Document(DocumentType.INVOICE, Document.Directive.NONE, null);
    d1.setActive(true);
    d1.setClosed(true);
    dos.add(d1);
    return dos;
}
Also used : Dossier(eu.ggnet.dwoss.redtape.ee.entity.Dossier) Document(eu.ggnet.dwoss.redtape.ee.entity.Document)

Example 34 with Dossier

use of eu.ggnet.dwoss.redtape.ee.entity.Dossier in project dwoss by gg-net.

the class DossierTest method testGetRelevantPositionsCapitalReturns.

@Test
public void testGetRelevantPositionsCapitalReturns() {
    final int UNIQUE_UNIT_ID = 1;
    Dossier dos1 = new Dossier();
    Document dos1CapitalAsset = new Document(DocumentType.RETURNS, Document.Directive.HAND_OVER_GOODS, null);
    dos1CapitalAsset.setActive(true);
    Position p1 = new Position();
    p1.setUniqueUnitId(UNIQUE_UNIT_ID);
    p1.setType(PositionType.UNIT);
    Position p2 = new Position();
    p2.setType(PositionType.COMMENT);
    dos1CapitalAsset.appendAll(p1, p2);
    dos1.add(dos1CapitalAsset);
    assertEquals(1, dos1.getRelevantUniqueUnitIds().size());
    assertEquals(UNIQUE_UNIT_ID, (int) dos1.getRelevantUniqueUnitIds().iterator().next());
    dos1CapitalAsset.add(Document.Condition.CANCELED);
    assertTrue("Should have no relevant UniqueUnit ids, but there are:  " + dos1.getRelevantUniqueUnitIds(), dos1.getRelevantUniqueUnitIds().isEmpty());
}
Also used : Position(eu.ggnet.dwoss.redtape.ee.entity.Position) Dossier(eu.ggnet.dwoss.redtape.ee.entity.Dossier) Document(eu.ggnet.dwoss.redtape.ee.entity.Document) Test(org.junit.Test)

Example 35 with Dossier

use of eu.ggnet.dwoss.redtape.ee.entity.Dossier in project dwoss by gg-net.

the class DossierTest method testChangesAllowedClosedDossierPaymentMethod.

@Test
public void testChangesAllowedClosedDossierPaymentMethod() {
    Dossier dos1 = sampleClosedDossier();
    Dossier dos2 = sampleClosedDossier();
    dos2.setPaymentMethod(PaymentMethod.DIRECT_DEBIT);
    assertFalse(dos1.getPaymentMethod() == dos2.getPaymentMethod());
    assertFalse("Changes should not be allowed", dos1.changesAllowed(dos2));
}
Also used : Dossier(eu.ggnet.dwoss.redtape.ee.entity.Dossier) Test(org.junit.Test)

Aggregations

Dossier (eu.ggnet.dwoss.redtape.ee.entity.Dossier)47 Document (eu.ggnet.dwoss.redtape.ee.entity.Document)30 Test (org.junit.Test)17 Position (eu.ggnet.dwoss.redtape.ee.entity.Position)11 DossierEao (eu.ggnet.dwoss.redtape.ee.eao.DossierEao)8 DocumentHistory (eu.ggnet.dwoss.redtape.ee.entity.DocumentHistory)6 LogicTransaction (eu.ggnet.dwoss.stock.ee.entity.LogicTransaction)6 UniqueUnit (eu.ggnet.dwoss.uniqueunit.ee.entity.UniqueUnit)6 Address (eu.ggnet.dwoss.redtape.ee.entity.Address)5 StockUnit (eu.ggnet.dwoss.stock.ee.entity.StockUnit)4 SubMonitor (eu.ggnet.dwoss.progress.SubMonitor)3 AddressEmo (eu.ggnet.dwoss.redtape.ee.emo.AddressEmo)3 StockUnitEao (eu.ggnet.dwoss.stock.ee.eao.StockUnitEao)3 RepaymentCustomers (eu.ggnet.dwoss.mandator.api.value.RepaymentCustomers)2 PositionBuilder (eu.ggnet.dwoss.redtape.ee.entity.PositionBuilder)2 Reminder (eu.ggnet.dwoss.redtape.ee.entity.Reminder)2 RedTapeWorker (eu.ggnet.dwoss.redtapext.ee.RedTapeWorker)2 ReportLineEao (eu.ggnet.dwoss.report.ee.eao.ReportLineEao)2 Report (eu.ggnet.dwoss.report.ee.entity.Report)2 eu.ggnet.dwoss.rules (eu.ggnet.dwoss.rules)2