Lines 202-248
Link Here
|
202 |
cout<<" Account ID : "<<data.account_id<<"\n"; |
202 |
cout<<" Account ID : "<<data.account_id<<"\n"; |
203 |
} |
203 |
} |
204 |
|
204 |
|
205 |
if(data.transactiontype_valid==true){ |
205 |
if(data.transactiontype_valid==true) |
206 |
switch(data.transactiontype){ |
206 |
{ |
207 |
case data.OFX_CREDIT: strncpy(dest_string, "CREDIT: Generic credit", sizeof(dest_string)); |
207 |
if(data.transactiontype==OFX_CREDIT) |
208 |
break; |
208 |
strncpy(dest_string, "CREDIT: Generic credit", sizeof(dest_string)); |
209 |
case data.OFX_DEBIT: strncpy(dest_string, "DEBIT: Generic debit", sizeof(dest_string)); |
209 |
else if (data.transactiontype==OFX_DEBIT) |
210 |
break; |
210 |
strncpy(dest_string, "DEBIT: Generic debit", sizeof(dest_string)); |
211 |
case data.OFX_INT: strncpy(dest_string, "INT: Interest earned or paid (Note: Depends on signage of amount)", sizeof(dest_string)); |
211 |
else if (data.transactiontype==OFX_INT) |
212 |
break; |
212 |
strncpy(dest_string, "INT: Interest earned or paid (Note: Depends on signage of amount)", sizeof(dest_string)); |
213 |
case data.OFX_DIV: strncpy(dest_string, "DIV: Dividend", sizeof(dest_string)); |
213 |
else if (data.transactiontype==OFX_DIV) |
214 |
break; |
214 |
strncpy(dest_string, "DIV: Dividend", sizeof(dest_string)); |
215 |
case data.OFX_FEE: strncpy(dest_string, "FEE: FI fee", sizeof(dest_string)); |
215 |
else if (data.transactiontype==OFX_FEE) |
216 |
break; |
216 |
strncpy(dest_string, "FEE: FI fee", sizeof(dest_string)); |
217 |
case data.OFX_SRVCHG: strncpy(dest_string, "SRVCHG: Service charge", sizeof(dest_string)); |
217 |
else if (data.transactiontype==OFX_SRVCHG) |
218 |
break; |
218 |
strncpy(dest_string, "SRVCHG: Service charge", sizeof(dest_string)); |
219 |
case data.OFX_DEP: strncpy(dest_string, "DEP: Deposit", sizeof(dest_string)); |
219 |
else if (data.transactiontype==OFX_DEP) |
220 |
break; |
220 |
strncpy(dest_string, "DEP: Deposit", sizeof(dest_string)); |
221 |
case data.OFX_ATM: strncpy(dest_string, "ATM: ATM debit or credit (Note: Depends on signage of amount)", sizeof(dest_string)); |
221 |
else if (data.transactiontype==OFX_ATM) |
222 |
break; |
222 |
strncpy(dest_string, "ATM: ATM debit or credit (Note: Depends on signage of amount)", sizeof(dest_string)); |
223 |
case data.OFX_POS: strncpy(dest_string, "POS: Point of sale debit or credit (Note: Depends on signage of amount)", sizeof(dest_string)); |
223 |
else if (data.transactiontype==OFX_POS) |
224 |
break; |
224 |
strncpy(dest_string, "POS: Point of sale debit or credit (Note: Depends on signage of amount)", sizeof(dest_string)); |
225 |
case data.OFX_XFER: strncpy(dest_string, "XFER: Transfer", sizeof(dest_string)); |
225 |
else if (data.transactiontype==OFX_XFER) |
226 |
break; |
226 |
strncpy(dest_string, "XFER: Transfer", sizeof(dest_string)); |
227 |
case data.OFX_CHECK: strncpy(dest_string, "CHECK: Check", sizeof(dest_string)); |
227 |
else if (data.transactiontype==OFX_CHECK) |
228 |
break; |
228 |
strncpy(dest_string, "CHECK: Check", sizeof(dest_string)); |
229 |
case data.OFX_PAYMENT: strncpy(dest_string, "PAYMENT: Electronic payment", sizeof(dest_string)); |
229 |
else if (data.transactiontype==OFX_PAYMENT) |
230 |
break; |
230 |
strncpy(dest_string, "PAYMENT: Electronic payment", sizeof(dest_string)); |
231 |
case data.OFX_CASH: strncpy(dest_string, "CASH: Cash withdrawal", sizeof(dest_string)); |
231 |
else if (data.transactiontype==OFX_CASH) |
232 |
break; |
232 |
strncpy(dest_string, "CASH: Cash withdrawal", sizeof(dest_string)); |
233 |
case data.OFX_DIRECTDEP: strncpy(dest_string, "DIRECTDEP: Direct deposit", sizeof(dest_string)); |
233 |
else if (data.transactiontype==OFX_DIRECTDEP) |
234 |
break; |
234 |
strncpy(dest_string, "DIRECTDEP: Direct deposit", sizeof(dest_string)); |
235 |
case data.OFX_DIRECTDEBIT: strncpy(dest_string, "DIRECTDEBIT: Merchant initiated debit", sizeof(dest_string)); |
235 |
else if (data.transactiontype==OFX_DIRECTDEBIT) |
236 |
break; |
236 |
strncpy(dest_string, "DIRECTDEBIT: Merchant initiated debit", sizeof(dest_string)); |
237 |
case data.OFX_REPEATPMT: strncpy(dest_string, "REPEATPMT: Repeating payment/standing order", sizeof(dest_string)); |
237 |
else if (data.transactiontype==OFX_REPEATPMT) |
238 |
break; |
238 |
strncpy(dest_string, "REPEATPMT: Repeating payment/standing order", sizeof(dest_string)); |
239 |
case data.OFX_OTHER: strncpy(dest_string, "OTHER: Other", sizeof(dest_string)); |
239 |
else if (data.transactiontype==OFX_OTHER) |
240 |
break; |
240 |
strncpy(dest_string, "OTHER: Other", sizeof(dest_string)); |
241 |
default : strncpy(dest_string, "Unknown transaction type", sizeof(dest_string)); |
241 |
else |
242 |
break; |
242 |
strncpy(dest_string, "Unknown transaction type", sizeof(dest_string)); |
|
|
243 |
cout<<" Transaction type: "<<dest_string<<"\n"; |
243 |
} |
244 |
} |
244 |
cout<<" Transaction type: "<<dest_string<<"\n"; |
245 |
|
245 |
} |
|
|
246 |
if(data.date_initiated_valid==true){ |
246 |
if(data.date_initiated_valid==true){ |
247 |
strftime(dest_string,sizeof(dest_string),"%c %Z",localtime(&(data.date_initiated))); |
247 |
strftime(dest_string,sizeof(dest_string),"%c %Z",localtime(&(data.date_initiated))); |
248 |
cout<<" Date initiated: "<<dest_string<<"\n"; |
248 |
cout<<" Date initiated: "<<dest_string<<"\n"; |
Lines 283-329
Link Here
|
283 |
} |
283 |
} |
284 |
if(data.invtransactiontype_valid==true){ |
284 |
if(data.invtransactiontype_valid==true){ |
285 |
cout<<" Investment transaction type: "; |
285 |
cout<<" Investment transaction type: "; |
286 |
switch(data.invtransactiontype){ |
286 |
if (data.invtransactiontype==OFX_BUYDEBT) |
287 |
case data.OFX_BUYDEBT: strncpy(dest_string, "BUYDEBT (Buy debt security)", sizeof(dest_string)); |
287 |
strncpy(dest_string, "BUYDEBT (Buy debt security)", sizeof(dest_string)); |
288 |
break; |
288 |
else if (data.invtransactiontype==OFX_BUYMF) |
289 |
case data.OFX_BUYMF: strncpy(dest_string, "BUYMF (Buy mutual fund)", sizeof(dest_string)); |
289 |
strncpy(dest_string, "BUYMF (Buy mutual fund)", sizeof(dest_string)); |
290 |
break; |
290 |
else if (data.invtransactiontype==OFX_BUYOPT) |
291 |
case data.OFX_BUYOPT: strncpy(dest_string, "BUYOPT (Buy option)", sizeof(dest_string)); |
291 |
strncpy(dest_string, "BUYOPT (Buy option)", sizeof(dest_string)); |
292 |
break; |
292 |
else if (data.invtransactiontype==OFX_BUYOTHER) |
293 |
case data.OFX_BUYOTHER: strncpy(dest_string, "BUYOTHER (Buy other security type)", sizeof(dest_string)); |
293 |
strncpy(dest_string, "BUYOTHER (Buy other security type)", sizeof(dest_string)); |
294 |
break; |
294 |
else if (data.invtransactiontype==OFX_BUYSTOCK) |
295 |
case data.OFX_BUYSTOCK: strncpy(dest_string, "BUYSTOCK (Buy stock))", sizeof(dest_string)); |
295 |
strncpy(dest_string, "BUYSTOCK (Buy stock))", sizeof(dest_string)); |
296 |
break; |
296 |
else if (data.invtransactiontype==OFX_CLOSUREOPT) |
297 |
case data.OFX_CLOSUREOPT: strncpy(dest_string, "CLOSUREOPT (Close a position for an option)", sizeof(dest_string)); |
297 |
strncpy(dest_string, "CLOSUREOPT (Close a position for an option)", sizeof(dest_string)); |
298 |
break; |
298 |
else if (data.invtransactiontype==OFX_INCOME) |
299 |
case data.OFX_INCOME: strncpy(dest_string, "INCOME (Investment income is realized as cash into the investment account)", sizeof(dest_string)); |
299 |
strncpy(dest_string, "INCOME (Investment income is realized as cash into the investment account)", sizeof(dest_string)); |
300 |
break; |
300 |
else if (data.invtransactiontype==OFX_INVEXPENSE) |
301 |
case data.OFX_INVEXPENSE: strncpy(dest_string, "INVEXPENSE (Misc investment expense that is associated with a specific security)", sizeof(dest_string)); |
301 |
strncpy(dest_string, "INVEXPENSE (Misc investment expense that is associated with a specific security)", sizeof(dest_string)); |
302 |
break; |
302 |
else if (data.invtransactiontype==OFX_JRNLFUND) |
303 |
case data.OFX_JRNLFUND: strncpy(dest_string, "JRNLFUND (Journaling cash holdings between subaccounts within the same investment account)", sizeof(dest_string)); |
303 |
strncpy(dest_string, "JRNLFUND (Journaling cash holdings between subaccounts within the same investment account)", sizeof(dest_string)); |
304 |
break; |
304 |
else if (data.invtransactiontype==OFX_MARGININTEREST) |
305 |
case data.OFX_MARGININTEREST: strncpy(dest_string, "MARGININTEREST (Margin interest expense)", sizeof(dest_string)); |
305 |
strncpy(dest_string, "MARGININTEREST (Margin interest expense)", sizeof(dest_string)); |
306 |
break; |
306 |
else if (data.invtransactiontype==OFX_REINVEST) |
307 |
case data.OFX_REINVEST: strncpy(dest_string, "REINVEST (Reinvestment of income)", sizeof(dest_string)); |
307 |
strncpy(dest_string, "REINVEST (Reinvestment of income)", sizeof(dest_string)); |
308 |
break; |
308 |
else if (data.invtransactiontype==OFX_RETOFCAP) |
309 |
case data.OFX_RETOFCAP: strncpy(dest_string, "RETOFCAP (Return of capital)", sizeof(dest_string)); |
309 |
strncpy(dest_string, "RETOFCAP (Return of capital)", sizeof(dest_string)); |
310 |
break; |
310 |
else if (data.invtransactiontype==OFX_SELLDEBT) |
311 |
case data.OFX_SELLDEBT: strncpy(dest_string, "SELLDEBT (Sell debt security. Used when debt is sold, called, or reached maturity)", sizeof(dest_string)); |
311 |
strncpy(dest_string, "SELLDEBT (Sell debt security. Used when debt is sold, called, or reached maturity)", sizeof(dest_string)); |
312 |
break; |
312 |
else if (data.invtransactiontype==OFX_SELLMF) |
313 |
case data.OFX_SELLMF: strncpy(dest_string, "SELLMF (Sell mutual fund)", sizeof(dest_string)); |
313 |
strncpy(dest_string, "SELLMF (Sell mutual fund)", sizeof(dest_string)); |
314 |
break; |
314 |
else if (data.invtransactiontype==OFX_SELLOPT) |
315 |
case data.OFX_SELLOPT: strncpy(dest_string, "SELLOPT (Sell option)", sizeof(dest_string)); |
315 |
strncpy(dest_string, "SELLOPT (Sell option)", sizeof(dest_string)); |
316 |
break; |
316 |
else if (data.invtransactiontype==OFX_SELLOTHER) |
317 |
case data.OFX_SELLOTHER: strncpy(dest_string, "SELLOTHER (Sell other type of security)", sizeof(dest_string)); |
317 |
strncpy(dest_string, "SELLOTHER (Sell other type of security)", sizeof(dest_string)); |
318 |
break; |
318 |
else if (data.invtransactiontype==OFX_SELLSTOCK) |
319 |
case data.OFX_SELLSTOCK: strncpy(dest_string, "SELLSTOCK (Sell stock)", sizeof(dest_string)); |
319 |
strncpy(dest_string, "SELLSTOCK (Sell stock)", sizeof(dest_string)); |
320 |
break; |
320 |
else if (data.invtransactiontype==OFX_SPLIT) |
321 |
case data.OFX_SPLIT: strncpy(dest_string, "SPLIT (Stock or mutial fund split)", sizeof(dest_string)); |
321 |
strncpy(dest_string, "SPLIT (Stock or mutial fund split)", sizeof(dest_string)); |
322 |
break; |
322 |
else if (data.invtransactiontype==OFX_TRANSFER) |
323 |
case data.OFX_TRANSFER: strncpy(dest_string, "TRANSFER (Transfer holdings in and out of the investment account)", sizeof(dest_string)); |
323 |
strncpy(dest_string, "TRANSFER (Transfer holdings in and out of the investment account)", sizeof(dest_string)); |
324 |
break; |
324 |
else |
325 |
default: strncpy(dest_string, "ERROR, this investment transaction type is unknown. This is a bug in ofxdump", sizeof(dest_string)); |
325 |
strncpy(dest_string, "ERROR, this investment transaction type is unknown. This is a bug in ofxdump", sizeof(dest_string)); |
326 |
break; |
|
|
327 |
} |
326 |
} |
328 |
cout<<dest_string<<"\n"; |
327 |
cout<<dest_string<<"\n"; |
329 |
} |
328 |
} |