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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
1c58d2f7
Commit
1c58d2f7
authored
May 19, 2020
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_advanced_ecommerce: add tax
parent
c6344595
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
2 deletions
+92
-2
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_getFinalPrice.py
..._skins/erp5_advanced_ecommerce/SaleOrder_getFinalPrice.py
+2
-1
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_getShoppingCartTotalPrice.py
...advanced_ecommerce/SaleOrder_getShoppingCartTotalPrice.py
+1
-1
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_getTotalTax.py
...al_skins/erp5_advanced_ecommerce/SaleOrder_getTotalTax.py
+2
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_getTotalTax.xml
...l_skins/erp5_advanced_ecommerce/SaleOrder_getTotalTax.xml
+70
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_viewShoppingCartRenderer.zpt
...advanced_ecommerce/SaleOrder_viewShoppingCartRenderer.zpt
+5
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_viewShoppingCartWidgetRenderer.zpt
...ed_ecommerce/SaleOrder_viewShoppingCartWidgetRenderer.zpt
+12
-0
No files found.
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_getFinalPrice.py
View file @
1c58d2f7
total_discount
=
context
.
SaleOrder_getTotalDiscount
()
total_tax
=
context
.
SaleOrder_getTotalTax
()
return
context
.
getTotalPrice
()
+
total_discount
return
context
.
getTotalPrice
()
+
total_discount
+
total_tax
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_getShoppingCartTotalPrice.py
View file @
1c58d2f7
...
...
@@ -17,7 +17,7 @@ if sale_order is None:
if
discount
:
total
=
sale_order
.
SaleOrder_getFinalPrice
()
else
:
total
=
sale_order
.
getTotalPrice
()
total
=
sale_order
.
getTotalPrice
()
+
sale_order
.
SaleOrder_getTotalTax
()
if
not
include_shipping
:
shipping_method
=
getattr
(
sale_order
,
'shipping_method'
,
None
)
...
...
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_getTotalTax.py
0 → 100644
View file @
1c58d2f7
return
round
(
sum
([
i
.
getTotalPrice
()
for
i
in
context
.
getAggregatedAmountList
(
rounding
=
True
)
if
"base_amount/trade/base/taxable/vat/vat_normal_rate"
in
i
.
getBaseApplicationList
()]),
2
)
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_getTotalTax.xml
0 → 100644
View file @
1c58d2f7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SaleOrder_getTotalTax
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_viewShoppingCartRenderer.zpt
View file @
1c58d2f7
...
...
@@ -4,6 +4,7 @@
shopping_cart_item_list shopping_cart/SaleOrder_getShoppingCartItemList;
shipping here/SaleOrder_getSelectedShippingResource;
discount shopping_cart/SaleOrder_getTotalDiscount;
total_tax python: shopping_cart.SaleOrder_getTotalTax();
total_price python: shopping_cart.SaleOrder_getShoppingCartTotalPrice(include_currency=False);">
<div class="shopping_cart_item_list">
...
...
@@ -64,6 +65,10 @@
</div>
<div class="shopping_cart_end_lines">
<table cellpadding="0" cellspacing="0">
<tr>
<td><span tal:replace="python: here.Base_translateString('Tax')"/></td>
<td> <span tal:replace="python: '%s %s' % (total_tax, currency_code)"/> </td>
</tr>
<tr>
<td><span tal:replace="python: here.Base_translateString('Sub Total')"/></td>
<td> <span tal:replace="python: '%s %s' % (total_price, currency_code)"/> </td>
...
...
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/SaleOrder_viewShoppingCartWidgetRenderer.zpt
View file @
1c58d2f7
...
...
@@ -7,6 +7,7 @@
discount shopping_cart/SaleOrder_getTotalDiscount;
currency web_site/WebSite_getShoppingCartDefaultCurrency;
currency_symbol python: context.getPortalObject().restrictedTraverse(shopping_cart.getPriceCurrency()).getShortTitle();
total_tax python: shopping_cart.SaleOrder_getTotalTax();
total_price python: here.SaleOrder_getShoppingCartTotalPrice(include_currency=True, discount=True);">
<tr tal:repeat="order_line shopping_cart_item_list">
...
...
@@ -58,6 +59,17 @@
</td></tr>
</tal:block>
<tal:block tal:condition = "python: not empty_cart and total_tax > 0">
<tr><td class="cart_middle">
<div class="cart_left">
<span tal:replace="python: here.Base_translateString('Tax')"/>
</div>
<div class="cart_right">
<span tal:replace="total_tax"/> <span tal:replace="currency_symbol"/>
</div>
</td></tr>
</tal:block>
<tal:block tal:condition = "not: empty_cart">
<tr><td class="cart_middle">
<div class="cart_left">
...
...
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