diff --git a/erpnext/accounts/doctype/pos_profile/test_pos_profile.py b/erpnext/accounts/doctype/pos_profile/test_pos_profile.py index 9c6a11487c5..37828e16afb 100644 --- a/erpnext/accounts/doctype/pos_profile/test_pos_profile.py +++ b/erpnext/accounts/doctype/pos_profile/test_pos_profile.py @@ -31,6 +31,8 @@ class TestPOSProfile(unittest.TestCase): frappe.db.sql("delete from `tabPOS Profile`") def make_pos_profile(): + frappe.db.sql("delete from `tabPOS Profile`") + pos_profile = frappe.get_doc({ "company": "_Test Company", "cost_center": "_Test Cost Center - _TC", diff --git a/erpnext/accounts/page/pos/test_pos.js b/erpnext/accounts/page/pos/test_pos.js new file mode 100644 index 00000000000..62c6e31eb5d --- /dev/null +++ b/erpnext/accounts/page/pos/test_pos.js @@ -0,0 +1,60 @@ +QUnit.test("test:POS Profile", function(assert) { + assert.expect(1); + let done = assert.async(); + + frappe.run_serially([ + () => { + return frappe.tests.make("POS Profile", [ + {naming_series: "SINV"}, + {company: "_Test Company"}, + {country: "India"}, + {currency: "INR"}, + {write_off_account: "Write Off - _TC"}, + {write_off_cost_center: "Main - _TC"}, + {payments: [ + [ + {"default": 1}, + {"mode_of_payment": "Cash"} + ]] + } + ]); + }, + () => cur_frm.save(), + () => frappe.timeout(2), + () => { + assert.equal(cur_frm.doc.payments[0].default, 1, "Default mode of payment tested"); + }, + () => done() + ]); +}); + +QUnit.test("test:Sales Invoice", function(assert) { + assert.expect(2); + let done = assert.async(); + + frappe.run_serially([ + () => { + return frappe.tests.make("Sales Invoice", [ + {customer: "_Test Customer 2"}, + {company: "_Test Company"}, + {is_pos: 1}, + {posting_date: frappe.datetime.get_today()}, + {due_date: frappe.datetime.get_today()}, + {items: [ + [ + {"item_code": "_Test Item"}, + {"qty": 5} + ]] + } + ]); + }, + () => frappe.timeout(2), + () => cur_frm.save(), + () => frappe.timeout(2), + () => { + assert.equal(cur_frm.doc.payments[0].default, 1, "Default mode of payment tested"); + assert.equal(cur_frm.doc.payments[0].mode_of_payment, "Cash", "Default mode of payment tested"); + }, + () => done() + ]); +}); \ No newline at end of file diff --git a/erpnext/docs/assets/img/pos-setting/default_mop.png b/erpnext/docs/assets/img/pos-setting/default_mop.png new file mode 100644 index 00000000000..bd1e7a07e9d Binary files /dev/null and b/erpnext/docs/assets/img/pos-setting/default_mop.png differ diff --git a/erpnext/docs/assets/img/pos-setting/item_customer_group.png b/erpnext/docs/assets/img/pos-setting/item_customer_group.png new file mode 100644 index 00000000000..6117a8f2669 Binary files /dev/null and b/erpnext/docs/assets/img/pos-setting/item_customer_group.png differ diff --git a/erpnext/docs/assets/img/pos-setting/pos-setting.png b/erpnext/docs/assets/img/pos-setting/pos-setting.png deleted file mode 100644 index 606119921c6..00000000000 Binary files a/erpnext/docs/assets/img/pos-setting/pos-setting.png and /dev/null differ diff --git a/erpnext/docs/assets/img/pos-setting/pos_profile.png b/erpnext/docs/assets/img/pos-setting/pos_profile.png new file mode 100644 index 00000000000..a8bd4acaa07 Binary files /dev/null and b/erpnext/docs/assets/img/pos-setting/pos_profile.png differ diff --git a/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md b/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md index 78d2226361f..763c1421550 100644 --- a/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md +++ b/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md @@ -15,7 +15,7 @@ POS Invoices created in the offline mode will be saved locally in the browser. I In ERPNext all Sales and Purchase transactions, like Sales Invoice, Quotation, Sales Order, Purchase Order etc. can be edited via the POS. There two steps to Setup POS: 1. Enable POS View via (Setup > Customize > Feature Setup) -2. Create a [POS Setting]({{docs_base_url}}/user/manual/en/setting-up/pos-setting.html) record +2. Create a [POS Profile]({{docs_base_url}}/user/manual/en/setting-up/pos-setting.html) record #### Different sections of the POS diff --git a/erpnext/docs/user/manual/en/setting-up/pos-setting.md b/erpnext/docs/user/manual/en/setting-up/pos-setting.md index 9bfd8198f23..01e353b2c95 100644 --- a/erpnext/docs/user/manual/en/setting-up/pos-setting.md +++ b/erpnext/docs/user/manual/en/setting-up/pos-setting.md @@ -1,4 +1,4 @@ -# Point of Sale Setting +# Point of Sale Profile POS includes advanced features to cater to different functionality, such as inventory management, CRM, financials, warehousing, etc., all built into the @@ -10,11 +10,17 @@ If you are in retail operations, you want your Point of Sale to be as quick and efficient as possible. To do this, you can create a POS Setting for a user from: -> Accounts > Setup > Point-of-Sale Setting +> Accounts > Setup > Point-of-Sale Profile Set default values as defined. -POS Setting +POS Setting + +To set the default mode of payment, enabled the option default in the mode of payments table +POS Setting + +User can sale the particular products to the particular customers from the POS by adding item groups, customer groups in the POS Profile. +POS Setting > Important : If you specify a particular User, the POS setting will be applied only to that User. If the User option is left blank, the setting will diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt index f51c1de9eaa..9382114d89b 100644 --- a/erpnext/tests/ui/tests.txt +++ b/erpnext/tests/ui/tests.txt @@ -27,3 +27,4 @@ erpnext/schools/doctype/student_batch_name/test_student_batch_name.js erpnext/schools/doctype/student_category/test_student_category.js erpnext/schools/doctype/room/test_room.js erpnext/schools/doctype/instructor/test_instructor.js +erpnext/accounts/page/pos/test_pos.js \ No newline at end of file