[IMP] hr_payroll: minor changes on payslip report, still major changes are yet to...
authormtr <mtr@mtr>
Tue, 5 Apr 2011 13:38:34 +0000 (19:08 +0530)
committermtr <mtr@mtr>
Tue, 5 Apr 2011 13:38:34 +0000 (19:08 +0530)
bzr revid: mtr@mtr-20110405133834-u5u2k3toqfn2brej

addons/hr_payroll/report/payslip.rml
addons/hr_payroll/report/report_payslip.py

index 26c5939..d70e4b6 100644 (file)
           <para style="terp_default_Bold_9">Basic Salary</para>
         </td>
         <td>
-          <para style="terp_default_9">[[ formatLang(o.basic_before_leaves, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] </para>
+          <para style="terp_default_9">[[ formatLang(o.contract_id.wage, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] </para>
         </td>
         <td>
           <para style="terp_default_Bold_9">Leaved Deduction</para>
     <para style="terp_default_space">
       <font color="white"> </font>
     </para>
-    <blockTable colWidths="269.0,134.0,135.0" style="Table21">
-      <tr>
-        <td>
-          <para style="terp_tblheader_Details">Other Lines</para>
-        </td>
-        <td>
-          <para style="terp_tblheader_Details_Right">Payments - [[ get_month(o) ]]</para>
-        </td>
-        <td>
-          <para style="terp_tblheader_Details_Right">Deduction -[[ get_month(o) ]]</para>
-        </td>
-      </tr>
-    </blockTable>
-    <section>
-      <para style="terp_default_9">[[repeatIn(get_others(o.line_ids),'ol') ]]</para>
-      <blockTable colWidths="269.0,134.0,135.0" style="Table22">
-        <tr>
-          <td>
-            <para style="terp_default_9">[[ ol.code or '' ]]</para>
-          </td>
-          <td>
-            <para style="terp_default_Right_9">[[ ol.type in ['advance','loan','otherpay'] and formatLang(ol.total, dp='Account') or '' ]] [[ ol.type in ['advance','loan','otherpay'] and o.company_id and o.company_id.currency_id.symbol or '' ]]</para>
-          </td>
-          <td>
-            <para style="terp_default_Right_9">[[ ol.type in ['otherdeduct','installment'] and formatLang(ol.total, dp='Account') or '' ]] [[ ol.type in ['otherdeduct','installment'] and o.company_id and o.company_id.currency_id.symbol or '' ]]</para>
-          </td>
-        </tr>
-      </blockTable>
-    </section>
+   
     <blockTable colWidths="269.0,177.0,93.0" style="Table5">
       <tr>
         <td>
index d5cd653..e4c44a8 100644 (file)
@@ -36,33 +36,21 @@ class payslip_report(report_sxw.rml_parse):
                 'get_earnings': self.get_earnings,
                 'get_deductions':self.get_deductions,
                 'get_leave':self.get_leave,
-                'get_others':self.get_others,
                 })
 
     def convert(self, amount, cur):
         amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur)
         return amt_en
 
-    def get_others(self, obj):
-        payslip_line = self.pool.get('hr.payslip.line')
-        res = []
-        ids = []
-        for id in range(len(obj)):
-            if obj[id].category_id.type in ('advance', 'loan', 'otherpay', 'otherdeduct', 'installment'):
-                ids.append(obj[id].id)
-        if ids:
-            res = payslip_line.browse(self.cr, self.uid, ids)
-        return res
-
     def get_leave(self, obj):
         payslip_line = self.pool.get('hr.payslip.line')
         res = []
-        ids = []
-        for id in range(len(obj)):
-            if obj[id].type == 'leaves':
-                ids.append(obj[id].id)
-        if ids:
-            res = payslip_line.browse(self.cr, self.uid, ids)
+#        ids = []
+#        for id in range(len(obj)):
+#            if obj[id].type == 'leaves':
+#                ids.append(obj[id].id)
+#        if ids:
+#            res = payslip_line.browse(self.cr, self.uid, ids)
         return res
 
     def get_earnings(self, obj):
@@ -70,7 +58,7 @@ class payslip_report(report_sxw.rml_parse):
         res = []
         ids = []
         for id in range(len(obj)):
-            if obj[id].category_id.type == 'allowance' and obj[id].type != 'leaves':
+            if obj[id].category_id.parent_id.name == 'Allowance':
                 ids.append(obj[id].id)
         if ids:
             res = payslip_line.browse(self.cr, self.uid, ids)
@@ -81,7 +69,7 @@ class payslip_report(report_sxw.rml_parse):
         res = []
         ids = []
         for id in range(len(obj)):
-            if obj[id].category_id.type == 'deduction' and obj[id].type != 'leaves':
+            if obj[id].category_id.parent_id.name == 'Deduction':
                 ids.append(obj[id].id)
         if ids:
             res = payslip_line.browse(self.cr, self.uid, ids)