Merge pull request #5490 from rohitwaghchaure/pos_testing_fix
[POS] Minor fixes
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.js b/erpnext/accounts/doctype/pricing_rule/pricing_rule.js
index 70c0397..356f11b 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.js
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.js
@@ -93,4 +93,10 @@
//Dynamically change the description based on type of margin
cur_frm.cscript.type = function(doc){
cur_frm.set_df_property('rate', 'description', doc.type=='Percentage'?'In Percentage %':'In Amount')
-}
\ No newline at end of file
+}
+
+frappe.ui.form.on('Pricing Rule', 'price_or_discount', function(frm){
+ if(frm.doc.price_or_discount == 'Price') {
+ frm.set_value('for_price_list', "")
+ }
+})
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.py b/erpnext/accounts/doctype/sales_invoice/pos.py
index 54d47b5..ec0e50c 100644
--- a/erpnext/accounts/doctype/sales_invoice/pos.py
+++ b/erpnext/accounts/doctype/sales_invoice/pos.py
@@ -134,12 +134,14 @@
return customer_list
def get_pricing_rules(doc):
+ pricing_rules = ""
if doc.ignore_pricing_rule == 0:
- return frappe.db.sql(""" Select * from `tabPricing Rule` where docstatus < 2 and disable = 0
- and selling = 1 and ifnull(company, '') in (%(company)s, '') and
- ifnull(for_price_list, '') in (%(price_list)s, '') and %(date)s between
- ifnull(valid_from, '2000-01-01') and ifnull(valid_upto, '2500-12-31') order by priority desc, name desc""",
- {'company': doc.company, 'price_list': doc.selling_price_list, 'date': nowdate()}, as_dict=1)
+ pricing_rules = frappe.db.sql(""" Select * from `tabPricing Rule` where docstatus < 2 and disable = 0
+ and selling = 1 and ifnull(company, '') in (%(company)s, '') and
+ ifnull(for_price_list, '') in (%(price_list)s, '') and %(date)s between
+ ifnull(valid_from, '2000-01-01') and ifnull(valid_upto, '2500-12-31') order by priority desc, name desc""",
+ {'company': doc.company, 'price_list': doc.selling_price_list, 'date': nowdate()}, as_dict=1)
+ return pricing_rules
@frappe.whitelist()
def make_invoice(doc_list):
diff --git a/erpnext/accounts/page/pos/pos_page.html b/erpnext/accounts/page/pos/pos_page.html
deleted file mode 100644
index 5a4c538..0000000
--- a/erpnext/accounts/page/pos/pos_page.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<div class="text-center" style="padding: 40px;">
- <img src="/assets/erpnext/images/pos.svg"
- style="width: 100px; height: 100px; margin-bottom: 30px; opacity: 0.2" class="text-muted">
- <p>{%= __("Select type of transaction") %}</p>
- <p class="select-type" style="margin: auto; max-width: 300px; margin-bottom: 30px;">
-
- </p>
- <p style="margin-bottom: 30px;">
- <button class="btn btn-primary btn-lg">{%= __("Start") %}</button>
- </p>
- <p class="pos-setting-message hide">
- <a class="btn btn-default btn-sm" href="#Form/POS Profile/New POS Profile">
- {%= __("Make new POS Profile") %}</a>
- </p>
-</div>