Do not print zero lines amount of 0.00 in Sales Documents if service item, $no_zero_l...
[fa-stable.git] / reporting / rep109.php
index 51697c3c6c1ec8bac98ae1c1b3d530d378b90093..c8b4a1ef3e782f8ac34fc86df9d67742fa5d13e0 100644 (file)
@@ -33,7 +33,7 @@ $print_as_quote = 0;
 
 function print_sales_orders()
 {
-       global $path_to_root, $print_as_quote;
+       global $path_to_root, $print_as_quote, $no_zero_lines_amount;
 
        include_once($path_to_root . "/reporting/includes/pdf_report.inc");
 
@@ -124,11 +124,14 @@ function print_sales_orders()
                        $rep->TextColLines(1, 2, $myrow2['description'], -2);
                        $newrow = $rep->row;
                        $rep->row = $oldrow;
-                       $rep->TextCol(2, 3,     $DisplayQty, -2);
-                       $rep->TextCol(3, 4,     $myrow2['units'], -2);
-                       $rep->TextCol(4, 5,     $DisplayPrice, -2);
-                       $rep->TextCol(5, 6,     $DisplayDiscount, -2);
-                       $rep->TextCol(6, 7,     $DisplayNet, -2);
+                       if ($Net != 0.0 || !is_service($myrow2['mb_flag']) || !isset($no_zero_lines_amount) || $no_zero_lines_amount == 0)
+                       {
+                               $rep->TextCol(2, 3,     $DisplayQty, -2);
+                               $rep->TextCol(3, 4,     $myrow2['units'], -2);
+                               $rep->TextCol(4, 5,     $DisplayPrice, -2);
+                               $rep->TextCol(5, 6,     $DisplayDiscount, -2);
+                               $rep->TextCol(6, 7,     $DisplayNet, -2);
+                       }       
                        $rep->row = $newrow;
                        //$rep->NewLine(1);
                        if ($rep->row < $rep->bottomMargin + (15 * $rep->lineHeight))