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
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
Lukas Niegsch
erp5
Commits
4acd4a3a
Commit
4acd4a3a
authored
Oct 21, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounting: convert price script should handle the case where another section is defined on lines
Also fix some comments
parent
6c0b47e6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
23 deletions
+7
-23
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertDestinationPrice.xml
...ounting/AccountingTransaction_convertDestinationPrice.xml
+3
-14
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertSourcePrice.xml
...5_accounting/AccountingTransaction_convertSourcePrice.xml
+4
-9
No files found.
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertDestinationPrice.xml
View file @
4acd4a3a
...
@@ -50,28 +50,17 @@
...
@@ -50,28 +50,17 @@
</item>
</item>
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
"""\n
<value>
<string>
"""Convert the amounts used in the accounting transaction to the currency of the destination section\n
Script to convert the prices used in the transaction to the \n
currency of the destination section\n
form_id : Page that action is called from\n
\n
\n
"""\n
"""\n
portal = context.getPortalObject()\n
portal = context.getPortalObject()\n
#get the precision of the destination\n
precision = context.getDestinationSectionValue().getPriceCurrencyValue().getQuantityPrecision()\n
precision = context.getDestinationSectionValue().getPriceCurrencyValue().getQuantityPrecision()\n
#Get all transaction lines of the transaction \n
line_list = context.contentValues(\n
line_list = context.contentValues(\n
portal_type=portal.getPortalAccountingMovementTypeList())\n
portal_type=portal.getPortalAccountingMovementTypeList())\n
"""\n
For each transaction line, calculate the price of the resource\n
(i.e. currency in which the transaction is being done) in the \n
context of the transaction line, add the resource, price_currency\n
and start_date categories \n
"""\n
\n
\n
for line in line_list:\n
for line in line_list:\n
section = line.getDestinationSectionValue()\n
section = line.getDestinationSectionValue()\n
if section != context.getDestinationSectionValue():\n
continue\n
currency = line.getResourceValue()\n
currency = line.getResourceValue()\n
if not exchange_rate:\n
if not exchange_rate:\n
exchange_rate = currency.getPrice(context=line.asContext(\n
exchange_rate = currency.getPrice(context=line.asContext(\n
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertSourcePrice.xml
View file @
4acd4a3a
...
@@ -52,23 +52,18 @@
...
@@ -52,23 +52,18 @@
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
"""\n
<value>
<string>
"""\n
Script to convert the prices used in the transaction to the \n
Script to convert the prices used in the transaction to the \n
currency of the
destination
section\n
currency of the
source
section\n
"""\n
"""\n
portal = context.getPortalObject()\n
portal = context.getPortalObject()\n
#get the precision of the destination\n
precision = context.getSourceSectionValue().getPriceCurrencyValue().getQuantityPrecision()\n
precision = context.getSourceSectionValue().getPriceCurrencyValue().getQuantityPrecision()\n
#Get all transaction lines of the transaction \n
line_list = context.contentValues(\n
line_list = context.contentValues(\n
portal_type=portal.getPortalAccountingMovementTypeList())\n
portal_type=portal.getPortalAccountingMovementTypeList())\n
"""\n
\n
For each transaction line, calculate the price of the resource\n
(i.e. currency in which the transaction is being done) in the \n
context of the transaction line, add the resource, price_currency\n
and start_date categories \n
"""\n
\n
\n
for line in line_list:\n
for line in line_list:\n
section = line.getSourceSectionValue()\n
section = line.getSourceSectionValue()\n
if section != context.getSourceSectionValue():\n
continue\n
currency = line.getResourceValue()\n
currency = line.getResourceValue()\n
if not exchange_rate:\n
if not exchange_rate:\n
exchange_rate = currency.getPrice(context=line.asContext(\n
exchange_rate = currency.getPrice(context=line.asContext(\n
...
...
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