Skip to content

Commit 5de4f54

Browse files
authored
Merge branch 'dev' into notes-feature
2 parents 867e68d + 1970665 commit 5de4f54

File tree

8 files changed

+17
-8
lines changed

8 files changed

+17
-8
lines changed

app/src/main/java/com/blogspot/e_kanivets/moneytracker/controller/external/ExportController.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public List<String> getRecordsForExport(long fromDate, long toDate) {
3131
@SuppressWarnings("StringBufferReplaceableByString")
3232
StringBuilder sb = new StringBuilder();
3333
sb.append(Head.TIME).append(Head.DELIMITER);
34+
sb.append(Head.ACCOUNT_ID).append(Head.DELIMITER);
3435
sb.append(Head.TITLE).append(Head.DELIMITER);
3536
sb.append(Head.CATEGORY).append(Head.DELIMITER);
3637
sb.append(Head.NOTES).append(Head.DELIMITER);
@@ -47,6 +48,12 @@ public List<String> getRecordsForExport(long fromDate, long toDate) {
4748
for (Record record : recordList) {
4849
sb = new StringBuilder();
4950
sb.append(record.getTime()).append(Head.DELIMITER);
51+
52+
long account_id = -1;
53+
if (record.getAccount() != null)
54+
account_id = record.getAccount().getId();
55+
56+
sb.append(account_id).append(Head.DELIMITER);
5057
sb.append(record.getTitle()).append(Head.DELIMITER);
5158

5259
Category category = null;

app/src/main/java/com/blogspot/e_kanivets/moneytracker/controller/external/Head.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99
public interface Head {
1010
String TIME = "time";
11+
String ACCOUNT_ID = "account_id";
1112
String TITLE = "title";
1213
String CATEGORY = "category";
1314
String NOTES = "notes";

app/src/main/java/com/blogspot/e_kanivets/moneytracker/controller/external/ImportController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public List<Record> importRecordsFromCsv(@Nullable String csv) {
4545

4646
try {
4747
long time = Long.parseLong(timeCol);
48+
long accountId = Long.parseLong(accountIdCol);
4849
String title = titleCol.trim();
4950
String categoryName = categoryCol.trim();
5051
String notes = notesCol.trim();
@@ -59,7 +60,7 @@ public List<Record> importRecordsFromCsv(@Nullable String csv) {
5960
else type = Record.TYPE_INCOME;
6061

6162
Category category = new Category(categoryName);
62-
Account account = new Account(-1, "MOCK", -1, currency, 0, -1, false, 0);
63+
Account account = new Account(accountId, "MOCK", -1, currency, 0, -1, false, 0);
6364

6465
Record record = new Record(time, type, title, category, notes, Math.abs(price), account, currency);
6566
Record createdRecord = recordController.create(record);

app/src/main/res/values-fr/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
2. Copier son contenu dans le champ de saisie.\n
7171
3. Appuyer sur importer. Au bout de quelques secondes, le nombre d\'opérations importées est affiché.\n
7272
\n
73-
<b>Note :</b> date - horodatage en millisecondes ; devise - code devise à 3 lettres.\n
73+
<b>Note :</b> date - horodatage en millisecondes ;Le account_id par défaut est 1 et pour chaque nouveau compte, il augmente de 1;Assurez-vous que tous les comptes existent déjà; devise - code devise à 3 lettres.\n
7474
<b>Exemple :</b> 1466948795712;métro;transport;-20.0;EUR</string>
7575

7676
<string name="bank_sells">Banque achète</string>

app/src/main/res/values-pt-rBR/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
2. Copie o seu conteúdo para o campo de texto.\n
8383
3. Pressione o botão de importar. Em alguns segundos você verá quantos registros foram importados.\n
8484
\n
85-
<b>Nota:</b> hora - o valor deve ser em milissegundos; moeda - código de 3 símbolos da moeda.\n
85+
<b>Nota:</b> hora - o valor deve ser em milissegundos;Account_id padrão é 1 e para cada nova conta aumenta em 1; Verifique se todas as contas já existem; moeda - código de 3 símbolos da moeda.\n
8686
<b>Exemplo:</b> 1466948795712;metrô;transporte;-20.0;BRL</string>
8787

8888
<string name="slash" translatable="false">/</string>

app/src/main/res/values-ru/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
2. Скопируйте его контент в текстовое поле.\n
7575
3. Нажмите кнопку импорта. Через несколько секунд Вы увидите сколько записей было импортировано.\n
7676
\n
77-
<b>Важно:</b> время - метка времени в миллисекундах; валюта - 3-х символьный код валюты.\n
77+
<b>Важно:</b> время - метка времени в миллисекундах;По умолчанию account_id равен 1, и для каждой новой учетной записи он увеличивается на 1; Убедитесь, что все учетные записи уже существуют; валюта - 3-х символьный код валюты.\n
7878
<b>Пример:</b> 1466948795712;метро;транспорт;-20.0;UAH</string>
7979

8080
<string name="bank_sells">Банк продает</string>

app/src/main/res/values-uk/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
2. Скопіюйте його контент до текстового поля.\n
7575
3. Натисніть кнопку імпорту. Через дікілька секунд Ви побачите скільки записів було імпортовано.\n
7676
\n
77-
<b>Важливо:</b> час - мітка часу у мілісекундах; валюта - 3-х символьний код валюти.\n
77+
<b>Важливо:</b> час - мітка часу у мілісекундах;За замовчуванням account_id дорівнює 1 і для кожного нового облікового запису він збільшується на 1; Переконайтеся, що всі облікові записи вже існують; валюта - 3-х символьний код валюти.\n
7878
<b>Приклад:</b> 1466948795712;метро;транспорт;-20.0;UAH</string>
7979

8080
<string name="bank_sells">Банк продає</string>

app/src/main/res/values/strings.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@
7979
<string name="help">Help</string>
8080
<string name="import_help">To import records into application:\n
8181
1. Create CSV file in format - \n
82-
<b>time;title;category;price;currency.</b>\n
82+
<b>time;account_id;title;category;price;currency.</b>\n
8383
2. Copy its content to text field.\n
8484
3. Press import button. In few seconds you will see how much records has been imported.\n
8585
\n
86-
<b>Note:</b> time - timestamp value in milliseconds; currency - 3 symbols code of currency.\n
87-
<b>Example:</b> 1466948795712;metro;transport;-20.0;UAH</string>
86+
<b>Note:</b> time - timestamp value in milliseconds; Default account_id is 1 and for every new account it increases by 1; Make sure all the accounts already exists; currency - 3 symbols code of currency.\n
87+
<b>Example:</b> 1466948795712;1;metro;transport;-20.0;UAH</string>
8888

8989
<string name="slash" translatable="false">/</string>
9090
<string name="bank_sells">Bank sells</string>

0 commit comments

Comments
 (0)