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
33fa4b66
Commit
33fa4b66
authored
Nov 13, 2018
by
Claire Zuliani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add freelance invoice model
parent
86794592
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
0 deletions
+65
-0
admin.py
admin.py
+2
-0
migrations/0003_freelanceinvoice.py
migrations/0003_freelanceinvoice.py
+34
-0
models.py
models.py
+27
-0
urls.py
urls.py
+2
-0
No files found.
admin.py
View file @
33fa4b66
from
django.contrib
import
admin
from
guardian.admin
import
GuardedModelAdmin
from
.models
import
ClientInvoice
from
.models
import
FreelanceInvoice
admin
.
site
.
register
(
ClientInvoice
)
admin
.
site
.
register
(
FreelanceInvoice
)
migrations/0003_freelanceinvoice.py
0 → 100644
View file @
33fa4b66
# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-11-12 19:31
from
__future__
import
unicode_literals
import
datetime
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'djangoldp_invoices'
,
'0002_auto_20181112_1912'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'FreelanceInvoice'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'freelanceFullname'
,
models
.
CharField
(
max_length
=
255
)),
(
'identifier'
,
models
.
CharField
(
max_length
=
255
)),
(
'title'
,
models
.
CharField
(
max_length
=
255
)),
(
'htAmount'
,
models
.
DecimalField
(
decimal_places
=
2
,
max_digits
=
11
)),
(
'tvaRate'
,
models
.
DecimalField
(
decimal_places
=
2
,
max_digits
=
4
)),
(
'creationDate'
,
models
.
DateField
(
default
=
datetime
.
date
.
today
)),
(
'modificationDate'
,
models
.
DateField
(
default
=
datetime
.
date
.
today
)),
(
'invoicingDate'
,
models
.
DateField
(
default
=
datetime
.
date
.
today
)),
(
'uploadUrl'
,
models
.
CharField
(
max_length
=
255
)),
],
options
=
{
'permissions'
:
((
'view_freelance_invoice'
,
'Read'
),
(
'control_freelance_invoice'
,
'Control'
)),
},
),
]
models.py
View file @
33fa4b66
...
...
@@ -25,3 +25,30 @@ class ClientInvoice(models.Model):
def
__str__
(
self
):
return
'{} ({})'
.
format
(
self
.
identifier
,
self
.
title
)
class
FreelanceInvoice
(
models
.
Model
):
# customer = models.ForeignKey(User, on_delete=models.CASCADE)
# provider = models.ForeignKey(User, on_delete=models.CASCADE)
STATES
=
(
(
'pending'
,
'en attente'
),
(
'paid'
,
'réglée'
)
)
freelanceFullname
=
models
.
CharField
(
max_length
=
255
)
identifier
=
models
.
CharField
(
max_length
=
255
)
title
=
models
.
CharField
(
max_length
=
255
)
# state = models.CharField(max_length=1, choices=STATES, default = 'pending')
htAmount
=
models
.
DecimalField
(
max_digits
=
11
,
decimal_places
=
2
)
tvaRate
=
models
.
DecimalField
(
max_digits
=
4
,
decimal_places
=
2
)
creationDate
=
models
.
DateField
(
default
=
datetime
.
date
.
today
)
modificationDate
=
models
.
DateField
(
default
=
datetime
.
date
.
today
)
invoicingDate
=
models
.
DateField
(
default
=
datetime
.
date
.
today
)
uploadUrl
=
models
.
CharField
(
max_length
=
255
)
class
Meta
:
permissions
=
(
(
'view_freelance_invoice'
,
'Read'
),
(
'control_freelance_invoice'
,
'Control'
),
)
def
__str__
(
self
):
return
'{} ({} / {})'
.
format
(
self
.
freelanceFullname
,
self
.
identifier
,
self
.
title
)
\ No newline at end of file
urls.py
View file @
33fa4b66
...
...
@@ -2,7 +2,9 @@ from django.conf.urls import url, include
from
django.conf
import
settings
from
djangoldp.views
import
LDPViewSet
from
.models
import
ClientInvoice
from
.models
import
FreelanceInvoice
urlpatterns
=
[
url
(
r'^client-invoices'
,
LDPViewSet
.
urls
(
model
=
ClientInvoice
)),
url
(
r'^freelance-invoices'
,
LDPViewSet
.
urls
(
model
=
FreelanceInvoice
)),
]
\ No newline at end of file
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