Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
slapos.core
Commits
acb86e5c
Commit
acb86e5c
authored
Apr 18, 2024
by
Romain Courteaud
🐸
Committed by
Rafael Monnerat
Jun 03, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_panel: Include "Deposit" on the list to Pay
parent
0941e532
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/AccountingTransactionModule_getCreateExternalPaymentTransactionOnSlaposPanelHTML.py
...e_getCreateExternalPaymentTransactionOnSlaposPanelHTML.py
+24
-1
No files found.
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/AccountingTransactionModule_getCreateExternalPaymentTransactionOnSlaposPanelHTML.py
View file @
acb86e5c
...
@@ -14,7 +14,7 @@ ledger_uid = portal.portal_categories.ledger.automated.getUid()
...
@@ -14,7 +14,7 @@ ledger_uid = portal.portal_categories.ledger.automated.getUid()
html_content
=
''
html_content
=
''
entity
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
entity
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
if
entity
is
None
:
if
entity
is
None
:
return
'<p>Nothing to pay</p>'
return
'<p>Nothing to pay
with your account
</p>'
for
currency_uid
,
secure_service_relative_url
in
[
for
currency_uid
,
secure_service_relative_url
in
[
(
portal
.
currency_module
.
EUR
.
getUid
(),
portal
.
Base_getPayzenServiceRelativeUrl
()),
(
portal
.
currency_module
.
EUR
.
getUid
(),
portal
.
Base_getPayzenServiceRelativeUrl
()),
...
@@ -22,6 +22,7 @@ for currency_uid, secure_service_relative_url in [
...
@@ -22,6 +22,7 @@ for currency_uid, secure_service_relative_url in [
]:
]:
if
secure_service_relative_url
is
not
None
:
if
secure_service_relative_url
is
not
None
:
# Existing invoices
outstanding_amount_list
=
entity
.
Entity_getOutstandingAmountList
(
outstanding_amount_list
=
entity
.
Entity_getOutstandingAmountList
(
ledger_uid
=
ledger_uid
,
ledger_uid
=
ledger_uid
,
resource_uid
=
currency_uid
resource_uid
=
currency_uid
...
@@ -35,6 +36,28 @@ for currency_uid, secure_service_relative_url in [
...
@@ -35,6 +36,28 @@ for currency_uid, secure_service_relative_url in [
'payment_url'
:
'%s/SaleInvoiceTransaction_createExternalPaymentTransactionFromAmountAndRedirect'
%
outstanding_amount
.
absolute_url
()
'payment_url'
:
'%s/SaleInvoiceTransaction_createExternalPaymentTransactionFromAmountAndRedirect'
%
outstanding_amount
.
absolute_url
()
}
}
# Existing subscription request
deposit_price
=
0
for
sql_subscription_request
in
portal
.
portal_catalog
(
portal_type
=
"Subscription Request"
,
simulation_state
=
'submitted'
,
destination_section__uid
=
entity
.
getUid
(),
price_currency__uid
=
currency_uid
,
ledger__uid
=
ledger_uid
):
subscription_request
=
sql_subscription_request
.
getObject
()
subscription_request_total_price
=
subscription_request
.
getTotalPrice
()
if
0
<
subscription_request_total_price
:
deposit_price
+=
subscription_request_total_price
if
0
<
deposit_price
:
html_content
+=
"""
<p><a href="%(payment_url)s">%(total_price)s %(currency)s</a></p>
"""
%
{
'total_price'
:
deposit_price
,
'currency'
:
currency_uid
,
'payment_url'
:
'%s/SaleInvoiceTransaction_createExternalPaymentTransactionFromAmountAndRedirect'
%
entity
.
absolute_url
()
}
if
html_content
:
if
html_content
:
if
web_site
.
getLayoutProperty
(
"configuration_payment_url_template"
,
None
)
is
None
:
if
web_site
.
getLayoutProperty
(
"configuration_payment_url_template"
,
None
)
is
None
:
html_content
=
'<p>Please contact us to handle your payment</p>'
html_content
=
'<p>Please contact us to handle your payment</p>'
...
...
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