Source code: com/pjsofts/eurobudget/format/qif/QIF.java
1 /*
2 * QIF.java
3 *
4 * Created on 8 mars 2002, 15:06
5 */
6
7 package com.pjsofts.eurobudget.format.qif;
8
9 import com.pjsofts.eurobudget.EBConstants;
10 import java.text.DateFormat;
11 import java.text.NumberFormat;
12 import java.text.SimpleDateFormat;
13 import java.util.Locale;
14 import java.util.ResourceBundle;
15
16 /**<PRE>
17 * QIF format - Warning loose information compare to FileData
18 * Quicken Interchange Format strict or relative ??
19 * Description:
20 * First Line: !Type :
21 * First Transaction: define initial amount(T), date of creation (D) and name of the account (L), (M)ention
22 * Then many group of lines describing transactions separated by "^"
23 * Lines are prefixed with :
24 * D for Date(seems to be dd/MM/yy or dd/MM'yy for 19yy and dd/MM'yy for 20yy)
25 * CX or C* for Cxxxx, X means Rapproché, * means Pointé, else nothing
26 * M for Mention (Comment, Note), String
27 * T for Amount(Number negative or positive)
28 * N for Check number, Number, format x,xxxx,xxx.xxx (!French, US)
29 * P for Person (Tiers), String
30 * L for List
31 * String means Category 1
32 * String:String means Category1:Category2)
33 * [String] means Name of Account ==> Virement
34 *
35 * Normal order = D,C,M,T,N,P,L
36 * Mandatory = D,T
37 * Information lost:
38 * owner, last modif date,
39 * </PRE>
40 * more info on http://www.respmech.com/mym2qifw/qif_new.htm
41 *
42 */
43 public class QIF {
44
45 private static final ResourceBundle i18n = EBConstants.i18n;
46
47 public static final Locale LOCALE = Locale.US;
48 public static final DateFormat DF = new SimpleDateFormat("dd/MM/yy",LOCALE);
49 public static final DateFormat DF2000 = new SimpleDateFormat("dd/MM''yy",LOCALE);
50 // DecimalFormat ??
51 public static final NumberFormat NF = NumberFormat.getNumberInstance(LOCALE);
52
53 static {
54 NF.setGroupingUsed(true);
55 NF.setMaximumFractionDigits(3);
56 NF.setMinimumFractionDigits(2);
57 NF.setParseIntegerOnly(false);
58 }
59
60 /**
61 * When an object implementing interface <code>Runnable</code> is used
62 * to create a thread, starting the thread causes the object's
63 * <code>run</code> method to be called in that separately executing
64 * thread.
65 * <p>
66 * The general contract of the method <code>run</code> is that it may
67 * take any action whatsoever.
68 *
69 * Need to call setAction before calling this one.
70 * Can't be stopped.
71 * @see java.lang.Thread#run()
72 */
73 // public void run() {
74 // }
75 //
76
77 }
78
79 /*
80
81
82
83
84
85 Items for a Memorized Transaction List
86
87
88 Immediately preceding the ^ character, each entry must end with one of the following file indicators to specify the transaction type.
89
90
91 KC
92 KD
93 KP
94 KI
95 KE
96 With that exception, memorized transaction entries have the same format as regular transaction entries (non-investment accounts). However, the Date or Num field is included. All items are optional, but if an amortization record is included, all seven amortization lines must also be included.
97
98
99 Field Indicator Explanation
100 KC Check transaction
101 KD Deposit transaction
102 KP Payment transaction
103 KI Investment transaction
104 KE Electronic payee transaction
105 T Amount
106 C Cleared status
107 P Payee
108 M Memo
109 A Address
110 L Category or Transfer/Class
111 S Category/class in split
112 E Memo in split
113 $ Dollar amount of split
114 1 Amortization: First payment date
115 2 Amortization: Total years for loan
116 3 Amortization: Number of payments already made
117 4 Amortization: Number of periods per year
118 5 Amortization: Interest rate
119 6 Amortization: Current loan balance
120 7 Amortization: Original loan amount
121 ^ End of entry
122 */
123
124