Regalamiunsorriso/www/admin/_alterTable/_alterTable/296_costoagg.sql
2026-04-07 18:02:17 +02:00

50 lines
No EOL
2.6 KiB
SQL

# Alter table "ARTICOLO" #
# ---------------------------------------------------------------------- #
ALTER TABLE `ARTICOLO` ADD COLUMN `flgControlloCostoAggArt` INTEGER;
# ---------------------------------------------------------------------- #
# Alter table "TIPO" #
# ---------------------------------------------------------------------- #
ALTER TABLE `TIPO` ADD COLUMN `flgControlloCostiAggFor` INTEGER;
# ---------------------------------------------------------------------- #
# Alter table "ARTICOLO_FORNITORE" #
# ---------------------------------------------------------------------- #
ALTER TABLE `ARTICOLO_FORNITORE` ADD COLUMN `flgControlloCostoAggAF` INTEGER;
update articolo set flgControlloCostoAggArt=1;
update articolo set flgControlloCostoAggArt=0 where id_tipo=54;
update articolo set flgControlloCostoAggArt=0 where id_tipo=55;
update articolo set flgControlloCostoAggArt=0 where id_tipo=56;
update articolo set flgControlloCostoAggArt=0 where id_tipo=57;
update articolo set flgControlloCostoAggArt=0 where id_tipo=116;
update articolo_fornitore set flgControlloCostoAggAF=1;
update articolo_fornitore set flgControlloCostoAggAF=0 where id_articolo in (select id_articolo from articolo where id_tipo=54);
update articolo_fornitore set flgControlloCostoAggAF=0 where id_articolo in (select id_articolo from articolo where id_tipo=55);
update articolo_fornitore set flgControlloCostoAggAF=0 where id_articolo in (select id_articolo from articolo where id_tipo=56);
update articolo_fornitore set flgControlloCostoAggAF=0 where id_articolo in (select id_articolo from articolo where id_tipo=57);
update articolo_fornitore set flgControlloCostoAggAF=0 where id_articolo in (select id_articolo from articolo where id_tipo=116);
update articolo_fornitore set flgControlloCostoAggAF=1 where id_clifor=1970;
update articolo_fornitore set flgControlloCostoAggAF=1 where id_clifor=2030;
update articolo_fornitore set flgControlloCostoAggAF=1 where id_clifor=1973;
update articolo_fornitore set flgControlloCostoAggAF=1 where id_clifor=1997;
update articolo_fornitore set flgControlloCostoAggAF=1 where id_clifor=2000;
update articolo_fornitore set flgControlloCostoAggAF=1 where `costoAggiuntivo`>0;
###################################################################
#insert into PARM (codice) values ('DB_VERSION');
UPDATE PARM SET testo='296' where codice='DB_VERSION';
######################################################################