Browse Source

Ignore useless invoice lines

Dolibarr allows to group invoice lines under a title (actually, there can
be up to 9 levels of title/subtitle/etc).

Unfortunately, the title of each group appears in the database as a
legitimate invoice line, so it gets imported by himport even though it
does not make any sense.

This patch ignores these "fake" invoice lines by filtering on the
'special_code' column.
Baptiste Jonglez 6 years ago
parent
commit
edfbb64242
1 changed files with 4 additions and 0 deletions
  1. 4 0
      himport/dolibarrAlchemyHledger.py

+ 4 - 0
himport/dolibarrAlchemyHledger.py

@@ -483,6 +483,8 @@ class HledgerSellEntry(HledgerBillingEntry):
         if self.tva_type == 'none':
             for ed in e.details:
                 p_code = self.get_product_account_code(ed)
+                if ed.special_code == 104777:
+                    continue
 
                 s += "    %(compte_produit)s   %(amount_ttc)s\n" % {
                     'compte_produit': settings.get_ledger_account(p_code),
@@ -491,6 +493,8 @@ class HledgerSellEntry(HledgerBillingEntry):
         else:
             for ed in e.details:
                 p_code = self.get_product_account_code(ed)
+                if ed.special_code == 104777:
+                    continue
 
                 s += "    %(compte_produit)s   %(amount_ht)s\n" % {
                     'compte_produit': settings.get_ledger_account(p_code),