Downloads
have gotten down to work on some importing and exporting of product data. here' my SQL for exporting product information to a table that is quite useable under Openbravo POS.
hope this helps someone, somewhere
remember to salt and pepper to taste!
SELECT DISTINCT
UUID() AS "ID",
n.nid AS "REFERENCE",
ucp.model AS "CODE",
"" AS "CODETYPE",
n.title AS "NAME",
ucp.cost AS "PRICEBUY",
ucp.sell_price AS "PRICESELL",
td.name, "000" AS "TAXCAT",
"0f9681b4-8134-4fa4-8ca7-b226eeba7397" AS "ATTRIBUTESET_ID",
null AS "STOCKCOST",
null AS "STOCKVOLUME",
null AS "IMAGE",
"" AS ISCOM,
"" AS ISSCALE,
null AS "ATTRIBUTES"
FROM `node` as n
JOIN uc_products AS ucp
ON ucp.nid = n.nid
JOIN term_node AS term
ON term.nid = n.nid
JOIN term_data AS td
ON term.tid = td.tid
JOIN term_hierarchy AS th
on th.tid = term.tid
WHERE n.type = "product"
AND td.vid = "1"
GROUP BY n.nid