Hi community,
This is an example for getting a Sales Invoice via the REST API (version 4)
Thanks,
Pratik
erpnext
Hi community,
This is an example for getting a Sales Invoice via the REST API (version 4)
Pratik
erpnext
Hi community,
https://gist.github.com/pdvyas/03f6cd06364533e57280
This is an example for getting a Sales Invoice via the REST API (version 4)
Thanks,
-- he b
Pratik
erpnext
–
Note:
If you are posting an issue,
Thanks a lot Pratik for the help. But the problem is that i don’t know how
to login to the REST API let alone to retirive values from salesinvoice and
pass to a text file(part of integration).
Using the REST API requires no knowlege of the technology in ERPNext.
All that is required from the language/platform on which you’re
integrating on is sending HTTP request.
As you can see, you have to send an HTTP request to login and another
request to retrieve the sales invoice (using the cookies sent by the
server in the previous request).
I chose ERPNext because it is very
easy to use and most of the activities within it fits as our companies
requirement. Other wise i am totally new to it and also to the system that
hosts ERPNext for that matter (the frappe or the Ubunto OS). I am now going
to shift from Windows and its derivatives to yours system. I urge you to
show me how this is done at least ones please.
Thanks for choosing ERPNext. You can take help from the community to
implement your integration (if it’s not that urgent). Anyways, can you
share which language are you implementing your integration on? For
example, if it’s dot net, then someone from the community can help you
out. At Web Notes, we know only Python and Javascript.
Pratik
erpnext
Hi community,
https://gist.github.com/pdvyas/03f6cd06364533e57280
This is an example for getting a Sales Invoice via the REST API (version 4)
Thanks,
--
Pratik
erpnext
–
Note:
If you are posting an issue,
Hi Pratik,Let me try to make this very simple.I created a custom button called Print to POS. Now when the casheir at the client machine clicks this button, it should collect some information from the invoice (like customer name, address, Tin no, Item code, Item name, Quantity,price, discount, vat etc) and write to a text file on a client machine let say to a destination D:\POSfolder\posfile.txt. After that the POS software installed on the client machine handles the printing of the Sales invoice as well as a slip from the POS machine attached to the client computer. This is phase one. let us try to handle this scenarioThankskhalid
On Monday, May 26, 2014 12:15:08 PM UTC+3, Pratik Vyas wrote:Hi community,
https://gist.github.com/pdvyas/03f6cd06364533e57280
This is an example for getting a Sales Invoice via the REST API (version 4)
Thanks,
--
Pratik
erpnext–
Note:
If you are posting an issue,
- We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
- Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
- For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
End of Note
—
You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/3a950d62-8fe7-4366-aef2-b7ea9c260e07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
–
Note:
If you are posting an issue,
Hi community,
https://gist.github.com/pdvyas/03f6cd06364533e57280
This is an example for getting a Sales Invoice via the REST API (version 4)
Thanks,
--
Pratik
erpnext
–
Note:
If you are posting an issue,
Hi Rushab,we all know that it is possible to put a button on a sales invoice or any doctype for that matter ya, but isn't it possible to write some script on the buttons click event?
On Monday, May 26, 2014 12:15:08 PM UTC+3, Pratik Vyas wrote:Hi community,
https://gist.github.com/pdvyas/03f6cd06364533e57280
This is an example for getting a Sales Invoice via the REST API (version 4)
Thanks,
--
Pratik
erpnext–
Note:
If you are posting an issue,
- We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
- Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
- For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
End of Note
—
You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/cdaa6d4b-aee2-4ac4-8fe3-7f184c806926%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
–
Note:
If you are posting an issue,
Hi community,
https://gist.github.com/pdvyas/03f6cd06364533e57280
This is an example for getting a Sales Invoice via the REST API (version 4)
Thanks,
--
Pratik
erpnext
–
Note:
If you are posting an issue,
Ay example on how to post a sales invoice from another invoice system to ERP NEXT. Am working on a project to integrate my point of sales system with ERPNEXt using the web api. So far am abl to do customer not i want to do sales invoice but am getting this error: Error: Data missing in table: Items
'Sync credit invoice
Dim jinvoiceheader As New InvoiceHeaderManager
Dim jihlist As List(Of InvoiceHeader) = jinvoiceheader.InvoiceHeaderData(“U”)
'ERP Next Object
Dim new_erp_salesinvoice As New ERPObject(DocType.SalesInvoice)
'insert invoice header from database
For Each joogleinvoice In jihlist
With joogleinvoice
new_erp_salesinvoice.Data.title = jihlist(0).customerid
new_erp_salesinvoice.Data.naming_series = "SINV"
new_erp_salesinvoice.Data.name = "SINV" & jihlist(0).invoicenumber
new_erp_salesinvoice.Data.customer_name = jihlist(0).customerid
new_erp_salesinvoice.Data.is_pos = 0
new_erp_salesinvoice.Data.is_return = 0
'new_erp_salesinvoice.Data.offline_pos_name
new_erp_salesinvoice.Data.posting_date = jihlist(0).invoicedate
new_erp_salesinvoice.Data.due_date = jihlist(0).duedate
'new_erp_salesinvoice.Link.company
new_erp_salesinvoice.Data.selling_price_list = "Standard Selling"
new_erp_salesinvoice.Data.price_list_currency = "JMD"
new_erp_salesinvoice.Data.total_billing_amount = 0
new_erp_salesinvoice.Data.base_total = jihlist(0).subtotal
new_erp_salesinvoice.Data.base_net_total = jihlist(0).subtotal
new_erp_salesinvoice.Data.net_total = jihlist(0).subtotal
new_erp_salesinvoice.Data.total = jihlist(0).subtotal
'new_erp_salesinvoice.Table.taxes
new_erp_salesinvoice.Data.base_total_taxes_and_charges = jihlist(0).tax
new_erp_salesinvoice.Data.total_taxes_and_charges = jihlist(0).tax
new_erp_salesinvoice.Data.apply_discount_on = "Grand Total"
'new_erp_salesinvoice.Data.base_discount_amount
'new_erp_salesinvoice.Float.additional_discount_percentage
'new_erp_salesinvoice.Currency.discount_amount
new_erp_salesinvoice.Data.base_grand_total = jihlist(0).invoiceamount
new_erp_salesinvoice.Data.base_rounded_total = jihlist(0).invoiceamount
'new_erp_salesinvoice.Data.base_in_words
new_erp_salesinvoice.Data.grand_total = jihlist(0).invoiceamount
new_erp_salesinvoice.Data.rounded_total = jihlist(0).invoiceamount
'new_erp_salesinvoice.Data.in_words
'new_erp_salesinvoice.Currency.total_advance = 0
'new_erp_salesinvoice.Currency.outstanding_amount
'new_erp_salesinvoice.Button.get_advances
'new_erp_salesinvoice.Table.advances
'new_erp_salesinvoice.Link.cash_bank_account
'new_erp_salesinvoice.Table.payments
'new_erp_salesinvoice.Currency.base_paid_amount
'new_erp_salesinvoice.Currency.paid_amount
'new_erp_salesinvoice.Currency.base_change_amount
'new_erp_salesinvoice.Currency.change_amount
new_erp_salesinvoice.Data.account_for_change_amount = "Cash - CPXZ"
'new_erp_salesinvoice.Check.write_off_outstanding_amount_automatically
new_erp_salesinvoice.Data.source = "Joogle API"
new_erp_salesinvoice.Data.debit_to = "Debtors - CPXZ"
new_erp_salesinvoice.Data.against_income_account = "Sales - CPXZ"
new_erp_salesinvoice.Data.joogle_invoice_number = jihlist(0).invoicenumber
new_erp_salesinvoice.Data.import_status = "U"
End With
client.InsertObject(new_erp_salesinvoice)
Next
Any help with inserting the sales invoice, then submitted. Am not using the GitHub - gizmofort/gizmofort.connector.erpnext: Simple C# REST API for ERPNext API in C# but am not seeing the submit function.
Yes it work
I used the onsubmit = 1 and docstatus = 1 in the api.
For Each joogleinvoice In openjihlist
With joogleinvoice
Dim jihlist As List(Of MainRecieptDetailMaster) = jinvoiceheader.GetAllInvoiceDetail(openjihlist(0).invoicenumber)
Dim jinvoicelist As List(Of InvoiceDetail) = invoicedetailjm.InvoiceDetailData(openjihlist(0).invoicenumber, jaccountsetup_Sales(0).iaccountname, jaccountsetup_Main(0).iaccountname, jaccountsetup_COGS(0).iaccountname, jaccountsetup_Margin(0).type, jaccountsetup_Sales(0).iaccountname)
Dim jinvoicepayment As List(Of InvoicePaymentMaster) = invoicepaymentjm.ShowPaymentERPNEXT(openjihlist(0).invoicenumber)
currentinvoicenumber = openjihlist(0).invoicenumber
new_erp_salesinvoice.Data.items = jinvoicelist
new_erp_salesinvoice.Data.title = jihlist(0).invoicenumber & "-" & jihlist(0).companyname & "-" & jihlist(0).invoicedate
new_erp_salesinvoice.Data.naming_series = "SINV-"
new_erp_salesinvoice.Data.name = "SINV-" & jihlist(0).invoicenumber
new_erp_salesinvoice.Data.customer_name = jihlist(0).companyname
new_erp_salesinvoice.Data.customer = jihlist(0).companyname
new_erp_salesinvoice.Data.is_pos = 1
new_erp_salesinvoice.Data.is_return = 0
new_erp_salesinvoice.Data.update_stock = 1
new_erp_salesinvoice.Data.offline_pos_name = "SINV-" & jihlist(0).invoicenumber
new_erp_salesinvoice.Data.posting_date = jihlist(0).invoicedate
new_erp_salesinvoice.Data.due_date = jihlist(0).duedate
new_erp_salesinvoice.Data.selling_price_list = "Standard Selling" 'jihlist(0).pricelist
new_erp_salesinvoice.Data.price_list_currency = defaultcustomervar(0).currency
'defaultcustomervar(0).currency
new_erp_salesinvoice.Data.total_billing_amount = jihlist(0).invoicetotal
new_erp_salesinvoice.Data.base_total = jihlist(0).subtotal
new_erp_salesinvoice.Data.base_net_total = jihlist(0).subtotal
new_erp_salesinvoice.Data.net_total = jihlist(0).subtotal
new_erp_salesinvoice.Data.total = jihlist(0).subtotal
new_erp_salesinvoice.Data.taxes = jtax
new_erp_salesinvoice.Data.taxes_and_charges = "GCT" 'jihlist(0).tax1name
new_erp_salesinvoice.Data.total_taxes_and_charges = jihlist(0).tax
new_erp_salesinvoice.Data.apply_discount_on = "Net Total"
new_erp_salesinvoice.Data.payments = jinvoicepayment
new_erp_salesinvoice.Data.account_for_change_amount = jaccountsetup_Cash(0).iaccountname
new_erp_salesinvoice.Data.debit_to = jaccountsetup_Debtors(0).iaccountname
new_erp_salesinvoice.Data.against_income_account = jaccountsetup_Sales(0).iaccountname
new_erp_salesinvoice.Data.import_status = "P"
new_erp_salesinvoice.Data.status = "Paid"
new_erp_salesinvoice.Data.submit_on_creation = 1
new_erp_salesinvoice.Data.joogle_invoice = jihlist(0).invoicenumber
new_erp_salesinvoice.Data.docstatus = 1
End With
client.InsertObject(new_erp_salesinvoice)
Thank i’ll try it in C#.
Hello ,
Any example for creating sales invoice items object for gizmofort.connector.erpnext use ?
Yes…But only in VB. you will have to convert you code
Public Function synerp()
Try
If CheckForInternetConnection() = True Then
Else
Dim setapploger As New AppLogerMaster With {.description = "Unable to reach ERP Please check you internet or contact support.",
.documentno = 0,
.logdate = Date.Now,
.modulename = "Joogle ERP Connection",
.recordrecived = 0,
.status = "Not Connected",
.recordsent = 0}
Dim setapplogervar As New AppLogerManager
setapplogervar.AddApp(setapploger)
Exit Function
End If
'Connect to ERP over web API
Dim client = New ERPNextClient(itemmastersetting(0).webapiurl, session.emailaddress, (epasswordvar.Decrypt(session.password.Trim())))
Dim new_erp_salesinvoice As New ERPObject(DocType.SalesInvoice)
Dim openjihlist As List(Of InvoiceHeader) = jinvoiceheader.InvoiceHeaderData("")
If openjihlist.Count > 0 Then
'Do Until openjihlist.Count = 0
' Exit Do
'Loop
Dim getgetcompany As New InvoiceTotal
Dim setprintcompany As List(Of InvoiceTotalMaster) = getgetcompany.GetItemCompany(openjihlist(0).invoicenumber)
If setprintcompany.Count = 1 Then
Dim jaccountsetup_Sales As List(Of AccountingSetupMaster) = inv_account.GetAccountSetupAction("ERPCredit", "PointOfSales", "Auto", setprintcompany(0).company)
Dim jaccountsetup_Cash As List(Of AccountingSetupMaster) = inv_account.GetAccountSetupAction("PaymentCredit", "Payment", "Manual", setprintcompany(0).company)
Dim jaccountsetup_Main As List(Of AccountingSetupMaster) = inv_account.GetAccountSetupAction("CC", "ERP", "Manual", setprintcompany(0).company)
Dim jaccountsetup_COGS As List(Of AccountingSetupMaster) = inv_account.GetAccountSetupAction("COGS", "PointOfSales", "Auto", setprintcompany(0).company)
Dim jaccountsetup_Margin As List(Of AccountingSetupMaster) = inv_account.GetAccountSetupAction("MarginType", "PointOfSales", "Auto", setprintcompany(0).company)
Dim jerptaxaccountlist As List(Of AccountingSetupMaster) = inv_account.GetERPTaxInfo("ERPTax")
Dim jtax As List(Of InvoiceHeader) = jinvoiceheader.ERpTaxCalculater(openjihlist(0).invoicenumber, jerptaxaccountlist(0).iaccountname, jerptaxaccountlist(0).appmodule, jerptaxaccountlist(0).accountname, 0, jerptaxaccountlist(0).description)
Dim jaccountsetup_Debtors As List(Of AccountingSetupMaster) = inv_account.GetAccountSetupAction("ERPDebit", "PointOfSales", "Auto", setprintcompany(0).company)
'CUSTOMER SETTING
Dim defaultcustomervar As List(Of CustomerMaster) = customeridentity.FindCustomer(session.location, session.customerid)
For Each joogleinvoice In openjihlist
With joogleinvoice
Dim jihlist As List(Of MainRecieptDetailMaster) = jinvoiceheader.GetAllInvoiceDetail(openjihlist(0).invoicenumber)
Dim jinvoicelist As List(Of InvoiceDetail) = invoicedetailjm.InvoiceDetailData(openjihlist(0).invoicenumber, jaccountsetup_Sales(0).iaccountname, jaccountsetup_Main(0).iaccountname, jaccountsetup_COGS(0).iaccountname, jaccountsetup_Margin(0).type, jaccountsetup_Sales(0).iaccountname)
Dim jinvoicepayment As List(Of InvoicePaymentMaster) = invoicepaymentjm.ShowPaymentERPNEXT(openjihlist(0).invoicenumber)
currentinvoicenumber = openjihlist(0).invoicenumber
new_erp_salesinvoice.Data.items = jinvoicelist
new_erp_salesinvoice.Data.title = jihlist(0).invoicenumber & "-" & jihlist(0).companyname & "-" & jihlist(0).invoicedate
new_erp_salesinvoice.Data.naming_series = "SINV-"
new_erp_salesinvoice.Data.name = "SINV-" & jihlist(0).invoicenumber
new_erp_salesinvoice.Data.customer_name = jihlist(0).companyname
new_erp_salesinvoice.Data.customer = jihlist(0).companyname
new_erp_salesinvoice.Data.is_pos = 1
new_erp_salesinvoice.Data.is_return = 0
new_erp_salesinvoice.Data.update_stock = 1
new_erp_salesinvoice.Data.offline_pos_name = "SINV-" & jihlist(0).invoicenumber
new_erp_salesinvoice.Data.posting_date = jihlist(0).invoicedate
new_erp_salesinvoice.Data.due_date = jihlist(0).duedate
'new_erp_salesinvoice.Data.selling_price_list = "Standard Selling" 'jihlist(0).pricelist
new_erp_salesinvoice.Data.price_list_currency = defaultcustomervar(0).currency
'defaultcustomervar(0).currency
new_erp_salesinvoice.Data.total_billing_amount = jihlist(0).invoicetotal
new_erp_salesinvoice.Data.base_total = jihlist(0).subtotal
new_erp_salesinvoice.Data.base_net_total = jihlist(0).subtotal
new_erp_salesinvoice.Data.net_total = jihlist(0).subtotal
new_erp_salesinvoice.Data.total = jihlist(0).subtotal
new_erp_salesinvoice.Data.taxes = jtax
new_erp_salesinvoice.Data.taxes_and_charges = "GCT" 'jihlist(0).tax1name
new_erp_salesinvoice.Data.total_taxes_and_charges = jihlist(0).tax
new_erp_salesinvoice.Data.apply_discount_on = "Net Total"
new_erp_salesinvoice.Data.base_discount_amount = jihlist(0).customersaving
new_erp_salesinvoice.Data.payments = jinvoicepayment
new_erp_salesinvoice.Data.account_for_change_amount = jaccountsetup_Cash(0).iaccountname
new_erp_salesinvoice.Data.debit_to = jaccountsetup_Debtors(0).iaccountname
new_erp_salesinvoice.Data.against_income_account = jaccountsetup_Sales(0).iaccountname
new_erp_salesinvoice.Data.import_status = "P"
new_erp_salesinvoice.Data.status = "Paid"
new_erp_salesinvoice.Data.submit_on_creation = 1
new_erp_salesinvoice.Data.joogle_invoice = jihlist(0).invoicenumber
new_erp_salesinvoice.Data.docstatus = 1
End With
client.InsertObject(new_erp_salesinvoice)
'Dim update_erp_salesinvoice As New ERPObject(DocType.SalesInvoice)
'update_erp_salesinvoice.Data.status = "Paid"
'client.UpdateObject(update_erp_salesinvoice)
'Dim update_erp_salesinvoice As New ERPObject(DocType.SalesInvoice)
'update_erp_salesinvoice.Data.status = "Paid"
'client.UpdateObject(update_erp_salesinvoice)
jinvoiceheader.UpdateInvoiceStatus(openjihlist(0).invoicenumber)
invoicedetailjm.UpdateInvoiceStatus(openjihlist(0).invoicenumber)
'client.UpdateObject()
Next
'For Each openinvoice In openjihlist
'Next
'client.Dispose()
Dim setapploger As New AppLogerMaster With {.description = "Invoice data upload successfull.",
.documentno = 0,
.logdate = Date.Now,
.modulename = "Joogle ERP Invoice",
.recordrecived = 0,
.status = "Success",
.recordsent = openjihlist.Count}
Dim setapplogervar As New AppLogerManager
setapplogervar.AddApp(setapploger)
End If
Else
Dim setapploger As New AppLogerMaster With {.description = "No Data to Upload.",
.documentno = 0,
.logdate = Date.Now,
.modulename = "Joogle ERP Invoice",
.recordrecived = 0,
.status = "No Data",
.recordsent = openjihlist.Count}
Dim setapplogervar As New AppLogerManager
setapplogervar.AddApp(setapploger)
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Invoice not upload. Error in data")
Dim setapploger As New AppLogerMaster With {.description = ex.Message,
.documentno = currentinvoicenumber,
.logdate = Date.Now,
.modulename = "Joogle ERP Invoice",
.recordrecived = 0,
.status = "Error",
.recordsent = 0}
Dim setapplogervar As New AppLogerManager
setapplogervar.AddApp(setapploger)
jinvoiceheader.UpdateFailmporttatus(currentinvoicenumber)
invoicedetailjm.UpdateFailInvoiceStatus(currentinvoicenumber)
End Try
End Function
Hello Everyone,
Am working on extending the DocType for GizmoFort.Connector.ERPNext to include all major DocTypes for integration. This can be in C# and VB.net I will do a Java wraper for user with android integration need. The new code will be post in the orignal github for GitHub - gizmofort/gizmofort.connector.erpnext: Simple C# REST API for ERPNext. If anyone need a new Doctype before am finish please let me know.
Thanks to gizmofort · GitHub for creating the orignal code
Integrating your point-of-sale (POS) system with ERPNext using the web API to post sales invoices requires ensuring that ERPNext recognizes the items listed in your invoices. Here’s how to tackle the “Data missing in table: Items” error:
The Issue:
ERPNext throws this error if it can’t find the items in your sales invoices within its own item database. This could be because:
Missing Items: The items haven’t been created in ERPNext yet.
Incorrect Mapping: The item names or identifiers from your POS system don’t match ERPNext’s.
Solutions:
Pre-Create Items: Create the necessary items in ERPNext first, providing details like names, descriptions, stock information (if applicable), and sales taxes. You can do this manually or automate it with a script based on your POS system’s item data.
Map Item IDs/Names: If creating items beforehand isn’t feasible, establish a mapping between your invoice maker item IDs or names and their corresponding identifiers in ERPNext. Modify your sales invoice data to use the identifiers that ERPNext recognizes.
Error Handling (Optional): If pre-creation or mapping isn’t ideal, consider error handling in your integration script. When it encounters the “Items” error, it can identify the missing items, attempt to create them in ERPNext (if allowed), or log the issue for manual intervention. This way, you can resume processing successful invoices or retry failed ones after fixing the missing item problem.