private void OutputSplit(TrxSplit split, string transType, string payeeName) { CatDef cat = Categories[GetCatExportKey(split.CategoryKey)]; OutputLine("SPL\t\t" + transType + "\t" + split.Parent.TrxDate.ToString("MM/dd/yyyy") + "\t" + cat.ExportName + "\t" + payeeName + "\t" + (-split.Amount).ToString("##############0.00") + "\t\t" + split.Memo + "\tY"); }
private bool SplitIsToAccountsPayable(TrxSplit split) { int dotIndex = split.CategoryKey.IndexOf('.'); if (dotIndex < 0) { return(false); } int acctKey = int.Parse(split.CategoryKey.Substring(0, dotIndex)); return(Company.Accounts.First(acct => acct.AccountKey == acctKey).AcctSubType == Account.SubType.Liability_AccountsPayable); }
private SplitDetailRow GetSplitDetailRow(TrxSplit split) { // Unlike for BudgetTrx we do not incorporate repeat key in the row key, // because there are so many different generated BankTrx sequences it // would make the resulting grid unwieldy. string rowKey = split.CategoryKey; if (!SplitDetailRows.TryGetValue(rowKey, out SplitDetailRow row)) { string sequence = ""; if (!string.IsNullOrEmpty(split.Parent.RepeatKey)) { sequence = split.Parent.Register.Account.Repeats.KeyToValue1(split.Parent.RepeatKey); } row = new SplitDetailRow(PeriodCount, split.CategoryKey, Company.Categories.KeyToValue1(split.CategoryKey), sequence); SplitDetailRows[rowKey] = row; } return(row); }
/// <summary> /// Construct the account name to write to the export file for the specified split. /// Split category may be an income/expense account, or a balance sheet account. /// The resulting name is guaranteed to not exist in this.Categories, and the result /// is generally added to this.Categories by the caller. /// This is how unique names are constructed, FROM A SPLIT, to add to this.Categories. /// </summary> /// <param name="split"></param> /// <param name="catName"></param> /// <returns></returns> private string MakeCatExportName(TrxSplit split, string catName) { string exportName; int periodIndex = split.CategoryKey.IndexOf('.'); if (periodIndex < 0) { exportName = GetPreExistingIntuitCatName(catName); if (exportName == null) { exportName = MakeUniqueAccountExportName(catName.Length > 2 ? catName.Substring(2) : catName); } } else { int acctKey = int.Parse(split.CategoryKey.Substring(0, periodIndex)); Account matchingAcct = Company.Accounts.First(acct => acct.AccountKey == acctKey); exportName = MakeBalanceSheetExportName(matchingAcct); } return(exportName); }
public override bool IncludeSplit(TrxSplit split) { return(split.CategoryKey.IndexOf('.') <= 0); }
public SplitDetailItemBuilder(TrxSplit split) { Split = split; }
public abstract bool IncludeSplit(TrxSplit split);
public override bool IncludeSplit(TrxSplit split) { return(true); }