2

Use Case: The bank statement might contain some payments, that should NOT AT ALL get into CiviCRM (e.g. salary payments).

Is there an easy way to make the importer plugin skip certain lines?

Best Detlev

3
  • 1
    Thanks for drawing my attention to Civibanking - looks very useful. From a quick look at the user guide docs.civicrm.org/banking/en/latest/user-guide the Analysing Stage gives an example of "the payment has nothing to do with CiviCRM" which is what I think you want.
    – Mick Kahn
    Commented Aug 6, 2021 at 8:12
  • Thanks for your answer! However, this would work, but in this case is not enough: The bank statements contain some payments, that should never be stored within CiviCRM because they shall not be visible to unauthorized people. (i.e. CiviCRM users with access to CiviContribute and CiviBanking, but with no access to salary information). Commented Aug 7, 2021 at 9:16
  • Looking a bit more at the extension, I don't think its possible. CiviBanking is an extension to CiviCRM so if you really don't want it in CiviCRM at all then you will need it before importing the file. A quick look at the extension doesn't seem to have any speciific CiviBanking permissions so you can't limit to a specific user, which might be acceptable. But someone properly familiar with the extension may know more so I won't call this a answer yet. Hope there is a way.
    – Mick Kahn
    Commented Aug 7, 2021 at 17:49

2 Answers 2

4

Assuming that you're talking about the CSV importer, there is a configuration option called line_filter where you can provide a regular expression to skip a line if it doesn't match it. The "line" given to preg_match() is a standardized csv string. See here.

Additionally, there's also another (and even older) line filter mechanism based on the filter attribute, see here. However this approach has mostly been abandoned in favour of the more flexible regex based approach. However, it's still in the code for backwards compatibility, and there are still examples using it, see e.g. here.

2
  • Great - this is what I was searching for! Commented Aug 17, 2021 at 14:15
  • The solution is not obvious - therefore some more detail here: 1. Using the regex approach ("filter") is a good idea! 2. We have to set a regex filter for two kind of lines: a) The lines that should be imported b) The heading line! 3. Be aware, that the heading might contain the character ";" , which is not allowed. Commented Mar 30, 2023 at 18:43
0

Another way of doing this, is to operate with two bank accounts. One that is processed in CiviCRM, and one for transactions that normally shouldn’t be processed in CiviCRM. Only have the first one as bank files, and then you have solve it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.