Payments - better recognition of dates
authorDamien Bobillot <damien.bobillot+gitxorg@m4x.org>
Wed, 25 May 2011 12:05:55 +0000 (14:05 +0200)
committerDamien Bobillot <damien.bobillot+gitxorg@m4x.org>
Wed, 25 May 2011 12:05:55 +0000 (14:05 +0200)
modules/payment.php

index 0fc1436..e7c588f 100644 (file)
@@ -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;