X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep109.php;h=d6ed21e245b36e1e81f8bc0f5a7e5ea2e6924130;hb=927ebef2443b6dda544056e33ec84b71d2bdb6c2;hp=b5acbab7050552482d353ebcc2ee41f06b4e39f4;hpb=6a4d8e6c1e92ff1b8fc5abb3fae76fb1c1968550;p=fa-stable.git diff --git a/reporting/rep109.php b/reporting/rep109.php index b5acbab7..d6ed21e2 100644 --- a/reporting/rep109.php +++ b/reporting/rep109.php @@ -29,11 +29,9 @@ include_once($path_to_root . "/taxes/tax_calc.inc"); print_sales_orders(); -$print_as_quote = 0; - function print_sales_orders() { - global $path_to_root, $print_as_quote, $no_zero_lines_amount; + global $path_to_root, $SysPrefs; include_once($path_to_root . "/reporting/includes/pdf_report.inc"); @@ -83,18 +81,27 @@ function print_sales_orders() $rep->Font(); if ($print_as_quote == 1) { - $rep->title = _('QUOTE'); - $rep->filename = "Quote" . $i . ".pdf"; + $rep = new FrontReport("", "", user_pagesize(), 9, $orientation); + if ($print_as_quote == 1) + { + $rep->title = _('QUOTE'); + $rep->filename = "Quote" . $i . ".pdf"; + } + else + { + $rep->title = _("SALES ORDER"); + $rep->filename = "SalesOrder" . $i . ".pdf"; + } } else - { - $rep->title = _("SALES ORDER"); - $rep->filename = "SalesOrder" . $i . ".pdf"; - } + $rep->title = ($print_as_quote==1 ? _("QUOTE") : _("SALES ORDER")); + $rep->currency = $cur; + $rep->Font(); $rep->Info($params, $cols, null, $aligns); - $contacts = get_branch_contacts($branch['branch_code'], 'order', $branch['debtor_no'], false); + $contacts = get_branch_contacts($branch['branch_code'], 'order', $branch['debtor_no'], true); $rep->SetCommonData($myrow, $branch, $myrow, $baccount, ST_SALESORDER, $contacts); + $rep->SetHeaderType('Header2'); $rep->NewPage(); $result = get_sales_order_details($i, ST_SALESORDER); @@ -119,7 +126,7 @@ function print_sales_orders() $rep->TextColLines(1, 2, $myrow2['description'], -2); $newrow = $rep->row; $rep->row = $oldrow; - if ($Net != 0.0 || !is_service($myrow2['mb_flag']) || !isset($no_zero_lines_amount) || $no_zero_lines_amount == 0) + if ($Net != 0.0 || !is_service($myrow2['mb_flag']) || !$SysPrefs->no_zero_lines_amount()) { $rep->TextCol(2, 3, $DisplayQty, -2); $rep->TextCol(3, 4, $myrow2['units'], -2); @@ -170,7 +177,7 @@ function print_sales_orders() if ($myrow['tax_included']) { - if (isset($alternative_tax_include_on_docs) && $alternative_tax_include_on_docs == 1) + if ($SysPrefs->alternative_tax_include_on_docs() == 1) { if ($first) { @@ -216,4 +223,3 @@ function print_sales_orders() $rep->End(); } -?> \ No newline at end of file