Sales Invoice Import Data

Hello,

I am doing sales invoice import through Data Import functionality, my requirement is if I already have the tax template set on Item group the sales and tax table should be populated, but it’s not, does any one have idea of this?

Data Import does not trigger all form events like manual Sales Invoice creation, so Item Group Tax Templates are not auto-populating the Taxes table during import.

  • Add the Sales Taxes and Charges Template directly in the import file, or

  • Run doc.set_missing_values() and doc.calculate_taxes_and_totals() through a custom hook/script before save.

Thanks for your response, can you let me know how I can run above thing in import functionality through server script?

Create a Server Script:

  • Script Type: Document Event

  • Reference Doctype: Sales Invoice

  • Event: Before Insert

Add this code:

doc.set_missing_values()
doc.calculate_taxes_and_totals()