From d28cc3a74962b8b5e5eaf52414b7fc66002fbe9b Mon Sep 17 00:00:00 2001 From: glushenkogw1990 Date: Thu, 4 May 2017 02:37:59 +0300 Subject: [PATCH] Addition to the generation of VAT and unit measurements fix --- MoySkladICMLParser.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MoySkladICMLParser.php b/MoySkladICMLParser.php index 8d038a5..814c71c 100644 --- a/MoySkladICMLParser.php +++ b/MoySkladICMLParser.php @@ -334,10 +334,10 @@ class MoySkladICMLParser $products[$assortiment['id']]['unit'] =''; } - if (isset($assortiment['effectiveVat'])){ - $products[$assortiment['id']]['effectiveVat'] = (string) $assortiment['effectiveVat']; - } elseif (isset($assortiment['product']['effectiveVat'])){ - $products[$assortiment['id']]['effectiveVat'] = (string) $assortiment['product']['effectiveVat']; + if (isset($assortiment['effectiveVat']) && $assortiment['effectiveVat'] != 0){ + $products[$assortiment['id']]['effectiveVat'] = $assortiment['effectiveVat']; + } elseif (isset($assortiment['product']['effectiveVat']) && $assortiment['product']['effectiveVat'] != 0){ + $products[$assortiment['id']]['effectiveVat'] = $assortiment['product']['effectiveVat']; } else { $products[$assortiment['id']]['effectiveVat'] = 'none'; }