コード例 #1
0
ファイル: SieDocument.cs プロジェクト: asd1530/SimpleApp
        private void parseTRANS(SieDataItem di, SieVoucher v)
        {
            if (!KONTO.ContainsKey(di.GetString(0)))
            {
                KONTO.Add(di.GetString(0), new SieAccount()
                {
                    Number = di.GetString(0), Company = this.Company, Import = this.Import
                });
            }

            var objOffset = 0;

            if (di.RawData.Contains("{"))
            {
                objOffset = 1;
            }

            var vr = new SieVoucherRow()
            {
                Account   = KONTO[di.GetString(0)],
                Objects   = di.GetObjects(),
                Amount    = di.GetDecimal(1 + objOffset),
                RowDate   = di.GetDate(2 + objOffset).HasValue ? di.GetDate(2 + objOffset).Value : v.VoucherDate,
                Text      = di.GetString(3 + objOffset),
                Quantity  = di.GetIntNull(4 + objOffset),
                CreatedBy = di.GetString(5 + objOffset),
                Token     = di.ItemType,
                Company   = this.Company,
                Import    = this.Import
            };

            v.Rows.Add(vr);
        }