From 1ab4348bb160bd97f5a0828bd46601744c890d1a Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 9 Dec 2011 15:07:40 +0000 Subject: [PATCH] =?UTF-8?q?#489=20Efface=20menu=20+=20d=C3=A9pendance=20->?= =?UTF-8?q?=20mise=20=C3=A0=20jour=20SQL=20Correction=20signe=20op=C3=A9ra?= =?UTF-8?q?tion=20extourn=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/admin/sql/patch/upgrade99.sql | 12 +++++++++++- include/class_acc_ledger.php | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) 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));