Exemplo n.º 1
0
        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");
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        /// <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);
        }
Exemplo n.º 5
0
 public override bool IncludeSplit(TrxSplit split)
 {
     return(split.CategoryKey.IndexOf('.') <= 0);
 }
Exemplo n.º 6
0
 public SplitDetailItemBuilder(TrxSplit split)
 {
     Split = split;
 }
Exemplo n.º 7
0
 public abstract bool IncludeSplit(TrxSplit split);
Exemplo n.º 8
0
 public override bool IncludeSplit(TrxSplit split)
 {
     return(true);
 }