[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r5304 - phpcompta/trunk/include
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r5304 - phpcompta/trunk/include |
Date: |
Wed, 22 May 2013 19:29:57 +0200 (CEST) |
Author: danydb
Date: 2013-05-22 19:29:57 +0200 (Wed, 22 May 2013)
New Revision: 5304
Modified:
phpcompta/trunk/include/class_acc_operation.php
Log:
remove last bug
Modified: phpcompta/trunk/include/class_acc_operation.php
===================================================================
--- phpcompta/trunk/include/class_acc_operation.php 2013-05-22 15:17:00 UTC
(rev 5303)
+++ phpcompta/trunk/include/class_acc_operation.php 2013-05-22 17:29:57 UTC
(rev 5304)
@@ -492,10 +492,10 @@
$ledger_id=$this->get_ledger();
if ( $ledger_id=='') throw new Exception('Journal non trouvé');
$oledger=new Acc_Ledger($this->db,$ledger_id);
-
+
// retrieve info from jrn_info
-
-
+
+
switch($oledger->get_type())
{
case 'VEN':
@@ -508,7 +508,8 @@
$ret=new Acc_Fin($this->db,$this->jr_id);
break;
default:
- return $this->get();
+ $ret=new Acc_Misc($this->db,$this->jr_id);
+ break;
}
$ret->get();
if ( empty($ret->det->array))
@@ -530,16 +531,16 @@
// other info
$array=$this->db->get_value("select ji_value from jrn_info where
jr_id=$1 and id_type=$2",array($this->jr_id,'OTHER'));
- $this->info->other= $array['ji_value'];
-
+ $this->info->other= $array;
+
// Bon de commande
- $array=$this->db->get_value("select * from jrn_info where
+ $array=$this->db->get_value("select ji_value from jrn_info where
jr_id=$1 and id_type=$2",array($this->jr_id,'BON_COMMANDE'));
- $this->info->command= $array['ji_value'];
+ $this->info->command= $array;
}
/**
- * Save into jrn_info
+ * Save into jrn_info
* @param $p_info msg to save
* @param $p_type is OTHER or BON_COMMAND
*/
@@ -547,17 +548,17 @@
{
if ( ! in_array($p_type,array('OTHER','BON_COMMANDE'))) return;
if (trim($p_info)=="") {
- $this->db->exec_sql('delete from jrn_info where jr_id=$1 and
id_type=$2',array($this->jr_id,$p_TYPE));
+ $this->db->exec_sql('delete from jrn_info where jr_id=$1 and
id_type=$2',array($this->jr_id,$p_type));
return;
}
- $exist=$this->db->get_value('select count(ji_id) from jrn_info where
jr_id=$1 and id_type=$2',array($this->jr_id,$p_TYPE));
+ $exist=$this->db->get_value('select count(ji_id) from jrn_info where
jr_id=$1 and id_type=$2',array($this->jr_id,$p_type));
if ( $exist == "0" ) {
//insert into jrn_info
$this->db->exec_sql('insert into jrn_info(jr_id,id_type,ji_value)
values ($1,$2,$3)',
array($this->jr_id,$p_type,$p_info));
} elseif ( $exist == 1) {
//update
- $this->db->exec_sql('update jrn_info set id_type=$2,ji_value=$3
where jr_id=$1',
+ $this->db->exec_sql('update jrn_info set ji_value=$3 where
jr_id=$1 and id_type=$2',
array($this->jr_id,$p_type,$p_info));
}
}
---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r5304 - phpcompta/trunk/include,
phpcompta-dev <=