1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 05:32:39 +01:00

Don't strtolower invoice number when importing

This commit is contained in:
Hillel Coren 2016-12-22 17:57:06 +02:00
parent ffa7d4e730
commit 54c224f646

View File

@ -143,8 +143,7 @@ class BaseTransformer extends TransformerAbstract
*/ */
protected function getInvoiceNumber($number) protected function getInvoiceNumber($number)
{ {
$number = strtolower($number); return str_pad(trim($number), 4, '0', STR_PAD_LEFT);
return str_pad($number, 4, '0', STR_PAD_LEFT);
} }
/** /**
@ -154,6 +153,7 @@ class BaseTransformer extends TransformerAbstract
protected function getInvoiceId($invoiceNumber) protected function getInvoiceId($invoiceNumber)
{ {
$invoiceNumber = $this->getInvoiceNumber($invoiceNumber); $invoiceNumber = $this->getInvoiceNumber($invoiceNumber);
$invoiceNumber = strtolower($invoiceNumber);
return isset($this->maps[ENTITY_INVOICE][$invoiceNumber]) ? $this->maps[ENTITY_INVOICE][$invoiceNumber] : null; 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) protected function hasInvoice($invoiceNumber)
{ {
$invoiceNumber = $this->getInvoiceNumber($invoiceNumber); $invoiceNumber = $this->getInvoiceNumber($invoiceNumber);
$invoiceNumber = strtolower($invoiceNumber);
return isset($this->maps[ENTITY_INVOICE][$invoiceNumber]); return isset($this->maps[ENTITY_INVOICE][$invoiceNumber]);
} }
@ -174,6 +175,7 @@ class BaseTransformer extends TransformerAbstract
protected function getInvoiceClientId($invoiceNumber) protected function getInvoiceClientId($invoiceNumber)
{ {
$invoiceNumber = $this->getInvoiceNumber($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; return isset($this->maps[ENTITY_INVOICE.'_'.ENTITY_CLIENT][$invoiceNumber])? $this->maps[ENTITY_INVOICE.'_'.ENTITY_CLIENT][$invoiceNumber] : null;
} }