Sales invoice uploader

i want to create new doctype which it can importing sales invoice data from external document, and when i make checkbox called “create customer” and check it,
if the customer name doesn’t listed in master customer it would auto create new customer. I already make the new doctype can u help me with the rest like function in client-server script?

Not possible. I suggest first obtaining the list of customer not available in the customer master. Then import the unavailable customer master entries and proceed with importing the sales invoice.

Can u help me with the code then?

It’s not easy to develop the code, first, you have to check the import-related code and how it is defined and then you have to override the class/method in your custom app.