diff --git a/uc_taxes.module b/uc_taxes.module
index fab79e1..e8ceb9c 100644
--- a/uc_taxes.module
+++ b/uc_taxes.module
@@ -539,7 +539,15 @@ function uc_taxes_apply_tax($order, $tax) {
       $taxable_amount += uc_taxes_apply_item_tax($item, $tax);
     }
   }
-  $taxed_line_items = $tax->taxed_line_items;
+
+  //$taxable_amount is inclusive of VAT if uc_vat module installed and enabled (due to uc_price alter in uc_vat and as patch #898776-9 was applied to ubercart 6.x-2.6)
+  if (module_exists('uc_vat')) {   
+  	$amount = $taxable_amount - ($taxable_amount / (1 + $tax->rate));
+  }
+  else {
+  	$taxed_line_items = $tax->taxed_line_items;
+  }
+
   if (is_array($order->line_items) && is_array($taxed_line_items)) {
     foreach ($order->line_items as $key => $line_item) {
       if ($line_item['type'] == 'tax') {
