-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathqboconst.py
76 lines (67 loc) · 1.77 KB
/
qboconst.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#####################################################################
# #
# File: qboconst.py #
# Developer: Justin Leto #
# #
# qboconst.py holds const values for QBO file format #
# #
# Usage: Called from qbo.py #
# #
#####################################################################
from datetime import date, time
DATE_TODAY = "" + date.today().strftime('%Y%m%d%H%M%S') + ".000[-5]"
HEADER = ("OFXHEADER:100\n"
"DATA:OFXSGML\n"
"VERSION:102\n"
"SECURITY:NONE\n"
"ENCODING:USASCII\n"
"CHARSET:1252\n"
"COMPRESSION:NONE\n"
"OLDFILEUID:NONE\n"
"NEWFILEUID:NONE\n\n"
"<OFX>\n"
"<SIGNONMSGSRSV1>\n"
"<SONRS>\n"
"<STATUS>\n"
"<CODE>0\n"
"<SEVERITY>INFO\n"
"<MESSAGE>OK\n"
"</STATUS>\n"
"<DTSERVER>" + DATE_TODAY + "\n"
"<LANGUAGE>ENG\n"
"<INTU.BID>3000\n"
"</SONRS>\n"
"</SIGNONMSGSRSV1>\n"
"<BANKMSGSRSV1>\n"
"<STMTTRNRS>\n"
"<TRNUID>" + DATE_TODAY + "\n"
"<STATUS>\n"
"<CODE>0\n"
"<SEVERITY>INFO\n"
"<MESSAGE>OK\n"
"</STATUS>\n"
"<STMTRS>\n"
"<CURDEF>USD\n"
"<BANKACCTFROM>\n"
"<BANKID>999999999\n"
"<ACCTID>999999999999\n"
"<ACCTTYPE>CHECKING\n"
"</BANKACCTFROM>\n")
FOOTER = ("<LEDGERBAL>\n"
"<BALAMT>0.00\n"
"<DTASOF>" + DATE_TODAY + "\n"
"</LEDGERBAL>\n"
"<AVAILBAL>\n"
"<BALAMT>0.00\n"
"<DTASOF>" + DATE_TODAY + "\n"
"</AVAILBAL>\n"
"</STMTRS>\n"
"</STMTTRNRS>\n"
"</BANKMSGSRSV1>\n"
"</OFX>\n")
DATE_START = "<DTSTART>" + DATE_TODAY + "\n"
DATE_END = "<DTEND>" + DATE_TODAY + "\n"
BANKTRANLIST_START = "<BANKTRANLIST>\n"
BANKTRANLIST_END = "</BANKTRANLIST>\n"
TRANSACTION_START = "<STMTTRN>"
TRANSACTION_END = "</STMTTRN>"