Commit b6debe61 authored by Sebastien Robin's avatar Sebastien Robin

update made by Guillaume


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1798 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent eb118709
...@@ -33,6 +33,7 @@ from Products.ERP5.ERP5Globals import movement_type_list, order_movement_type_li ...@@ -33,6 +33,7 @@ from Products.ERP5.ERP5Globals import movement_type_list, order_movement_type_li
from DateTime import DateTime from DateTime import DateTime
from copy import deepcopy from copy import deepcopy
from string import lower from string import lower
from Products.ERP5Type.DateUtils import centis, getClosestDate, addToDate
from zLOG import LOG from zLOG import LOG
...@@ -143,8 +144,7 @@ An ERP5 Rule...""" ...@@ -143,8 +144,7 @@ An ERP5 Rule..."""
### First, plan the theorical accounting movements ### First, plan the theorical accounting movements
accounting_movement_list = [] accounting_movement_list = []
immobilisation_movement_list = my_item.getImmobilisationMovementList() immobilisation_movement_list = my_item.getImmobilisationMovementValueList()
LOG('AmortisationRule :', 0, 'immobilisation_movement_list = %s' % repr(immobilisation_movement_list))
current_immo_movement = None current_immo_movement = None
for mvt_number in range(len(immobilisation_movement_list)): for mvt_number in range(len(immobilisation_movement_list)):
...@@ -189,16 +189,12 @@ An ERP5 Rule...""" ...@@ -189,16 +189,12 @@ An ERP5 Rule..."""
if accounting_movement['quantity'] != 0: if accounting_movement['quantity'] != 0:
my_type = accounting_movement['type'] my_type = accounting_movement['type']
if ids.get(my_type) is None: if ids.get(my_type) is None:
LOG('AmortisationRule :', 0, 'ids has no attribute %s' % repr(my_type))
ids[my_type] = movement_last_id_list.get(my_type, None) ids[my_type] = movement_last_id_list.get(my_type, None)
if ids[my_type] is None: if ids[my_type] is None:
ids[my_type] = -1 ids[my_type] = -1
ids[my_type] = ids[my_type] + 1 ids[my_type] = ids[my_type] + 1
new_id = my_type + '_' + str(ids[my_type]) new_id = my_type + '_' + str(ids[my_type])
LOG('AmortisationRule :', 0, 'ids[my_type] = %s after incrementing' % repr(ids[my_type]))
LOG('AmortisationRule :', 0, 'creating simulation movement %s...' % repr(new_id))
# Round date # Round date
stop_date = accounting_movement['stop_date'] stop_date = accounting_movement['stop_date']
...@@ -230,26 +226,15 @@ An ERP5 Rule...""" ...@@ -230,26 +226,15 @@ An ERP5 Rule..."""
between the two given immobilisation movements. between the two given immobilisation movements.
If next_immo_movement is None, accounting movements are made at infinite. If next_immo_movement is None, accounting movements are made at infinite.
""" """
def changeDateYear(date, new_year):
"""
Return the given date modified so that its year is new_year
"""
if new_year is not None:
return DateTime( str(int(new_year)) + "/" + str(date.month()) + "/" + str(date.day()) )
else:
return date
item = current_immo_movement.getParent() item = current_immo_movement.getParent()
if item is not None: if item is not None:
# First we need to calculate the item value at the first immobilisation movement date # First we need to calculate the item value at the first immobilisation movement date
begin_value = current_immo_movement.getAmortisationOrDefaultAmortisationValue() begin_value = current_immo_movement.getAmortisationOrDefaultAmortisationPrice()
begin_remaining = current_immo_movement.getAmortisationOrDefaultAmortisationDuration() begin_remaining = current_immo_movement.getAmortisationOrDefaultAmortisationDuration()
# To find financial end date, we need to know the company # To find financial end date, we need to know the company
organisation = current_immo_movement.getOrganisation() section = current_immo_movement.getSectionValue()
currency = current_immo_movement.getCurrency() currency = current_immo_movement.getPriceCurrency()
if currency is not None: if currency is not None:
currency = self.currency[currency.split('/')[-1]] currency = self.currency[currency.split('/')[-1]]
...@@ -261,26 +246,27 @@ An ERP5 Rule...""" ...@@ -261,26 +246,27 @@ An ERP5 Rule..."""
returned_list = [] returned_list = []
# Calculate particular accounting movements (immobilisation beginning, end, ownership change...) # Calculate particular accounting movements (immobilisation beginning, end, ownership change...)
immobilised_before = item.isImmobilised(at_date = start_date - 0.00001) LOG('_getAccountingMovement start_date',0,start_date)
LOG('_getAccountingMovement centis',0,centis)
immobilised_before = item.isImmobilised(at_date = start_date - centis)
immobilised_after = current_immo_movement.getImmobilisation() immobilised_after = current_immo_movement.getImmobilisation()
replace = 0 replace = 0
if immobilised_before and previous_immo_movement is not None: if immobilised_before and previous_immo_movement is not None:
immo_begin_value = previous_immo_movement.getAmortisationOrDefaultAmortisationValue() immo_begin_value = previous_immo_movement.getAmortisationOrDefaultAmortisationPrice()
immo_end_value = current_immo_movement.getDefaultAmortisationValue() # We use this method in order to get the calculated value immo_end_value = current_immo_movement.getDefaultAmortisationPrice() # We use this method in order to get the calculated value
# of the item, and not the value entered later by the user # of the item, and not the value entered later by the user
if immo_end_value is not None: if immo_end_value is not None:
amortisation_value = immo_begin_value - immo_end_value amortisation_price = immo_begin_value - immo_end_value
end_vat = previous_immo_movement.getVat() * immo_end_value / immo_begin_value end_vat = previous_immo_movement.getVat() * immo_end_value / immo_begin_value
immo_end_value_vat = immo_end_value + end_vat immo_end_value_vat = immo_end_value + end_vat
returned_list.extend([{ 'stop_date' : start_date, returned_list.extend([{ 'stop_date' : start_date,
'type' : 'immo', 'type' : 'immo',
'quantity' : -immo_begin_value, 'quantity' : -immo_begin_value,
'source' : None, 'source' : None,
'destination' : previous_immo_movement.getImmobilisationAccount(), 'destination' : previous_immo_movement.getImmobilisationAccount(),
'source_section_value' : None, 'source_section_value' : None,
'destination_section_value' : previous_immo_movement.getOrganisation(), 'destination_section_value' : previous_immo_movement.getSectionValue(),
'resource_value' : currency }, 'resource_value' : currency },
{ 'stop_date' : start_date, { 'stop_date' : start_date,
'type' : 'vat', 'type' : 'vat',
...@@ -288,15 +274,15 @@ An ERP5 Rule...""" ...@@ -288,15 +274,15 @@ An ERP5 Rule..."""
'source' : None, 'source' : None,
'destination' : previous_immo_movement.getVatAccount(), 'destination' : previous_immo_movement.getVatAccount(),
'source_section_value' : None, 'source_section_value' : None,
'destination_section_value' : previous_immo_movement.getOrganisation(), 'destination_section_value' : previous_immo_movement.getSectionValue(),
'resource_value' : currency }, 'resource_value' : currency },
{ 'stop_date' : start_date, { 'stop_date' : start_date,
'type' : 'amo', 'type' : 'amo',
'quantity' : amortisation_value, 'quantity' : amortisation_price,
'source' : None, 'source' : None,
'destination' : previous_immo_movement.getAmortisationAccount(), 'destination' : previous_immo_movement.getAmortisationAccount(),
'source_section_value' : None, 'source_section_value' : None,
'destination_section_value' : previous_immo_movement.getOrganisation(), 'destination_section_value' : previous_immo_movement.getSectionValue(),
'resource_value' : currency }, 'resource_value' : currency },
{ 'stop_date' : start_date, { 'stop_date' : start_date,
'type' : 'in_out', 'type' : 'in_out',
...@@ -304,7 +290,7 @@ An ERP5 Rule...""" ...@@ -304,7 +290,7 @@ An ERP5 Rule..."""
'source' : None, 'source' : None,
'destination' : previous_immo_movement.getOutputAccount(), 'destination' : previous_immo_movement.getOutputAccount(),
'source_section_value' : None, 'source_section_value' : None,
'destination_section_value' : previous_immo_movement.getOrganisation(), 'destination_section_value' : previous_immo_movement.getSectionValue(),
'resource_value' : currency } ] ) 'resource_value' : currency } ] )
replace = 1 replace = 1
...@@ -319,7 +305,7 @@ An ERP5 Rule...""" ...@@ -319,7 +305,7 @@ An ERP5 Rule..."""
returned_list[2]['source'] = current_immo_movement.getAmortisationAccount() returned_list[2]['source'] = current_immo_movement.getAmortisationAccount()
returned_list[3]['source'] = current_immo_movement.getInputAccount() returned_list[3]['source'] = current_immo_movement.getInputAccount()
for i in range(4): for i in range(4):
returned_list[i]['source_section_value'] = organisation returned_list[i]['source_section_value'] = section
replace = 0 replace = 0
else: else:
returned_list.extend([{ 'stop_date' : start_date, returned_list.extend([{ 'stop_date' : start_date,
...@@ -327,7 +313,7 @@ An ERP5 Rule...""" ...@@ -327,7 +313,7 @@ An ERP5 Rule..."""
'quantity' : - immo_begin_value, 'quantity' : - immo_begin_value,
'source' : current_immo_movement.getImmobilisationAccount(), 'source' : current_immo_movement.getImmobilisationAccount(),
'destination' : None, 'destination' : None,
'source_section_value' : organisation, 'source_section_value' : section,
'destination_section_value' : None, 'destination_section_value' : None,
'resource_value' : currency }, 'resource_value' : currency },
{ 'stop_date' : start_date, { 'stop_date' : start_date,
...@@ -335,7 +321,7 @@ An ERP5 Rule...""" ...@@ -335,7 +321,7 @@ An ERP5 Rule..."""
'quantity' : - begin_vat, 'quantity' : - begin_vat,
'source' : current_immo_movement.getVatAccount(), 'source' : current_immo_movement.getVatAccount(),
'destination' : None, 'destination' : None,
'source_section_value' : organisation, 'source_section_value' : section,
'destination_section_value' : None, 'destination_section_value' : None,
'resource_value' : currency }, 'resource_value' : currency },
{ 'stop_date' : start_date, { 'stop_date' : start_date,
...@@ -343,7 +329,7 @@ An ERP5 Rule...""" ...@@ -343,7 +329,7 @@ An ERP5 Rule..."""
'quantity' : 0, 'quantity' : 0,
'source' : current_immo_movement.getAmortisationAccount(), 'source' : current_immo_movement.getAmortisationAccount(),
'destination' : None, 'destination' : None,
'source_section_value' : organisation, 'source_section_value' : section,
'destination_section_value' : None, 'destination_section_value' : None,
'resource_value' : currency }, 'resource_value' : currency },
{ 'stop_date' : start_date, { 'stop_date' : start_date,
...@@ -351,7 +337,7 @@ An ERP5 Rule...""" ...@@ -351,7 +337,7 @@ An ERP5 Rule..."""
'quantity' : immo_begin_value + begin_vat, 'quantity' : immo_begin_value + begin_vat,
'source' : current_immo_movement.getInputAccount(), 'source' : current_immo_movement.getInputAccount(),
'destination' : None, 'destination' : None,
'source_section_value' : organisation, 'source_section_value' : section,
'destination_section_value' : None, 'destination_section_value' : None,
'resource_value' : currency } ] ) 'resource_value' : currency } ] )
...@@ -371,24 +357,19 @@ An ERP5 Rule...""" ...@@ -371,24 +357,19 @@ An ERP5 Rule..."""
if immobilised_after: if immobilised_after:
# Search for the first financial end date after the first immobilisation movement # Search for the first financial end date after the first immobilisation movement
end_date = organisation.getFinancialYearEndDate() end_date = getClosestDate(target_date=start_date, date=section.getFinancialYearStopDate(), precision='year', before=0)
end_date = changeDateYear(end_date, start_date.year() )
if end_date - start_date <= 0:
end_date = changeDateYear(end_date, end_date.year()+1)
while (stop_date is None and current_value > 0) or (stop_date is not None and end_date - stop_date < 0): while (stop_date is None and current_value > 0) or (stop_date is not None and end_date - stop_date < 0):
annuity_end_value = item.getAmortisationPrice(at_date=end_date) annuity_end_value = item.getAmortisationPrice(at_date=end_date)
LOG('AmortisationRule :',0,'annuity_end_value=%s, current_value=%s' % (repr(annuity_end_value), repr(current_value)))
if annuity_end_value is not None: if annuity_end_value is not None:
annuity_value = current_value - annuity_end_value annuity_value = current_value - annuity_end_value
if annuity_value != 0: if annuity_value != 0:
LOG('AmortisationRule :', 0, 'annuity until %s ; value = %s, organisation = %s' % (repr(end_date), repr(annuity_value), repr(organisation)))
returned_list.extend([{ 'stop_date' : end_date, returned_list.extend([{ 'stop_date' : end_date,
'type' : 'annuity_depr', 'type' : 'annuity_depr',
'quantity' : (- annuity_value), 'quantity' : (- annuity_value),
'source' : current_immo_movement.getDepreciationAccount(), 'source' : current_immo_movement.getDepreciationAccount(),
'destination' : None, 'destination' : None,
'source_section_value' : organisation, 'source_section_value' : section,
'destination_section_value': None, 'destination_section_value': None,
'resource_value' : currency }, 'resource_value' : currency },
{ 'stop_date' : end_date, { 'stop_date' : end_date,
...@@ -396,28 +377,27 @@ An ERP5 Rule...""" ...@@ -396,28 +377,27 @@ An ERP5 Rule..."""
'quantity' : annuity_value, 'quantity' : annuity_value,
'source' : current_immo_movement.getAmortisationAccount(), 'source' : current_immo_movement.getAmortisationAccount(),
'destination' : None, 'destination' : None,
'source_section_value' : organisation, 'source_section_value' : section,
'destination_section_value': None, 'destination_section_value': None,
'resource_value' : currency } ] ) 'resource_value' : currency } ] )
current_value -= annuity_value current_value -= annuity_value
end_date = changeDateYear(end_date, end_date.year()+1) end_date = addToDate(end_date, {'year':1})
# Get the last period until the next immobilisation movement # Get the last period until the next immobilisation movement
if stop_date is not None: if stop_date is not None:
# We use DefaultAmortisationValue in order to get the calculated value of the item, # We use getDefaultAmortisationPrice in order to get the calculated value of the item,
# and not the value entered later by the user for the next immobilisation period # and not the value entered later by the user for the next immobilisation period
annuity_end_value = next_immo_movement.getDefaultAmortisationValue() annuity_end_value = next_immo_movement.getDefaultAmortisationPrice()
if annuity_end_value is not None: if annuity_end_value is not None:
annuity_value = current_value - annuity_end_value annuity_value = current_value - annuity_end_value
if annuity_value != 0: if annuity_value != 0:
LOG('AmortisationRule :', 0, 'annuity until %s ; value = %s, organisation = %s' % (repr(next_immo_movement.getStopDate()), repr(annuity_value), repr(organisation)))
returned_list.extend([{ 'stop_date' : end_date, returned_list.extend([{ 'stop_date' : end_date,
'type' : 'annuity_depr', 'type' : 'annuity_depr',
'quantity' : (- annuity_value), 'quantity' : (- annuity_value),
'source' : current_immo_movement.getDepreciationAccount(), 'source' : current_immo_movement.getDepreciationAccount(),
'destination' : None, 'destination' : None,
'source_section_value' : organisation, 'source_section_value' : section,
'destination_section_value': None, 'destination_section_value': None,
'resource_value' : currency }, 'resource_value' : currency },
{ 'stop_date' : end_date, { 'stop_date' : end_date,
...@@ -425,7 +405,7 @@ An ERP5 Rule...""" ...@@ -425,7 +405,7 @@ An ERP5 Rule..."""
'quantity' : annuity_value, 'quantity' : annuity_value,
'source' : current_immo_movement.getAmortisationAccount(), 'source' : current_immo_movement.getAmortisationAccount(),
'destination' : None, 'destination' : None,
'source_section_value' : organisation, 'source_section_value' : section,
'destination_section_value': None, 'destination_section_value': None,
'resource_value' : currency } ] ) 'resource_value' : currency } ] )
......
...@@ -119,17 +119,17 @@ an accounting immobilisation (in order to amortise an object) ...@@ -119,17 +119,17 @@ an accounting immobilisation (in order to amortise an object)
} }
security.declareProtected(Permissions.View, 'getAmortisationOrDefaultAmortisationValue') security.declareProtected(Permissions.View, 'getAmortisationOrDefaultAmortisationPrice')
def getAmortisationOrDefaultAmortisationValue(self, with_currency=0, **kw): def getAmortisationOrDefaultAmortisationPrice(self, with_currency=0, **kw):
""" """
Returns the amortisation value. Returns the amortisation value.
If it is None, returns the default amortisation value. If it is None, returns the default amortisation value.
""" """
amortisation_value = self.getAmortisationValue() amortisation_price = self.getAmortisationBeginningPrice()
if amortisation_value is not None: if amortisation_price is not None:
return amortisation_value return amortisation_price
else: else:
return self.getDefaultAmortisationValue(with_currency=with_currency, **kw) return self.getDefaultAmortisationPrice(with_currency=with_currency, **kw)
security.declareProtected(Permissions.View, 'getAmortisationOrDefaultAmortisationDuration') security.declareProtected(Permissions.View, 'getAmortisationOrDefaultAmortisationDuration')
...@@ -159,15 +159,14 @@ an accounting immobilisation (in order to amortise an object) ...@@ -159,15 +159,14 @@ an accounting immobilisation (in order to amortise an object)
return item.getRemainingAmortisationDuration(current_date, from_immobilisation=1, **kw) return item.getRemainingAmortisationDuration(current_date, from_immobilisation=1, **kw)
security.declareProtected(Permissions.ModifyPortalContent, 'getDefaultAmortisationValue') security.declareProtected(Permissions.ModifyPortalContent, 'getDefaultAmortisationPrice')
def getDefaultAmortisationValue(self, with_currency=0, **kw): def getDefaultAmortisationPrice(self, with_currency=0, **kw):
""" """
Returns a calculated value of amortisation value Returns a calculated value of amortisation value
at the immobilisation movement date at the immobilisation movement date
""" """
item = self.getParent() item = self.getParent()
current_date = self.getStopDate() current_date = self.getStopDate()
LOG('Immobilisation :',0, 'current_date=%s, item=%s' % (repr(current_date), repr(item)))
if current_date is None or item is None: if current_date is None or item is None:
return None return None
...@@ -175,48 +174,41 @@ an accounting immobilisation (in order to amortise an object) ...@@ -175,48 +174,41 @@ an accounting immobilisation (in order to amortise an object)
return returned_value return returned_value
security.declarePrivate('_checkConsistency')
security.declareProtected(Permissions.View, 'isNotValid') def _checkConsistency(self, fixit=0, mapped_value_property_list=()):
def isNotValid(self): errors = []
""" relative_url = self.getRelativeUrl()
Checks if necessary data is present on the immobilisation movement.
Returns an error message, or None if the immobilisation is valid
XXX please use checkConsistency API instead and try to use constraint
checkers for implementation
"""
item = self.getParent() item = self.getParent()
if item is None: if item is None:
return "The immobilisation movement does not apply on an item" errors += [(relative_url, "Property value inconsistency", 100, "The immobilisation movement does not apply on an item")]
immo_date = self.getStopDate() immo_date = self.getStopDate()
if immo_date is None: if immo_date is None:
return 'Date field is not filled' errors += [(relative_url, "Property value inconsistency", 100, 'Date property is empty')]
if self.getImmobilisation(): if self.getImmobilisation():
immo_duration = self.getAmortisationDuration() immo_duration = self.getAmortisationDuration()
if immo_duration is None: if immo_duration is None:
return 'Duration field is not filled' errors += [(relative_url, "Property value inconsistency", 100, 'Amortisation duration property is empty')]
immo_value = self.getAmortisationValue() immo_value = self.getAmortisationBeginningPrice()
if immo_value is None: if immo_value is None:
return 'Value field is not filled' errors += [(relative_url, "Property value inconsistency", 100, 'Amortisation price property is empty')]
immo_type = self.getAmortisationType() immo_type = self.getAmortisationType()
if immo_type is None or immo_type is "": if immo_type is None or immo_type is "":
return "Amortisation field is not filled" errors += [(relative_url, "Property value inconsistency", 100, 'Amortisation type property is empty')]
if immo_type == "degressive": if immo_type == "degressive":
fiscal_coef = self.getFiscalCoefficient() fiscal_coef = self.getFiscalCoefficient()
if fiscal_coef is None: if fiscal_coef is None:
return "Fiscal coefficient field is not filled" errors += [(relative_url, "Property value inconsistency", 100, 'Fiscal coefficient property is empty')]
vat = self.getVat() vat = self.getVat()
if vat is None: if vat is None:
return "VAT Amount field is not filled" errors += [(relative_url, "Property value inconsistency", 100, 'VAT Amount property is empty')]
for (account, text) in ( (self.getInputAccount() , "Input Account"), for (account, text) in ( (self.getInputAccount() , "Input Account"),
(self.getOutputAccount() , "Output Account"), (self.getOutputAccount() , "Output Account"),
(self.getImmobilisationAccount(), "Immobilisation Account"), (self.getImmobilisationAccount(), "Immobilisation Account"),
...@@ -224,72 +216,58 @@ an accounting immobilisation (in order to amortise an object) ...@@ -224,72 +216,58 @@ an accounting immobilisation (in order to amortise an object)
(self.getDepreciationAccount() , "Deprecisation Account"), (self.getDepreciationAccount() , "Deprecisation Account"),
(self.getVatAccount() , "VAT Account") ): (self.getVatAccount() , "VAT Account") ):
if account is None or account is "": if account is None or account is "":
return text + " list has no selected choice" errors += [(relative_url, "Property value inconsistency", 100, text + ' property is empty')]
section = self.getSectionValue()
if section is None:
errors += [(relative_url, "Property value inconsistency", 100, "The corresponding item does not belong to an organisation at this date")]
else:
financial_date = section.getFinancialYearStopDate()
if financial_date is None:
errors += [(relative_url, "Property value inconsistency", 100, "The organisation which owns the item at this date has no financial year end date")]
organisation = self.getOrganisation() currency = self.getPriceCurrency()
if organisation is None:
return "Item %s does not belong to an organisation at this date" % item.getTitle()
financial_date = organisation.getFinancialYearEndDate()
if financial_date is None:
return "The organisation which owns the item at this date has no financial year end date"
currency = self.getCurrency()
if currency is None: if currency is None:
return "The organisation which owns the item at this date has no amortisation currency" errors += [(relative_url, "Property value inconsistency", 100, "The organisation which owns the item at this date has no amortisation currency")]
return None return errors
security.declareProtected(Permissions.View, 'getOrganisation') security.declareProtected(Permissions.View, 'getSectionValue')
def getOrganisation(self): def getSectionValue(self):
""" """
Returns the organisation which owns the item on which the Returns the organisation which owns the item on which the
immobilisation movement applies, at the time of the immobilisation immobilisation movement applies, at the time of the immobilisation
movement movement
XXX Naming problem -> it is an owner
Please rename to getSectionValue on both item and immobilisation
""" """
# if self.isContext() and hasattr(self, 'organisation'):
# return self.organisation
item = self.getParent() item = self.getParent()
date = self.getStopDate() date = self.getStopDate()
if item is None or date is None: if item is None or date is None:
return None return None
LOG('Immobilisation :', 0, 'item = %s for immobilisation %s' % (repr(item), repr(self))) return item.getSectionValue(at_date = date)
return item.getOwner(at_date = date)
security.declareProtected(Permissions.View, 'getOrganisationTitle') security.declareProtected(Permissions.View, 'getSectionTitle')
def getOrganisationTitle(self): def getSectionTitle(self):
""" """
Returns the name of the organisation which owns the Returns the name of the organisation which owns the
item on which the immobilisation movement applies, at the item on which the immobilisation movement applies, at the
time of the immobilisation movement time of the immobilisation movement
XXX id. same naming problem getSectionTitle
""" """
organisation = self.getOrganisation() section = self.getSectionValue()
if organisation is None: if section is None:
return None return None
return organisation.getTitle() return section.getTitle()
security.declareProtected(Permissions.View, 'getCurrency') security.declareProtected(Permissions.View, 'getPriceCurrency')
def getCurrency(self): def getPriceCurrency(self):
""" """
Returns the used currency id for this particular immobilisation movement Returns the used currency id for this particular immobilisation movement
XXX Rename to getPriceCurrency (this is the name we use at this point, it will be renamed
some day to getTradeCurrency - make sure getPriceCurrencyValue is object and getPriceCurrency is not)
""" """
organisation = self.getOrganisation() section = self.getSectionValue()
if organisation is not None: if section is not None:
LOG('Immobilisation :', 0, 'organisation = %s, currency = %s' % (repr(organisation), repr(organisation.getSocialCapitalCurrency()))) return section.getSocialCapitalCurrency()
return organisation.getSocialCapitalCurrency()
LOG('Immobilisation :', 0, 'organisation = %s, currency = %s' % (repr(organisation), repr(None)))
return None return None
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