Posting Data from External Application to ERP Next

Hello,

We are trying to push data from our application to ERPNEXT. Data is received successfully on custom doctype, Our purpose is to use that data for the chart of accounts but we are unable to check that in our accounting tree.

Can anyone help me that what we are missing to finish this job?

Can you give more context of what kind of data you’re pushing?

Is the data getting updated if you enter it manually in that custom doctype?

Thank you so much for your prompt feedback brother.

We have basically tried to push the Sale price, Tax Value from our record. Atm, we have send that data through postman, and it’s fine for us to display it in custom doctype accounts. What our plan is to do is to get that data sales record in order to do accounting through erpnext.

Here we are getting data and then we submitted this manually,

And this is our custom doctype:

You will have to write additional code to create a journal entry or invoice on the creation of this document.

Check the documentation and forum on how to trigger invoice creation through python from another doctype.

That brings me to my next question, why aren’t you directly creating POS invoice or sales invoice from the API? That will directly allow you to post accounting entries on submission.

Yes, I have that option as well. Initially was trying to go with a customs document. Else I believe that I can edit the default Sales Invoice doctype or POS invoice Doctype.

Hello @kennethsequeira ,

I have done with posting data now I’m trying to use a custom script in which I want my ERP to submit invoices automatically when status==Draft. Below sample code for reference. Can you help me out in this case?

frappe.ui.form.on(‘Sales Invoice’, {
before_save(frm) {
if( status==‘Draft’ )
{
alert(‘Form is submitting…’);
document.getElementById(“form”).submit();
}
}
});

Kind Regards,
Saad