From: Damien Bobillot Date: Wed, 25 May 2011 12:05:55 +0000 (+0200) Subject: Payments - better recognition of dates X-Git-Tag: xorg/1.1.2~76 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=1fe903b101a7e4c31450cb019b3a803f1d43b298;p=platal.git Payments - better recognition of dates --- 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;