From: Joe Hunt Date: Tue, 17 Jan 2012 09:13:16 +0000 (+0100) Subject: Do not print zero lines amount of 0.00 in Sales Documents if service item, $no_zero_l... X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=237ab9849cc72845aa348d958ef0f6fb56de9aac;p=textcart.git Do not print zero lines amount of 0.00 in Sales Documents if service item, $no_zero_lines_amount. 1 = do not --- diff --git a/config.default.php b/config.default.php index 9bc4dae..161fec2 100644 --- a/config.default.php +++ b/config.default.php @@ -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; diff --git a/reporting/rep107.php b/reporting/rep107.php index 62dc0f2..5e044f2 100644 --- a/reporting/rep107.php +++ b/reporting/rep107.php @@ -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)) diff --git a/reporting/rep109.php b/reporting/rep109.php index 51697c3..c8b4a1e 100644 --- a/reporting/rep109.php +++ b/reporting/rep109.php @@ -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)) diff --git a/reporting/rep110.php b/reporting/rep110.php index 4b4fec8..7b9318d 100644 --- a/reporting/rep110.php +++ b/reporting/rep110.php @@ -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); diff --git a/reporting/rep111.php b/reporting/rep111.php index 07fbd41..2662fca 100644 --- a/reporting/rep111.php +++ b/reporting/rep111.php @@ -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)) diff --git a/sales/includes/db/cust_trans_details_db.inc b/sales/includes/db/cust_trans_details_db.inc index 2656e54..9296a04 100644 --- a/sales/includes/db/cust_trans_details_db.inc +++ b/sales/includes/db/cust_trans_details_db.inc @@ -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(); diff --git a/sales/includes/db/sales_order_db.inc b/sales/includes/db/sales_order_db.inc index 3785cb5..e4eaa5c 100644 --- a/sales/includes/db/sales_order_db.inc +++ b/sales/includes/db/sales_order_db.inc @@ -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