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
24729059
Commit
24729059
authored
Sep 23, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: Accept at at_date as parameter to calculate Outstanding Amount
parent
4bcb88d9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_contract/Entity_statSlapOSOutstandingAmount.py
...ins/slapos_contract/Entity_statSlapOSOutstandingAmount.py
+6
-1
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_contract/Entity_statSlapOSOutstandingAmount.py
View file @
24729059
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
from
DateTime
import
DateTime
from
DateTime
import
DateTime
at_date
=
None
if
at_date
in
kw
:
at_date
=
kw
[
"at_date"
]
if
contract
is
None
:
if
contract
is
None
:
contract
=
portal
.
portal_catalog
.
getResultValue
(
contract
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Cloud Contract"
,
portal_type
=
"Cloud Contract"
,
...
@@ -30,7 +34,8 @@ for currency_uid in currency_uid_list:
...
@@ -30,7 +34,8 @@ for currency_uid in currency_uid_list:
portal_type
=
"Cloud Contract Line"
):
portal_type
=
"Cloud Contract Line"
):
if
line
.
getPriceCurrencyUid
()
==
currency_uid
:
if
line
.
getPriceCurrencyUid
()
==
currency_uid
:
maximum_invoice_credit
=
line
.
getMaximumInvoiceCredit
()
maximum_invoice_credit
=
line
.
getMaximumInvoiceCredit
()
amount_per_currency
=
context
.
Entity_statOutstandingAmount
(
resource_uid
=
currency_uid
)
amount_per_currency
=
context
.
Entity_statOutstandingAmount
(
at_date
=
at_date
,
resource_uid
=
currency_uid
)
if
amount_per_currency
>
maximum_invoice_credit
:
if
amount_per_currency
>
maximum_invoice_credit
:
return
amount_per_currency
# We exceed maximum amount because
return
amount_per_currency
# We exceed maximum amount because
# user already requested too much
# user already requested too much
...
...
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