1 Commits
v1.0.1 ... main

Author SHA1 Message Date
shopkeeperdev
b4b0a9c46d 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>
2025-11-10 16:55:56 -05:00

View File

@@ -73,20 +73,20 @@ class ReportGenerator
$statusPlaceholders = implode(',', array_fill(0, count($orderStatuses), '?')); $statusPlaceholders = implode(',', array_fill(0, count($orderStatuses), '?'));
$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),