Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hypha
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ots
hypha
Commits
a59c5974
Commit
a59c5974
authored
3 years ago
by
sks444
Browse files
Options
Downloads
Patches
Plain Diff
Add vendor
parent
a9c46f6e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hypha/apply/projects/models/__init__.py
+3
-0
3 additions, 0 deletions
hypha/apply/projects/models/__init__.py
hypha/apply/projects/models/vendor.py
+81
-0
81 additions, 0 deletions
hypha/apply/projects/models/vendor.py
with
84 additions
and
0 deletions
hypha/apply/projects/models/__init__.py
+
3
−
0
View file @
a59c5974
...
@@ -9,6 +9,7 @@ from .project import (
...
@@ -9,6 +9,7 @@ from .project import (
ProjectSettings
,
ProjectSettings
,
)
)
from
.report
import
Report
,
ReportConfig
,
ReportPrivateFiles
,
ReportVersion
from
.report
import
Report
,
ReportConfig
,
ReportPrivateFiles
,
ReportVersion
from
.vendor
import
Vendor
,
BankInformation
__all__
=
[
__all__
=
[
'
Project
'
,
'
Project
'
,
...
@@ -25,4 +26,6 @@ __all__ = [
...
@@ -25,4 +26,6 @@ __all__ = [
'
ReportVersion
'
,
'
ReportVersion
'
,
'
ReportPrivateFiles
'
,
'
ReportPrivateFiles
'
,
'
ReportConfig
'
,
'
ReportConfig
'
,
'
Vendor
'
,
'
BankInformation
'
,
]
]
This diff is collapsed.
Click to expand it.
hypha/apply/projects/models/vendor.py
0 → 100644
+
81
−
0
View file @
a59c5974
from
django.db
import
models
from
django.utils.translation
import
gettext_lazy
as
_
from
babel.numbers
import
list_currencies
,
get_currency_name
from
hypha.apply.utils.storage
import
PrivateStorage
from
hypha.apply.users.models
import
User
def
due_diligence_documents
(
instance
,
filename
):
return
f
'
vendor/
{
instance
.
vendor_id
}
/due_diligence_documents/
{
filename
}
'
class
BankInformation
(
models
.
Model
):
CURRENCY_CHOICES
=
[
(
currency
,
f
'
{
get_currency_name
(
currency
)
}
-
{
currency
}
'
)
for
currency
in
list_currencies
()
]
account_holder_name
=
models
.
CharField
(
max_length
=
150
)
account_routing_number
=
models
.
CharField
(
max_length
=
10
)
account_number
=
models
.
CharField
(
max_length
=
20
)
account_currency
=
models
.
CharField
(
choices
=
CURRENCY_CHOICES
,
max_length
=
10
)
need_extra_info
=
models
.
BooleanField
(
default
=
False
)
branch_address
=
models
.
TextField
(
_
(
'
Address
'
),
blank
=
True
)
iba_info
=
models
.
OneToOneField
(
'
self
'
,
null
=
True
,
blank
=
True
,
on_delete
=
models
.
SET_NULL
,
related_name
=
'
bank_info
'
,
verbose_name
=
'
Intermediary Bank Account Information
'
)
nid_type
=
models
.
CharField
(
max_length
=
25
,
verbose_name
=
'
National Identity Document Type
'
,
blank
=
True
)
nid_number
=
models
.
CharField
(
max_length
=
20
,
blank
=
True
)
def
__str__
(
self
):
return
self
.
account_holder_name
class
Vendor
(
User
):
TYPE_CHOICES
=
[
(
'
organization
'
,
'
Organization
'
),
(
'
personal
'
,
'
Personal
'
),
]
contractor_name
=
models
.
CharField
(
max_length
=
150
,
blank
=
True
)
address
=
models
.
TextField
(
_
(
'
Address
'
),
blank
=
True
)
type
=
models
.
CharField
(
max_length
=
15
,
choices
=
TYPE_CHOICES
,
blank
=
True
)
required_to_pay_taxes
=
models
.
BooleanField
(
default
=
False
)
bank_info
=
models
.
OneToOneField
(
BankInformation
,
on_delete
=
models
.
SET_NULL
,
null
=
True
,
blank
=
True
,
)
other_info
=
models
.
TextField
(
blank
=
True
)
def
__str__
(
self
):
return
self
.
full_name
class
DueDiligenceDocument
(
models
.
Model
):
document
=
models
.
FileField
(
upload_to
=
due_diligence_documents
,
storage
=
PrivateStorage
()
)
vendor
=
models
.
ForeignKey
(
Vendor
,
on_delete
=
models
.
CASCADE
)
def
__str__
(
self
):
return
self
.
vendor
.
full_name
+
'
->
'
+
self
.
document
.
name
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment