Afshan
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
2 deletions
-
erpnext/selling/page/point_of_sale/pos_item_cart.js
|
|
@ -367,15 +367,16 @@ erpnext.PointOfSale.ItemCart = class { |
|
|
|
`<div class="add-discount-field"></div>` |
|
|
|
); |
|
|
|
const me = this; |
|
|
|
const frm = me.events.get_frm(); |
|
|
|
let discount = frm.doc.additional_discount_percentage; |
|
|
|
|
|
|
|
this.discount_field = frappe.ui.form.make_control({ |
|
|
|
df: { |
|
|
|
label: __('Discount'), |
|
|
|
fieldtype: 'Data', |
|
|
|
placeholder: __('Enter discount percentage.'), |
|
|
|
placeholder: ( discount ? discount + '%' : __('Enter discount percentage.') ), |
|
|
|
input_class: 'input-xs', |
|
|
|
onchange: function() { |
|
|
|
const frm = me.events.get_frm(); |
|
|
|
if (flt(this.value) != 0) { |
|
|
|
frappe.model.set_value(frm.doc.doctype, frm.doc.name, 'additional_discount_percentage', flt(this.value)); |
|
|
|
me.hide_discount_control(this.value); |
|
|
|