Overview
Comment:Le graphique des dépenses et recettes était inversé + Fix bug dans la gestion du cache statique
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 583fa92c76b789090a1edbf9b2e3e78fb852130c
User & Date: bohwaz on 2013-09-10 11:35:08
Other Links: manifest | tags
Context
2013-09-13
16:25
Fix bug appel simplediff avec namespaces + espaces insécables dans les nombres check-in: 1823585df4 user: bohwaz tags: trunk
2013-09-10
11:35
Le graphique des dépenses et recettes était inversé + Fix bug dans la gestion du cache statique check-in: 583fa92c76 user: bohwaz tags: trunk
2013-09-02
10:48
Arrêtons d'essayer d'être intelligents, dans 90% des cas ça merde check-in: eaeee5f5c5 user: bohwaz tags: trunk
Changes

Modified src/include/class.compta_stats.php from [dd09198417] to [016e46bf63].

11
12
13
14
15
16
17
18

19
20
21
22
23

24
25
26
27
28
29
30
11
12
13
14
15
16
17

18
19
20
21
22

23
24
25
26
27
28
29
30







-
+




-
+







			WHERE id_categorie IN (SELECT id FROM compta_categories WHERE type = '.$type.')
			AND id_exercice = (SELECT id FROM compta_exercices WHERE cloture = 0)
			GROUP BY strftime(\'%Y-%m\', date) ORDER BY date;');
	}

	public function recettes()
	{
		return $this->_byType(-1);
		return $this->_byType(Compta_Categories::RECETTES);
	}

	public function depenses()
	{
		return $this->_byType(1);
		return $this->_byType(Compta_Categories::DEPENSES);
	}

	public function soldeCompte($compte, $augmente = 'debit', $diminue = 'credit')
	{
		$db = DB::getInstance();

		if (strpos($compte, '%') !== false)

Modified src/include/lib.static_cache.php from [9e4c6fda87] to [c7a4e63305].

39
40
41
42
43
44
45
46

47
48
49
50
51
52
53
39
40
41
42
43
44
45

46
47
48
49
50
51
52
53







-
+







		self::$cache_dir = $dir;
		return true;
	}

	static public function store($id, $content)
	{
		$path = self::_getCachePath($id);
		return file_put_contents($path, $content);
		return (bool) file_put_contents($path, $content);
	}

	static public function expired($id, $expire = self::EXPIRE)
	{
		$path = self::_getCachePath($id);
		$time = @filemtime($path);

Modified src/www/admin/compta/graph.php from [051251e8e7] to [e602a4458e].

31
32
33
34
35
36
37
38

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
31
32
33
34
35
36
37

38
39
40









41
42
43
44
45
46
47







-
+


-
-
-
-
-
-
-
-
-







	{
		$r = new \SVGPlot_Data($stats->recettes());
		$r->title = 'Recettes';

		$d = new \SVGPlot_Data($stats->depenses());
		$d->title = 'Dépenses';

		$data = array($r, $d);
		$data = array($d, $r);

		$plot->setTitle('Recettes et dépenses de l\'exercice courant');

		$labels = array();

		foreach ($r->get() as $k=>$v)
		{
			$labels[] = utils::date_fr('M y', strtotime(substr($k, 0, 4) . '-' . substr($k, 4, 2) .'-01'));
		}

		$plot->setLabels($labels);
	}
	elseif ($graph == 'banques_caisses')
	{
		$banques = new Compta_Comptes_Bancaires;

		$data = array();

110
111
112
113
114
115
116

117

118
119
120
121
122
101
102
103
104
105
106
107
108

109
110
111
112
113
114







+
-
+






	Static_Cache::store('graph_' . $graph, $plot->output());
}

header('Content-Type: image/svg+xml');
Static_Cache::display('graph_' . $graph);

// Clean cache sometimes
if (time() % 100)
if ((time() % 100) == 0)
{
	Static_Cache::clean();
}

?>