Commit 895afcee authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio_ui_test: Extend create Fake Invoices to create paid and unpaid invoices

parent 34a0667d
...@@ -19,7 +19,8 @@ def wrapWithShadow(): ...@@ -19,7 +19,8 @@ def wrapWithShadow():
payment.confirm() payment.confirm()
payment.start() payment.start()
payment.stop() if not unpaid:
payment.stop()
payment.PaymentTransaction_generatePayzenId() payment.PaymentTransaction_generatePayzenId()
...@@ -53,10 +54,23 @@ current_invoice, payment = demo_user_functional.Person_restrictMethodAsShadowUse ...@@ -53,10 +54,23 @@ current_invoice, payment = demo_user_functional.Person_restrictMethodAsShadowUse
argument_list=[]) argument_list=[])
payment.setCausalityValue(current_invoice) payment.setCausalityValue(current_invoice)
payment.setDestinationSectionValue(demo_user_functional)
current_invoice.plan() current_invoice.plan()
current_invoice.confirm() current_invoice.confirm()
current_invoice.startBuilding() current_invoice.startBuilding()
current_invoice.reindexObject() current_invoice.reindexObject()
current_invoice.stop() current_invoice.stop()
if not unpaid:
def isNodeFromLineReceivable(line):
node_value = line.getSourceValue(portal_type='Account')
return node_value.getAccountType() == 'asset/receivable'
for line in current_invoice.getMovementList(portal.getPortalAccountingMovementTypeList()):
if isNodeFromLineReceivable(line):
if not line.hasGroupingReference():
line.setGroupingReference('FAKEGROUPINGREFERENCE')
break
return 'Done.' return 'Done.'
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>unpaid=None</string> </value>
</item> </item>
<item> <item>
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment