This commit is contained in:
2016-07-18 16:20:26 +02:00
parent 3aa1966f8b
commit 0247db6b12
22 changed files with 10088 additions and 40 deletions
+22 -15
View File
@@ -146,21 +146,28 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location'
});
}
$scope.postTransaction = function() {
var newTransaction = new Transaction({
"account" : $scope.account._links.self.href,
"amount" : amountToNumber($scope.transaction.amount),
"date" : $scope.transaction.date,
"description" : $scope.transaction.description,
"category" : $scope.transaction.category._links.self.href,
"creditor" : $scope.transaction.creditor
});
newTransaction.$save(function(transaction) {
$scope.refreshList();
$scope.lastSubmission = newTransaction;
});
};
$scope.submitTransaction = function() {
if (document.getElementById('amountInput').value) {
document.getElementById('transactionSubmit').disabled = true;
$scope.waitingForSubmission = true;
var newTransaction = new Transaction({
"account" : $scope.account._links.self.href,
"amount" : amountToNumber($scope.transaction.amount),
"date" : $scope.transaction.date,
"description" : $scope.transaction.description,
"category" : $scope.transaction.category._links.self.href,
"creditor" : $scope.transaction.creditor
});
newTransaction.$save(function(transaction) {
document.getElementById('transactionSubmit').disabled = false;
$scope.waitingForSubmission = false;
$scope.refreshList();
$scope.lastSubmission = newTransaction;
});
}
}
$scope.deleteLastSubmission = function() {
var testTrns = $resource($scope.lastSubmission._links.self.href).delete(function() {