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
Paul Graydon
slapos.core
Commits
c81133a9
Commit
c81133a9
authored
Jan 03, 2013
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a direct link to pay from the invoice.
parent
4a1f6e61
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
4 deletions
+103
-4
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_hosting/AccountingTransaction_getPaymentState.xml
...s/vifib_hosting/AccountingTransaction_getPaymentState.xml
+22
-2
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_hosting/SaleInvoiceTransaction_getPayzenPaymentLink.xml
...b_hosting/SaleInvoiceTransaction_getPayzenPaymentLink.xml
+79
-0
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewMyInvoicesRender/listbox.xml
...vifib_hosting/WebSection_viewMyInvoicesRender/listbox.xml
+1
-1
master/bt5/slapos_web/bt/revision
master/bt5/slapos_web/bt/revision
+1
-1
No files found.
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_hosting/AccountingTransaction_getPaymentState.xml
View file @
c81133a9
...
@@ -59,9 +59,10 @@ elif simulation_state in ("planned", "confirmed", "ordered", "started"):\n
...
@@ -59,9 +59,10 @@ elif simulation_state in ("planned", "confirmed", "ordered", "started"):\n
result = "Ongoing"\n
result = "Ongoing"\n
\n
\n
else:\n
else:\n
portal = context.getPortalObject()\n
\n
\n
paid = True\n
paid = True\n
for line in context.getMovementList(
context.getPortalObject()
.getPortalAccountingMovementTypeList()):\n
for line in context.getMovementList(
portal
.getPortalAccountingMovementTypeList()):\n
node_value = line.getSourceValue(portal_type=\'Account\')\n
node_value = line.getSourceValue(portal_type=\'Account\')\n
if node_value.getAccountType() == \'asset/receivable\':\n
if node_value.getAccountType() == \'asset/receivable\':\n
if not line.hasGroupingReference():\n
if not line.hasGroupingReference():\n
...
@@ -73,7 +74,26 @@ else:\n
...
@@ -73,7 +74,26 @@ else:\n
elif context.getTotalPrice() == 0:\n
elif context.getTotalPrice() == 0:\n
result = "Free!"\n
result = "Free!"\n
else:\n
else:\n
result = "Waiting for payment"\n
# Check if there is an ongoing payzen payment\n
payment = portal.portal_catalog.getResultValue(\n
portal_type="Payment Transaction",\n
simulation_state="started",\n
default_causality_uid=context.getUid(),\n
default_payment_mode_uid=portal.portal_categories.payment_mode.payzen.getUid(),\n
)\n
if payment is None:\n
result = "Unpaid"\n
else:\n
# Check if mapping exists\n
person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
payzen_id = person.Person_restrictMethodAsShadowUser(\n
shadow_document=person,\n
callable_object=payment.PaymentTransaction_getPayzenId,\n
argument_list=[])[0]\n
if payzen_id is None:\n
result = "Pay now"\n
else:\n
result = "Waiting for payment confirmation"\n
\n
\n
return result\n
return result\n
</string>
</value>
</string>
</value>
...
...
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_hosting/SaleInvoiceTransaction_getPayzenPaymentLink.xml
0 → 100644
View file @
c81133a9
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
result = None\n
if context.AccountingTransaction_getPaymentState() == "Pay now":\n
portal = context.getPortalObject()\n
payment = portal.portal_catalog.getResultValue(\n
portal_type="Payment Transaction",\n
simulation_state="started",\n
default_causality_uid=context.getUid(),\n
default_payment_mode_uid=portal.portal_categories.payment_mode.payzen.getUid(),\n
)\n
if payment is not None:\n
result = "%s/PaymentTransaction_redirectToManualPayzenPayment" % payment.absolute_url()\n
\n
return result\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SaleInvoiceTransaction_getPayzenPaymentLink
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_hosting/WebSection_viewMyInvoicesRender/listbox.xml
View file @
c81133a9
...
@@ -180,7 +180,7 @@
...
@@ -180,7 +180,7 @@
</tuple>
</tuple>
<tuple>
<tuple>
<string>
AccountingTransaction_getPaymentState
</string>
<string>
AccountingTransaction_getPaymentState
</string>
<string></string>
<string>
SaleInvoiceTransaction_getPayzenPaymentLink
</string>
</tuple>
</tuple>
<tuple>
<tuple>
<string>
download
</string>
<string>
download
</string>
...
...
master/bt5/slapos_web/bt/revision
View file @
c81133a9
26
27
\ No newline at end of file
\ 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