parameters: (self, object, fixit=0)
return_statement: return errors
docstring: Check if the quantity of the transaction is greater than the
        balance of the source.
docstring_summary: Check if the quantity of the transaction is greater than the
        balance of the source.
docstring_tokens: Check if the quantity of the transaction is greater than the balance of the source .
function: def _checkConsistency(self, object, fixit=0):
        """
        Check if the quantity of the transaction is greater than the
        balance of the source.
        """
        errors = []
  
        source_cell = object.getSourceValue()
        destination_cell = object.getDestinationValue()
  
        if (source_cell is not None) and \
           (destination_cell is not None):
          # XXX Dirty code !
          quantity = object.getQuantity()
          budget_list = object.getPortalObject().budget_module.objectValues()
          max_quantity = 0
          for obj in budget_list:
            for item in obj.objectValues():
               if (item.getPortalType() == 'Budget Transfer Line') and \
                  (item.getSourceValue() == source_cell) and \
                  (item.getDestinationValue() == destination_cell):
                 max_quantity = item.getQuantity()
          if quantity > max_quantity:
            if fixit != 0:
              self.setQuantity(max_quantity)
            else:
              error_message = 'The quantity of the transaction is greater than ' \
                              'the transferable maximum quantity (TMQ): ' \
                              'TMQ = %.2f' % max_quantity
              # Add error
              errors.append(self._generateError(object, error_message))
        return errors
function_tokens: def _checkConsistency ( self , object , fixit = 0 ) : errors = [ ] source_cell = object . getSourceValue ( ) destination_cell = object . getDestinationValue ( ) if ( source_cell is not None ) and ( destination_cell is not None ) : # XXX Dirty code ! quantity = object . getQuantity ( ) budget_list = object . getPortalObject ( ) . budget_module . objectValues ( ) max_quantity = 0 for obj in budget_list : for item in obj . objectValues ( ) : if ( item . getPortalType ( ) == 'Budget Transfer Line' ) and ( item . getSourceValue ( ) == source_cell ) and ( item . getDestinationValue ( ) == destination_cell ) : max_quantity = item . getQuantity ( ) if quantity > max_quantity : if fixit != 0 : self . setQuantity ( max_quantity ) else : error_message = 'The quantity of the transaction is greater than ' 'the transferable maximum quantity (TMQ): ' 'TMQ = %.2f' % max_quantity # Add error errors . append ( self . _generateError ( object , error_message ) ) return errors