| 1 |
/* |
| 2 |
* MoneyImport : Convert Bank csv file to MS Money OFX file. |
| 3 |
* |
| 4 |
* Copyright (c) 2001-2003 Takuya Murakami. All rights reserved. |
| 5 |
* |
| 6 |
* Redistribution and use in source and binary forms, with or without |
| 7 |
* modification, are permitted provided that the following conditions |
| 8 |
* are met: |
| 9 |
* |
| 10 |
* 1. Redistributions of source code must retain the above copyright |
| 11 |
* notice, this list of conditions and the following disclaimer. |
| 12 |
* |
| 13 |
* 2. Redistributions in binary form must reproduce the above copyright |
| 14 |
* notice, this list of conditions and the following disclaimer in the |
| 15 |
* documentation and/or other materials provided with the distribution. |
| 16 |
* |
| 17 |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 18 |
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 19 |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 20 |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR |
| 21 |
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 22 |
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 23 |
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 24 |
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 25 |
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 26 |
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 27 |
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 |
* |
| 29 |
* $Id$ |
| 30 |
*/ |
| 31 |
|
| 32 |
#ifndef _CONVERT_H |
| 33 |
#define _CONVERT_H |
| 34 |
|
| 35 |
#if 0 |
| 36 |
// |
| 37 |
// �������� |
| 38 |
// |
| 39 |
typedef enum { |
| 40 |
// ���� |
| 41 |
T_INT=0, // ���� |
| 42 |
T_DIV, // �z�� |
| 43 |
T_DIRECTDEP, // �U�������A���������A���������������� |
| 44 |
T_DEP, // ���������� |
| 45 |
|
| 46 |
// �o�� |
| 47 |
T_PAYMENT, // �������������� |
| 48 |
T_CASH, // ���������o�� |
| 49 |
T_ATM, // �J�[�h�����������o�� |
| 50 |
T_CHECK, // ���������A���� |
| 51 |
T_DEBIT, // �������o�� |
| 52 |
} trntype; |
| 53 |
|
| 54 |
#define T_INCOME 0 |
| 55 |
#define T_OUTGO 1 |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
// ���t�f�[�^ |
| 60 |
typedef struct { |
| 61 |
int year; |
| 62 |
int month; |
| 63 |
int date; |
| 64 |
int hour; |
| 65 |
int minutes; |
| 66 |
int seconds; |
| 67 |
} DateTime; |
| 68 |
|
| 69 |
// |
| 70 |
// �g�����U�N�V�����f�[�^ |
| 71 |
// |
| 72 |
typedef struct _transaction { |
| 73 |
struct _transaction *next; |
| 74 |
|
| 75 |
DateTime date; // ���t |
| 76 |
unsigned long id; // ID |
| 77 |
AnsiString desc; // ���� |
| 78 |
trntype type; // ���� |
| 79 |
long value; // ���z |
| 80 |
long balance; // �c�� |
| 81 |
} Transaction; |
| 82 |
|
| 83 |
// utility funcs |
| 84 |
extern void SplitLine(char *line, char **rows); |
| 85 |
extern trntype GetTrnType(const char *desc, int type); |
| 86 |
extern AnsiString utf8(char *sjis); |
| 87 |
|
| 88 |
#endif |
| 89 |
|
| 90 |
class Accounts; |
| 91 |
extern void Convert(AnsiString csvfile, AnsiString ofxfile, |
| 92 |
Accounts *acs); |
| 93 |
|
| 94 |
#endif // _CONVERT_H |
| 95 |
|