Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Tezor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Onboarding
AlekSIS-App-Tezor
Commits
33826865
Commit
33826865
authored
3 years ago
by
Tom Teichler
Browse files
Options
Downloads
Patches
Plain Diff
Reformat
parent
ccd9758f
No related branches found
No related tags found
1 merge request
!16
Sepaxml
Pipeline
#62414
failed
3 years ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: docker
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/tezor/forms.py
+12
-5
12 additions, 5 deletions
aleksis/apps/tezor/forms.py
aleksis/apps/tezor/util/invoice.py
+1
-0
1 addition, 0 deletions
aleksis/apps/tezor/util/invoice.py
with
13 additions
and
5 deletions
aleksis/apps/tezor/forms.py
+
12
−
5
View file @
33826865
...
@@ -2,8 +2,8 @@ from django.http import HttpResponse
...
@@ -2,8 +2,8 @@ from django.http import HttpResponse
from
django.utils.translation
import
gettext
as
_
from
django.utils.translation
import
gettext
as
_
from
djp_sepa.models
import
SEPAMandate
from
djp_sepa.models
import
SEPAMandate
from
payments
import
PaymentStatus
from
material
import
Fieldset
,
Layout
,
Row
from
material
import
Fieldset
,
Layout
,
Row
from
payments
import
PaymentStatus
from
aleksis.core.forms
import
ActionForm
from
aleksis.core.forms
import
ActionForm
from
aleksis.core.mixins
import
ExtensibleForm
from
aleksis.core.mixins
import
ExtensibleForm
...
@@ -17,22 +17,29 @@ def send_emails_action(modeladmin, request, queryset):
...
@@ -17,22 +17,29 @@ def send_emails_action(modeladmin, request, queryset):
"""
Send e-mails for selected invoices.
"""
"""
Send e-mails for selected invoices.
"""
email_invoice
.
delay
(
list
(
queryset
.
values_list
(
"
token
"
,
flat
=
True
)))
email_invoice
.
delay
(
list
(
queryset
.
values_list
(
"
token
"
,
flat
=
True
)))
send_emails_action
.
short_description
=
_
(
"
Send e-mails
"
)
send_emails_action
.
short_description
=
_
(
"
Send e-mails
"
)
send_emails_action
.
permission
=
"
tezor.send_invoice_email
"
send_emails_action
.
permission
=
"
tezor.send_invoice_email
"
def
get_sepa_xml
(
modeladmin
,
request
,
queryset
):
def
get_sepa_xml
(
modeladmin
,
request
,
queryset
):
"""
Get a SEPA XML for selected invoices.
"""
"""
Get a SEPA XML for selected invoices.
"""
qs
=
SEPAMandate
.
objects
.
filter
(
payment__in
=
queryset
,
payment__status
=
PaymentStatus
.
PREAUTH
)
qs
=
SEPAMandate
.
objects
.
filter
(
payment__in
=
queryset
,
payment__status
=
PaymentStatus
.
PREAUTH
)
sepadd
=
SEPAMandate
.
as_sepadd
(
qs
)
sepadd
=
SEPAMandate
.
as_sepadd
(
qs
)
return
HttpResponse
(
sepadd
.
export
(
pretty_print
=
True
).
decode
(),
headers
=
{
return
HttpResponse
(
"
Content-Type
"
:
"
text/xml
"
,
sepadd
.
export
(
pretty_print
=
True
).
decode
(),
"
Content-Disposition
"
:
"
attachment; filename=
\"
sepa_direct_debit.xml
\"
"
,
headers
=
{
})
"
Content-Type
"
:
"
text/xml
"
,
"
Content-Disposition
"
:
'
attachment; filename=
"
sepa_direct_debit.xml
"'
,
},
)
get_sepa_xml
.
short_description
=
_
(
"
Get SEPA XML
"
)
get_sepa_xml
.
short_description
=
_
(
"
Get SEPA XML
"
)
get_sepa_xml
.
permission
=
"
tezor.get_sepa_xml
"
get_sepa_xml
.
permission
=
"
tezor.get_sepa_xml
"
class
InvoicesActionForm
(
ActionForm
):
class
InvoicesActionForm
(
ActionForm
):
def
get_actions
(
self
):
def
get_actions
(
self
):
return
[
send_emails_action
,
get_sepa_xml
]
return
[
send_emails_action
,
get_sepa_xml
]
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/tezor/util/invoice.py
+
1
−
0
View file @
33826865
_provider_cache
=
{}
_provider_cache
=
{}
def
provider_factory
(
variant
,
payment
=
None
):
def
provider_factory
(
variant
,
payment
=
None
):
from
djp_sepa.providers
import
DirectDebitProvider
,
PaymentPledgeProvider
# noqa
from
djp_sepa.providers
import
DirectDebitProvider
,
PaymentPledgeProvider
# noqa
from
payments.paypal
import
PaypalProvider
# noqa
from
payments.paypal
import
PaypalProvider
# noqa
...
...
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