Commit fffd2a07 authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting:

* restore previous price setting
* set round price
* disable invoice generation for consumption to see test impacted
* XXX consumption price must be set to 0
  XXX migrate existing packing list
parent 1602d428
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</item> </item>
<item> <item>
<key> <string>base_price</string> </key> <key> <string>base_price</string> </key>
<value> <float>0.83</float> </value> <value> <float>1.0</float> </value>
</item> </item>
<item> <item>
<key> <string>base_price_per_slice</string> </key> <key> <string>base_price_per_slice</string> </key>
......
...@@ -97,27 +97,9 @@ if instance_tree.getCausalityState() == 'diverged': ...@@ -97,27 +97,9 @@ if instance_tree.getCausalityState() == 'diverged':
# Define the start date of the period, this can variates with the time. # Define the start date of the period, this can variates with the time.
# start_date_delta = 0 # start_date_delta = 0
if subscription_request is not None: if subscription_request is not None:
"""
# Copy from Subscription Condition the source and Source Section into the line
# RAFAEL: As the model is use single Open Order, it isn't possible to use multiple
# companies per region, so we rely on Subscription Conditions to Describe the
# providers.
edit_kw["source"] = subscription_request.getSource()
edit_kw["source_section"] = subscription_request.getSourceSection()
"""
# Quantity is double because the first invoice has to # Quantity is double because the first invoice has to
# charge for 2 months # charge for 2 months
edit_kw['quantity'] = subscription_request.getQuantity() edit_kw['quantity'] = subscription_request.getQuantity()
"""
edit_kw['price'] = subscription_request.getPrice()
edit_kw['price_currency'] = subscription_request.getPriceCurrency()
# While create move the start date to be at least 1 months
# So we can charge 3 months at once
# You can increase 65 days to generate 3 months
# You can increase 32 days to generate 2 months
# You can increase 0 days to keep generating one month only
# start_date_delta = 0
"""
open_order_line.edit( open_order_line.edit(
activate_kw=activate_kw, activate_kw=activate_kw,
......
...@@ -72,7 +72,7 @@ for movement in movement_list: ...@@ -72,7 +72,7 @@ for movement in movement_list:
specialise=specialise, specialise=specialise,
price_currency=movement.getPriceCurrency(), price_currency=movement.getPriceCurrency(),
start_date=movement.getStartDate(), start_date=movement.getStartDate(),
price=movement.getPrice(0.0) price=movement.getPrice(0.0),
) )
instance_tree = movement.getAggregateValue(portal_type="Instance Tree") instance_tree = movement.getAggregateValue(portal_type="Instance Tree")
......
...@@ -111,6 +111,7 @@ else: ...@@ -111,6 +111,7 @@ else:
destination_project=project, destination_project=project,
resource_value=service, resource_value=service,
quantity_unit=service.getQuantityUnit(), quantity_unit=service.getQuantityUnit(),
price=0,
) )
delivery.confirm(comment="Created from %s" % context.getRelativeUrl()) delivery.confirm(comment="Created from %s" % context.getRelativeUrl())
delivery.start() delivery.start()
......
...@@ -378,6 +378,7 @@ class TestSlapOSComputerConsumptionTioXMLFile_solveInvoicingGeneration( ...@@ -378,6 +378,7 @@ class TestSlapOSComputerConsumptionTioXMLFile_solveInvoicingGeneration(
self.assertEqual(line.getTitle(), "fooà") self.assertEqual(line.getTitle(), "fooà")
self.assertEqual(line.getQuantity(), 42.42) self.assertEqual(line.getQuantity(), 42.42)
self.assertEqual(line.getPrice(), 0)
self.assertEqual(line.getAggregateList(), [ self.assertEqual(line.getAggregateList(), [
self.compute_node.partition1.getRelativeUrl(), self.compute_node.partition1.getRelativeUrl(),
self.start_requested_software_instance.getRelativeUrl(), self.start_requested_software_instance.getRelativeUrl(),
...@@ -434,6 +435,7 @@ class TestSlapOSComputerConsumptionTioXMLFile_solveInvoicingGeneration( ...@@ -434,6 +435,7 @@ class TestSlapOSComputerConsumptionTioXMLFile_solveInvoicingGeneration(
self.assertEqual(line.getTitle(), "fooà") self.assertEqual(line.getTitle(), "fooà")
self.assertEqual(line.getQuantity(), 42.42) self.assertEqual(line.getQuantity(), 42.42)
self.assertEqual(line.getPrice(), 0)
self.assertEqual(line.getAggregateList(), [ self.assertEqual(line.getAggregateList(), [
self.compute_node.partition2.getRelativeUrl(), self.compute_node.partition2.getRelativeUrl(),
self.stop_requested_software_instance.getRelativeUrl(), self.stop_requested_software_instance.getRelativeUrl(),
......
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