示例#1
0
文件: Entry.java 项目: Kayvlim/fenix
  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();
  }
示例#2
0
文件: Entry.java 项目: Kayvlim/fenix
  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);
  }
示例#3
0
文件: Entry.java 项目: Kayvlim/fenix
 private void init(EntryType entryType, Money amount, Account account) {
   checkParameters(entryType, amount, account);
   super.setEntryType(entryType);
   super.setOriginalAmount(amount);
   super.setAccount(account);
 }