From 54c224f646a5034807500df17f7fd9f607749e69 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 22 Dec 2016 17:57:06 +0200 Subject: [PATCH] Don't strtolower invoice number when importing --- app/Ninja/Import/BaseTransformer.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Ninja/Import/BaseTransformer.php b/app/Ninja/Import/BaseTransformer.php index 9c0c53ace1..2f0131c9df 100644 --- a/app/Ninja/Import/BaseTransformer.php +++ b/app/Ninja/Import/BaseTransformer.php @@ -143,8 +143,7 @@ class BaseTransformer extends TransformerAbstract */ protected function getInvoiceNumber($number) { - $number = strtolower($number); - return str_pad($number, 4, '0', STR_PAD_LEFT); + return str_pad(trim($number), 4, '0', STR_PAD_LEFT); } /** @@ -154,6 +153,7 @@ class BaseTransformer extends TransformerAbstract protected function getInvoiceId($invoiceNumber) { $invoiceNumber = $this->getInvoiceNumber($invoiceNumber); + $invoiceNumber = strtolower($invoiceNumber); return isset($this->maps[ENTITY_INVOICE][$invoiceNumber]) ? $this->maps[ENTITY_INVOICE][$invoiceNumber] : null; } @@ -164,6 +164,7 @@ class BaseTransformer extends TransformerAbstract protected function hasInvoice($invoiceNumber) { $invoiceNumber = $this->getInvoiceNumber($invoiceNumber); + $invoiceNumber = strtolower($invoiceNumber); return isset($this->maps[ENTITY_INVOICE][$invoiceNumber]); } @@ -174,6 +175,7 @@ class BaseTransformer extends TransformerAbstract protected function getInvoiceClientId($invoiceNumber) { $invoiceNumber = $this->getInvoiceNumber($invoiceNumber); + $invoiceNumber = strtolower($invoiceNumber); return isset($this->maps[ENTITY_INVOICE.'_'.ENTITY_CLIENT][$invoiceNumber])? $this->maps[ENTITY_INVOICE.'_'.ENTITY_CLIENT][$invoiceNumber] : null; }