Index
hypha.apply.projects.models
¶
Invoice
¶
Bases: Model
project
class-attribute
instance-attribute
¶
by
class-attribute
instance-attribute
¶
paid_value
class-attribute
instance-attribute
¶
paid_value = DecimalField(max_digits=10, decimal_places=2, validators=[MinValueValidator(Decimal('0.01'))], null=True)
document
class-attribute
instance-attribute
¶
document = FileField(upload_to=invoice_path, storage=PrivateStorage())
message_for_pm
class-attribute
instance-attribute
¶
invoice_number
class-attribute
instance-attribute
¶
invoice_amount
class-attribute
instance-attribute
¶
invoice_amount = DecimalField(max_digits=10, decimal_places=2, validators=[MinValueValidator(Decimal('0.01'))], null=True, verbose_name=gettext_lazy('Invoice amount'))
status
class-attribute
instance-attribute
¶
status = FSMField(default=SUBMITTED, choices=INVOICE_STATUS_CHOICES)
deliverables
class-attribute
instance-attribute
¶
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
vendor_document_number
property
¶
Vendor document number is a required field to create invoices in IntAcct.
Formatting should be HP###### i.e. HP000001 and so on.
transition_invoice_to_resubmitted
¶
Tranistion invoice to resubmitted status. This method generally gets used on invoice edit.
Source code in hypha/apply/projects/models/payment.py
can_user_delete
¶
can_user_edit
¶
Check when an user can edit an invoice. Only applicant and staff have permission to edit invoice based on its current status.
Source code in hypha/apply/projects/models/payment.py
can_user_change_status
¶
Check user roles that can tranistion invoice status based on the current status.
Source code in hypha/apply/projects/models/payment.py
can_user_edit_deliverables
¶
Source code in hypha/apply/projects/models/payment.py
InvoiceDeliverable
¶
SupportingDocument
¶
Bases: Model
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
document
class-attribute
instance-attribute
¶
document = FileField(upload_to='supporting_documents', storage=PrivateStorage())
Contract
¶
Bases: Model
approver
class-attribute
instance-attribute
¶
project
class-attribute
instance-attribute
¶
file
class-attribute
instance-attribute
¶
file = FileField(upload_to=contract_path, storage=PrivateStorage())
signed_by_applicant
class-attribute
instance-attribute
¶
uploaded_by_contractor_at
class-attribute
instance-attribute
¶
uploaded_by_applicant_at
class-attribute
instance-attribute
¶
save
¶
ContractDocumentCategory
¶
Bases: Model
recommended_minimum
class-attribute
instance-attribute
¶
template
class-attribute
instance-attribute
¶
template = FileField(upload_to=contract_document_template_path, storage=PrivateStorage(), blank=True, null=True)
panels
class-attribute
instance-attribute
¶
ContractPacketFile
¶
Bases: Model
category
class-attribute
instance-attribute
¶
category = ForeignKey('ContractDocumentCategory', null=True, on_delete=CASCADE, related_name='contract_packet_files')
project
class-attribute
instance-attribute
¶
document
class-attribute
instance-attribute
¶
document = FileField(upload_to=contract_document_path, storage=PrivateStorage())
created_at
class-attribute
instance-attribute
¶
get_remove_form
¶
Get an instantiated RemoveContractDocumentForm with this class as instance
.
This allows us to build instances of the RemoveContractDocumentForm for each instance of ContractPacketFile in the contracting documents template. The standard Delegated View flow makes it difficult to create these forms in the view or template.
Source code in hypha/apply/projects/models/project.py
Deliverable
¶
Bases: Model
external_id
class-attribute
instance-attribute
¶
external_id = CharField(max_length=30, blank=True, help_text='ID of this deliverable at integrated payment service.')
available_to_invoice
class-attribute
instance-attribute
¶
unit_price
class-attribute
instance-attribute
¶
unit_price = DecimalField(max_digits=10, decimal_places=2, validators=[MinValueValidator(Decimal('0.01'))])
extra_information
class-attribute
instance-attribute
¶
extra_information = JSONField(default=dict, help_text='More details of the deliverable at integrated payment service.')
DocumentCategory
¶
Bases: Model
recommended_minimum
class-attribute
instance-attribute
¶
template
class-attribute
instance-attribute
¶
template = FileField(upload_to=document_template_path, storage=PrivateStorage(), blank=True, null=True)
panels
class-attribute
instance-attribute
¶
PacketFile
¶
Bases: Model
category
class-attribute
instance-attribute
¶
category = ForeignKey('DocumentCategory', null=True, on_delete=CASCADE, related_name='packet_files')
project
class-attribute
instance-attribute
¶
document
class-attribute
instance-attribute
¶
document = FileField(upload_to=document_path, storage=PrivateStorage())
created_at
class-attribute
instance-attribute
¶
get_remove_form
¶
Get an instantiated RemoveDocumentForm with this class as instance
.
This allows us to build instances of the RemoveDocumentForm for each instance of PacketFile in the supporting documents template. The standard Delegated View flow makes it difficult to create these forms in the view or template.
Source code in hypha/apply/projects/models/project.py
PAFApprovals
¶
Project
¶
Bases: BaseStreamForm
, AccessFormData
, Model
stream_file_class
class-attribute
instance-attribute
¶
stream_file_class = SubmissionStreamFieldFile
submission_form_class
class-attribute
instance-attribute
¶
submission_form_class = PageStreamBaseForm
lead
class-attribute
instance-attribute
¶
submission
class-attribute
instance-attribute
¶
user
class-attribute
instance-attribute
¶
vendor
class-attribute
instance-attribute
¶
vendor = ForeignKey('application_projects.Vendor', on_delete=SET_NULL, null=True, blank=True, related_name='projects')
value
class-attribute
instance-attribute
¶
value = DecimalField(default=0, max_digits=20, decimal_places=2, validators=[MinValueValidator(limit_value=0)])
proposed_start
class-attribute
instance-attribute
¶
proposed_end
class-attribute
instance-attribute
¶
status
class-attribute
instance-attribute
¶
status = TextField(choices=PROJECT_STATUS_CHOICES, default=DRAFT)
form_data
class-attribute
instance-attribute
¶
form_data = JSONField(encoder=StreamFieldDataEncoder, default=dict)
form_fields
class-attribute
instance-attribute
¶
form_fields = StreamField(ProjectApprovalFormCustomFormFieldsBlock(), null=True, use_json_field=True)
user_has_updated_details
class-attribute
instance-attribute
¶
submitted_contract_documents
class-attribute
instance-attribute
¶
activities
class-attribute
instance-attribute
¶
activities = GenericRelation('activity.Activity', content_type_field='source_content_type', object_id_field='source_object_id', related_query_name='project')
external_projectid
class-attribute
instance-attribute
¶
external_projectid = CharField(max_length=30, blank=True, help_text='ID of this project at integrated payment service.')
external_project_information
class-attribute
instance-attribute
¶
external_project_information = JSONField(default=dict, help_text='More details of the project integrated at payment service.')
sent_to_compliance_at
class-attribute
instance-attribute
¶
paf_reviews_meta_data
class-attribute
instance-attribute
¶
paf_reviews_meta_data = JSONField(default=dict, help_text='Reviewers role and their actions/comments')
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
can_send_for_approval
property
¶
Wrapper to expose the pending approval state
We don't want to expose a "Sent for Approval" state to the end User so we infer it from the current status being "Comitted" and the Project being locked.
program_project_id
property
¶
Program project id is used to fetch deliverables from IntAcct.
Stored in external_project_information as the first item of referenceno(PONUMBER).
stream_file
classmethod
¶
Source code in hypha/apply/funds/models/mixins.py
process_file
classmethod
¶
process_file_data
¶
Source code in hypha/apply/funds/models/mixins.py
extract_files
¶
from_db
classmethod
¶
Source code in hypha/apply/stream_forms/models.py
deserialised_data
classmethod
¶
Source code in hypha/apply/funds/models/mixins.py
get_definitive_id
¶
field
¶
data
¶
get_serialize_multi_inputs_answer
¶
Source code in hypha/apply/funds/models/mixins.py
serialize
¶
Source code in hypha/apply/funds/models/mixins.py
get_multi_inputs_answer
¶
Source code in hypha/apply/funds/models/mixins.py
render_answer
¶
Source code in hypha/apply/funds/models/mixins.py
render_answers
¶
render_first_group_text_answers
¶
render_text_blocks_answers
¶
Source code in hypha/apply/funds/models/mixins.py
output_answers
¶
output_text_answers
¶
output_first_group_text_answers
¶
get_answer_from_label
¶
Source code in hypha/apply/funds/models/mixins.py
deserialize_form_data
classmethod
¶
Source code in hypha/apply/stream_forms/models.py
get_defined_fields
¶
get_form_fields
¶
Source code in hypha/apply/stream_forms/models.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
get_form_class
¶
get_address_display
¶
Source code in hypha/apply/projects/models/project.py
create_from_submission
classmethod
¶
Create a Project from the given submission.
Returns a new Project or the given ApplicationSubmissions existing Project.
Source code in hypha/apply/projects/models/project.py
paid_value
¶
unpaid_value
¶
clean
¶
Source code in hypha/apply/projects/models/project.py
save
¶
Source code in hypha/apply/projects/models/project.py
editable_by
¶
Source code in hypha/apply/projects/models/project.py
get_absolute_url
¶
can_request_funding
¶
ProjectApprovalForm
¶
Bases: ProjectBaseStreamForm
ProjectSettings
¶
Bases: BaseSiteSetting
, ClusterableModel
contracting_gp_email
class-attribute
instance-attribute
¶
finance_gp_email
class-attribute
instance-attribute
¶
staff_gp_email
class-attribute
instance-attribute
¶
vendor_setup_required
class-attribute
instance-attribute
¶
paf_approval_sequential
class-attribute
instance-attribute
¶
paf_approval_sequential = BooleanField(default=True, help_text='Uncheck it to approve PAF parallely')
panels
class-attribute
instance-attribute
¶
panels = [FieldPanel('staff_gp_email'), FieldPanel('contracting_gp_email'), FieldPanel('finance_gp_email'), FieldPanel('vendor_setup_required'), MultiFieldPanel([FieldPanel('paf_approval_sequential', heading='Approve PAF Sequentially'), InlinePanel('paf_reviewers_roles', label=gettext_lazy('PAF Reviewers Roles'))], heading=gettext_lazy('PAF Reviewers Roles'))]
ProjectSOWForm
¶
Bases: ProjectBaseStreamForm
Report
¶
Bases: Model
project
class-attribute
instance-attribute
¶
current
class-attribute
instance-attribute
¶
current = OneToOneField('ReportVersion', on_delete=CASCADE, related_name='live_for_report', null=True)
draft
class-attribute
instance-attribute
¶
draft = OneToOneField('ReportVersion', on_delete=CASCADE, related_name='draft_for_report', null=True)
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
get_absolute_url
¶
start_date
¶
ReportConfig
¶
Bases: Model
Persists configuration about the reporting schedule etc
FREQUENCY_CHOICES
class-attribute
instance-attribute
¶
FREQUENCY_CHOICES = [(WEEK, gettext_lazy('Weeks')), (MONTH, gettext_lazy('Months')), (YEAR, gettext_lazy('Years'))]
project
class-attribute
instance-attribute
¶
frequency
class-attribute
instance-attribute
¶
frequency = CharField(choices=FREQUENCY_CHOICES, default=MONTH, max_length=6)
disable_reporting
class-attribute
instance-attribute
¶
get_frequency_display
¶
Source code in hypha/apply/projects/models/report.py
is_up_to_date
¶
outstanding_reports
¶
has_very_late_reports
¶
past_due_reports
¶
last_report
¶
Source code in hypha/apply/projects/models/report.py
current_due_report
¶
Source code in hypha/apply/projects/models/report.py
ReportPrivateFiles
¶
Bases: Model
report
class-attribute
instance-attribute
¶
document
class-attribute
instance-attribute
¶
document = FileField(upload_to=report_path, storage=PrivateStorage())
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
ReportVersion
¶
BankInformation
¶
Bases: Model
account_holder_name
class-attribute
instance-attribute
¶
account_routing_number
class-attribute
instance-attribute
¶
branch_address
class-attribute
instance-attribute
¶
iba_info
class-attribute
instance-attribute
¶
iba_info = OneToOneField('self', null=True, blank=True, on_delete=SET_NULL, related_name='bank_info', verbose_name='Intermediary Bank Account Information')
nid_type
class-attribute
instance-attribute
¶
nid_number
class-attribute
instance-attribute
¶
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
DueDiligenceDocument
¶
Bases: Model
document
class-attribute
instance-attribute
¶
document = FileField(upload_to='due_diligence_documents', storage=PrivateStorage())
vendor
class-attribute
instance-attribute
¶
vendor = ForeignKey(Vendor, on_delete=CASCADE, related_name='due_diligence_documents')
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
Vendor
¶
Bases: Model
TYPE_CHOICES
class-attribute
instance-attribute
¶
TYPE_CHOICES = [('organization', gettext_lazy('Yes, the account belongs to the organisation above')), ('personal', gettext_lazy('No, it is a personal bank account'))]
created_at
class-attribute
instance-attribute
¶
updated_at
class-attribute
instance-attribute
¶
user
class-attribute
instance-attribute
¶
contractor_name
class-attribute
instance-attribute
¶
address
class-attribute
instance-attribute
¶
type
class-attribute
instance-attribute
¶
type = CharField(max_length=15, choices=TYPE_CHOICES, blank=True)
required_to_pay_taxes
class-attribute
instance-attribute
¶
bank_info
class-attribute
instance-attribute
¶
bank_info = OneToOneField(BankInformation, on_delete=SET_NULL, null=True, blank=True)
user_has_updated_details
class-attribute
instance-attribute
¶
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
VendorFormSettings
¶
Bases: BaseSiteSetting
wagtail_reference_index_ignore
class-attribute
instance-attribute
¶
name_label
class-attribute
instance-attribute
¶
name_label = TextField('label', default='1. What is the name of the person/organisation on the contract?')
name_help_text
class-attribute
instance-attribute
¶
name_help_text = RichTextField('help text', blank=True, default='This is the party name in the contract.')
contractor_name_label
class-attribute
instance-attribute
¶
contractor_name_label = TextField('label', default="2. What is the individual's name who is signing the contract?")
contractor_name_help_text
class-attribute
instance-attribute
¶
contractor_name_help_text = RichTextField('help text', blank=True, default='This person is is authorised to sign contract on behalf of the person or organization named above.')
type_label
class-attribute
instance-attribute
¶
type_label = TextField('label', default='3. Is the bank account owned by the person or organisation in the Question 1 above?')
type_help_text
class-attribute
instance-attribute
¶
type_help_text = RichTextField('help text', blank=True, default='The name of the bank account must be the same as on the contract.')
required_to_pay_taxes_label
class-attribute
instance-attribute
¶
required_to_pay_taxes_label = TextField('label', default='Is the organisation required to pay US taxes?')
required_to_pay_taxes_help_text
class-attribute
instance-attribute
¶
due_diligence_documents_label
class-attribute
instance-attribute
¶
due_diligence_documents_help_text
class-attribute
instance-attribute
¶
due_diligence_documents_help_text = RichTextField('help text', blank=True, default='Upload Due Diligence Documents. E.g. w8/w9 forms.')
account_holder_name_label
class-attribute
instance-attribute
¶
account_holder_name_help_text
class-attribute
instance-attribute
¶
account_holder_name_help_text = RichTextField('help text', blank=True, default='This name must be same as the person or organisation that signed the contract. This person is authorised to sign contracts on behalf of the person or organisation named above.')
account_routing_number_label
class-attribute
instance-attribute
¶
account_routing_number_help_text
class-attribute
instance-attribute
¶
account_routing_number_help_text = RichTextField('help text', blank=True, default='Depending on your country, this might be called the ACH, SWIFT, BIC or ABA number.')
account_number_label
class-attribute
instance-attribute
¶
account_number_help_text
class-attribute
instance-attribute
¶
account_number_help_text = RichTextField('help text', blank=True, default='Depending on your country, this might be called the account number, IBAN, or BBAN number.')
account_currency_label
class-attribute
instance-attribute
¶
account_currency_help_text
class-attribute
instance-attribute
¶
account_currency_help_text = RichTextField('help text', blank=True, default='This is the currency of this bank account.')
need_extra_info_label
class-attribute
instance-attribute
¶
need_extra_info_label = TextField('label', default='Do you need to provide us with extra information?')
need_extra_info_help_text
class-attribute
instance-attribute
¶
branch_address_label
class-attribute
instance-attribute
¶
branch_address_help_text
class-attribute
instance-attribute
¶
branch_address_help_text = TextField('help text', blank=True, default='The address of the bank branch where you have the bank account located(not the bank account holder address)')
ib_account_routing_number_label
class-attribute
instance-attribute
¶
ib_account_routing_number_label = TextField('label', default='Intermediary Bank Account Routing Number')
ib_account_routing_number_help_text
class-attribute
instance-attribute
¶
ib_account_routing_number_help_text = RichTextField('help text', blank=True, default='Depending on your country, this might be called ACH, SWIFT, BIC or ABA number')
ib_account_number_label
class-attribute
instance-attribute
¶
ib_account_number_help_text
class-attribute
instance-attribute
¶
ib_account_number_help_text = RichTextField('help text', blank=True, default='Depending on your country, this might be called the account number, IBAN, or BBAN number')
ib_account_currency_label
class-attribute
instance-attribute
¶
ib_account_currency_help_text
class-attribute
instance-attribute
¶
ib_account_currency_help_text = RichTextField('help text', blank=True, default='This is the currency of this bank account')
ib_branch_address_label
class-attribute
instance-attribute
¶
ib_branch_address_help_text
class-attribute
instance-attribute
¶
ib_branch_address_help_text = RichTextField('help text', blank=True, default='Bank branch address(not the bank account holder address)')
nid_type_label
class-attribute
instance-attribute
¶
nid_type_help_text
class-attribute
instance-attribute
¶
nid_type_help_text = RichTextField('help text', blank=True, default='This could be a passport, a National Identity number, or other national identity document.')
nid_number_label
class-attribute
instance-attribute
¶
nid_number_help_text
class-attribute
instance-attribute
¶
other_info_label
class-attribute
instance-attribute
¶
other_info_help_text
class-attribute
instance-attribute
¶
other_info_help_text = RichTextField('help text', blank=True, default='If you need to include other information not listed above, provide it here.')
panels
class-attribute
instance-attribute
¶
panels = [MultiFieldPanel([FieldPanel('name_label'), FieldPanel('name_help_text')], 'Name'), MultiFieldPanel([FieldPanel('contractor_name_label'), FieldPanel('contractor_name_help_text')], 'Contractor Name'), MultiFieldPanel([FieldPanel('type_label'), FieldPanel('type_help_text')], 'Type'), MultiFieldPanel([FieldPanel('required_to_pay_taxes_label'), FieldPanel('required_to_pay_taxes_help_text')], 'Required to pay taxes'), MultiFieldPanel([FieldPanel('due_diligence_documents_label'), FieldPanel('due_diligence_documents_help_text')], 'Due Diligence Documents'), MultiFieldPanel([FieldPanel('account_holder_name_label'), FieldPanel('account_holder_name_help_text')], 'Account Holder Name'), MultiFieldPanel([FieldPanel('account_routing_number_label'), FieldPanel('account_routing_number_help_text')], 'Account Routing Number'), MultiFieldPanel([FieldPanel('account_number_label'), FieldPanel('account_number_help_text')], 'Account Number'), MultiFieldPanel([FieldPanel('account_currency_label'), FieldPanel('account_currency_help_text')], 'Account Currency'), MultiFieldPanel([FieldPanel('need_extra_info_label'), FieldPanel('need_extra_info_help_text')], 'Need Extra Info'), MultiFieldPanel([FieldPanel('branch_address_label'), FieldPanel('branch_address_help_text')], 'Account Branch Address'), MultiFieldPanel([FieldPanel('ib_account_routing_number_label'), FieldPanel('ib_account_routing_number_help_text')], 'Intermediary Account Routing Number'), MultiFieldPanel([FieldPanel('ib_account_number_label'), FieldPanel('ib_account_number_help_text')], 'Intermediary Account Number'), MultiFieldPanel([FieldPanel('ib_account_currency_label'), FieldPanel('ib_account_currency_help_text')], 'Intermediary Account Currency'), MultiFieldPanel([FieldPanel('ib_branch_address_label'), FieldPanel('ib_branch_address_help_text')], 'Intermediary Account Branch Address'), MultiFieldPanel([FieldPanel('nid_type_label'), FieldPanel('nid_type_help_text')], 'National Identity Document Type'), MultiFieldPanel([FieldPanel('nid_number_label'), FieldPanel('nid_number_help_text')], 'National Identity Document Number'), MultiFieldPanel([FieldPanel('other_info_label'), FieldPanel('other_info_help_text')], 'Other Information')]