")
api_api.add_resource(CategoriesResource, "/categories")
api_api.add_resource(SoldsResource, "/solds")
diff --git a/accountant/api/views/scheduled_operations.py b/accountant/api/views/scheduled_operations.py
index 28f3990..d8d8e44 100644
--- a/accountant/api/views/scheduled_operations.py
+++ b/accountant/api/views/scheduled_operations.py
@@ -80,11 +80,13 @@ class ScheduledOperationListResource(Resource):
"""
kwargs = parser.parse_args()
- scheduledOperation = ScheduledOperation(**kwargs)
+ scheduled_operation = ScheduledOperation(**kwargs)
- session.add(scheduledOperation)
+ session.add(scheduled_operation)
- return scheduledOperation, 201
+ scheduled_operation.reschedule(session)
+
+ return scheduled_operation, 201
class ScheduledOperationResource(Resource):
@@ -109,6 +111,9 @@ class ScheduledOperationResource(Resource):
"""
Delete a scheduled operation.
"""
+
+ raise NotImplementedError("Must be fixed.")
+
try:
scheduled_operation = ScheduledOperation.query(
session
@@ -148,6 +153,8 @@ class ScheduledOperationResource(Resource):
session.merge(scheduled_operation)
+ scheduled_operation.reschedule(session)
+
return scheduled_operation
diff --git a/accountant/frontend/static/js/entries.js b/accountant/frontend/static/js/entries.js
index 9f73eea..812c0de 100644
--- a/accountant/frontend/static/js/entries.js
+++ b/accountant/frontend/static/js/entries.js
@@ -396,7 +396,7 @@ accountantApp
// Returns true if the entry is a scheduled one.
$scope.isSaved = function(entry) {
- return entry.id !== null;
+ return entry.confirmed;
};
// Cancel current editing entry or clears field if a new one.
@@ -426,11 +426,19 @@ accountantApp
// Points an entry.
$scope.pointEntry = function(entry) {
+ entry.confirmed = true;
entry.pointed = !entry.pointed;
$scope.saveEntry(entry);
};
+ // Confirm an entry.
+ $scope.confirmEntry = function(entry) {
+ entry.confirmed = true;
+
+ $scope.saveEntry(entry);
+ };
+
// Create an new entry.
$scope.createEntry = function(entry) {
entry.account_id = $scope.account.id;
diff --git a/accountant/frontend/static/templates/entries.html b/accountant/frontend/static/templates/entries.html
index 6955b30..24ddcc3 100644
--- a/accountant/frontend/static/templates/entries.html
+++ b/accountant/frontend/static/templates/entries.html
@@ -171,7 +171,7 @@
-