Hello Everyone,
I am working on POS Customisation and added 1 custom field on point_of_sale.js. which looks like this.
i want to send the Remarks Data in Sales Invoice custom field Named as “POS Remarks” . How should i ?
can anyonw help with this ?
rmeyer
February 10, 2019, 3:58pm
2
From JavaScript, call this.frm.set_value('remark', 'This is my remark');
For my custom POS I use a different architecture and create the invoice server-side in Python:
def submit_sales_invoice(cart, amount=0, company=''):
settings = frappe.get_doc('Simple POS Settings')
defaults = frappe.defaults.get_defaults()
if not company:
company = defaults.get('company')
cart = json.loads(cart)
# items doctype: Sales Invoice Item
items = [{'qty': qty, 'item_code': code} for code, qty in cart.items()]
sinv = frappe.get_doc({
'doctype': 'Sales Invoice',
'company': company,
# 'selling_price_list': defaults.get('selling_price_list'),
'is_pos': 1,
'pos_profile': settings.get('pos_profile'),
'items': items,
'payments': [
# doctype: Sales Invoice Payment
{
This file has been truncated. show original
Here you’d have to add an argument “remark” to the function and pass that command from JavaScript.
1 Like
Thanks for the reply @rmeyer
I can push the String to the custom field like you said here this.frm.set_value(‘remark’, ‘This is my remark’);. But how can i push dynamic data that i enter in remarks field in popup ?
rmeyer
February 13, 2019, 11:26am
4
If by popup you mean the payment modal, check this:
{
fieldtype: 'Currency',
label: __("Write off Amount"),
options: me.frm.doc.currency,
fieldname: "write_off_amount",
default: me.frm.doc.write_off_amount,
onchange: () => {
me.update_cur_frm_value('write_off_amount', () => {
frappe.flags.change_amount = false;
me.update_change_amount();
});
}
},
Inside the onchange
function you can set the value.
Thanks For Your Response @rmeyer
I have completed this task
I have the same problem to continue without solving
how you make these i try to make custom field in pos page but i can not start do these