Commit a762d700 authored by Aurel's avatar Aurel

fix code layout

add a way to define delivery line portal type when creating container


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7553 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5d4f9a46
...@@ -378,10 +378,7 @@ class TestERP5BankingMixin: ...@@ -378,10 +378,7 @@ class TestERP5BankingMixin:
caveau = c.newContent(id='caveau', portal_type='Category', codification='', vault_type='site/caveau') caveau = c.newContent(id='caveau', portal_type='Category', codification='', vault_type='site/caveau')
for s in ['auxiliaire', 'reserve', 'externes', 'serre']: for s in ['auxiliaire', 'reserve', 'externes', 'serre']:
s = caveau.newContent(id='%s' %(s,), portal_type='Category', codification='', vault_type='site/caveau/%s' %(s,)) s = caveau.newContent(id='%s' %(s,), portal_type='Category', codification='', vault_type='site/caveau/%s' %(s,))
if s.getId() == 'auxiliaire': if s.getId() == 'serre':
for ss in ['encaisse_des_billets_a_ventiler_et_a_detruire', 'encaisse_des_billets_ventiles_et_detruits']:
s.newContent(id='%s' %(ss,), portal_type='Category', codification='', vault_type='site/caveau/%s' %(s.getId(),))
elif s.getId() == 'serre':
for ss in ['encaisse_des_billets_neufs_non_emis', 'encaisse_des_billets_retires_de_la_circulation','encaisse_des_billets_detruits']: for ss in ['encaisse_des_billets_neufs_non_emis', 'encaisse_des_billets_retires_de_la_circulation','encaisse_des_billets_detruits']:
ss = s.newContent(id='%s' %(ss,), portal_type='Category', codification='', vault_type='site/caveau/%s' %(s.getId(),)) ss = s.newContent(id='%s' %(ss,), portal_type='Category', codification='', vault_type='site/caveau/%s' %(s.getId(),))
else: else:
...@@ -391,6 +388,9 @@ class TestERP5BankingMixin: ...@@ -391,6 +388,9 @@ class TestERP5BankingMixin:
for country in ['France', 'Spain']: for country in ['France', 'Spain']:
if country[0] != c.getCodification()[0]: if country[0] != c.getCodification()[0]:
ss.newContent(id='%s' %(country,), portal_type='Category', codification='', vault_type='site/caveau/%s' %(s.getId(),)) ss.newContent(id='%s' %(country,), portal_type='Category', codification='', vault_type='site/caveau/%s' %(s.getId(),))
if s.getId() == 'auxiliaire':
for ss in ['encaisse_des_billets_a_ventiler_et_a_detruire', 'encaisse_des_billets_ventiles_et_detruits']:
s.newContent(id='%s' %(ss,), portal_type='Category', codification='', vault_type='site/caveau/%s' %(s.getId(),))
def openCounterDate(self, date=None, site=None): def openCounterDate(self, date=None, site=None):
...@@ -520,13 +520,13 @@ class TestERP5BankingMixin: ...@@ -520,13 +520,13 @@ class TestERP5BankingMixin:
return check return check
def createCashContainer(self, document, container_portal_type, global_dict, line_list,): def createCashContainer(self, document, container_portal_type, global_dict, line_list, delivery_line_type='Cash Delivery Line'):
""" """
Create a cash container Create a cash container
global_dict has keys : global_dict has keys :
emission_letter, variation, cash_status, resource emission_letter, variation, cash_status, resource
line_list is a list od dict with keys: line_list is a list od dict with keys:
reference, range_start, range_stop, quantity reference, range_start, range_stop, quantity, aggregate
""" """
# Container Creation # Container Creation
base_list=('emission_letter', 'variation', 'cash_status') base_list=('emission_letter', 'variation', 'cash_status')
...@@ -540,6 +540,8 @@ class TestERP5BankingMixin: ...@@ -540,6 +540,8 @@ class TestERP5BankingMixin:
, cash_number_range_start = line_dict['range_start'] , cash_number_range_start = line_dict['range_start']
, cash_number_range_stop = line_dict['range_stop'] , cash_number_range_stop = line_dict['range_stop']
) )
if line_dict.has_key('aggregate'):
movement_container.setAggregateValueList([line_dict['aggregate'],])
# create a cash container line # create a cash container line
container_line = movement_container.newContent(portal_type = 'Container Line' container_line = movement_container.newContent(portal_type = 'Container Line'
, reindex_object = 1 , reindex_object = 1
...@@ -564,7 +566,7 @@ class TestERP5BankingMixin: ...@@ -564,7 +566,7 @@ class TestERP5BankingMixin:
resource_total_quantity += line_dict['quantity'] resource_total_quantity += line_dict['quantity']
# create cash delivery movement # create cash delivery movement
movement_line = document.newContent(id = "movement" movement_line = document.newContent(id = "movement"
, portal_type = 'Cash Delivery Line' , portal_type = delivery_line_type
, resource_value = global_dict['resource'] , resource_value = global_dict['resource']
, quantity_unit_value = self.getCategoryTool().quantity_unit.unit , quantity_unit_value = self.getCategoryTool().quantity_unit.unit
) )
......
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