[Erp5-report] r20516 - in /erp5/trunk/bt5/erp5_trade: SkinTemplateItem/portal_skins/erp5_tr...
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Apr 15 11:30:15 CEST 2008
Author: jerome
Date: Tue Apr 15 11:30:14 2008
New Revision: 20516
URL: http://svn.erp5.org?rev=20516&view=rev
Log:
support tax line with multiple base applications and multiple delivery lines
Modified:
erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/DeliveryMovement_getCorrespondingTaxLineList.xml
erp5/trunk/bt5/erp5_trade/bt/revision
Modified: erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/DeliveryMovement_getCorrespondingTaxLineList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/DeliveryMovement_getCorrespondingTaxLineList.xml?rev=20516&r1=20515&r2=20516&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/DeliveryMovement_getCorrespondingTaxLineList.xml (original)
+++ erp5/trunk/bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/DeliveryMovement_getCorrespondingTaxLineList.xml Tue Apr 15 11:30:14 2008
@@ -89,16 +89,17 @@
portal_type=context.getPortalMovementTypeList())]\n
# 2 for each tax line, calculate the corresponding ratio\n
for tax_line in contributed_tax_line_list:\n
- # XXX only the first one is used here !\n
- # this assume that a tax will be applied to only one base_amount\n
- base_amount = tax_line.getBaseApplication()\n
base_total_price = 0\n
- for movement in other_movement_list:\n
- if base_amount in movement.getBaseContributionList():\n
- base_total_price += movement.getTotalPrice(fast=0)\n
- \n
+ added_movement_list = {}\n
+ for base_amount in tax_line.getBaseApplicationList():\n
+ for movement in other_movement_list:\n
+ if base_amount in movement.getBaseContributionList():\n
+ if movement.getRelativeUrl() not in added_movement_list:\n
+ base_total_price += movement.getTotalPrice(fast=0)\n
+ added_movement_list[movement.getRelativeUrl()] = 1\n
+\n
adjusted_tax_line_list.append(tax_line.asContext(quantity=\n
- # XXX round ?\n
+ # XXX round ?\n
tax_line.getQuantity() * total_price / base_total_price))\n
\n
return adjusted_tax_line_list\n
@@ -164,8 +165,10 @@
<string>m</string>
<string>other_movement_list</string>
<string>base_total_price</string>
+ <string>added_movement_list</string>
<string>movement</string>
<string>_inplacevar_</string>
+ <string>_write_</string>
</tuple>
</value>
</item>
Modified: erp5/trunk/bt5/erp5_trade/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_trade/bt/revision?rev=20516&r1=20515&r2=20516&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_trade/bt/revision (original)
+++ erp5/trunk/bt5/erp5_trade/bt/revision Tue Apr 15 11:30:14 2008
@@ -1,1 +1,1 @@
-265
+266
More information about the Erp5-report
mailing list