'sunday', 1 => 'monday', 2 => 'tuesday', 3 => 'wednesday', 4 => 'thursday', 5 => 'friday', 6 => 'saturday']; $fieldInfosPointSale = 'infos_' . $dayWeekArray[$dayWeek]; $html = '' ; // par point de vente foreach ($pointsSaleArray as $pointSale) { if (count($pointSale->orders)) { $html .= '
Client | ' . 'Produits | ' . 'Commentaire | ' . $colCredit . 'Montant | ' . '|
---|---|---|---|---|
'.$strUser.' | '; // produits $strProducts = ''; foreach ($productsArray as $product) { $add = false; foreach ($order->productOrder as $productOrder) { if ($product->id == $productOrder->id_product) { $strProducts .= $product->name . ' (' .$productOrder->quantity . ' '.Product::strUnit($productOrder->unit, 'wording_short', true).'), '; $add = true; } } } $html .= ''.substr($strProducts, 0, strlen($strProducts) - 2).' | '; $html .= ''.$order->comment.' | '; if($pointSale->credit) { $credit = '' ; if(isset($order->user) && isset($order->user->userProducer)) { $credit = number_format($order->user->userProducer[0]->credit,2).' €' ; } $html .= ''.$credit.' | ' ; } $html .= ''.number_format($order->amount, 2) . ' € '; if($order->getPaymentStatus() == Order::PAYMENT_PAID) { $html .= '(payé)' ; } elseif($order->getPaymentStatus() == Order::PAYMENT_UNPAID && $order->getAmount(Order::AMOUNT_PAID)) { $html .= '(reste '.$order->getAmount(Order::AMOUNT_REMAINING, true).' à payer)' ; } elseif($order->getPaymentStatus() == Order::PAYMENT_SURPLUS) { $html .= '(surplus : '.$order->getAmount(Order::PAYMENT_SURPLUS, true).' à rembourser)' ; } $html .= ' | ' ; $html .= '
Total | ' ; $strProducts = ''; foreach ($productsArray as $product) { foreach(Product::$unitsArray as $unit => $dataUnit) { $quantity = Order::getProductQuantity($product->id, $pointSale->orders, false, $unit); if ($quantity) { $strProducts .= $product->name . ' (' .$quantity . ' '.Product::strUnit($unit, 'wording_short', true).'), '; } } } $strProducts = substr($strProducts, 0, strlen($strProducts) - 2) ; $html .= ''.$strProducts.' | ' ; if($pointSale->credit) { $html .= ' | ' ; } $html .= ' | '.number_format($pointSale->revenues, 2) . ' € | '; $html .= '
Point de vente | ' . 'Produits | ' . 'Montant | ' . '
---|---|---|
'.$pointSale->name.' | ' ; foreach ($productsArray as $product) { foreach(Product::$unitsArray as $unit => $dataUnit) { $quantity = Order::getProductQuantity($product->id, $pointSale->orders, false, $unit); if ($quantity) { $html .= $product->name . ' (' .$quantity . ' '.Product::strUnit($unit, 'wording_short', true).'), '; } } } $html = substr($html, 0, strlen($html) - 2) ; $html .= ' | '.number_format($pointSale->revenues, 2).' € |
Total | ' ; foreach ($productsArray as $product) { foreach(Product::$unitsArray as $unit => $dataUnit) { $quantity = Order::getProductQuantity($product->id, $ordersArray, false, $unit); if ($quantity) { $html .= $product->name . ' (' .$quantity . ' '.Product::strUnit($unit, 'wording_short', true).'), '; } } } $html = substr($html, 0, strlen($html) - 2) ; $html .= ' | '.number_format($revenues, 2).' € |