Commit 45dad6fe authored by Fabien Morin's avatar Fabien Morin

use new method from PaySheetModel class

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26054 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 63ae6a2e
......@@ -57,17 +57,7 @@
request = context.REQUEST\n
quantity_renderer = context.Base_viewFieldLibrary.my_money_quantity.render_pdf\n
\n
model = context.getSpecialiseValue()\n
def getPropertyFromModel(model, property_name):\n
"""Get a property from the paysheet model, or from a specialised model.\n
"""\n
v = model.getProperty(property_name)\n
if v:\n
return v\n
for specialised_model in model.getSpecialiseValueList():\n
v = getPropertyFromModel(specialised_model, property_name)\n
if v:\n
return v\n
model = context.getSpecialiseValue().getEffectiveModel(context)\n
\n
def getFieldAsString(field):\n
return \', \'.join(getFieldAsLineList(field))\n
......@@ -211,9 +201,6 @@ year_to_date_bonus_worked_hour_amount = context.PaySheetTransaction_getYearToDat
base_contribution=\'base_contribution/base_amount/overtime\', \\\n
tax_category=\'tax_category/employee_share\') or 0\n
\n
salaire_net_imposable = context.PaySheetTransaction_getMovementTotalPriceFromCategory(\\\n
base_contribution=\'base_contribution/base_amount/salaire_net_imposable\',\n
tax_category=\'tax_category/employee_share\')\n
year_to_date_taxable_net_salary = context.PaySheetTransaction_getYearToDateBaseContributionTotalPrice(\\\n
paysheet=context, base_contribution_list=\'salaire_net_imposable\') + salaire_net_imposable\n
\n
......@@ -247,7 +234,7 @@ data_dict = {\n
\'price_currency\': getPriceCurrencyId(context.getPriceCurrencyReference() or \'\'),\n
\'year\': str(context.getStartDate() is not None and context.getStartDate().year() or \'\'),\n
\'description\': getFieldAsLineList(context.getDescription() or\n
getPropertyFromModel(model, \'description\') or \'\'),\n
model.getModelIneritanceEffectiveProperty(context, \'description\') or \'\'),\n
\'year_to_date_gross_salary\': year_to_date_gross_salary,\n
\'year_to_date_slice_a\': year_to_date_slice_a,\n
\'year_to_date_worked_hour_count\': year_to_date_worked_hour_count,\n
......@@ -306,7 +293,6 @@ return unicodeDict(data_dict)\n
<string>request</string>
<string>quantity_renderer</string>
<string>model</string>
<string>getPropertyFromModel</string>
<string>getFieldAsLineList</string>
<string>getFieldAsString</string>
<string>getSocialCodeId</string>
......
......@@ -79,7 +79,7 @@ paysheet_list = accounting_module.searchFolder(**search_params)\n
\n
yearly_slice_amount = 0\n
# get the slice value for this paysheet :\n
model = context.getSpecialiseValue()\n
model = context.getSpecialiseValue().getEffectiveModel(context)\n
slice = model.getCell(slice_path)\n
\n
if not slice:\n
......@@ -98,7 +98,7 @@ else:\n
yearly_slice_amount += slice_amount\n
\n
for paysheet in paysheet_list :\n
model = paysheet.getSpecialiseValue()\n
model = paysheet.getSpecialiseValue().getEffectiveModel(paysheet)\n
if model is not None:\n
slice = model.getCell(slice_path)\n
plafond = slice.getQuantityRangeMax()\n
......
93
\ No newline at end of file
96
\ 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