<commit_before>package org.kuali.module.ar.document;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;

import org.kuali.core.document.AmountTotaling;
import org.kuali.core.document.TransactionalDocumentBase;
import org.kuali.core.util.KualiDecimal;
import org.kuali.core.web.format.CurrencyFormatter;
import org.kuali.module.ar.bo.AccountsReceivableDocumentHeader;
import org.kuali.module.ar.bo.CashControlDetail;
import org.kuali.module.ar.bo.PaymentMedium;
import org.kuali.module.chart.bo.AccountingPeriod;

/**
 * @author <NAME>vous System Team (<EMAIL>)
 */
public class CashControlDocument extends TransactionalDocumentBase implements AmountTotaling {

	private String referenceFinancialDocumentNumber;
	private Integer universityFiscalYear;
	private String universityFiscalPeriodCode;
	private String customerPaymentMediumCode;
	private KualiDecimal cashControlTotalAmount = KualiDecimal.ZERO;

    private PaymentMedium customerPaymentMedium;
	private AccountingPeriod universityFiscalPeriod;
    private AccountsReceivableDocumentHeader accountsReceivableDocumentHeader;

    private List<CashControlDetail> cashControlDetails;
    
    private boolean hasNegativeCashControlDetail = false;
    
	public boolean isHasNegativeCashControlDetail() {
        return hasNegativeCashControlDetail;
    }

    public void setHasNegativeCashControlDetail(boolean hasNegativeCashControlDetail) {
        this.hasNegativeCashControlDetail = hasNegativeCashControlDetail;
    }

    /**
	 * Default constructor.
	 */
	public CashControlDocument() {
        super();
        accountsReceivableDocumentHeader = new AccountsReceivableDocumentHeader();
        customerPaymentMedium = new PaymentMedium();
        universityFiscalPeriod = new AccountingPeriod();
        cashControlDetails = new ArrayList<CashControlDetail>();
    }

	/**
	 * Gets the documentNumber attribute.
	 * 
	 * @return Returns the documentNumber
	 * 
	 */
	public String getDocumentNumber() { 
		return documentNumber;
	}

	/**
	 * Sets the documentNumber attribute.
	 * 
	 * @param documentNumber The documentNumber to set.
	 * 
	 */
	public void setDocumentNumber(String documentNumber) {
		this.documentNumber = documentNumber;
	}


	/**
	 * Gets the referenceFinancialDocumentNumber attribute.<commit_msg>KULAR-126 Change access modifiers for action methods<commit_after>package org.kuali.module.ar.document;

import java.sql.Date;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;

import org.kuali.core.document.AmountTotaling;
import org.kuali.core.document.TransactionalDocumentBase;
import org.kuali.core.util.KualiDecimal;
import org.kuali.core.web.format.CurrencyFormatter;
import org.kuali.module.ar.bo.AccountsReceivableDocumentHeader;
import org.kuali.module.ar.bo.CashControlDetail;
import org.kuali.module.ar.bo.PaymentMedium;
import org.kuali.module.chart.bo.AccountingPeriod;

/**
 * @author <NAME> System Team (<EMAIL>)
 */
public class CashControlDocument extends TransactionalDocumentBase implements AmountTotaling {

	private String referenceFinancialDocumentNumber;
	private Integer universityFiscalYear;
	private String universityFiscalPeriodCode;
	private String customerPaymentMediumCode;
	private KualiDecimal cashControlTotalAmount = KualiDecimal.ZERO;

    private PaymentMedium customerPaymentMedium;
	private AccountingPeriod universityFiscalPeriod;
    private AccountsReceivableDocumentHeader accountsReceivableDocumentHeader;

    private List<CashControlDetail> cashControlDetails;
    
    private boolean hasNegativeCashControlDetail = false;
    
	public boolean isHasNegativeCashControlDetail() {
        return hasNegativeCashControlDetail;
    }

    public void setHasNegativeCashControlDetail(boolean hasNegativeCashControlDetail) {
        this.hasNegativeCashControlDetail = hasNegativeCashControlDetail;
    }

    /**
	 * Default constructor.
	 */
	public CashControlDocument() {
        super();
        accountsReceivableDocumentHeader = new AccountsReceivableDocumentHeader();
        customerPaymentMedium = new PaymentMedium();
        universityFiscalPeriod = new AccountingPeriod();
        cashControlDetails = new ArrayList<CashControlDetail>();
        
        //TODO remove these lines
        this.getAccountsReceivableDocumentHeader().setProcessingChartOfAccountCode("UA");
        this.setReferenceFinancialDocumentNumber("gfe6234");
        
        CashControlDetail detail = new CashControlDetail();
        detail.setCustomerNumber("3476385");
        detail.setReferenceFinancialDocumentNumber("6234762354");
        detail.setDocumentNumber("7865765");
        detail.setCustomerPaymentDate(new Date(System.currentTimeMillis()));
        detail.setFinancialDocumentLineAmount(new KualiDecimal(10));
        
        addCashControlDetail(detail);
    }

	/**
	 * Gets the documentNumber attribute.
	 * 
	 * @return Returns the documentNumber
	 * 
	 */
	public String getDocumentNumber() { 
		return documentNumber;
	}

	/**
	 * Sets the documentNumber attribute.
	 * 
	 * @param documentNumber The documentNumber to set.
	 * 
	 */
	public void setDocumentNumber(String documentNumber) {
		this.documentNumber = documentNumber;
	}


	/**
	 * Gets the referenceFinancialDocumentNumber attribute.
{'fraction_non_alphanumeric': 0.07756180411398376, 'fraction_numerical': 0.006227590111341763, 'mean_word_length': 4.6203605514316015, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1463617', 'n_tokens_mistral': 1519, 'n_tokens_neox': 1403, 'n_words': 283}