From 2f569ae68378f863e8db0857fb024eb6564b3309 Mon Sep 17 00:00:00 2001 From: andrei Date: Mon, 29 Sep 2025 15:01:18 +0000 Subject: [PATCH] Replace open days field with currency symbol --- .gitignore | 3 ++- config.json | 18 +++++++----------- index.js | 16 ++++++---------- update_excel_xlsxwriter.py | 4 ++-- 4 files changed, 17 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index cd5f421..bb03605 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ logs __pycache__/ *.py[cod] *$py.class +venv/ # Output directory -output/ \ No newline at end of file +output/ diff --git a/config.json b/config.json index 8ae0e6b..77e8564 100644 --- a/config.json +++ b/config.json @@ -5,14 +5,14 @@ "company_name": "gfdgdf", "email": "gfdgf", "phone": "gfdgfdg", - "store_name": "gfdgfdgfgd", + "store_name": "test222", "country": "gfdgfd", "starting_date": "2025-09-25", "duration": 36, "store_types": [ "Convenience" ], - "open_days_per_month": 30, + "currency_symbol": "$", "convenience_store_type": { "stores_number": 1233, "monthly_transactions": 32131312, @@ -20,8 +20,7 @@ "screen_count": 2, "screen_percentage": 123123, "has_in_store_radio": true, - "radio_percentage": 321, - "open_days_per_month": 30 + "radio_percentage": 321 }, "minimarket_store_type": { "stores_number": 0, @@ -30,8 +29,7 @@ "screen_count": 0, "screen_percentage": 0, "has_in_store_radio": false, - "radio_percentage": 0, - "open_days_per_month": 30 + "radio_percentage": 0 }, "supermarket_store_type": { "stores_number": 0, @@ -40,8 +38,7 @@ "screen_count": 0, "screen_percentage": 0, "has_in_store_radio": false, - "radio_percentage": 0, - "open_days_per_month": 30 + "radio_percentage": 0 }, "hypermarket_store_type": { "stores_number": 0, @@ -50,8 +47,7 @@ "screen_count": 0, "screen_percentage": 0, "has_in_store_radio": false, - "radio_percentage": 0, - "open_days_per_month": 30 + "radio_percentage": 0 }, "on_site_channels": [ "Website" @@ -75,4 +71,4 @@ "potential_reach_off_site": 0, "unique_impressions_off_site": 0 } -} \ No newline at end of file +} diff --git a/index.js b/index.js index f08c8a2..a3ffa63 100644 --- a/index.js +++ b/index.js @@ -32,7 +32,7 @@ async function updateConfig(formData) { // Store information store_types: getSelectedStoreTypes(formData), - open_days_per_month: parseInt(formData.openDays) || 0, + currency_symbol: formData.currency || "", // Store type specific data convenience_store_type: { @@ -42,8 +42,7 @@ async function updateConfig(formData) { screen_count: isStoreTypeSelected(formData, 'Convenience') ? parseInt(formData.convenience_screen_count) || 0 : 0, screen_percentage: isStoreTypeSelected(formData, 'Convenience') ? parseInt(formData.convenience_screen_percentage) || 0 : 0, has_in_store_radio: isStoreTypeSelected(formData, 'Convenience') ? formData.convenience_radio === "Yes" : false, - radio_percentage: isStoreTypeSelected(formData, 'Convenience') ? parseInt(formData.convenience_radio_percentage) || 0 : 0, - open_days_per_month: parseInt(formData.openDays) || 0 + radio_percentage: isStoreTypeSelected(formData, 'Convenience') ? parseInt(formData.convenience_radio_percentage) || 0 : 0 }, minimarket_store_type: { @@ -53,8 +52,7 @@ async function updateConfig(formData) { screen_count: isStoreTypeSelected(formData, 'Minimarket') ? parseInt(formData.minimarket_screen_count) || 0 : 0, screen_percentage: isStoreTypeSelected(formData, 'Minimarket') ? parseInt(formData.minimarket_screen_percentage) || 0 : 0, has_in_store_radio: isStoreTypeSelected(formData, 'Minimarket') ? formData.minimarket_radio === "Yes" : false, - radio_percentage: isStoreTypeSelected(formData, 'Minimarket') ? parseInt(formData.minimarket_radio_percentage) || 0 : 0, - open_days_per_month: parseInt(formData.openDays) || 0 + radio_percentage: isStoreTypeSelected(formData, 'Minimarket') ? parseInt(formData.minimarket_radio_percentage) || 0 : 0 }, supermarket_store_type: { @@ -64,8 +62,7 @@ async function updateConfig(formData) { screen_count: isStoreTypeSelected(formData, 'Supermarket') ? parseInt(formData.supermarket_screen_count) || 0 : 0, screen_percentage: isStoreTypeSelected(formData, 'Supermarket') ? parseInt(formData.supermarket_screen_percentage) || 0 : 0, has_in_store_radio: isStoreTypeSelected(formData, 'Supermarket') ? formData.supermarket_radio === "Yes" : false, - radio_percentage: isStoreTypeSelected(formData, 'Supermarket') ? parseInt(formData.supermarket_radio_percentage) || 0 : 0, - open_days_per_month: parseInt(formData.openDays) || 0 + radio_percentage: isStoreTypeSelected(formData, 'Supermarket') ? parseInt(formData.supermarket_radio_percentage) || 0 : 0 }, hypermarket_store_type: { @@ -75,8 +72,7 @@ async function updateConfig(formData) { screen_count: isStoreTypeSelected(formData, 'Hypermarket') ? parseInt(formData.hypermarket_screen_count) || 0 : 0, screen_percentage: isStoreTypeSelected(formData, 'Hypermarket') ? parseInt(formData.hypermarket_screen_percentage) || 0 : 0, has_in_store_radio: isStoreTypeSelected(formData, 'Hypermarket') ? formData.hypermarket_radio === "Yes" : false, - radio_percentage: isStoreTypeSelected(formData, 'Hypermarket') ? parseInt(formData.hypermarket_radio_percentage) || 0 : 0, - open_days_per_month: parseInt(formData.openDays) || 0 + radio_percentage: isStoreTypeSelected(formData, 'Hypermarket') ? parseInt(formData.hypermarket_radio_percentage) || 0 : 0 }, // On-site channels @@ -195,4 +191,4 @@ if (typeof module !== 'undefined' && module.exports) { updateConfig, fetchConfig }; -} \ No newline at end of file +} diff --git a/update_excel_xlsxwriter.py b/update_excel_xlsxwriter.py index 19367f9..0c9be8a 100644 --- a/update_excel_xlsxwriter.py +++ b/update_excel_xlsxwriter.py @@ -83,7 +83,7 @@ def update_excel_variables(excel_path): 'B2': user_data.get('store_name', ''), 'B31': user_data.get('starting_date', ''), 'B32': user_data.get('duration', 36), - 'B37': user_data.get('open_days_per_month', 0), + 'B37': user_data.get('currency_symbol', ''), # Convenience store type 'H37': user_data.get('convenience_store_type', {}).get('stores_number', 0), @@ -430,4 +430,4 @@ if __name__ == "__main__": excel_path = sys.argv[1] update_excel_variables(excel_path) else: - print("Please provide the path to the Excel file as an argument") \ No newline at end of file + print("Please provide the path to the Excel file as an argument")