diff --git a/html/admin/sql/patch/upgrade99.sql b/html/admin/sql/patch/upgrade99.sql
index a73e14c54..b079d2a1d 100644
--- a/html/admin/sql/patch/upgrade99.sql
+++ b/html/admin/sql/patch/upgrade99.sql
@@ -28,14 +28,14 @@ LANGUAGE plpgsql;
delete from profile_menu where p_id=2 and me_code_dep='DIVPARM';
delete from profile_menu where p_id=2 and me_code_dep='MOD';
-update quant_sold set qs_price=(-1)*qs_price, qs_vat=(-1)*qs_vat where qs_quantite > 0 and qs_price > 0 and qs_vat >= 0;
+update quant_sold set qs_price=(-1)*qs_price, qs_vat=(-1)*qs_vat where qs_quantite < 0 and qs_price > 0 and qs_vat >= 0;
update quant_purchase set qp_price=(-1)*qp_price, qp_vat=(-1)*qp_vat,
qp_nd_amount=(-1)*qp_nd_amount,
qp_nd_tva=(-1)*qp_nd_tva,
qp_nd_tva_recup=(-1)*qp_nd_tva_recup,
qp_dep_priv=(-1)*qp_dep_priv
-where qp_quantite > 0 and qp_price > 0 and qp_vat >= 0;
+where qp_quantite < 0 and qp_price > 0 and qp_vat >= 0;
update version set val=100;