Commit 3066c9aa authored by Tristan Cavelier's avatar Tristan Cavelier

erp5_payroll: XXX

parent 88e4b34f
......@@ -39,7 +39,6 @@ for inventory in portal.portal_simulation.getInventoryList(
precision=precision,
from_date=from_date,
at_date=at_date,
only_accountable=False,
group_by_resource=0,
group_by_node=1,
ledger=ledger, ):
......
......@@ -23,33 +23,39 @@ ledger = request.get('ledger', None)
portal_simulation = context.getPortalObject().portal_simulation
inventory_param_dict = {
employee_params = {
'group_by_node' : 1,
'group_by_variation': 1,
'section_uid' : section_uid_list,
'contribution_share_uid' : context.portal_categories.contribution_share.employee.getUid(),
'at_date' : at_date,
'from_date' : from_date,
'simulation_state' : simulation_state,
'precision' : precision,
'resource' : resource,
'ledger' : ledger,
'only_accountable': False,
'portal_type' : ('Pay Sheet Line', 'Pay Sheet Cell'),
}
}
employee_param_dict = inventory_param_dict.copy()
employee_param_dict['contribution_share_uid'] = context.portal_categories.contribution_share.employee.getUid()
employer_param_dict = inventory_param_dict.copy()
employer_param_dict['contribution_share_uid'] = context.portal_categories.contribution_share.employer.getUid()
employer_params = {
'group_by_node' : 1,
'group_by_variation': 1,
'section_uid' : section_uid_list,
'contribution_share_uid' : context.portal_categories.contribution_share.employer.getUid(),
'at_date' : at_date,
'from_date' : from_date,
'simulation_state' : simulation_state,
'precision' : precision,
'resource' : resource,
'ledger' : ledger,
}
if request.get('mirror_section'):
mirror_section = request['mirror_section']
employee_param_dict['mirror_section'] = mirror_section
employer_param_dict['mirror_section'] = mirror_section
employee_params['mirror_section'] = mirror_section
employer_params['mirror_section'] = mirror_section
employee_inventory_list = portal_simulation.getInventoryList(**employee_param_dict)
employer_inventory_list = portal_simulation.getInventoryList(**employer_param_dict)
employee_inventory_list = portal_simulation.getInventoryList(**employee_params)
employer_inventory_list = portal_simulation.getInventoryList(**employer_params)
inventory_list = {}
......
......@@ -5,7 +5,6 @@ getobject = portal.portal_catalog.getobject
for x in portal.portal_simulation.getInventoryList(
portal_type=('Pay Sheet Cell',
'Pay Sheet Line'),
only_accountable=False,
group_by_resource=0,
group_by_section=0,
group_by_mirror_section=1):
......
[lines, cols, tabs] = context.PaySheetLine_asCellRange()
line_items = []
col_items = []
tab_items = []
for line_path in lines:
line_title = context.portal_categories.resolveCategory(line_path).getTitleOrId()
line_items.append((line_path, line_title))
for col_path in cols:
col_title = context.portal_categories.resolveCategory(col_path).getTitleOrId()
col_items.append((col_path, col_title))
for tab_path in tabs:
tab_title = context.portal_categories.resolveCategory(tab_path).getTitleOrId()
tab_items.append((tab_path, tab_title))
return [line_items, col_items, tab_items]
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</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>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PaySheetLine_getCellRangeItemList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
from Products.PythonScripts.standard import Object
request = container.REQUEST
return [Object(
employer_share_preview=request['stat_employer_share_preview'],
employee_share_preview=request['stat_employee_share_preview'], )]
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</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>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PaySheetTransaction_statInitializePreview</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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