|
|
@@ -2,7 +2,7 @@ |
|
|
|
|
|
|
|
$html = '' ; |
|
|
|
|
|
|
|
foreach($pointsSaleArray as $pointSale) { |
|
|
|
foreach($pointsSaleArray as $keyPointSale => $pointSale) { |
|
|
|
|
|
|
|
if(isset($ordersArray[$pointSale->id]) && count($ordersArray[$pointSale->id]) > 0) { |
|
|
|
$html .= '<h1>'.$pointSale->name.'</h1>' ; |
|
|
@@ -73,36 +73,52 @@ foreach($pointsSaleArray as $pointSale) { |
|
|
|
|
|
|
|
$html .= '</tbody></table>'; |
|
|
|
|
|
|
|
$html .= '<pagebreak>'; |
|
|
|
$html .= ' <pagebreak>'; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
echo($html) ; |
|
|
|
$html = substr($html, 0, strlen($html) - 11) ; |
|
|
|
|
|
|
|
echo $html ; |
|
|
|
|
|
|
|
function line_product($product, $orders) { |
|
|
|
$html = '' ; |
|
|
|
|
|
|
|
$html .= '<tr>' ; |
|
|
|
$html .= '<td>'.$product->name.'</td>' ; |
|
|
|
if(has_quantity($product, $orders)) { |
|
|
|
$html .= '<tr>' ; |
|
|
|
$html .= '<td>'.$product->name.'</td>' ; |
|
|
|
|
|
|
|
foreach($orders as $order) { |
|
|
|
$quantity = '' ; |
|
|
|
foreach($order->productOrder as $productOrder) { |
|
|
|
if($product->id == $productOrder->id_product) { |
|
|
|
$unit = (Product::strUnit($productOrder->unit, 'wording_short', true) == 'p.') ? '' : ' '.Product::strUnit($productOrder->unit, 'wording_short', true) ; |
|
|
|
foreach($orders as $order) { |
|
|
|
$quantity = '' ; |
|
|
|
foreach($order->productOrder as $productOrder) { |
|
|
|
if($product->id == $productOrder->id_product) { |
|
|
|
$unit = (Product::strUnit($productOrder->unit, 'wording_short', true) == 'p.') ? '' : ' '.Product::strUnit($productOrder->unit, 'wording_short', true) ; |
|
|
|
|
|
|
|
$quantity .= $productOrder->quantity .$unit ; |
|
|
|
if($productOrder->quantity > 1) { |
|
|
|
$quantity = '<strong>'.$quantity.'</strong>' ; |
|
|
|
$quantity .= $productOrder->quantity .$unit ; |
|
|
|
if($productOrder->quantity > 1) { |
|
|
|
$quantity = '<strong>'.$quantity.'</strong>' ; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$html .= '<td class="td-nb-products">'.$quantity.'</td>' ; |
|
|
|
} |
|
|
|
|
|
|
|
$html .= '<td class="td-nb-products">'.$quantity.'</td>' ; |
|
|
|
$html .= '</tr>' ; |
|
|
|
} |
|
|
|
|
|
|
|
$html .= '</tr>' ; |
|
|
|
|
|
|
|
return $html ; |
|
|
|
} |
|
|
|
|
|
|
|
function has_quantity($product, $orders) { |
|
|
|
foreach($orders as $order) { |
|
|
|
foreach($order->productOrder as $productOrder) { |
|
|
|
if($product->id == $productOrder->id_product) { |
|
|
|
return true ; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return false ; |
|
|
|
} |