From: pavlikov_maxim Date: Fri, 19 Apr 2024 13:15:38 +0000 (+0300) Subject: фикс модуля write-offs X-Git-Tag: 1.1~124^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=6a63cc4f907dd36d6fd9c36b50a9bfc3e5411299;p=erp24_rep%2Fyii-erp24%2F.git фикс модуля write-offs --- diff --git a/erp24/views/write-offs/index.php b/erp24/views/write-offs/index.php index b5b143d8..d24f931a 100644 --- a/erp24/views/write-offs/index.php +++ b/erp24/views/write-offs/index.php @@ -103,13 +103,13 @@ $summ_retail = 0; $sql = "SELECT *,TO_CHAR(date, 'DD.MM.YYYY HH:MI') as date2 FROM write_offs WHERE 1=1 $where order by date DESC LIMIT $limit OFFSET $offset"; $data = $db::run($sql); $data = $data ? $data->fetchAll() : false; +$summ = 0; foreach (is_array($data) ? $data : [] as $row) { $items = json_decode($row["items"], true, 512, JSON_UNESCAPED_UNICODE); echo ' ' . $row["summ"] . '' . $row["summ_retail"] . '' . $row["write_downs"] . ''; - $summ_retail += $row["summ_retail"]; - $summ += $row["summ"]; + $summ += $row["summ"] ?? 0; if (empty($store_id)) echo '' . $stores[$row["store_id"]] . ' ';