diff --git a/.travis.yml b/.travis.yml index a70062fea3..80d979f602 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,6 +56,6 @@ script: - bench run-tests - sleep 5 - bench reinstall --yes - - bench execute erpnext.setup.setup_wizard.utils.complete + - bench --verbose run-setup-wizard-ui-test - bench execute erpnext.setup.utils.enable_all_roles_and_domains - bench run-ui-tests --app erpnext diff --git a/erpnext/accounts/doctype/account/test_account.js b/erpnext/accounts/doctype/account/test_account.js index 7b23ef01dd..039e33e011 100644 --- a/erpnext/accounts/doctype/account/test_account.js +++ b/erpnext/accounts/doctype/account/test_account.js @@ -5,7 +5,9 @@ QUnit.test("test account", function(assert) { let done = assert.async(); frappe.run_serially([ () => frappe.set_route('Tree', 'Account'), + () => frappe.timeout(3), () => frappe.click_button('Expand All'), + () => frappe.timeout(1), () => frappe.click_link('Debtors'), () => frappe.click_button('Edit'), () => frappe.timeout(1), diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json index 57e83b0b7a..19f4b56928 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.json +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json @@ -1337,6 +1337,67 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "subscription_section", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Subscription Section", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "subscription", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Subscription", + "length": 0, + "no_copy": 1, + "options": "Subscription", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -1382,7 +1443,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-06-13 14:29:09.794076", + "modified": "2017-08-31 11:21:09.442695", "modified_by": "Administrator", "module": "Accounts", "name": "Journal Entry", diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 12e46c42d3..dc37574ea6 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -644,16 +644,9 @@ frappe.ui.form.on('Payment Entry', { if(frm.doc.party) { var party_amount = frm.doc.payment_type=="Receive" ? frm.doc.paid_amount : frm.doc.received_amount; - - var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [], - function(d) { return flt(d.amount) })); if(frm.doc.total_allocated_amount < party_amount) { - if(frm.doc.payment_type == "Receive") { - unallocated_amount = party_amount - (frm.doc.total_allocated_amount - total_deductions); - } else { - unallocated_amount = party_amount - (frm.doc.total_allocated_amount + total_deductions); - } + unallocated_amount = party_amount - frm.doc.total_allocated_amount; } } frm.set_value("unallocated_amount", unallocated_amount); @@ -672,11 +665,10 @@ frappe.ui.form.on('Payment Entry', { difference_amount = flt(frm.doc.base_paid_amount) - flt(frm.doc.base_received_amount); } - $.each(frm.doc.deductions || [], function(i, d) { - if(d.amount) difference_amount -= flt(d.amount); - }) + var total_deductions = frappe.utils.sum($.map(frm.doc.deductions || [], + function(d) { return flt(d.amount) })); - frm.set_value("difference_amount", difference_amount); + frm.set_value("difference_amount", difference_amount - total_deductions); frm.events.hide_unhide_fields(frm); }, diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.json b/erpnext/accounts/doctype/payment_entry/payment_entry.json index a59223d3a8..abf4ac9b15 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.json +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.json @@ -1659,6 +1659,67 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "subscription_section", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Subscription Section", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "subscription", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Subscription", + "length": 0, + "no_copy": 1, + "options": "Subscription", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -1730,7 +1791,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-06-13 14:29:04.244537", + "modified": "2017-08-31 11:20:37.578469", "modified_by": "Administrator", "module": "Accounts", "name": "Payment Entry", diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 9832c0527a..908e58eeac 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -281,13 +281,8 @@ class PaymentEntry(AccountsController): if self.party: party_amount = self.paid_amount if self.payment_type=="Receive" else self.received_amount - total_deductions = sum([flt(d.amount) for d in self.get("deductions")]) - if self.total_allocated_amount < party_amount: - if self.payment_type == "Receive": - self.unallocated_amount = party_amount - (self.total_allocated_amount - total_deductions) - else: - self.unallocated_amount = party_amount - (self.total_allocated_amount + total_deductions) + self.unallocated_amount = party_amount - self.total_allocated_amount def set_difference_amount(self): base_unallocated_amount = flt(self.unallocated_amount) * (flt(self.source_exchange_rate) @@ -302,11 +297,10 @@ class PaymentEntry(AccountsController): else: self.difference_amount = self.base_paid_amount - flt(self.base_received_amount) - for d in self.get("deductions"): - if d.amount: - self.difference_amount -= flt(d.amount) + total_deductions = sum([flt(d.amount) for d in self.get("deductions")]) - self.difference_amount = flt(self.difference_amount, self.precision("difference_amount")) + self.difference_amount = flt(self.difference_amount - total_deductions, + self.precision("difference_amount")) def clear_unallocated_reference_document_rows(self): self.set("references", self.get("references", {"allocated_amount": ["not in", [0, None, ""]]})) diff --git a/erpnext/accounts/doctype/payment_entry/test_payment_entry.py b/erpnext/accounts/doctype/payment_entry/test_payment_entry.py index 0316ccafe2..60be20dd89 100644 --- a/erpnext/accounts/doctype/payment_entry/test_payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/test_payment_entry.py @@ -267,3 +267,65 @@ class TestPaymentEntry(unittest.TestCase): return frappe.db.sql("""select account, debit, credit, against_voucher from `tabGL Entry` where voucher_type='Payment Entry' and voucher_no=%s order by account asc""", voucher_no, as_dict=1) + + def test_payment_entry_write_off_difference(self): + si = create_sales_invoice() + pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Cash - _TC") + pe.reference_no = "1" + pe.reference_date = "2016-01-01" + pe.received_amount = pe.paid_amount = 110 + pe.insert() + + self.assertEqual(pe.unallocated_amount, 10) + + pe.received_amount = pe.paid_amount = 95 + pe.append("deductions", { + "account": "_Test Write Off - _TC", + "cost_center": "_Test Cost Center - _TC", + "amount": 5 + }) + pe.save() + + self.assertEqual(pe.unallocated_amount, 0) + self.assertEqual(pe.difference_amount, 0) + + pe.submit() + + expected_gle = dict((d[0], d) for d in [ + ["Debtors - _TC", 0, 100, si.name], + ["_Test Cash - _TC", 95, 0, None], + ["_Test Write Off - _TC", 5, 0, None] + ]) + + self.validate_gl_entries(pe.name, expected_gle) + + def test_payment_entry_exchange_gain_loss(self): + si = create_sales_invoice(customer="_Test Customer USD", debit_to="_Test Receivable USD - _TC", + currency="USD", conversion_rate=50) + pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Bank USD - _TC") + pe.reference_no = "1" + pe.reference_date = "2016-01-01" + pe.target_exchange_rate = 55 + + pe.append("deductions", { + "account": "_Test Exchange Gain/Loss - _TC", + "cost_center": "_Test Cost Center - _TC", + "amount": -500 + }) + pe.save() + + self.assertEqual(pe.unallocated_amount, 0) + self.assertEqual(pe.difference_amount, 0) + + pe.submit() + + expected_gle = dict((d[0], d) for d in [ + ["_Test Receivable USD - _TC", 0, 5000, si.name], + ["_Test Bank USD - _TC", 5500, 0, None], + ["_Test Exchange Gain/Loss - _TC", 0, 500, None], + ]) + + self.validate_gl_entries(pe.name, expected_gle) + + outstanding_amount = flt(frappe.db.get_value("Sales Invoice", si.name, "outstanding_amount")) + self.assertEqual(outstanding_amount, 0) diff --git a/erpnext/accounts/doctype/payment_entry/tests/test_payment_against_invoice.js b/erpnext/accounts/doctype/payment_entry/tests/test_payment_against_invoice.js new file mode 100644 index 0000000000..7dea76db80 --- /dev/null +++ b/erpnext/accounts/doctype/payment_entry/tests/test_payment_against_invoice.js @@ -0,0 +1,51 @@ +QUnit.module('Payment Entry'); + +QUnit.test("test payment entry", function(assert) { + assert.expect(6); + let done = assert.async(); + frappe.run_serially([ + () => { + return frappe.tests.make('Sales Invoice', [ + {customer: 'Test Customer 1'}, + {items: [ + [ + {'qty': 1}, + {'rate': 101}, + {'item_code': 'Test Product 1'}, + ] + ]} + ]); + }, + () => cur_frm.save(), + () => frappe.tests.click_button('Submit'), + () => frappe.tests.click_button('Yes'), + () => frappe.timeout(0.5), + () => frappe.tests.click_button('Close'), + () => frappe.timeout(0.5), + () => frappe.click_button('Make'), + () => frappe.click_link('Payment', 1), + () => frappe.timeout(2), + () => { + assert.equal(frappe.get_route()[1], 'Payment Entry', + 'made payment entry'); + assert.equal(cur_frm.doc.party, 'Test Customer 1', + 'customer set in payment entry'); + assert.equal(cur_frm.doc.paid_amount, 101, + 'paid amount set in payment entry'); + assert.equal(cur_frm.doc.references[0].allocated_amount, 101, + 'amount allocated against sales invoice'); + }, + () => cur_frm.set_value('paid_amount', 100), + () => { + cur_frm.doc.references[0].allocated_amount = 101; + }, + () => frappe.click_button('Write Off Difference Amount'), + () => { + assert.equal(cur_frm.doc.difference_amount, 0, + 'difference amount is zero'); + assert.equal(cur_frm.doc.deductions[0].amount, 1, + 'Write off amount = 1'); + }, + () => done() + ]); +}); diff --git a/erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js b/erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js index a4ef0ca4eb..0c76343fa9 100644 --- a/erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js @@ -25,5 +25,4 @@ QUnit.test("test payment entry", function(assert) { () => frappe.timeout(0.3), () => done() ]); -}); - +}); \ No newline at end of file diff --git a/erpnext/accounts/doctype/payment_entry/tests/test_payment_entry_write_off.js b/erpnext/accounts/doctype/payment_entry/tests/test_payment_entry_write_off.js new file mode 100644 index 0000000000..133f136298 --- /dev/null +++ b/erpnext/accounts/doctype/payment_entry/tests/test_payment_entry_write_off.js @@ -0,0 +1,67 @@ +QUnit.module('Payment Entry'); + +QUnit.test("test payment entry", function(assert) { + assert.expect(8); + let done = assert.async(); + frappe.run_serially([ + () => { + return frappe.tests.make('Sales Invoice', [ + {customer: 'Test Customer 1'}, + {company: '_Test Company'}, + {currency: 'INR'}, + {selling_price_list: '_Test Price List'}, + {items: [ + [ + {'qty': 1}, + {'item_code': 'Test Product 1'}, + ] + ]} + ]); + }, + () => frappe.timeout(1), + () => cur_frm.save(), + () => frappe.tests.click_button('Submit'), + () => frappe.tests.click_button('Yes'), + () => frappe.timeout(1.5), + () => frappe.click_button('Close'), + () => frappe.timeout(0.5), + () => frappe.click_button('Make'), + () => frappe.timeout(1), + () => frappe.click_link('Payment'), + () => frappe.timeout(2), + () => cur_frm.set_value("paid_to", "_Test Cash - _TC"), + () => frappe.timeout(0.5), + () => { + assert.equal(frappe.get_route()[1], 'Payment Entry', 'made payment entry'); + assert.equal(cur_frm.doc.party, 'Test Customer 1', 'customer set in payment entry'); + assert.equal(cur_frm.doc.paid_from, 'Debtors - _TC', 'customer account set in payment entry'); + assert.equal(cur_frm.doc.paid_amount, 100, 'paid amount set in payment entry'); + assert.equal(cur_frm.doc.references[0].allocated_amount, 100, + 'amount allocated against sales invoice'); + }, + () => cur_frm.set_value('paid_amount', 95), + () => frappe.timeout(1), + () => { + frappe.model.set_value("Payment Entry Reference", + cur_frm.doc.references[0].name, "allocated_amount", 100); + }, + () => frappe.timeout(.5), + () => { + assert.equal(cur_frm.doc.difference_amount, 5, 'difference amount is 5'); + }, + () => { + frappe.db.set_value("Company", "_Test Company", "write_off_account", "_Test Write Off - _TC"); + frappe.timeout(1); + frappe.db.set_value("Company", "_Test Company", + "exchange_gain_loss_account", "_Test Exchange Gain/Loss - _TC"); + }, + () => frappe.timeout(1), + () => frappe.click_button('Write Off Difference Amount'), + () => frappe.timeout(2), + () => { + assert.equal(cur_frm.doc.difference_amount, 0, 'difference amount is zero'); + assert.equal(cur_frm.doc.deductions[0].amount, 5, 'Write off amount = 5'); + }, + () => done() + ]); +}); \ No newline at end of file diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.js b/erpnext/accounts/doctype/pos_profile/pos_profile.js index 03d84e9ad6..97bbc1227f 100755 --- a/erpnext/accounts/doctype/pos_profile/pos_profile.js +++ b/erpnext/accounts/doctype/pos_profile/pos_profile.js @@ -8,10 +8,6 @@ frappe.ui.form.on("POS Profile", "onload", function(frm) { return { filters: { selling: 1 } }; }); - frm.set_query("print_format", function() { - return { filters: { doc_type: "Sales Invoice", print_format_type: "Js"} }; - }); - erpnext.queries.setup_queries(frm, "Warehouse", function() { return erpnext.queries.warehouse(frm.doc); }); @@ -27,6 +23,27 @@ frappe.ui.form.on("POS Profile", "onload", function(frm) { }); frappe.ui.form.on('POS Profile', { + setup: function(frm) { + frm.set_query("online_print_format", function() { + return { + filters: [ + ['Print Format', 'doc_type', '=', 'Sales Invoice'], + ['Print Format', 'print_format_type', '!=', 'Js'], + ] + }; + }); + + frm.set_query("print_format", function() { + return { filters: { doc_type: "Sales Invoice", print_format_type: "Js"} }; + }); + + frappe.db.get_value('POS Settings', {name: 'POS Settings'}, 'is_online', (r) => { + is_online = r && cint(r.is_online) + frm.toggle_display('offline_pos_section', !is_online); + frm.toggle_display('print_format_for_online', is_online); + }); + }, + refresh: function(frm) { if(frm.doc.company) { frm.trigger("toggle_display_account_head"); diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.json b/erpnext/accounts/doctype/pos_profile/pos_profile.json index 6991da2888..187454ef33 100644 --- a/erpnext/accounts/doctype/pos_profile/pos_profile.json +++ b/erpnext/accounts/doctype/pos_profile/pos_profile.json @@ -631,8 +631,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "default": "Point of Sale", - "fieldname": "print_format", + "fieldname": "print_format_for_online", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, @@ -641,7 +640,7 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Print Format", + "label": "Print Format for Online", "length": 0, "no_copy": 0, "options": "Print Format", @@ -822,7 +821,7 @@ "columns": 0, "fieldname": "apply_discount", "fieldtype": "Check", - "hidden": 0, + "hidden": 1, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, @@ -836,7 +835,7 @@ "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, - "read_only": 0, + "read_only": 1, "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, @@ -851,7 +850,7 @@ "collapsible": 0, "columns": 0, "default": "Grand Total", - "depends_on": "apply_discount", + "depends_on": "", "fieldname": "apply_discount_on", "fieldtype": "Select", "hidden": 0, @@ -883,7 +882,7 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "customer_details", + "fieldname": "offline_pos_section", "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, @@ -892,7 +891,7 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "New Customer Details", + "label": "Offline POS Section", "length": 0, "no_copy": 0, "permlevel": 0, @@ -969,6 +968,38 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "Point of Sale", + "fieldname": "print_format", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Print Format", + "length": 0, + "no_copy": 0, + "options": "Print Format", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -1291,7 +1322,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-07-28 03:40:03.253088", + "modified": "2017-09-01 15:55:14.890452", "modified_by": "Administrator", "module": "Accounts", "name": "POS Profile", diff --git a/erpnext/docs/user/manual/en/setting-up/setup-wizard/__init__.py b/erpnext/accounts/doctype/pos_settings/__init__.py similarity index 100% rename from erpnext/docs/user/manual/en/setting-up/setup-wizard/__init__.py rename to erpnext/accounts/doctype/pos_settings/__init__.py diff --git a/erpnext/accounts/doctype/pos_settings/pos_settings.js b/erpnext/accounts/doctype/pos_settings/pos_settings.js new file mode 100644 index 0000000000..1a14618513 --- /dev/null +++ b/erpnext/accounts/doctype/pos_settings/pos_settings.js @@ -0,0 +1,8 @@ +// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +frappe.ui.form.on('POS Settings', { + refresh: function() { + + } +}); diff --git a/erpnext/accounts/doctype/pos_settings/pos_settings.json b/erpnext/accounts/doctype/pos_settings/pos_settings.json new file mode 100644 index 0000000000..a04558da26 --- /dev/null +++ b/erpnext/accounts/doctype/pos_settings/pos_settings.json @@ -0,0 +1,94 @@ +{ + "allow_copy": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2017-08-28 16:46:41.732676", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "default": "1", + "fieldname": "is_online", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Online", + "length": 0, + "no_copy": 0, + "options": "", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + } + ], + "has_web_view": 0, + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "is_submittable": 0, + "issingle": 1, + "istable": 0, + "max_attachments": 0, + "modified": "2017-08-30 18:34:58.960276", + "modified_by": "Administrator", + "module": "Accounts", + "name": "POS Settings", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "System Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0 +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/pos_settings/pos_settings.py b/erpnext/accounts/doctype/pos_settings/pos_settings.py new file mode 100644 index 0000000000..736d36eea9 --- /dev/null +++ b/erpnext/accounts/doctype/pos_settings/pos_settings.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from frappe.model.document import Document + +class POSSettings(Document): + pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/pos_settings/test_pos_settings.js b/erpnext/accounts/doctype/pos_settings/test_pos_settings.js new file mode 100644 index 0000000000..639c94ed10 --- /dev/null +++ b/erpnext/accounts/doctype/pos_settings/test_pos_settings.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: POS Settings", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new POS Settings + () => frappe.tests.make('POS Settings', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json index 49af59b388..8860b092e0 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_guest_to_view": 0, "allow_import": 1, "allow_rename": 1, "autoname": "field:title", @@ -12,6 +13,7 @@ "editable_grid": 0, "fields": [ { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -40,6 +42,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -69,6 +72,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -99,6 +103,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -129,6 +134,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -159,6 +165,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -189,6 +196,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -217,6 +225,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -247,6 +256,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -275,6 +285,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -303,6 +314,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -331,6 +343,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -359,6 +372,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -387,6 +401,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -417,6 +432,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -447,6 +463,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -477,6 +494,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -507,6 +525,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -537,6 +556,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -567,6 +587,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -597,6 +618,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -627,6 +649,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -655,6 +678,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -683,6 +707,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -711,6 +736,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -739,6 +765,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -767,6 +794,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -796,6 +824,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -824,6 +853,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -851,6 +881,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -880,6 +911,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -910,6 +942,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -941,6 +974,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -969,6 +1003,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1000,6 +1035,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1028,6 +1064,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1058,6 +1095,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1085,13 +1123,14 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, "depends_on": "eval:doc.price_or_discount==\"Price\"", "fieldname": "price", - "fieldtype": "Float", + "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -1114,6 +1153,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1143,6 +1183,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1173,6 +1214,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1202,6 +1244,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -1230,18 +1273,18 @@ "unique": 0 } ], + "has_web_view": 0, "hide_heading": 0, "hide_toolbar": 0, "icon": "fa fa-gift", "idx": 1, "image_view": 0, "in_create": 0, - "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-02-17 16:21:28.446208", + "modified": "2017-08-31 16:34:41.614743", "modified_by": "Administrator", "module": "Accounts", "name": "Pricing Rule", diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index ac5f5dd321..b9a7dae55f 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -46,6 +46,12 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ cur_frm.add_custom_button(__('Return / Debit Note'), this.make_debit_note, __("Make")); } + + if(!doc.subscription) { + cur_frm.add_custom_button(__('Subscription'), function() { + erpnext.utils.make_subscription(doc.doctype, doc.name) + }, __("Make")) + } } if(doc.docstatus===0) { @@ -343,6 +349,7 @@ frappe.ui.form.on("Purchase Invoice", { 'Payment Entry': 'Payment' } }, + onload: function(frm) { $.each(["warehouse", "rejected_warehouse"], function(i, field) { frm.set_query(field, "items", function() { @@ -370,5 +377,5 @@ frappe.ui.form.on("Purchase Invoice", { erpnext.buying.get_default_bom(frm); } frm.toggle_reqd("supplier_warehouse", frm.doc.is_subcontracted==="Yes"); - } -}) + }, +}) \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index 8ea48f65aa..748c24ddea 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -3348,6 +3348,67 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "subscription_section", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Subscription Section", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "subscription", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Subscription", + "length": 0, + "no_copy": 1, + "options": "Subscription", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -3358,7 +3419,7 @@ "depends_on": "eval:doc.docstatus<2 && !doc.__islocal", "fieldname": "recurring_invoice", "fieldtype": "Section Break", - "hidden": 0, + "hidden": 1, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, @@ -3797,7 +3858,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-07-19 13:53:48.673757", + "modified": "2017-08-31 11:22:47.074420", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 7ab790118a..be388aac85 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -667,7 +667,7 @@ class PurchaseInvoice(BuyingController): if account_type != 'Fixed Asset': frappe.throw(_("Row {0}# Account must be of type 'Fixed Asset'").format(d.idx)) - def on_recurring(self, reference_doc): + def on_recurring(self, reference_doc, subscription_doc): self.due_date = None @frappe.whitelist() diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py index 6141db5d3c..062a2d2c64 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_dashboard.py @@ -8,7 +8,8 @@ def get_data(): 'Payment Entry': 'reference_name', 'Payment Request': 'reference_name', 'Landed Cost Voucher': 'receipt_document', - 'Purchase Invoice': 'return_against' + 'Purchase Invoice': 'return_against', + 'Subscription': 'reference_document' }, 'internal_links': { 'Purchase Order': ['items', 'purchase_order'], @@ -27,5 +28,9 @@ def get_data(): 'label': _('Returns'), 'items': ['Purchase Invoice'] }, + { + 'label': _('Subscription'), + 'items': ['Subscription'] + }, ] } \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index 3454a2e9b4..639620f910 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -256,10 +256,6 @@ class TestPurchaseInvoice(unittest.TestCase): self.assertFalse(frappe.db.sql("""select name from `tabJournal Entry Account` where reference_type='Purchase Invoice' and reference_name=%s""", pi.name)) - def test_recurring_invoice(self): - from erpnext.controllers.tests.test_recurring_document import test_recurring_document - test_recurring_document(self, test_records) - def test_total_purchase_cost_for_project(self): existing_purchase_cost = frappe.db.sql("""select sum(base_net_amount) from `tabPurchase Invoice Item` where project = '_Test Project' and docstatus=1""") diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index ef233c6799..11d1825388 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -86,7 +86,11 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte this.make_payment_request, __("Make")); } - + if(!doc.subscription) { + cur_frm.add_custom_button(__('Subscription'), function() { + erpnext.utils.make_subscription(doc.doctype, doc.name) + }, __("Make")) + } } // Show buttons only when pos view is active diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 260c05e3e4..2bb0044fbd 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -4175,6 +4175,67 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "subscription_section", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Subscription Section", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "subscription", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Subscription", + "length": 0, + "no_copy": 1, + "options": "Subscription", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -4185,7 +4246,7 @@ "depends_on": "eval:doc.docstatus<2 && !doc.__islocal", "fieldname": "recurring_invoice", "fieldtype": "Section Break", - "hidden": 0, + "hidden": 1, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, @@ -4688,7 +4749,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-07-07 13:05:37.469682", + "modified": "2017-08-31 11:23:08.675028", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 780edd8bdf..065fb94ed2 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -107,7 +107,7 @@ class SalesInvoice(SellingController): def on_submit(self): self.validate_pos_paid_amount() - if not self.recurring_id: + if not self.subscription: frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.base_grand_total, self) @@ -313,7 +313,7 @@ class SalesInvoice(SellingController): for fieldname in ('territory', 'naming_series', 'currency', 'taxes_and_charges', 'letter_head', 'tc_name', 'selling_price_list', 'company', 'select_print_heading', 'cash_bank_account', - 'write_off_account', 'write_off_cost_center'): + 'write_off_account', 'write_off_cost_center', 'apply_discount_on'): if (not for_validate) or (for_validate and not self.get(fieldname)): self.set(fieldname, pos.get(fieldname)) @@ -799,7 +799,7 @@ class SalesInvoice(SellingController): for dn in set(updated_delivery_notes): frappe.get_doc("Delivery Note", dn).update_billing_percentage(update_modified=update_modified) - def on_recurring(self, reference_doc): + def on_recurring(self, reference_doc, subscription_doc): for fieldname in ("c_form_applicable", "c_form_no", "write_off_amount"): self.set(fieldname, reference_doc.get(fieldname)) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py index bc9d76646b..efd18b5215 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_dashboard.py @@ -8,7 +8,8 @@ def get_data(): 'Journal Entry': 'reference_name', 'Payment Entry': 'reference_name', 'Payment Request': 'reference_name', - 'Sales Invoice': 'return_against' + 'Sales Invoice': 'return_against', + 'Subscription': 'reference_document', }, 'internal_links': { 'Sales Order': ['items', 'sales_order'] @@ -26,5 +27,9 @@ def get_data(): 'label': _('Returns'), 'items': ['Sales Invoice'] }, + { + 'label': _('Subscription'), + 'items': ['Subscription'] + }, ] } \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index e0a453c5c9..db29563631 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -809,10 +809,6 @@ class TestSalesInvoice(unittest.TestCase): self.assertTrue(not frappe.db.sql("""select name from `tabJournal Entry Account` where reference_name=%s""", si.name)) - def test_recurring_invoice(self): - from erpnext.controllers.tests.test_recurring_document import test_recurring_document - test_recurring_document(self, test_records) - def test_serialized(self): from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos @@ -1167,8 +1163,15 @@ class TestSalesInvoice(unittest.TestCase): self.assertEqual(flt(si.outstanding_amount), flt(si.grand_total + si.total_advance, si.precision("outstanding_amount"))) def test_multiple_uom_in_selling(self): - si = frappe.copy_doc(test_records[1]) + frappe.db.sql("""delete from `tabItem Price` + where price_list='_Test Price List' and item_code='_Test Item'""") + item_price = frappe.new_doc("Item Price") + item_price.price_list = "_Test Price List" + item_price.item_code = "_Test Item" + item_price.price_list_rate = 100 + item_price.insert() + si = frappe.copy_doc(test_records[1]) si.items[0].uom = "_Test UOM 1" si.items[0].conversion_factor = None si.items[0].price_list_rate = None diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js index 33b41e9ee4..2f425248a1 100644 --- a/erpnext/accounts/page/pos/pos.js +++ b/erpnext/accounts/page/pos/pos.js @@ -8,7 +8,16 @@ frappe.pages['pos'].on_page_load = function (wrapper) { single_column: true }); - wrapper.pos = new erpnext.pos.PointOfSale(wrapper) + frappe.db.get_value('POS Settings', {name: 'POS Settings'}, 'is_online', (r) => { + if (r && r.is_online && !cint(r.is_online)) { + // offline + wrapper.pos = new erpnext.pos.PointOfSale(wrapper); + cur_pos = wrapper.pos; + } else { + // online + frappe.set_route('point-of-sale'); + } + }); } frappe.pages['pos'].refresh = function (wrapper) { diff --git a/erpnext/accounts/page/pos/test_pos.js b/erpnext/accounts/page/pos/test_pos.js index bc5edc9f2a..8913a9e1cc 100644 --- a/erpnext/accounts/page/pos/test_pos.js +++ b/erpnext/accounts/page/pos/test_pos.js @@ -1,16 +1,15 @@ -QUnit.test("test:POS Profile", function(assert) { - assert.expect(1); +QUnit.test("test:Sales Invoice", function(assert) { + assert.expect(3); 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"}, + {write_off_account: "Write Off - FT"}, + {write_off_cost_center: "Main - FT"}, {payments: [ [ {"default": 1}, @@ -24,19 +23,10 @@ QUnit.test("test:POS Profile", function(assert) { () => { 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([ + () => frappe.timeout(1), () => { 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()}, @@ -44,7 +34,7 @@ QUnit.test("test:Sales Invoice", function(assert) { [ {"item_code": "Test Product 1"}, {"qty": 5}, - {"warehouse":'Stores - TC'} + {"warehouse":'Stores - FT'} ]] } ]); diff --git a/erpnext/accounts/print_format/point_of_sale/point_of_sale.json b/erpnext/accounts/print_format/point_of_sale/point_of_sale.json index 28c853cc48..4e69cad06b 100644 --- a/erpnext/accounts/print_format/point_of_sale/point_of_sale.json +++ b/erpnext/accounts/print_format/point_of_sale/point_of_sale.json @@ -10,7 +10,7 @@ "html": "\n\n
\n\t{{ company }}
\n\t{{ __(\"POS No : \") }} {{ offline_pos_name }}
\n
\n\t{{ __(\"Customer\") }}: {{ customer }}
\n
\n\t{{ __(\"Date\") }}: {{ dateutil.global_date_format(posting_date) }}
\n
{{ __(\"Item\") }} | \n\t\t\t{{ __(\"Qty\") }} | \n\t\t\t{{ __(\"Amount\") }} | \n\t\t
---|---|---|
\n\t\t\t\t{{ item.item_name }}\n\t\t\t | \n\t\t\t{{ format_number(item.qty, null,precision(\"difference\")) }} @ {{ format_currency(item.rate, currency) }} | \n\t\t\t{{ format_currency(item.amount, currency) }} | \n\t\t
\n\t\t\t\t{{ __(\"Net Total\") }}\n\t\t\t | \n\t\t\t\n\t\t\t\t{{ format_currency(total, currency) }}\n\t\t\t | \n\t\t
\n\t\t\t\t{{ row.description }}\n\t\t\t | \n\t\t\t\n\t\t\t\t{{ format_currency(row.tax_amount, currency) }}\n\t\t\t | \n\t\t
\n\t\t\t\t{{ __(\"Discount\") }}\n\t\t\t | \n\t\t\t\n\t\t\t\t{{ format_currency(discount_amount, currency) }}\n\t\t\t | \n\t\t
\n\t\t\t\t{{ __(\"Grand Total\") }}\n\t\t\t | \n\t\t\t\n\t\t\t\t{{ format_currency(grand_total, currency) }}\n\t\t\t | \n\t\t
\n\t\t\t\t{{ __(\"Paid Amount\") }}\n\t\t\t | \n\t\t\t\n\t\t\t\t{{ format_currency(paid_amount, currency) }}\n\t\t\t | \n\t\t
{{ terms }}
\n{{ __(\"Thank you, please visit again.\") }}
", "idx": 0, "line_breaks": 0, - "modified": "2017-05-19 14:36:04.740728", + "modified": "2017-09-01 14:27:04.871233", "modified_by": "Administrator", "module": "Accounts", "name": "Point of Sale", diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index c533e6bbcd..a51246bcb8 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -13,6 +13,7 @@ frappe.ui.form.on("Purchase Order", { 'Stock Entry': 'Material to Supplier' } }, + onload: function(frm) { erpnext.queries.setup_queries(frm, "Warehouse", function() { return erpnext.queries.warehouse(frm.doc); @@ -20,8 +21,7 @@ frappe.ui.form.on("Purchase Order", { frm.set_indicator_formatter('item_code', function(doc) { return (doc.qty<=doc.received_qty) ? "green" : "orange" }) - - } + }, }); erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend({ @@ -86,8 +86,13 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend( if(flt(doc.per_billed)==0 && doc.status != "Delivered") { cur_frm.add_custom_button(__('Payment'), cur_frm.cscript.make_payment_entry, __("Make")); } - cur_frm.page.set_inner_btn_group_as_primary(__("Make")); + if(!doc.subscription) { + cur_frm.add_custom_button(__('Subscription'), function() { + erpnext.utils.make_subscription(doc.doctype, doc.name) + }, __("Make")) + } + cur_frm.page.set_inner_btn_group_as_primary(__("Make")); } }, diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 09c987f0fd..c4096cc772 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -2856,6 +2856,67 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "subscription_section", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Subscription Section", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "subscription", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Subscription", + "length": 0, + "no_copy": 1, + "options": "Subscription", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -2866,7 +2927,7 @@ "depends_on": "eval:doc.docstatus<2 && !doc.__islocal", "fieldname": "recurring_order", "fieldtype": "Section Break", - "hidden": 0, + "hidden": 1, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, @@ -3335,7 +3396,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-07-19 14:03:51.838328", + "modified": "2017-08-31 11:22:30.190589", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order", diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py index df10a541df..d57b0e2568 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order_dashboard.py @@ -5,7 +5,8 @@ def get_data(): 'fieldname': 'purchase_order', 'non_standard_fieldnames': { 'Journal Entry': 'reference_name', - 'Payment Entry': 'reference_name' + 'Payment Entry': 'reference_name', + 'Subscription': 'reference_document' }, 'internal_links': { 'Material Request': ['items', 'material_request'], @@ -23,11 +24,11 @@ def get_data(): }, { 'label': _('Reference'), - 'items': ['Material Request', 'Supplier Quotation', 'Project'] + 'items': ['Material Request', 'Supplier Quotation', 'Project', 'Subscription'] }, { 'label': _('Sub-contracting'), 'items': ['Stock Entry'] - } + }, ] } diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.js b/erpnext/buying/doctype/purchase_order/test_purchase_order.js new file mode 100644 index 0000000000..e9db270b4f --- /dev/null +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Purchase Order", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially('Purchase Order', [ + // insert a new Purchase Order + () => frappe.tests.make([ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js index 3767248e36..3899bbab11 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js @@ -22,7 +22,9 @@ erpnext.buying.SupplierQuotationController = erpnext.buying.BuyingController.ext cur_frm.page.set_inner_btn_group_as_primary(__("Make")); cur_frm.add_custom_button(__("Quotation"), this.make_quotation, __("Make")); - + cur_frm.add_custom_button(__('Subscription'), function() { + erpnext.utils.make_subscription(me.frm.doc.doctype, me.frm.doc.name) + }, __("Make")) } else if (this.frm.doc.docstatus===0) { diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json index ea3ae74dfe..eed0c15cad 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json @@ -2051,6 +2051,67 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "subscription_section", + "fieldtype": "Section Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Subscription Section", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "subscription", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Subscription", + "length": 0, + "no_copy": 1, + "options": "Subscription", + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -2247,7 +2308,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-07-19 13:51:18.929697", + "modified": "2017-08-31 11:23:25.268924", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation", diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py index df69063aae..4321f27f2a 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_dashboard.py @@ -3,6 +3,9 @@ from frappe import _ def get_data(): return { 'fieldname': 'supplier_quotation', + 'non_standard_fieldnames': { + 'Subscription': 'reference_document' + }, 'internal_links': { 'Material Request': ['items', 'material_request'], 'Request for Quotation': ['items', 'request_for_quotation'], @@ -17,6 +20,10 @@ def get_data(): 'label': _('Reference'), 'items': ['Material Request', 'Request for Quotation', 'Project'] }, + { + 'label': _('Subscription'), + 'items': ['Subscription'] + }, ] } diff --git a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.js new file mode 100644 index 0000000000..7097a6dcb2 --- /dev/null +++ b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Supplier Quotation", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially('Supplier Quotation', [ + // insert a new Supplier Quotation + () => frappe.tests.make([ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index b24e047bcc..d04143d77d 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -8,7 +8,6 @@ from frappe.utils import today, flt, cint, fmt_money, formatdate, getdate from erpnext.setup.utils import get_exchange_rate from erpnext.accounts.utils import get_fiscal_years, validate_fiscal_year, get_account_currency from erpnext.utilities.transaction_base import TransactionBase -from erpnext.controllers.recurring_document import convert_to_recurring, validate_recurring_document from erpnext.controllers.sales_and_purchase_return import validate_return from erpnext.accounts.party import get_party_account_currency, validate_party_frozen_disabled from erpnext.exceptions import InvalidCurrency @@ -53,13 +52,6 @@ class AccountsController(TransactionBase): self.validate_party() self.validate_currency() - if self.meta.get_field("is_recurring"): - if self.amended_from and self.recurring_id == self.amended_from: - self.recurring_id = None - if not self.get("__islocal"): - validate_recurring_document(self) - convert_to_recurring(self, self.get("posting_date") or self.get("transaction_date")) - if self.doctype == 'Purchase Invoice': self.validate_paid_amount() @@ -84,11 +76,6 @@ class AccountsController(TransactionBase): else: frappe.db.set(self,'paid_amount',0) - def on_update_after_submit(self): - if self.meta.get_field("is_recurring"): - validate_recurring_document(self) - convert_to_recurring(self, self.get("posting_date") or self.get("transaction_date")) - def set_missing_values(self, for_validate=False): if frappe.flags.in_test: for fieldname in ["posting_date","transaction_date"]: diff --git a/erpnext/controllers/recurring_document.py b/erpnext/controllers/recurring_document.py deleted file mode 100644 index 713e9bac2f..0000000000 --- a/erpnext/controllers/recurring_document.py +++ /dev/null @@ -1,230 +0,0 @@ -from __future__ import unicode_literals -import frappe -import calendar -import frappe.utils -import frappe.defaults - -from frappe.utils import cint, cstr, getdate, nowdate, \ - get_first_day, get_last_day, split_emails - -from frappe import _, msgprint, throw - -month_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, 'Yearly': 12} -date_field_map = { - "Sales Order": "transaction_date", - "Sales Invoice": "posting_date", - "Purchase Order": "transaction_date", - "Purchase Invoice": "posting_date" -} - -def create_recurring_documents(): - manage_recurring_documents("Sales Order") - manage_recurring_documents("Sales Invoice") - manage_recurring_documents("Purchase Order") - manage_recurring_documents("Purchase Invoice") - -def manage_recurring_documents(doctype, next_date=None, commit=True): - """ - Create recurring documents on specific date by copying the original one - and notify the concerned people - """ - next_date = next_date or nowdate() - - date_field = date_field_map[doctype] - - condition = " and ifnull(status, '') != 'Closed'" if doctype in ("Sales Order", "Purchase Order") else "" - - recurring_documents = frappe.db.sql("""select name, recurring_id - from `tab{0}` where is_recurring=1 - and (docstatus=1 or docstatus=0) and next_date=%s - and next_date <= ifnull(end_date, '2199-12-31') {1}""".format(doctype, condition), next_date) - - exception_list = [] - for ref_document, recurring_id in recurring_documents: - if not frappe.db.sql("""select name from `tab%s` - where %s=%s and recurring_id=%s and (docstatus=1 or docstatus=0)""" - % (doctype, date_field, '%s', '%s'), (next_date, recurring_id)): - try: - reference_doc = frappe.get_doc(doctype, ref_document) - new_doc = make_new_document(reference_doc, date_field, next_date) - if reference_doc.notify_by_email: - send_notification(new_doc) - if commit: - frappe.db.commit() - except: - if commit: - frappe.db.rollback() - - frappe.db.begin() - frappe.db.sql("update `tab%s` \ - set is_recurring = 0 where name = %s" % (doctype, '%s'), - (ref_document)) - notify_errors(ref_document, doctype, reference_doc.get("customer") or reference_doc.get("supplier"), - reference_doc.owner) - frappe.db.commit() - - exception_list.append(frappe.get_traceback()) - finally: - if commit: - frappe.db.begin() - - if exception_list: - exception_message = "\n\n".join([cstr(d) for d in exception_list]) - frappe.throw(exception_message) - -def make_new_document(reference_doc, date_field, posting_date): - new_document = frappe.copy_doc(reference_doc, ignore_no_copy=False) - mcount = month_map[reference_doc.recurring_type] - - from_date = get_next_date(reference_doc.from_date, mcount) - - # get last day of the month to maintain period if the from date is first day of its own month - # and to date is the last day of its own month - if (cstr(get_first_day(reference_doc.from_date)) == cstr(reference_doc.from_date)) and \ - (cstr(get_last_day(reference_doc.to_date)) == cstr(reference_doc.to_date)): - to_date = get_last_day(get_next_date(reference_doc.to_date, mcount)) - else: - to_date = get_next_date(reference_doc.to_date, mcount) - - new_document.update({ - date_field: posting_date, - "from_date": from_date, - "to_date": to_date, - "next_date": get_next_date(reference_doc.next_date, mcount,cint(reference_doc.repeat_on_day_of_month)) - }) - - if new_document.meta.get_field('set_posting_time'): - new_document.set('set_posting_time', 1) - - # copy document fields - for fieldname in ("owner", "recurring_type", "repeat_on_day_of_month", - "recurring_id", "notification_email_address", "is_recurring", "end_date", - "title", "naming_series", "select_print_heading", "ignore_pricing_rule", - "posting_time", "remarks", 'submit_on_creation'): - if new_document.meta.get_field(fieldname): - new_document.set(fieldname, reference_doc.get(fieldname)) - - # copy item fields - for i, item in enumerate(new_document.items): - for fieldname in ("page_break",): - item.set(fieldname, reference_doc.items[i].get(fieldname)) - - new_document.run_method("on_recurring", reference_doc=reference_doc) - - if reference_doc.submit_on_creation: - new_document.insert() - new_document.submit() - else: - new_document.docstatus=0 - new_document.insert() - - return new_document - -def get_next_date(dt, mcount, day=None): - dt = getdate(dt) - - from dateutil.relativedelta import relativedelta - dt += relativedelta(months=mcount, day=day) - - return dt - -def send_notification(new_rv): - """Notify concerned persons about recurring document generation""" - - frappe.sendmail(new_rv.notification_email_address, - subject= _("New {0}: #{1}").format(new_rv.doctype, new_rv.name), - message = _("Please find attached {0} #{1}").format(new_rv.doctype, new_rv.name), - attachments = [frappe.attach_print(new_rv.doctype, new_rv.name, file_name=new_rv.name, print_format=new_rv.recurring_print_format)]) - -def notify_errors(doc, doctype, party, owner): - from frappe.utils.user import get_system_managers - recipients = get_system_managers(only_name=True) - - frappe.sendmail(recipients + [frappe.db.get_value("User", owner, "email")], - subject="[Urgent] Error while creating recurring %s for %s" % (doctype, doc), - message = frappe.get_template("templates/emails/recurring_document_failed.html").render({ - "type": doctype, - "name": doc, - "party": party - })) - - assign_task_to_owner(doc, doctype, "Recurring Invoice Failed", recipients) - -def assign_task_to_owner(doc, doctype, msg, users): - for d in users: - from frappe.desk.form import assign_to - args = { - 'assign_to' : d, - 'doctype' : doctype, - 'name' : doc, - 'description' : msg, - 'priority' : 'High' - } - assign_to.add(args) - -def validate_recurring_document(doc): - if doc.is_recurring: - validate_notification_email_id(doc) - if not doc.recurring_type: - frappe.throw(_("Please select {0}").format(doc.meta.get_label("recurring_type"))) - - elif not (doc.from_date and doc.to_date): - frappe.throw(_("Period From and Period To dates mandatory for recurring {0}").format(doc.doctype)) - -def validate_recurring_next_date(doc): - posting_date = doc.get("posting_date") or doc.get("transaction_date") - if getdate(posting_date) > getdate(doc.next_date): - frappe.throw(_("Next Date must be greater than Posting Date")) - - next_date = getdate(doc.next_date) - if next_date.day != doc.repeat_on_day_of_month: - - # if the repeat day is the last day of the month (31) - # and the current month does not have as many days, - # then the last day of the current month is a valid date - lastday = calendar.monthrange(next_date.year, next_date.month)[1] - if doc.repeat_on_day_of_month < lastday: - - # the specified day of the month is not same as the day specified - # or the last day of the month - frappe.throw(_("Next Date's day and Repeat on Day of Month must be equal")) - -def convert_to_recurring(doc, posting_date): - if doc.is_recurring: - if not doc.recurring_id: - doc.db_set("recurring_id", doc.name) - - set_next_date(doc, posting_date) - - if doc.next_date: - validate_recurring_next_date(doc) - - elif doc.recurring_id: - doc.db_set("recurring_id", None) - -def validate_notification_email_id(doc): - if doc.notify_by_email: - if doc.notification_email_address: - email_list = split_emails(doc.notification_email_address.replace("\n", "")) - - from frappe.utils import validate_email_add - for email in email_list: - if not validate_email_add(email): - throw(_("{0} is an invalid email address in 'Notification \ - Email Address'").format(email)) - - else: - frappe.throw(_("'Notification Email Addresses' not specified for recurring %s") \ - % doc.doctype) - -def set_next_date(doc, posting_date): - """ Set next date on which recurring document will be created""" - if not doc.repeat_on_day_of_month: - msgprint(_("Please enter 'Repeat on Day of Month' field value"), raise_exception=1) - - next_date = get_next_date(posting_date, month_map[doc.recurring_type], - cint(doc.repeat_on_day_of_month)) - - doc.db_set('next_date', next_date) - - msgprint(_("Next Recurring {0} will be created on {1}").format(doc.doctype, next_date)) diff --git a/erpnext/controllers/tests/test_recurring_document.py b/erpnext/controllers/tests/test_recurring_document.py deleted file mode 100644 index d47c5c7701..0000000000 --- a/erpnext/controllers/tests/test_recurring_document.py +++ /dev/null @@ -1,149 +0,0 @@ -# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors -# License: GNU General Public License v3. See license.txt -from __future__ import unicode_literals - -import frappe -import frappe.permissions -from erpnext.controllers.recurring_document import date_field_map -from frappe.utils import get_first_day, get_last_day, add_to_date, nowdate, getdate, add_days - -def test_recurring_document(obj, test_records): - frappe.db.set_value("Print Settings", "Print Settings", "send_print_as_pdf", 1) - today = nowdate() - base_doc = frappe.copy_doc(test_records[0]) - - base_doc.update({ - "is_recurring": 1, - "submit_on_create": 1, - "recurring_type": "Monthly", - "notification_email_address": "test@example.com, test1@example.com, test2@example.com", - "repeat_on_day_of_month": getdate(today).day, - "due_date": None, - "from_date": get_first_day(today), - "to_date": get_last_day(today) - }) - - date_field = date_field_map[base_doc.doctype] - base_doc.set(date_field, today) - - if base_doc.doctype == "Sales Order": - base_doc.set("delivery_date", add_days(today, 15)) - - # monthly - doc1 = frappe.copy_doc(base_doc) - doc1.insert() - doc1.submit() - _test_recurring_document(obj, doc1, date_field, True) - - # monthly without a first and last day period - if getdate(today).day != 1: - doc2 = frappe.copy_doc(base_doc) - doc2.update({ - "from_date": today, - "to_date": add_to_date(today, days=30) - }) - doc2.insert() - doc2.submit() - _test_recurring_document(obj, doc2, date_field, False) - - # quarterly - doc3 = frappe.copy_doc(base_doc) - doc3.update({ - "recurring_type": "Quarterly", - "from_date": get_first_day(today), - "to_date": get_last_day(add_to_date(today, months=3)) - }) - doc3.insert() - doc3.submit() - _test_recurring_document(obj, doc3, date_field, True) - - # quarterly without a first and last day period - doc4 = frappe.copy_doc(base_doc) - doc4.update({ - "recurring_type": "Quarterly", - "from_date": today, - "to_date": add_to_date(today, months=3) - }) - doc4.insert() - doc4.submit() - _test_recurring_document(obj, doc4, date_field, False) - - # yearly - doc5 = frappe.copy_doc(base_doc) - doc5.update({ - "recurring_type": "Yearly", - "from_date": get_first_day(today), - "to_date": get_last_day(add_to_date(today, years=1)) - }) - doc5.insert() - doc5.submit() - _test_recurring_document(obj, doc5, date_field, True) - - # yearly without a first and last day period - doc6 = frappe.copy_doc(base_doc) - doc6.update({ - "recurring_type": "Yearly", - "from_date": today, - "to_date": add_to_date(today, years=1) - }) - doc6.insert() - doc6.submit() - _test_recurring_document(obj, doc6, date_field, False) - - # change date field but keep recurring day to be today - doc7 = frappe.copy_doc(base_doc) - doc7.update({ - date_field: today, - }) - doc7.insert() - doc7.submit() - - # setting so that _test function works - # doc7.set(date_field, today) - _test_recurring_document(obj, doc7, date_field, True) - -def _test_recurring_document(obj, base_doc, date_field, first_and_last_day): - from frappe.utils import add_months, get_last_day - from erpnext.controllers.recurring_document import manage_recurring_documents, \ - get_next_date - - no_of_months = ({"Monthly": 1, "Quarterly": 3, "Yearly": 12})[base_doc.recurring_type] - - def _test(i): - obj.assertEquals(i+1, frappe.db.sql("""select count(*) from `tab%s` - where recurring_id=%s and (docstatus=1 or docstatus=0)""" % (base_doc.doctype, '%s'), - (base_doc.recurring_id))[0][0]) - - next_date = get_next_date(base_doc.get(date_field), no_of_months, - base_doc.repeat_on_day_of_month) - - manage_recurring_documents(base_doc.doctype, next_date=next_date, commit=False) - - recurred_documents = frappe.db.sql("""select name from `tab%s` - where recurring_id=%s and (docstatus=1 or docstatus=0) order by name desc""" - % (base_doc.doctype, '%s'), (base_doc.recurring_id)) - - obj.assertEquals(i+2, len(recurred_documents)) - - new_doc = frappe.get_doc(base_doc.doctype, recurred_documents[0][0]) - - for fieldname in ["is_recurring", "recurring_type", - "repeat_on_day_of_month", "notification_email_address"]: - obj.assertEquals(base_doc.get(fieldname), - new_doc.get(fieldname)) - - obj.assertEquals(new_doc.get(date_field), getdate(next_date)) - - obj.assertEquals(new_doc.from_date, getdate(add_months(base_doc.from_date, no_of_months))) - - if first_and_last_day: - obj.assertEquals(new_doc.to_date, getdate(get_last_day(add_months(base_doc.to_date, no_of_months)))) - else: - obj.assertEquals(new_doc.to_date, getdate(add_months(base_doc.to_date, no_of_months))) - - return new_doc - - # if yearly, test 1 repetition, else test 5 repetitions - count = 1 if (no_of_months == 12) else 5 - for i in xrange(count): - base_doc = _test(i) diff --git a/erpnext/docs/assets/img/articles/brand-logo.gif b/erpnext/docs/assets/img/articles/brand-logo.gif new file mode 100644 index 0000000000..99a10d3b34 Binary files /dev/null and b/erpnext/docs/assets/img/articles/brand-logo.gif differ diff --git a/erpnext/docs/assets/img/articles/download-backup-1.png b/erpnext/docs/assets/img/articles/download-backup-1.png new file mode 100644 index 0000000000..93597f453f Binary files /dev/null and b/erpnext/docs/assets/img/articles/download-backup-1.png differ diff --git a/erpnext/docs/assets/img/articles/download-backup-2.gif b/erpnext/docs/assets/img/articles/download-backup-2.gif new file mode 100644 index 0000000000..4109dff018 Binary files /dev/null and b/erpnext/docs/assets/img/articles/download-backup-2.gif differ diff --git a/erpnext/docs/assets/img/articles/email-error.png b/erpnext/docs/assets/img/articles/email-error.png new file mode 100644 index 0000000000..e8c5d73dc3 Binary files /dev/null and b/erpnext/docs/assets/img/articles/email-error.png differ diff --git a/erpnext/docs/assets/img/articles/fetching-1.png b/erpnext/docs/assets/img/articles/fetching-1.png new file mode 100644 index 0000000000..fcf3fcbac2 Binary files /dev/null and b/erpnext/docs/assets/img/articles/fetching-1.png differ diff --git a/erpnext/docs/assets/img/articles/fetching-2.png b/erpnext/docs/assets/img/articles/fetching-2.png new file mode 100644 index 0000000000..c5594d56f4 Binary files /dev/null and b/erpnext/docs/assets/img/articles/fetching-2.png differ diff --git a/erpnext/docs/assets/img/articles/fetching-3.gif b/erpnext/docs/assets/img/articles/fetching-3.gif new file mode 100644 index 0000000000..5deea3e5f8 Binary files /dev/null and b/erpnext/docs/assets/img/articles/fetching-3.gif differ diff --git a/erpnext/docs/assets/img/articles/item-valuation-1.png b/erpnext/docs/assets/img/articles/item-valuation-1.png new file mode 100644 index 0000000000..16bde1d120 Binary files /dev/null and b/erpnext/docs/assets/img/articles/item-valuation-1.png differ diff --git a/erpnext/docs/assets/img/articles/item-valuation-2.png b/erpnext/docs/assets/img/articles/item-valuation-2.png new file mode 100644 index 0000000000..cc8b8442f3 Binary files /dev/null and b/erpnext/docs/assets/img/articles/item-valuation-2.png differ diff --git a/erpnext/docs/assets/img/articles/purchase-return.gif b/erpnext/docs/assets/img/articles/purchase-return.gif new file mode 100644 index 0000000000..de5f18cf33 Binary files /dev/null and b/erpnext/docs/assets/img/articles/purchase-return.gif differ diff --git a/erpnext/docs/assets/img/articles/report-header-1.png b/erpnext/docs/assets/img/articles/report-header-1.png new file mode 100644 index 0000000000..848c3018bb Binary files /dev/null and b/erpnext/docs/assets/img/articles/report-header-1.png differ diff --git a/erpnext/docs/assets/img/articles/report-header-2.png b/erpnext/docs/assets/img/articles/report-header-2.png new file mode 100644 index 0000000000..47d86958be Binary files /dev/null and b/erpnext/docs/assets/img/articles/report-header-2.png differ diff --git a/erpnext/docs/assets/img/project/timesheet/make_invoice_from_timesheet.gif b/erpnext/docs/assets/img/project/timesheet/make_invoice_from_timesheet.gif new file mode 100644 index 0000000000..90cc6d6e86 Binary files /dev/null and b/erpnext/docs/assets/img/project/timesheet/make_invoice_from_timesheet.gif differ diff --git a/erpnext/docs/assets/img/schools/admission/program-enrollment-tool.gif b/erpnext/docs/assets/img/schools/admission/program-enrollment-tool.gif new file mode 100644 index 0000000000..c25b179967 Binary files /dev/null and b/erpnext/docs/assets/img/schools/admission/program-enrollment-tool.gif differ diff --git a/erpnext/docs/assets/img/schools/admission/program-enrollment-tool01.gif b/erpnext/docs/assets/img/schools/admission/program-enrollment-tool01.gif new file mode 100644 index 0000000000..8b1f6314be Binary files /dev/null and b/erpnext/docs/assets/img/schools/admission/program-enrollment-tool01.gif differ diff --git a/erpnext/docs/assets/img/schools/admission/program-enrollment.gif b/erpnext/docs/assets/img/schools/admission/program-enrollment.gif new file mode 100644 index 0000000000..616ab17df9 Binary files /dev/null and b/erpnext/docs/assets/img/schools/admission/program-enrollment.gif differ diff --git a/erpnext/docs/assets/img/schools/admission/program-enrollment.png b/erpnext/docs/assets/img/schools/admission/program-enrollment.png deleted file mode 100644 index df96f3c320..0000000000 Binary files a/erpnext/docs/assets/img/schools/admission/program-enrollment.png and /dev/null differ diff --git a/erpnext/docs/assets/img/schools/admission/student-applicant-enroll.png b/erpnext/docs/assets/img/schools/admission/student-applicant-enroll.png index fb92a679df..7cf5e75be4 100644 Binary files a/erpnext/docs/assets/img/schools/admission/student-applicant-enroll.png and b/erpnext/docs/assets/img/schools/admission/student-applicant-enroll.png differ diff --git a/erpnext/docs/assets/img/schools/admission/student-application-actions.png b/erpnext/docs/assets/img/schools/admission/student-application-actions.png new file mode 100644 index 0000000000..e3a4c15ec1 Binary files /dev/null and b/erpnext/docs/assets/img/schools/admission/student-application-actions.png differ diff --git a/erpnext/docs/assets/img/schools/schedule/student-attendance.gif b/erpnext/docs/assets/img/schools/schedule/student-attendance.gif new file mode 100644 index 0000000000..82549d4692 Binary files /dev/null and b/erpnext/docs/assets/img/schools/schedule/student-attendance.gif differ diff --git a/erpnext/docs/assets/img/schools/schedule/student-leave-application.gif b/erpnext/docs/assets/img/schools/schedule/student-leave-application.gif new file mode 100644 index 0000000000..3b09fac27b Binary files /dev/null and b/erpnext/docs/assets/img/schools/schedule/student-leave-application.gif differ diff --git a/erpnext/docs/assets/img/schools/setup/Course-schedule-error.png b/erpnext/docs/assets/img/schools/setup/Course-schedule-error.png new file mode 100644 index 0000000000..d9913d857a Binary files /dev/null and b/erpnext/docs/assets/img/schools/setup/Course-schedule-error.png differ diff --git a/erpnext/docs/assets/img/schools/setup/Room-Assesment-plan.png b/erpnext/docs/assets/img/schools/setup/Room-Assesment-plan.png new file mode 100644 index 0000000000..4b23cd7ea3 Binary files /dev/null and b/erpnext/docs/assets/img/schools/setup/Room-Assesment-plan.png differ diff --git a/erpnext/docs/assets/img/schools/setup/course-fee-program.png b/erpnext/docs/assets/img/schools/setup/course-fee-program.png new file mode 100644 index 0000000000..c8527d04e0 Binary files /dev/null and b/erpnext/docs/assets/img/schools/setup/course-fee-program.png differ diff --git a/erpnext/docs/assets/img/schools/setup/setup-section.png b/erpnext/docs/assets/img/schools/setup/setup-section.png deleted file mode 100644 index c02bbc4733..0000000000 Binary files a/erpnext/docs/assets/img/schools/setup/setup-section.png and /dev/null differ diff --git a/erpnext/docs/assets/img/schools/setup/student-attendance-tool.gif b/erpnext/docs/assets/img/schools/setup/student-attendance-tool.gif new file mode 100644 index 0000000000..c8c1c05e80 Binary files /dev/null and b/erpnext/docs/assets/img/schools/setup/student-attendance-tool.gif differ diff --git a/erpnext/docs/assets/img/schools/setup/student-group-instructor.png b/erpnext/docs/assets/img/schools/setup/student-group-instructor.png new file mode 100644 index 0000000000..d9457a6d9c Binary files /dev/null and b/erpnext/docs/assets/img/schools/setup/student-group-instructor.png differ diff --git a/erpnext/docs/assets/img/schools/student/guardian.png b/erpnext/docs/assets/img/schools/student/guardian.png new file mode 100644 index 0000000000..01045be490 Binary files /dev/null and b/erpnext/docs/assets/img/schools/student/guardian.png differ diff --git a/erpnext/docs/assets/img/schools/student/schools-settings.png b/erpnext/docs/assets/img/schools/student/schools-settings.png new file mode 100644 index 0000000000..8a71ac92ed Binary files /dev/null and b/erpnext/docs/assets/img/schools/student/schools-settings.png differ diff --git a/erpnext/docs/assets/img/schools/student/student group.gif b/erpnext/docs/assets/img/schools/student/student group.gif new file mode 100644 index 0000000000..13b1cf4342 Binary files /dev/null and b/erpnext/docs/assets/img/schools/student/student group.gif differ diff --git a/erpnext/docs/assets/img/schools/student/student-admission.gif b/erpnext/docs/assets/img/schools/student/student-admission.gif new file mode 100644 index 0000000000..a9ce8dc9b5 Binary files /dev/null and b/erpnext/docs/assets/img/schools/student/student-admission.gif differ diff --git a/erpnext/docs/assets/img/schools/student/student-batch-validation.gif b/erpnext/docs/assets/img/schools/student/student-batch-validation.gif new file mode 100644 index 0000000000..dd9f0e821d Binary files /dev/null and b/erpnext/docs/assets/img/schools/student/student-batch-validation.gif differ diff --git a/erpnext/docs/assets/img/schools/student/student-batch.gif b/erpnext/docs/assets/img/schools/student/student-batch.gif new file mode 100644 index 0000000000..43bae7734d Binary files /dev/null and b/erpnext/docs/assets/img/schools/student/student-batch.gif differ diff --git a/erpnext/docs/assets/img/schools/student/student-batch.png b/erpnext/docs/assets/img/schools/student/student-batch.png deleted file mode 100644 index 75a33140cc..0000000000 Binary files a/erpnext/docs/assets/img/schools/student/student-batch.png and /dev/null differ diff --git a/erpnext/docs/assets/img/schools/student/student-course-validation.gif b/erpnext/docs/assets/img/schools/student/student-course-validation.gif new file mode 100644 index 0000000000..6ab9d00472 Binary files /dev/null and b/erpnext/docs/assets/img/schools/student/student-course-validation.gif differ diff --git a/erpnext/docs/assets/img/schools/student/student-group-attendance.gif b/erpnext/docs/assets/img/schools/student/student-group-attendance.gif new file mode 100644 index 0000000000..da9aa1ac26 Binary files /dev/null and b/erpnext/docs/assets/img/schools/student/student-group-attendance.gif differ diff --git a/erpnext/docs/assets/img/schools/student/student-group-creation-tool.gif b/erpnext/docs/assets/img/schools/student/student-group-creation-tool.gif new file mode 100644 index 0000000000..1fe1a6f020 Binary files /dev/null and b/erpnext/docs/assets/img/schools/student/student-group-creation-tool.gif differ diff --git a/erpnext/docs/assets/img/schools/student/student-group-creation-tool.png b/erpnext/docs/assets/img/schools/student/student-group-creation-tool.png deleted file mode 100644 index 32e6498f8b..0000000000 Binary files a/erpnext/docs/assets/img/schools/student/student-group-creation-tool.png and /dev/null differ diff --git a/erpnext/docs/assets/img/schools/student/student-group.png b/erpnext/docs/assets/img/schools/student/student-group.png deleted file mode 100644 index c562b00132..0000000000 Binary files a/erpnext/docs/assets/img/schools/student/student-group.png and /dev/null differ diff --git a/erpnext/docs/assets/img/subscription/__init__.py b/erpnext/docs/assets/img/subscription/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/assets/img/subscription/subscription.gif b/erpnext/docs/assets/img/subscription/subscription.gif new file mode 100644 index 0000000000..68488053d6 Binary files /dev/null and b/erpnext/docs/assets/img/subscription/subscription.gif differ diff --git a/erpnext/docs/assets/img/subscription/subscription.png b/erpnext/docs/assets/img/subscription/subscription.png new file mode 100644 index 0000000000..8b2cdc3029 Binary files /dev/null and b/erpnext/docs/assets/img/subscription/subscription.png differ diff --git a/erpnext/docs/user/manual/en/accounts/articles/freeze-account.md b/erpnext/docs/user/manual/en/accounts/articles/freeze-account.md new file mode 100644 index 0000000000..3582c28124 --- /dev/null +++ b/erpnext/docs/user/manual/en/accounts/articles/freeze-account.md @@ -0,0 +1,13 @@ +# Freeze an Account + +Once an Account is Frozen, you won't be able to use it any accounting transaction. Since this is a critical action, you need to explicitly define a Role who can set an Account as Frozen. You can define this Role in the Account Settings. + +`Accounts > Account Settings` + +To freeze an Account, go to Chart of Accounts, and edit an Account. + + + +If User has Role define in the Account Setting assigned, then he/she will be able to set an Account as Frozen. + + \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/accounts/articles/index.txt b/erpnext/docs/user/manual/en/accounts/articles/index.txt index 8b7768a2d1..af8572c233 100644 --- a/erpnext/docs/user/manual/en/accounts/articles/index.txt +++ b/erpnext/docs/user/manual/en/accounts/articles/index.txt @@ -13,4 +13,5 @@ what-is-the-differences-of-total-and-valuation-in-tax-and-charges withdrawing-salary-from-owners-equity-account adjust-withhold-amount-payment-entry common-receivable-account.md -types-in-tax-template \ No newline at end of file +types-in-tax-template +freeze-account \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/customize-erpnext/articles/fetching-data-from-a-document.md b/erpnext/docs/user/manual/en/customize-erpnext/articles/fetching-data-from-a-document.md new file mode 100644 index 0000000000..04b20ac4b9 --- /dev/null +++ b/erpnext/docs/user/manual/en/customize-erpnext/articles/fetching-data-from-a-document.md @@ -0,0 +1,19 @@ +# Fetching Data from one Document to Another + +**Question:** We track Customer's PO No and PO Date field in the Sales Order. To have these values fetched into Sales Invoice as well, we have inserted Custom Field in the Sales Invoice. However, when we create Sales Invoice from the Sales Order, Customer's PO details are not being fetched. + +**Answer:** When data is fetched from one transaction to the another transaction, then the mapping of data is done based on the field names. If two transactions have fields with the exact same name, then it's values are mapped. + +For example, if you want Customer's PO No. and PO Date to be fetched from Sales Order to Sales Invoice, then you should ensure that Custom Fields added in the Sales Invoice has an exact same field name as in the Sales Order. + +Sales Order (standard fields) + + + +Sales Invoice (custom fields) + + + +Since names for the Customer's PO related fields are same in the Sales Order and Sales Invoice, when creating Sales Invoice from the Sales Order, values in these fields are auto-fetched. + + \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/customize-erpnext/articles/index.txt b/erpnext/docs/user/manual/en/customize-erpnext/articles/index.txt index 1740ef0e94..56e7040b47 100644 --- a/erpnext/docs/user/manual/en/customize-erpnext/articles/index.txt +++ b/erpnext/docs/user/manual/en/customize-erpnext/articles/index.txt @@ -15,4 +15,5 @@ set-language set-precision user-restriction maximum-numbers-of-fields-in-a-form -child-table \ No newline at end of file +child-table +fetching-data-from-a-document \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/human-resources/training.md b/erpnext/docs/user/manual/en/human-resources/training.md index 39b9790246..2aa06791f0 100644 --- a/erpnext/docs/user/manual/en/human-resources/training.md +++ b/erpnext/docs/user/manual/en/human-resources/training.md @@ -9,22 +9,23 @@ Schedule seminars, workshops, conferences etc using Training Event. You can also ### Inviting Employees for Event You can invite your employees to attend the event. You can do so by selecting the employees to be invited in the employee table. + By default the status of the employee will be 'Open'. -The system shall notify the employee with status 'Open' by sending a email to the office email address of the employee as mentioned in the employee master if you have selected 'Send Email' checkbox. -The status is changed to 'Invited' when an invitation email is sent to the employee by the system. -When an Employee confirms his/her presence for the event you can change the status to 'Confirmed'. +When you submit the Training Event, a notifcation will be sent to the employee notifying that the Training has been scheduled. This is sent via Email Alert "Training Scheduled". You can modifiy this Email Alert to customize the message. + ### Training Result -After compleation of the training Employee Wise training results can be stored based on the Feedback received from the Trainer. +After compleation of the training Employee-wise training results can be stored based on the Feedback received from the Trainer. +When the Training Result is submitted, all the employees will receive an email notifying them that they must share their feedback via "Training Feedback". This is also managed via an Email Alert, so you can customize this alert too. -### Trainig Feedback +### Training Feedback -Collect feedback regarding the event from your Employees using Training Feedback. +Employees can then share their feedback via Training Feedback. diff --git a/erpnext/docs/user/manual/en/index.txt b/erpnext/docs/user/manual/en/index.txt index fff4da7d8e..712ab8eabd 100644 --- a/erpnext/docs/user/manual/en/index.txt +++ b/erpnext/docs/user/manual/en/index.txt @@ -9,6 +9,7 @@ manufacturing projects support human-resources +subscription customer-portal website using-erpnext diff --git a/erpnext/docs/user/manual/en/projects/timesheet/sales-invoice-from-timesheet.md b/erpnext/docs/user/manual/en/projects/timesheet/sales-invoice-from-timesheet.md index 9be2bad0e2..4dbdcbb6dc 100644 --- a/erpnext/docs/user/manual/en/projects/timesheet/sales-invoice-from-timesheet.md +++ b/erpnext/docs/user/manual/en/projects/timesheet/sales-invoice-from-timesheet.md @@ -48,6 +48,8 @@ In the Timesheet, if "Is Billable" is checked, you will find option to create Sa + + ####Sales Invoice Sales Invoice has dedicated table for the Timesheet table where Timesheet details will be updated. You can select more Timesheets in this table. diff --git a/erpnext/docs/user/manual/en/schools/Assessment/assessment_criteria_group.md b/erpnext/docs/user/manual/en/schools/Assessment/assessment_criteria_group.md new file mode 100644 index 0000000000..4287ca8617 --- /dev/null +++ b/erpnext/docs/user/manual/en/schools/Assessment/assessment_criteria_group.md @@ -0,0 +1 @@ +# \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/Attendance/__init__.py b/erpnext/docs/user/manual/en/schools/Attendance/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/schools/Attendance/index.md b/erpnext/docs/user/manual/en/schools/Attendance/index.md new file mode 100644 index 0000000000..3153a59022 --- /dev/null +++ b/erpnext/docs/user/manual/en/schools/Attendance/index.md @@ -0,0 +1,6 @@ +#Attendance + + +### Topics + +{index} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/Attendance/index.txt b/erpnext/docs/user/manual/en/schools/Attendance/index.txt new file mode 100644 index 0000000000..8cd02627a2 --- /dev/null +++ b/erpnext/docs/user/manual/en/schools/Attendance/index.txt @@ -0,0 +1,3 @@ +student-attendance +student-leave-application +student-attendance-tool \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/Attendance/student-attendance-tool.md b/erpnext/docs/user/manual/en/schools/Attendance/student-attendance-tool.md new file mode 100644 index 0000000000..5c4ce3072a --- /dev/null +++ b/erpnext/docs/user/manual/en/schools/Attendance/student-attendance-tool.md @@ -0,0 +1,15 @@ +# Student Attendance Tool + +The Student Attendance tool allow you to bulk update the attendance for students based on **Student Group and Course Schedule**. + +To mark the **Attedance* based on Student Group select the group based on + +**1. Batch + 2. Course + 3. Activity ** + +Student detials will be autofetched and you can mark the attendance of the given date. + + + +{next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/Attendance/student-attendance.md b/erpnext/docs/user/manual/en/schools/Attendance/student-attendance.md new file mode 100644 index 0000000000..1b917d0ae2 --- /dev/null +++ b/erpnext/docs/user/manual/en/schools/Attendance/student-attendance.md @@ -0,0 +1,15 @@ +# Student Attendance + +Attendance doctype allows you to track and manage attendance of a student in all the days at any time. The Attendance module is designed to help teachers easily mark student attendance during class. + +Attendance Records can be created against Student on daily basis. + +To create Attendance record : + +Select the **Student, Course Schedule and Student Group** for which attendance is to be marked for the given date. Set the Status to Present/Absent and save. + + + +**Student Attendance tool** can be used for bulk updation of the attendance based on **Batch, Course or Activity**. + +{next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/Attendance/student-leave-application.md b/erpnext/docs/user/manual/en/schools/Attendance/student-leave-application.md new file mode 100644 index 0000000000..5620bdadd7 --- /dev/null +++ b/erpnext/docs/user/manual/en/schools/Attendance/student-leave-application.md @@ -0,0 +1,13 @@ +#Student Leave Application + +ERPNext allows you to record the leave application for a student. + +To create a Student Leave application record, enter the Student and the date for the leave is applied and save. + + + +Incase the student is not attending the school in order to participate or represent school in any event, he/she can be mark as present from the Leave Application itself. + +Once a Leave Application is recorded for a student it will not be recorded in the absent student report as he has applied for a leave. + +{next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/admission/index.md b/erpnext/docs/user/manual/en/schools/admission/index.md index 87cdfe5c89..b602271bbb 100644 --- a/erpnext/docs/user/manual/en/schools/admission/index.md +++ b/erpnext/docs/user/manual/en/schools/admission/index.md @@ -1,6 +1,6 @@ # Admission -This section contains student admission related documents. +The Admission section allow you to create all records starting from Student application till the program enrollment. Below is the list of documents for Student addmission. ### Topics diff --git a/erpnext/docs/user/manual/en/schools/admission/index.txt b/erpnext/docs/user/manual/en/schools/admission/index.txt index ec9e768116..680d779089 100644 --- a/erpnext/docs/user/manual/en/schools/admission/index.txt +++ b/erpnext/docs/user/manual/en/schools/admission/index.txt @@ -1,2 +1,4 @@ +student-admission student-applicant -program-enrollment \ No newline at end of file +program-enrollment +program-enrollment-Tool diff --git a/erpnext/docs/user/manual/en/schools/admission/program-enrollment-tool.md b/erpnext/docs/user/manual/en/schools/admission/program-enrollment-tool.md new file mode 100644 index 0000000000..2a2fa1e58e --- /dev/null +++ b/erpnext/docs/user/manual/en/schools/admission/program-enrollment-tool.md @@ -0,0 +1,16 @@ +# Program Enrollment Tool + +The Program Enrollment tool allows the bulk enrollment of the **Student Applicants** in a Program. + + +You can create the the Program Enrollment for : + +1. **Student Applicants** >> List of Student Applicants will be fetched for the selected **Program** and **Academic year**. + + + +2. **Program Enrollment** >> You can bulk update the **Program** for the students from one academic year to another in the same **Program** or a new **Program**. + + + +{next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/admission/program-enrollment.md b/erpnext/docs/user/manual/en/schools/admission/program-enrollment.md index 2dcc6cb2ce..cc1308cf6c 100644 --- a/erpnext/docs/user/manual/en/schools/admission/program-enrollment.md +++ b/erpnext/docs/user/manual/en/schools/admission/program-enrollment.md @@ -1,7 +1,12 @@ # Program Enrollment -This form allows you to enroll a student to a program. A student can be enrolled to multiple programs. +Program Enrollment describes an educational model where students must complete a defined set of courses towards their academic objective in a specified sequence. Enrollment is a program driven process in which the student select the Program to enrol for in a Academic Year. - +Once a student have applied for the **Program** and the application is approved, the program enrollment is done for that student. + + + +- A student can be enrolled in multiple Course for a program in a given academeic year. +- Based on the Fee structure selected at the time of enrollment Fee detials are created of the student. {next} diff --git a/erpnext/docs/user/manual/en/schools/admission/student-applicant.md b/erpnext/docs/user/manual/en/schools/admission/student-applicant.md index e67c1dc79e..22d370939d 100644 --- a/erpnext/docs/user/manual/en/schools/admission/student-applicant.md +++ b/erpnext/docs/user/manual/en/schools/admission/student-applicant.md @@ -18,7 +18,9 @@ You can Approve or Reject a student applicant. By accepting a student applicant and will not allow you to change the application status unless the student record is deleted. ### Student Enrollment +Once the form is submitted you can either approve or reject the application form. + Once you approve a Student Applicant you can enroll them to a program. When you click the 'Enroll' buttom, the system shall create a student against that applicant and redirect you to the [Program Enrollment form](/docs/user/manual/en/schools/student/program-enrollment.html). diff --git a/erpnext/docs/user/manual/en/schools/admission/student_admission.md b/erpnext/docs/user/manual/en/schools/admission/student_admission.md new file mode 100644 index 0000000000..eeaa977912 --- /dev/null +++ b/erpnext/docs/user/manual/en/schools/admission/student_admission.md @@ -0,0 +1,13 @@ +# Student Admission + +The admission process begins with filling the admission form. The Student Admission record enables to intitate your admission process for a given **Academic year**. ERPNext admission module allow you to create an admission record which can be then published on the ERPNext generate website. + +To create a Student Admission record go to : + +**Schools** >> **Admissions** >> **Student Admission** >> + + + + + +Once a admission record is created it can be published on the website and the student can apply from the web portal itself. \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/index.md b/erpnext/docs/user/manual/en/schools/index.md index 8c766d6db4..d317d39bfa 100644 --- a/erpnext/docs/user/manual/en/schools/index.md +++ b/erpnext/docs/user/manual/en/schools/index.md @@ -1,7 +1,7 @@ # Schools -The School Modules is designed to meet requirements of Schools, Colleges & Educational Institutes. +The School Modules in ERPNext is designed to meet requirements of Schools, Colleges & Educational Institutes. This is a centralized system, which maintains and updates all the activities related to an Institution. This will ease the process of each and every aspect of a School, be it Students, Admission, Examination and Fee. diff --git a/erpnext/docs/user/manual/en/schools/index.txt b/erpnext/docs/user/manual/en/schools/index.txt index b485fdcfea..159089c6f3 100644 --- a/erpnext/docs/user/manual/en/schools/index.txt +++ b/erpnext/docs/user/manual/en/schools/index.txt @@ -1,6 +1,7 @@ student admission +Attendance schedule fees setup -assessment \ No newline at end of file +Assessment \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/schedule/student-attendance.md b/erpnext/docs/user/manual/en/schools/schedule/student-attendance.md deleted file mode 100644 index 84e1ea8669..0000000000 --- a/erpnext/docs/user/manual/en/schools/schedule/student-attendance.md +++ /dev/null @@ -1,7 +0,0 @@ -# Student Attendance - -Maintains attendance record of the student. Attendance Records can be created against Course Schedules. - - - -{next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/setup/academic-term.md b/erpnext/docs/user/manual/en/schools/setup/academic-term.md index 6306444b61..b52bea7108 100644 --- a/erpnext/docs/user/manual/en/schools/setup/academic-term.md +++ b/erpnext/docs/user/manual/en/schools/setup/academic-term.md @@ -1,5 +1,9 @@ # Academic Term +An academic term (or simply "term") is a portion of an academic year, the time during which an educational institution holds classes. The schedules adopted vary widely. The academic term can be a quater, trimester or a semester. + +The **Academic term** form in ERPNext enables you to create academic terms within in a year. Based on the term schedule enter the start and end date for the schedule and generate the term for a Academic year. + diff --git a/erpnext/docs/user/manual/en/schools/setup/academic-year.md b/erpnext/docs/user/manual/en/schools/setup/academic-year.md index 3913eb634b..4fc5f929a5 100644 --- a/erpnext/docs/user/manual/en/schools/setup/academic-year.md +++ b/erpnext/docs/user/manual/en/schools/setup/academic-year.md @@ -1,5 +1,11 @@ # Academic Year +An academic year is a period of time which schools, colleges and universities use to measure a quantity of study. + +The **Academic year** form have the Start and End date for the Academic year. + -{next} \ No newline at end of file +**Student group** link is given to view or add the respective groups to the Academic year. + +{next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/setup/course.md b/erpnext/docs/user/manual/en/schools/setup/course.md index 140131dccd..dc10ed54b1 100644 --- a/erpnext/docs/user/manual/en/schools/setup/course.md +++ b/erpnext/docs/user/manual/en/schools/setup/course.md @@ -1,5 +1,15 @@ # Course + A course is a unit of teaching that typically lasts one academic term, is led by one or more instructors (teachers or professors), and has a fixed number of students. Students may receive a grade and academic credit after completion of the course. + +To create a **Course** enter the Course name and Code. Code for the course should be unique for every course. You can also link the department under which the course is conducted. + +Once a **Course** is created, a course schedule can defined for the same. + + + +The Course form is further linked to **Program, Student Group and Assessment Plan** doctypes. The links allow to view/create the related documents for a **Course**. + {next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/setup/index.md b/erpnext/docs/user/manual/en/schools/setup/index.md index 9de753614c..4e0915277b 100644 --- a/erpnext/docs/user/manual/en/schools/setup/index.md +++ b/erpnext/docs/user/manual/en/schools/setup/index.md @@ -1,5 +1,7 @@ # Setup +The Setup section of Schools module provides facility to make some basic configuration. Below are doctypes for basic configuration. + ### Topics diff --git a/erpnext/docs/user/manual/en/schools/setup/index.txt b/erpnext/docs/user/manual/en/schools/setup/index.txt index fb9ba05d09..8fb9bb2def 100644 --- a/erpnext/docs/user/manual/en/schools/setup/index.txt +++ b/erpnext/docs/user/manual/en/schools/setup/index.txt @@ -2,5 +2,8 @@ course program instructor room +student-category +student-batch-name academic-term -academic-year \ No newline at end of file +academic-year +school-settings \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/setup/instructor.md b/erpnext/docs/user/manual/en/schools/setup/instructor.md index 1a4d35161c..6150f025fe 100644 --- a/erpnext/docs/user/manual/en/schools/setup/instructor.md +++ b/erpnext/docs/user/manual/en/schools/setup/instructor.md @@ -1,5 +1,18 @@ # Instructor +An instructoe is a teacher, or professor, of a specialised subject that involves skill. + +You can create an Instructor and link it to the Employee master and a Departmemt. + +An **Instructor** is further linked to a **Course Schedule**, where you can define the schedule for a **Course** for a give date and **Room no**. + + +It is also linked to **Student group** where an **Instructor** is assigned to the Student group. + + + +An **Instructor** is also linked to an **Assesment Plan** for a Student group. The Instructor can be an Examiner or the supervisor for the assesment. + {next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/setup/program.md b/erpnext/docs/user/manual/en/schools/setup/program.md index 64513e20b0..be10166e7b 100644 --- a/erpnext/docs/user/manual/en/schools/setup/program.md +++ b/erpnext/docs/user/manual/en/schools/setup/program.md @@ -1,5 +1,19 @@ # Program +An educational program is a program written by the institutions which determines the learning progress of each subject in all the stages of formal education. + +To create a Program go to : + +###Schools >> Setup >> Program >> New Program + +Enter a unique code for every **Program**. You can also link the **Program** to the department under which it is conducted. + +Add the relevant Course and the Fee details for a program. + + + +The Program Doctype is further linked to the **Student applicant**, **Program enrollment, Student group, Fee structre and Fee**. The links allow to view or create the related document for a Program. + {next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/setup/room.md b/erpnext/docs/user/manual/en/schools/setup/room.md index bb265e3ea2..43ddde9224 100644 --- a/erpnext/docs/user/manual/en/schools/setup/room.md +++ b/erpnext/docs/user/manual/en/schools/setup/room.md @@ -1,6 +1,17 @@ # Room +A classroom is a space (room or lab) where you want to schedule courses or examinations. A room in an educational institute can be a Class room, a laboratory or a Examination hall. + +The Room doctype allows you to record the room number and the seating capacity for a classroom. Once a room is created Course schedule link is provided in the Room doctype to view or add the course schedule for the classroom. +The course schedule validate the availability of the Room number and an alert message is shown if there is an overlap for the Room number for a given time slot. + + + +The Room number is further linked to the Assesment plan. It validates the availability of examination room for the assessment to be held for a given date and time. + + + {next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/setup/school-settings.md b/erpnext/docs/user/manual/en/schools/setup/school-settings.md new file mode 100644 index 0000000000..ce9e9144b7 --- /dev/null +++ b/erpnext/docs/user/manual/en/schools/setup/school-settings.md @@ -0,0 +1,15 @@ +#School Settings + +The Schools settings page allow you to setup basic settings like **Academic Year and Term** for the Schools setup. + + + +The checkbox to Validate Batch for Students in Student Group enables the Student Batch validation for every Student from the Program Enrollment for the **Batch** based on **Student Group** + + + +You can enable the validation of Course for every Student from the enrolled Courses in Program Enrollment,for Course based Student Group by checking the settings for **Validate Enrolled Course for Students in Student Group** + + + +{next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/setup/student-batch-name.md b/erpnext/docs/user/manual/en/schools/setup/student-batch-name.md new file mode 100644 index 0000000000..056f910863 --- /dev/null +++ b/erpnext/docs/user/manual/en/schools/setup/student-batch-name.md @@ -0,0 +1,10 @@ +# Student Batch + +Student batch is a collection of students from Student Groups. **Student batch** allows you to create **Student Group** based on a batch. When a student is enrolled for a **Program**, the Student batch is selected to enroll the student for the given Program and batch + + + +You can also get a **Student Batch-Wise Attendance** report to view the number of student present from the Batch. + + +{next} diff --git a/erpnext/docs/user/manual/en/schools/setup/student-category.md b/erpnext/docs/user/manual/en/schools/setup/student-category.md new file mode 100644 index 0000000000..0d76927972 --- /dev/null +++ b/erpnext/docs/user/manual/en/schools/setup/student-category.md @@ -0,0 +1,12 @@ +# Student Category + +Student Category doctype allow you to classify student based various categories. In Institutions, there may be fee concession for some categories such as Handicapped students, foreign, nationals, reserved category by the government etc. + +To create Student category go to Setup >> Student Category >> New. + +We can create new student category by adding a name and save it + + + + +{next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/student/guardian.md b/erpnext/docs/user/manual/en/schools/student/guardian.md new file mode 100644 index 0000000000..7bbdbc22c5 --- /dev/null +++ b/erpnext/docs/user/manual/en/schools/student/guardian.md @@ -0,0 +1,9 @@ +#Guardian + +The Guardian doctype allows you to record the guardian details for a **Student**. + + + +The email id added in the **Guardian** detail can be linked to a email group for sending newsletter or announcements. + +{next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/student/index.txt b/erpnext/docs/user/manual/en/schools/student/index.txt index 9b31be4dc9..89704b1fc7 100644 --- a/erpnext/docs/user/manual/en/schools/student/index.txt +++ b/erpnext/docs/user/manual/en/schools/student/index.txt @@ -1,5 +1,6 @@ student +guardian student-log student-batch student-group -student-group-creation-tool +student-group-creation-tool \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/student/student-batch.md b/erpnext/docs/user/manual/en/schools/student/student-batch.md index 4987c0313f..056f910863 100644 --- a/erpnext/docs/user/manual/en/schools/student/student-batch.md +++ b/erpnext/docs/user/manual/en/schools/student/student-batch.md @@ -1,7 +1,10 @@ # Student Batch -Student batch is a collection of students from Student Groups. +Student batch is a collection of students from Student Groups. **Student batch** allows you to create **Student Group** based on a batch. When a student is enrolled for a **Program**, the Student batch is selected to enroll the student for the given Program and batch + + + +You can also get a **Student Batch-Wise Attendance** report to view the number of student present from the Batch. - {next} diff --git a/erpnext/docs/user/manual/en/schools/student/student-group-creation-tool.md b/erpnext/docs/user/manual/en/schools/student/student-group-creation-tool.md index 130c94491e..1cd9b1e796 100644 --- a/erpnext/docs/user/manual/en/schools/student/student-group-creation-tool.md +++ b/erpnext/docs/user/manual/en/schools/student/student-group-creation-tool.md @@ -1,8 +1,17 @@ # Student Group Creation Tool -This tool allows you to create student groups in bulk. You can specify multiple parameters to create them. +The Student group creation tool allows you to create student groups in bulk. +To create Student group using this tool go to - +##Schools >>Student >> Student Group creation tool + +Select the **Academic Term** and the **Program** for which a student group is to be created. + + + +By default the student group is created based on the **Course** only. The check box for "Separate course based Group for every Batch" allows you to create batchwise Student groups for a course. + +You can leave it unchecked if you don't want to consider batch while making course based groups. {next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/student/student-group.md b/erpnext/docs/user/manual/en/schools/student/student-group.md index 191e917a8b..cf3f82c5a2 100644 --- a/erpnext/docs/user/manual/en/schools/student/student-group.md +++ b/erpnext/docs/user/manual/en/schools/student/student-group.md @@ -1,8 +1,22 @@ # Student Group -A student group is a collection of students taking a same course. You can create Course Schedules and Examinations against a Student Group. -A student group needs to be created for every course in a particular academic term and academic year. +A student group is a collection of students taking same course. You can create Course Schedules and Examinations against a Student Group. + +A Student Group needs to be created for every course for **Academic Term** and **Academic Year**. The student group can be create based on **Batch, Course and Activity**. + +To create a Student Group go to: + +Schools >> Student >> New Student Group + + + +To create a Student group based on **Batch**, select the **Progam** and **Batch**, where as to create a Student group based on **Course**, you will only have to select the Course Code. Creating a student group based on activity allows you to group of student for events and activities happening in the institute. + +Once a student group is created you can mark attendance for the group. + + + +You can also update the **Email Group** for the Student Group. Click on Update Email Group to add all the email ids of the gaurdians in the respective email group and **Newsletter** can be created and sent to the Email group. - {next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/schools/student/student-log.md b/erpnext/docs/user/manual/en/schools/student/student-log.md index a037a231ac..160e39fcdc 100644 --- a/erpnext/docs/user/manual/en/schools/student/student-log.md +++ b/erpnext/docs/user/manual/en/schools/student/student-log.md @@ -1,6 +1,7 @@ # Student Log -You can make a note of student activities using student log. +The Student log Doctype enables you to add and edit addtional information for a student. +You can make a note of student activities using Student log. Logs can be categorised as 'General', 'Academic', 'Medical' or 'Achievement' diff --git a/erpnext/docs/user/manual/en/schools/student/student.md b/erpnext/docs/user/manual/en/schools/student/student.md index dd99a80d2f..09e44714e6 100644 --- a/erpnext/docs/user/manual/en/schools/student/student.md +++ b/erpnext/docs/user/manual/en/schools/student/student.md @@ -1,10 +1,12 @@ # Student A Student is a person who has enrolled at your institute and you have accepted their application. -The student doctype maintains personal details of the student. - -You can view everything related to a particular student on this page. Eg : Fees, Student Group, etc +The Student doctype maintains detials like personal information, date of birth, address etc. It also records the **Guardian** and sibling details. +The student is enrolled in a **Program** when the application is approved. Once the enrollement is done the **Student Applicant** status is update to Admitted. -{next} +You can view every doctype created for a particular student. Eg : Fees, Student Group, etc + + +{next} \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/setting-up/articles/email-error.md b/erpnext/docs/user/manual/en/setting-up/articles/email-error.md new file mode 100644 index 0000000000..9d5abd021e --- /dev/null +++ b/erpnext/docs/user/manual/en/setting-up/articles/email-error.md @@ -0,0 +1,9 @@ +# Email Error in Sending or Receiving + +In ERPNext, you can customize the Incoming and Outgoing Email Gateway. On saving an Email Account, ERPNext tries establishing a connection with your email gateway. If your ERPNext account is able to connect fine, then Email Account is saved successfully. If not, then you might receive an error as below. + + + +This indicates that using login credentials and other email gateway details provided in the Email Account, ERPNext is not able to connect to your email server. Please ensure that you have entered valid email credentials for your Email Gateway. Once you have configured Email Account successfully, you should be able to send and receive emails from your ERPNext account fine. + +Note: Your ERPNext account is connected with an ERPNext email server by default. If you don't want to use your own email server, you can continue sending emails using ERPNext email server, without any configuration required in the Email Account. \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/setting-up/articles/index.txt b/erpnext/docs/user/manual/en/setting-up/articles/index.txt index d175d929da..259229ec8d 100644 --- a/erpnext/docs/user/manual/en/setting-up/articles/index.txt +++ b/erpnext/docs/user/manual/en/setting-up/articles/index.txt @@ -14,4 +14,5 @@ using-custom-domain-on-erpnext setup-two-factor-authentication difference-between-system-user-and-website-user outgoing-email-gateway -print-format-sections \ No newline at end of file +print-format-sections +email-error \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/setting-up/data/download-backup.md b/erpnext/docs/user/manual/en/setting-up/data/download-backup.md new file mode 100644 index 0000000000..6c98cf34f8 --- /dev/null +++ b/erpnext/docs/user/manual/en/setting-up/data/download-backup.md @@ -0,0 +1,13 @@ +# Download Backup + +In the ERPNext, you can manually download database backup. To get the latest database backup, go to: + +`Setup > Data > Download Backup` + +Backup available for the download is updated in every eight hours. Click on the link to download the backups at a given time. + + + +By default three latest backups will be available for the download. If you want to customize no. of backups, then click on "Set Number of Backups". In the System Settings, you can set Number of Backups available for the download at a time. + + \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/setting-up/data/index.txt b/erpnext/docs/user/manual/en/setting-up/data/index.txt index 998b5a2164..d15f9175bb 100644 --- a/erpnext/docs/user/manual/en/setting-up/data/index.txt +++ b/erpnext/docs/user/manual/en/setting-up/data/index.txt @@ -1,2 +1,3 @@ data-import-tool bulk-rename +download-backup diff --git a/erpnext/docs/user/manual/en/setting-up/setup-wizard/index.md b/erpnext/docs/user/manual/en/setting-up/setup-wizard/index.md index 244d893c7b..c05c4af5b6 100644 --- a/erpnext/docs/user/manual/en/setting-up/setup-wizard/index.md +++ b/erpnext/docs/user/manual/en/setting-up/setup-wizard/index.md @@ -1,6 +1,6 @@ # Setup Wizard -The Setup Wizard helps you quickly setup your ERPnext by helping you create your company, Items, Customer, Suppliers and will also setup a basic website with this data. +The Setup Wizard helps you quickly setup ERPnext as per your locale and sets up your organisation. Here is a quick overview of the steps: diff --git a/erpnext/docs/user/manual/en/setting-up/setup-wizard/index.txt b/erpnext/docs/user/manual/en/setting-up/setup-wizard/index.txt index eb7655826e..b2f680a388 100644 --- a/erpnext/docs/user/manual/en/setting-up/setup-wizard/index.txt +++ b/erpnext/docs/user/manual/en/setting-up/setup-wizard/index.txt @@ -1,10 +1,5 @@ step-1-language step-2-currency-and-timezone step-3-user-details +step-4-two-factor-authentication step-5-company-details -step-6-letterhead-and-logo -step-7-add-users -step-8-tax-details -step-9-customer-names -step-10-suppliers -step-11-item diff --git a/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-10-suppliers.md b/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-10-suppliers.md deleted file mode 100644 index 364b4d6982..0000000000 --- a/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-10-suppliers.md +++ /dev/null @@ -1,12 +0,0 @@ -# Step 10: Suppliers - -Enter a few of your Suppliers' names. - - - ---- - -To understand Suppliers in detail visit [Supplier Master](/docs/user/manual/en/buying/supplier.html) - -{next} diff --git a/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-11-item.md b/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-11-item.md deleted file mode 100644 index 42d7e3d26d..0000000000 --- a/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-11-item.md +++ /dev/null @@ -1,16 +0,0 @@ -# Step 11: Item Names - -In this final step, please enter the names of the Items you buy or sell. - - - -Please set the group of the item (Product / Service) and unit of measure. Don't worry you will be able to edit all of this later. - ---- - -## Thats it! - -Once you are done with the setup wizard you will see the familiar desktop page. - -{next} diff --git a/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-6-letterhead-and-logo.md b/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-6-letterhead-and-logo.md deleted file mode 100644 index 0286a3ee23..0000000000 --- a/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-6-letterhead-and-logo.md +++ /dev/null @@ -1,23 +0,0 @@ -# Step 6: Letterhead and Logo - -Attach Company Letterhead and Company Logo. - - - ---- - -### Letterhead - -A letterhead is the heading at the top of a sheet of letter paper (stationery). That heading usually consists of a name and an address, and a logo or corporate design. - -Click on the box ‘Attach Letterhead’ . Select the image file from the place it is stored and click enter. - -You may choose to skip this step if your letterhead is not ready. - -To select letterhead later through the setup module, read [Letter-head](/docs/user/manual/en/setting-up/print/letter-head.html) - -#### To "attach as web-link" - -For any attachments in ERPNext, you can also attach as a web-link. If you are using other tools like Dropbox or Google Docs to manage your files, you can set its public link. - -{next} diff --git a/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-7-add-users.md b/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-7-add-users.md deleted file mode 100644 index c92721c91b..0000000000 --- a/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-7-add-users.md +++ /dev/null @@ -1,7 +0,0 @@ -# Step 7: Add Users - -Add other users and assign them roles based on their job responsibilities. - - - -{next} diff --git a/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-8-tax-details.md b/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-8-tax-details.md deleted file mode 100644 index dae88e4432..0000000000 --- a/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-8-tax-details.md +++ /dev/null @@ -1,21 +0,0 @@ -# Step 8: Tax Details - -Enter any three types of taxes which you regularly pay. This wizard will create a tax master which will calculate the taxes as per the tax-type. - - - -Just set the tax name and the standard percentage levied. - ---- - -Some examples of tax types are given below. - -#### VAT - -A value added tax (VAT) is a form of consumption tax. From the perspective of the buyer, it is a tax on the purchase price. From that of the seller, it is a tax only on the value added to a product, material, or a service. From an accounting point of view, by the stage of its manufacture or distribution. The manufacturer remits to the government the difference between these two amounts, and retains the rest for themselves to offset the taxes they had previously paid on the inputs. - -The purpose of VAT is to generate tax revenues to the government similar to the corporate income tax or the personal income tax. For Example: When you shop at a departmental store and avail discount on the products, the store charges you 5% extra on the total bill as the VAT. - -To setup VAT in the setup wizard , simply enter the percentage amount levied by your government. To setup VAT at a later stage read [setting-up-taxes](/docs/user/manual/en/setting-up/setting-up-taxes.html) - -{next} diff --git a/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-9-customer-names.md b/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-9-customer-names.md deleted file mode 100644 index e3489433fc..0000000000 --- a/erpnext/docs/user/manual/en/setting-up/setup-wizard/step-9-customer-names.md +++ /dev/null @@ -1,22 +0,0 @@ -# Step 9: Customers - -Enter your Customer names and the contact person from that organisation. - - - - ---- - -#### Difference between a customer name and a contact name - -A customer name is the name of the organisation and a contact name is the name of the person from that organisation. - -For Example: If American Power Mills is an organisation name and their founder Shiv Agarwal has installed ERPNext on his system. Then, - -Customer Name: American Power Mills - -Contact Name: Shiv Agarwal - -To understand Customer in detail visit [Customer Details](/docs/user/manual/en/CRM/customer.html) - -{next} diff --git a/erpnext/docs/user/manual/en/stock/articles/delivery-note-stock-error.md b/erpnext/docs/user/manual/en/stock/articles/delivery-note-stock-error.md new file mode 100644 index 0000000000..afb6de92d8 --- /dev/null +++ b/erpnext/docs/user/manual/en/stock/articles/delivery-note-stock-error.md @@ -0,0 +1,7 @@ +# Delivery Note Negative Stock Error + +**Question**: When submitting a Delivery Note, receiving a message says that item's stock is insufficient, but we have item's stock available in the Warehouse. + +**Answer**: On submission of Delivery Note, stock level is checked as on Posting Date and Posting Time of a Delivery Note. It's possible that you have stock of an Item available in the Warehouse. But if you are creating back-dated Delivery Note, and if item was not available in the warehouse on the Posting Date and Posting Time of Delivery Note, you are likely to receive an error message on the negative stock. You can refer to the Stock Ledger report to confirm the same. + +If this is the case, you should edit the Posting Date and Time of a Delivery Note, and ensure that it is after the Posting Date and Time of item's receipt entry. \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/stock/articles/index.txt b/erpnext/docs/user/manual/en/stock/articles/index.txt index df779de628..acf1375214 100644 --- a/erpnext/docs/user/manual/en/stock/articles/index.txt +++ b/erpnext/docs/user/manual/en/stock/articles/index.txt @@ -10,4 +10,8 @@ repack-entry serial-no-naming stock-entry-purpose stock-level-report -track-items-using-barcode \ No newline at end of file +track-items-using-barcode +stock-received-but-not-billed +return-rejected-item +item-valuation-transactions +delivery-note-stock-error \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/stock/articles/item-valuation-transactions.md b/erpnext/docs/user/manual/en/stock/articles/item-valuation-transactions.md new file mode 100644 index 0000000000..5cc6529d89 --- /dev/null +++ b/erpnext/docs/user/manual/en/stock/articles/item-valuation-transactions.md @@ -0,0 +1,17 @@ +# Item Valuation Methods and Transactions + +In ERPNext, Item's stock valuation is updated on the creation of one of the following transaction. + +1. Purchase Receipt +2. Stock Entry of type Material Receipt +3. Stock Reconciliation made for updating stock opening balance + +You can select valuation method based on which item's value will be calculated. Valuation Method can be set globally for all the items from the Stock Settings. + + + +You can also set Valuation Method in the item master, especially when a valuation method for an item is different from the default Method. + + + +[Click here to learn about the valuation methods available in the ERPNext, and how it works.](https://frappe.io/blog/erpnext-features/inventory-valuation-method-fifo-vs-moving-average) diff --git a/erpnext/docs/user/manual/en/stock/articles/return-rejected-item.md b/erpnext/docs/user/manual/en/stock/articles/return-rejected-item.md new file mode 100644 index 0000000000..aaaec2dea0 --- /dev/null +++ b/erpnext/docs/user/manual/en/stock/articles/return-rejected-item.md @@ -0,0 +1,13 @@ +# Return Rejected Items + +In the Purchase Receipt, you can receive the Items in the Accepted or the Rejected Warehouse. + +If you are creating Purchase Return for the items received in the Rejected Warehouse, then create return entry following these steps. + +1. In the Purchase Receipt Item table, for the item to be returned, in the Received Qty field, enter return entry in negative. +2. In the Accepted Warehouse field, set value as zero. +3. In the Rejected Warehouse field, set the quantity to be returned in negative. + +For detailed steps on how to create Purchase Return Entry for the Rejected Item, refer to the below example. + + \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/stock/articles/stock-received-but-not-billed.md b/erpnext/docs/user/manual/en/stock/articles/stock-received-but-not-billed.md new file mode 100644 index 0000000000..25ef3b8aa6 --- /dev/null +++ b/erpnext/docs/user/manual/en/stock/articles/stock-received-but-not-billed.md @@ -0,0 +1,9 @@ +# Purpose of Stock Received but not Billed + +When purchased items are received, an accounts posting is done based on the value of the purchased items in the Stock-in-hand / fixed-assets account. When you sell and deliver those items, an expense (cost-of-goods-sold) is booked, equal to the buying cost of the items. + +As stock balance increases through Purchase Receipt, Warehouse account is debited and an adjustment account called **Stock Received But Not Billed** account is credited. At the same time, the negative expense is booked in account **Expense included in Valuation** for the amount added for valuation purpose, to avoid double expense booking. + +On receiving Bill from the supplier, you will make Purchase Invoice against a Purchase Receipt. Here **Stock Received But Not Billed** account is debited, hence nullifies the balance in the Stock Received but not Billed Account. + +The balance in the Stock Received but not Billed account indicates the value of items for which Purchase Receipt has been made, but billing is pending. \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/subscription/__init__.py b/erpnext/docs/user/manual/en/subscription/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/subscription/index.md b/erpnext/docs/user/manual/en/subscription/index.md new file mode 100644 index 0000000000..24d75eda95 --- /dev/null +++ b/erpnext/docs/user/manual/en/subscription/index.md @@ -0,0 +1,22 @@ +If you have a contract with the Customer where your organization gives bill to the Customer on a monthly, quarterly, half-yearly or annual basis, you can use subscription feature to make auto invoicing. + + + +#### Scenario + +Subscription for your hosted ERPNext account requires yearly renewal. We use Sales Invoice for generating proforma invoices. To automate proforma invoicing for renewal, we set original Sales Invoice on the subscription form. Recurring proforma invoice is created automatically just before customer's account is about to expire, and requires renewal. This recurring Proforma Invoice is also emailed automatically to the customer. + +To set the subscription for the sales invoice +Goto Subscription > select base doctype "Sales Invoice" > select base docname "Invoice No" > Save + + + +**From Date and To Date**: This defines contract period with the customer. + +**Repeat on Day**: If frequency is set as Monthly, then it will be day of the month on which recurring invoice will be generated. + +**Notify By Email**: If you want to notify the user about auto recurring invoice. + +**Print Format**: Select a print format to define document view which should be emailed to customer. + +**Disabled**: It will stop to make auto recurring documents against the subscription \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/subscription/index.txt b/erpnext/docs/user/manual/en/subscription/index.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/docs/user/manual/en/using-erpnext/articles/index.txt b/erpnext/docs/user/manual/en/using-erpnext/articles/index.txt index 4ca21aa969..9dc7df3f31 100644 --- a/erpnext/docs/user/manual/en/using-erpnext/articles/index.txt +++ b/erpnext/docs/user/manual/en/using-erpnext/articles/index.txt @@ -8,4 +8,5 @@ bulk-rename renaming-documents search-filter tree-master-renaming -pos-view \ No newline at end of file +pos-view +letter-head-in-the-report \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/using-erpnext/articles/letter-head-in-the-report.md b/erpnext/docs/user/manual/en/using-erpnext/articles/letter-head-in-the-report.md new file mode 100644 index 0000000000..4f8b2e9ea3 --- /dev/null +++ b/erpnext/docs/user/manual/en/using-erpnext/articles/letter-head-in-the-report.md @@ -0,0 +1,15 @@ +# Letter Head in the Report's Print Format + +In the reports, Letter Head is fetched from the Company master. To have company's Letter Head fetched correctly in the report, please ensure that you have updated default Letter Head in the Company master. + +`Explore > Accounts > Company` + + + +In a Company master, if no Letter Head is set as default, then in the reports, Letter Head having Default field checked will be fetched. + + + +If you are managing multiple companies in a single ERPNext account, then ensure that for each Company, default Letter Head is set in the Company master. + +After updating Letter Head in the Company master, refresh your ERPNext account, and then check the print format of a report. \ No newline at end of file diff --git a/erpnext/docs/user/manual/en/website/articles/website-banner.md b/erpnext/docs/user/manual/en/website/articles/website-banner.md new file mode 100644 index 0000000000..514e23e58d --- /dev/null +++ b/erpnext/docs/user/manual/en/website/articles/website-banner.md @@ -0,0 +1,9 @@ +# Website Banner Resizing + +Each ERPNext account website automatically generated from it. On a website, logo is set based on logo image selected in the Setup Wizard. You can change or edit property for your company's logo from the Website Settings. + +`Explore > Website > Website Settings` + +For the exact steps on how to upload a Website Banner and resize it, please refer to the help given below. + + \ No newline at end of file diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 7e65fc9262..b2c328552f 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -27,6 +27,8 @@ doctype_js = { # setup wizard setup_wizard_requires = "assets/erpnext/js/setup_wizard.js" setup_wizard_complete = "erpnext.setup.setup_wizard.setup_wizard.setup_complete" +setup_wizard_success = "erpnext.setup.setup_wizard.setup_wizard.setup_success" +setup_wizard_test = "erpnext.setup.setup_wizard.test_setup_wizard.run_setup_wizard_test" before_install = "erpnext.setup.install.check_setup_wizard_not_completed" after_install = "erpnext.setup.install.after_install" @@ -34,6 +36,8 @@ after_install = "erpnext.setup.install.after_install" boot_session = "erpnext.startup.boot.boot_session" notification_config = "erpnext.startup.notifications.get_notification_config" get_help_messages = "erpnext.utilities.activation.get_help_messages" +get_user_progress_slides = "erpnext.utilities.user_progress.get_user_progress_slides" +update_and_get_user_progress = "erpnext.utilities.user_progress_utils.update_default_domain_actions_and_get_state" on_session_creation = "erpnext.shopping_cart.utils.set_cart_count" on_logout = "erpnext.shopping_cart.utils.clear_cart_count" @@ -180,7 +184,7 @@ doc_events = { scheduler_events = { "hourly": [ - "erpnext.controllers.recurring_document.create_recurring_documents", + "erpnext.subscription.doctype.subscription.subscription.make_subscription_entry", 'erpnext.hr.doctype.daily_work_summary_settings.daily_work_summary_settings.trigger_emails' ], "daily": [ diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py index a078ef2033..03626cdc5c 100755 --- a/erpnext/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -289,3 +289,15 @@ def create_user(employee, user = None): }) user.insert() return user.name + +def get_employee_emails(employee_list): + '''Returns list of employee emails either based on user_id or company_email''' + employee_emails = [] + for employee in employee_list: + if not employee: + continue + user, email = frappe.db.get_value('Employee', employee, ['user_id', 'company_email']) + if user or email: + employee_emails.append(user or email) + + return employee_emails \ No newline at end of file diff --git a/erpnext/hr/doctype/training_event/test_training_event.js b/erpnext/hr/doctype/training_event/tests/test_training_event.js similarity index 100% rename from erpnext/hr/doctype/training_event/test_training_event.js rename to erpnext/hr/doctype/training_event/tests/test_training_event.js diff --git a/erpnext/hr/doctype/training_event/tests/test_training_event_attendance.js b/erpnext/hr/doctype/training_event/tests/test_training_event_attendance.js new file mode 100644 index 0000000000..6364308f73 --- /dev/null +++ b/erpnext/hr/doctype/training_event/tests/test_training_event_attendance.js @@ -0,0 +1,40 @@ +QUnit.module('hr'); + +QUnit.test("test: Training Event", function (assert) { + // number of asserts + assert.expect(1); + let done = assert.async(); + + frappe.run_serially([ + // insert a new Training Event + () => frappe.set_route("List", "Training Event", "List"), + () => frappe.new_doc("Training Event"), + () => frappe.timeout(1), + () => frappe.click_link('Edit in full page'), + () => cur_frm.set_value("event_name", "Test Event " + frappe.utils.get_random(10)), + () => cur_frm.set_value("start_time", "2017-07-26, 2:00 pm PDT"), + () => cur_frm.set_value("end_time", "2017-07-26, 2:30 pm PDT"), + () => cur_frm.set_value("introduction", "This is a test report"), + () => cur_frm.set_value("location", "Fake office"), + () => frappe.click_button('Add Row'), + () => frappe.db.get_value('Employee', {'employee_name':'Test Employee 1'}, 'name'), + (r) => { + console.log(r); + return cur_frm.fields_dict.employees.grid.grid_rows[0].doc.employee = r.message.name; + }, + () => { + return cur_frm.fields_dict.employees.grid.grid_rows[0].doc.attendance = "Optional"; + }, + () => frappe.click_button('Save'), + () => frappe.timeout(2), + () => frappe.click_button('Submit'), + () => frappe.timeout(2), + () => frappe.click_button('Yes'), + () => frappe.timeout(1), + () => { + assert.equal(cur_frm.doc.docstatus, 1); + }, + () => done() + ]); + +}); \ No newline at end of file diff --git a/erpnext/hr/doctype/training_event/training_event.js b/erpnext/hr/doctype/training_event/training_event.js index ebe0c7907c..6a6e8fe0a6 100644 --- a/erpnext/hr/doctype/training_event/training_event.js +++ b/erpnext/hr/doctype/training_event/training_event.js @@ -18,4 +18,4 @@ frappe.ui.form.on('Training Event', { }); } } -}); +}); \ No newline at end of file diff --git a/erpnext/hr/doctype/training_event/training_event.json b/erpnext/hr/doctype/training_event/training_event.json index 03b58b4802..7be9d974fe 100644 --- a/erpnext/hr/doctype/training_event/training_event.json +++ b/erpnext/hr/doctype/training_event/training_event.json @@ -25,7 +25,7 @@ "ignore_xss_filter": 0, "in_filter": 0, "in_global_search": 0, - "in_list_view": 0, + "in_list_view": 1, "in_standard_filter": 0, "label": "Event Name", "length": 0, @@ -55,7 +55,7 @@ "ignore_xss_filter": 0, "in_filter": 0, "in_global_search": 0, - "in_list_view": 0, + "in_list_view": 1, "in_standard_filter": 1, "label": "Event Status", "length": 0, @@ -115,12 +115,12 @@ "ignore_xss_filter": 0, "in_filter": 0, "in_global_search": 0, - "in_list_view": 0, + "in_list_view": 1, "in_standard_filter": 1, "label": "Type", "length": 0, "no_copy": 0, - "options": "Seminar\nTheory\nWorkshop\nConference\nExam\nInternet", + "options": "Seminar\nTheory\nWorkshop\nConference\nExam\nInternet\nSelf-Study", "permlevel": 0, "precision": "", "print_hide": 0, @@ -386,7 +386,7 @@ "ignore_xss_filter": 0, "in_filter": 0, "in_global_search": 0, - "in_list_view": 0, + "in_list_view": 1, "in_standard_filter": 1, "label": "Location", "length": 0, @@ -581,37 +581,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "description": "Will send an email about the event to employees with status 'Open'", - "fieldname": "send_email", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Send Email", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_bulk_edit": 0, "allow_on_submit": 1, @@ -672,6 +641,37 @@ "search_index": 0, "set_only_once": 0, "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "employee_emails", + "fieldtype": "Small Text", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Employee Emails", + "length": 0, + "no_copy": 0, + "options": "Email", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 } ], "has_web_view": 0, @@ -684,7 +684,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-05-29 06:13:38.411039", + "modified": "2017-08-11 03:11:25.768563", "modified_by": "Administrator", "module": "HR", "name": "Training Event", diff --git a/erpnext/hr/doctype/training_event/training_event.py b/erpnext/hr/doctype/training_event/training_event.py index 27ae8cf549..cc568414a0 100644 --- a/erpnext/hr/doctype/training_event/training_event.py +++ b/erpnext/hr/doctype/training_event/training_event.py @@ -3,24 +3,10 @@ # For license information, please see license.txt from __future__ import unicode_literals -import frappe -from frappe import _ from frappe.model.document import Document +from erpnext.hr.doctype.employee.employee import get_employee_emails class TrainingEvent(Document): - def on_update(self): - self.invite_employee() - - def on_update_after_submit(self): - self.invite_employee() - - def invite_employee(self): - if self.event_status == "Scheduled" and self.send_email: - subject = _("""You are invited for to attend {0} - {1} scheduled from {2} to {3} at {4}."""\ - .format(self.type, self.event_name, self.start_time, self.end_time, self.location)) - - for emp in self.employees: - if emp.status== "Open": - frappe.sendmail(frappe.db.get_value("Employee", emp.employee, "company_email"), \ - subject=subject, content= self.introduction) - emp.status= "Invited" \ No newline at end of file + def validate(self): + self.employee_emails = ', '.join(get_employee_emails([d.employee + for d in self.employees])) diff --git a/erpnext/hr/doctype/training_event_employee/training_event_employee.json b/erpnext/hr/doctype/training_event_employee/training_event_employee.json index 575d0e7582..a8a72b1a70 100644 --- a/erpnext/hr/doctype/training_event_employee/training_event_employee.json +++ b/erpnext/hr/doctype/training_event_employee/training_event_employee.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, "beta": 0, @@ -11,6 +12,7 @@ "editable_grid": 1, "fields": [ { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -21,6 +23,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 1, "in_standard_filter": 0, "label": "Employee", @@ -40,6 +43,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -50,6 +54,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, "label": "Employee Name", @@ -69,6 +74,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -79,6 +85,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, "length": 0, @@ -96,6 +103,7 @@ "unique": 0 }, { + "allow_bulk_edit": 0, "allow_on_submit": 1, "bold": 0, "collapsible": 0, @@ -107,12 +115,44 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 1, "in_standard_filter": 0, "label": "Status", "length": 0, "no_copy": 1, - "options": "Open\nInvited\nConfirmed\nAttended\nWithdrawn", + "options": "Open\nInvited\nCompleted\nFeedback Submitted", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "attendance", + "fieldtype": "Select", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Attendance", + "length": 0, + "no_copy": 0, + "options": "Mandatory\nOptional", "permlevel": 0, "precision": "", "print_hide": 0, @@ -126,17 +166,17 @@ "unique": 0 } ], + "has_web_view": 0, "hide_heading": 0, "hide_toolbar": 0, "idx": 0, "image_view": 0, "in_create": 0, - "in_dialog": 0, "is_submittable": 0, "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-12-14 11:43:40.996578", + "modified": "2017-08-11 03:36:22.738253", "modified_by": "Administrator", "module": "HR", "name": "Training Event Employee", @@ -146,7 +186,9 @@ "quick_entry": 1, "read_only": 0, "read_only_onload": 0, + "show_name_in_global_search": 0, "sort_field": "modified", "sort_order": "DESC", + "track_changes": 0, "track_seen": 0 } \ No newline at end of file diff --git a/erpnext/hr/doctype/training_feedback/training_feedback.py b/erpnext/hr/doctype/training_feedback/training_feedback.py index 2a0403bd53..b7eae38ae4 100644 --- a/erpnext/hr/doctype/training_feedback/training_feedback.py +++ b/erpnext/hr/doctype/training_feedback/training_feedback.py @@ -5,6 +5,19 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document +from frappe import _ class TrainingFeedback(Document): - pass + def validate(self): + training_event = frappe.get_doc("Training Event", self.training_event) + if training_event.docstatus != 1: + frappe.throw(_('{0} must be submitted').format(_('Training Event'))) + + def on_submit(self): + training_event = frappe.get_doc("Training Event", self.training_event) + for e in training_event.employees: + if e.employee == self.employee: + training_event.status = 'Feedback Submitted' + break + + training_event.save() diff --git a/erpnext/hr/doctype/training_result/test_training_result.js b/erpnext/hr/doctype/training_result/test_training_result.js new file mode 100644 index 0000000000..cb1d7fb27a --- /dev/null +++ b/erpnext/hr/doctype/training_result/test_training_result.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Training Result", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Training Result + () => frappe.tests.make('Training Result', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/erpnext/hr/doctype/training_result/training_result.json b/erpnext/hr/doctype/training_result/training_result.json index e5fbb5fd42..41142b59e6 100644 --- a/erpnext/hr/doctype/training_result/training_result.json +++ b/erpnext/hr/doctype/training_result/training_result.json @@ -26,7 +26,7 @@ "ignore_xss_filter": 0, "in_filter": 0, "in_global_search": 0, - "in_list_view": 0, + "in_list_view": 1, "in_standard_filter": 0, "label": "Training Event", "length": 0, @@ -133,6 +133,37 @@ "search_index": 0, "set_only_once": 0, "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "employee_emails", + "fieldtype": "Small Text", + "hidden": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Employee Emails", + "length": 0, + "no_copy": 0, + "options": "Email", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 } ], "has_web_view": 0, @@ -145,7 +176,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-06-15 08:16:01.566531", + "modified": "2017-08-11 03:53:21.283968", "modified_by": "Administrator", "module": "HR", "name": "Training Result", diff --git a/erpnext/hr/doctype/training_result/training_result.py b/erpnext/hr/doctype/training_result/training_result.py index 36c3cb93bc..7cdc51f801 100644 --- a/erpnext/hr/doctype/training_result/training_result.py +++ b/erpnext/hr/doctype/training_result/training_result.py @@ -6,19 +6,27 @@ from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document +from erpnext.hr.doctype.employee.employee import get_employee_emails class TrainingResult(Document): + def validate(self): + training_event = frappe.get_doc("Training Event", self.training_event) + if training_event.docstatus != 1: + frappe.throw(_('{0} must be submitted').format(_('Training Event'))) + + self.employee_emails = ', '.join(get_employee_emails([d.employee + for d in self.employees])) + def on_submit(self): - self.send_result() - - def send_result(self): - for emp in self.employees: - message = "Thank You for attending {0}.".format(self.training_event) - if emp.grade: - message = message + "Your grade: {0}".format(emp.grade) - frappe.sendmail(frappe.db.get_value("Employee", emp.employee, "company_email"), \ - subject=_("{0} Results".format(self.training_event)), \ - content=message) + training_event = frappe.get_doc("Training Event", self.training_event) + training_event.status = 'Completed' + for e in self.employees: + for e1 in training_event.employees: + if e1.employee == e.employee: + e1.status = 'Completed' + break + + training_event.save() @frappe.whitelist() def get_employees(training_event): diff --git a/erpnext/hr/email_alert/__init__.py b/erpnext/hr/email_alert/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/hr/email_alert/training_feedback/__init__.py b/erpnext/hr/email_alert/training_feedback/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/hr/email_alert/training_feedback/training_feedback.html b/erpnext/hr/email_alert/training_feedback/training_feedback.html new file mode 100644 index 0000000000..fd8fef9e82 --- /dev/null +++ b/erpnext/hr/email_alert/training_feedback/training_feedback.html @@ -0,0 +1,6 @@ +{{ _("Hello") }},
+ +You attended training {{ frappe.utils.get_link_to_form( + "Training Event", doc.training_event) }}
+ +{{ _("Please share your feedback to the training by clicking on 'Training Feedback' and then 'New'") }}
\ No newline at end of file diff --git a/erpnext/hr/email_alert/training_feedback/training_feedback.json b/erpnext/hr/email_alert/training_feedback/training_feedback.json new file mode 100644 index 0000000000..51f6cedfec --- /dev/null +++ b/erpnext/hr/email_alert/training_feedback/training_feedback.json @@ -0,0 +1,24 @@ +{ + "attach_print": 0, + "creation": "2017-08-11 03:17:11.769210", + "days_in_advance": 0, + "docstatus": 0, + "doctype": "Email Alert", + "document_type": "Training Result", + "enabled": 1, + "event": "Submit", + "idx": 0, + "is_standard": 1, + "message": "{{ message }}
\n\n{{ message }}
+ +{{ doc.introduction }}
+ +{{ doc.introduction }}
\n\n{{ message }}
+ +{{ message }}
+ +{{_("Please update your status for this training event")}}:
+ + +{% else %} +{{_("Please confirm once you have completed your training")}}:
+ +{% endif %} +{{_("Thank you")}},
+{{ user_fullname }}