Browse Source

Merge branch 'dev'

master
Guillaume 3 years ago
parent
commit
8e06be748d
1 changed files with 57 additions and 55 deletions
  1. +57
    -55
      backend/views/distribution/report-grid.php

+ 57
- 55
backend/views/distribution/report-grid.php View File

@@ -4,75 +4,77 @@ $html = '' ;

foreach($pointsSaleArray as $pointSale) {

$html .= '<h1>'.$pointSale->name.'</h1>' ;
if(isset($ordersArray[$pointSale->id]) && count($ordersArray[$pointSale->id]) > 0) {
$html .= '<h1>'.$pointSale->name.'</h1>' ;

foreach ($ordersArray[$pointSale->id] as $indexPage => $orders) {
foreach ($ordersArray[$pointSale->id] as $indexPage => $orders) {

$html .= '<table class="">'
. '<thead>'
. '<tr>'
. '<th></th>';
$html .= '<table class="">'
. '<thead>'
. '<tr>'
. '<th></th>';

foreach ($orders as $order) {
$html .= '<th class="th-user" text-rotate="90">'
. '<div class="user">' . $order->getStrUser() . '</div>'
//.'<div class="amount">'.number_format($order->amount_with_tax, 2) .' € </div>'
. '</th>';
}
foreach ($orders as $order) {
$html .= '<th class="th-user" text-rotate="90">'
. '<div class="user">' . $order->getStrUser() . '</div>'
//.'<div class="amount">'.number_format($order->amount_with_tax, 2) .' € </div>'
. '</th>';
}

$html .= '</tr>'
. '<thead>'
. '<tbody>';
$html .= '</tr>'
. '<thead>'
. '<tbody>';


foreach ($categoriesArray as $category) {
if ($category) {
$html .= '<tr><td class="category-name">' . $category->name . '</td><td colspan="' . (count($orders)) . '"></td></tr>';
}
foreach ($categoriesArray as $category) {
if ($category) {
$html .= '<tr><td class="category-name">' . $category->name . '</td><td colspan="' . (count($orders)) . '"></td></tr>';
}

foreach ($productsArray as $product) {
if (($category && $product->id_product_category == $category->id) || (!$category && !$product->id_product_category)) {
$html .= line_product($product, $orders);
foreach ($productsArray as $product) {
if (($category && $product->id_product_category == $category->id) || (!$category && !$product->id_product_category)) {
$html .= line_product($product, $orders);
}
}
}
}

$html .= '</tbody>'
. '</table>';
$html .= '<pagebreak>';
$html .= '<table class="">'
. '<thead>'
. '<tr>'
. '<th>Client</th>'
. '<th>Contact</th>'
. '<th>Commentaire</th>'
. '<th>Montant</th>'
. '</thead>'
. '<tbody>';
foreach ($orders as $order) {
$html .= '<tr>';
$strUser = $order->getStrUser();
if ($producer->option_order_reference_type == Producer::ORDER_REFERENCE_TYPE_YEARLY && $order->reference && strlen($order->reference) > 0) {
$strUser .= '<br />' . $order->reference;
}
$html .= '</tbody>'
. '</table>';
$html .= '<pagebreak>';
$html .= '<table class="">'
. '<thead>'
. '<tr>'
. '<th>Client</th>'
. '<th>Contact</th>'
. '<th>Commentaire</th>'
. '<th>Montant</th>'
. '</thead>'
. '<tbody>';
foreach ($orders as $order) {
$html .= '<tr>';
$strUser = $order->getStrUser();
if ($producer->option_order_reference_type == Producer::ORDER_REFERENCE_TYPE_YEARLY && $order->reference && strlen($order->reference) > 0) {
$strUser .= '<br />' . $order->reference;
}

$html .= '<td>' . $strUser . '</td>';
$contactUser = '';
if ($order->user) {
$contactUser .= $order->user->phone . '<br />' . $order->user->email;
$html .= '<td>' . $strUser . '</td>';
$contactUser = '';
if ($order->user) {
$contactUser .= $order->user->phone . '<br />' . $order->user->email;
}
$html .= '<td>' . $contactUser . '</td>';
$html .= '<td>' . nl2br($order->comment) . '</td>';
$html .= '<td>' . number_format($order->amount_with_tax, 2) . ' € </td>';
$html .= '</tr>';
}
$html .= '<td>' . $contactUser . '</td>';
$html .= '<td>' . nl2br($order->comment) . '</td>';
$html .= '<td>' . number_format($order->amount_with_tax, 2) . ' € </td>';
$html .= '</tr>';
}

$html .= '</tbody></table>';
$html .= '</tbody></table>';

$html .= '<pagebreak>';
$html .= '<pagebreak>';
}
}
}


Loading…
Cancel
Save