Commit 467f7631 authored by Vincent Pelletier's avatar Vincent Pelletier

Add closing date for closed bank accounts.

Also, provide bank account state.
Also, simplify code.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45565 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 524cbb56
...@@ -79,19 +79,29 @@ resource_uid = context.currency_module[context.Baobab_getPortalReferenceCurrency ...@@ -79,19 +79,29 @@ resource_uid = context.currency_module[context.Baobab_getPortalReferenceCurrency
inv_account_dict = {}\n inv_account_dict = {}\n
# Set empty dictionnary for each account\n # Set empty dictionnary for each account\n
for account_uid in account_uids:\n for account_uid in account_uids:\n
acc_dict = inv_account_dict[account_uid] = {}\n
account = account_dict[account_uid]\n account = account_dict[account_uid]\n
# context.log(\'account\',account)\n
acc_dict[\'account_reference\'] = account.getReference()\n
acc_dict[\'internal_bank_account_number\'] = account.getInternalBankAccountNumber()\n
parent_value = account.getParentValue()\n parent_value = account.getParentValue()\n
acc_dict[\'account_owner\'] = parent_value.getTitle()\n account_state = account.getValidationState()\n
acc_dict[\'activity\'] = None\n if account_state == \'closed\':\n
closed_date = DateTime(account.Base_getWorkflowHistory()[\'bank_account_workflow\'][\'item_list\'][0][-1]).Date()\n
else:\n
closed_date = None\n
if parent_value.getPortalType() == \'Organisation\':\n if parent_value.getPortalType() == \'Organisation\':\n
acc_dict[\'activity\'] = parent_value.getActivity()\n activity = parent_value.getActivity()\n
acc_dict[\'currency_title\'] = account.getPriceCurrencyTitle()\n else:\n
acc_dict[\'bic_code\'] = account.getBicCode(None)\n activity = None\n
acc_dict[\'transaction_list\'] = []\n inv_account_dict[account_uid] = {\n
state_title: account_state,\n
closed_date: closed_date,\n
account_reference: account.getReference(),\n
internal_bank_account_number: account.getInternalBankAccountNumber(),\n
state: account.getValidationState(),\n
activity: parent_activity,\n
account_owner: parent_value.getTitle(),\n
currency_title: account.getPriceCurrencyTitle(),\n
bic_code: account.getBicCode(None),\n
transaction_list: [],\n
}\n
\n \n
# Current inventory\n # Current inventory\n
if current_inventory:\n if current_inventory:\n
......
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