Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
3a08100d
Commit
3a08100d
authored
Jan 27, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounting py3
parent
6f7e5355
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
12 deletions
+17
-12
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getNodeItemList.py
...5_accounting/AccountingTransactionLine_getNodeItemList.py
+1
-4
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getAgedBalanceLineList.py
...ing/AccountingTransactionModule_getAgedBalanceLineList.py
+1
-1
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getAgedBalanceReportSectionList.py
...ntingTransactionModule_getAgedBalanceReportSectionList.py
+12
-4
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getAccountingTransactionLineList.py
...AccountingTransaction_getAccountingTransactionLineList.py
+1
-1
bt5/erp5_accounting/TestTemplateItem/portal_components/test.erp5.testAccounting.py
...emplateItem/portal_components/test.erp5.testAccounting.py
+2
-2
No files found.
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getNodeItemList.py
View file @
3a08100d
...
@@ -50,9 +50,6 @@ def display(x):
...
@@ -50,9 +50,6 @@ def display(x):
display_cache
[
x
]
=
display_funct
(
x
)
display_cache
[
x
]
=
display_funct
(
x
)
return
display_cache
[
x
]
return
display_cache
[
x
]
def
sort
(
x
,
y
):
return
cmp
(
display
(
x
),
display
(
y
))
def
getItemList
(
category
=
None
,
portal_path
=
None
,
mirror
=
0
,
omit_filter
=
0
,
def
getItemList
(
category
=
None
,
portal_path
=
None
,
mirror
=
0
,
omit_filter
=
0
,
simulation_state
=
None
):
simulation_state
=
None
):
"""Returns a list of Account path items. """
"""Returns a list of Account path items. """
...
@@ -71,7 +68,7 @@ def getItemList(category=None, portal_path=None, mirror=0, omit_filter=0,
...
@@ -71,7 +68,7 @@ def getItemList(category=None, portal_path=None, mirror=0, omit_filter=0,
portal_type
=
'Account'
,
portal_type
=
'Account'
,
base
=
0
,
base
=
0
,
display_method
=
display
,
display_method
=
display
,
sort_
method
=
sort
,
sort_
key
=
display
,
filter
=
filter_dict
)
filter
=
filter_dict
)
return
item_list
return
item_list
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getAgedBalanceLineList.py
View file @
3a08100d
...
@@ -118,7 +118,7 @@ for brain in portal.portal_simulation.getMovementHistoryList(
...
@@ -118,7 +118,7 @@ for brain in portal.portal_simulation.getMovementHistoryList(
if
by_mirror_section_list_dict
:
if
by_mirror_section_list_dict
:
for
row
in
portal_catalog
(
for
row
in
portal_catalog
(
select_list
=
[
'title'
],
select_list
=
[
'title'
],
uid
=
by_mirror_section_list_dict
.
keys
(
),
uid
=
list
(
by_mirror_section_list_dict
.
keys
()
),
):
):
title
=
row
.
title
title
=
row
.
title
for
line
in
by_mirror_section_list_dict
[
row
.
uid
]:
for
line
in
by_mirror_section_list_dict
[
row
.
uid
]:
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_getAgedBalanceReportSectionList.py
View file @
3a08100d
import
six
from
Products.ERP5Type.Message
import
translateString
from
Products.ERP5Type.Message
import
translateString
from
Products.ERP5Form.Report
import
ReportSection
from
Products.ERP5Form.Report
import
ReportSection
if
six
.
PY2
:
def
translate
(
*
args
,
**
kw
):
return
unicode
(
translateString
(
*
args
,
**
kw
))
else
:
def
translate
(
*
args
,
**
kw
):
return
str
(
translateString
(
*
args
,
**
kw
))
request
=
container
.
REQUEST
request
=
container
.
REQUEST
section_category
=
request
[
'section_category'
]
section_category
=
request
[
'section_category'
]
section_category_strict
=
request
[
'section_category_strict'
]
section_category_strict
=
request
[
'section_category_strict'
]
...
@@ -30,16 +38,16 @@ previous_period = 0
...
@@ -30,16 +38,16 @@ previous_period = 0
for
idx
,
period
in
enumerate
(
period_list
):
for
idx
,
period
in
enumerate
(
period_list
):
if
idx
!=
0
:
if
idx
!=
0
:
previous_period
=
period_list
[
idx
-
1
]
previous_period
=
period_list
[
idx
-
1
]
selection_columns
.
append
((
'period_%s'
%
idx
,
unicode
(
translateString
(
selection_columns
.
append
((
'period_%s'
%
idx
,
translate
(
'Period ${period_number} (from ${from} to ${to} days)'
,
'Period ${period_number} (from ${from} to ${to} days)'
,
mapping
=
{
'period_number'
:
1
+
idx
,
mapping
=
{
'period_number'
:
1
+
idx
,
'from'
:
previous_period
,
'from'
:
previous_period
,
'to'
:
period
}
)))
)
'to'
:
period
}
)))
editable_columns
.
append
((
'period_%s'
%
idx
,
''
))
editable_columns
.
append
((
'period_%s'
%
idx
,
''
))
selection_columns
.
append
((
'period_%s'
%
(
idx
+
1
),
selection_columns
.
append
((
'period_%s'
%
(
idx
+
1
),
unicode
(
translateString
(
'Older (more than ${day_count} days)'
,
translate
(
'Older (more than ${day_count} days)'
,
mapping
=
{
'day_count'
:
period_list
[
-
1
]})))
)
mapping
=
{
'day_count'
:
period_list
[
-
1
]})))
editable_columns
.
append
((
'period_%s'
%
(
idx
+
1
),
''
))
editable_columns
.
append
((
'period_%s'
%
(
idx
+
1
),
''
))
selection_params
=
dict
(
section_category
=
section_category
,
selection_params
=
dict
(
section_category
=
section_category
,
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_getAccountingTransactionLineList.py
View file @
3a08100d
...
@@ -9,6 +9,6 @@ sort_dict = { 'income': 0,
...
@@ -9,6 +9,6 @@ sort_dict = { 'income': 0,
'refundable_vat'
:
-
1
}
'refundable_vat'
:
-
1
}
def
getAccountingTransactionLineSortKey
(
line
):
def
getAccountingTransactionLineSortKey
(
line
):
return
sort_dict
.
get
(
line
.
getId
(),
line
.
getIntIndex
()
or
line
.
getIntId
(
))
return
sort_dict
.
get
(
line
.
getId
(),
(
line
.
getIntIndex
()
or
line
.
getIntId
()
or
0
))
return
sorted
(
context
.
contentValues
(
portal_type
=
portal_type
,
checked_permission
=
"View"
),
key
=
getAccountingTransactionLineSortKey
)
return
sorted
(
context
.
contentValues
(
portal_type
=
portal_type
,
checked_permission
=
"View"
),
key
=
getAccountingTransactionLineSortKey
)
bt5/erp5_accounting/TestTemplateItem/portal_components/test.erp5.testAccounting.py
View file @
3a08100d
...
@@ -3394,9 +3394,9 @@ class TestAccountingExport(AccountingTestCase):
...
@@ -3394,9 +3394,9 @@ class TestAccountingExport(AccountingTestCase):
'40 - Payable'
,
'40 - Payable'
,
self
.
account_module
.
payable
.
Account_getFormattedTitle
())
self
.
account_module
.
payable
.
Account_getFormattedTitle
())
# check that this account name can be found in the content
# check that this account name can be found in the content
self
.
assertIn
(
'40 - Payable'
,
content_xml
)
self
.
assertIn
(
b
'40 - Payable'
,
content_xml
)
# check that we don't have unknown categories
# check that we don't have unknown categories
self
.
assertNotIn
(
'???'
,
content_xml
)
self
.
assertNotIn
(
b
'???'
,
content_xml
)
class
TestTransactions
(
AccountingTestCase
):
class
TestTransactions
(
AccountingTestCase
):
...
...
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