Rewritten sales shipping cost taxation, improved shipping cost handling in sales...
[fa-stable.git] / reporting / rep111.php
index a8c779271d0277903a0ccd0955ec15790e2b415b..49096e4a9aa055aba8fa1c021a2faae015616641 100644 (file)
@@ -94,6 +94,10 @@ function print_sales_quotations()
                $result = get_sales_order_details($i, ST_SALESQUOTE);
                $SubTotal = 0;
                $items = $prices = array();
+               if ($myrow["ship_via"]) {
+                       $items[] = $myrow["ship_via"];
+                       $prices[] = $myrow["freight_cost"];
+               }
                while ($myrow2=db_fetch($result))
                {
                        $Net = round2(((1 - $myrow2["discount_percent"]) * $myrow2["unit_price"] * $myrow2["quantity"]),
@@ -165,8 +169,7 @@ function print_sales_quotations()
                        $rep->NewLine();
                }
 
-               $tax_items = get_tax_for_items(ST_SALESORDER, $items, $prices, $myrow["freight_cost"],
-                 $myrow['tax_group_id'], $myrow['tax_included']);
+               $tax_items = get_tax_for_items(ST_SALESORDER, $items, $prices, $myrow['tax_group_id'], $myrow['tax_included']);
                $first = true;
                foreach($tax_items as $tax_item)
                {