Commit f91c1f2c authored by Jérome Perrin's avatar Jérome Perrin

Invoice: do not display tax lines with 0 quantity.

Also simplify a bit the code
parent ea5cf6d2
...@@ -197,15 +197,11 @@ for line in getSubLineList(context):\n ...@@ -197,15 +197,11 @@ for line in getSubLineList(context):\n
display_id = \'title\'\n display_id = \'title\'\n
variation_description = \', \'.join([x[0] for x in line.getVariationCategoryItemList(display_id=display_id)])\n variation_description = \', \'.join([x[0] for x in line.getVariationCategoryItemList(display_id=display_id)])\n
desc = (\'%s %s\' % (desc[0], variation_description), )\n desc = (\'%s %s\' % (desc[0], variation_description), )\n
is_tax=0\n is_tax = 0\n
portal_preferences = context.getPortalObject().portal_preferences\n for tax_use in (context.getPortalObject().portal_preferences.getPreferredTaxUseList() or ["use/trade/tax"]):\n
if portal_preferences.getPreferredTaxUseList()==[] :\n if line.isMemberOf(tax_use):\n
use_of_tax="use/trade/tax"\n is_tax = 1\n
is_tax=line.isMemberOf(use_of_tax) \n break\n
else:\n
tax_list=portal_preferences.getPreferredTaxUseList() \n
for use_of_tax in tax_list:\n
is_tax = is_tax or line.isMemberOf(use_of_tax)\n
\n \n
#set the not_tax_line with the tax_number and the tax_line with the tax_name\n #set the not_tax_line with the tax_number and the tax_line with the tax_name\n
tax_number=\'\'\n tax_number=\'\'\n
...@@ -247,8 +243,9 @@ for line in getSubLineList(context):\n ...@@ -247,8 +243,9 @@ for line in getSubLineList(context):\n
}\n }\n
\n \n
if line_dict[\'use_type_tax\']:\n if line_dict[\'use_type_tax\']:\n
total_tax_price+=line.getTotalPrice() or 0.0\n if line.getQuantity():\n
line_tax.append(unicodeDict(line_dict.copy()))\n total_tax_price+=line.getTotalPrice() or 0.0\n
line_tax.append(unicodeDict(line_dict.copy()))\n
else:\n else:\n
number_line_not_tax = number_line_not_tax+1\n number_line_not_tax = number_line_not_tax+1\n
line_dict[\'number_not_tax_line\'] = number_line_not_tax\n line_dict[\'number_not_tax_line\'] = number_line_not_tax\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment