+
+ /**
+ * \brief get the accounts except the CHRG account.
+ */
+ public function getAvances($period,$account,&$total)
+ {
+ $uid = $this->getUserIdFromAccount($account);
+ $q =<<<_EOF
+SELECT jia_acc,act.actu_abrevation,act.actu_title from JoinIdentityAccount
+ JOIN AccountTypeUser as act on jia_actu = act.actu_id
+WHERE jia_ident = {$uid} AND jia_acc != "{$account}";
+_EOF;
+ $res = $this->doQueryI($q);
+ // Put account list in an array
+ $result = Array();
+ foreach ($res['records'] as $entry)
+ {
+ $compte = $entry[0];
+ $q = "call solde_compte_where('".$period."','t.acc_id like \"".$compte."%\"');";
+ $res = $this->doQueryI($q);
+ $result[$compte] = array($entry[1],$entry[2],$res['records'][0][2]);
+ $total += ($result[$compte][2]);
+ }
+ return $result;
+ }