forked from kugiigi/tagatuos-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata_transfer
More file actions
240 lines (213 loc) · 7.1 KB
/
data_transfer
File metadata and controls
240 lines (213 loc) · 7.1 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
SELECT 'Uncategorized', descr, descrlong, date, value FROM items WHERE category = 'Gastos';
/*Insert Expenses*/
INSERT INTO realData.expenses(category_name,name,descr,date,value) SELECT 'Uncategorized', descr, descrlong, date, value FROM items WHERE category = 'Gastos';
SELECT descr, descrlong, date, value,CASE WHEN descr LIKE 'Utang ni%' then 0 else 1 end, CASE WHEN status = 'Paid' then 1 else 0 end FROM items WHERE category = 'Utang';
/*Insert Debts*/
INSERT INTO realData.debts(name,descr,date,value,debtor_flag,paid_flag) SELECT descr, descrlong, date, value,CASE WHEN descr LIKE 'Utang ni%' then 0 else 1 end, CASE WHEN status = 'Paid' then 1 else 0 end FROM items WHERE category = 'Utang';
UPDATE expenses set category_name = 'Transportation'
where (name LIKE '%MRT%'
OR name LIKE '%Bus%'
OR name LIKE '%FX%'
OR name LIKE '%Tricycle%'
OR name LIKE '%Van%'
OR name LIKE '%LRT%'
OR name LIKE '%Jeep%'
OR name LIKE '%Taxi%'
OR name LIKE '%Train%'
OR name LIKE '%NLEX%'
OR name LIKE '%Beep Card Load%'
)
AND name NOT IN ('Incubus Concert','Muse and Incubus CD')
;
UPDATE expenses set category_name = 'Personal' where (name LIKE '%Grocer%');
UPDATE expenses set category_name = 'Household' where (name LIKE '%Kuryente%'
OR name LIKE '%Bigay kay mama%'
OR name LIKE '%Adventure Insurance%'
OR name LIKE '%Plantsa%'
OR name LIKE '%Amilyar%')
AND category_name = 'Uncategorized';
(name LIKE '%Oxygen 1155%'
OR name LIKE '%Human 7%'
OR name LIKE '%Kagamitan%'
OR name LIKE '%Pangahit%'
OR name LIKE '%Pabango%'
OR name LIKE '%Panlaba Powder%'
OR name LIKE '%Gupit%'
OR name LIKE '%Deodorant%'
OR name LIKE '%Palmolive Shampoo%'
OR name LIKE '%Gupit%'
OR name LIKE '%Gupit%'
)
--UPDATE expenses set category_name = 'Electronics'
SELECT DISTINCT name FROM expenses
where(name LIKE '%Thermal Paste%'
OR name LIKE '%Desktop Mouse%'
OR name LIKE '%Bayad sa UPS%'
OR name LIKE '%16GB Flash Drive%'
OR name LIKE '%Europe Socket Adapter%'
OR name LIKE '%LycaMobile Sim Card%'
OR name LIKE '%Amazon Online Shopping%'
OR name LIKE '%Corsair RM650%'
OR name LIKE '%Amazon Package%'
OR name LIKE '%Audio Male to Male%'
OR name LIKE '%DVI Cable%'
OR name LIKE '%PS3 Controller USB Cable%'
OR name LIKE '%PS3 Controller%'
OR name LIKE '%PC Bluetooth Adapter%'
OR name LIKE '%Google Cardboard%'
OR name LIKE '%Earphone%'
OR name LIKE '%Bluetooth Dongle%'
OR name LIKE '%Developer Laptop%'
OR name LIKE '%Laptop RAM Upgrade%'
OR name LIKE '%Laptop RAM%'
OR name LIKE '%Laptop Mouse%'
OR name LIKE '%Bluetooth Keyboard and Mouse%'
OR name LIKE '%bq Aquaris E5 HD Ubuntu Edition%'
OR name LIKE '%Smart Micro Sim Card%'
OR name LIKE '%Europe Adapter%'
OR name LIKE '%Congstar Sim Card%'
OR name LIKE '%Bluetooth Keyboards%'
OR name LIKE '%Soundbar Battery%'
OR name LIKE '%Sony SBH20 Bluetooth Headset%'
OR name LIKE '%Miracast + HDMI to VGA Adapter%'
OR name LIKE '%JohnnyAir Padala%'
OR name LIKE '%S3 Battery%'
OR name LIKE '%Logitech Wireless Mouse%'
OR name LIKE '%A4Tech Headset%'
OR name LIKE '%Logitech Wireless Mouse/KB%'
OR name LIKE '%GPU Checkup%'
)
--AND name NOT IN ('Meryenda + Deodorant')
AND category_name = 'Uncategorized'
;
--UPDATE expenses set category_name = 'Travels'
SELECT DISTINCT name FROM expenses
where(name LIKE '%Pasalubong%'
OR name LIKE '%CR/WC%'
OR name LIKE '%Atomium & Mini Europe%'
OR name LIKE '%Hostel%'
OR name LIKE '%Louvre Museum Ticket%'
OR name LIKE '%Ticket to Summit of Eiffel Tower%'
OR name LIKE '%Pasalubong 2%'
OR name LIKE '%Skip-The-Line Ticket to Eiffel Tower%'
OR name LIKE '%Japan Visa%'
OR name LIKE '%Japan Plane Ticket%'
OR name LIKE '%Suica Load%'
OR name LIKE '%JR West Kansai Area Pass%'
OR name LIKE '%Leeg Unan%'
OR name LIKE '%Keychains%'
OR name LIKE '%Spiderman Key Holder%'
OR name LIKE '%Locker%'
OR name LIKE '%Haikyuu Manga%'
OR name LIKE '%Tokyo 1 day Pass%'
OR name LIKE '%Tokyo Tower Ticket%'
OR name LIKE '%Weekly Jump Vol. 1%'
OR name LIKE '%Maleta Repair%'
OR name LIKE '%Heidelberg Castle Ticket%'
OR name LIKE '%Starbucks Tumbler Germany%'
OR name LIKE '%Pasalubong%'
)
--AND name NOT IN ('Meryenda + Deodorant')
AND category_name = 'Uncategorized'
;
UPDATE expenses set category_name = 'Work'
--SELECT DISTINCT name FROM expenses
where(name LIKE '%Passport - Rush%'
OR name LIKE '%Passport Scan%'
OR name LIKE '%German Visa%'
OR name LIKE '%German Visa Delivery%'
OR name LIKE '%Terminal Fee%'
OR name LIKE '%Travel Tax%'
OR name LIKE '%Visa Photo%'
OR name LIKE '%Germany Flight Rebooking%'
OR name LIKE '%TGIF%'
OR name LIKE '%SSE Promotion Celebration Contribution%'
OR name LIKE '%SF Summer Outing%'
)
--AND name NOT IN ('Meryenda + Deodorant')
AND category_name = 'Uncategorized'
;
UPDATE expenses set category_name = 'Leisure'
--SELECT DISTINCT name FROM expenses
where(name LIKE '%Gastos badtrip%'
OR name LIKE '%Rurouni Kenshin 2 Movie%'
OR name LIKE '%Football%'
OR name LIKE '%Videoke%'
OR name LIKE '%Nuod Sine%'
OR name LIKE '%Football Ball%'
OR name LIKE '%Incubus Concert%'
OR name LIKE '%Sine Food%'
OR name LIKE '%Basketball Bola%'
OR name LIKE '%Muse and Incubus CD%'
OR name LIKE '%Muse - Absolution%'
OR name LIKE '%Beer%'
OR name LIKE '%Basketball%'
OR name LIKE '%Mask%'
OR name LIKE '%Sine Pagkain%'
OR name LIKE '%Mystery Manila%'
OR name LIKE '%Volleyball%'
OR name LIKE '%Inoman%'
OR name LIKE '%Don Pagkain Inom%'
OR name LIKE '%Tree Planting%'
OR name LIKE '%Mountain Hiking Expenses%'
)
--AND name NOT IN ('Meryenda + Deodorant')
AND category_name = 'Uncategorized'
;
UPDATE expenses set category_name = 'Clothing'
--SELECT DISTINCT name FROM expenses
where(name LIKE '%Accenture Jersey%'
OR name LIKE '%Tsinelas%'
OR name LIKE '%Siyaping%'
OR name LIKE '%Berlin Shirt%'
OR name LIKE '%Shoulder Bag%'
OR name LIKE '%Jersey Season 2%'
OR name LIKE '%Nike Shoes%'
OR name LIKE '%Damit sa Kasal ni Kuya Nicky%'
OR name LIKE '%Polo Shirt%'
OR name LIKE '%Kinjaz Apparels%'
OR name LIKE '%Kinjaz Apparels Receive%'
OR name LIKE '%Black Shoes for Dancing%'
OR name LIKE '%Jacket for ME4%'
)
--AND name NOT IN ('Meryenda + Deodorant')
AND category_name = 'Uncategorized'
;
UPDATE expenses set category_name = 'Events'
--SELECT DISTINCT name FROM expenses
where(name LIKE '%ABL Registration%'
OR name LIKE '%Birthday ni Jerel%'
OR name LIKE '%Birthday Celebrations%'
OR name LIKE '%Dance Class%'
OR name LIKE '%Birthday ni Janine%'
OR name LIKE '%Birthday Ni Joyce%'
)
--AND name NOT IN ('Meryenda + Deodorant')
AND category_name = 'Uncategorized'
;
UPDATE expenses set category_name = 'Personal'
--SELECT DISTINCT name FROM expenses
where(name LIKE '%Smart Load%'
OR name LIKE '%Globe Prepaid%'
OR name LIKE '%Baranggay Clearance%'
OR name LIKE '%BPI ePrepaid Mastercard%'
OR name LIKE '%Congstar Load%'
OR name LIKE '%Card Case%'
OR name LIKE '%Retractable pang Beep Card%'
)
--AND name NOT IN ('Meryenda + Deodorant')
AND category_name = 'Uncategorized'
;
UPDATE expenses set category_name = 'Games'
--SELECT DISTINCT name FROM expenses
where(name LIKE '%NBA 2K15%'
OR name LIKE '%Steam Games%'
OR name LIKE '%GTA V%'
OR name LIKE '%Cut The Rope%'
OR name LIKE '%Gundam with stand%'
OR name LIKE '%Metal Gear Solid V:Phantom Pain%'
OR name LIKE '%The Witcher Trilogy%'
)
--AND name NOT IN ('Meryenda + Deodorant')
AND category_name = 'Uncategorized'
;