Commit 26811852 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_subscription_request: Switch account from bank to payment_to_encash

parent 978a1e93
......@@ -10,11 +10,17 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>destination/account_module/bank</string>
<string>source/account_module/bank</string>
<string>destination/account_module/payment_to_encash</string>
<string>source/account_module/payment_to_encash</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>grouping_date</string> </key>
<value>
......@@ -31,6 +37,12 @@
<key> <string>id</string> </key>
<value> <string>2</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Accounting Transaction Line</string> </value>
......
......@@ -10,11 +10,17 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>destination/account_module/bank</string>
<string>source/account_module/bank</string>
<string>destination/account_module/payment_to_encash</string>
<string>source/account_module/payment_to_encash</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>grouping_date</string> </key>
<value>
......@@ -31,6 +37,12 @@
<key> <string>id</string> </key>
<value> <string>2</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Accounting Transaction Line</string> </value>
......
......@@ -28,7 +28,7 @@ if current_invoice is None:
amount = 0
for line in current_payment.contentValues():
if line.getSource() in ["account_module/bank", "account_module/receivable"]:
if line.getSource() in ["account_module/payment_to_encash", "account_module/receivable"]:
quantity = int(amount) * line.getQuantity()
line.setQuantity(quantity)
......
......@@ -524,7 +524,7 @@ class TestSubscriptionRequest_requestPaymentTransaction(TestSubscriptionSkinsMix
self.assertEqual(current_payment.getSimulationState(), "started")
for line in current_payment.contentValues():
if line.getSource() == "account_module/bank":
if line.getSource() == "account_module/payment_to_encash":
self.assertEqual(line.getQuantity(), -25*quantity)
if line.getSource() == "account_module/receivable":
self.assertEqual(line.getQuantity(), 25*quantity)
......@@ -555,7 +555,7 @@ class TestSubscriptionRequest_requestPaymentTransaction(TestSubscriptionSkinsMix
self.assertEqual(current_payment.getSimulationState(), "started")
for line in current_payment.contentValues():
if line.getSource() == "account_module/bank":
if line.getSource() == "account_module/payment_to_encash":
self.assertEqual(line.getQuantity(), -188*quantity)
if line.getSource() == "account_module/receivable":
self.assertEqual(line.getQuantity(), 188*quantity)
......
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