--
-- Script run when an upgrade of Dolibarr is done. Whatever is the Dolibarr version.
--

-- Add copper surcharge fields to import_line table (v2.8)
ALTER TABLE llx_importzugferd_import_line ADD COLUMN copper_surcharge double(24,8) DEFAULT NULL AFTER ean;
ALTER TABLE llx_importzugferd_import_line ADD COLUMN copper_surcharge_basis_qty double(24,8) DEFAULT NULL AFTER copper_surcharge;

-- Add fk_datanorm field to import_line table (v2.9)
ALTER TABLE llx_importzugferd_import_line ADD COLUMN fk_datanorm integer DEFAULT NULL AFTER fk_product;

-- Add missing datanorm fields (v3.0)
ALTER TABLE llx_importzugferd_datanorm ADD COLUMN price_unit_code tinyint DEFAULT 0 AFTER price_unit;
ALTER TABLE llx_importzugferd_datanorm ADD COLUMN price_type tinyint DEFAULT 1 AFTER price_unit_code;
ALTER TABLE llx_importzugferd_datanorm ADD COLUMN metal_surcharge double(24,8) DEFAULT 0 AFTER price_type;
ALTER TABLE llx_importzugferd_datanorm ADD COLUMN vpe integer DEFAULT NULL AFTER metal_surcharge;
ALTER TABLE llx_importzugferd_datanorm ADD COLUMN action_code char(1) DEFAULT 'N' AFTER datanorm_version;

-- Note: kaufmenge extrafield is created programmatically in modImportZugferd.class.php init()
