Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Djangoldp Invoice
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Startin blox
djangoldp-packages
Djangoldp Invoice
Commits
7adefac3
Commit
7adefac3
authored
Jan 17, 2019
by
Claire Zuliani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature: add djangoldp_project to module
#3
parent
6d2472bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
4 deletions
+33
-4
migrations/0004_auto_20190117_0215.py
migrations/0004_auto_20190117_0215.py
+27
-0
models.py
models.py
+4
-2
urls.py
urls.py
+2
-2
No files found.
migrations/0004_auto_20190117_0215.py
0 → 100644
View file @
7adefac3
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-01-17 02:15
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'djangoldp_project'
,
'0002_move_jabber'
),
(
'djangoldp_invoices'
,
'0003_auto_20190114_1630'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'clientinvoice'
,
name
=
'customer'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
to
=
'djangoldp_project.Customer'
),
),
migrations
.
AddField
(
model_name
=
'clientinvoice'
,
name
=
'project'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
DO_NOTHING
,
to
=
'djangoldp_project.Project'
),
),
]
models.py
View file @
7adefac3
# -*- coding: utf-8 -*-
from
django.conf
import
settings
from
django.db
import
models
from
djangoldp_project.models
import
Customer
from
djangoldp_project.models
import
Project
from
django.db.models
import
Sum
import
datetime
from
decimal
import
Decimal
...
...
@@ -40,8 +42,8 @@ class FreelanceInvoice(models.Model):
class
ClientInvoice
(
models
.
Model
):
# customer = models.ForeignKey('xxx.Client', on_delete=models.CASCADE
)
# project = models.ForeignKey('xxx.Project', on_delete=models.CASCADE
)
customer
=
models
.
ForeignKey
(
Customer
,
on_delete
=
models
.
DO_NOTHING
,
null
=
True
)
project
=
models
.
ForeignKey
(
Project
,
on_delete
=
models
.
DO_NOTHING
,
null
=
True
)
STATES
=
(
(
'pending'
,
'en attente'
),
(
'paid'
,
'réglée'
)
...
...
urls.py
View file @
7adefac3
...
...
@@ -9,9 +9,9 @@ from .models import Task
urlpatterns
=
[
url
(
r'^freelance-invoices/'
,
LDPViewSet
.
urls
(
model
=
FreelanceInvoice
)),
url
(
r'^client-invoices/'
,
LDPViewSet
.
urls
(
model
=
ClientInvoice
,
nested_fields
=
[
"batches"
],
nested_fields
=
[
"batches"
,
"project"
,
"customer"
],
fields
=
[
"@id"
,
"identifier"
,
"title"
,
"state"
,
"htAmount"
,
"tvaRate"
,
"invoicingDate"
,
"tvaAmount"
,
"ttcAmount"
,
"batches"
]
"tvaAmount"
,
"ttcAmount"
,
"batches"
,
"project"
,
"customer"
]
)),
url
(
r'^batches/'
,
LDPViewSet
.
urls
(
model
=
Batch
,
nested_fields
=
[
"tasks"
],
...
...
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