ALTER TABLE oc_gestion_devis
    ADD devis_number INT DEFAULT 1;
ALTER TABLE oc_gestion_devis
    ADD devis_full_number VARCHAR(255);
UPDATE oc_gestion_devis as devis
    SET devis.devis_full_number = CONCAT('DEV', YEAR(devis.date) % 100, LPAD(MONTH(devis.date), 2, '0'), LPAD(devis.devis_number, 2, '0'));

ALTER TABLE oc_gestion_facture
    ADD facture_number INT DEFAULT 1;
UPDATE oc_gestion_facture as facture
    SET facture.num = CONCAT('FAC', YEAR(facture.date) % 100, LPAD(MONTH(facture.date), 2, '0'), LPAD(facture.facture_number, 2, '0'));


