bug fix for old docs

This commit is contained in:
Hesabix 2024-05-22 17:16:20 +00:00
parent 74dd972f3d
commit 151f6f2c17

View file

@ -44,7 +44,7 @@ class Explore
$person = self::ExplorePerson($item->getPerson()); $person = self::ExplorePerson($item->getPerson());
} }
} }
$result['person'] = $person; $result['person'] = $person;
return $result; return $result;
} }
@ -124,7 +124,7 @@ class Explore
} }
public static function ExploreHesabdariRow(HesabdariRow $row) public static function ExploreHesabdariRow(HesabdariRow $row)
{ {
return [ $temp = [
'id' => $row->getId(), 'id' => $row->getId(),
'bid' => self::ExploreBid($row->getBid()), 'bid' => self::ExploreBid($row->getBid()),
'year' => self::ExploreYear($row->getYear()), 'year' => self::ExploreYear($row->getYear()),
@ -139,9 +139,14 @@ class Explore
'plugin' => $row->getPlugin(), 'plugin' => $row->getPlugin(),
'commodity_count' => $row->getCommdityCount(), 'commodity_count' => $row->getCommdityCount(),
'commodity' => self::ExploreCommodity($row->getCommodity(), $row->getCommdityCount(), $row->getDes()), '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 = '') public static function ExploreCommodity(Commodity | null $item, int | null $count = 0, string $des = '')
@ -289,8 +294,8 @@ class Explore
'start' => $year->getStart(), 'start' => $year->getStart(),
'end' => $year->getEnd(), 'end' => $year->getEnd(),
'now' => time(), 'now' => time(),
'startShamsi'=> $jdate->jdate('Y-n-d',$year->getStart()), 'startShamsi' => $jdate->jdate('Y-n-d', $year->getStart()),
'endShamsi'=> $jdate->jdate('Y-n-d',$year->getEnd()), 'endShamsi' => $jdate->jdate('Y-n-d', $year->getEnd()),
]; ];
} }