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
Léo-Paul Géneau
slapos.core
Commits
35966f23
Commit
35966f23
authored
Jun 25, 2021
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: Fixup Constraints to not make Reversal Transactions inconsistent
parent
e27cbaa6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Base_testSlapOSValidTradeCondition.py
...s/slapos_accounting/Base_testSlapOSValidTradeCondition.py
+4
-1
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_isTotalPriceEqualAccounting.py
...ing/SaleInvoiceTransaction_isTotalPriceEqualAccounting.py
+4
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_isTradeModelCorrect.py
..._accounting/SaleInvoiceTransaction_isTradeModelCorrect.py
+5
-0
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Base_testSlapOSValidTradeCondition.py
View file @
35966f23
root_trade_condition_list
=
[
"sale_trade_condition_module/slapos_aggregated_trade_condition"
,
"sale_trade_condition_module/slapos_aggregated_subscription_trade_condition"
]
"sale_trade_condition_module/slapos_aggregated_subscription_trade_condition"
,
# Valid trade condition for payments
"sale_trade_condition_module/slapos_manual_accounting_trade_condition"
]
if
context
.
getSpecialise
()
in
root_trade_condition_list
:
return
True
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_isTotalPriceEqualAccounting.py
View file @
35966f23
invoice
=
context
total_price
=
invoice
.
getTotalPrice
()
if
invoice
.
getTotalPrice
()
<
0
:
# For a negative total is from the Reversal transactions
total_price
*=
-
1
accounting_price
=
invoice
.
AccountingTransaction_getTotalCredit
()
precision
=
invoice
.
getPriceCurrencyValue
().
getQuantityPrecision
()
return
round
(
total_price
,
precision
)
==
round
(
accounting_price
,
precision
)
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_isTradeModelCorrect.py
View file @
35966f23
specialise
=
context
.
getSpecialiseValue
(
portal_type
=
'Sale Trade Condition'
)
if
specialise
.
getSpecialiseValue
()
is
None
:
# The trade model don't applies if the Trade Condition isn't attached to
# A business process
return
True
amount_list
=
specialise
.
getAggregatedAmountList
(
context
)
if
len
(
amount_list
)
<
1
:
return
False
...
...
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