* - gDossier * Must return at least tva, htva and tvac */ if (!defined('ALLOWED')) { die('Appel direct ne sont pas permis'); } require_once NOALYSS_INCLUDE . '/constant.php'; require_once NOALYSS_INCLUDE . '/class_database.php'; require_once NOALYSS_INCLUDE . '/class_dossier.php'; require_once NOALYSS_INCLUDE . '/class_acc_ledger.php'; require_once NOALYSS_INCLUDE . '/class_user.php'; // Check if the needed field does exist extract($_GET); foreach (array('l', 'gDossier') as $a) { if (!isset(${$a})) { echo "error {$a} is not set "; exit; } } if (is_numeric($l) == false) { exit; } $Ledger = new Acc_Ledger($cn, $l); $prop = $Ledger->get_propertie(); $pj_seq = $Ledger->guess_pj(); $string = '{"pj":"' . $pj_seq . '"}'; header("Content-type: text/json; charset: utf8", true); echo $string; ?>
switch ($fil) { case -1: $l = new Acc_Ledger($cn, $ledger); $where = ' where fd_id in (' . $l->get_all_fiche_def() . ')'; break; case 'cred': $l = new Acc_Ledger($cn, $ledger); $prop = $l->get_propertie(); if ($prop['jrn_def_fiche_cred'] == '') { $prop = -1; } $where = ' where fd_id in (' . $prop['jrn_def_fiche_cred'] . ')'; break; case 'deb': $l = new Acc_Ledger($cn, $ledger); $prop = $l->get_propertie(); if ($prop == '') { $prop = -1; } $where = ' where fd_id in (' . $prop['jrn_def_fiche_deb'] . ')'; break; } } else { /* we filter thanks a given model of card */ if (isset($cat)) { $where = sprintf(' where frd_id in (' . sql_string($cat) . ')'); } else { /* we filter thanks a given list of category of card */ if (isset($fil) && strlen(trim($fil)) > 0) { $where = sprintf(" where fd_id in (%s)", sql_string($fil));
function get_account_ledger($p_jrn) { $l = new Acc_Ledger($this->db, $p_jrn); $row = $l->get_propertie(); if (strlen(trim($row['jrn_def_class_deb'])) == 0) { return array(); } $valid_account = explode(" ", $row['jrn_def_class_deb']); return $valid_account; }