Show CSV data
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>de.tilman</groupId>
|
||||
<artifactId>next-transactions</artifactId>
|
||||
<version>1.4.0</version>
|
||||
<version>1.5.0</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@@ -392,6 +392,7 @@ transactionControllers.controller('ImportListCtrl', [ '$scope', '$resource', '$l
|
||||
$scope.processCSV = function () {
|
||||
$scope.account = ImportService.getAccount();
|
||||
$scope.categories = ImportService.getCategories();
|
||||
$scope.csvInput = ImportService.getCSV();
|
||||
$scope.csv = Papa.parse(ImportService.getCSV()).data;
|
||||
|
||||
var matcherData = $resource('/api/matchers/search/listForAccount', { projection: 'full', accountId: $scope.account.id }).get();
|
||||
@@ -464,9 +465,6 @@ transactionControllers.controller('ImportListCtrl', [ '$scope', '$resource', '$l
|
||||
$scope.importTransaction = function(line) {
|
||||
if (line.targetCategory) {
|
||||
|
||||
console.log(line[1]);
|
||||
console.log(line[1].substr(6,4) + "-" + line[1].substr(3,2) + "-" + line[1].substr(0,2));
|
||||
|
||||
var newTransaction = new Transaction({
|
||||
"account" : $scope.account._links.self.href,
|
||||
"amount" : line[4].replace(',', '.'),
|
||||
@@ -481,6 +479,15 @@ transactionControllers.controller('ImportListCtrl', [ '$scope', '$resource', '$l
|
||||
console.log(transaction);
|
||||
line.submittedTransactionLink = transaction._links.self.href;
|
||||
line.submittedTransactionId = transaction.id;
|
||||
|
||||
// delete from CSV
|
||||
var descriptionPos = $scope.csvInput.search(line[3]);
|
||||
var lineStart = $scope.csvInput.lastIndexOf('\n', descriptionPos);
|
||||
var lineEnd = $scope.csvInput.indexOf('\n', descriptionPos);
|
||||
if (lineEnd < 0)
|
||||
lineEnd = $scope.csvInput.length;
|
||||
$scope.csvInput = $scope.csvInput.substring(0, lineStart) + $scope.csvInput.substring(lineEnd, $scope.csvInput.length);
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,10 @@
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 4ex;">
|
||||
<div class="row" style="margin-top: 4ex; text-align: center;">
|
||||
<textarea ng-model='csvInput' name="csvText" cols="220" rows="30" style="font-family: monospace; font-size: 70%;" disabled></textarea>
|
||||
</div>
|
||||
<!-- div class="row" style="margin-top: 4ex;">
|
||||
<table class="importTable">
|
||||
<tr>
|
||||
<th style="width: 5%;">Position</th>
|
||||
@@ -66,5 +69,5 @@
|
||||
<td class="spacer"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div -->
|
||||
</div>
|
||||
@@ -7,7 +7,7 @@
|
||||
</div>
|
||||
|
||||
<form name="importForm" ng-submit="importCSV()" style="text-align: center;">
|
||||
<textarea ng-model='csvInput' name="csvText" cols="140" rows="20"></textarea>
|
||||
<textarea ng-model='csvInput' name="csvText" cols="220" rows="30" style="font-family: monospace; font-size: 70%;"></textarea>
|
||||
|
||||
<div style="margin: 2ex;">
|
||||
<button id="transactionSubmit" type="submit" class="btn btn-primary">
|
||||
@@ -18,3 +18,15 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- HERE BE DRAGONS
|
||||
SELECT FORMATDATETIME(t.date,'dd.MM.yyyy'), c.name, t.amount, t.description
|
||||
FROM Transaction t
|
||||
JOIN Category c on (t.category_id = c.id)
|
||||
WHERE t.account_id = 1 and t.date > parsedatetime('2016-06-01','yyyy-MM-dd')
|
||||
|
||||
"08.08.2016";"08.08.2016";"Übertrag/Überweisung";"Empfänger: Adam Kto/IBAN: DE485197745151542243216 BLZ/BIC: COBADEHD001 Buchungstext: none End-to-End-Ref.: nicht angegeben Ref. JK21619010302362/2";"-40,00";
|
||||
"27.07.2016";"27.07.2016";"Lastschrift/Belast.";"Auftraggeber: DANKE, IHR LIDL Kto/IBAN: DE61300500000008000119 Buchungstext: Kartenzahlung DANKE, IHR LIDL//Berlin/DE 2016-06-25T09:47:08 KFN 2 VJ 1912 Ref. 6GL16179AXXX0086/7787";"-70,17";
|
||||
"24.07.2016";"24.07.2016";"Übertrag/Überweisung";"Auftraggeber: Adam Buchungstext: Uebertrag comdirect bank End-to-End-Ref.: nicht angegeben Ref. IX216126F0211532/1";"200,00";
|
||||
"24.07.2016";"24.07.2016";"Übertrag/Überweisung";"Auftraggeber: Wohnungsbau-Verein Oberwaffeln eG Buchungstext: Mg.-Nr. 12345, Adam - 4, Dividende 2015 End-to-End-Ref.: nicht angegeben Ref. H2216176742235523/75535";"4,42";
|
||||
-->
|
||||
Reference in New Issue
Block a user