From 6a63cc4f907dd36d6fd9c36b50a9bfc3e5411299 Mon Sep 17 00:00:00 2001 From: pavlikov_maxim Date: Fri, 19 Apr 2024 16:15:38 +0300 Subject: [PATCH] =?utf8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D0=BC=D0=BE=D0=B4?= =?utf8?q?=D1=83=D0=BB=D1=8F=20write-offs?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/views/write-offs/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"]] . ' '; -- 2.39.5