(self, matched_candidates_values)
return {'rejected'}
Check restrictions that can't be handled for each move.line separately.
        Note: Only used by models having a type equals to 'invoice_matching'.

        :param matched_candidates_values: The values computed by '_process_matched_candidates_data'.
        :return: A string representing what to do with the candidates:
            * rejected:             Reject candidates.
            * allow_write_off:      Allow to generate the write-off from the reconcile model lines if specified.
            * allow_auto_reconcile: Allow to automatically reconcile entries if 'auto_validate' is enabled.
Check restrictions that can't be handled for each move.line separately.
        Note: Only used by models having a type equals to 'invoice_matching'.
Check restrictions that can t be handled for each move . line separately . Note : Only used by models having a type equals to invoice_matching .
def _check_rule_propositions(self, matched_candidates_values):
        """ Check restrictions that can't be handled for each move.line separately.
        Note: Only used by models having a type equals to 'invoice_matching'.

        :param matched_candidates_values: The values computed by '_process_matched_candidates_data'.
        :return: A string representing what to do with the candidates:
            * rejected:             Reject candidates.
            * allow_write_off:      Allow to generate the write-off from the reconcile model lines if specified.
            * allow_auto_reconcile: Allow to automatically reconcile entries if 'auto_validate' is enabled.
        """
        candidates = matched_candidates_values['candidates']
        currency = matched_candidates_values['currency']

        if not self.allow_payment_tolerance:
            return {'allow_write_off', 'allow_auto_reconcile'}
        if not candidates:
            return {'rejected'}

        # The statement line will be fully reconciled.
        residual_balance_after_rec = matched_candidates_values['residual_balance_curr'] + matched_candidates_values['candidates_balance_curr']
        if currency.is_zero(residual_balance_after_rec):
            return {'allow_auto_reconcile'}

        # The payment amount is higher than the sum of invoices.
        # In that case, don't check the tolerance and don't try to generate any write-off.
        if residual_balance_after_rec > 0.0:
            return {'allow_auto_reconcile'}

        # No tolerance, reject the candidates.
        if self.payment_tolerance_param == 0:
            return {'rejected'}

        # If the tolerance is expressed as a fixed amount, check the residual payment amount doesn't exceed the
        # tolerance.
        if self.payment_tolerance_type == 'fixed_amount' and -residual_balance_after_rec <= self.payment_tolerance_param:
            return {'allow_write_off', 'allow_auto_reconcile'}

        # The tolerance is expressed as a percentage between 0 and 100.0.
        reconciled_percentage_left = (residual_balance_after_rec / matched_candidates_values['candidates_balance_curr']) * 100.0
        if self.payment_tolerance_type == 'percentage' and reconciled_percentage_left <= self.payment_tolerance_param:
            return {'allow_write_off', 'allow_auto_reconcile'}

        return {'rejected'}
def _check_rule_propositions ( self , matched_candidates_values ) : candidates = matched_candidates_values [ 'candidates' ] currency = matched_candidates_values [ 'currency' ] if not self . allow_payment_tolerance : return { 'allow_write_off' , 'allow_auto_reconcile' } if not candidates : return { 'rejected' } # The statement line will be fully reconciled. residual_balance_after_rec = matched_candidates_values [ 'residual_balance_curr' ] + matched_candidates_values [ 'candidates_balance_curr' ] if currency . is_zero ( residual_balance_after_rec ) : return { 'allow_auto_reconcile' } # The payment amount is higher than the sum of invoices. # In that case, don't check the tolerance and don't try to generate any write-off. if residual_balance_after_rec > 0.0 : return { 'allow_auto_reconcile' } # No tolerance, reject the candidates. if self . payment_tolerance_param == 0 : return { 'rejected' } # If the tolerance is expressed as a fixed amount, check the residual payment amount doesn't exceed the # tolerance. if self . payment_tolerance_type == 'fixed_amount' and - residual_balance_after_rec <= self . payment_tolerance_param : return { 'allow_write_off' , 'allow_auto_reconcile' } # The tolerance is expressed as a percentage between 0 and 100.0. reconciled_percentage_left = ( residual_balance_after_rec / matched_candidates_values [ 'candidates_balance_curr' ] ) * 100.0 if self . payment_tolerance_type == 'percentage' and reconciled_percentage_left <= self . payment_tolerance_param : return { 'allow_write_off' , 'allow_auto_reconcile' } return { 'rejected' }