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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
ac0e9e24
Commit
ac0e9e24
authored
Feb 24, 2023
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: testSlapOSAccountingBuilder stop using deleted business processes
parent
2654f035
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
263 additions
and
253 deletions
+263
-253
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingBuilder.py
...ortal_components/test.erp5.testSlapOSAccountingBuilder.py
+263
-253
No files found.
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingBuilder.py
View file @
ac0e9e24
...
@@ -12,33 +12,6 @@ def convertCategoryList(base, l):
...
@@ -12,33 +12,6 @@ def convertCategoryList(base, l):
return
[
'%s/%s'
%
(
base
,
q
)
for
q
in
l
]
return
[
'%s/%s'
%
(
base
,
q
)
for
q
in
l
]
class
TestSlapOSSalePackingListBuilder
(
SlapOSTestCaseMixin
):
class
TestSlapOSSalePackingListBuilder
(
SlapOSTestCaseMixin
):
def
afterSetUp
(
self
):
super
(
TestSlapOSSalePackingListBuilder
,
self
).
afterSetUp
()
self
.
expected_slapos_organisation
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
"Organisation"
,
title
=
"testSlapOSAccountingBuilder"
).
getRelativeUrl
()
self
.
slapos_project
=
self
.
addProject
()
self
.
slapos_trade_condition
=
self
.
portal
.
sale_trade_condition_module
.
newContent
(
portal_type
=
"Sale Trade Condition"
,
reference
=
'test_trade_condition%s'
%
self
.
generateNewId
(),
# XXX hardcoded
specialise
=
"business_process_module/slapos_ultimate_business_process"
)
self
.
slapos_trade_condition
.
newContent
(
portal_type
=
"Trade Model Line"
,
reference
=
"VAT"
,
resource
=
"service_module/slapos_tax"
,
base_application
=
"base_amount/invoicing/taxable"
,
trade_phase
=
"slapos/tax"
,
price
=
0.196
,
quantity
=
1.0
,
membership_criterion_base_category
=
(
'price_currency'
,),
membership_criterion_category
=
(
'price_currency/currency_module/EUR'
,)
)
self
.
slapos_trade_condition
.
validate
()
def
checkSimulationMovement
(
self
,
simulation_movement
):
def
checkSimulationMovement
(
self
,
simulation_movement
):
self
.
assertEqual
(
1.0
,
simulation_movement
.
getDeliveryRatio
())
self
.
assertEqual
(
1.0
,
simulation_movement
.
getDeliveryRatio
())
...
@@ -88,11 +61,15 @@ class TestSlapOSSalePackingListBuilder(SlapOSTestCaseMixin):
...
@@ -88,11 +61,15 @@ class TestSlapOSSalePackingListBuilder(SlapOSTestCaseMixin):
self
.
assertEqual
(
expected_stop_date
,
delivery
.
getStopDate
())
self
.
assertEqual
(
expected_stop_date
,
delivery
.
getStopDate
())
self
.
assertSameSet
([
self
.
assertSameSet
([
'ledger/automated'
,
'ledger/automated'
]
\
'source/%s'
%
self
.
expected_slapos_organisation
,
+
convertCategoryList
(
'price_currency'
,
'source_section/%s'
%
self
.
expected_slapos_organisation
,
simulation_movement
.
getPriceCurrencyList
())
\
'price_currency/currency_module/EUR'
,
+
convertCategoryList
(
'specialise'
,
'specialise/%s'
%
self
.
slapos_trade_condition
.
getRelativeUrl
()]
\
simulation_movement
.
getSpecialiseList
())
\
+
convertCategoryList
(
'source'
,
simulation_movement
.
getSourceList
())
\
+
convertCategoryList
(
'source_section'
,
simulation_movement
.
getSourceSectionList
())
\
+
convertCategoryList
(
'destination'
,
+
convertCategoryList
(
'destination'
,
simulation_movement
.
getDestinationList
())
\
simulation_movement
.
getDestinationList
())
\
+
convertCategoryList
(
'destination_section'
,
+
convertCategoryList
(
'destination_section'
,
...
@@ -105,33 +82,39 @@ class TestSlapOSSalePackingListBuilder(SlapOSTestCaseMixin):
...
@@ -105,33 +82,39 @@ class TestSlapOSSalePackingListBuilder(SlapOSTestCaseMixin):
delivery
.
getCategoryList
())
delivery
.
getCategoryList
())
def
test
(
self
):
def
test
(
self
):
instance_tree
=
self
.
portal
.
instance_tree_module
\
resource
,
_
,
_
,
_
,
_
,
instance_tree
=
self
.
bootstrapAllocableInstanceTree
(
is_accountable
=
True
)
.
template_instance_tree
.
Base_createCloneDocument
(
batch_mode
=
1
)
project
=
instance_tree
.
getFollowUpValue
()
trade_condition
=
project
.
getSpecialiseValue
()
currency
=
trade_condition
.
getPriceCurrencyValue
()
source
=
trade_condition
.
getSourceSectionValue
()
destination
=
instance_tree
.
getDestinationSectionValue
()
business_process
=
trade_condition
.
getSpecialiseValue
()
applied_rule
=
self
.
portal
.
portal_simulation
.
newContent
(
applied_rule
=
self
.
portal
.
portal_simulation
.
newContent
(
portal_type
=
'Applied Rule'
,
portal_type
=
'Applied Rule'
,
causality
=
instance_tree
.
getRelativeUrl
(),
causality
=
instance_tree
.
getRelativeUrl
(),
specialise
=
'portal_rules/slapos_subscription_item_rule'
specialise
=
'portal_rules/slapos_subscription_item_rule'
)
)
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
simulation_movement_kw
=
dict
(
simulation_movement_kw
=
dict
(
portal_type
=
'Simulation Movement'
,
portal_type
=
'Simulation Movement'
,
aggregate
=
instance_tree
.
getRelativeUrl
()
,
aggregate
_value
=
instance_tree
,
base_contribution
=
[
'base_amount/invoicing/discounted'
,
base_contribution
=
[
'base_amount/invoicing/discounted'
,
'base_amount/invoicing/taxable'
],
'base_amount/invoicing/taxable'
],
causality
=
[
'business_process_module/slapos_aggregated_business_process'
causality
=
[
'/deliver'
,
'business_process_module/slapos_sale_business_pr'
'%s/deliver'
%
business_process
.
getRelativeUrl
(),
'ocess/delivery_path'
],
'%s/delivery_path'
%
business_process
.
getRelativeUrl
()
destination_value
=
person
,
],
destination_decision_value
=
person
,
destination_value
=
destination
,
destination_section_value
=
person
,
destination_decision_value
=
destination
,
destination_project_value
=
self
.
slapos_project
,
destination_section_value
=
destination
,
price_currency
=
'currency_module/EUR'
,
destination_project_value
=
project
,
price_currency_value
=
currency
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
resource
=
'service_module/slapos_instance_subscription'
,
resource
_value
=
resource
,
source
=
self
.
expected_slapos_organisation
,
source
_value
=
source
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
ledger
=
'automated'
,
ledger
=
'automated'
,
trade_phase
=
'slapos/delivery'
,
trade_phase
=
'slapos/delivery'
,
use
=
'trade/sale'
,
use
=
'trade/sale'
,
...
@@ -186,36 +169,42 @@ class TestSlapOSSalePackingListBuilder(SlapOSTestCaseMixin):
...
@@ -186,36 +169,42 @@ class TestSlapOSSalePackingListBuilder(SlapOSTestCaseMixin):
class
TestSlapOSSaleInvoiceBuilder
(
TestSlapOSSalePackingListBuilder
):
class
TestSlapOSSaleInvoiceBuilder
(
TestSlapOSSalePackingListBuilder
):
def
test
(
self
,
causality1
=
None
,
causality2
=
None
):
# pylint: disable=arguments-differ
def
test
(
self
,
causality1
=
None
,
causality2
=
None
):
# pylint: disable=arguments-differ
person
=
self
.
portal
.
person_module
.
template_member
\
resource
,
_
,
_
,
_
,
_
,
instance_tree
=
self
.
bootstrapAllocableInstanceTree
(
is_accountable
=
True
)
.
Base_createCloneDocument
(
batch_mode
=
1
)
project
=
instance_tree
.
getFollowUpValue
()
trade_condition
=
project
.
getSpecialiseValue
()
currency
=
trade_condition
.
getPriceCurrencyValue
()
source
=
trade_condition
.
getSourceSectionValue
()
destination
=
instance_tree
.
getDestinationSectionValue
()
business_process
=
trade_condition
.
getSpecialiseValue
()
# Create Aggregated Packing List
# Create Aggregated Packing List
delivery_kw
=
dict
(
delivery_kw
=
dict
(
portal_type
=
'Sale Packing List'
,
portal_type
=
'Sale Packing List'
,
price_currency
=
'currency_module/EUR'
,
price_currency
_value
=
currency
,
source
=
self
.
expected_slapos_organisation
,
source
_value
=
source
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
ledger
=
'automated'
ledger
=
'automated'
)
)
delivery_line_kw
=
dict
(
delivery_line_kw
=
dict
(
portal_type
=
'Sale Packing List Line'
,
portal_type
=
'Sale Packing List Line'
,
resource
=
'service_module/slapos_instance_subscription'
,
resource
_value
=
resource
,
use
=
'trade/sale'
,
use
=
'trade/sale'
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
base_contribution_list
=
[
'base_amount/invoicing/discounted'
,
base_contribution_list
=
[
'base_amount/invoicing/discounted'
,
'base_amount/invoicing/taxable'
],
'base_amount/invoicing/taxable'
],
)
)
delivery_1
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
delivery_1
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
destination_value
=
pers
on
,
destination_value
=
destinati
on
,
destination_decision_value
=
pers
on
,
destination_decision_value
=
destinati
on
,
destination_section_value
=
pers
on
,
destination_section_value
=
destinati
on
,
destination_project_value
=
self
.
slapos_
project
,
destination_project_value
=
project
,
start_date
=
DateTime
(
'2012/01/01'
),
start_date
=
DateTime
(
'2012/01/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
causality_value
=
causality1
,
causality_value
=
causality1
,
**
delivery_kw
**
delivery_kw
)
)
# Create Applied rule and set causality
# Create Applied rule and set causality
applied_rule_1
=
self
.
portal
.
portal_simulation
.
newContent
(
applied_rule_1
=
self
.
portal
.
portal_simulation
.
newContent
(
portal_type
=
'Applied Rule'
,
portal_type
=
'Applied Rule'
,
...
@@ -242,10 +231,10 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -242,10 +231,10 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
# Create second delivery
# Create second delivery
delivery_2
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
delivery_2
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
destination_value
=
pers
on
,
destination_value
=
destinati
on
,
destination_decision_value
=
pers
on
,
destination_decision_value
=
destinati
on
,
destination_section_value
=
pers
on
,
destination_section_value
=
destinati
on
,
destination_project_value
=
self
.
slapos_
project
,
destination_project_value
=
project
,
start_date
=
DateTime
(
'2012/01/01'
),
start_date
=
DateTime
(
'2012/01/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
causality_value
=
causality2
,
causality_value
=
causality2
,
...
@@ -272,18 +261,18 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -272,18 +261,18 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
base_contribution
=
[
'base_amount/invoicing/discounted'
,
base_contribution
=
[
'base_amount/invoicing/discounted'
,
'base_amount/invoicing/taxable'
],
'base_amount/invoicing/taxable'
],
causality
=
[
causality
=
[
'
business_process_module/slapos_aggregated_business_process/deliver'
,
'
%s/deliver'
%
business_process
.
getRelativeUrl
()
,
'
business_process_module/slapos_sale_business_process/delivery_path'
],
'
%s/delivery_path'
%
business_process
.
getRelativeUrl
()
],
destination_value
=
pers
on
,
destination_value
=
destinati
on
,
destination_decision_value
=
pers
on
,
destination_decision_value
=
destinati
on
,
destination_section_value
=
pers
on
,
destination_section_value
=
destinati
on
,
destination_project_value
=
self
.
slapos_
project
,
destination_project_value
=
project
,
price_currency
=
'currency_module/EUR'
,
price_currency
_value
=
currency
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
resource
=
'service_module/slapos_instance_subscription'
,
resource
_value
=
resource
,
source
=
self
.
expected_slapos_organisation
,
source
_value
=
source
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
trade_phase
=
'slapos/delivery'
,
trade_phase
=
'slapos/delivery'
,
ledger
=
'automated'
,
ledger
=
'automated'
,
use
=
'trade/sale'
,
use
=
'trade/sale'
,
...
@@ -331,8 +320,8 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -331,8 +320,8 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
invoice_movement_kw
=
simulation_movement_kw
.
copy
()
invoice_movement_kw
=
simulation_movement_kw
.
copy
()
invoice_movement_kw
.
update
(
invoice_movement_kw
.
update
(
causality
=
[
causality
=
[
'
business_process_module/slapos_aggregated_business_process/invoice'
,
'
%s/invoice'
%
business_process
.
getRelativeUrl
()
,
'
business_process_module/slapos_aggregated_business_process/invoice_path'
'
%s/invoice_path'
%
business_process
.
getRelativeUrl
()
],
],
trade_phase
=
'slapos/invoicing'
trade_phase
=
'slapos/invoicing'
)
)
...
@@ -403,7 +392,7 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -403,7 +392,7 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
invoice_kw
=
dict
(
delivery_portal_type
=
'Sale Invoice Transaction'
,
invoice_kw
=
dict
(
delivery_portal_type
=
'Sale Invoice Transaction'
,
simulation_state
=
'confirmed'
)
simulation_state
=
'confirmed'
)
category_list
=
[
'resource/
currency_module/EUR'
,
'payment_mode/payzen'
]
category_list
=
[
'resource/
%s'
%
currency
.
getRelativeUrl
()
,
'payment_mode/payzen'
]
self
.
checkDelivery
(
invoice_movement_1
,
invoice_1
,
self
.
checkDelivery
(
invoice_movement_1
,
invoice_1
,
category_list
=
category_list
+
convertCategoryList
(
'causality'
,
category_list
=
category_list
+
convertCategoryList
(
'causality'
,
[
delivery_1
.
getRelativeUrl
(),
delivery_2
.
getRelativeUrl
()]),
**
invoice_kw
)
[
delivery_1
.
getRelativeUrl
(),
delivery_2
.
getRelativeUrl
()]),
**
invoice_kw
)
...
@@ -488,6 +477,7 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -488,6 +477,7 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
self
.
_test_with_different_causality
(
causality1
=
causality1
,
causality2
=
causality2
)
self
.
_test_with_different_causality
(
causality1
=
causality1
,
causality2
=
causality2
)
def
test_with_ssingle_ausality
(
self
):
def
test_with_ssingle_ausality
(
self
):
self
.
portal
.
testromain
()
causality1
=
self
.
portal
.
subscription_request_module
.
newContent
(
causality1
=
self
.
portal
.
subscription_request_module
.
newContent
(
portal_type
=
"Subscription Request"
,
portal_type
=
"Subscription Request"
,
)
)
...
@@ -495,31 +485,35 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -495,31 +485,35 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
def
_test_with_different_causality
(
self
,
causality1
=
None
,
causality2
=
None
):
def
_test_with_different_causality
(
self
,
causality1
=
None
,
causality2
=
None
):
resource
,
_
,
_
,
_
,
_
,
instance_tree
=
self
.
bootstrapAllocableInstanceTree
(
is_accountable
=
True
)
project
=
instance_tree
.
getFollowUpValue
()
trade_condition
=
project
.
getSpecialiseValue
()
currency
=
trade_condition
.
getPriceCurrencyValue
()
source
=
trade_condition
.
getSourceSectionValue
()
destination
=
instance_tree
.
getDestinationSectionValue
()
business_process
=
trade_condition
.
getSpecialiseValue
()
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
# Create Aggregated Packing List
# Create Aggregated Packing List
delivery_kw
=
dict
(
delivery_kw
=
dict
(
portal_type
=
'Sale Packing List'
,
portal_type
=
'Sale Packing List'
,
price_currency
=
'currency_module/EUR'
,
price_currency
_value
=
currency
,
source
=
self
.
expected_slapos_organisation
,
source
_value
=
source
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
)
)
delivery_line_kw
=
dict
(
delivery_line_kw
=
dict
(
portal_type
=
'Sale Packing List Line'
,
portal_type
=
'Sale Packing List Line'
,
resource
=
'service_module/slapos_instance_subscription'
,
resource
_value
=
resource
,
use
=
'trade/sale'
,
use
=
'trade/sale'
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
base_contribution_list
=
[
'base_amount/invoicing/discounted'
,
base_contribution_list
=
[
'base_amount/invoicing/discounted'
,
'base_amount/invoicing/taxable'
],
'base_amount/invoicing/taxable'
],
)
)
delivery_1
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
delivery_1
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
destination_value
=
pers
on
,
destination_value
=
destinati
on
,
destination_decision_value
=
pers
on
,
destination_decision_value
=
destinati
on
,
destination_section_value
=
pers
on
,
destination_section_value
=
destinati
on
,
destination_project_value
=
self
.
slapos_
project
,
destination_project_value
=
project
,
start_date
=
DateTime
(
'2012/01/01'
),
start_date
=
DateTime
(
'2012/01/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
causality_value
=
causality1
,
causality_value
=
causality1
,
...
@@ -553,10 +547,10 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -553,10 +547,10 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
# Create second delivery
# Create second delivery
delivery_2
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
delivery_2
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
destination_value
=
pers
on
,
destination_value
=
destinati
on
,
destination_decision_value
=
pers
on
,
destination_decision_value
=
destinati
on
,
destination_section_value
=
pers
on
,
destination_section_value
=
destinati
on
,
destination_project_value
=
self
.
slapos_
project
,
destination_project_value
=
project
,
start_date
=
DateTime
(
'2012/01/01'
),
start_date
=
DateTime
(
'2012/01/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
causality_value
=
causality2
,
causality_value
=
causality2
,
...
@@ -584,18 +578,18 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -584,18 +578,18 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
base_contribution
=
[
'base_amount/invoicing/discounted'
,
base_contribution
=
[
'base_amount/invoicing/discounted'
,
'base_amount/invoicing/taxable'
],
'base_amount/invoicing/taxable'
],
causality
=
[
causality
=
[
'
business_process_module/slapos_aggregated_business_process/deliver'
,
'
%s/deliver'
%
business_process
.
getRelativeUrl
()
,
'
business_process_module/slapos_sale_business_process/delivery_path'
],
'
%s/delivery_path'
%
business_process
.
getRelativeUrl
()
],
destination_value
=
pers
on
,
destination_value
=
destinati
on
,
destination_decision_value
=
pers
on
,
destination_decision_value
=
destinati
on
,
destination_section_value
=
pers
on
,
destination_section_value
=
destinati
on
,
destination_project_value
=
self
.
slapos_
project
,
destination_project_value
=
project
,
price_currency
=
'currency_module/EUR'
,
price_currency
_value
=
currency
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
resource
=
'service_module/slapos_instance_subscription'
,
resource
_value
=
resource
,
source
=
self
.
expected_slapos_organisation
,
source
_value
=
source
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
trade_phase
=
'slapos/delivery'
,
trade_phase
=
'slapos/delivery'
,
ledger
=
'automated'
,
ledger
=
'automated'
,
use
=
'trade/sale'
,
use
=
'trade/sale'
,
...
@@ -643,8 +637,8 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -643,8 +637,8 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
invoice_movement_kw
=
simulation_movement_kw
.
copy
()
invoice_movement_kw
=
simulation_movement_kw
.
copy
()
invoice_movement_kw
.
update
(
invoice_movement_kw
.
update
(
causality
=
[
causality
=
[
'
business_process_module/slapos_aggregated_business_process/invoice'
,
'
%s/invoice'
%
business_process
.
getRelativeUrl
()
,
'
business_process_module/slapos_aggregated_business_process/invoice_path'
'
%s/invoice_path'
%
business_process
.
getRelativeUrl
()
],
],
trade_phase
=
'slapos/invoicing'
trade_phase
=
'slapos/invoicing'
)
)
...
@@ -714,7 +708,7 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -714,7 +708,7 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
invoice_kw
=
dict
(
delivery_portal_type
=
'Sale Invoice Transaction'
,
invoice_kw
=
dict
(
delivery_portal_type
=
'Sale Invoice Transaction'
,
simulation_state
=
'confirmed'
)
simulation_state
=
'confirmed'
)
category_list
=
[
'resource/
currency_module/EUR'
,
'payment_mode/payzen'
]
category_list
=
[
'resource/
%s'
%
currency
.
getRelativeUrl
()
,
'payment_mode/payzen'
]
self
.
checkDelivery
(
invoice_movement_1
,
invoice_1
,
self
.
checkDelivery
(
invoice_movement_1
,
invoice_1
,
category_list
=
category_list
+
convertCategoryList
(
'causality'
,
category_list
=
category_list
+
convertCategoryList
(
'causality'
,
[
delivery_1
.
getRelativeUrl
()]),
**
invoice_kw
)
[
delivery_1
.
getRelativeUrl
()]),
**
invoice_kw
)
...
@@ -774,30 +768,36 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -774,30 +768,36 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
)
)
def
test_with_different_date
(
self
):
def
test_with_different_date
(
self
):
person
=
self
.
portal
.
person_module
.
template_member
\
resource
,
_
,
_
,
_
,
_
,
instance_tree
=
self
.
bootstrapAllocableInstanceTree
(
is_accountable
=
True
)
.
Base_createCloneDocument
(
batch_mode
=
1
)
project
=
instance_tree
.
getFollowUpValue
()
trade_condition
=
project
.
getSpecialiseValue
()
currency
=
trade_condition
.
getPriceCurrencyValue
()
source
=
trade_condition
.
getSourceSectionValue
()
destination
=
instance_tree
.
getDestinationSectionValue
()
business_process
=
trade_condition
.
getSpecialiseValue
()
# Create Aggregated Packing List
# Create Aggregated Packing List
delivery_kw
=
dict
(
delivery_kw
=
dict
(
portal_type
=
'Sale Packing List'
,
portal_type
=
'Sale Packing List'
,
price_currency
=
'currency_module/EUR'
,
price_currency
_value
=
currency
,
source
=
self
.
expected_slapos_organisation
,
source
_value
=
source
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
ledger
=
'automated'
ledger
=
'automated'
)
)
delivery_line_kw
=
dict
(
delivery_line_kw
=
dict
(
portal_type
=
'Sale Packing List Line'
,
portal_type
=
'Sale Packing List Line'
,
resource
=
'service_module/slapos_instance_subscription'
,
resource
_value
=
resource
,
use
=
'trade/sale'
,
use
=
'trade/sale'
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
base_contribution_list
=
[
'base_amount/invoicing/discounted'
,
base_contribution_list
=
[
'base_amount/invoicing/discounted'
,
'base_amount/invoicing/taxable'
],
'base_amount/invoicing/taxable'
],
)
)
delivery_1
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
delivery_1
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
destination_value
=
pers
on
,
destination_value
=
destinati
on
,
destination_decision_value
=
pers
on
,
destination_decision_value
=
destinati
on
,
destination_section_value
=
pers
on
,
destination_section_value
=
destinati
on
,
destination_project_value
=
self
.
slapos_
project
,
destination_project_value
=
project
,
start_date
=
DateTime
(
'2012/01/01'
),
start_date
=
DateTime
(
'2012/01/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
**
delivery_kw
**
delivery_kw
...
@@ -829,10 +829,10 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -829,10 +829,10 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
# Create second delivery
# Create second delivery
delivery_2
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
delivery_2
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
destination_value
=
pers
on
,
destination_value
=
destinati
on
,
destination_decision_value
=
pers
on
,
destination_decision_value
=
destinati
on
,
destination_section_value
=
pers
on
,
destination_section_value
=
destinati
on
,
destination_project_value
=
self
.
slapos_
project
,
destination_project_value
=
project
,
start_date
=
DateTime
(
'2012/02/01'
),
start_date
=
DateTime
(
'2012/02/01'
),
stop_date
=
DateTime
(
'2012/03/01'
),
stop_date
=
DateTime
(
'2012/03/01'
),
**
delivery_kw
**
delivery_kw
...
@@ -858,18 +858,18 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -858,18 +858,18 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
base_contribution
=
[
'base_amount/invoicing/discounted'
,
base_contribution
=
[
'base_amount/invoicing/discounted'
,
'base_amount/invoicing/taxable'
],
'base_amount/invoicing/taxable'
],
causality
=
[
causality
=
[
'
business_process_module/slapos_aggregated_business_process/deliver'
,
'
%s/deliver'
%
business_process
.
getRelativeUrl
()
,
'
business_process_module/slapos_sale_business_process/delivery_path'
],
'
%s/delivery_path'
%
business_process
.
getRelativeUrl
()
],
destination_value
=
pers
on
,
destination_value
=
destinati
on
,
destination_decision_value
=
pers
on
,
destination_decision_value
=
destinati
on
,
destination_section_value
=
pers
on
,
destination_section_value
=
destinati
on
,
destination_project_value
=
self
.
slapos_
project
,
destination_project_value
=
project
,
price_currency
=
'currency_module/EUR'
,
price_currency
_value
=
currency
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
resource
=
'service_module/slapos_instance_subscription'
,
resource
_value
=
resource
,
source
=
self
.
expected_slapos_organisation
,
source
_value
=
source
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
trade_phase
=
'slapos/delivery'
,
trade_phase
=
'slapos/delivery'
,
ledger
=
'automated'
,
ledger
=
'automated'
,
use
=
'trade/sale'
,
use
=
'trade/sale'
,
...
@@ -917,8 +917,8 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -917,8 +917,8 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
invoice_movement_kw
=
simulation_movement_kw
.
copy
()
invoice_movement_kw
=
simulation_movement_kw
.
copy
()
invoice_movement_kw
.
update
(
invoice_movement_kw
.
update
(
causality
=
[
causality
=
[
'
business_process_module/slapos_aggregated_business_process/invoice'
,
'
%s/invoice'
%
business_process
.
getRelativeUrl
()
,
'
business_process_module/slapos_aggregated_business_process/invoice_path'
'
%s/invoice_path'
%
business_process
.
getRelativeUrl
()
],
],
trade_phase
=
'slapos/invoicing'
trade_phase
=
'slapos/invoicing'
)
)
...
@@ -993,7 +993,7 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -993,7 +993,7 @@ class TestSlapOSSaleInvoiceBuilder(TestSlapOSSalePackingListBuilder):
invoice_kw
=
dict
(
delivery_portal_type
=
'Sale Invoice Transaction'
,
invoice_kw
=
dict
(
delivery_portal_type
=
'Sale Invoice Transaction'
,
simulation_state
=
'confirmed'
,
expected_start_date
=
expected_start_date
,
simulation_state
=
'confirmed'
,
expected_start_date
=
expected_start_date
,
expected_stop_date
=
expected_stop_date
)
expected_stop_date
=
expected_stop_date
)
category_list
=
[
'resource/
currency_module/EUR'
,
'payment_mode/payzen'
]
category_list
=
[
'resource/
%s'
%
currency
.
getRelativeUrl
()
,
'payment_mode/payzen'
]
self
.
checkDelivery
(
invoice_movement_1
,
invoice_1
,
self
.
checkDelivery
(
invoice_movement_1
,
invoice_1
,
category_list
=
category_list
+
convertCategoryList
(
'causality'
,
category_list
=
category_list
+
convertCategoryList
(
'causality'
,
...
@@ -1070,6 +1070,14 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1070,6 +1070,14 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
self
.
assertNotEqual
(
None
,
simulation_movement
.
getDeliveryValue
())
self
.
assertNotEqual
(
None
,
simulation_movement
.
getDeliveryValue
())
def
test
(
self
):
def
test
(
self
):
resource
,
_
,
_
,
_
,
_
,
instance_tree
=
self
.
bootstrapAllocableInstanceTree
(
is_accountable
=
True
)
project
=
instance_tree
.
getFollowUpValue
()
trade_condition
=
project
.
getSpecialiseValue
()
currency
=
trade_condition
.
getPriceCurrencyValue
()
source
=
trade_condition
.
getSourceSectionValue
()
destination
=
instance_tree
.
getDestinationSectionValue
()
business_process
=
trade_condition
.
getSpecialiseValue
()
applied_rule_1
=
self
.
portal
.
portal_simulation
.
newContent
(
applied_rule_1
=
self
.
portal
.
portal_simulation
.
newContent
(
portal_type
=
'Applied Rule'
,
portal_type
=
'Applied Rule'
,
specialise
=
'portal_rules/slapos_delivery_root_simulation_rule'
specialise
=
'portal_rules/slapos_delivery_root_simulation_rule'
...
@@ -1078,8 +1086,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1078,8 +1086,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
portal_type
=
'Applied Rule'
,
portal_type
=
'Applied Rule'
,
specialise
=
'portal_rules/slapos_delivery_root_simulation_rule'
specialise
=
'portal_rules/slapos_delivery_root_simulation_rule'
)
)
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
simulation_movement_1
=
applied_rule_1
.
newContent
(
simulation_movement_1
=
applied_rule_1
.
newContent
(
portal_type
=
'Simulation Movement'
portal_type
=
'Simulation Movement'
)
)
...
@@ -1090,18 +1097,18 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1090,18 +1097,18 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
# linked invoice
# linked invoice
invoice_kw
=
dict
(
invoice_kw
=
dict
(
portal_type
=
'Sale Invoice Transaction'
,
portal_type
=
'Sale Invoice Transaction'
,
source
=
self
.
expected_slapos_organisation
,
source
_value
=
source
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
price_currency
=
'currency_module/EUR'
,
price_currency
_value
=
currency
,
resource
=
'currency_module/EUR'
,
resource
_value
=
currency
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
created_by_builder
=
1
,
created_by_builder
=
1
,
ledger
=
'automated'
ledger
=
'automated'
)
)
invoice_line_kw
=
dict
(
invoice_line_kw
=
dict
(
portal_type
=
'Invoice Line'
,
portal_type
=
'Invoice Line'
,
use
=
'trade/sale'
,
use
=
'trade/sale'
,
resource
=
'service_module/slapos_instance_subscription'
,
resource
_value
=
resource
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
base_contribution
=
[
'base_amount/invoicing/discounted'
,
base_contribution
=
[
'base_amount/invoicing/discounted'
,
'base_amount/invoicing/taxable'
],
'base_amount/invoicing/taxable'
],
...
@@ -1116,10 +1123,10 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1116,10 +1123,10 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
invoice_1
=
self
.
portal
.
accounting_module
.
newContent
(
invoice_1
=
self
.
portal
.
accounting_module
.
newContent
(
start_date
=
DateTime
(
'2012/01/01'
),
start_date
=
DateTime
(
'2012/01/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
destination_value
=
pers
on
,
destination_value
=
destinati
on
,
destination_section_value
=
pers
on
,
destination_section_value
=
destinati
on
,
destination_decision_value
=
pers
on
,
destination_decision_value
=
destinati
on
,
destination_project_value
=
self
.
slapos_
project
,
destination_project_value
=
project
,
**
invoice_kw
**
invoice_kw
)
)
invoice_line_1
=
invoice_1
.
newContent
(
invoice_line_1
=
invoice_1
.
newContent
(
...
@@ -1135,10 +1142,10 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1135,10 +1142,10 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
invoice_2
=
self
.
portal
.
accounting_module
.
newContent
(
invoice_2
=
self
.
portal
.
accounting_module
.
newContent
(
start_date
=
DateTime
(
'2012/01/01'
),
start_date
=
DateTime
(
'2012/01/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
destination_value
=
pers
on
,
destination_value
=
destinati
on
,
destination_section_value
=
pers
on
,
destination_section_value
=
destinati
on
,
destination_decision_value
=
pers
on
,
destination_decision_value
=
destinati
on
,
destination_project_value
=
self
.
slapos_
project
,
destination_project_value
=
project
,
**
invoice_kw
**
invoice_kw
)
)
invoice_line_2
=
invoice_2
.
newContent
(
invoice_line_2
=
invoice_2
.
newContent
(
...
@@ -1159,8 +1166,8 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1159,8 +1166,8 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
# create new simulation movements
# create new simulation movements
invoice_movement_kw
=
dict
(
invoice_movement_kw
=
dict
(
causality
=
[
causality
=
[
'
business_process_module/slapos_aggregated_business_process/invoice'
,
'
%s/invoice'
%
business_process
.
getRelativeUrl
()
,
'
business_process_module/slapos_aggregated_business_process/invoice_path'
'
%s/invoice_path'
%
business_process
.
getRelativeUrl
()
],
],
trade_phase
=
'slapos/invoicing'
,
trade_phase
=
'slapos/invoicing'
,
delivery_ratio
=
1.0
,
delivery_ratio
=
1.0
,
...
@@ -1168,16 +1175,16 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1168,16 +1175,16 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
portal_type
=
'Simulation Movement'
,
portal_type
=
'Simulation Movement'
,
base_contribution
=
[
'base_amount/invoicing/discounted'
,
base_contribution
=
[
'base_amount/invoicing/discounted'
,
'base_amount/invoicing/taxable'
],
'base_amount/invoicing/taxable'
],
destination_value
=
pers
on
,
destination_value
=
destinati
on
,
destination_section_value
=
pers
on
,
destination_section_value
=
destinati
on
,
destination_decision_value
=
pers
on
,
destination_decision_value
=
destinati
on
,
destination_project_value
=
self
.
slapos_
project
,
destination_project_value
=
project
,
price_currency
=
'currency_module/EUR'
,
price_currency
_value
=
currency
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
resource
=
'service_module/slapos_instance_subscription'
,
resource
_value
=
resource
,
source
=
self
.
expected_slapos_organisation
,
source
_value
=
source
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
use
=
'trade/sale'
,
use
=
'trade/sale'
,
ledger
=
'automated'
ledger
=
'automated'
)
)
...
@@ -1197,15 +1204,15 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1197,15 +1204,15 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
price
=
.
196
,
price
=
.
196
,
delivery_ratio
=
1.
,
delivery_ratio
=
1.
,
delivery_error
=
0.
,
delivery_error
=
0.
,
price_currency
=
'currency_module/EUR'
,
price_currency
_value
=
currency
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
resource
=
'service_module/slapos_tax'
,
resource
=
'service_module/slapos_tax'
,
base_application
=
'base_amount/invoicing/taxable'
,
base_application
=
'base_amount/invoicing/taxable'
,
use
=
'trade/tax'
,
use
=
'trade/tax'
,
ledger
=
'automated'
,
ledger
=
'automated'
,
causality
=
[
'
business_process_module/slapos_aggregated_business_process/tax'
,
causality
=
[
'
%s/tax'
%
business_process
.
getRelativeUrl
()
,
'
business_process_module/slapos_aggregated_business_process/trade_model_path'
,
'
%s/trade_model_path'
%
business_process
.
getRelativeUrl
()
,
'
sale_trade_condition_module/slapos_aggregated_trade_condition/1'
],
'
%s/1'
%
trade_condition
.
getRelativeUrl
()
],
)
)
trade_model_rule_1
=
invoice_movement_1
.
newContent
(
trade_model_rule_1
=
invoice_movement_1
.
newContent
(
portal_type
=
'Applied Rule'
,
portal_type
=
'Applied Rule'
,
...
@@ -1261,18 +1268,17 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1261,18 +1268,17 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
)
)
transaction_movement_1_rec
=
transaction_rule_1
.
newContent
(
transaction_movement_1_rec
=
transaction_rule_1
.
newContent
(
portal_type
=
'Simulation Movement'
,
portal_type
=
'Simulation Movement'
,
causality
=
[
'business_process_module/slapos_aggregated_business_process/account'
,
causality
=
[
'%s/account'
%
business_process
.
getRelativeUrl
(),
'business_process_module/slapos_aggregated_business_process/account_debi'
'%s/account_debit_path'
%
business_process
.
getRelativeUrl
()],
't_path'
],
destination
=
[
'account_module/payable'
],
destination
=
[
'account_module/payable'
],
destination_decision
=
invoice_movement_1
.
getDestinationDecision
(),
destination_decision
=
invoice_movement_1
.
getDestinationDecision
(),
destination_section
=
invoice_movement_1
.
getDestinationSection
(),
destination_section
=
invoice_movement_1
.
getDestinationSection
(),
destination_project
=
invoice_movement_1
.
getDestinationProject
(),
destination_project
=
invoice_movement_1
.
getDestinationProject
(),
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
resource
=
'currency_module/EUR'
,
resource
_value
=
currency
,
source
=
'account_module/receivable'
,
source
=
'account_module/receivable'
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
trade_phase
=
'slapos/accounting'
,
trade_phase
=
'slapos/accounting'
,
ledger
=
'automated'
,
ledger
=
'automated'
,
price
=
1.0
,
price
=
1.0
,
...
@@ -1283,18 +1289,17 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1283,18 +1289,17 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
transaction_movement_1_rec_bis
.
edit
(
delivery
=
None
,
delivery_ratio
=
1.0
)
transaction_movement_1_rec_bis
.
edit
(
delivery
=
None
,
delivery_ratio
=
1.0
)
transaction_movement_1_sal
=
transaction_rule_1
.
newContent
(
transaction_movement_1_sal
=
transaction_rule_1
.
newContent
(
portal_type
=
'Simulation Movement'
,
portal_type
=
'Simulation Movement'
,
causality
=
[
'business_process_module/slapos_aggregated_business_process/account'
,
causality
=
[
'%s/account'
%
business_process
.
getRelativeUrl
(),
'business_process_module/slapos_aggregated_business_process/account_cred'
'%s/account_credit_path'
%
business_process
.
getRelativeUrl
()],
'it_path'
],
destination
=
[
'account_module/purchase'
],
destination
=
[
'account_module/purchase'
],
destination_decision
=
invoice_movement_1
.
getDestinationDecision
(),
destination_decision
=
invoice_movement_1
.
getDestinationDecision
(),
destination_section
=
invoice_movement_1
.
getDestinationSection
(),
destination_section
=
invoice_movement_1
.
getDestinationSection
(),
destination_project
=
invoice_movement_1
.
getDestinationProject
(),
destination_project
=
invoice_movement_1
.
getDestinationProject
(),
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
resource
=
'currency_module/EUR'
,
resource
_value
=
currency
,
source
=
'account_module/receivable'
,
source
=
'account_module/receivable'
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
trade_phase
=
'slapos/accounting'
,
trade_phase
=
'slapos/accounting'
,
ledger
=
'automated'
,
ledger
=
'automated'
,
price
=
1.0
,
price
=
1.0
,
...
@@ -1307,17 +1312,17 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1307,17 +1312,17 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
)
)
transation_model_movement_1_rec
=
transation_model_rule_1
.
newContent
(
transation_model_movement_1_rec
=
transation_model_rule_1
.
newContent
(
portal_type
=
'Simulation Movement'
,
portal_type
=
'Simulation Movement'
,
causality
=
[
'
business_process_module/slapos_aggregated_business_process/account'
,
causality
=
[
'
%s/account'
%
business_process
.
getRelativeUrl
()
,
'
business_process_module/slapos_aggregated_business_process/accounting_tax2'
],
'
%s/accounting_tax2'
%
business_process
.
getRelativeUrl
()
],
destination
=
[
'account_module/payable'
],
destination
=
[
'account_module/payable'
],
destination_decision
=
invoice_movement_1
.
getDestinationDecision
(),
destination_decision
=
invoice_movement_1
.
getDestinationDecision
(),
destination_section
=
invoice_movement_1
.
getDestinationSection
(),
destination_section
=
invoice_movement_1
.
getDestinationSection
(),
destination_project
=
invoice_movement_1
.
getDestinationProject
(),
destination_project
=
invoice_movement_1
.
getDestinationProject
(),
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
resource
=
'currency_module/EUR'
,
resource
_value
=
currency
,
source
=
'account_module/receivable'
,
source
=
'account_module/receivable'
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
trade_phase
=
'slapos/accounting'
,
trade_phase
=
'slapos/accounting'
,
ledger
=
'automated'
,
ledger
=
'automated'
,
price
=
1.0
,
price
=
1.0
,
...
@@ -1328,17 +1333,17 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1328,17 +1333,17 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
transation_model_movement_1_rec_bis
.
edit
(
delivery
=
None
,
delivery_ratio
=
1.0
)
transation_model_movement_1_rec_bis
.
edit
(
delivery
=
None
,
delivery_ratio
=
1.0
)
transation_model_movement_1_sal
=
transation_model_rule_1
.
newContent
(
transation_model_movement_1_sal
=
transation_model_rule_1
.
newContent
(
portal_type
=
'Simulation Movement'
,
portal_type
=
'Simulation Movement'
,
causality
=
[
'
business_process_module/slapos_aggregated_business_process/account'
,
causality
=
[
'
%s/account'
%
business_process
.
getRelativeUrl
()
,
'
business_process_module/slapos_aggregated_business_process/accounting_tax1'
],
'
%s/accounting_tax1'
%
business_process
.
getRelativeUrl
()
],
destination
=
[
'account_module/refundable_vat'
],
destination
=
[
'account_module/refundable_vat'
],
destination_decision
=
invoice_movement_1
.
getDestinationDecision
(),
destination_decision
=
invoice_movement_1
.
getDestinationDecision
(),
destination_section
=
invoice_movement_1
.
getDestinationSection
(),
destination_section
=
invoice_movement_1
.
getDestinationSection
(),
destination_project
=
invoice_movement_1
.
getDestinationProject
(),
destination_project
=
invoice_movement_1
.
getDestinationProject
(),
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
resource
=
'currency_module/EUR'
,
resource
_value
=
currency
,
source
=
'account_module/coll_vat'
,
source
=
'account_module/coll_vat'
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
trade_phase
=
'slapos/accounting'
,
trade_phase
=
'slapos/accounting'
,
ledger
=
'automated'
,
ledger
=
'automated'
,
price
=
1.0
,
price
=
1.0
,
...
@@ -1351,18 +1356,17 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1351,18 +1356,17 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
)
)
transaction_movement_2_rec
=
transaction_rule_2
.
newContent
(
transaction_movement_2_rec
=
transaction_rule_2
.
newContent
(
portal_type
=
'Simulation Movement'
,
portal_type
=
'Simulation Movement'
,
causality
=
[
'business_process_module/slapos_aggregated_business_process/account'
,
causality
=
[
'%s/account'
%
business_process
.
getRelativeUrl
(),
'business_process_module/slapos_aggregated_business_process/account_debi'
'%s/account_debit_path'
%
business_process
.
getRelativeUrl
()],
't_path'
],
destination
=
[
'account_module/payable'
],
destination
=
[
'account_module/payable'
],
destination_decision
=
invoice_movement_2
.
getDestinationDecision
(),
destination_decision
=
invoice_movement_2
.
getDestinationDecision
(),
destination_section
=
invoice_movement_2
.
getDestinationSection
(),
destination_section
=
invoice_movement_2
.
getDestinationSection
(),
destination_project
=
invoice_movement_2
.
getDestinationProject
(),
destination_project
=
invoice_movement_2
.
getDestinationProject
(),
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
resource
=
'currency_module/EUR'
,
resource
_value
=
currency
,
source
=
'account_module/receivable'
,
source
=
'account_module/receivable'
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
trade_phase
=
'slapos/accounting'
,
trade_phase
=
'slapos/accounting'
,
ledger
=
'automated'
,
ledger
=
'automated'
,
price
=
1.0
,
price
=
1.0
,
...
@@ -1370,18 +1374,17 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1370,18 +1374,17 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
)
)
transaction_movement_2_sal
=
transaction_rule_2
.
newContent
(
transaction_movement_2_sal
=
transaction_rule_2
.
newContent
(
portal_type
=
'Simulation Movement'
,
portal_type
=
'Simulation Movement'
,
causality
=
[
'business_process_module/slapos_aggregated_business_process/account'
,
causality
=
[
'%s/account'
%
business_process
.
getRelativeUrl
(),
'business_process_module/slapos_aggregated_business_process/account_cred'
'%s/account_credit_path'
%
business_process
.
getRelativeUrl
()],
'it_path'
],
destination
=
[
'account_module/purchase'
],
destination
=
[
'account_module/purchase'
],
destination_decision
=
invoice_movement_2
.
getDestinationDecision
(),
destination_decision
=
invoice_movement_2
.
getDestinationDecision
(),
destination_section
=
invoice_movement_2
.
getDestinationSection
(),
destination_section
=
invoice_movement_2
.
getDestinationSection
(),
destination_project
=
invoice_movement_2
.
getDestinationProject
(),
destination_project
=
invoice_movement_2
.
getDestinationProject
(),
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
resource
=
'currency_module/EUR'
,
resource
_value
=
currency
,
source
=
'account_module/receivable'
,
source
=
'account_module/receivable'
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
trade_phase
=
'slapos/accounting'
,
trade_phase
=
'slapos/accounting'
,
ledger
=
'automated'
,
ledger
=
'automated'
,
price
=
1.0
,
price
=
1.0
,
...
@@ -1394,17 +1397,17 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1394,17 +1397,17 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
)
)
transation_model_movement_2_rec
=
transation_model_rule_2
.
newContent
(
transation_model_movement_2_rec
=
transation_model_rule_2
.
newContent
(
portal_type
=
'Simulation Movement'
,
portal_type
=
'Simulation Movement'
,
causality
=
[
'
business_process_module/slapos_aggregated_business_process/account'
,
causality
=
[
'
%s/account'
%
business_process
.
getRelativeUrl
()
,
'
business_process_module/slapos_aggregated_business_process/accounting_tax2'
],
'
%s/accounting_tax2'
%
business_process
.
getRelativeUrl
()
],
destination
=
[
'account_module/payable'
],
destination
=
[
'account_module/payable'
],
destination_decision
=
invoice_movement_2
.
getDestinationDecision
(),
destination_decision
=
invoice_movement_2
.
getDestinationDecision
(),
destination_section
=
invoice_movement_2
.
getDestinationSection
(),
destination_section
=
invoice_movement_2
.
getDestinationSection
(),
destination_project
=
invoice_movement_2
.
getDestinationProject
(),
destination_project
=
invoice_movement_2
.
getDestinationProject
(),
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
resource
=
'currency_module/EUR'
,
resource
_value
=
currency
,
source
=
'account_module/receivable'
,
source
=
'account_module/receivable'
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
trade_phase
=
'slapos/accounting'
,
trade_phase
=
'slapos/accounting'
,
ledger
=
'automated'
,
ledger
=
'automated'
,
price
=
1.0
,
price
=
1.0
,
...
@@ -1412,17 +1415,17 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1412,17 +1415,17 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
)
)
transation_model_movement_2_sal
=
transation_model_rule_2
.
newContent
(
transation_model_movement_2_sal
=
transation_model_rule_2
.
newContent
(
portal_type
=
'Simulation Movement'
,
portal_type
=
'Simulation Movement'
,
causality
=
[
'
business_process_module/slapos_aggregated_business_process/account'
,
causality
=
[
'
%s/account'
%
business_process
.
getRelativeUrl
()
,
'
business_process_module/slapos_aggregated_business_process/accounting_tax1'
],
'
%s/accounting_tax1'
%
business_process
.
getRelativeUrl
()
],
destination
=
[
'account_module/refundable_vat'
],
destination
=
[
'account_module/refundable_vat'
],
destination_decision
=
invoice_movement_2
.
getDestinationDecision
(),
destination_decision
=
invoice_movement_2
.
getDestinationDecision
(),
destination_section
=
invoice_movement_2
.
getDestinationSection
(),
destination_section
=
invoice_movement_2
.
getDestinationSection
(),
destination_project
=
invoice_movement_2
.
getDestinationProject
(),
destination_project
=
invoice_movement_2
.
getDestinationProject
(),
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
resource
=
'currency_module/EUR'
,
resource
_value
=
currency
,
source
=
'account_module/coll_vat'
,
source
=
'account_module/coll_vat'
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
trade_phase
=
'slapos/accounting'
,
trade_phase
=
'slapos/accounting'
,
ledger
=
'automated'
,
ledger
=
'automated'
,
price
=
1.0
,
price
=
1.0
,
...
@@ -1466,7 +1469,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
...
@@ -1466,7 +1469,7 @@ class TestSlapOSSaleInvoiceTransactionBuilder(TestSlapOSSalePackingListBuilder):
self
.
assertEqual
(
'Sale Invoice Transaction Line'
,
self
.
assertEqual
(
'Sale Invoice Transaction Line'
,
transaction_line
.
getPortalType
())
transaction_line
.
getPortalType
())
self
.
assertSameSet
([
self
.
assertSameSet
([
'resource/
currency_module/EUR'
]
+
category_list
,
'resource/
%s'
%
currency
.
getRelativeUrl
()
]
+
category_list
,
transaction_line
.
getCategoryList
()
transaction_line
.
getCategoryList
()
)
)
self
.
assertEqual
(
simulation_movement
.
getQuantity
(),
self
.
assertEqual
(
simulation_movement
.
getQuantity
(),
...
@@ -1597,6 +1600,14 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
...
@@ -1597,6 +1600,14 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
self
.
assertNotEqual
(
None
,
simulation_movement
.
getDeliveryValue
())
self
.
assertNotEqual
(
None
,
simulation_movement
.
getDeliveryValue
())
def
test
(
self
):
def
test
(
self
):
resource
,
_
,
_
,
_
,
_
,
instance_tree
=
self
.
bootstrapAllocableInstanceTree
(
is_accountable
=
True
)
project
=
instance_tree
.
getFollowUpValue
()
trade_condition
=
project
.
getSpecialiseValue
()
currency
=
trade_condition
.
getPriceCurrencyValue
()
source
=
trade_condition
.
getSourceSectionValue
()
destination
=
instance_tree
.
getDestinationSectionValue
()
business_process
=
trade_condition
.
getSpecialiseValue
()
applied_rule_1
=
self
.
portal
.
portal_simulation
.
newContent
(
applied_rule_1
=
self
.
portal
.
portal_simulation
.
newContent
(
portal_type
=
'Applied Rule'
,
portal_type
=
'Applied Rule'
,
specialise
=
'portal_rules/slapos_delivery_root_simulation_rule'
specialise
=
'portal_rules/slapos_delivery_root_simulation_rule'
...
@@ -1605,8 +1616,7 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
...
@@ -1605,8 +1616,7 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
portal_type
=
'Applied Rule'
,
portal_type
=
'Applied Rule'
,
specialise
=
'portal_rules/slapos_delivery_root_simulation_rule'
specialise
=
'portal_rules/slapos_delivery_root_simulation_rule'
)
)
person
=
self
.
portal
.
person_module
.
template_member
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
simulation_movement_1
=
applied_rule_1
.
newContent
(
simulation_movement_1
=
applied_rule_1
.
newContent
(
portal_type
=
'Simulation Movement'
portal_type
=
'Simulation Movement'
)
)
...
@@ -1617,11 +1627,11 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
...
@@ -1617,11 +1627,11 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
# linked invoice
# linked invoice
invoice_kw
=
dict
(
invoice_kw
=
dict
(
portal_type
=
'Sale Invoice Transaction'
,
portal_type
=
'Sale Invoice Transaction'
,
source
=
self
.
expected_slapos_organisation
,
source
_value
=
source
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
price_currency
=
'currency_module/EUR'
,
price_currency
_value
=
currency
,
resource
=
'currency_module/EUR'
,
resource
_value
=
currency
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
ledger
=
'automated'
,
ledger
=
'automated'
,
created_by_builder
=
1
created_by_builder
=
1
)
)
...
@@ -1629,7 +1639,7 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
...
@@ -1629,7 +1639,7 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
portal_type
=
'Invoice Line'
,
portal_type
=
'Invoice Line'
,
use
=
'trade/sale'
,
use
=
'trade/sale'
,
ledger
=
'automated'
,
ledger
=
'automated'
,
resource
=
'service_module/slapos_instance_subscription'
,
resource
_value
=
resource
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
base_contribution
=
[
'base_amount/invoicing/discounted'
,
base_contribution
=
[
'base_amount/invoicing/discounted'
,
'base_amount/invoicing/taxable'
],
'base_amount/invoicing/taxable'
],
...
@@ -1638,10 +1648,10 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
...
@@ -1638,10 +1648,10 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
invoice_1
=
self
.
portal
.
accounting_module
.
newContent
(
invoice_1
=
self
.
portal
.
accounting_module
.
newContent
(
start_date
=
DateTime
(
'2012/01/01'
),
start_date
=
DateTime
(
'2012/01/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
destination_value
=
pers
on
,
destination_value
=
destinati
on
,
destination_section_value
=
pers
on
,
destination_section_value
=
destinati
on
,
destination_decision_value
=
pers
on
,
destination_decision_value
=
destinati
on
,
destination_project_value
=
self
.
slapos_
project
,
destination_project_value
=
project
,
**
invoice_kw
**
invoice_kw
)
)
invoice_line_1
=
invoice_1
.
newContent
(
invoice_line_1
=
invoice_1
.
newContent
(
...
@@ -1652,10 +1662,10 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
...
@@ -1652,10 +1662,10 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
invoice_2
=
self
.
portal
.
accounting_module
.
newContent
(
invoice_2
=
self
.
portal
.
accounting_module
.
newContent
(
start_date
=
DateTime
(
'2012/01/01'
),
start_date
=
DateTime
(
'2012/01/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
stop_date
=
DateTime
(
'2012/02/01'
),
destination_value
=
pers
on
,
destination_value
=
destinati
on
,
destination_section_value
=
pers
on
,
destination_section_value
=
destinati
on
,
destination_decision_value
=
pers
on
,
destination_decision_value
=
destinati
on
,
destination_project_value
=
self
.
slapos_
project
,
destination_project_value
=
project
,
**
invoice_kw
**
invoice_kw
)
)
invoice_line_2
=
invoice_2
.
newContent
(
invoice_line_2
=
invoice_2
.
newContent
(
...
@@ -1680,16 +1690,16 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
...
@@ -1680,16 +1690,16 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
portal_type
=
'Simulation Movement'
,
portal_type
=
'Simulation Movement'
,
base_contribution
=
[
'base_amount/invoicing/discounted'
,
base_contribution
=
[
'base_amount/invoicing/discounted'
,
'base_amount/invoicing/taxable'
],
'base_amount/invoicing/taxable'
],
destination_value
=
pers
on
,
destination_value
=
destinati
on
,
destination_decision_value
=
pers
on
,
destination_decision_value
=
destinati
on
,
destination_section_value
=
pers
on
,
destination_section_value
=
destinati
on
,
destination_project_value
=
self
.
slapos_
project
,
destination_project_value
=
project
,
price_currency
=
'currency_module/EUR'
,
price_currency
_value
=
currency
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
resource
=
'service_module/slapos_instance_subscription'
,
resource
_value
=
resource
,
source
=
self
.
expected_slapos_organisation
,
source
_value
=
source
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
ledger
=
'automated'
,
ledger
=
'automated'
,
use
=
'trade/sale'
,
use
=
'trade/sale'
,
)
)
...
@@ -1727,11 +1737,11 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
...
@@ -1727,11 +1737,11 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
model_movement_kw
=
dict
(
model_movement_kw
=
dict
(
base_application
=
'base_amount/invoicing/taxable'
,
base_application
=
'base_amount/invoicing/taxable'
,
ledger
=
'automated'
,
ledger
=
'automated'
,
price_currency
=
'currency_module/EUR'
,
price_currency
_value
=
currency
,
quantity_unit
=
'unit/piece'
,
quantity_unit
=
'unit/piece'
,
source
=
self
.
expected_slapos_organisation
,
source
_value
=
source
,
source_section
=
self
.
expected_slapos_organisation
,
source_section
_value
=
source
,
specialise_value
=
self
.
slapos_
trade_condition
,
specialise_value
=
trade_condition
,
portal_type
=
'Simulation Movement'
,
portal_type
=
'Simulation Movement'
,
)
)
model_rule_1
=
invoice_movement_1
.
newContent
(
model_rule_1
=
invoice_movement_1
.
newContent
(
...
@@ -1745,9 +1755,9 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
...
@@ -1745,9 +1755,9 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
destination_project
=
invoice_movement_1
.
getDestinationProject
(),
destination_project
=
invoice_movement_1
.
getDestinationProject
(),
resource
=
'service_module/slapos_tax'
,
resource
=
'service_module/slapos_tax'
,
trade_phase
=
'slapos/tax'
,
trade_phase
=
'slapos/tax'
,
causality
=
[
'
business_process_module/slapos_aggregated_business_process/tax'
,
causality
=
[
'
%s/tax'
%
business_process
.
getRelativeUrl
()
,
'
business_process_module/slapos_aggregated_business_process/trade_model_path'
,
'
%s/trade_model_path'
%
business_process
.
getRelativeUrl
()
,
'
sale_trade_condition_module/slapos_aggregated_trade_condition/1'
,
'
%s/1'
%
trade_condition
.
getRelativeUrl
()
,
],
],
price
=
.
196
,
price
=
.
196
,
quantity
=
invoice_movement_1
.
getTotalPrice
(),
quantity
=
invoice_movement_1
.
getTotalPrice
(),
...
@@ -1760,9 +1770,9 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
...
@@ -1760,9 +1770,9 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
destination_project
=
invoice_movement_1
.
getDestinationProject
(),
destination_project
=
invoice_movement_1
.
getDestinationProject
(),
resource
=
'service_module/slapos_tax'
,
resource
=
'service_module/slapos_tax'
,
trade_phase
=
'slapos/tax'
,
trade_phase
=
'slapos/tax'
,
causality
=
[
'
business_process_module/slapos_aggregated_business_process/tax'
,
causality
=
[
'
%s/tax'
%
business_process
.
getRelativeUrl
()
,
'
business_process_module/slapos_aggregated_business_process/trade_model_path'
,
'
%s/trade_model_path'
%
business_process
.
getRelativeUrl
()
,
'
sale_trade_condition_module/slapos_aggregated_trade_condition/1'
,
'
%s/1'
%
trade_condition
.
getRelativeUrl
()
,
],
],
price
=
.
196
,
price
=
.
196
,
quantity
=
.
0
,
quantity
=
.
0
,
...
@@ -1780,9 +1790,9 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
...
@@ -1780,9 +1790,9 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
destination_project
=
invoice_movement_2
.
getDestinationProject
(),
destination_project
=
invoice_movement_2
.
getDestinationProject
(),
resource
=
'service_module/slapos_tax'
,
resource
=
'service_module/slapos_tax'
,
trade_phase
=
'slapos/tax'
,
trade_phase
=
'slapos/tax'
,
causality
=
[
'
business_process_module/slapos_aggregated_business_process/tax'
,
causality
=
[
'
%s/tax'
%
business_process
.
getRelativeUrl
()
,
'
business_process_module/slapos_aggregated_business_process/trade_model_path'
,
'
%s/trade_model_path'
%
business_process
.
getRelativeUrl
()
,
'
sale_trade_condition_module/slapos_aggregated_trade_condition/1'
,
'
%s/1'
%
trade_condition
.
getRelativeUrl
()
,
],
],
price
=
.
196
,
price
=
.
196
,
quantity
=
invoice_movement_2
.
getTotalPrice
(),
quantity
=
invoice_movement_2
.
getTotalPrice
(),
...
...
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