Commit b6368c92 authored by Fabien Morin's avatar Fabien Morin

- update listbox of PaySheetTransaction_view to have more "more_columns"

- rename my_default_calculation_script_id to my_calculation_script_id to be
consistent with script in lines
- change system preference title (it was set to BPM because of copy/paste
mistake)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27863 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c0a7136f
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
<string>my_source_section_title</string> <string>my_source_section_title</string>
<string>my_price_currency</string> <string>my_price_currency</string>
<string>my_specialise_title_list</string> <string>my_specialise_title_list</string>
<string>my_default_calculation_script_id</string> <string>my_calculation_script_id</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_default_calculation_script_id</string> </value> <value> <string>my_calculation_script_id</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>The default script used to calculated the withhold amount for each line.</string> </value> <value> <string>The script used to calculate the withhold amount for each line.</string> </value>
</item> </item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Default Calculation Script</string> </value> <value> <string>Calculation Script</string> </value>
</item> </item>
</dictionary> </dictionary>
</value> </value>
......
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<value> <value>
<list> <list>
<string>my_specialise_title_list</string> <string>my_specialise_title_list</string>
<string>my_default_calculation_script_id</string> <string>my_calculation_script_id</string>
<string>my_float_index</string> <string>my_float_index</string>
<string>my_int_index</string> <string>my_int_index</string>
</list> </list>
......
...@@ -13,14 +13,14 @@ ...@@ -13,14 +13,14 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>description</string> <string>description</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_default_calculation_script_id</string> </value> <value> <string>my_calculation_script_id</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>The default script used to calculated the withhold amount for each line.</string> </value> <value> <string>The script used to calculate the withhold amount for each line.</string> </value>
</item> </item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Default Calculation Script</string> </value> <value> <string>Calculation Script</string> </value>
</item> </item>
</dictionary> </dictionary>
</value> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
precision = context.getPriceCurrencyValue().getQuantityPrecision()\n
\n
quantity = cell.getQuantity()\n
price = cell.getPrice()\n
if price is None:\n
price = 1\n
\n
model_line = cell.getParentValue()\n
\n
if model_line.isEditable():\n
return dict(quantity=quantity,\n
price=price)\n
\n
base_application = 0\n
tax_category_list = cell.getVariationCategoryList(base_category_list= \\\n
\'tax_category\')\n
if tax_category_list != []:\n
tax_category = tax_category_list[0]\n
else:\n
tax_category = None\n
\n
# get the application amount for this cell\n
for base in cell.getBaseApplicationList():\n
if base_amount_dict.has_key(base) and base_amount_dict[base].has_key(tax_category):\n
base_application += base_amount_dict[base][tax_category]\n
\n
if not len(cell.getBaseApplicationList()):\n
base_application = quantity\n
salary_range_list = cell.getVariationCategoryList(\\\n
base_category_list=\'salary_range\')\n
if len(salary_range_list):\n
salary_range = salary_range_list[0] # a cell can have only one salary_range\n
# category\n
else:\n
salary_range = None\n
\n
model_slice_min = 0\n
model_slice_max = 0\n
if salary_range:\n
model = context.getSpecialiseValue().getEffectiveModel(\\\n
start_date=context.getStartDate(),\n
stop_date=context.getStopDate())\n
cell = model.getCell(salary_range)\n
if cell is None:\n
context.log("Warning ! Can\'t find cell corresponding to : %s" %\n
salary_range)\n
else:\n
model_slice_min = cell.getQuantityRangeMin()\n
model_slice_max = cell.getQuantityRangeMax()\n
\n
if not quantity and base_application-model_slice_min>0:\n
if base_application <= model_slice_max:\n
quantity = base_application-model_slice_min\n
elif model_slice_max:\n
quantity = model_slice_max-model_slice_min\n
else:\n
quantity = base_application\n
\n
else:\n
quantity = base_application\n
\n
return {\'quantity\':quantity, \'price\':price}\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>base_amount_dict, cell</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>base_amount_dict</string>
<string>cell</string>
<string>_getattr_</string>
<string>context</string>
<string>precision</string>
<string>quantity</string>
<string>price</string>
<string>None</string>
<string>model_line</string>
<string>dict</string>
<string>base_application</string>
<string>tax_category_list</string>
<string>_getitem_</string>
<string>tax_category</string>
<string>_getiter_</string>
<string>base</string>
<string>_inplacevar_</string>
<string>len</string>
<string>salary_range_list</string>
<string>salary_range</string>
<string>model_slice_min</string>
<string>model_slice_max</string>
<string>model</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PaySheetTransaction_defaultCalculationScript</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -62,17 +62,18 @@ ...@@ -62,17 +62,18 @@
\'\'\'\n \'\'\'\n
\n \n
column_list = []\n column_list = []\n
editable_column_list = [(\'base\', \'Base\'),]\n editable_column_list = [(\'int_index\', \'PaySheet Order\'),\n
(\'title\', \'Title\'),]\n
\n \n
not_editable_column_list = [(\'int_index\', \'PaySheet Order\'),\n not_editable_column_list = [(\'source_section_title\', \'Service Provider\'),\n
(\'title\', \'Title\'),\n (\'slice\', \'Slice\'),\n
(\'source_section_title\', \'Service Provider\'),\n (\'base\', \'Base\'),]\n
(\'slice\', \'Slice\'),]\n \n
column_list.extend(editable_column_list)\n
\n \n
if not editable:\n if not editable:\n
column_list.extend(not_editable_column_list)\n column_list.extend(not_editable_column_list)\n
\n \n
column_list.extend(editable_column_list)\n
\n \n
# this following columns are add for both edibales and not\n # this following columns are add for both edibales and not\n
for model_line in context.contentValues(portal_type=\'Pay Sheet Line\'):\n for model_line in context.contentValues(portal_type=\'Pay Sheet Line\'):\n
......
...@@ -89,6 +89,8 @@ ...@@ -89,6 +89,8 @@
<string>listbox_employer_share_price</string> <string>listbox_employer_share_price</string>
<string>listbox_employee_share_total_price</string> <string>listbox_employee_share_total_price</string>
<string>listbox_employer_share_total_price</string> <string>listbox_employer_share_total_price</string>
<string>listbox_int_index</string>
<string>listbox_title</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>all_columns</string>
<string>columns</string> <string>columns</string>
<string>editable_columns</string> <string>editable_columns</string>
<string>list_method</string> <string>list_method</string>
...@@ -62,17 +63,23 @@ ...@@ -62,17 +63,23 @@
<value> <value>
<dictionary> <dictionary>
<item> <item>
<key> <string>columns</string> </key> <key> <string>all_columns</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
<key> <string>editable_columns</string> </key> <key> <string>columns</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item>
<key> <string>editable_columns</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -81,10 +88,30 @@ ...@@ -81,10 +88,30 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>list_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>sort</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -92,6 +119,12 @@ ...@@ -92,6 +119,12 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>all_columns</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>columns</string> </key> <key> <string>columns</string> </key>
<value> <value>
...@@ -136,7 +169,7 @@ ...@@ -136,7 +169,7 @@
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -194,7 +227,7 @@ ...@@ -194,7 +227,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>here/PaySheetTransaction_getListBoxColumnList</string> </value> <value> <string>python:here.PaySheetTransaction_getListBoxColumnList() + [(\'translated_portal_type\', \'Type\')]</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
...@@ -210,12 +243,28 @@ ...@@ -210,12 +243,28 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: context.PaySheetTransaction_getListBoxColumnList(editable=1)</string> </value> <value> <string>here/PaySheetTransaction_getListBoxColumnList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.PaySheetTransaction_getListBoxColumnList(editable=1)</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle> <pickle>
<tuple> <tuple>
<global name="Method" module="Products.Formulator.MethodField"/> <global name="Method" module="Products.Formulator.MethodField"/>
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>css_class</string> <string>css_class</string>
<string>display_width</string>
<string>editable</string> <string>editable</string>
<string>input_style</string> <string>input_style</string>
<string>display_width</string>
<string>precision</string> <string>precision</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -95,6 +95,10 @@ ...@@ -95,6 +95,10 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string>figure</string> </value> <value> <string>figure</string> </value>
</item> </item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
...@@ -111,6 +115,10 @@ ...@@ -111,6 +115,10 @@
<key> <string>input_style</string> </key> <key> <string>input_style</string> </key>
<value> <string>-1 234.5</string> </value> <value> <string>-1 234.5</string> </value>
</item> </item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>title</string>
<string>css_class</string> <string>css_class</string>
<string>display_width</string>
<string>editable</string> <string>editable</string>
<string>input_style</string> <string>input_style</string>
<string>display_width</string>
<string>precision</string> <string>precision</string>
<string>title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -95,6 +95,10 @@ ...@@ -95,6 +95,10 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string>figure</string> </value> <value> <string>figure</string> </value>
</item> </item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
...@@ -111,6 +115,10 @@ ...@@ -111,6 +115,10 @@
<key> <string>input_style</string> </key> <key> <string>input_style</string> </key>
<value> <string>-1 234.5</string> </value> <value> <string>-1 234.5</string> </value>
</item> </item>
<item>
<key> <string>precision</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_int_index</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_integer_value</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>display_width</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>display_width</string> </key>
<value> <int>30</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewPayrollFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
</item> </item>
<item> <item>
<key> <string>name</string> </key> <key> <string>name</string> </key>
<value> <string>SystemPreference_viewBPM</string> </value> <value> <string>SystemPreference_viewPayroll</string> </value>
</item> </item>
<item> <item>
<key> <string>pt</string> </key> <key> <string>pt</string> </key>
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>BPM</string> </value> <value> <string>Payroll</string> </value>
</item> </item>
<item> <item>
<key> <string>unicode_mode</string> </key> <key> <string>unicode_mode</string> </key>
...@@ -145,6 +145,10 @@ ...@@ -145,6 +145,10 @@
<key> <string>update_action</string> </key> <key> <string>update_action</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
483 484
\ 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