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
7d8e657f
Commit
7d8e657f
authored
Apr 12, 2016
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trade: display a summary of the product quantity on a packing list
Summary of total product quantity by product line.
parent
868f058b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
0 deletions
+63
-0
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_getODTDataDict.xml
...teItem/portal_skins/erp5_base/Delivery_getODTDataDict.xml
+25
-0
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PackingList_viewAsODT.xml
...ateItem/portal_skins/erp5_trade/PackingList_viewAsODT.xml
+38
-0
No files found.
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_getODTDataDict.xml
View file @
7d8e657f
...
...
@@ -146,6 +146,7 @@ def getTaxLineList(order):\n
return tax_line_list\n
\n
line_base_contribution_list = []\n
quantity_unit_detail_dict = {}\n
number = 0\n
tax_free_line_totalprice = 0\n
line_list = []\n
...
...
@@ -225,6 +226,30 @@ for line in getSubLineList(context):\n
tax_number=tax_number+\',\'+str(line_base_contribution_list.index(contribution)+1)\n
else:\n
tax_name=line.getBaseApplication()\n
\n
# Keep a mapping quantity_unit ->
total quantity, to display total of products at the bottom.\n
# We keep the numeral value as `_total_quantity` and a method to convert this quantity\n
# to string for display using precision of the resource.\n
quantity_unit = line.getQuantityUnitTranslatedTitle() or (\n
line.getResource() and line.getResourceValue().getQuantityUnitTranslatedTitle()) or \'\'\n
\n
if quantity_unit:\n
# We only consider "physical" resources.\n
if line.getResourceValue().getPortalType() in (\'Product\', \'Component\'):\n
if quantity_unit in quantity_unit_detail_dict:\n
quantity_unit_detail = quantity_unit_detail_dict[quantity_unit]\n
quantity_unit_detail[\'_total_quantity\'] = quantity_unit_detail[\'_total_quantity\'] + line.getTotalQuantity()\n
else:\n
quantity_unit_detail = quantity_unit_detail_dict[quantity_unit] = {\n
"title": translateString("Total ${quantity_unit}", mapping={"quantity_unit": quantity_unit}),\n
"_total_quantity": line.getTotalQuantity(),\n
# We assume all resources for the same quantity unit have the same quantity precision.\n
# This is completly wrong, but should allow not to show decimal part for resources that are managed as "units"\n
"total_quantity_display_method": lambda qty: (\'%%.%df\' % line.getQuantityPrecisionFromResource(line.getResource())) % qty,\n
}\n
quantity_unit_detail["total_quantity"] = quantity_unit_detail["total_quantity_display_method"](\n
quantity_unit_detail["_total_quantity"])\n
\n
line_dict = {\n
\'style_name\': \'Table_20_Contents\',\n
\'left_style_name\': \'Table_20_Contents_20_Left\',\n
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PackingList_viewAsODT.xml
View file @
7d8e657f
...
...
@@ -533,6 +533,44 @@ AAA=</string> </value>
<text:p
text:style-name=
\'Table_20_Contents\'/
>
\n
</table:table-cell>
\n
</table:table-row>
\n
\n
<table:table-row
table:style-name=
\'Tableau3.2\'
>
\n
<table:table-cell
table:style-name=
\'Tableau3.A2\'
office:value-type=
\'string\'
>
\n
<text:p
text:style-name=
\'Table_20_Contents\'/
>
\n
</table:table-cell>
\n
<table:table-cell
table:style-name=
\'Tableau3.A2\'
office:value-type=
\'string\'
>
\n
<text:p
text:style-name=
\'Table_20_Contents\'/
>
\n
</table:table-cell>
\n
<table:table-cell
table:style-name=
\'Tableau3.A1\'
office:value-type=
\'string\'
>
\n
<text:p
text:style-name=
\'Table_20_Contents\'/
>
\n
</table:table-cell>
\n
<tal:block
tal:condition=
"data_dict/quantity_unit_detail_list | nothing"
>
\n
<table:table-cell
table:number-columns-spanned=
"2"
table:style-name=
\'Tableau1.A2\'
office:value-type=
\'string\'
>
\n
<text:p
text:style-name=
\'Item_20_Table_20_Title_20_Left\'
i18n:translate=
""
>
Total Quantity of Products
</text:p>
\n
</table:table-cell>
\n
<table:covered-table-cell/>
\n
</tal:block>
\n
</table:table-row>
\n
<table:table-row
table:style-name=
\'Tableau3.2\'
tal:repeat=
"quantity_unit_detail data_dict/quantity_unit_detail_list | python: []"
>
\n
<table:table-cell
table:style-name=
\'Tableau3.A2\'
office:value-type=
\'string\'
>
\n
<text:p
text:style-name=
\'Table_20_Contents\'/
>
\n
</table:table-cell>
\n
<table:table-cell
table:style-name=
\'Tableau3.A2\'
office:value-type=
\'string\'
>
\n
<text:p
text:style-name=
\'Table_20_Contents\'/
>
\n
</table:table-cell>
\n
<table:table-cell
table:style-name=
\'Tableau3.A1\'
office:value-type=
\'string\'
>
\n
<text:p
text:style-name=
\'Table_20_Contents\'/
>
\n
</table:table-cell>
\n
<table:table-cell
table:style-name=
\'Tableau3.D2\'
office:value-type=
\'string\'
>
\n
<text:p
text:style-name=
\'Table_20_Heading\'
><span
tal:replace=
\'quantity_unit_detail/title\'/
>
:
</text:p>
\n
</table:table-cell>
\n
<table:table-cell
table:style-name=
\'Tableau3.E2\'\n
office:value-type=
\'float\'\n
tal:attributes=
\'office:value
quantity_unit_detail/total_quantity\'
>
\n
<text:p
text:style-name=
\'Table_20_Contents_20_Right\'
tal:content=
\'quantity_unit_detail/total_quantity\'
>
800.000,00
</text:p>
\n
</table:table-cell>
\n
</table:table-row>
\n
\n
<table:table-row
table:style-name=
\'Tableau3.3\'
>
\n
<table:table-cell
table:style-name=
\'Tableau3.A2\'
office:value-type=
\'string\'
>
\n
<text:p
text:style-name=
\'Table_20_Contents\'/
>
\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