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
Eric Zheng
slapos.core
Commits
4caa52f2
Commit
4caa52f2
authored
Nov 28, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixup price calulcation.
parent
364e4a1d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
2 deletions
+51
-2
master/bt5/slapos_accounting/PathTemplateItem/portal_deliveries/slapos_sale_invoice_transaction_trade_model_builder.xml
...s/slapos_sale_invoice_transaction_trade_model_builder.xml
+1
-1
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingBuilder.py
...ccounting/TestTemplateItem/testSlapOSAccountingBuilder.py
+49
-0
master/bt5/slapos_accounting/bt/revision
master/bt5/slapos_accounting/bt/revision
+1
-1
No files found.
master/bt5/slapos_accounting/PathTemplateItem/portal_deliveries/slapos_sale_invoice_transaction_trade_model_builder.xml
View file @
4caa52f2
...
@@ -86,7 +86,7 @@
...
@@ -86,7 +86,7 @@
<value>
<value>
<tuple>
<tuple>
<string>
calculateAddQuantity
</string>
<string>
calculateAddQuantity
</string>
<string>
calculate
Separat
ePrice
</string>
<string>
calculate
Averag
ePrice
</string>
</tuple>
</tuple>
</value>
</value>
</item>
</item>
...
...
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingBuilder.py
View file @
4caa52f2
...
@@ -1056,6 +1056,20 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
...
@@ -1056,6 +1056,20 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
quantity
=
invoice_movement_1
.
getTotalPrice
(),
quantity
=
invoice_movement_1
.
getTotalPrice
(),
**
model_movement_kw
**
model_movement_kw
)
)
model_movement_1_tax_2
=
model_rule_1
.
newContent
(
destination
=
invoice_movement_1
.
getDestination
(),
destination_section
=
invoice_movement_1
.
getDestinationSection
(),
destination_decision
=
invoice_movement_1
.
getDestinationDecision
(),
resource
=
'service_module/slapos_tax'
,
trade_phase
=
'slapos/tax'
,
causality
=
[
'business_process_module/slapos_aggregated_business_process/tax'
,
'business_process_module/slapos_aggregated_business_process/trade_model_path'
,
'sale_trade_condition_module/slapos_aggregated_trade_condition/1'
,
],
price
=
.
196
,
quantity
=
.
0
,
**
model_movement_kw
)
model_rule_2
=
invoice_movement_2
.
newContent
(
model_rule_2
=
invoice_movement_2
.
newContent
(
portal_type
=
'Applied Rule'
,
portal_type
=
'Applied Rule'
,
...
@@ -1086,9 +1100,14 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
...
@@ -1086,9 +1100,14 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
self
.
tic
()
self
.
tic
()
self
.
checkSimulationMovement
(
model_movement_1_tax
)
self
.
checkSimulationMovement
(
model_movement_1_tax
)
self
.
assertEqual
(
0.0
,
model_movement_1_tax_2
.
getDeliveryRatio
())
self
.
assertEqual
(
0.0
,
model_movement_1_tax_2
.
getDeliveryError
())
self
.
assertNotEqual
(
None
,
model_movement_1_tax_2
.
getDeliveryValue
())
self
.
checkSimulationMovement
(
model_movement_2_tax
)
self
.
checkSimulationMovement
(
model_movement_2_tax
)
model_line_1_tax
=
model_movement_1_tax
.
getDeliveryValue
()
model_line_1_tax
=
model_movement_1_tax
.
getDeliveryValue
()
model_line_1_tax_2
=
model_movement_1_tax_2
.
getDeliveryValue
()
self
.
assertEqual
(
model_line_1_tax
,
model_line_1_tax_2
)
model_line_2_tax
=
model_movement_2_tax
.
getDeliveryValue
()
model_line_2_tax
=
model_movement_2_tax
.
getDeliveryValue
()
def
checkModelLine
(
simulation_movement
,
transaction_line
,
category_list
):
def
checkModelLine
(
simulation_movement
,
transaction_line
,
category_list
):
...
@@ -1153,6 +1172,7 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
...
@@ -1153,6 +1172,7 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
self
.
tic
()
self
.
tic
()
self
.
checkSimulationMovement
(
model_movement_1_tax_bis
)
self
.
checkSimulationMovement
(
model_movement_1_tax_bis
)
model_line_1_tax_bis
=
model_movement_1_tax_bis
.
getDeliveryValue
()
model_line_1_tax_bis
=
model_movement_1_tax_bis
.
getDeliveryValue
()
checkModelLine
(
model_movement_1_tax_bis
,
model_line_1_tax_bis
,
[
checkModelLine
(
model_movement_1_tax_bis
,
model_line_1_tax_bis
,
[
'base_application/base_amount/invoicing/taxable'
,
'base_application/base_amount/invoicing/taxable'
,
...
@@ -1161,6 +1181,35 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
...
@@ -1161,6 +1181,35 @@ class TestSlapOSSaleInvoiceTransactionTradeModelBuilder(TestSlapOSSalePackingLis
self
.
assertEqual
(
invoice_1
.
getRelativeUrl
(),
self
.
assertEqual
(
invoice_1
.
getRelativeUrl
(),
model_line_1_tax_bis
.
getParentValue
().
getRelativeUrl
())
model_line_1_tax_bis
.
getParentValue
().
getRelativeUrl
())
model_movement_2_tax_bis
=
model_movement_2_tax
.
Base_createCloneDocument
(
batch_mode
=
1
)
model_movement_2_tax_bis
.
edit
(
delivery
=
None
,
delivery_ratio
=
1.0
,
quantity
=
.
0
)
self
.
tic
()
self
.
portal
.
portal_deliveries
\
.
slapos_sale_invoice_transaction_trade_model_builder
.
build
(
path
=
'%s/%%'
%
applied_rule_1
.
getPath
())
self
.
portal
.
portal_deliveries
\
.
slapos_sale_invoice_transaction_trade_model_builder
.
build
(
path
=
'%s/%%'
%
applied_rule_2
.
getPath
())
self
.
tic
()
# as invoice_2 has been updated it is time to update its causality
# with automatic solving
invoice_2
.
updateCausalityState
(
solve_automatically
=
True
)
self
.
tic
()
self
.
assertEqual
(
0.0
,
model_movement_2_tax_bis
.
getDeliveryRatio
())
self
.
assertEqual
(
0.0
,
model_movement_2_tax_bis
.
getDeliveryError
())
self
.
assertNotEqual
(
None
,
model_movement_2_tax_bis
.
getDeliveryValue
())
model_line_2_tax_bis
=
model_movement_2_tax_bis
.
getDeliveryValue
()
checkModelLine
(
model_movement_2_tax_bis
,
model_line_2_tax_bis
,
[
'base_application/base_amount/invoicing/taxable'
,
'resource/service_module/slapos_tax'
,
'use/trade/tax'
])
self
.
assertEqual
(
invoice_2
.
getRelativeUrl
(),
model_line_2_tax_bis
.
getParentValue
().
getRelativeUrl
())
class
TestSlapOSPaymentTransactionOrderBuilder
(
testSlapOSMixin
):
class
TestSlapOSPaymentTransactionOrderBuilder
(
testSlapOSMixin
):
def
sumReceivable
(
self
,
transaction
):
def
sumReceivable
(
self
,
transaction
):
quantity
=
.
0
quantity
=
.
0
...
...
master/bt5/slapos_accounting/bt/revision
View file @
4caa52f2
168
169
\ No newline at end of file
\ No newline at end of file
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