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
4a306b42
Commit
4a306b42
authored
Mar 08, 2019
by
Matthieu Fesselier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: use ldp models
parent
78ebbbfd
Pipeline
#2560
passed with stage
in 27 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
djangoldp_invoice/models.py
djangoldp_invoice/models.py
+5
-4
No files found.
djangoldp_invoice/models.py
View file @
4a306b42
# -*- coding: utf-8 -*-
from
django.conf
import
settings
from
django.db
import
models
from
djangoldp.models
import
Model
from
djangoldp_project.models
import
Customer
from
djangoldp_project.models
import
Project
from
django.db.models
import
Sum
import
datetime
from
decimal
import
Decimal
class
FreelanceInvoice
(
models
.
Model
):
class
FreelanceInvoice
(
Model
):
# customer = models.ForeignKey(User, on_delete=models.CASCADE)
# provider = models.ForeignKey(User, on_delete=models.CASCADE)
STATES
=
(
...
...
@@ -41,7 +42,7 @@ class FreelanceInvoice(models.Model):
class
CustomerInvoice
(
models
.
Model
):
class
CustomerInvoice
(
Model
):
customer
=
models
.
ForeignKey
(
Customer
,
on_delete
=
models
.
DO_NOTHING
,
null
=
True
)
project
=
models
.
ForeignKey
(
Project
,
on_delete
=
models
.
DO_NOTHING
,
null
=
True
)
STATES
=
(
...
...
@@ -77,7 +78,7 @@ class CustomerInvoice(models.Model):
return
'{} - {} ({})'
.
format
(
self
.
identifier
,
self
.
title
,
self
.
htAmount
())
# Lot =========================================================
class
Batch
(
models
.
Model
):
class
Batch
(
Model
):
invoice
=
models
.
ForeignKey
(
CustomerInvoice
,
on_delete
=
models
.
CASCADE
,
related_name
=
'batches'
)
title
=
models
.
CharField
(
max_length
=
255
)
creationDate
=
models
.
DateField
(
auto_now_add
=
True
)
...
...
@@ -100,7 +101,7 @@ class Batch(models.Model):
Batch
.
_meta
.
serializer_fields
=
[
'@id'
,
'invoice'
,
'title'
,
'htAmount'
,
'tasks'
]
class
Task
(
models
.
Model
):
class
Task
(
Model
):
batch
=
models
.
ForeignKey
(
Batch
,
on_delete
=
models
.
CASCADE
,
related_name
=
'tasks'
)
title
=
models
.
CharField
(
max_length
=
255
)
htAmount
=
models
.
DecimalField
(
max_digits
=
11
,
decimal_places
=
2
)
...
...
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