From 1fe903b101a7e4c31450cb019b3a803f1d43b298 Mon Sep 17 00:00:00 2001 From: Damien Bobillot Date: Wed, 25 May 2011 14:05:55 +0200 Subject: [PATCH] Payments - better recognition of dates --- modules/payment.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/payment.php b/modules/payment.php index 0fc1436..e7c588f 100644 --- a/modules/payment.php +++ b/modules/payment.php @@ -928,7 +928,11 @@ class PaymentLogsImporter extends CSVImporter { $this->result = array(); foreach ($this->data as $line) { $a = $this->makeAssoc($line, $insert_relation); + // convert date $a['date'] = preg_replace('/([0-9]{2})\/([0-9]{2})\/([0-9]{4}).*/', '\3-\2-\1', $a['date']); + $a['date'] = preg_replace('/T.*/','', $a['date']); + + // convert money $a['amount'] = str_replace(',', '.', $a['amount']); $a['commission'] = str_replace(',', '.', $a['commission']); $this->result[] = $a; -- 2.1.4