mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-01 10:42:24 +02:00
Bill types added in Bill and Project Model, Implemented in BillForm
This commit is contained in:
parent
9a8cc16a0b
commit
48d50f7249
10 changed files with 150 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
||||||
# Verbose and documented settings are in conf-templates/ihatemoney.cfg.j2
|
# Verbose and documented settings are in conf-templates/ihatemoney.cfg.j2
|
||||||
DEBUG = SQLACHEMY_ECHO = False
|
DEBUG = SQLACHEMY_ECHO = True
|
||||||
SQLALCHEMY_DATABASE_URI = "sqlite:////tmp/ihatemoney.db"
|
SQLALCHEMY_DATABASE_URI = "sqlite:////tmp/ihatemoney.db"
|
||||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||||
SECRET_KEY = "tralala"
|
SECRET_KEY = "tralala"
|
||||||
|
@ -9,7 +9,8 @@ ACTIVATE_DEMO_PROJECT = True
|
||||||
ADMIN_PASSWORD = ""
|
ADMIN_PASSWORD = ""
|
||||||
ALLOW_PUBLIC_PROJECT_CREATION = True
|
ALLOW_PUBLIC_PROJECT_CREATION = True
|
||||||
ACTIVATE_ADMIN_DASHBOARD = False
|
ACTIVATE_ADMIN_DASHBOARD = False
|
||||||
SESSION_COOKIE_SECURE = True
|
SESSION_COOKIE_SECURE = False
|
||||||
|
TEMPLATES_AUTO_RELOAD=True
|
||||||
SUPPORTED_LANGUAGES = [
|
SUPPORTED_LANGUAGES = [
|
||||||
"de",
|
"de",
|
||||||
"el",
|
"el",
|
||||||
|
|
|
@ -77,6 +77,7 @@ def get_billform_for(project, set_default=True, **kwargs):
|
||||||
|
|
||||||
active_members = [(m.id, m.name) for m in project.active_members]
|
active_members = [(m.id, m.name) for m in project.active_members]
|
||||||
|
|
||||||
|
form.bill_type.choices = project.bill_types
|
||||||
form.payed_for.choices = form.payer.choices = active_members
|
form.payed_for.choices = form.payer.choices = active_members
|
||||||
form.payed_for.default = [m.id for m in project.active_members]
|
form.payed_for.default = [m.id for m in project.active_members]
|
||||||
|
|
||||||
|
@ -336,7 +337,10 @@ class BillForm(FlaskForm):
|
||||||
description=_("A link to an external document, related to this bill"),
|
description=_("A link to an external document, related to this bill"),
|
||||||
)
|
)
|
||||||
payed_for = SelectMultipleField(
|
payed_for = SelectMultipleField(
|
||||||
_("For whom?"), validators=[DataRequired()], coerce=int
|
_("For Who?"), validators=[DataRequired()], coerce=int
|
||||||
|
)
|
||||||
|
bill_type = SelectField(
|
||||||
|
_("Bill Type"), validators=[DataRequired()], coerce=str
|
||||||
)
|
)
|
||||||
submit = SubmitField(_("Submit"))
|
submit = SubmitField(_("Submit"))
|
||||||
submit2 = SubmitField(_("Submit and add a new one"))
|
submit2 = SubmitField(_("Submit and add a new one"))
|
||||||
|
@ -351,12 +355,14 @@ class BillForm(FlaskForm):
|
||||||
payer_id=self.payer.data,
|
payer_id=self.payer.data,
|
||||||
project_default_currency=project.default_currency,
|
project_default_currency=project.default_currency,
|
||||||
what=self.what.data,
|
what=self.what.data,
|
||||||
|
bill_type=self.bill_type.data
|
||||||
)
|
)
|
||||||
|
|
||||||
def save(self, bill, project):
|
def save(self, bill, project):
|
||||||
bill.payer_id = self.payer.data
|
bill.payer_id = self.payer.data
|
||||||
bill.amount = self.amount.data
|
bill.amount = self.amount.data
|
||||||
bill.what = self.what.data
|
bill.what = self.what.data
|
||||||
|
bill.bill_type = self.bill_type.data
|
||||||
bill.external_link = self.external_link.data
|
bill.external_link = self.external_link.data
|
||||||
bill.date = self.date.data
|
bill.date = self.date.data
|
||||||
bill.owers = Person.query.get_by_ids(self.payed_for.data, project)
|
bill.owers = Person.query.get_by_ids(self.payed_for.data, project)
|
||||||
|
@ -370,6 +376,7 @@ class BillForm(FlaskForm):
|
||||||
self.payer.data = bill.payer_id
|
self.payer.data = bill.payer_id
|
||||||
self.amount.data = bill.amount
|
self.amount.data = bill.amount
|
||||||
self.what.data = bill.what
|
self.what.data = bill.what
|
||||||
|
self.bill_type.data = bill.bill_type
|
||||||
self.external_link.data = bill.external_link
|
self.external_link.data = bill.external_link
|
||||||
self.original_currency.data = bill.original_currency
|
self.original_currency.data = bill.original_currency
|
||||||
self.date.data = bill.date
|
self.date.data = bill.date
|
||||||
|
@ -393,6 +400,10 @@ class BillForm(FlaskForm):
|
||||||
# See https://github.com/python-babel/babel/issues/821
|
# See https://github.com/python-babel/babel/issues/821
|
||||||
raise ValidationError(f"Result is too high: {field.data}")
|
raise ValidationError(f"Result is too high: {field.data}")
|
||||||
|
|
||||||
|
def validate_bill_type(self, field):
|
||||||
|
if (field.data, field.data) not in Project.bill_types:
|
||||||
|
raise ValidationError(_("Invalid Bill Type"))
|
||||||
|
|
||||||
|
|
||||||
class MemberForm(FlaskForm):
|
class MemberForm(FlaskForm):
|
||||||
name = StringField(_("Name"), validators=[DataRequired()], filters=[strip_filter])
|
name = StringField(_("Name"), validators=[DataRequired()], filters=[strip_filter])
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
"""add bill type into bill_version
|
||||||
|
|
||||||
|
Revision ID: 3263a8f198b0
|
||||||
|
Revises: 7a9b38559992
|
||||||
|
Create Date: 2022-12-10 20:00:48.611280
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '3263a8f198b0'
|
||||||
|
down_revision = '7a9b38559992'
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.add_column('bill_version', sa.Column('bill_type', sa.UnicodeText(), autoincrement=False, nullable=True))
|
||||||
|
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
pass
|
||||||
|
# ### end Alembic commands ###
|
|
@ -0,0 +1,23 @@
|
||||||
|
"""new bill type attribute added
|
||||||
|
|
||||||
|
Revision ID: 7a9b38559992
|
||||||
|
Revises: 927ed575acbd
|
||||||
|
Create Date: 2022-12-10 17:25:38.387643
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '7a9b38559992'
|
||||||
|
down_revision = '927ed575acbd'
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
op.add_column("bill", sa.Column("bill_type", sa.UnicodeText()))
|
||||||
|
op.add_column("bill_version", sa.Column("bill_type", sa.UnicodeText()))
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
pass
|
|
@ -74,7 +74,7 @@ class Project(db.Model):
|
||||||
|
|
||||||
query_class = ProjectQuery
|
query_class = ProjectQuery
|
||||||
default_currency = db.Column(db.String(3))
|
default_currency = db.Column(db.String(3))
|
||||||
|
bill_types = [("Expense","Expense"), ("Reimbursment","Reimbursment"), ("Refund","Refund"), ("Transfer","Transfer"), ("Payment","Payment")]
|
||||||
@property
|
@property
|
||||||
def _to_serialize(self):
|
def _to_serialize(self):
|
||||||
obj = {
|
obj = {
|
||||||
|
@ -673,6 +673,7 @@ class Bill(db.Model):
|
||||||
date = db.Column(db.Date, default=datetime.datetime.now)
|
date = db.Column(db.Date, default=datetime.datetime.now)
|
||||||
creation_date = db.Column(db.Date, default=datetime.datetime.now)
|
creation_date = db.Column(db.Date, default=datetime.datetime.now)
|
||||||
what = db.Column(db.UnicodeText)
|
what = db.Column(db.UnicodeText)
|
||||||
|
bill_type = db.Column(db.UnicodeText)
|
||||||
external_link = db.Column(db.UnicodeText)
|
external_link = db.Column(db.UnicodeText)
|
||||||
|
|
||||||
original_currency = db.Column(db.String(3))
|
original_currency = db.Column(db.String(3))
|
||||||
|
@ -692,6 +693,7 @@ class Bill(db.Model):
|
||||||
payer_id: int = None,
|
payer_id: int = None,
|
||||||
project_default_currency: str = "",
|
project_default_currency: str = "",
|
||||||
what: str = "",
|
what: str = "",
|
||||||
|
bill_type: str = "",
|
||||||
):
|
):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.amount = amount
|
self.amount = amount
|
||||||
|
@ -701,6 +703,7 @@ class Bill(db.Model):
|
||||||
self.owers = owers
|
self.owers = owers
|
||||||
self.payer_id = payer_id
|
self.payer_id = payer_id
|
||||||
self.what = what
|
self.what = what
|
||||||
|
self.bill_type = bill_type
|
||||||
self.converted_amount = self.currency_helper.exchange_currency(
|
self.converted_amount = self.currency_helper.exchange_currency(
|
||||||
self.amount, self.original_currency, project_default_currency
|
self.amount, self.original_currency, project_default_currency
|
||||||
)
|
)
|
||||||
|
@ -715,6 +718,7 @@ class Bill(db.Model):
|
||||||
"date": self.date,
|
"date": self.date,
|
||||||
"creation_date": self.creation_date,
|
"creation_date": self.creation_date,
|
||||||
"what": self.what,
|
"what": self.what,
|
||||||
|
"bill_type": self.bill_type,
|
||||||
"external_link": self.external_link,
|
"external_link": self.external_link,
|
||||||
"original_currency": self.original_currency,
|
"original_currency": self.original_currency,
|
||||||
"converted_amount": self.converted_amount,
|
"converted_amount": self.converted_amount,
|
||||||
|
|
|
@ -164,6 +164,7 @@
|
||||||
{% include "display_errors.html" %}
|
{% include "display_errors.html" %}
|
||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
{{ input(form.date, inline=True) }}
|
{{ input(form.date, inline=True) }}
|
||||||
|
{{ input(form.bill_type, inline=True) }}
|
||||||
{{ input(form.what, inline=True) }}
|
{{ input(form.what, inline=True) }}
|
||||||
{{ input(form.payer, inline=True, class="form-control custom-select") }}
|
{{ input(form.payer, inline=True, class="form-control custom-select") }}
|
||||||
<div data-toggle="tooltip" data-placement="top" title='{{ _("Simple operations are allowed, e.g. (18+36.2)/3") }}'>
|
<div data-toggle="tooltip" data-placement="top" title='{{ _("Simple operations are allowed, e.g. (18+36.2)/3") }}'>
|
||||||
|
|
|
@ -363,6 +363,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage",
|
"what": "fromage",
|
||||||
"payer": "1",
|
"payer": "1",
|
||||||
"payed_for": ["1", "2"],
|
"payed_for": ["1", "2"],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "25",
|
"amount": "25",
|
||||||
"external_link": "https://raclette.fr",
|
"external_link": "https://raclette.fr",
|
||||||
},
|
},
|
||||||
|
@ -387,6 +388,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
{"activated": True, "id": 1, "name": "zorglub", "weight": 1},
|
{"activated": True, "id": 1, "name": "zorglub", "weight": 1},
|
||||||
{"activated": True, "id": 2, "name": "fred", "weight": 1},
|
{"activated": True, "id": 2, "name": "fred", "weight": 1},
|
||||||
],
|
],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": 25.0,
|
"amount": 25.0,
|
||||||
"date": "2011-08-10",
|
"date": "2011-08-10",
|
||||||
"id": 1,
|
"id": 1,
|
||||||
|
@ -418,6 +420,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage",
|
"what": "fromage",
|
||||||
"payer": "1",
|
"payer": "1",
|
||||||
"payed_for": ["1", "2"],
|
"payed_for": ["1", "2"],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "25",
|
"amount": "25",
|
||||||
"external_link": "https://raclette.fr",
|
"external_link": "https://raclette.fr",
|
||||||
},
|
},
|
||||||
|
@ -437,6 +440,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
"what": "beer",
|
"what": "beer",
|
||||||
"payer": "2",
|
"payer": "2",
|
||||||
"payed_for": ["1", "2"],
|
"payed_for": ["1", "2"],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "25",
|
"amount": "25",
|
||||||
"external_link": "https://raclette.fr",
|
"external_link": "https://raclette.fr",
|
||||||
},
|
},
|
||||||
|
@ -458,6 +462,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
{"activated": True, "id": 1, "name": "zorglub", "weight": 1},
|
{"activated": True, "id": 1, "name": "zorglub", "weight": 1},
|
||||||
{"activated": True, "id": 2, "name": "fred", "weight": 1},
|
{"activated": True, "id": 2, "name": "fred", "weight": 1},
|
||||||
],
|
],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": 25.0,
|
"amount": 25.0,
|
||||||
"date": "2011-09-10",
|
"date": "2011-09-10",
|
||||||
"external_link": "https://raclette.fr",
|
"external_link": "https://raclette.fr",
|
||||||
|
@ -512,6 +517,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage",
|
"what": "fromage",
|
||||||
"payer": "1",
|
"payer": "1",
|
||||||
"payed_for": ["1", "2"],
|
"payed_for": ["1", "2"],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": input_amount,
|
"amount": input_amount,
|
||||||
},
|
},
|
||||||
headers=self.get_auth("raclette"),
|
headers=self.get_auth("raclette"),
|
||||||
|
@ -536,6 +542,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
{"activated": True, "id": 1, "name": "zorglub", "weight": 1},
|
{"activated": True, "id": 1, "name": "zorglub", "weight": 1},
|
||||||
{"activated": True, "id": 2, "name": "fred", "weight": 1},
|
{"activated": True, "id": 2, "name": "fred", "weight": 1},
|
||||||
],
|
],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": expected_amount,
|
"amount": expected_amount,
|
||||||
"date": "2011-08-10",
|
"date": "2011-08-10",
|
||||||
"id": id,
|
"id": id,
|
||||||
|
@ -569,6 +576,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage",
|
"what": "fromage",
|
||||||
"payer": "1",
|
"payer": "1",
|
||||||
"payed_for": ["1", "2"],
|
"payed_for": ["1", "2"],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": amount,
|
"amount": amount,
|
||||||
},
|
},
|
||||||
headers=self.get_auth("raclette"),
|
headers=self.get_auth("raclette"),
|
||||||
|
@ -615,6 +623,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage",
|
"what": "fromage",
|
||||||
"payer": "1",
|
"payer": "1",
|
||||||
"payed_for": ["1", "2"],
|
"payed_for": ["1", "2"],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "25",
|
"amount": "25",
|
||||||
"external_link": "https://raclette.fr",
|
"external_link": "https://raclette.fr",
|
||||||
},
|
},
|
||||||
|
@ -639,6 +648,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
{"activated": True, "id": 1, "name": "zorglub", "weight": 1},
|
{"activated": True, "id": 1, "name": "zorglub", "weight": 1},
|
||||||
{"activated": True, "id": 2, "name": "fred", "weight": 1},
|
{"activated": True, "id": 2, "name": "fred", "weight": 1},
|
||||||
],
|
],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": 25.0,
|
"amount": 25.0,
|
||||||
"date": "2011-08-10",
|
"date": "2011-08-10",
|
||||||
"id": 1,
|
"id": 1,
|
||||||
|
@ -663,6 +673,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage",
|
"what": "fromage",
|
||||||
"payer": "1",
|
"payer": "1",
|
||||||
"payed_for": ["1", "2"],
|
"payed_for": ["1", "2"],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "30",
|
"amount": "30",
|
||||||
"external_link": "https://raclette.fr",
|
"external_link": "https://raclette.fr",
|
||||||
"original_currency": "CAD",
|
"original_currency": "CAD",
|
||||||
|
@ -684,6 +695,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
{"activated": True, "id": 1, "name": "zorglub", "weight": 1.0},
|
{"activated": True, "id": 1, "name": "zorglub", "weight": 1.0},
|
||||||
{"activated": True, "id": 2, "name": "fred", "weight": 1.0},
|
{"activated": True, "id": 2, "name": "fred", "weight": 1.0},
|
||||||
],
|
],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": 30.0,
|
"amount": 30.0,
|
||||||
"date": "2011-08-10",
|
"date": "2011-08-10",
|
||||||
"id": 1,
|
"id": 1,
|
||||||
|
@ -704,6 +716,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
"what": "Pierogi",
|
"what": "Pierogi",
|
||||||
"payer": "1",
|
"payer": "1",
|
||||||
"payed_for": ["2", "3"],
|
"payed_for": ["2", "3"],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "80",
|
"amount": "80",
|
||||||
"original_currency": "PLN",
|
"original_currency": "PLN",
|
||||||
},
|
},
|
||||||
|
@ -747,6 +760,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage",
|
"what": "fromage",
|
||||||
"payer": "1",
|
"payer": "1",
|
||||||
"payed_for": ["1", "2"],
|
"payed_for": ["1", "2"],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "25",
|
"amount": "25",
|
||||||
},
|
},
|
||||||
headers=self.get_auth("raclette"),
|
headers=self.get_auth("raclette"),
|
||||||
|
@ -814,6 +828,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage",
|
"what": "fromage",
|
||||||
"payer": "1",
|
"payer": "1",
|
||||||
"payed_for": ["1", "2"],
|
"payed_for": ["1", "2"],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "25",
|
"amount": "25",
|
||||||
},
|
},
|
||||||
headers=self.get_auth("raclette"),
|
headers=self.get_auth("raclette"),
|
||||||
|
@ -836,6 +851,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
{"activated": True, "id": 1, "name": "zorglub", "weight": 1},
|
{"activated": True, "id": 1, "name": "zorglub", "weight": 1},
|
||||||
{"activated": True, "id": 2, "name": "freddy familly", "weight": 4},
|
{"activated": True, "id": 2, "name": "freddy familly", "weight": 4},
|
||||||
],
|
],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": 25.0,
|
"amount": 25.0,
|
||||||
"date": "2011-08-10",
|
"date": "2011-08-10",
|
||||||
"id": 1,
|
"id": 1,
|
||||||
|
@ -923,6 +939,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage",
|
"what": "fromage",
|
||||||
"payer": "1",
|
"payer": "1",
|
||||||
"payed_for": ["1"],
|
"payed_for": ["1"],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "0",
|
"amount": "0",
|
||||||
},
|
},
|
||||||
headers=self.get_auth("raclette"),
|
headers=self.get_auth("raclette"),
|
||||||
|
@ -951,6 +968,7 @@ class APITestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage",
|
"what": "fromage",
|
||||||
"payer": "1",
|
"payer": "1",
|
||||||
"payed_for": ["1"],
|
"payed_for": ["1"],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "9347242149381274732472348728748723473278472843.12",
|
"amount": "9347242149381274732472348728748723473278472843.12",
|
||||||
},
|
},
|
||||||
headers=self.get_auth("raclette"),
|
headers=self.get_auth("raclette"),
|
||||||
|
|
|
@ -411,6 +411,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": fred_id,
|
"payer": fred_id,
|
||||||
"payed_for": [fred_id],
|
"payed_for": [fred_id],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "25",
|
"amount": "25",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -462,6 +463,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": zorglub.id,
|
"payer": zorglub.id,
|
||||||
"payed_for": [zorglub.id],
|
"payed_for": [zorglub.id],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "25",
|
"amount": "25",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -635,6 +637,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": members_ids[0],
|
"payer": members_ids[0],
|
||||||
"payed_for": members_ids,
|
"payed_for": members_ids,
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "25",
|
"amount": "25",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -650,6 +653,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": members_ids[0],
|
"payer": members_ids[0],
|
||||||
"payed_for": members_ids,
|
"payed_for": members_ids,
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10",
|
"amount": "10",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -673,6 +677,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": members_ids[0],
|
"payer": members_ids[0],
|
||||||
"payed_for": members_ids,
|
"payed_for": members_ids,
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "19",
|
"amount": "19",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -684,6 +689,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": members_ids[1],
|
"payer": members_ids[1],
|
||||||
"payed_for": members_ids[0],
|
"payed_for": members_ids[0],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "20",
|
"amount": "20",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -695,6 +701,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": members_ids[1],
|
"payer": members_ids[1],
|
||||||
"payed_for": members_ids,
|
"payed_for": members_ids,
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "17",
|
"amount": "17",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -710,6 +717,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": members_ids[0],
|
"payer": members_ids[0],
|
||||||
"payed_for": members_ids,
|
"payed_for": members_ids,
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "-25",
|
"amount": "-25",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -724,6 +732,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": members_ids[0],
|
"payer": members_ids[0],
|
||||||
"payed_for": members_ids,
|
"payed_for": members_ids,
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "25,02",
|
"amount": "25,02",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -738,6 +747,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": members_ids[0],
|
"payer": members_ids[0],
|
||||||
"payed_for": members_ids,
|
"payed_for": members_ids,
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "42",
|
"amount": "42",
|
||||||
"external_link": "https://example.com/fromage",
|
"external_link": "https://example.com/fromage",
|
||||||
},
|
},
|
||||||
|
@ -753,6 +763,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "mauvais fromage à raclette",
|
"what": "mauvais fromage à raclette",
|
||||||
"payer": members_ids[0],
|
"payer": members_ids[0],
|
||||||
"payed_for": members_ids,
|
"payed_for": members_ids,
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "42000",
|
"amount": "42000",
|
||||||
"external_link": "javascript:alert('Tu bluffes, Martoni.')",
|
"external_link": "javascript:alert('Tu bluffes, Martoni.')",
|
||||||
},
|
},
|
||||||
|
@ -778,6 +789,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": members_ids[0],
|
"payer": members_ids[0],
|
||||||
"payed_for": members_ids,
|
"payed_for": members_ids,
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10",
|
"amount": "10",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -789,6 +801,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "pommes de terre",
|
"what": "pommes de terre",
|
||||||
"payer": members_ids[1],
|
"payer": members_ids[1],
|
||||||
"payed_for": members_ids,
|
"payed_for": members_ids,
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10",
|
"amount": "10",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -853,6 +866,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2, 3],
|
"payed_for": [1, 2, 3],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "24.36",
|
"amount": "24.36",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -864,6 +878,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "red wine",
|
"what": "red wine",
|
||||||
"payer": 2,
|
"payer": 2,
|
||||||
"payed_for": [1],
|
"payed_for": [1],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "19.12",
|
"amount": "19.12",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -875,6 +890,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "delicatessen",
|
"what": "delicatessen",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "22",
|
"amount": "22",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -977,6 +993,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2, 3],
|
"payed_for": [1, 2, 3],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10.0",
|
"amount": "10.0",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -988,6 +1005,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "red wine",
|
"what": "red wine",
|
||||||
"payer": 2,
|
"payer": 2,
|
||||||
"payed_for": [1],
|
"payed_for": [1],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "20",
|
"amount": "20",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -999,6 +1017,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "delicatessen",
|
"what": "delicatessen",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10",
|
"amount": "10",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -1047,6 +1066,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": 2,
|
"payer": 2,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "30",
|
"amount": "30",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -1072,6 +1092,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "ice cream",
|
"what": "ice cream",
|
||||||
"payer": 2,
|
"payer": 2,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10",
|
"amount": "10",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -1087,6 +1108,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "champomy",
|
"what": "champomy",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10",
|
"amount": "10",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -1102,6 +1124,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "smoothie",
|
"what": "smoothie",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "20",
|
"amount": "20",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -1118,6 +1141,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "more champomy",
|
"what": "more champomy",
|
||||||
"payer": 2,
|
"payer": 2,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "30",
|
"amount": "30",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -1150,6 +1174,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2, 3],
|
"payed_for": [1, 2, 3],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10.0",
|
"amount": "10.0",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -1161,6 +1186,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "red wine",
|
"what": "red wine",
|
||||||
"payer": 2,
|
"payer": 2,
|
||||||
"payed_for": [1],
|
"payed_for": [1],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "20",
|
"amount": "20",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -1172,6 +1198,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "delicatessen",
|
"what": "delicatessen",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10",
|
"amount": "10",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -1180,8 +1207,8 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
members = defaultdict(int)
|
members = defaultdict(int)
|
||||||
# We should have the same values between transactions and project balances
|
# We should have the same values between transactions and project balances
|
||||||
for t in transactions:
|
for t in transactions:
|
||||||
members[t["ower"]] -= t["amount"]
|
members[t["ower"]] -= t["bill_type":"Expense", "amount"]
|
||||||
members[t["receiver"]] += t["amount"]
|
members[t["receiver"]] += t["bill_type":"Expense", "amount"]
|
||||||
balance = self.get_project("raclette").balance
|
balance = self.get_project("raclette").balance
|
||||||
for m, a in members.items():
|
for m, a in members.items():
|
||||||
assert abs(a - balance[m.id]) < 0.01
|
assert abs(a - balance[m.id]) < 0.01
|
||||||
|
@ -1203,6 +1230,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2, 3],
|
"payed_for": [1, 2, 3],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10.0",
|
"amount": "10.0",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -1214,6 +1242,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "red wine",
|
"what": "red wine",
|
||||||
"payer": 2,
|
"payer": 2,
|
||||||
"payed_for": [1, 3],
|
"payed_for": [1, 3],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "20",
|
"amount": "20",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -1225,6 +1254,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "refund",
|
"what": "refund",
|
||||||
"payer": 3,
|
"payer": 3,
|
||||||
"payed_for": [2],
|
"payed_for": [2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "13.33",
|
"amount": "13.33",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -1233,7 +1263,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
|
|
||||||
# There should not be any zero-amount transfer after rounding
|
# There should not be any zero-amount transfer after rounding
|
||||||
for t in transactions:
|
for t in transactions:
|
||||||
rounded_amount = round(t["amount"], 2)
|
rounded_amount = round(t["bill_type":"Expense", "amount"], 2)
|
||||||
self.assertNotEqual(
|
self.assertNotEqual(
|
||||||
0.0,
|
0.0,
|
||||||
rounded_amount,
|
rounded_amount,
|
||||||
|
@ -1259,6 +1289,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2, 3, 4],
|
"payed_for": [1, 2, 3, 4],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10.0",
|
"amount": "10.0",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -1277,6 +1308,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "roblochon",
|
"what": "roblochon",
|
||||||
"payer": 2,
|
"payer": 2,
|
||||||
"payed_for": [1, 3, 4],
|
"payed_for": [1, 3, 4],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "100.0",
|
"amount": "100.0",
|
||||||
}
|
}
|
||||||
# Try to access bill of another project
|
# Try to access bill of another project
|
||||||
|
@ -1382,6 +1414,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2, 3],
|
"payed_for": [1, 2, 3],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10.0",
|
"amount": "10.0",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -1393,6 +1426,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "red wine",
|
"what": "red wine",
|
||||||
"payer": 2,
|
"payer": 2,
|
||||||
"payed_for": [1, 3],
|
"payed_for": [1, 3],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "20",
|
"amount": "20",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -1404,6 +1438,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "refund",
|
"what": "refund",
|
||||||
"payer": 3,
|
"payer": 3,
|
||||||
"payed_for": [2],
|
"payed_for": [2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "13.33",
|
"amount": "13.33",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -1429,6 +1464,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "refund from EUR",
|
"what": "refund from EUR",
|
||||||
"payer": 3,
|
"payer": 3,
|
||||||
"payed_for": [2],
|
"payed_for": [2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "20",
|
"amount": "20",
|
||||||
"original_currency": "EUR",
|
"original_currency": "EUR",
|
||||||
},
|
},
|
||||||
|
@ -1452,6 +1488,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "Poutine",
|
"what": "Poutine",
|
||||||
"payer": 3,
|
"payer": 3,
|
||||||
"payed_for": [2],
|
"payed_for": [2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "18",
|
"amount": "18",
|
||||||
"original_currency": "CAD",
|
"original_currency": "CAD",
|
||||||
},
|
},
|
||||||
|
@ -1508,6 +1545,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10.0",
|
"amount": "10.0",
|
||||||
"original_currency": "EUR",
|
"original_currency": "EUR",
|
||||||
},
|
},
|
||||||
|
@ -1542,6 +1580,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10.0",
|
"amount": "10.0",
|
||||||
"original_currency": "EUR",
|
"original_currency": "EUR",
|
||||||
},
|
},
|
||||||
|
@ -1554,6 +1593,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "aspirine",
|
"what": "aspirine",
|
||||||
"payer": 2,
|
"payer": 2,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "5.0",
|
"amount": "5.0",
|
||||||
"original_currency": "EUR",
|
"original_currency": "EUR",
|
||||||
},
|
},
|
||||||
|
@ -1587,6 +1627,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1],
|
"payed_for": [1],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "0",
|
"amount": "0",
|
||||||
"original_currency": "EUR",
|
"original_currency": "EUR",
|
||||||
},
|
},
|
||||||
|
@ -1635,6 +1676,7 @@ class BudgetTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1],
|
"payed_for": [1],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "9347242149381274732472348728748723473278472843.12",
|
"amount": "9347242149381274732472348728748723473278472843.12",
|
||||||
"original_currency": "EUR",
|
"original_currency": "EUR",
|
||||||
},
|
},
|
||||||
|
|
|
@ -200,6 +200,7 @@ class HistoryTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": user_id,
|
"payer": user_id,
|
||||||
"payed_for": [user_id],
|
"payed_for": [user_id],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "25",
|
"amount": "25",
|
||||||
},
|
},
|
||||||
follow_redirects=True,
|
follow_redirects=True,
|
||||||
|
@ -216,6 +217,7 @@ class HistoryTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": user_id,
|
"payer": user_id,
|
||||||
"payed_for": [user_id],
|
"payed_for": [user_id],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10",
|
"amount": "10",
|
||||||
},
|
},
|
||||||
follow_redirects=True,
|
follow_redirects=True,
|
||||||
|
@ -367,6 +369,7 @@ class HistoryTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1],
|
"payed_for": [1],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "25",
|
"amount": "25",
|
||||||
},
|
},
|
||||||
follow_redirects=True,
|
follow_redirects=True,
|
||||||
|
@ -388,6 +391,7 @@ class HistoryTestCase(IhatemoneyTestCase):
|
||||||
"what": "new thing",
|
"what": "new thing",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1],
|
"payed_for": [1],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10",
|
"amount": "10",
|
||||||
},
|
},
|
||||||
follow_redirects=True,
|
follow_redirects=True,
|
||||||
|
@ -486,6 +490,7 @@ class HistoryTestCase(IhatemoneyTestCase):
|
||||||
"what": "Bill 1",
|
"what": "Bill 1",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "25",
|
"amount": "25",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -496,6 +501,7 @@ class HistoryTestCase(IhatemoneyTestCase):
|
||||||
"what": "Bill 2",
|
"what": "Bill 2",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "20",
|
"amount": "20",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -514,6 +520,7 @@ class HistoryTestCase(IhatemoneyTestCase):
|
||||||
"what": "Bill 1",
|
"what": "Bill 1",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "88",
|
"amount": "88",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -555,6 +562,7 @@ class HistoryTestCase(IhatemoneyTestCase):
|
||||||
"what": "Bill 1",
|
"what": "Bill 1",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "25",
|
"amount": "25",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -579,6 +587,7 @@ class HistoryTestCase(IhatemoneyTestCase):
|
||||||
"what": "Bill 2",
|
"what": "Bill 2",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "20",
|
"amount": "20",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -641,6 +650,7 @@ class HistoryTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1],
|
"payed_for": [1],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10",
|
"amount": "10",
|
||||||
"original_currency": "EUR",
|
"original_currency": "EUR",
|
||||||
},
|
},
|
||||||
|
|
|
@ -127,6 +127,7 @@ class ModelsTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2, 3],
|
"payed_for": [1, 2, 3],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10.0",
|
"amount": "10.0",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -138,6 +139,7 @@ class ModelsTestCase(IhatemoneyTestCase):
|
||||||
"what": "red wine",
|
"what": "red wine",
|
||||||
"payer": 2,
|
"payer": 2,
|
||||||
"payed_for": [1],
|
"payed_for": [1],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "20",
|
"amount": "20",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -149,6 +151,7 @@ class ModelsTestCase(IhatemoneyTestCase):
|
||||||
"what": "delicatessen",
|
"what": "delicatessen",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10",
|
"amount": "10",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -183,6 +186,7 @@ class ModelsTestCase(IhatemoneyTestCase):
|
||||||
"what": "fromage à raclette",
|
"what": "fromage à raclette",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2, 3],
|
"payed_for": [1, 2, 3],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10.0",
|
"amount": "10.0",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -194,6 +198,7 @@ class ModelsTestCase(IhatemoneyTestCase):
|
||||||
"what": "red wine",
|
"what": "red wine",
|
||||||
"payer": 2,
|
"payer": 2,
|
||||||
"payed_for": [1],
|
"payed_for": [1],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "20",
|
"amount": "20",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -205,6 +210,7 @@ class ModelsTestCase(IhatemoneyTestCase):
|
||||||
"what": "delicatessen",
|
"what": "delicatessen",
|
||||||
"payer": 1,
|
"payer": 1,
|
||||||
"payed_for": [1, 2],
|
"payed_for": [1, 2],
|
||||||
|
"bill_type": "Expense",
|
||||||
"amount": "10",
|
"amount": "10",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue