Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
82481281
Commit
82481281
authored
Feb 10, 2016
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add invoice tracking model
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
5cf27c1b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
1 deletion
+66
-1
weblate/billing/admin.py
weblate/billing/admin.py
+14
-1
weblate/billing/migrations/0007_invoice.py
weblate/billing/migrations/0007_invoice.py
+29
-0
weblate/billing/models.py
weblate/billing/models.py
+23
-0
No files found.
weblate/billing/admin.py
View file @
82481281
...
...
@@ -22,7 +22,7 @@ from __future__ import unicode_literals
from
django.contrib
import
admin
from
django.utils.translation
import
ugettext_lazy
as
_
from
weblate.billing.models
import
Plan
,
Billing
from
weblate.billing.models
import
Plan
,
Billing
,
Invoice
class
PlanAdmin
(
admin
.
ModelAdmin
):
...
...
@@ -51,5 +51,18 @@ class BillingAdmin(admin.ModelAdmin):
list_projects
.
short_description
=
_
(
'Projects'
)
class
InvoiceAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'billing'
,
'start'
,
'end'
,
'payment'
,
'currency'
,
'ref'
)
list_filter
=
(
'currency'
,)
search_fields
=
(
'billing__user__username'
,
'billing__projects__name'
,
'ref'
,
'note'
,
)
date_hierarchy
=
'end'
admin
.
site
.
register
(
Plan
,
PlanAdmin
)
admin
.
site
.
register
(
Billing
,
BillingAdmin
)
admin
.
site
.
register
(
Invoice
,
InvoiceAdmin
)
weblate/billing/migrations/0007_invoice.py
0 → 100644
View file @
82481281
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-10 12:53
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'billing'
,
'0006_auto_20160106_1834'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Invoice'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'start'
,
models
.
DateField
()),
(
'end'
,
models
.
DateField
()),
(
'payment'
,
models
.
IntegerField
()),
(
'currency'
,
models
.
IntegerField
(
choices
=
[(
0
,
'EUR'
),
(
1
,
'BTC'
)],
default
=
1
)),
(
'ref'
,
models
.
CharField
(
blank
=
True
,
max_length
=
50
)),
(
'note'
,
models
.
TextField
(
blank
=
True
)),
(
'billing'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'billing.Billing'
)),
],
),
]
weblate/billing/models.py
View file @
82481281
...
...
@@ -127,3 +127,26 @@ class Billing(models.Model):
)
)
in_limits
.
boolean
=
True
@
python_2_unicode_compatible
class
Invoice
(
models
.
Model
):
CURRENCY_EUR
=
0
CURRENCY_BTC
=
1
billing
=
models
.
ForeignKey
(
Billing
)
start
=
models
.
DateField
()
end
=
models
.
DateField
()
payment
=
models
.
IntegerField
()
currency
=
models
.
IntegerField
(
choices
=
(
(
CURRENCY_EUR
,
'EUR'
),
(
CURRENCY_BTC
,
'BTC'
),
),
default
=
CURRENCY_BTC
)
ref
=
models
.
CharField
(
blank
=
True
,
max_length
=
50
)
note
=
models
.
TextField
(
blank
=
True
)
def
__str__
(
self
):
return
'{0} - {1}: {2}'
.
format
(
self
.
start
,
self
.
end
,
self
.
billing
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment