Author: danydb
Date: 2012-04-24 21:33:27 +0200 (Tue, 24 Apr 2012)
New Revision: 4815
Modified:
phpcompta/tags/rel601/sql/upgrade.sql
Log:
Fix bug predefined operation for misc ledger
Fix bug for check_balance (null value)
Modified: phpcompta/tags/rel601/sql/upgrade.sql
===================================================================
--- phpcompta/tags/rel601/sql/upgrade.sql 2012-04-24 19:33:02 UTC (rev
4814)
+++ phpcompta/tags/rel601/sql/upgrade.sql 2012-04-24 19:33:27 UTC (rev
4815)
@@ -1,29 +1,29 @@
CREATE OR REPLACE FUNCTION comptaproc.check_balance(p_grpt integer)
RETURNS numeric AS
$BODY$
-declare
+declare
amount_jrnx_debit numeric;
amount_jrnx_credit numeric;
amount_jrn numeric;
begin
- select coalesce(sum (j_montant),0) into amount_jrnx_credit
- from jrnx
- where
+ select coalesce(sum (j_montant),0) into amount_jrnx_credit
+ from jrnx
+ where
j_grpt=p_grpt
and j_debit=false;
- select coalesce(sum (j_montant),0) into amount_jrnx_debit
- from jrnx
- where
+ select coalesce(sum (j_montant),0) into amount_jrnx_debit
+ from jrnx
+ where
j_grpt=p_grpt
and j_debit=true;
- select coalesce(jr_montant,0) into amount_jrn
+ select coalesce(jr_montant,0) into amount_jrn
from jrn
where
jr_grpt_id=p_grpt;
- if ( amount_jrnx_debit != amount_jrnx_credit )
+ if ( amount_jrnx_debit != amount_jrnx_credit )
then
return abs(amount_jrnx_debit-amount_jrnx_credit);
end if;
@@ -36,3 +36,4 @@
$BODY$
LANGUAGE plpgsql;
+update op_predef set od_direct='t' where od_jrn_type='ODS';
---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu
_______________________________________________
Phpcompta est un logiciel libre de comptabilité en ligne
(http://www.phpcompta.eu)
Phpcompta-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/phpcompta-dev