Replace spaces with underscores in CSV column names
Update CSV export column headers to use underscores instead of spaces for better compatibility with data processing tools: - Vendor Product number → Vendor_product_number - Vendor code → Vendor_code - Vendor name → Vendor_name - Dealer product number → Dealer_product_number - Zip code → Zip_code 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -75,18 +75,18 @@ class ReportGenerator
|
|||||||
$sql = "
|
$sql = "
|
||||||
SELECT
|
SELECT
|
||||||
DATE_FORMAT(o.created_at, '%m/%d/%Y') AS 'Date',
|
DATE_FORMAT(o.created_at, '%m/%d/%Y') AS 'Date',
|
||||||
oi.sku AS 'Vendor Product number',
|
oi.sku AS 'Vendor_product_number',
|
||||||
oi.name AS 'Description',
|
oi.name AS 'Description',
|
||||||
'' AS 'Vendor code',
|
'' AS 'Vendor_code',
|
||||||
'' AS 'Vendor name',
|
'' AS 'Vendor_name',
|
||||||
o.increment_id AS 'Dealer product number',
|
o.increment_id AS 'Dealer_product_number',
|
||||||
CASE
|
CASE
|
||||||
WHEN sa.country_id = 'US' THEN 'United States'
|
WHEN sa.country_id = 'US' THEN 'United States'
|
||||||
ELSE sa.country_id
|
ELSE sa.country_id
|
||||||
END AS 'Country',
|
END AS 'Country',
|
||||||
sa.city AS 'City',
|
sa.city AS 'City',
|
||||||
sa.region AS 'State',
|
sa.region AS 'State',
|
||||||
sa.postcode AS 'Zip code',
|
sa.postcode AS 'Zip_code',
|
||||||
CAST(oi.qty_ordered AS UNSIGNED) AS 'Quantity',
|
CAST(oi.qty_ordered AS UNSIGNED) AS 'Quantity',
|
||||||
COALESCE(
|
COALESCE(
|
||||||
NULLIF(oi.base_cost, 0),
|
NULLIF(oi.base_cost, 0),
|
||||||
|
|||||||
Reference in New Issue
Block a user