Answers.Body: <p>Your configuration seems not to be correct. And to me it looks like you have set up a configuration for an XML (CAMT0.53) file and your example looks like a CVS file. </p>
  
  <p>You can use one of the examples from the CSV directory as an example and the tweak it to your needs: <a href="https://github.com/Project60/org.project60.banking/tree/master/configuration_database/importer/csv" rel="nofollow noreferrer">https://github.com/Project60/org.project60.banking/tree/master/configuration_database/importer/csv</a></p>
  
  <p>Below a configuration which works with the example csv file you provided in the question:</p>
  
  <pre><code>{
    "delimiter": ",",
    "encoding": "UTF8",
    "header": 1,
    "defaults": {},
    "rules": [
      {
        "from": "Datum",
        "to": "booking_date",
        "type": "strtotime:Ymd"
      },
      {
        "from": "Datum",
        "to": "value_date",
        "type": "strtotime:Ymd"
      },
      {
        "from": "Naam / Omschrijving",
        "to": "name",
        "type": "set"
      },
      {
        "from": "Bedrag (EUR)",
        "to": "amount",
        "type": "amount"
      },
      {
        "from": "_constant:EUR",
        "to": "currency",
        "type": "set"
      },
      {
        "from": "Mededelingen",
        "to": "purpose",
        "type": "set"
      },
      {
        "from": "Tegenrekening",
        "to": "_party_ba_id",
        "type": "set"
      },
      {
        "from": "Rekening",
        "to": "_bank_id",
        "type": "set"
      }
    ]
  }
  </code></pre>
  
  <p><strong>A few remarks</strong>: </p>
  
  <p>I dont know what would happen if a write-off is present in the file. Is that indicated by a negative amount? Or is the column Bij Af / set to Af.</p>
  
  <p>The name in the <em>from</em> part of a rule is the name of the column in the csv file. However there is also a from which sets a constant value to EUR. </p>
  
  <p>The name in <em>to</em> part is the name of the field in the CiviBanking transaction. You could define new fields here as you can use existing ones (like booking_date, value_date, amount and purpose). The new ones can be used in the configuration of the matchers. However I have not defined any new fields here. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-17T04:14:43.573Z
Answers.Text: Your configuration seems not to be correct. And to me it looks like you have set up a configuration for an XML (CAMT0.53) file and your example looks like a CVS file.
  
  Did you mean CVS or CSV as mentioned above?
Answers.UserDisplayName: harshal
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-17T05:18:45.827Z
Answers.Text: Also, I tried to import CSV files from the example, but every time I do that my booking_date value is shown as 01-01-1970 when I set type for booking_date as "type": "strtotime:Ymd" since my date is set as 20180212 even when I import is successful, any ideas on how can dateformat be fixed?
Answers.UserDisplayName: harshal
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-17T10:26:30.393Z
Answers.Text: I have updated my answer with a working example of a configuration.
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-17T17:20:00.090Z
Answers.Text: Bij is received. Af is payed.
Answers.UserDisplayName: harshal
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-17T17:21:49.070Z
Answers.Text: How did you come to know about adding _constant:EUR in from,what was reference point while implementing it,I did see it in examples but nothing apart from it.let me know,thanks. Also thanks a lot, your solution worked very well @Jaap Jansma
Answers.UserDisplayName: harshal
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-21T12:26:04.273Z
Answers.Text: I have done two implementations with CiviBanking and I have looked a few things up in the code.
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-21T18:40:50.247Z
Answers.Text: Hi @Japp Jansma , I need an example of how to add Matcher Plugin, is this somewhat which you can help on?
Answers.UserDisplayName: harshal
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-23T12:59:07.320Z
Answers.Text: I have answerred your question
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-15T21:28:46.897Z
Answers.LastActivityDate: 2018-02-17T10:26:11.823Z
Answers.LastEditDate: 2018-02-17T10:26:11.823Z
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Body: <p>I am using civicrm extension 
  CiviBanking
  <a href="https://github.com/Project60/org.project60.banking/blob/master/doc/civibanking-getting-started.md" rel="nofollow noreferrer">https://github.com/Project60/org.project60.banking/blob/master/doc/civibanking-getting-started.md</a>
  I created a record in the table civicrm_bank_plugin_instance, with config data
  in JSON format where my booking_date is configured as given below
  While trying to use the CSV Importer plugin in CiviBanking <a href="https://www.example.com/civicrm/banking/import" rel="nofollow noreferrer">https://www.example.com/civicrm/banking/import</a></p>
  
  <pre><code>{
    "namespaces": {
      "camt": "urn:iso:std:iso:20022:tech:xsd:camt.053.001.02"
    },
    "probe": "camt:BkToCstmrStmt/camt:GrpHdr/camt:MsgId",
    "rules": [
      {
        "comment": "statement name is MsgId/LglSeqNb",
        "from": "xpath:camt:BkToCstmrStmt/camt:GrpHdr/camt:MsgId",
        "to": "tx_batch.reference",
        "type": "set"
      },
      {
        "comment": "statement name is MsgId/LglSeqNb",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:LglSeqNb",
        "to": "tx_batch.reference",
        "type": "append:/"
      },
      {
        "comment": "statement sequence number",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:LglSeqNb",
        "to": "tx_batch.sequence",
        "type": "set"
      },
      {
        "comment": "IBAN preset for payments",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:Acct/camt:Id/camt:IBAN",
        "to": "tx._IBAN",
        "type": "set"
      },
      {
        "comment": "BIC preset for payments",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:Acct/camt:Svcr/camt:FinInstnId/camt:BIC",
        "to": "tx._BIC",
        "type": "set"
      },
      {
        "comment": "starting time",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:FrToDt/camt:FrDtTm",
        "to": "tx_batch.starting_date",
        "type": "strtotime"
      },
      {
        "comment": "ending time",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:FrToDt/camt:ToDtTm",
        "to": "tx_batch.ending_date",
        "type": "strtotime"
      },
      {
        "comment": "statement currency",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:Bal[1]/camt:Amt/@Ccy",
        "to": "tx_batch.currency",
        "type": "set"
      },
      {
        "comment": "statement starting balance. FIXME: include condition instead of position",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:Bal[2]/camt:Amt",
        "to": "tx_batch.starting_balance",
        "type": "amount"
      },
      {
        "comment": "statement starting balance. FIXME: include condition instead of position",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:Bal[1]/camt:Amt",
        "to": "tx_batch.ending_balance",
        "type": "amount"
      }
    ],
    "payments": {
      "path": "camt:BkToCstmrStmt/camt:Stmt/camt:Ntry",
      "rules": [
        {
          "comment": "booking date",
          "from": "xpath:camt:BookgDt/camt:Dt",
          "to": "booking_date",
          "type": "strtotime"
        },
        {
          "comment": "value date",
          "from": "xpath:camt:ValDt/camt:Dt",
          "to": "value_date",
          "type": "strtotime"
        },
        {
          "comment": "Amount",
          "from": "xpath:camt:Amt",
          "to": "amount",
          "type": "amount"
        },
        {
          "comment": "Currency",
          "from": "xpath:camt:Amt/@Ccy",
          "to": "currency",
          "type": "set"
        },
        {
          "comment": "party IBAN",
          "from": "xpath:camt:NtryDtls/camt:TxDtls/camt:RltdPties/camt:DbtrAcct/camt:Id/camt:IBAN",
          "to": "_party_IBAN",
          "type": "set"
        },
        {
          "comment": "party BIC",
          "from": "xpath:camt:NtryDtls/camt:TxDtls/camt:RltdAgts/camt:DbtrAgt/camt:FinInstnId/camt:BIC",
          "to": "_party_BIC",
          "type": "set"
        },
        {
          "comment": "transaction message",
          "from": "xpath:camt:NtryDtls/camt:TxDtls/camt:AddtlTxInf",
          "to": "purpose",
          "type": "set"
        },
        {
          "comment": "party name",
          "from": "xpath:camt:NtryDtls/camt:TxDtls/camt:RltdPties/camt:Dbtr/camt:Nm",
          "to": "name",
          "type": "set"
        },
        {
          "comment": "party address",
          "from": "xpath:camt:NtryDtls/camt:TxDtls/camt:RltdPties/camt:Dbtr/camt:PstlAdr/camt:StrtNm",
          "to": "street_address",
          "type": "set"
        },
        {
          "comment": "party address",
          "from": "xpath:camt:NtryDtls/camt:TxDtls/camt:RltdPties/camt:Dbtr/camt:PstlAdr/camt:TwnNm",
          "to": "city",
          "type": "set"
        },
        {
          "comment": "party address",
          "from": "xpath:camt:NtryDtls/camt:TxDtls/camt:RltdPties/camt:Dbtr/camt:PstlAdr/camt:Ctry",
          "to": "country",
          "type": "set"
        }
      ]
    }
  }
  </code></pre>
  
  <p>and my CSV has data as given below</p>
  
  <pre><code>"Datum","Naam / Omschrijving","Rekening","Tegenrekening","Code","Af Bij","Bedrag (EUR)","MutatieSoort","Mededelingen"
  "20180212","STICHTING GYM-SUPPORT","NL21INGB111111111","NL76RAB11111111","OV","Bij","100,00","Overschrijving","Naam: STICHTING GYM-SUPPORT Omschrijving: Bestelling Lyme magazine IBAN: NL76RAB11111111"
  </code></pre>
  
  <p>I tried changing type for booking date from "type": "strtotime" to "type": "strtotime:Ymd" but it still gives error.
  How can I fix it?
  My civicrm version is 4.6.22</p>
  
  <p><a href="https://i.sstatic.net/X6hcB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/X6hcB.png" alt="enter image description here"></a></p>
  
Tags: <civibanking>
Title: CiviBanking : No valid booking date detected. Not imported!
ThreadText: # CiviBanking : No valid booking date detected. Not imported!
  
  (Asked by: username_0 on 2018-02-15)
  
  I am using civicrm extension 
  CiviBanking
  https://github.com/Project60/org.project60.banking/blob/master/doc/civibanking-getting-started.md
  I created a record in the table civicrm_bank_plugin_instance, with config data
  in JSON format where my booking_date is configured as given below
  While trying to use the CSV Importer plugin in CiviBanking https://www.example.com/civicrm/banking/import
  {
    "namespaces": {
      "camt": "urn:iso:std:iso:20022:tech:xsd:camt.053.001.02"
    },
    "probe": "camt:BkToCstmrStmt/camt:GrpHdr/camt:MsgId",
    "rules": [
      {
        "comment": "statement name is MsgId/LglSeqNb",
        "from": "xpath:camt:BkToCstmrStmt/camt:GrpHdr/camt:MsgId",
        "to": "tx_batch.reference",
        "type": "set"
      },
      {
        "comment": "statement name is MsgId/LglSeqNb",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:LglSeqNb",
        "to": "tx_batch.reference",
        "type": "append:/"
      },
      {
        "comment": "statement sequence number",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:LglSeqNb",
        "to": "tx_batch.sequence",
        "type": "set"
      },
      {
        "comment": "IBAN preset for payments",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:Acct/camt:Id/camt:IBAN",
        "to": "tx._IBAN",
        "type": "set"
      },
      {
        "comment": "BIC preset for payments",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:Acct/camt:Svcr/camt:FinInstnId/camt:BIC",
        "to": "tx._BIC",
        "type": "set"
      },
      {
        "comment": "starting time",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:FrToDt/camt:FrDtTm",
        "to": "tx_batch.starting_date",
        "type": "strtotime"
      },
      {
        "comment": "ending time",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:FrToDt/camt:ToDtTm",
        "to": "tx_batch.ending_date",
        "type": "strtotime"
      },
      {
        "comment": "statement currency",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:Bal[1]/camt:Amt/@Ccy",
        "to": "tx_batch.currency",
        "type": "set"
      },
      {
        "comment": "statement starting balance. FIXME: include condition instead of position",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:Bal[2]/camt:Amt",
        "to": "tx_batch.starting_balance",
        "type": "amount"
      },
      {
        "comment": "statement starting balance. FIXME: include condition instead of position",
        "from": "xpath:camt:BkToCstmrStmt/camt:Stmt/camt:Bal[1]/camt:Amt",
        "to": "tx_batch.ending_balance",
        "type": "amount"
      }
    ],
    "payments": {
      "path": "camt:BkToCstmrStmt/camt:Stmt/camt:Ntry",
      "rules": [
        {
          "comment": "booking date",
          "from": "xpath:camt:BookgDt/camt:Dt",
          "to": "booking_date",
          "type": "strtotime"
        },
        {
          "comment": "value date",
          "from": "xpath:camt:ValDt/camt:Dt",
          "to": "value_date",
          "type": "strtotime"
        },
        {
          "comment": "Amount",
          "from": "xpath:camt:Amt",
          "to": "amount",
          "type": "amount"
        },
        {
          "comment": "Currency",
          "from": "xpath:camt:Amt/@Ccy",
          "to": "currency",
          "type": "set"
        },
        {
          "comment": "party IBAN",
          "from": "xpath:camt:NtryDtls/camt:TxDtls/camt:RltdPties/camt:DbtrAcct/camt:Id/camt:IBAN",
          "to": "_party_IBAN",
          "type": "set"
        },
        {
          "comment": "party BIC",
          "from": "xpath:camt:NtryDtls/camt:TxDtls/camt:RltdAgts/camt:DbtrAgt/camt:FinInstnId/camt:BIC",
          "to": "_party_BIC",
          "type": "set"
        },
        {
          "comment": "transaction message",
          "from": "xpath:camt:NtryDtls/camt:TxDtls/camt:AddtlTxInf",
          "to": "purpose",
          "type": "set"
        },
        {
          "comment": "party name",
          "from": "xpath:camt:NtryDtls/camt:TxDtls/camt:RltdPties/camt:Dbtr/camt:Nm",
          "to": "name",
          "type": "set"
        },
        {
          "comment": "party address",
          "from": "xpath:camt:NtryDtls/camt:TxDtls/camt:RltdPties/camt:Dbtr/camt:PstlAdr/camt:StrtNm",
          "to": "street_address",
          "type": "set"
        },
        {
          "comment": "party address",
          "from": "xpath:camt:NtryDtls/camt:TxDtls/camt:RltdPties/camt:Dbtr/camt:PstlAdr/camt:TwnNm",
          "to": "city",
          "type": "set"
        },
        {
          "comment": "party address",
          "from": "xpath:camt:NtryDtls/camt:TxDtls/camt:RltdPties/camt:Dbtr/camt:PstlAdr/camt:Ctry",
          "to": "country",
          "type": "set"
        }
      ]
    }
  }
  
  and my CSV has data as given below
  "Datum","Naam / Omschrijving","Rekening","Tegenrekening","Code","Af Bij","Bedrag (EUR)","MutatieSoort","Mededelingen"
  "20180212","STICHTING GYM-SUPPORT","NL21INGB111111111","NL76RAB11111111","OV","Bij","100,00","Overschrijving","Naam: STICHTING GYM-SUPPORT Omschrijving: Bestelling Lyme magazine IBAN: NL76RAB11111111"
  
  I tried changing type for booking date from "type": "strtotime" to "type": "strtotime:Ymd" but it still gives error.
  How can I fix it?
  My civicrm version is 4.6.22
  
  **Tags:** civibanking
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-02-15. Score: 2
  
  Your configuration seems not to be correct. And to me it looks like you have set up a configuration for an XML (CAMT0.53) file and your example looks like a CVS file. 
  You can use one of the examples from the CSV directory as an example and the tweak it to your needs: https://github.com/Project60/org.project60.banking/tree/master/configuration_database/importer/csv
  Below a configuration which works with the example csv file you provided in the question:
  {
    "delimiter": ",",
    "encoding": "UTF8",
    "header": 1,
    "defaults": {},
    "rules": [
      {
        "from": "Datum",
        "to": "booking_date",
        "type": "strtotime:Ymd"
      },
      {
        "from": "Datum",
        "to": "value_date",
        "type": "strtotime:Ymd"
      },
      {
        "from": "Naam / Omschrijving",
        "to": "name",
        "type": "set"
      },
      {
        "from": "Bedrag (EUR)",
        "to": "amount",
        "type": "amount"
      },
      {
        "from": "_constant:EUR",
        "to": "currency",
        "type": "set"
      },
      {
        "from": "Mededelingen",
        "to": "purpose",
        "type": "set"
      },
      {
        "from": "Tegenrekening",
        "to": "_party_ba_id",
        "type": "set"
      },
      {
        "from": "Rekening",
        "to": "_bank_id",
        "type": "set"
      }
    ]
  }
  
  A few remarks: 
  I dont know what would happen if a write-off is present in the file. Is that indicated by a negative amount? Or is the column Bij Af / set to Af.
  The name in the from part of a rule is the name of the column in the csv file. However there is also a from which sets a constant value to EUR. 
  The name in to part is the name of the field in the CiviBanking transaction. You could define new fields here as you can use existing ones (like booking_date, value_date, amount and purpose). The new ones can be used in the configuration of the matchers. However I have not defined any new fields here.
  
  > **Comments:**
  > **username_0**: Your configuration seems not to be correct. And to me it looks like you have set up a configuration for an XML (CAMT0.53) file and your example looks like a CVS file.  Did you mean CVS or CSV as mentioned above?  
  > **username_0**: Also, I tried to import CSV files from the example, but every time I do that my booking_date value is shown as 01-01-1970 when I set type for booking_date as "type": "strtotime:Ymd" since my date is set as 20180212 even when I import is successful, any ideas on how can dateformat be fixed?  
  > **username_1**: I have updated my answer with a working example of a configuration.  
  > **username_0**: Bij is received. Af is payed.  
  > **username_0**: How did you come to know about adding _constant:EUR in from,what was reference point while implementing it,I did see it in examples but nothing apart from it.let me know,thanks. Also thanks a lot, your solution worked very well @Jaap Jansma  
  > **username_1**: I have done two implementations with CiviBanking and I have looked a few things up in the code.  
  > **username_0**: Hi @Japp Jansma , I need an example of how to add Matcher Plugin, is this somewhat which you can help on?  
  > **username_1**: I have answerred your question  
  
  ---
  
  