Hello,
I create some fields in sales invoice, and I want to use POS to send additional information for each invoice. I have edited the pos_payment.html, payments.js, and make a new interface as below. However, I don’t know how to make the value of the new fields sent to backend.
I have found that pos.js would invoke a method, called sync_sales_invoice, and it send me.si_docs as an argument to the function, make_invoice in pos.py, but I don’t know how to append the new field value to me.si_docs. Please help me. Thanks.
sync_sales_invoice: function () {
var me = this;
this.si_docs = this.get_submitted_invoice() || [];
this.email_queue_list = this.get_email_queue() || {};
this.customers_list = this.get_customers_details() || {};
if (this.si_docs.length || this.email_queue_list || this.customers_list) {
frappe.call({
method: "erpnext.accounts.doctype.sales_invoice.pos.make_invoice",
args: {
doc_list: me.si_docs,
email_queue_list: me.email_queue_list,
customers_list: me.customers_list
},
callback: function (r) {
if (r.message) {
me.removed_items = r.message.invoice;
me.removed_email = r.message.email_queue
me.removed_customers = r.message.customers
me.remove_doc_from_localstorage();
me.remove_email_queue_from_localstorage();
me.remove_customer_from_localstorage();
}
}
})
}
},