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

Support taxes with only employer share, show the base total

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21474 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6f194545
...@@ -122,6 +122,7 @@ inventory_list = {}\n ...@@ -122,6 +122,7 @@ inventory_list = {}\n
\n \n
employee_total = 0\n employee_total = 0\n
employer_total = 0\n employer_total = 0\n
base_total = 0\n
\n \n
i = 0\n i = 0\n
for inventory in employee_inventory_list:\n for inventory in employee_inventory_list:\n
...@@ -135,9 +136,19 @@ for inventory in employee_inventory_list:\n ...@@ -135,9 +136,19 @@ for inventory in employee_inventory_list:\n
employee_share=price,\n employee_share=price,\n
base=inventory.quantity, )\n base=inventory.quantity, )\n
employee_total += price\n employee_total += price\n
base_total += inventory.quantity\n
\n \n
# XXX what about taxes with only employer share ?\n
for inventory in employer_inventory_list:\n for inventory in employer_inventory_list:\n
if employee.getUid() not in inventory_list:\n
inventory_list[employee.getUid()] = Object(id=i,\n
employee_career_reference=employee.getCareerReference(),\n
employee_title=employee.getTitle(),\n
employee_career_function=employee.getCareerFunctionTitle(),\n
employee_share=0,\n
base=inventory.quantity, )\n
base_total += inventory.quantity\n
i = i + 1\n
\n
price = inventory.total_price or 0\n price = inventory.total_price or 0\n
employee = inventory.getDestinationValue()\n employee = inventory.getDestinationValue()\n
inventory_list[employee.getUid()].employer_share = price\n inventory_list[employee.getUid()].employer_share = price\n
...@@ -149,6 +160,7 @@ total = employee_total + employer_total\n ...@@ -149,6 +160,7 @@ total = employee_total + employer_total\n
\n \n
request.set(\'employee_total\', employee_total)\n request.set(\'employee_total\', employee_total)\n
request.set(\'employer_total\', employer_total)\n request.set(\'employer_total\', employer_total)\n
request.set(\'base_total\', base_total)\n
request.set(\'total\', total)\n request.set(\'total\', total)\n
\n \n
invent_list = []\n invent_list = []\n
...@@ -233,6 +245,7 @@ return invent_list\n ...@@ -233,6 +245,7 @@ return invent_list\n
<string>inventory_list</string> <string>inventory_list</string>
<string>employee_total</string> <string>employee_total</string>
<string>employer_total</string> <string>employer_total</string>
<string>base_total</string>
<string>i</string> <string>i</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>inventory</string> <string>inventory</string>
......
...@@ -70,8 +70,9 @@ ...@@ -70,8 +70,9 @@
request = context.REQUEST\n request = context.REQUEST\n
\n \n
return [Object(employee_share= request[\'employee_total\'],\n return [Object(employee_share= request[\'employee_total\'],\n
employer_share=request[\'employer_total\'],\n employer_share=request[\'employer_total\'],\n
total= request[\'total\']\n base=request[\'base_total\'],\n
total= request[\'total\']\n
)\n )\n
]\n ]\n
</string> </value> </string> </value>
......
265 266
\ 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