Commit 19a4da0c authored by Fabien Morin's avatar Fabien Morin

check for the slices only if there is a salary_range category defined on the...

check for the slices only if there is a salary_range category defined on the cell, else quantity=base_application. This permit to use negative amount in the paysheet wtih line wich have no slices

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25359 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 20a9ad0f
...@@ -78,8 +78,7 @@ else:\n ...@@ -78,8 +78,7 @@ else:\n
\n \n
if base_amount_dict:\n if base_amount_dict:\n
# get the application amount for this cell\n # get the application amount for this cell\n
model_line = cell.getParentValue()\n for base in cell.getBaseApplicationList():\n
for base in model_line.getBaseApplicationList():\n
if base_amount_dict.has_key(base):\n if base_amount_dict.has_key(base):\n
base_application += base_amount_dict[base][tax_category]\n base_application += base_amount_dict[base][tax_category]\n
\n \n
...@@ -87,7 +86,7 @@ if base_amount_dict:\n ...@@ -87,7 +86,7 @@ if base_amount_dict:\n
salary_range_list = cell.getVariationCategoryList(\\\n salary_range_list = cell.getVariationCategoryList(\\\n
base_category_list=\'salary_range\')\n base_category_list=\'salary_range\')\n
if len(salary_range_list):\n if len(salary_range_list):\n
salary_range = salary_range_list[0] # a slice can have only one salary_range\n salary_range = salary_range_list[0] # a cell can have only one salary_range\n
# category\n # category\n
else:\n else:\n
salary_range = None\n salary_range = None\n
...@@ -104,14 +103,16 @@ if salary_range:\n ...@@ -104,14 +103,16 @@ if salary_range:\n
model_slice_min = cell.getQuantityRangeMin()\n model_slice_min = cell.getQuantityRangeMin()\n
model_slice_max = cell.getQuantityRangeMax()\n model_slice_max = cell.getQuantityRangeMax()\n
\n \n
if not quantity and base_application-model_slice_min>0:\n
if base_application <= model_slice_max:\n
quantity = base_application-model_slice_min\n
elif model_slice_max:\n
quantity = model_slice_max-model_slice_min\n
else:\n
quantity = base_application\n
\n \n
if not quantity and base_application-model_slice_min>0:\n else:\n
if base_application <= model_slice_max:\n quantity = base_application\n
quantity = base_application-model_slice_min\n
elif model_slice_max:\n
quantity = model_slice_max-model_slice_min\n
else:\n
quantity = base_application\n
\n \n
return {\'quantity\':quantity, \'price\':price}\n return {\'quantity\':quantity, \'price\':price}\n
......
343 344
\ No newline at end of file \ No newline at end of file
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