From c65c38d2930e66af29864f127d48dd49d610657d Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 16 Jun 2016 11:49:37 +0530 Subject: [PATCH] [POS] Minor fixes --- .../accounts/doctype/pricing_rule/pricing_rule.js | 8 +++++++- erpnext/accounts/doctype/sales_invoice/pos.py | 12 +++++++----- erpnext/accounts/page/pos/pos_page.html | 15 --------------- 3 files changed, 14 insertions(+), 21 deletions(-) delete mode 100644 erpnext/accounts/page/pos/pos_page.html diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.js b/erpnext/accounts/doctype/pricing_rule/pricing_rule.js index 70c039725f..356f11ba97 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.js +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.js @@ -93,4 +93,10 @@ cur_frm.cscript.buying = function() { //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 54d47b5e3e..ec0e50c378 100644 --- a/erpnext/accounts/doctype/sales_invoice/pos.py +++ b/erpnext/accounts/doctype/sales_invoice/pos.py @@ -134,12 +134,14 @@ def get_customers(pos_profile, doc): 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 5a4c538f17..0000000000 --- a/erpnext/accounts/page/pos/pos_page.html +++ /dev/null @@ -1,15 +0,0 @@ -
- -

{%= __("Select type of transaction") %}

-

- -

-

- -

-

- - {%= __("Make new POS Profile") %} -

-