From: Alexander Smirnov Date: Tue, 14 Jan 2025 18:49:21 +0000 (+0300) Subject: [ERP-280] type filter bug X-Git-Tag: 1.7~82^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=0a02b13ca191e5450fc01cfb34269d1509785741;p=erp24_rep%2Fyii-erp24%2F.git [ERP-280] type filter bug --- diff --git a/erp24/api2/controllers/DataController.php b/erp24/api2/controllers/DataController.php index 4f6c7913..a80a3f31 100644 --- a/erp24/api2/controllers/DataController.php +++ b/erp24/api2/controllers/DataController.php @@ -1390,7 +1390,7 @@ class DataController extends BaseController $writeOffs2->date = $arr["date"]; $writeOffs2->based_on = $arr["based_on"] ?? ""; $typeIndex = strpos($arr["type"], "_"); - $writeOffs2->type = $typeIndex >= 0 ? substr($arr["type"], $typeIndex + 1) : $arr['type']; + $writeOffs2->type = $typeIndex === false ? $arr['type'] : substr($arr["type"], $typeIndex + 1); $writeOffs2->cause = $arr["cause"] ?? ""; $writeOffs2->comment = $arr["comment"] ?? ""; $writeOffs2->items = json_encode($arr["items"], JSON_UNESCAPED_UNICODE);