-- ====================================================================
-- 09_articole_terti_050.sql
-- Mapări ARTICOLE_TERTI cu cantitate_roa = 0.5 pentru articole
-- unde unitatea web (50 buc/set) ≠ unitatea ROA (100 buc/set).
--
-- Efect: price sync va calcula pret_crm = pret_web / 0.5,
--   iar kit pricing va folosi prețul corect per set ROA.
--
-- 25.03.2026 - creat pentru fix discount negativ kit pahare
-- ====================================================================

-- Pahar 6oz Coffee Coffee SIBA 50buc (GoMag) → 100buc/set (ROA)
INSERT INTO articole_terti (sku, codmat, cantitate_roa, activ, sters, data_creare, id_util_creare)
SELECT '1708828', '1708828', 0.5, 1, 0, SYSDATE, -3 FROM dual
WHERE NOT EXISTS (
  SELECT 1 FROM articole_terti WHERE sku = '1708828' AND codmat = '1708828' AND sters = 0
);

-- Pahar 8oz Coffee Coffee SIBA 50buc → 100buc/set
INSERT INTO articole_terti (sku, codmat, cantitate_roa, activ, sters, data_creare, id_util_creare)
SELECT '528795', '528795', 0.5, 1, 0, SYSDATE, -3 FROM dual
WHERE NOT EXISTS (
  SELECT 1 FROM articole_terti WHERE sku = '528795' AND codmat = '528795' AND sters = 0
);

-- Pahar 8oz Tchibo 50buc → 100buc/set
INSERT INTO articole_terti (sku, codmat, cantitate_roa, activ, sters, data_creare, id_util_creare)
SELECT '58', '58', 0.5, 1, 0, SYSDATE, -3 FROM dual
WHERE NOT EXISTS (
  SELECT 1 FROM articole_terti WHERE sku = '58' AND codmat = '58' AND sters = 0
);

-- Pahar 7oz Lavazza SIBA 50buc → 100buc/set
INSERT INTO articole_terti (sku, codmat, cantitate_roa, activ, sters, data_creare, id_util_creare)
SELECT '51', '51', 0.5, 1, 0, SYSDATE, -3 FROM dual
WHERE NOT EXISTS (
  SELECT 1 FROM articole_terti WHERE sku = '51' AND codmat = '51' AND sters = 0
);

-- Pahar 8oz Albastru JND 50buc → 100buc/set
INSERT INTO articole_terti (sku, codmat, cantitate_roa, activ, sters, data_creare, id_util_creare)
SELECT '105712338826', '105712338826', 0.5, 1, 0, SYSDATE, -3 FROM dual
WHERE NOT EXISTS (
  SELECT 1 FROM articole_terti WHERE sku = '105712338826' AND codmat = '105712338826' AND sters = 0
);

-- Pahar 8oz Paris JND 50buc → 100buc/set
INSERT INTO articole_terti (sku, codmat, cantitate_roa, activ, sters, data_creare, id_util_creare)
SELECT '10573080', '10573080', 0.5, 1, 0, SYSDATE, -3 FROM dual
WHERE NOT EXISTS (
  SELECT 1 FROM articole_terti WHERE sku = '10573080' AND codmat = '10573080' AND sters = 0
);

COMMIT;
