Data import in sales invoice

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?

It is not possible to achieve this using the client script. I have already mentioned this in previous(same) discussions.

do u know where is the related code exactly? like what kind of doctype that i need to check