]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-360 Сборка страницы автопм
authormarina <m.zozirova@gmail.com>
Tue, 17 Jun 2025 10:11:26 +0000 (13:11 +0300)
committermarina <m.zozirova@gmail.com>
Tue, 17 Jun 2025 10:11:26 +0000 (13:11 +0300)
erp24/controllers/AutoPlannogrammaController.php
erp24/web/js/autoplannogramma/autoplannogramma.js

index 51c36b5a790197b58f121fe6f3e590c8ebd87111..d4e93d80cad5770c2f6837d772c772cddcbad5f6 100644 (file)
@@ -220,12 +220,10 @@ class AutoPlannogrammaController extends BaseController
                     $channelData = $forecast[$storeId][$channel] ?? [];
                     $titleData = [];
 
-                    // Always use share-based value if it exists
                     if (isset($channelData['share']) && is_numeric($channelData['share'])) {
                         $titleData[0] = round($quantity * $channelData['share'], 2);
                     }
 
-                    // Add product-specific details if available
                     if (isset($productData['product_id']) && isset($forecast[$storeId][$productData['product_id']][$channel])) {
                         $details = $forecast[$storeId][$productData['product_id']][$channel];
                         $titleData[0] = $titleData[0] ?? round($quantity * array_sum($details), 2);
index 9cfff0f67bdf2df25742fb97deb10b839e7f077f..ecfc2003c005cd7d1037978c5b02e38af6470183 100644 (file)
@@ -386,16 +386,15 @@ const generateTitleString = (titleObj) => {
     if (!titleObj || typeof titleObj !== 'object') return '';
 
     const typeTitles = {
-        offline: '📦 Оффлайн',
-        online: '🌐 Онлайн',
-        marketplace: '🛒 Маркетплейс'
+        offline: 'Оффлайн',
+        online: 'Онлайн',
+        marketplace: 'Маркетплейс'
     };
 
     const parts = Object.entries(titleObj)
         .map(([typeKey, typeValue]) => {
             const title = typeTitles[typeKey] || typeKey;
 
-            // Handle case where typeValue is an array [numeric_value, {details: {...}}]
             if (Array.isArray(typeValue) && typeValue.length >= 1) {
                 const numericValue = parseFloat(typeValue[0]);
                 const details = typeValue[1]?.details || {};
@@ -404,12 +403,11 @@ const generateTitleString = (titleObj) => {
                 return `${title}: ${numericValue.toFixed(2)}${lines.length ? '\n' + lines.join('\n') : ''}`;
             }
 
-            // Handle case where typeValue is a number (for share-only, if applicable)
             if (typeof typeValue === 'number') {
                 return `${title}: ${typeValue.toFixed(2)}`;
             }
 
-            return ''; // Skip invalid or empty values
+            return '';
         })
         .filter(Boolean);