From 08cf034e2f35db1ce6cc5e40e6e25606f6948426 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 May 2018 13:39:44 +0200 Subject: [PATCH] FIX to allow IRPF not null even if main VAT is null. From https://www.javierrguez.com/problema-facturas-irpf-sin-iva-dolibarr/ --- htdocs/core/lib/functions.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a22a9675ff6..78010725086 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4261,7 +4261,8 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller if ($local == 2) { - if (! $mysoc->localtax2_assuj || (string) $vatratecleaned == "0") return 0; + //if (! $mysoc->localtax2_assuj || (string) $vatratecleaned == "0") return 0; + if (! $mysoc->localtax2_assuj) return 0; // If main vat is 0, IRPF may be different than 0. if ($thirdparty_seller->id == $mysoc->id) { if (! $thirdparty_buyer->localtax2_assuj) return 0;