mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-02 11:12:23 +02:00
settle button added
This commit is contained in:
parent
9d4873ed6e
commit
7ea7447db3
1 changed files with 12 additions and 10 deletions
|
@ -8,11 +8,11 @@ Basically, this blueprint takes care of the authentication and provides
|
||||||
some shortcuts to make your life better when coding (see `pull_project`
|
some shortcuts to make your life better when coding (see `pull_project`
|
||||||
and `add_project_id` for a quick overview)
|
and `add_project_id` for a quick overview)
|
||||||
"""
|
"""
|
||||||
|
import datetime
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from urllib.parse import urlparse, urlunparse
|
from urllib.parse import urlparse, urlunparse
|
||||||
import datetime
|
|
||||||
|
|
||||||
from flask import (
|
from flask import (
|
||||||
Blueprint,
|
Blueprint,
|
||||||
|
@ -810,6 +810,7 @@ def settle_bill():
|
||||||
bills = g.project.get_transactions_to_settle_bill()
|
bills = g.project.get_transactions_to_settle_bill()
|
||||||
return render_template("settle_bills.html", bills=bills, current_view="settle_bill")
|
return render_template("settle_bills.html", bills=bills, current_view="settle_bill")
|
||||||
|
|
||||||
|
|
||||||
@main.route("/<project_id>/settle/<amount>/<int:ower_id>/<int:payer_id>")
|
@main.route("/<project_id>/settle/<amount>/<int:ower_id>/<int:payer_id>")
|
||||||
def settle(amount, ower_id, payer_id):
|
def settle(amount, ower_id, payer_id):
|
||||||
# FIXME: Test this bill belongs to this project !
|
# FIXME: Test this bill belongs to this project !
|
||||||
|
@ -826,7 +827,7 @@ def settle(amount,ower_id,payer_id):
|
||||||
payer_id=ower_id,
|
payer_id=ower_id,
|
||||||
project_default_currency=g.project.default_currency,
|
project_default_currency=g.project.default_currency,
|
||||||
bill_type="Reimbursement",
|
bill_type="Reimbursement",
|
||||||
what="settlement"
|
what="settlement",
|
||||||
)
|
)
|
||||||
session.update()
|
session.update()
|
||||||
|
|
||||||
|
@ -837,6 +838,7 @@ def settle(amount,ower_id,payer_id):
|
||||||
# db.session.commit()
|
# db.session.commit()
|
||||||
return redirect(url_for(".settle_bill"))
|
return redirect(url_for(".settle_bill"))
|
||||||
|
|
||||||
|
|
||||||
@main.route("/<project_id>/history")
|
@main.route("/<project_id>/history")
|
||||||
def history():
|
def history():
|
||||||
"""Query for the version entries associated with this project."""
|
"""Query for the version entries associated with this project."""
|
||||||
|
|
Loading…
Reference in a new issue