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
Boxiang Sun
slapos.core
Commits
3ee01bfb
Commit
3ee01bfb
authored
Apr 19, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: Skip if no trade condition is set
parent
1f6622ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_isTotalPriceEqualAccounting.py
...ing/SaleInvoiceTransaction_isTotalPriceEqualAccounting.py
+3
-1
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_isTradeModelCorrect.py
..._accounting/SaleInvoiceTransaction_isTradeModelCorrect.py
+1
-1
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_isTotalPriceEqualAccounting.py
View file @
3ee01bfb
invoice
=
context
invoice
=
context
specialise
=
context
.
getSpecialiseValue
(
portal_type
=
'Sale Trade Condition'
)
specialise
=
context
.
getSpecialiseValue
(
portal_type
=
'Sale Trade Condition'
)
if
specialise
.
getSpecialiseValue
()
is
None
:
if
specialise
is
None
or
specialise
.
getSpecialiseValue
()
is
None
:
if
not
len
(
invoice
.
objectValues
(
portal_type
=
"Invoice Line"
)):
if
not
len
(
invoice
.
objectValues
(
portal_type
=
"Invoice Line"
)):
# The trade model don't applies if the Trade Condition isn't attached to
# The trade model don't applies if the Trade Condition isn't attached to
# A business process
# A business process
return
True
return
True
total_price
=
invoice
.
getTotalPrice
()
total_price
=
invoice
.
getTotalPrice
()
if
invoice
.
getTotalPrice
()
<
0
:
if
invoice
.
getTotalPrice
()
<
0
:
# For a negative total is from the Reversal transactions
# For a negative total is from the Reversal transactions
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_isTradeModelCorrect.py
View file @
3ee01bfb
specialise
=
context
.
getSpecialiseValue
(
portal_type
=
'Sale Trade Condition'
)
specialise
=
context
.
getSpecialiseValue
(
portal_type
=
'Sale Trade Condition'
)
if
specialise
.
getSpecialiseValue
()
is
None
:
if
specialise
is
None
or
specialise
.
getSpecialiseValue
()
is
None
:
# The trade model don't applies if the Trade Condition isn't attached to
# The trade model don't applies if the Trade Condition isn't attached to
# A business process
# A business process
return
True
return
True
...
...
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