]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-280] type filter bug origin/feature_smirnov_erp-280_type_filter
authorAlexander Smirnov <fredeom@mail.ru>
Tue, 14 Jan 2025 18:49:21 +0000 (21:49 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Tue, 14 Jan 2025 18:49:21 +0000 (21:49 +0300)
erp24/api2/controllers/DataController.php

index 4f6c791348dc282fb519d03a6457d318f02b29d1..a80a3f3183353aaea3c81f038be6566f5e2b74f1 100644 (file)
@@ -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);