Meera Trambadia (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-payroll-india-add-field-mtr into 
lp:~openerp-dev/openobject-addons/trunk-payroll-india-mra.

Requested reviews:
  Mustufa Rangwala (Open ERP) (mra-tinyerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-payroll-india-add-field-mtr/+merge/115089

l10n_in_hr_payroll:-
-Added one selection field (Metro and non metro city) on contract and used that 
in HRA Calculation
-Merged two salary rules ('HRAM' and 'HRANM') into one rule (HRA)

-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-payroll-india-add-field-mtr/+merge/115089
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-payroll-india-mra.
=== modified file 'l10n_in_hr_payroll/data/l10n_in_hr_payroll_data.xml'
--- l10n_in_hr_payroll/data/l10n_in_hr_payroll_data.xml	2012-07-13 09:12:51 +0000
+++ l10n_in_hr_payroll/data/l10n_in_hr_payroll_data.xml	2012-07-16 09:39:21 +0000
@@ -14,35 +14,20 @@
         </record>
 
         <record id="hr_salary_rule_houserentallowancemetro" model="hr.salary.rule">
-            <field name="code">HRAM</field>
+            <field name="code">HRA</field>
             <field name="amount_select">code</field>
-            <field name="amount_python_compute">result = payslip.company_id.dearness_allowance and ((contract.wage + DA) * 0.50) or (contract.wage * 0.50)</field>
+            <field name="amount_python_compute">result=payslip.company_id.dearness_allowance and ((contract.wage + DA) * 0.50) or (contract.wage * 0.50) if (contract.city_type=='metro') else payslip.company_id.dearness_allowance and ((contract.wage + DA) * 0.40) or (contract.wage * 0.40) if (contract.city_type=='non-metro') else 0.00</field>
             <field name="category_id" ref="hr_payroll.ALW"/>
-            <field name="name">House Rent Allowance for metro city</field>
+            <field name="name">House Rent Allowance</field>
             <field name="sequence" eval="51"/>
             <field name="note">Rent receipts can be shown for taking tax benefit for living in a rented house.
 Income tax exemption for HRA will be least of following:
     1. The actual amount of HRA received as a part of salary.
-    2. 40% (if living in non-metro area).
+    2. 50% (if living in metro area) and 40% (if living in non-metro area) of (basic salary+Dearness allowance).
     3. Rent paid minus 10% of (basic salary+DA).
             </field>
         </record>
 
-        <record id="hr_salary_rule_houserentallowancenonmetro" model="hr.salary.rule">
-            <field name="amount_select">code</field>
-            <field name="amount_python_compute">result = payslip.company_id.dearness_allowance and ((contract.wage + DA) * 0.40) or (contract.wage * 0.40)</field>
-            <field name="code">HRANM</field>
-            <field name="category_id" ref="hr_payroll.ALW"/>
-            <field name="name">House Rent Allowance for non metro city</field>
-            <field name="sequence" eval="52"/>
-            <field name="note">Rent receipts can be shown for taking tax benefit for living in a rented house.
-Income tax exemption for HRA will be least of following:
-    1. The actual amount of HRA received as a part of salary.
-    2. 50% (if living in metro area) of (basic salary+Dearness allowance (DA)).
-    3. Rent paid minus 10% of (basic salary+DA).
-             </field>
-         </record>
-
         <record id="hr_salary_trans_allownce" model="hr.salary.rule">
             <field name="code">TCA</field>
             <field name="name">Transport/Conveyance Allownace</field>
@@ -121,7 +106,7 @@
             <field name="amount_select">fix</field>
             <field eval="0.0" name="amount_fix"/>
             <field name="sequence" eval="28"/>
-            <field name="note">Generally arrears are fully taxable, but employee may claim exemption u/s 89(1). 
+            <field name="note">Generally arrears are fully taxable, but employee may claim exemption u/s 89(1).
 One would need to compute income tax on the arrears if it would have been received in actual year.
 Now difference of income tax between payment year and actual year would be allowed for deduction.</field>
         </record>
@@ -134,8 +119,8 @@
             <field name="amount_select">code</field>
              <field name="amount_python_compute">result = payslip.company_id.dearness_allowance and ((contract.wage + DA) * 15 * employee.number_of_year / worked_days.WORK100.number_of_days) or (contract.wage * 15 * employee.number_of_year / worked_days.WORK100.number_of_days)</field>
             <field name="sequence" eval="57"/>
-            <field name="note">Covered under the Payment of Gratuity Act, 1971: 
-(Last drawn monthly basic salary + dearness allowance)/26 x 15 days x 
+            <field name="note">Covered under the Payment of Gratuity Act, 1971:
+(Last drawn monthly basic salary + dearness allowance)/26 x 15 days x
 number of years of service (date of joining – date of retirement/leaving job)</field>
         </record>
 
@@ -328,12 +313,12 @@
             <field name="code">CPT</field>
             <field name="name">Deduction for Company Provided Transport</field>
             <field name="category_id" ref="hr_payroll.DED"/>
-            <field name="condition_select">none</field>			
+            <field name="condition_select">none</field>
             <field name="amount_select">fix</field>
             <field eval="0.0" name="amount_fix"/>
             <field name="sequence" eval="165"/>
         </record>
-        
+
          <record id="hr_salary_rule_food_coupon_ded" model="hr.salary.rule">
             <field name="amount_select">fix</field>
             <field eval="-20" name="amount_fix"/>
@@ -367,7 +352,7 @@
             <field name="code">DLA</field>
             <field name="name">Deduction Towards Leave Availed</field>
             <field name="category_id" ref="hr_payroll.DED"/>
-            <field name="condition_select">none</field>			
+            <field name="condition_select">none</field>
             <field name="amount_select">fix</field>
             <field eval="0.0" name="amount_fix"/>
             <field name="sequence" eval="180"/>

=== modified file 'l10n_in_hr_payroll/l10n_in_hr_payroll.py'
--- l10n_in_hr_payroll/l10n_in_hr_payroll.py	2012-07-05 13:35:41 +0000
+++ l10n_in_hr_payroll/l10n_in_hr_payroll.py	2012-07-16 09:39:21 +0000
@@ -38,19 +38,26 @@
 
     _inherit = 'hr.contract'
     _description = 'HR Contract'
-    
+
     _columns = {
         'tds': fields.float('TDS', digits_compute=dp.get_precision('Payroll'), help="Amount for Tax Deduction at Source"),
         'driver_salay': fields.boolean('Driver Salary', help=" Allowance for company provided driver"),
         'medical_insurance': fields.float('Medical Insurance', digits_compute=dp.get_precision('Payroll'), help="Deduction towards company provided medical insurance"),
         'voluntary_provident_fund': fields.float('Voluntary Provident Fund', digits_compute=dp.get_precision('Payroll'), help="VPF computed as percentage(%)"),
+        'city_type': fields.selection([
+            ('metro', 'Metro'),
+            ('non-metro', 'Non-Metro'),
+            ], 'Type of City', readonly=False),
+    }
+    _defaults = {
+        'city_type': 'non-metro',
     }
 
 hr_contract()
 
 class hr_employee(osv.osv):
     '''
-    Employee's Join date allows to compute total working 
+    Employee's Join date allows to compute total working
     experience of Employee and it is used to calculate Gratuity rule.
     '''
 
@@ -85,12 +92,12 @@
             else:
                 res[employee.id] = 0.0
         return res
-    
+
     _columns = {
         'join_date': fields.date('Join Date', help="Joining date of employee"),
         'number_of_year': fields.function(_compute_year, string='No. of Years of Service', type="float", store=True, help="Total years of work experience"),
         }
-    
+
 hr_employee()
 
 class payroll_advice(osv.osv):
@@ -115,7 +122,7 @@
         'company_id':fields.many2one('res.company', 'Company', required=True, readonly=True, states={'draft': [('readonly', False)]}),
         'bank_id':fields.many2one('res.bank', 'Bank', readonly=True, states={'draft': [('readonly', False)]}, help="Select the Bank from which the salary is going to be paid"),
     }
-    
+
     _defaults = {
         'date': lambda * a: time.strftime('%Y-%m-%d'),
         'state': lambda * a: 'draft',
@@ -128,7 +135,7 @@
 
     def compute_advice(self, cr, uid, ids, context=None):
         """
-        Advice - Create Advice lines in Payment Advice and 
+        Advice - Create Advice lines in Payment Advice and
         compute Advice lines.
         @param cr: the current row, from the database cursor,
         @param uid: the current user’s ID for security checks,
@@ -240,8 +247,8 @@
     }
     _defaults = {
         'dearness_allowance': True,
-    }    
+    }
 
 res_company()
 
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'l10n_in_hr_payroll/l10n_in_hr_payroll_view.xml'
--- l10n_in_hr_payroll/l10n_in_hr_payroll_view.xml	2012-07-05 13:35:41 +0000
+++ l10n_in_hr_payroll/l10n_in_hr_payroll_view.xml	2012-07-16 09:39:21 +0000
@@ -13,6 +13,7 @@
                  <group col="2" colspan="2" name="right_column">
                     <separator colspan="2" string="Allowance"/>
                         <field name="driver_salay"/>
+                        <field name="city_type"/>
                  </group>
                  <group col="2" colspan="2" name="left_column">
                     <separator colspan="2" string="Deduction"/>
@@ -24,7 +25,7 @@
             </data>
             </field>
         </record>
-        
+
         <record id="hr_employee_form_in_inherit" model="ir.ui.view">
             <field name="name">hr.employee.form.inherit</field>
             <field name="model">hr.employee</field>
@@ -55,7 +56,7 @@
                 </tree>
             </field>
         </record>
-        
+
         <record id="view_hr_bank_advice_form" model="ir.ui.view">
             <field name="name">hr.payroll.advice.form</field>
             <field name="model">hr.payroll.advice</field>
@@ -140,7 +141,7 @@
             <field name="view_id" ref="view_hr_bank_advice_tree"/>
             <field name="search_view_id" ref="view_hr_payroll_advice_filter"/>
         </record>
-        
+
         <menuitem
             action="action_view_hr_bank_advice_tree"
             id="hr_menu_payment_advice"

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to