Skip to content
This repository was archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Merge branch 'issue-213' into develop
Browse files Browse the repository at this point in the history
wandersonwhcr committed Jan 22, 2018
2 parents cbc867a + e009382 commit b811eee
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions module/Balance/src/Balance/Model/Persistence/Db/Balance.php
Original file line number Diff line number Diff line change
@@ -62,19 +62,19 @@ public function fetch(Parameters $params)
->columns(['id', 'value' => $eValue])
->join(['e' => 'entries'], 'a.id = e.account_id', [])
->join(['p' => 'postings'], 'p.id = e.posting_id', []);
// Captura
$subselect = clone($balanceSelect);
// Filtro de Não Acumulados
$subselect->where(function ($where) {
$where->equalTo('a.accumulate', 0);
});
// Filtro?
if ($datetime) {
// Aplicar Filtro de Data Limite
$subselect->where(function ($where) use ($datetime) {
$balanceSelect->where(function ($where) use ($datetime) {
$where->lessThanOrEqualTo('p.datetime', $datetime);
});
}
// Captura
$subselect = clone($balanceSelect);
// Filtro de Não Acumulados
$subselect->where(function ($where) {
$where->equalTo('a.accumulate', 0);
});
// Seletor
$select = (new Select())
->from(['b' => $subselect])

0 comments on commit b811eee

Please sign in to comment.