41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
'debut' => $debut,
'fin' => $fin,
'exercice' => $exercice
]);
foreach ($result as &$row)
{
$solde += $row['solde'];
$row['solde'] = $solde;
}
$solde_final = $solde;
return $result;
}
|
|
|
|
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
'debut' => $debut,
'fin' => $fin,
'exercice' => $exercice
]);
foreach ($result as &$row)
{
$solde += $row->solde;
$row->solde = $solde;
}
$solde_final = $solde;
return $result;
}
|
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
// Synchro des trucs cochés
$st = $db->prepare('INSERT OR REPLACE INTO compta_rapprochement (id_operation, id_auteur)
VALUES (:operation, :auteur);');
$st->bindValue(':auteur', (int)$auteur, \SQLITE3_INTEGER);
foreach ($journal as $row)
{
if (!array_key_exists($row['id'], $cases))
continue;
$st->bindValue(':operation', (int)$row['id'], \SQLITE3_INTEGER);
$st->execute();
}
// Synchro des trucs NON cochés
$st = $db->prepare('DELETE FROM compta_rapprochement WHERE id_operation = :id;');
foreach ($journal as $row)
{
if (array_key_exists($row['id'], $cases))
continue;
$st->bindValue(':id', (int)$row['id'], \SQLITE3_INTEGER);
$st->execute();
}
$db->commit();
return true;
}
}
|
|
|
|
|
|
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
// Synchro des trucs cochés
$st = $db->prepare('INSERT OR REPLACE INTO compta_rapprochement (id_operation, id_auteur)
VALUES (:operation, :auteur);');
$st->bindValue(':auteur', (int)$auteur, \SQLITE3_INTEGER);
foreach ($journal as $row)
{
if (!array_key_exists($row->id, $cases))
continue;
$st->bindValue(':operation', (int)$row->id, \SQLITE3_INTEGER);
$st->execute();
}
// Synchro des trucs NON cochés
$st = $db->prepare('DELETE FROM compta_rapprochement WHERE id_operation = :id;');
foreach ($journal as $row)
{
if (array_key_exists($row->id, $cases))
continue;
$st->bindValue(':id', (int)$row->id, \SQLITE3_INTEGER);
$st->execute();
}
$db->commit();
return true;
}
}
|