Tax included calculation problem when more than 1 tax type in a group
[fa-stable.git] / reporting / rep110.php
index a8fdbc4a6caae71abf175ab090c49b5b6d9d4ac8..9f418f7c712746a3e8b0aff0b725259638a3e5b3 100644 (file)
@@ -105,6 +105,9 @@ function print_deliveries()
                        $SubTotal = 0;
                        while ($myrow2=db_fetch($result))
                        {
+                               if ($myrow2["quantity"] == 0)
+                                       continue;
+                                       
                                $Net = round2(((1 - $myrow2["discount_percent"]) * $myrow2["unit_price"] * $myrow2["quantity"]),
                                   user_price_dec());
                                $SubTotal += $Net;
@@ -171,7 +174,7 @@ function print_deliveries()
                                if ($tax_item['included_in_price'])
                                {
                                                $rep->TextCol(3, 7, $doc_Included . " " . $tax_item['tax_type_name'] .
-                                                       " (" . $tax_item['rate'] . "%) " . $doc_Amount . ":" . $DisplayTax, -2);
+                                                       " (" . $tax_item['rate'] . "%) " . $doc_Amount . ": " . $DisplayTax, -2);
                                        }
                                else
                                {
@@ -187,6 +190,12 @@ function print_deliveries()
                                $rep->Font('bold');
                                $rep->TextCol(3, 6, $doc_TOTAL_DELIVERY, - 2);
                                $rep->TextCol(6, 7,     $DisplayTotal, -2);
+                               $words = price_in_words($myrow['Total'], ST_CUSTDELIVERY);
+                               if ($words != "")
+                               {
+                                       $rep->NewLine(1);
+                                       $rep->TextCol(1, 7, $myrow['curr_code'] . ": " . $words, - 2);
+                               }       
                                $rep->Font();
                        }       
                        if ($email == 1)