'sunday', 1 => 'monday', 2 => 'tuesday', 3 => 'wednesday', 4 => 'thursday', 5 => 'friday', 6 => 'saturday']; $fieldInfosPointSale = 'infos_' . $dayWeekArray[$dayWeek]; $html = '' ; $count = count($productsArray) ; $limit = 100 ; $isBig = $count > $limit ; // par point de vente foreach ($pointsSaleArray as $pointSale) { if (count($pointSale->orders)) { $html .= '
Nom / prénom | ' . 'Téléphone | ' . 'Produits | ' . ($isBig ? 'Produits | ' : '') . 'Commentaire | ' . 'Paiement | ' . 'Moyen de paiement | ' . 'Montant | ' . '||
---|---|---|---|---|---|---|---|---|---|
'.$strUser.' | '; // téléphone $html .= '' ; if (isset($order->user) && strlen($order->user->phone)) { $html .= $order->user->phone ; } $html .= ' | ' ; // mail $html .= '' ; if (isset($order->user) && strlen($order->user->email)) { $html .= $order->user->email ; } $html .= ' | ' ; // produits $strProducts = ''; foreach ($productsArray as $product) { $add = false; foreach ($order->productOrder as $productOrder) { if($product->id == $productOrder->id_product) { $unit = ( $productManager->strUnit($productOrder->unit, 'wording_short', true) == 'p.') ? '' : ' '. $productManager->strUnit($productOrder->unit, 'wording_short', true) ; $strProducts .= $product->name . ' (' .$productOrder->quantity .$unit.')'.substr($strProducts, 0, strlen($strProducts) - 6).' | '; if($isBig) { $html .= '' ; } // commentaire $html .= ' | '.$order->comment.' | '; // paiement $html .= '' ; if(isset($order->mean_payment) && strlen($order->mean_payment) > 0) { $html .= 'Payé' ; } $html .= ' | ' ; // moyen de paiement $html .= '' ; if(isset($order->mean_payment) && strlen($order->mean_payment) > 0) { if($order->mean_payment == 'cheque') { $html .= 'Chèque' ; } elseif($order->mean_payment == 'money') { $html .= 'Espèces' ; } elseif($order->mean_payment == 'credit') { $html .= 'Crédit' ; } elseif($order->mean_payment == 'credit-card') { $html .= 'Carte bancaire' ; } elseif($order->mean_payment == 'transfer') { $html .= 'Virement' ; } else { $html .= $order->mean_payment ; } } $html .= ' | ' ; if($pointSale->credit) { $credit = '' ; if(isset($order->user) && $order->user->id) { $userProducer = UserProducer::searchOne([ 'id_user' => $order->user->id ]); if($userProducer) { $credit = number_format($userProducer->credit,2).' €' ; } } $html .= ''.$credit.' | ' ; } $html .= ''.number_format($order->amount_with_tax, 2) . ' € '; $html .= ' | ' ; $html .= '
Total | ' ; $strProducts = ''; $cpt = 0 ; foreach ($productsArray as $product) { foreach( Product::$unitsArray as $unit => $dataUnit) { $quantity = $orderManager->getProductQuantity($product, $pointSale->orders, false, $unit); if ($quantity) { $theUnit = ( $productManager->strUnit($unit, 'wording_short', true) == 'p.') ? '' : ' '. $productManager->strUnit($unit, 'wording_short', true) ; $strProducts .= $product->name . ' (' .$quantity .$theUnit.') | ' ; } $cpt ++ ; } $strProducts = substr($strProducts, 0, strlen($strProducts) - 6) ; $html .= ' | '.$strProducts.' | ' ; if($pointSale->credit) { $html .= ' | ' ; } $html .= ' | '.Price::format($pointSale->revenues_with_tax) . ' | '; $html .= '
Point de vente | ' . 'Produits | ' . ( $isBig ? 'Produits | ' : '') . 'Montant | ' . '
---|---|---|---|
'.$pointSale->name.' | ' ;
$cpt = 0 ;
foreach ($productsArray as $product) {
foreach( Product::$unitsArray as $unit => $dataUnit) {
$quantity = $orderManager->getProductQuantity($product, $pointSale->orders, false, $unit);
if ($quantity) {
$theUnit = ( Product::strUnit($unit, 'wording_short', true) == 'p.') ? '' : ' '. $productManager->strUnit($unit, 'wording_short', true) ;
$html .= $product->name . ' (' .$quantity .$theUnit.') '; } } if($isBig && $cpt == $limit) { $html .= ' | ' ; } $cpt ++ ; } $html = substr($html, 0, strlen($html) - 6) ; $html .= ' | '.Price::format($pointSale->revenues_with_tax, 2).' |
Total | ' ;
$cpt = 0 ;
foreach ($productsArray as $product) {
foreach( Product::$unitsArray as $unit => $dataUnit) {
$quantity = $orderManager->getProductQuantity($product, $ordersArray, false, $unit);
if ($quantity) {
$theUnit = ( $productManager->strUnit($unit, 'wording_short', true) == 'p.') ? '' : ' '. $productManager->strUnit($unit, 'wording_short', true) ;
$html .= $product->name . ' (' .$quantity .$theUnit.') '; } } if($isBig && $cpt == $limit) { $html .= ' | ' ; } $cpt ++ ; } $html = substr($html, 0, strlen($html) - 6) ; $html .= ' | '.number_format($revenues, 2).' € |