Bonjour à tous,
J’utilise Dolibarr 18.0.2 - chez OVH - sur PHP 8.
J’ai déjà sorti des logs (cf ci-dessous) et je ne sais comment faire…
Lorsque j’ajoute un produit ayant une TVA par défaut à 20%, notre société est bien configurée comme assujetti à la TVA, l’acheteur aussi. Tous deux sont en France.
Je m’attends à un ajout avec la TVA par défaut du produit (soit 20%)
J’obtiens un ajout avec une TVA à 0%
Dans les logs, j’ai bien TVA à 20%: (get_product_vat_for_country: ret=20
)
ci-dessous quelques logs…
Form::load_cache_vatrates
2023-11-11 14:19:54 DEBUG 92.157.231.52 sql=SELECT DISTINCT t.rowid, t.code, t.taux, t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.recuperableonly FROM llx_c_tva as t, llx_c_country as c WHERE t.fk_pays = c.rowid AND t.active > 0 AND c.code IN ('FR') ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC
2023-11-11 14:19:54 INFO 92.157.231.52 get_default_tva: seller use vat=1, seller country=FR, seller in cee=1, buyer vat number=FR57839508728 buyer country=FR, buyer in cee=1, idprod=0, idprodfournprice=0, SERVICE_ARE_ECOMMERCE_200238EC=
2023-11-11 14:19:54 DEBUG 92.157.231.52 sql=SELECT t.taux as vat_rate, t.code as default_vat_code FROM llx_c_tva as t, llx_c_country as c WHERE t.active = 1 AND t.fk_pays = c.rowid AND c.code = 'FR' ORDER BY t.use_default DESC, t.taux DESC, t.code ASC, t.recuperableonly ASC LIMIT 1
2023-11-11 14:19:54 INFO 92.157.231.52 get_product_vat_for_country: ret=20
2023-11-11 14:19:54 DEBUG 92.157.231.52 DiscountAbsolute::fetch
2023-11-11 14:20:02 INFO 92.157.231.52 get_default_tva: seller use vat=1, seller country=FR, seller in cee=1, buyer vat number=FR57839508728 buyer country=FR, buyer in cee=1, idprod=193, idprodfournprice=0, SERVICE_ARE_ECOMMERCE_200238EC=
et ensuite j’ai ceci… où Facture::addline contient un taux de tva null…
2023-11-11 14:20:04 INFO 92.157.231.52 get_product_vat_for_country: ret=20.000
2023-11-11 14:20:04 INFO 92.157.231.52 Product::fetch id=193 ref= ref_ext=
2023-11-11 14:20:04 DEBUG 92.157.231.52 sql=SELECT p.rowid, p.ref, p.ref_ext, p.label, p.description, p.url, p.note_public, p.note as note_private, p.customcode, p.fk_country, p.fk_state, p.lifetime, p.qc_frequency, p.price, p.price_ttc, p.price_min, p.price_min_ttc, p.price_base_type, p.cost_price, p.default_vat_code, p.tva_tx, p.recuperableonly as tva_npr, p.localtax1_tx, p.localtax2_tx, p.localtax1_type, p.localtax2_type, p.tosell, p.tobuy, p.fk_product_type, p.duration, p.fk_default_warehouse, p.fk_default_workstation, p.seuil_stock_alerte, p.canvas, p.net_measure, p.net_measure_units, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units, p.barcode, p.fk_barcode_type, p.finished, p.fk_default_bom, p.mandatory_period, p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.pmp, p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.batch_mask, p.fk_unit, p.fk_price_expression, p.price_autogen, p.model_pdf, p.stock FROM llx_product as p WHERE p.rowid = 193
2023-11-11 14:20:04 INFO 92.157.231.52 get_localtax tva= local=1 thirdparty_buyer id=102/country_code=FR thirdparty_seller id=0/country_code=FR thirdparty_seller localtax1_assuj=0 thirdparty_seller localtax2_assuj=0
2023-11-11 14:20:04 INFO 92.157.231.52 get_localtax tva= local=2 thirdparty_buyer id=102/country_code=FR thirdparty_seller id=0/country_code=FR thirdparty_seller localtax1_assuj=0 thirdparty_seller localtax2_assuj=0
2023-11-11 14:20:04 DEBUG 92.157.231.52 Facture::addline id=519, pu_ht=380, qty=1, txtva=, txlocaltax1=0, txlocaltax2=0, fk_product=193, remise_percent=0, date_start=, date_end=, ventil=0, info_bits=0, fk_remise_except=, price_base_type=HT, pu_ttc=380, type=1, fk_unit=, desc=Journée d'un technici…
2023-11-11 14:20:04 DEBUG 92.157.231.52 BEGIN Transaction