@Override
  protected void addRoleQualification(Object businessObject, Map<String, String> attributes) {
    super.addRoleQualification(businessObject, attributes);

    CustomerInvoiceWriteoffDocument writeoffDoc = (CustomerInvoiceWriteoffDocument) businessObject;
    String invoiceDocNumber = writeoffDoc.getFinancialDocumentReferenceInvoiceNumber();
    if (StringUtils.isBlank(invoiceDocNumber)) {
      return;
    }
    CustomerInvoiceDocumentService invoiceService =
        SpringContext.getBean(CustomerInvoiceDocumentService.class);

    Collection<CustomerInvoiceDetail> invoiceDetails =
        invoiceService.getCustomerInvoiceDetailsForCustomerInvoiceDocument(invoiceDocNumber);

    //  adds the chart/account for each account used on the original invoice that will be credited
    // by this
    for (CustomerInvoiceDetail invoiceDetail : invoiceDetails) {
      if (StringUtils.isNotBlank(invoiceDetail.getChartOfAccountsCode())
          && StringUtils.isNotBlank(invoiceDetail.getAccountNumber())) {
        attributes.put(
            KfsKimAttributes.CHART_OF_ACCOUNTS_CODE, invoiceDetail.getChartOfAccountsCode());
        attributes.put(KfsKimAttributes.ACCOUNT_NUMBER, invoiceDetail.getAccountNumber());
      }
    }
  }
 @Override
 public String getAccountNumber() {
   if (isUsingOrgAcctDefaultWriteoffFAU) {
     return poster.getAccountNumber();
   } else {
     return postable.getAccountNumber();
   }
 }
  @Override
  protected void addRoleQualification(Object businessObject, Map<String, String> attributes) {
    super.addRoleQualification(businessObject, attributes);

    CustomerInvoiceDocument document = (CustomerInvoiceDocument) businessObject;
    CustomerInvoiceDocumentService invoiceDocService =
        SpringContext.getBean(CustomerInvoiceDocumentService.class);
    Collection<CustomerInvoiceDetail> invoiceDetails =
        invoiceDocService.getCustomerInvoiceDetailsForCustomerInvoiceDocumentWithCaching(document);

    for (CustomerInvoiceDetail invoiceDetail : invoiceDetails) {
      if (StringUtils.isNotBlank(invoiceDetail.getChartOfAccountsCode())
          && StringUtils.isNotBlank(invoiceDetail.getAccountNumber())) {
        attributes.put(
            KfsKimAttributes.CHART_OF_ACCOUNTS_CODE, invoiceDetail.getChartOfAccountsCode());
        attributes.put(KfsKimAttributes.ACCOUNT_NUMBER, invoiceDetail.getAccountNumber());
      }
    }

    // add profile principal id - hopefully someday, TEM can simply do this for us if it is turned
    // on
    final String currentUserPrincipalId = GlobalVariables.getUserSession().getPrincipalId();
    attributes.put(KfsKimAttributes.PROFILE_PRINCIPAL_ID, currentUserPrincipalId);
  }