Bon apres un week end de reflexion j ai trouvé ma solution:
Explication pour celui qui cherche cela un jour:
Dans le controller:
public function index() {
$this->Vente->recursive = 0;
$this->paginate =array(
'fields' => array('id', 'date(Vente.date_facture) AS df', 'total', 'type_reglement', 'tva', 'categorie', 'promotion', 'remise', 'rattrapage_caisse', 'created', 'updated'),
'order' => array('date_facture' => 'DESC')
);
$datas = $this->Paginator->paginate();
foreach ($datas as $k => $v) {
$ventes$v[0]'df']]] = $v; // On crée un tableau avec en clé df qui est la date du jour recuperer en requte. le foreach se chargera de classer le tout
}
$this->set(compact('ventes'));
}
Finalement, j'ai simplement retrier le tableau en fonction de df qui me sert de date jour dans la requete.
Ensuite dans la vue un double foreach: Un pour la date et l'autre a l interieur pour liset les ventes de la date en cours
Dans ma vue:
<?php foreach ($ventes as $d => $v): ?>
<?php $total_day = 0; ?>
<tr style="background-color:#FFCC66; border-top: 2px solid #FF9966">
<th></th><th colspan="8"><?php echo $d; ?></th>
</tr>
<?php foreach ($v as $vente): ?>
<tr>
<td><?php echo $vente'Vente']'total']; ?></td>
<td><?php echo $vente'Vente']'type_reglement']; ?></td>
<td><?php echo $vente'Vente']'tva']; ?></td>
<td><?php echo $vente'Vente']'categorie']; ?></td>
<td><?php echo $vente'Vente']'promotion']; ?></td>
<td><?php echo $vente'Vente']'remise']; ?></td>
<td><?php echo $vente'Vente']'rattrapage_caisse']; ?></td>
<td><?php echo $vente'Vente']'created']; ?></td>
</tr>
<?php $total_day += $vente'Vente']'total']; ?>
<?php endforeach; ?>
<tr style="background-color:#CCFFFF; border-top: 1px solid #CCCCFF">
<th></th><th colspan="8">TOTAL DE LA JOURNEE: <?php echo $total_day; ?> €</th>
</tr>
<?php endforeach ?>