From a8e00ac9a1faac6c3b287f6355d8988d3de6c4c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Tue, 10 Jun 2008 15:27:08 +0000
Subject: [PATCH] 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
---
 ...odule_getPaySheetLineReportSectionLineList.xml | 15 ++++++++++++++-
 ...dule_statPaySheetLineReportSectionLineList.xml |  5 +++--
 bt5/erp5_payroll/bt/revision                      |  2 +-
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/AccountingTransactionModule_getPaySheetLineReportSectionLineList.xml b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/AccountingTransactionModule_getPaySheetLineReportSectionLineList.xml
index 4b3632de3f..751ac62278 100644
--- a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/AccountingTransactionModule_getPaySheetLineReportSectionLineList.xml
+++ b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/AccountingTransactionModule_getPaySheetLineReportSectionLineList.xml
@@ -122,6 +122,7 @@ inventory_list = {}\n
 \n
 employee_total = 0\n
 employer_total = 0\n
+base_total = 0\n
 \n
 i = 0\n
 for inventory in employee_inventory_list:\n
@@ -135,9 +136,19 @@ for inventory in employee_inventory_list:\n
                employee_share=price,\n
                base=inventory.quantity, )\n
   employee_total += price\n
+  base_total += inventory.quantity\n
 \n
-# XXX what about taxes with only employer share ?\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
   employee = inventory.getDestinationValue()\n
   inventory_list[employee.getUid()].employer_share = price\n
@@ -149,6 +160,7 @@ total = employee_total + employer_total\n
 \n
 request.set(\'employee_total\', employee_total)\n
 request.set(\'employer_total\', employer_total)\n
+request.set(\'base_total\', base_total)\n
 request.set(\'total\', total)\n
 \n
 invent_list = []\n
@@ -233,6 +245,7 @@ return invent_list\n
                             <string>inventory_list</string>
                             <string>employee_total</string>
                             <string>employer_total</string>
+                            <string>base_total</string>
                             <string>i</string>
                             <string>_getiter_</string>
                             <string>inventory</string>
diff --git a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/AccountingTransactionModule_statPaySheetLineReportSectionLineList.xml b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/AccountingTransactionModule_statPaySheetLineReportSectionLineList.xml
index 6548b7b35c..f649114b83 100644
--- a/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/AccountingTransactionModule_statPaySheetLineReportSectionLineList.xml
+++ b/bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/AccountingTransactionModule_statPaySheetLineReportSectionLineList.xml
@@ -70,8 +70,9 @@
 request = context.REQUEST\n
 \n
 return [Object(employee_share= request[\'employee_total\'],\n
-              employer_share=request[\'employer_total\'],\n
-              total= request[\'total\']\n
+               employer_share=request[\'employer_total\'],\n
+               base=request[\'base_total\'],\n
+               total= request[\'total\']\n
               )\n
        ]\n
 </string> </value>
diff --git a/bt5/erp5_payroll/bt/revision b/bt5/erp5_payroll/bt/revision
index b1ef57c1f7..4acc65d012 100644
--- a/bt5/erp5_payroll/bt/revision
+++ b/bt5/erp5_payroll/bt/revision
@@ -1 +1 @@
-265
\ No newline at end of file
+266
\ No newline at end of file
-- 
2.30.9