From 151f6f2c17ec2098a30a28aeadff06b46f7813ab Mon Sep 17 00:00:00 2001 From: babak alizadeh Date: Wed, 22 May 2024 17:16:20 +0000 Subject: [PATCH] bug fix for old docs --- hesabixCore/src/Service/Explore.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/hesabixCore/src/Service/Explore.php b/hesabixCore/src/Service/Explore.php index 60e0641..8682efe 100644 --- a/hesabixCore/src/Service/Explore.php +++ b/hesabixCore/src/Service/Explore.php @@ -44,7 +44,7 @@ class Explore $person = self::ExplorePerson($item->getPerson()); } } - $result['person'] = $person; + $result['person'] = $person; return $result; } @@ -124,7 +124,7 @@ class Explore } public static function ExploreHesabdariRow(HesabdariRow $row) { - return [ + $temp = [ 'id' => $row->getId(), 'bid' => self::ExploreBid($row->getBid()), 'year' => self::ExploreYear($row->getYear()), @@ -139,9 +139,14 @@ class Explore 'plugin' => $row->getPlugin(), 'commodity_count' => $row->getCommdityCount(), 'commodity' => self::ExploreCommodity($row->getCommodity(), $row->getCommdityCount(), $row->getDes()), - 'tax' =>$row->getTax(), - 'discount' =>$row->getDiscount(), ]; + if (!$row->getTax()) + $row->setTax(0); + if (!$row->getDiscount()) + $row->setDiscount(0); + $temp['tax'] = $row->getTax(); + $temp['discount'] = $row->getDiscount(); + return $temp; } public static function ExploreCommodity(Commodity | null $item, int | null $count = 0, string $des = '') @@ -289,8 +294,8 @@ class Explore 'start' => $year->getStart(), 'end' => $year->getEnd(), 'now' => time(), - 'startShamsi'=> $jdate->jdate('Y-n-d',$year->getStart()), - 'endShamsi'=> $jdate->jdate('Y-n-d',$year->getEnd()), + 'startShamsi' => $jdate->jdate('Y-n-d', $year->getStart()), + 'endShamsi' => $jdate->jdate('Y-n-d', $year->getEnd()), ]; }