'dimanche', 1 => 'lundi', 2 => 'mardi', 3 => 'mercredi', 4 => 'jeudi', 5 => 'vendredi', 6 => 'samedi']; $champs_horaires_point_vente = 'horaires_' . $arr_jour_semaine[$num_jour_semaine]; $html = '' ; // par point de vente foreach ($points_vente as $pv) { if (count($pv->order) && strlen($pv->$champs_horaires_point_vente)) { $html .= '

'.$pv->name.'

' ; $col_credit_pain = '' ; if($pv->credit) { $col_credit = 'Rappel crédit' ; } $html .= '' . '' . '' . '' . '' . '' . $col_credit . '' . '' . ''; foreach ($pv->orders as $c) { $html .= '' ; $str_user = ''; // username if ($c->user) { $str_user = $c->user->name . " " . $c->user->lastname; } else { $str_user = $c->username; } if(strlen($c->comment_point_sale)) { $str_user .= '
'.$c->comment_point_sale.'' ; } // téléphone if (isset($c->user) && strlen($c->user->phone)) { $str_user .= '
' . $c->user->phone . ''; } $html .= ''; // produits $str_produits = ''; foreach ($produits as $p) { $add = false; foreach ($c->productOrder as $cp) { if ($p->id == $cp->id_product) { $str_produits .= $cp->quantity . ' ' . $p->name . ', '; $add = true; } } } $html .= ''; $html .= ''; if($pv->credit) { $credit = '' ; if(isset($c->user) && isset($c->user->userProducer)) { $credit = number_format($c->user->userProducer[0]->credit,2).' €' ; } $html .= '' ; } $html .= '' ; $html .= '' ; } $html .= '' ; $str_produits = ''; foreach ($produits as $p) { $quantite = Order::getProductQuantity($p->id, $pv->orders); $str_quantite = ''; if ($quantite) { $str_quantite = $quantite; $str_produits .= $str_quantite .' '. $p->name . ', '; } } $str_produits = substr($str_produits, 0, strlen($str_produits) - 2) ; $html .= '' ; if($pv->credit) { $html .= '' ; } $html .= ''; $html .= '
ClientProduitsCommentaireMontant
'.$str_user.''.substr($str_produits, 0, strlen($str_produits) - 2).''.$c->comment.''.$credit.''.number_format($c->amount, 2) . ' € '; if($c->getStatusPayment() == Order::PAYMENT_PAID) { $html .= '(payé)' ; } elseif($c->getStatusPayment() == Order::PAYMENT_UNPAID && $c->getAmount(Order::AMOUNT_PAID)) { $html .= '(reste '.$c->getAmount(Order::AMOUNT_REMAINING, true).' à payer)' ; } elseif($c->getStatusPayment() == Order::PAYMENT_SURPLUS) { $html .= '(surplus : '.$c->getAmount(Order::PAYMENT_SURPLUS, true).' à rembourser)' ; } $html .= '
Total'.$str_produits.''.number_format($pv->revenues, 2) . ' €
' ; } } // par point de vente $html .= '

Points de vente

' ; $html .= '' . '' . '' . '' . '' . '' . '' . ''; $recettes = 0 ; foreach ($points_vente as $pv) { if (count($pv->orders) && strlen($pv->$champs_horaires_point_vente)) { $html .= '' ; $recettes += $pv->revenues ; } } // total $html .= '' ; $html .= '
Point de venteProduitsMontant
'.$pv->name.'' ; foreach ($produits as $p) { $quantite = Order::getProductQuantity($p->id, $pv->orders); $str_quantite = ''; if ($quantite) { $str_quantite = $quantite; } if(strlen($str_quantite)) { $html .= $str_quantite . ' '.$p->name.', ' ; } } $html = substr($html, 0, strlen($html) - 2) ; $html .= ''.number_format($pv->revenues, 2).' €
Total' ; foreach ($produits as $p) { $quantite = Order::getProductQuantity($p->id, $orders); if($quantite) { $html .= $quantite . ' '.$p->name.', ' ; } } $html = substr($html, 0, strlen($html) - 2) ; $html .= ''.number_format($recettes, 2).' €
' ; echo $html ; ?>