Exemple #1
0
        protected virtual CodaLine ParseTransactionPart1(string line)
        {
            int    sequenceNumber      = int.Parse(line.Substring(2, 4).Trim());
            int    detailNumber        = int.Parse(line.Substring(6, 4).Trim());
            string reference           = line.Substring(10, 21).Trim();
            CodaTransactionType type   = (CodaTransactionType)int.Parse(line[31].ToString());
            decimal             amount = decimal.Parse(line.Substring(32, 15).Trim()) / 1000;

            if (type == CodaTransactionType.Debit)
            {
                amount *= -1;
            }
            string   codaDate      = line.Substring(47, 6).Trim();
            DateTime?effectiveDate = null;

            if (codaDate != "000000")
            {
                effectiveDate = CodaDate.Parse(codaDate);
            }
            string            code          = line.Substring(53, 8).Trim();
            string            family        = code.Substring(1, 2).Trim();
            string            operation     = code.Substring(3, 2).Trim();
            string            category      = code.Substring(5, 3).Trim();
            CodaCommunication communication = CodaCommunication.Parse(line.Substring(61, 54).Trim(), family == "05");
            DateTime          entryDate     = CodaDate.Parse(line.Substring(115, 6).Trim());
            int statementSequenceNumber     = int.Parse(line.Substring(121, 3).Trim());
            int globalizationCode           = int.Parse(line.Substring(124, 1).Trim());

            return(new CodaTransactionPart1Line(sequenceNumber, statementSequenceNumber, detailNumber, reference, effectiveDate,
                                                entryDate, type, code, family, operation, category, communication, amount, globalizationCode));
        }
Exemple #2
0
 public CodaTransaction(CodaTransactionType type, string family, string operation, string category, int statementSequenceNumber, int sequenceNumber, string reference,
                        DateTime entryDate, DateTime?effectiveDate, decimal amount, BankAccount counterPartyAccount, CodaCommunication communication, string message, int globalizationCode)
 {
     this.Type      = type;
     this.Family    = family;
     this.Operation = operation;
     this.Category  = category;
     this.StatementSequenceNumber = statementSequenceNumber;
     this.SequenceNumber          = sequenceNumber;
     this.Reference           = reference;
     this.EntryDate           = entryDate;
     this.EffectiveDate       = effectiveDate;
     this.Amount              = amount;
     this.CounterPartyAccount = counterPartyAccount;
     this.Communication       = communication;
     this.Message             = message;
     this.GlobalizationCode   = globalizationCode;
 }
Exemple #3
0
 public CodaTransactionPart1Line(int sequenceNumber, int statementSequenceNumber, int detailNumber, string reference, DateTime?effectiveDate, DateTime entryDate,
                                 CodaTransactionType type, string code, string family, string operation, string category, CodaCommunication communication, decimal amount, int globalizationCode)
     : base(CodaLineType.TransactionPart1)
 {
     this.SequenceNumber          = sequenceNumber;
     this.StatementSequenceNumber = statementSequenceNumber;
     this.DetailNumber            = detailNumber;
     this.Reference         = reference;
     this.EffectiveDate     = effectiveDate;
     this.EntryDate         = entryDate;
     this.Type              = type;
     this.Code              = code;
     this.Family            = family;
     this.Operation         = operation;
     this.Category          = category;
     this.Communication     = communication;
     this.Amount            = amount;
     this.GlobalizationCode = globalizationCode;
 }