Do not print zero lines amount of 0.00 in Sales Documents if service item, $no_zero_l...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 17 Jan 2012 09:13:16 +0000 (10:13 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 17 Jan 2012 09:13:16 +0000 (10:13 +0100)
config.default.php
reporting/rep107.php
reporting/rep109.php
reporting/rep110.php
reporting/rep111.php
sales/includes/db/cust_trans_details_db.inc
sales/includes/db/sales_order_db.inc

index 9bc4dae1e946d9f6cab4712dd73e0986233b5cd0..161fec2537346e8df51a7206a46622fd1c88b4d9 100644 (file)
@@ -68,6 +68,9 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
        $power_by               = "FrontAccounting";
        $power_url              = "http://frontaccounting.com";
 
+       /* Do not print zero lines amount of 0.00 in Sales Documents if service item. 1 = do not */
+       $no_zero_lines_amount = 1;
+
        /* Use icon for editkey (=true) righ of combobox. 1 = use, 0 = do not use */
        $use_icon_for_editkey = 0;
 
index 62dc0f2cb202a31c3afe0d53dd01b842f8e53a7e..5e044f2898df54935a36d3daf75de299c4b10cde 100644 (file)
@@ -32,7 +32,7 @@ print_invoices();
 
 function print_invoices()
 {
-       global $path_to_root, $alternative_tax_include_on_docs, $suppress_tax_rates;
+       global $path_to_root, $alternative_tax_include_on_docs, $suppress_tax_rates, $no_zero_lines_amount;
        
        include_once($path_to_root . "/reporting/includes/pdf_report.inc");
 
@@ -118,11 +118,14 @@ function print_invoices()
                                $rep->TextColLines(1, 2, $myrow2['StockDescription'], -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))
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))
index 4b4fec83e614ede4775a1124481c70d91dbac82d..7b9318d0e845ac9ecd2920aa87580bb3d5456b78 100644 (file)
@@ -34,7 +34,7 @@ print_deliveries();
 
 function print_deliveries()
 {
-       global $path_to_root, $packing_slip, $alternative_tax_include_on_docs, $suppress_tax_rates;
+       global $path_to_root, $packing_slip, $alternative_tax_include_on_docs, $suppress_tax_rates, $no_zero_lines_amount;
 
        include_once($path_to_root . "/reporting/includes/pdf_report.inc");
 
@@ -127,13 +127,16 @@ function print_deliveries()
                                $rep->TextColLines(1, 2, $myrow2['StockDescription'], -2);
                                $newrow = $rep->row;
                                $rep->row = $oldrow;
-                               $rep->TextCol(2, 3,     $DisplayQty, -2);
-                               $rep->TextCol(3, 4,     $myrow2['units'], -2);
-                               if ($packing_slip == 0)
-                               {
-                                       $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);
+                                       if ($packing_slip == 0)
+                                       {
+                                               $rep->TextCol(4, 5,     $DisplayPrice, -2);
+                                               $rep->TextCol(5, 6,     $DisplayDiscount, -2);
+                                               $rep->TextCol(6, 7,     $DisplayNet, -2);
+                                       }
                                }       
                                $rep->row = $newrow;
                                //$rep->NewLine(1);
index 07fbd41f2b34d62b223e946e4178fabd6e6c5e54..2662fca59d1221403d0a4cdff2785a063b24c8ac 100644 (file)
@@ -31,7 +31,7 @@ print_sales_quotations();
 
 function print_sales_quotations()
 {
-       global $path_to_root, $print_as_quote, $print_invoice_no;
+       global $path_to_root, $print_as_quote, $print_invoice_no, $no_zero_lines_amount;
 
        include_once($path_to_root . "/reporting/includes/pdf_report.inc");
 
@@ -111,11 +111,14 @@ function print_sales_quotations()
                        $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))
index 2656e54450c7177905a6da82034bfe4f41e1ba50..9296a04cb028affccf837a62aac6118eb80a56d5 100644 (file)
@@ -19,8 +19,8 @@ if (!is_array($debtor_trans_no))
        $sql = "SELECT ".TB_PREF."debtor_trans_details.*,
                ".TB_PREF."debtor_trans_details.unit_price+".TB_PREF."debtor_trans_details.unit_tax AS FullUnitPrice,
                ".TB_PREF."debtor_trans_details.description As StockDescription,
-               ".TB_PREF."stock_master.units
-               FROM ".TB_PREF."debtor_trans_details,".TB_PREF."stock_master
+               ".TB_PREF."stock_master.units, ".TB_PREF."stock_master.mb_flag
+               FROM ".TB_PREF."debtor_trans_details, ".TB_PREF."stock_master
                WHERE (";
 
        $tr=array();
index 3785cb563b7e18d0b36ce15972c2955afbc71bf4..e4eaa5c15a4d69908b393cad61ea32a49e6feb6b 100644 (file)
@@ -327,8 +327,9 @@ function get_sales_order_details($order_no, $trans_type) {
                .TB_PREF."sales_order_details.quantity,
                  discount_percent,
                  qty_sent as qty_done, "
-               .TB_PREF."stock_master.units,
-               ".TB_PREF."stock_master.material_cost + "
+               .TB_PREF."stock_master.units,"
+               .TB_PREF."stock_master.mb_flag,"
+               .TB_PREF."stock_master.material_cost + "
                        .TB_PREF."stock_master.labour_cost + "
                        .TB_PREF."stock_master.overhead_cost AS standard_cost
        FROM ".TB_PREF."sales_order_details, ".TB_PREF."stock_master