Exemple #1
0
  void delete() {
    check(this, RolePredicates.MANAGER_PREDICATE);
    if (!canBeDeleted()) {
      throw new DomainException("error.accounting.Entry.belongs.to.receipt");
    }

    super.setAccount(null);
    super.setAccountingTransaction(null);
    setRootDomainObject(null);

    super.deleteDomainObject();
  }
Exemple #2
0
  public void setActiveReceipt(Receipt receipt) {
    if (hasAdjustmentCreditNoteEntry()) {
      throw new DomainException("error.accounting.entry.is.already.associated.to.payed.creditNote");
    }

    if (isAssociatedToAnyActiveReceipt()) {
      throw new DomainExceptionWithLabelFormatter(
          "error.Entry.cannot.be.associated.to.receipt.because.is.already.associated.to.another.active.receipt",
          getDescription());
    }

    super.addReceipts(receipt);
  }
Exemple #3
0
 private void init(EntryType entryType, Money amount, Account account) {
   checkParameters(entryType, amount, account);
   super.setEntryType(entryType);
   super.setOriginalAmount(amount);
   super.setAccount(account);
 }