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
Ophélie Gagnard
slapos.core
Commits
b10ff9a5
Commit
b10ff9a5
authored
Apr 30, 2021
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request&accounting: Reservation refund is Taxable
This change was requested by the accountant
parent
574b660d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
9 deletions
+68
-9
master/bt5/slapos_accounting/PathTemplateItem/service_module/slapos_reservation_refund.xml
...TemplateItem/service_module/slapos_reservation_refund.xml
+46
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_generateReservationRefoundSalePackingList.py
...ptionRequest_generateReservationRefoundSalePackingList.py
+8
-1
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionDualOrganisationScenario.py
...st.erp5.testSlapOSSubscriptionDualOrganisationScenario.py
+2
-2
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionInvitationTokenChineseScenario.py
...5.testSlapOSSubscriptionInvitationTokenChineseScenario.py
+4
-0
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionInvitationTokenScenario.py
...est.erp5.testSlapOSSubscriptionInvitationTokenScenario.py
+2
-0
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionScenario.py
...al_components/test.erp5.testSlapOSSubscriptionScenario.py
+6
-6
No files found.
master/bt5/slapos_accounting/PathTemplateItem/service_module/slapos_reservation_refund.xml
View file @
b10ff9a5
...
@@ -85,6 +85,7 @@
...
@@ -85,6 +85,7 @@
<string>
quantity_unit/unit/piece
</string>
<string>
quantity_unit/unit/piece
</string>
<string>
product_line/cloud/subscription
</string>
<string>
product_line/cloud/subscription
</string>
<string>
use/trade/sale
</string>
<string>
use/trade/sale
</string>
<string>
base_contribution/base_amount/invoicing/taxable
</string>
</tuple>
</tuple>
</value>
</value>
</item>
</item>
...
@@ -514,6 +515,51 @@
...
@@ -514,6 +515,51 @@
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
988.64728.51101.34167
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<reference
id=
"6.1"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1619807004.05
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</list>
</value>
</value>
</item>
</item>
...
...
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_generateReservationRefoundSalePackingList.py
View file @
b10ff9a5
...
@@ -37,6 +37,13 @@ if payment_transaction is None or payment_transaction.getSimulationState() != "s
...
@@ -37,6 +37,13 @@ if payment_transaction is None or payment_transaction.getSimulationState() != "s
# Nothing to do bug wait the payment
# Nothing to do bug wait the payment
return
return
price_without_tax
=
None
for
invoice_line
in
sale_invoice_transaction
.
objectValues
(
portal_type
=
"Invoice Line"
):
if
invoice_line
.
getResource
()
==
"service_module/slapos_reservation_fee"
:
price_without_tax
=
invoice_line
.
getTotalPrice
()
assert
price_without_tax
is
not
None
,
"Something is wrong since price wasn't found"
# Time to create the PL
# Time to create the PL
person
=
sale_invoice_transaction
.
getDestinationValue
(
portal_type
=
"Person"
)
person
=
sale_invoice_transaction
.
getDestinationValue
(
portal_type
=
"Person"
)
delivery_template
=
portal
.
restrictedTraverse
(
delivery_template
=
portal
.
restrictedTraverse
(
...
@@ -65,7 +72,7 @@ line = delivery.newContent(
...
@@ -65,7 +72,7 @@ line = delivery.newContent(
destination_section_value
=
person
,
destination_section_value
=
person
,
resource_value
=
service
,
resource_value
=
service
,
quantity_unit
=
service
.
getQuantityUnit
(),
quantity_unit
=
service
.
getQuantityUnit
(),
price
=-
sale_invoice_transaction
.
getTotalPrice
()
,
price
=-
price_without_tax
,
causality_uid
=
context
.
getUid
()
causality_uid
=
context
.
getUid
()
)
)
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionDualOrganisationScenario.py
View file @
b10ff9a5
...
@@ -151,9 +151,9 @@ class testSlapOSSubscriptionDualOrganisationScenario(TestSlapOSSubscriptionScena
...
@@ -151,9 +151,9 @@ class testSlapOSSubscriptionDualOrganisationScenario(TestSlapOSSubscriptionScena
"sale_trade_condition_module/slapos_reservation_refund_trade_condition"
)
"sale_trade_condition_module/slapos_reservation_refund_trade_condition"
)
if
subscription_request
.
getPriceCurrency
()
==
"currency_module/CNY"
:
if
subscription_request
.
getPriceCurrency
()
==
"currency_module/CNY"
:
expected_reservation_fee
=
self
.
expected_zh_reservation_fee
expected_reservation_fee
=
self
.
expected_zh_reservation_fee
_without_tax
else
:
else
:
expected_reservation_fee
=
self
.
expected_reservation_fee
expected_reservation_fee
=
self
.
expected_reservation_fee
_without_tax
self
.
assertEqual
(
round
(
sale_packing_list
.
getTotalPrice
(),
2
),
self
.
assertEqual
(
round
(
sale_packing_list
.
getTotalPrice
(),
2
),
-
round
(
expected_reservation_fee
*
amount
,
2
))
-
round
(
expected_reservation_fee
*
amount
,
2
))
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionInvitationTokenChineseScenario.py
View file @
b10ff9a5
...
@@ -52,10 +52,12 @@ class testSlapOSSubscriptionCloudInvitationTokenScenario(TestSlapOSSubscriptionC
...
@@ -52,10 +52,12 @@ class testSlapOSSubscriptionCloudInvitationTokenScenario(TestSlapOSSubscriptionC
def
_init_test_with_valid_invitation
(
self
):
def
_init_test_with_valid_invitation
(
self
):
self
.
expected_reservation_fee
=
0.0
self
.
expected_reservation_fee
=
0.0
self
.
expected_reservation_fee_without_tax
=
0.0
self
.
expected_reservation_quantity_tax
=
0.0
self
.
expected_reservation_quantity_tax
=
0.0
self
.
expected_reservation_tax
=
0.0
self
.
expected_reservation_tax
=
0.0
self
.
expected_free_reservation
=
1
self
.
expected_free_reservation
=
1
self
.
expected_zh_reservation_fee
=
0.0
self
.
expected_zh_reservation_fee
=
0.0
self
.
expected_zh_reservation_fee_without_tax
=
0.0
self
.
expected_zh_reservation_quantity_tax
=
0.0
self
.
expected_zh_reservation_quantity_tax
=
0.0
self
.
expected_zh_reservation_tax
=
0.0
self
.
expected_zh_reservation_tax
=
0.0
self
.
expected_zh_free_reservation
=
1
self
.
expected_zh_free_reservation
=
1
...
@@ -79,10 +81,12 @@ class testSlapOSSubscriptionCloudInvitationTokenScenario(TestSlapOSSubscriptionC
...
@@ -79,10 +81,12 @@ class testSlapOSSubscriptionCloudInvitationTokenScenario(TestSlapOSSubscriptionC
def
test_two_subscription_scenario_with_invitation
(
self
):
def
test_two_subscription_scenario_with_invitation
(
self
):
self
.
expected_reservation_fee
=
0.0
self
.
expected_reservation_fee
=
0.0
self
.
expected_reservation_fee_without_tax
=
0.0
self
.
expected_reservation_quantity_tax
=
0.0
self
.
expected_reservation_quantity_tax
=
0.0
self
.
expected_reservation_tax
=
0.0
self
.
expected_reservation_tax
=
0.0
self
.
expected_free_reservation
=
1
self
.
expected_free_reservation
=
1
self
.
expected_zh_reservation_fee
=
0.0
self
.
expected_zh_reservation_fee
=
0.0
self
.
expected_zh_reservation_fee_without_tax
=
0.0
self
.
expected_zh_reservation_quantity_tax
=
0.0
self
.
expected_zh_reservation_quantity_tax
=
0.0
self
.
expected_zh_reservation_tax
=
0.0
self
.
expected_zh_reservation_tax
=
0.0
self
.
expected_zh_free_reservation
=
1
self
.
expected_zh_free_reservation
=
1
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionInvitationTokenScenario.py
View file @
b10ff9a5
...
@@ -51,6 +51,7 @@ class testSlapOSSubscriptionCloudInvitationTokenScenario(TestSlapOSSubscriptionS
...
@@ -51,6 +51,7 @@ class testSlapOSSubscriptionCloudInvitationTokenScenario(TestSlapOSSubscriptionS
self
.
_test_subscription_scenario_with_existing_user
(
amount
=
1
,
language
=
"en"
)
self
.
_test_subscription_scenario_with_existing_user
(
amount
=
1
,
language
=
"en"
)
def
_init_test_with_valid_invitation
(
self
):
def
_init_test_with_valid_invitation
(
self
):
self
.
expected_reservation_fee_without_tax
=
0.0
self
.
expected_reservation_fee
=
0.0
self
.
expected_reservation_fee
=
0.0
self
.
expected_reservation_quantity_tax
=
0.0
self
.
expected_reservation_quantity_tax
=
0.0
self
.
expected_reservation_tax
=
0.0
self
.
expected_reservation_tax
=
0.0
...
@@ -74,6 +75,7 @@ class testSlapOSSubscriptionCloudInvitationTokenScenario(TestSlapOSSubscriptionS
...
@@ -74,6 +75,7 @@ class testSlapOSSubscriptionCloudInvitationTokenScenario(TestSlapOSSubscriptionS
self
.
_test_subscription_scenario_with_reversal_transaction
(
amount
=
1
)
self
.
_test_subscription_scenario_with_reversal_transaction
(
amount
=
1
)
def
test_two_subscription_scenario_with_invitation
(
self
):
def
test_two_subscription_scenario_with_invitation
(
self
):
self
.
expected_reservation_fee_without_tax
=
0.0
self
.
expected_reservation_fee
=
0.0
self
.
expected_reservation_fee
=
0.0
self
.
expected_reservation_quantity_tax
=
0.0
self
.
expected_reservation_quantity_tax
=
0.0
self
.
expected_reservation_tax
=
0.0
self
.
expected_reservation_tax
=
0.0
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionScenario.py
View file @
b10ff9a5
...
@@ -1050,10 +1050,10 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
...
@@ -1050,10 +1050,10 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
quantity
=
subscription_request
.
getQuantity
()
quantity
=
subscription_request
.
getQuantity
()
if
subscription_request
.
getPriceCurrency
()
==
"currency_module/CNY"
:
if
subscription_request
.
getPriceCurrency
()
==
"currency_module/CNY"
:
expected_individual_price_without_tax
=
self
.
expected_zh_individual_price_without_tax
expected_individual_price_without_tax
=
self
.
expected_zh_individual_price_without_tax
expected_reservation_fee
=
self
.
expected_zh_reservation_fee
expected_reservation_fee
=
self
.
expected_zh_reservation_fee
_without_tax
else
:
else
:
expected_individual_price_without_tax
=
self
.
expected_individual_price_without_tax
expected_individual_price_without_tax
=
self
.
expected_individual_price_without_tax
expected_reservation_fee
=
self
.
expected_reservation_fee
expected_reservation_fee
=
self
.
expected_reservation_fee
_without_tax
# The values are without tax
# The values are without tax
self
.
assertEqual
(
sale_packing_list_line
.
getQuantity
(),
1
*
quantity
)
self
.
assertEqual
(
sale_packing_list_line
.
getQuantity
(),
1
*
quantity
)
...
@@ -1072,9 +1072,9 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
...
@@ -1072,9 +1072,9 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
# The values are without tax
# The values are without tax
self
.
assertEqual
(
sale_packing_list_line
.
getQuantity
(),
1
)
self
.
assertEqual
(
sale_packing_list_line
.
getQuantity
(),
1
)
self
.
assertEqual
(
round
(
sale_packing_list_line
.
getPrice
(),
2
),
self
.
assertEqual
(
round
(
sale_packing_list_line
.
getPrice
(),
2
),
-
int
(
expected_reservation_fee
*
quantity
))
-
round
(
expected_reservation_fee
*
quantity
,
2
))
self
.
assertEqual
(
round
(
sale_packing_list_line
.
getTotalPrice
(),
2
),
self
.
assertEqual
(
round
(
sale_packing_list_line
.
getTotalPrice
(),
2
),
-
int
(
expected_reservation_fee
*
quantity
))
-
round
(
expected_reservation_fee
*
quantity
,
2
))
self
.
assertEqual
(
sale_packing_list
.
getCausality
(),
self
.
assertEqual
(
sale_packing_list
.
getCausality
(),
subscription_request
.
getRelativeUrl
())
subscription_request
.
getRelativeUrl
())
...
@@ -1272,11 +1272,11 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
...
@@ -1272,11 +1272,11 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
if
subscription_request
.
getPriceCurrency
()
==
"currency_module/CNY"
:
if
subscription_request
.
getPriceCurrency
()
==
"currency_module/CNY"
:
self
.
assertEqual
(
round
(
sale_packing_list
.
getTotalPrice
(),
2
),
self
.
assertEqual
(
round
(
sale_packing_list
.
getTotalPrice
(),
2
),
-
round
(
self
.
expected_zh_reservation_fee
*
amount
,
2
))
-
round
(
self
.
expected_zh_reservation_fee
_without_tax
*
amount
,
2
))
else
:
else
:
self
.
assertEqual
(
round
(
sale_packing_list
.
getTotalPrice
(),
2
),
self
.
assertEqual
(
round
(
sale_packing_list
.
getTotalPrice
(),
2
),
-
round
(
self
.
expected_reservation_fee
*
amount
,
2
))
-
round
(
self
.
expected_reservation_fee
_without_tax
*
amount
,
2
))
return
subscription_request
return
subscription_request
...
...
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