From 4fccf7809d3b471c48c9e16b1f4d5afe9ac33a70 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Thu, 28 May 2020 00:41:01 +0800 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=20Item=20(=D1=83=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=B4=D0=BB=D0=B8=D0=BD=D1=8B=20=D0=B5=D0=B4.=20=D0=B8=D0=B7?= =?UTF-8?q?=D0=BC.)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AtolOnline/Entities/Item.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/AtolOnline/Entities/Item.php b/src/AtolOnline/Entities/Item.php index 4d7c026..f421336 100644 --- a/src/AtolOnline/Entities/Item.php +++ b/src/AtolOnline/Entities/Item.php @@ -100,17 +100,17 @@ class Item extends Entity if ($price) { $this->setPrice($price); } - if ($payment_object) { - $this->setPaymentObject($payment_object); - } if ($quantity) { $this->setQuantity($quantity); } + if ($measurement_unit) { + $this->setMeasurementUnit($measurement_unit); + } if ($vat_type) { $this->setVatType($vat_type); } - if ($measurement_unit) { - $this->setMeasurementUnit($measurement_unit); + if ($payment_object) { + $this->setPaymentObject($payment_object); } if ($payment_method) { $this->setPaymentMethod($payment_method); @@ -225,7 +225,7 @@ class Item extends Entity public function setMeasurementUnit(string $measurement_unit) { $measurement_unit = trim($measurement_unit); - if (strlen($measurement_unit) > 16) { + if ((function_exists('mb_strlen') ? mb_strlen($measurement_unit) : strlen($measurement_unit)) > 16) { throw new AtolUnitTooLongException($measurement_unit, 16); } $this->measurement_unit = $measurement_unit;