<commit_before><?php
/*******************************************************************************
 * purpose: contains csv2ofx functions
 ******************************************************************************/

// include files
$thisProjectDir	= dirname(__FILE__);
require_once $thisProjectDir.'/lib_general/MyArray.php';

//<-- begin class -->
class CSV2OFX {
	protected $className = __CLASS__;	// class name
	protected $verbose;
	protected $source;
	public $split;
	public $newContent;
	public $accounts = array();
	public $mainAccounts;
	public $csvContent;
	public $headAccount;
	public $headAccountId;
	public $headDate;
	public $headTranType;
	public $headAmount;
	public $headDesc;
	public $headPayee;
	public $headNotes;
	public $headSplitAccount;
	public $headClass;
	public $headTranId;
	public $headCheckNum;
	public $tranCheckNum;
	public $tranType;
	public $tranNotes;
	public $tranId;
	public $tranIds = array();
	public $tranDate;
	public $tranDate2;
	public $tranPayee;
	public $tranClass;
	public $tranSplitAccount;
	public $tranSplitAccountId;
	public $tranAmount;
	public $tranDesc;
	public $defSplitAccount = 'Orphan';

	/**
	 ***************************************************************************
	 * The class constructor
	 *
	 * @param 	boolean $verbose	enable verbose comments
	 **************************************************************************/
	function __construct($source, $csvContent, $verbose = FALSE) {
		$this->source = $source;
		$this->csvContent = $csvContent;
		$this->verbose = $verbose;

		// set headers
		// modify the 'custom' section to add support for other websites
		// add additional case blocks if needed
		switch($this->source) {
			case 'mint':
				$this->headAccount 	= 'Account Name';
				$this->headDate 	= 'Date';
				$this->headTranType = 'Transaction Type';
				$this->headAmount 	= 'Amount';
				$this->headDesc 	= 'Original Description';
				$this->headPayee 	= 'Description';
				$this->headNotes 	= 'Notes';
				$this->headSplitAccount = 'Category';
				$this->split		= FALSE;
				break;

			case 'xero':
				$this->headAccount 	= 'AccountName';
				$this->headDate 	= 'JournalDate';
				$this->headAmount 	= 'NetAmount';
				$this->headPayee 	= 'Description';
				$this->headNotes 	= 'Product';
				$this->headClass 	= 'Resource';
				$this->headSplitAccount = 'AccountName';
				$this->headTranId 	= 'JournalNumber';
				$this->headCheckNum = 'Reference';<commit_msg>Add default values to class constructor<commit_after><?php
/*******************************************************************************
 * purpose: contains csv2ofx functions
 ******************************************************************************/

// include files
$thisProjectDir	= dirname(__FILE__);
require_once $thisProjectDir.'/lib_general/MyArray.php';

//<-- begin class -->
class CSV2OFX {
	protected $className = __CLASS__;	// class name
	protected $verbose;
	protected $source;
	public $split;
	public $newContent;
	public $accounts = array();
	public $mainAccounts;
	public $csvContent;
	public $headAccount;
	public $headAccountId;
	public $headDate;
	public $headTranType;
	public $headAmount;
	public $headDesc;
	public $headPayee;
	public $headNotes;
	public $headSplitAccount;
	public $headClass;
	public $headTranId;
	public $headCheckNum;
	public $tranCheckNum;
	public $tranType;
	public $tranNotes;
	public $tranId;
	public $tranIds = array();
	public $tranDate;
	public $tranDate2;
	public $tranPayee;
	public $tranClass;
	public $tranSplitAccount;
	public $tranSplitAccountId;
	public $tranAmount;
	public $tranDesc;
	public $defSplitAccount = 'Orphan';

	/**
	 ***************************************************************************
	 * The class constructor
	 *
	 * @param 	boolean $verbose	enable verbose comments
	 **************************************************************************/
	function __construct($source='mint', $csvContent=null, $verbose=FALSE) {
		$this->source = $source;
		$this->csvContent = $csvContent;
		$this->verbose = $verbose;

		// set headers
		// modify the 'custom' section to add support for other websites
		// add additional case blocks if needed
		switch($this->source) {
			case 'mint':
				$this->headAccount 	= 'Account Name';
				$this->headDate 	= 'Date';
				$this->headTranType = 'Transaction Type';
				$this->headAmount 	= 'Amount';
				$this->headDesc 	= 'Original Description';
				$this->headPayee 	= 'Description';
				$this->headNotes 	= 'Notes';
				$this->headSplitAccount = 'Category';
				$this->split		= FALSE;
				break;

			case 'xero':
				$this->headAccount 	= 'AccountName';
				$this->headDate 	= 'JournalDate';
				$this->headAmount 	= 'NetAmount';
				$this->headPayee 	= 'Description';
				$this->headNotes 	= 'Product';
				$this->headClass 	= 'Resource';
				$this->headSplitAccount = 'AccountName';
				$this->headTranId 	= 'JournalNumber';
				$this->headCheckNum = 'Reference';
{'fraction_non_alphanumeric': 0.24352750809061488, 'fraction_numerical': 0.0012135922330097086, 'mean_word_length': 4.763403263403263, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 49, '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': '1595610', 'n_tokens_mistral': 1681, 'n_tokens_neox': 1488, 'n_words': 347}