/// <summary> /// Load Invoice Line. /// 4 amounts /// AMTTYPE_Payment /// AMTTYPE_Statement2 /// AMTTYPE_Charge /// AMTTYPE_Interest /// </summary> /// <param name="bs">bank statement</param> /// <returns>DocLine Array</returns> private DocLine[] LoadLines(MBankStatement bs) { List <DocLine> list = new List <DocLine>(); MBankStatementLine[] lines = bs.GetLines(false); for (int i = 0; i < lines.Length; i++) { MBankStatementLine line = lines[i]; DocLine_Bank docLine = new DocLine_Bank(line, this); // Set Date Acct if (i == 0) { SetDateAcct(line.GetDateAcct()); } MPeriod period = MPeriod.Get(GetCtx(), line.GetDateAcct()); if (period != null && period.IsOpen(MDocBaseType.DOCBASETYPE_BANKSTATEMENT)) { docLine.SetC_Period_ID(period.GetC_Period_ID()); } // list.Add(docLine); } // Return Array DocLine[] dls = new DocLine[list.Count]; dls = list.ToArray(); return(dls); }
/// <summary> /// Perform Match /// </summary> /// <param name="bs">bank statement</param> /// <returns>Message</returns> private String Match(MBankStatement bs) { if (_matchers == null || bs == null) { return("--"); } log.Fine("match - " + bs); int count = 0; MBankStatementLine[] lines = bs.GetLines(false); for (int i = 0; i < lines.Length; i++) { if (lines[i].GetC_Payment_ID() == 0) { Match(lines[i]); count++; } } //return String.valueOf(count); return(count.ToString()); }