diff --git a/html/admin/sql/patch/upgrade99.sql b/html/admin/sql/patch/upgrade99.sql
index f630dad78..a73e14c54 100644
--- a/html/admin/sql/patch/upgrade99.sql
+++ b/html/admin/sql/patch/upgrade99.sql
@@ -14,7 +14,7 @@ begin
loop
return next x;
- for e in select * from comptaproc.get_menu_dependency_pm(x)
+ for e in select * from comptaproc.get_menu_dependency(x)
loop
return next e;
end loop;
@@ -27,6 +27,16 @@ 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_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;
+
update version set val=100;
commit;
\ No newline at end of file
diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php
index be5dd39ae..8dde07733 100644
--- a/include/class_acc_ledger.php
+++ b/include/class_acc_ledger.php
@@ -262,7 +262,7 @@ class Acc_Ledger extends jrn_def_sql
qp_valid, qp_dep_priv)
SELECT $1, $2, qp_fiche, qp_quantite*(-1), qp_price*(-1), qp_vat*(-1),
qp_vat_code, qp_nd_amount*(-1), qp_nd_tva*(-1), qp_nd_tva_recup*(-1), qp_supplier,
- qp_valid, qp_dep_priv
+ qp_valid, qp_dep_priv*(-1)
FROM quant_purchase where j_id=$3",
array($p_internal,$j_id,$row));