Skip to content
Snippets Groups Projects
Commit fea194a0 authored by simon's avatar simon
Browse files

tmp: reimport CAMT53

No related merge requests found
......@@ -159,14 +159,14 @@ class CAMT053 extends BankingImportFormatDefinitionBase {
foreach ($statement->getEntries() as $batch_entry) {
if (in_array($batch_entry->getBookingDate()->format('Y-m-d'), $dates)) {
drupal_set_message(
t("Not importing entry for day @day and account @account: there are already transactions for this day!",
[
'@day' => $batch_entry->getBookingDate()->format('Y-m-d'),
'@account' => $statement->getAccount()->getIban(),
]),
'warning');
continue;
// drupal_set_message(
// t("Not importing entry for day @day and account @account: there are already transactions for this day!",
// [
// '@day' => $batch_entry->getBookingDate()->format('Y-m-d'),
// '@account' => $statement->getAccount()->getIban(),
// ]),
// 'warning');
// continue;
}
foreach ($batch_entry->getTransactionDetails() as $entry) {
......@@ -239,6 +239,14 @@ class CAMT053 extends BankingImportFormatDefinitionBase {
}
}
$query = \Drupal::entityQuery('bank_transaction')->condition('date', $transaction_data['date'])->condition('amount', $transaction_data['amount']);
if ($transaction_data['account_holder_name']) {
$query = $query->condition('account_holder_name', $transaction_data['account_holder_name']);
}
if (count($query->execute())) {
continue;
}
\Drupal::service('banking_import.default')->createImportedTransaction($transaction_data);
$n++;
}
......
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