From 9ea1c81666f21054e7346b8a22bfed191e04403f Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Thu, 28 May 2020 22:55:53 +0800 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BA=D0=BE=D1=80=D1=80=D0=B5=D0=BA?= =?UTF-8?q?=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=20Document::jsonSeri?= =?UTF-8?q?alize()=20-=20=D0=BD=D0=B5=20=D0=B2=D1=8B=D0=B4=D0=B0=D1=91?= =?UTF-8?q?=D1=82=20=D0=BF=D1=83=D1=81=D1=82=D0=BE=D0=B3=D0=BE=20=D0=BA?= =?UTF-8?q?=D0=B0=D1=81=D1=81=D0=B8=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AtolOnline/Entities/Document.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/AtolOnline/Entities/Document.php b/src/AtolOnline/Entities/Document.php index 5e98211..541a550 100644 --- a/src/AtolOnline/Entities/Document.php +++ b/src/AtolOnline/Entities/Document.php @@ -401,11 +401,11 @@ class Document extends Entity */ public function jsonSerialize() { - $json = [ - 'company' => $this->getCompany()->jsonSerialize(), // обязательно - 'payments' => $this->payments->jsonSerialize(), // обязательно - 'cashier' => $this->getCashier() ?? '', - ]; + $json['company'] = $this->getCompany()->jsonSerialize();// обязательно + $json['payments'] = $this->payments->jsonSerialize(); // обязательно + if ($this->getCashier()) { + $json['cashier'] = $this->getCashier(); + } if ($this->getCorrectionInfo()) { $json['correction_info'] = $this->getCorrectionInfo()->jsonSerialize(); // обязательно для коррекционных } else {