Item discount amount lost in billing amount

When creating sales order to sales invoice , the item discount shows correctly,
but on the customer billing it shows the full amount without discount.
When doing a direct sales invoice without a sales order , the billing is correct.
Is it a setting in ERPNEXT i’m missing or bug.

Anyone with the same issue.
Any help is much appreciated

ERPNEXT V13.22.1