diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.js b/erpnext/accounts/doctype/pos_profile/pos_profile.js
index b62d9b0b606..5162c29604c 100755
--- a/erpnext/accounts/doctype/pos_profile/pos_profile.js
+++ b/erpnext/accounts/doctype/pos_profile/pos_profile.js
@@ -42,6 +42,20 @@ frappe.ui.form.on('POS Profile', {
frm.toggle_display('offline_pos_section', is_offline);
frm.toggle_display('print_format_for_online', !is_offline);
});
+
+ frm.set_query('company_address', function(doc) {
+ if(!doc.company) {
+ frappe.throw(__('Please set Company'));
+ }
+
+ return {
+ query: 'frappe.contacts.doctype.address.address.address_query',
+ filters: {
+ link_doctype: 'Company',
+ link_name: doc.company
+ }
+ };
+ });
},
refresh: function(frm) {
@@ -49,11 +63,11 @@ frappe.ui.form.on('POS Profile', {
frm.trigger("toggle_display_account_head");
}
},
-
+
company: function(frm) {
frm.trigger("toggle_display_account_head");
},
-
+
toggle_display_account_head: function(frm) {
frm.toggle_display('expense_account',
erpnext.is_perpetual_inventory_enabled(frm.doc.company));
diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.json b/erpnext/accounts/doctype/pos_profile/pos_profile.json
index 610ed51dd7e..a089b4c91b9 100644
--- a/erpnext/accounts/doctype/pos_profile/pos_profile.json
+++ b/erpnext/accounts/doctype/pos_profile/pos_profile.json
@@ -1,5 +1,6 @@
{
"allow_copy": 0,
+ "allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 1,
@@ -13,6 +14,7 @@
"fields": [
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -40,11 +42,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -70,11 +73,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -101,11 +105,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
- "unique": 0
+ "translatable": 0,
+ "unique": 1
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -134,11 +139,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -166,11 +172,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -197,11 +204,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -228,11 +236,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -259,11 +268,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -290,11 +300,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -321,11 +332,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -352,10 +364,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
- },
+ },
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -381,11 +395,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -414,11 +429,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -447,16 +463,17 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fetch_from": "company.country",
+ "fetch_from": "company.country",
"fieldname": "country",
"fieldtype": "Read Only",
"hidden": 0,
@@ -480,11 +497,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -514,11 +532,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -546,11 +565,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -577,11 +597,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -609,11 +630,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -639,11 +661,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -671,11 +694,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -702,11 +726,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -734,11 +759,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -764,11 +790,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -796,11 +823,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -827,11 +855,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -859,11 +888,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
@@ -892,11 +922,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
@@ -925,11 +956,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -955,11 +987,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -988,11 +1021,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1021,11 +1055,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1052,11 +1087,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1086,11 +1122,77 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "company_address_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": "Company Address",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "company_address",
+ "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": "Company Address Name",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Address",
+ "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,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1118,11 +1220,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1152,11 +1255,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1182,11 +1286,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1215,11 +1320,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1247,11 +1353,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1279,11 +1386,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1312,11 +1420,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1345,11 +1454,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1377,11 +1487,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1409,11 +1520,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1439,11 +1551,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1472,11 +1585,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1504,11 +1618,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1537,11 +1652,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1570,7 +1686,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -1585,7 +1701,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-09-05 12:43:37.272875",
+ "modified": "2018-12-03 14:16:08.589778",
"modified_by": "Administrator",
"module": "Accounts",
"name": "POS Profile",
@@ -1639,5 +1755,6 @@
"sort_order": "DESC",
"title_field": "pos_profile_name",
"track_changes": 0,
- "track_seen": 0
-}
+ "track_seen": 0,
+ "track_views": 0
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index a4588b3dd82..91a44b377df 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -313,6 +313,10 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
erpnext.setup_serial_no();
},
+ packed_items_on_form_rendered: function(doc, grid_row) {
+ erpnext.setup_serial_no();
+ },
+
make_sales_return: function() {
frappe.model.open_mapped_doc({
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.make_sales_return",
@@ -585,7 +589,7 @@ frappe.ui.form.on('Sales Invoice', {
frm.set_query('company_address', function(doc) {
if(!doc.company) {
- frappe.throw(_('Please set Company'));
+ frappe.throw(__('Please set Company'));
}
return {
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 6387003f018..f3ec775d549 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -131,7 +131,7 @@ class SalesInvoice(SellingController):
#validate amount in mode of payments for returned invoices for pos must be negative
if self.is_pos and self.is_return:
self.verify_payment_amount_is_negative()
-
+
if self.redeem_loyalty_points and self.loyalty_program and self.loyalty_points:
validate_loyalty_points(self, self.loyalty_points)
@@ -397,7 +397,7 @@ class SalesInvoice(SellingController):
self.account_for_change_amount = pos.get('account_for_change_amount')
for fieldname in ('territory', 'naming_series', 'currency', 'taxes_and_charges', 'letter_head', 'tc_name',
- 'selling_price_list', 'company', 'select_print_heading', 'cash_bank_account',
+ 'selling_price_list', 'company', 'select_print_heading', 'cash_bank_account', 'company_address',
'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))
@@ -713,7 +713,7 @@ class SalesInvoice(SellingController):
return gl_entries
def make_customer_gl_entry(self, gl_entries):
- # Checked both rounding_adjustment and rounded_total
+ # Checked both rounding_adjustment and rounded_total
# because rounded_total had value even before introcution of posting GLE based on rounded total
grand_total = self.rounded_total if (self.rounding_adjustment and self.rounded_total) else self.grand_total
if grand_total:
@@ -1026,7 +1026,7 @@ class SalesInvoice(SellingController):
def verify_payment_amount_is_negative(self):
for entry in self.payments:
if entry.amount > 0:
- frappe.throw(_("Row #{0} (Payment Table): Amount must be negative").format(entry.idx))
+ frappe.throw(_("Row #{0} (Payment Table): Amount must be negative").format(entry.idx))
# collection of the loyalty points, create the ledger entry for that.
def make_loyalty_point_entry(self):
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index 17eb6a0cfe2..d446c5b35a1 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -537,7 +537,7 @@ def get_party_shipping_address(doctype, name):
'dl.link_doctype=%s '
'and dl.link_name=%s '
'and dl.parenttype="Address" '
- 'and '
+ 'and ifnull(ta.disabled, 0) = 0 and'
'(ta.address_type="Shipping" or ta.is_shipping_address=1) '
'order by ta.is_shipping_address desc, ta.address_type desc limit 1',
(doctype, name)
diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js
index 9370f0453eb..0a025f68d53 100644
--- a/erpnext/accounts/report/accounts_payable/accounts_payable.js
+++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js
@@ -10,36 +10,6 @@ frappe.query_reports["Accounts Payable"] = {
"options": "Company",
"default": frappe.defaults.get_user_default("Company")
},
- {
- "fieldname":"finance_book",
- "label": __("Finance Book"),
- "fieldtype": "Link",
- "options": "Finance Book"
- },
- {
- "fieldname":"supplier",
- "label": __("Supplier"),
- "fieldtype": "Link",
- "options": "Supplier",
- on_change: () => {
- var supplier = frappe.query_report.get_filter_value('supplier');
- frappe.db.get_value('Supplier', supplier, "tax_id", function(value) {
- frappe.query_report.set_filter_value('tax_id', value["tax_id"]);
- });
- }
- },
- {
- "fieldname":"supplier_group",
- "label": __("Supplier Group"),
- "fieldtype": "Link",
- "options": "Supplier Group"
- },
- {
- "fieldname":"report_date",
- "label": __("As on Date"),
- "fieldtype": "Date",
- "default": frappe.datetime.get_today()
- },
{
"fieldname":"ageing_based_on",
"label": __("Ageing Based On"),
@@ -48,7 +18,10 @@ frappe.query_reports["Accounts Payable"] = {
"default": "Posting Date"
},
{
- "fieldtype": "Break",
+ "fieldname":"report_date",
+ "label": __("As on Date"),
+ "fieldtype": "Date",
+ "default": frappe.datetime.get_today()
},
{
"fieldname":"range1",
@@ -71,6 +44,34 @@ frappe.query_reports["Accounts Payable"] = {
"default": "90",
"reqd": 1
},
+ {
+ "fieldname":"finance_book",
+ "label": __("Finance Book"),
+ "fieldtype": "Link",
+ "options": "Finance Book"
+ },
+ {
+ "fieldname":"supplier",
+ "label": __("Supplier"),
+ "fieldtype": "Link",
+ "options": "Supplier",
+ on_change: () => {
+ var supplier = frappe.query_report.get_filter_value('supplier');
+ if (supplier) {
+ frappe.db.get_value('Supplier', supplier, "tax_id", function(value) {
+ frappe.query_report.set_filter_value('tax_id', value["tax_id"]);
+ });
+ } else {
+ frappe.query_report.set_filter_value('tax_id', "");
+ }
+ }
+ },
+ {
+ "fieldname":"supplier_group",
+ "label": __("Supplier Group"),
+ "fieldtype": "Link",
+ "options": "Supplier Group"
+ },
{
"fieldname":"tax_id",
"label": __("Tax Id"),
diff --git a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js
index 77b099fd07b..7823cac89cb 100644
--- a/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js
+++ b/erpnext/accounts/report/accounts_payable_summary/accounts_payable_summary.js
@@ -10,24 +10,6 @@ frappe.query_reports["Accounts Payable Summary"] = {
"options": "Company",
"default": frappe.defaults.get_user_default("Company")
},
- {
- "fieldname":"supplier",
- "label": __("Supplier"),
- "fieldtype": "Link",
- "options": "Supplier"
- },
- {
- "fieldname":"supplier_group",
- "label": __("Supplier Group"),
- "fieldtype": "Link",
- "options": "Supplier Group"
- },
- {
- "fieldname":"report_date",
- "label": __("Date"),
- "fieldtype": "Date",
- "default": frappe.datetime.get_today()
- },
{
"fieldname":"ageing_based_on",
"label": __("Ageing Based On"),
@@ -36,7 +18,10 @@ frappe.query_reports["Accounts Payable Summary"] = {
"default": "Posting Date"
},
{
- "fieldtype": "Break",
+ "fieldname":"report_date",
+ "label": __("Date"),
+ "fieldtype": "Date",
+ "default": frappe.datetime.get_today()
},
{
"fieldname":"range1",
@@ -58,6 +43,24 @@ frappe.query_reports["Accounts Payable Summary"] = {
"fieldtype": "Int",
"default": "90",
"reqd": 1
+ },
+ {
+ "fieldname":"finance_book",
+ "label": __("Finance Book"),
+ "fieldtype": "Link",
+ "options": "Finance Book"
+ },
+ {
+ "fieldname":"supplier",
+ "label": __("Supplier"),
+ "fieldtype": "Link",
+ "options": "Supplier"
+ },
+ {
+ "fieldname":"supplier_group",
+ "label": __("Supplier Group"),
+ "fieldtype": "Link",
+ "options": "Supplier Group"
}
],
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
index 4930207abd3..fd462a628e8 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html
@@ -1,24 +1,14 @@
-{% if(filters.show_pdc_in_print) { %}
-
-{% } %}
-
-
{%= __(report.report_name) %}
+{%= __(report.report_name) %}
{% if (filters.customer_name) { %}
{%= filters.customer_name %}
@@ -36,7 +26,20 @@
{%= __("Until") %}
{%= frappe.datetime.str_to_user(filters.report_date) %}
-
+
+
+
+ {% if(filters.payment_terms) { %}
+ {%= __("Payment Terms") %}: {%= filters.payment_terms %}
+ {% } %}
+
+
+ {% if(filters.credit_limit) { %}
+ {%= __("Credit Limit") %}: {%= format_currency(filters.credit_limit) %}
+ {% } %}
+
+
+
{% if(filters.show_pdc_in_print) { %}
{% var balance_row = data.slice(-1).pop();
var range1 = report.columns[11].label;
@@ -104,17 +107,21 @@
{% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %}
- | {%= __("Date") %} |
- {%= __("Reference") %} |
+ {%= __("Date") %} |
+ {%= __("Age (Days)") %} |
+ {%= __("Reference") %} |
+ {% if(report.report_name === "Accounts Receivable") { %}
+ {%= __("Sales Person") %} |
+ {% } %}
{% if(!filters.show_pdc_in_print) { %}
{%= (filters.customer || filters.supplier) ? __("Remarks"): __("Party") %} |
{% } %}
- {%= __("Invoiced Amount") %} |
+ {%= __("Invoiced Amount") %} |
{% if(!filters.show_pdc_in_print) { %}
- {%= __("Paid Amount") %} |
- {%= report.report_name === "Accounts Receivable" ? __('Credit Note') : __('Debit Note') %} |
+ {%= __("Paid Amount") %} |
+ {%= report.report_name === "Accounts Receivable" ? __('Credit Note') : __('Debit Note') %} |
{% } %}
- {%= __("Outstanding Amount") %} |
+ {%= __("Outstanding Amount") %} |
{% if(filters.show_pdc_in_print) { %}
{% if(report.report_name === "Accounts Receivable") { %}
{%= __("Customer LPO No.") %} |
@@ -139,6 +146,7 @@
{% if(report.report_name === "Accounts Receivable" || report.report_name === "Accounts Payable") { %}
{% if(data[i][__("Customer")] || data[i][__("Supplier")]) { %}
{%= frappe.datetime.str_to_user(data[i]["posting_date"]) %} |
+ {%= data[i][__("Age (Days)")] %} |
{% if(!filters.show_pdc_in_print) { %}
{%= data[i]["voucher_type"] %}
@@ -146,6 +154,11 @@
{% } %}
{%= data[i]["voucher_no"] %}
|
+
+ {% if(report.report_name === "Accounts Receivable") { %}
+ {%= data[i]["sales_person"] %} |
+ {% } %}
+
{% if(!filters.show_pdc_in_print) { %}
{% if(!(filters.customer || filters.supplier)) { %}
@@ -156,10 +169,15 @@
{%= data[i][__("Supplier Name")] %}
{% } %}
{% } %}
- {%= __("Remarks") %}:
- {%= data[i][__("Remarks")] %}
+
+ {% if data[i][__("Remarks")] %}
+ {%= __("Remarks") %}:
+ {%= data[i][__("Remarks")] %}
+ {% } %}
+
|
{% } %}
+
{%= format_currency(data[i]["invoiced_amount"], data[i]["currency"]) %} |
@@ -187,7 +205,11 @@
{% if(!filters.show_pdc_in_print) { %}
|
{% } %}
- {%= __("Total") %} |
+ {% if(report.report_name === "Accounts Receivable") { %}
+ |
+ {% } %}
+ |
+ {%= __("Total") %} |
{%= format_currency(data[i]["invoiced_amount"], data[i]["currency"] ) %} |
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
index fda496057fc..b1bdce95c84 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
@@ -10,6 +10,40 @@ frappe.query_reports["Accounts Receivable"] = {
"options": "Company",
"default": frappe.defaults.get_user_default("Company")
},
+ {
+ "fieldname":"ageing_based_on",
+ "label": __("Ageing Based On"),
+ "fieldtype": "Select",
+ "options": 'Posting Date\nDue Date',
+ "default": "Posting Date"
+ },
+ {
+ "fieldname":"report_date",
+ "label": __("As on Date"),
+ "fieldtype": "Date",
+ "default": frappe.datetime.get_today()
+ },
+ {
+ "fieldname":"range1",
+ "label": __("Ageing Range 1"),
+ "fieldtype": "Int",
+ "default": "30",
+ "reqd": 1
+ },
+ {
+ "fieldname":"range2",
+ "label": __("Ageing Range 2"),
+ "fieldtype": "Int",
+ "default": "60",
+ "reqd": 1
+ },
+ {
+ "fieldname":"range3",
+ "label": __("Ageing Range 3"),
+ "fieldtype": "Int",
+ "default": "90",
+ "reqd": 1
+ },
{
"fieldname":"finance_book",
"label": __("Finance Book"),
@@ -23,10 +57,19 @@ frappe.query_reports["Accounts Receivable"] = {
"options": "Customer",
on_change: () => {
var customer = frappe.query_report.get_filter_value('customer');
- frappe.db.get_value('Customer', customer, ["tax_id", "customer_name"], function(value) {
- frappe.query_report.set_filter_value('tax_id', value["tax_id"]);
- frappe.query_report.set_filter_value('customer_name', value["customer_name"]);
- });
+ if (customer) {
+ frappe.db.get_value('Customer', customer, ["tax_id", "customer_name", "credit_limit", "payment_terms"], function(value) {
+ frappe.query_report.set_filter_value('tax_id', value["tax_id"]);
+ frappe.query_report.set_filter_value('customer_name', value["customer_name"]);
+ frappe.query_report.set_filter_value('credit_limit', value["credit_limit"]);
+ frappe.query_report.set_filter_value('payment_terms', value["payment_terms"]);
+ });
+ } else {
+ frappe.query_report.set_filter_value('tax_id', "");
+ frappe.query_report.set_filter_value('customer_name', "");
+ frappe.query_report.set_filter_value('credit_limit', "");
+ frappe.query_report.set_filter_value('payment_terms', "");
+ }
}
},
{
@@ -59,43 +102,6 @@ frappe.query_reports["Accounts Receivable"] = {
"fieldtype": "Link",
"options": "Sales Person"
},
- {
- "fieldtype": "Break",
- },
- {
- "fieldname":"report_date",
- "label": __("As on Date"),
- "fieldtype": "Date",
- "default": frappe.datetime.get_today()
- },
- {
- "fieldname":"ageing_based_on",
- "label": __("Ageing Based On"),
- "fieldtype": "Select",
- "options": 'Posting Date\nDue Date',
- "default": "Posting Date"
- },
- {
- "fieldname":"range1",
- "label": __("Ageing Range 1"),
- "fieldtype": "Int",
- "default": "30",
- "reqd": 1
- },
- {
- "fieldname":"range2",
- "label": __("Ageing Range 2"),
- "fieldtype": "Int",
- "default": "60",
- "reqd": 1
- },
- {
- "fieldname":"range3",
- "label": __("Ageing Range 3"),
- "fieldtype": "Int",
- "default": "90",
- "reqd": 1
- },
{
"fieldname":"show_pdc_in_print",
"label": __("Show PDC in Print"),
@@ -112,6 +118,18 @@ frappe.query_reports["Accounts Receivable"] = {
"label": __("Customer Name"),
"fieldtype": "Data",
"hidden": 1
+ },
+ {
+ "fieldname":"payment_terms",
+ "label": __("Payment Tems"),
+ "fieldtype": "Data",
+ "hidden": 1
+ },
+ {
+ "fieldname":"credit_limit",
+ "label": __("Credit Limit"),
+ "fieldtype": "Currency",
+ "hidden": 1
}
],
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index 572f81dc35e..8e05a087af7 100755
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -125,17 +125,22 @@ class ReceivablePayableReport(object):
}]
if args.get('party_type') == 'Customer':
- columns.append({
- "label": _("Customer LPO"),
- "fieldtype": "Data",
- "fieldname": "po_no",
- "width": 100,
- })
- columns += [_("Delivery Note") + ":Data:100"]
- if args.get("party_type") == "Customer":
columns += [
+ {
+ "label": _("Customer LPO"),
+ "fieldtype": "Data",
+ "fieldname": "po_no",
+ "width": 100,
+ },
+ _("Delivery Note") + ":Data:100",
_("Territory") + ":Link/Territory:80",
- _("Customer Group") + ":Link/Customer Group:120"
+ _("Customer Group") + ":Link/Customer Group:120",
+ {
+ "label": _("Sales Person"),
+ "fieldtype": "Data",
+ "fieldname": "sales_person",
+ "width": 120,
+ }
]
if args.get("party_type") == "Supplier":
columns += [_("Supplier Group") + ":Link/Supplier Group:80"]
@@ -238,7 +243,8 @@ class ReceivablePayableReport(object):
# customer territory / supplier group
if args.get("party_type") == "Customer":
- row += [self.get_territory(gle.party), self.get_customer_group(gle.party)]
+ row += [self.get_territory(gle.party), self.get_customer_group(gle.party),
+ voucher_details.get(gle.voucher_no, {}).get("sales_person")]
if args.get("party_type") == "Supplier":
row += [self.get_supplier_group(gle.party)]
@@ -395,9 +401,14 @@ class ReceivablePayableReport(object):
values.append(self.filters.get("sales_partner"))
if self.filters.get("sales_person"):
- conditions.append("""party in (select parent
- from `tabSales Team` where sales_person=%s and parenttype = 'Customer')""")
- values.append(self.filters.get("sales_person"))
+ lft, rgt = frappe.db.get_value("Sales Person",
+ self.filters.get("sales_person"), ["lft", "rgt"])
+
+ conditions.append("""exists(select name from `tabSales Team` steam where
+ steam.sales_person in (select name from `tabSales Person` where lft >= {0} and rgt <= {1})
+ and ((steam.parent = voucher_no and steam.parenttype = voucher_type)
+ or (steam.parent = against_voucher and steam.parenttype = against_voucher_type)
+ or (steam.parent = party and steam.parenttype = 'Customer')))""".format(lft, rgt))
if party_type_field=="supplier":
if self.filters.get("supplier_group"):
@@ -550,8 +561,12 @@ def get_voucher_details(party_type, voucher_nos, dn_details):
voucher_details = frappe._dict()
if party_type == "Customer":
- for si in frappe.db.sql("""select name, due_date, po_no
- from `tabSales Invoice` where docstatus=1 and name in (%s)
+ for si in frappe.db.sql("""
+ select inv.name, inv.due_date, inv.po_no, GROUP_CONCAT(steam.sales_person SEPARATOR ', ') as sales_person
+ from `tabSales Invoice` inv
+ left join `tabSales Team` steam on steam.parent = inv.name and steam.parenttype = 'Sales Invoice'
+ where inv.docstatus=1 and inv.name in (%s)
+ group by inv.name
""" %(','.join(['%s'] *len(voucher_nos))), (tuple(voucher_nos)), as_dict=1):
si['delivery_note'] = dn_details.get(si.name)
voucher_details.setdefault(si.name, si)
diff --git a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js
index 96e5d180938..a6f1457954c 100644
--- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js
+++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.js
@@ -11,25 +11,11 @@ frappe.query_reports["Accounts Receivable Summary"] = {
"default": frappe.defaults.get_user_default("Company")
},
{
- "fieldname":"customer",
- "label": __("Customer"),
- "fieldtype": "Link",
- "options": "Customer"
- },
- {
- "fieldname":"customer_group",
- "label": __("Customer Group"),
- "fieldtype": "Link",
- "options": "Customer Group"
- },
- {
- "fieldname":"payment_terms_template",
- "label": __("Payment Terms Template"),
- "fieldtype": "Link",
- "options": "Payment Terms Template"
- },
- {
- "fieldtype": "Break",
+ "fieldname":"ageing_based_on",
+ "label": __("Ageing Based On"),
+ "fieldtype": "Select",
+ "options": 'Posting Date\nDue Date',
+ "default": "Posting Date"
},
{
"fieldname":"report_date",
@@ -37,13 +23,6 @@ frappe.query_reports["Accounts Receivable Summary"] = {
"fieldtype": "Date",
"default": frappe.datetime.get_today()
},
- {
- "fieldname":"ageing_based_on",
- "label": __("Ageing Based On"),
- "fieldtype": "Select",
- "options": 'Posting Date\nDue Date',
- "default": "Posting Date"
- },
{
"fieldname":"range1",
"label": __("Ageing Range 1"),
@@ -64,6 +43,48 @@ frappe.query_reports["Accounts Receivable Summary"] = {
"fieldtype": "Int",
"default": "90",
"reqd": 1
+ },
+ {
+ "fieldname":"finance_book",
+ "label": __("Finance Book"),
+ "fieldtype": "Link",
+ "options": "Finance Book"
+ },
+ {
+ "fieldname":"customer",
+ "label": __("Customer"),
+ "fieldtype": "Link",
+ "options": "Customer"
+ },
+ {
+ "fieldname":"customer_group",
+ "label": __("Customer Group"),
+ "fieldtype": "Link",
+ "options": "Customer Group"
+ },
+ {
+ "fieldname":"payment_terms_template",
+ "label": __("Payment Terms Template"),
+ "fieldtype": "Link",
+ "options": "Payment Terms Template"
+ },
+ {
+ "fieldname":"territory",
+ "label": __("Territory"),
+ "fieldtype": "Link",
+ "options": "Territory"
+ },
+ {
+ "fieldname":"sales_partner",
+ "label": __("Sales Partner"),
+ "fieldtype": "Link",
+ "options": "Sales Partner"
+ },
+ {
+ "fieldname":"sales_person",
+ "label": __("Sales Person"),
+ "fieldtype": "Link",
+ "options": "Sales Person"
}
],
diff --git a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
index 7bf99728f71..190031abb8c 100644
--- a/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
+++ b/erpnext/accounts/report/accounts_receivable_summary/accounts_receivable_summary.py
@@ -97,6 +97,12 @@ class AccountsReceivableSummary(ReceivablePayableReport):
"fieldtype": "Link",
"options": "Customer Group",
"width": 80
+ },
+ {
+ "label": _("Sales Person"),
+ "fieldtype": "Data",
+ "fieldname": "sales_person",
+ "width": 120,
}]
if args.get("party_type") == "Supplier":
@@ -135,7 +141,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
]
if args.get("party_type") == "Customer":
- row += [self.get_territory(party), self.get_customer_group(party)]
+ row += [self.get_territory(party), self.get_customer_group(party), ", ".join(set(party_dict.sales_person))]
if args.get("party_type") == "Supplier":
row += [self.get_supplier_group(party)]
@@ -156,15 +162,19 @@ class AccountsReceivableSummary(ReceivablePayableReport):
"range1": 0,
"range2": 0,
"range3": 0,
- "range4": 0
+ "range4": 0,
+ "sales_person": []
})
)
for k in list(party_total[d.party]):
- if k != "currency":
+ if k not in ["currency", "sales_person"]:
party_total[d.party][k] += flt(d.get(k, 0))
party_total[d.party].currency = d.currency
+ if d.sales_person:
+ party_total[d.party].sales_person.append(d.sales_person)
+
return party_total
def get_voucherwise_data(self, party_naming_by, args):
@@ -181,12 +191,13 @@ class AccountsReceivableSummary(ReceivablePayableReport):
cols += ["bill_no", "bill_date"]
cols += ["invoiced_amt", "paid_amt", "credit_amt",
- "outstanding_amt", "age", "range1", "range2", "range3", "range4", "currency"]
+ "outstanding_amt", "age", "range1", "range2", "range3", "range4", "currency", "pdc/lc_date", "pdc/lc_ref",
+ "pdc/lc_amount", "remaining_balance"]
if args.get("party_type") == "Supplier":
cols += ["supplier_group", "remarks"]
if args.get("party_type") == "Customer":
- cols += ["territory", "customer_group", "remarks"]
+ cols += ["po_no", "do_no", "territory", "customer_group", "sales_person", "remarks"]
return self.make_data_dict(cols, voucherwise_data)
diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py
index d9ffced547a..15996c3a44b 100644
--- a/erpnext/config/accounts.py
+++ b/erpnext/config/accounts.py
@@ -1,8 +1,10 @@
from __future__ import unicode_literals
from frappe import _
+import frappe
+
def get_data():
- return [
+ config = [
{
"label": _("Billing"),
"items": [
@@ -25,48 +27,7 @@ def get_data():
"type": "doctype",
"name": "Payment Entry",
"description": _("Bank/Cash transactions against party or for internal transfer")
- },
- {
- "type": "page",
- "name": "pos",
- "label": _("POS"),
- "description": _("Point of Sale")
- },
- {
- "type": "doctype",
- "name": "Cashier Closing",
- "description": _("Cashier Closing")
- },
- {
- "type": "doctype",
- "name": "Auto Repeat",
- "label": _("Auto Repeat"),
- "description": _("To make recurring documents")
- },
- {
- "type": "doctype",
- "name": "Loyalty Program",
- "label": _("Loyalty Program"),
- "description": _("To make Customer based incentive schemes.")
- },
- {
- "type": "doctype",
- "name": "Loyalty Point Entry",
- "label": _("Loyalty Point Entry"),
- "description": _("To view logs of Loyalty Points assigned to a Customer.")
- },
- {
- "type": "report",
- "name": "Accounts Receivable",
- "doctype": "Sales Invoice",
- "is_query_report": True
- },
- {
- "type": "report",
- "name": "Accounts Payable",
- "doctype": "Purchase Invoice",
- "is_query_report": True
- },
+ }
]
},
@@ -93,7 +54,7 @@ def get_data():
},
{
"type": "report",
- "name":"General Ledger",
+ "name": "General Ledger",
"doctype": "GL Entry",
"is_query_report": True,
},
@@ -121,6 +82,18 @@ def get_data():
{
"label": _("Accounting Statements"),
"items": [
+ {
+ "type": "report",
+ "name": "Accounts Receivable",
+ "doctype": "Sales Invoice",
+ "is_query_report": True
+ },
+ {
+ "type": "report",
+ "name": "Accounts Payable",
+ "doctype": "Purchase Invoice",
+ "is_query_report": True
+ },
{
"type": "report",
"name": "Trial Balance",
@@ -224,49 +197,6 @@ def get_data():
},
]
},
- {
- "label": _("Goods and Services Tax (GST India)"),
- "items": [
- {
- "type": "doctype",
- "name": "GST Settings",
- },
- {
- "type": "doctype",
- "name": "GST HSN Code",
- },
- {
- "type": "report",
- "name": "GSTR-1",
- "is_query_report": True
- },
- {
- "type": "report",
- "name": "GSTR-2",
- "is_query_report": True
- },
- {
- "type": "report",
- "name": "GST Sales Register",
- "is_query_report": True
- },
- {
- "type": "report",
- "name": "GST Purchase Register",
- "is_query_report": True
- },
- {
- "type": "report",
- "name": "GST Itemised Sales Register",
- "is_query_report": True
- },
- {
- "type": "report",
- "name": "GST Itemised Purchase Register",
- "is_query_report": True
- },
- ]
- },
{
"label": _("Budget and Cost Center"),
"items": [
@@ -290,7 +220,7 @@ def get_data():
"doctype": "Cost Center"
},
{
- "type":"doctype",
+ "type": "doctype",
"name": "Monthly Distribution",
"description": _("Seasonality for setting budgets, targets etc.")
},
@@ -347,29 +277,24 @@ def get_data():
},
{
"type": "doctype",
- "name": "POS Settings",
- "description": _("Setup mode of POS (Online / Offline)")
- },
- {
- "type": "doctype",
- "name": "POS Profile",
- "label": _("Point-of-Sale Profile"),
- "description": _("Setup default values for POS Invoices")
- },
- {
- "type": "doctype",
- "name":"Terms and Conditions",
+ "name": "Terms and Conditions",
"label": _("Terms and Conditions Template"),
"description": _("Template of terms or contract.")
},
{
"type": "doctype",
- "name":"Mode of Payment",
+ "name": "Mode of Payment",
"description": _("e.g. Bank, Cash, Credit Card")
},
{
"type": "doctype",
- "name":"C-Form",
+ "name": "Auto Repeat",
+ "label": _("Auto Repeat"),
+ "description": _("To make recurring documents")
+ },
+ {
+ "type": "doctype",
+ "name": "C-Form",
"description": _("C-Form records"),
"country": "India"
}
@@ -506,12 +431,12 @@ def get_data():
"items": [
{
"type": "doctype",
- "name":"Shareholder",
+ "name": "Shareholder",
"description": _("List of available Shareholders with folio numbers")
},
{
"type": "doctype",
- "name":"Share Transfer",
+ "name": "Share Transfer",
"description": _("List of all share transactions"),
},
{
@@ -528,28 +453,6 @@ def get_data():
}
]
},
- {
- "label": _("Subscription Management"),
- "icon": "fa fa-microchip ",
- "items": [
- {
- "type": "doctype",
- "name":"Subscriber",
- },
- {
- "type": "doctype",
- "name":"Subscription Plan",
- },
- {
- "type": "doctype",
- "name":"Subscription"
- },
- {
- "type": "doctype",
- "name": "Subscription Settings"
- }
- ]
- },
{
"label": _("Help"),
"icon": "fa fa-facetime-video",
@@ -572,3 +475,121 @@ def get_data():
]
}
]
+ gst = {
+ "label": _("Goods and Services Tax (GST India)"),
+ "items": [
+ {
+ "type": "doctype",
+ "name": "GST Settings",
+ },
+ {
+ "type": "doctype",
+ "name": "GST HSN Code",
+ },
+ {
+ "type": "report",
+ "name": "GSTR-1",
+ "is_query_report": True
+ },
+ {
+ "type": "report",
+ "name": "GSTR-2",
+ "is_query_report": True
+ },
+ {
+ "type": "report",
+ "name": "GST Sales Register",
+ "is_query_report": True
+ },
+ {
+ "type": "report",
+ "name": "GST Purchase Register",
+ "is_query_report": True
+ },
+ {
+ "type": "report",
+ "name": "GST Itemised Sales Register",
+ "is_query_report": True
+ },
+ {
+ "type": "report",
+ "name": "GST Itemised Purchase Register",
+ "is_query_report": True
+ },
+ ]
+ }
+ retail = {
+ "label": _("Retail Operations"),
+ "items": [
+ {
+ "type": "page",
+ "name": "pos",
+ "label": _("POS"),
+ "description": _("Point of Sale")
+ },
+ {
+ "type": "doctype",
+ "name": "Cashier Closing",
+ "description": _("Cashier Closing")
+ },
+ {
+ "type": "doctype",
+ "name": "POS Settings",
+ "description": _("Setup mode of POS (Online / Offline)")
+ },
+ {
+ "type": "doctype",
+ "name": "POS Profile",
+ "label": _("Point-of-Sale Profile"),
+ "description": _("Setup default values for POS Invoices")
+ },
+ {
+ "type": "doctype",
+ "name": "Loyalty Program",
+ "label": _("Loyalty Program"),
+ "description": _("To make Customer based incentive schemes.")
+ },
+ {
+ "type": "doctype",
+ "name": "Loyalty Point Entry",
+ "label": _("Loyalty Point Entry"),
+ "description": _("To view logs of Loyalty Points assigned to a Customer.")
+ }
+ ]
+ }
+ subscriptions = {
+ "label": _("Subscription Management"),
+ "icon": "fa fa-microchip ",
+ "items": [
+ {
+ "type": "doctype",
+ "name": "Subscriber",
+ },
+ {
+ "type": "doctype",
+ "name": "Subscription Plan",
+ },
+ {
+ "type": "doctype",
+ "name": "Subscription"
+ },
+ {
+ "type": "doctype",
+ "name": "Subscription Settings"
+ }
+ ]
+ }
+ countries = frappe.get_all("Company", fields="country")
+ countries = [country["country"] for country in countries]
+ if "India" in countries:
+ config.insert(7, gst)
+ domains = frappe.get_active_domains()
+ if "Retail" in domains:
+ config.insert(2, retail)
+ else:
+ config.insert(7, retail)
+ if "Services" in domains:
+ config.insert(2, subscriptions)
+ else:
+ config.insert(7, subscriptions)
+ return config
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index acbeda6fe31..e5d625e83a8 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -12,7 +12,7 @@ app_license = "GNU General Public License (v3)"
source_link = "https://github.com/frappe/erpnext"
develop_version = '12.x.x-develop'
-staging_version = '11.0.3-beta.26'
+staging_version = '11.0.3-beta.27'
error_report_email = "support@erpnext.com"
diff --git a/erpnext/manufacturing/doctype/job_card/job_card.py b/erpnext/manufacturing/doctype/job_card/job_card.py
index 81c5eb9550f..bc745350a7e 100644
--- a/erpnext/manufacturing/doctype/job_card/job_card.py
+++ b/erpnext/manufacturing/doctype/job_card/job_card.py
@@ -110,7 +110,7 @@ class JobCard(Document):
if self.items:
self.transferred_qty = frappe.db.get_value('Stock Entry', {'job_card': self.name,
- 'work_order': self.work_order, 'docstatus': 1}, 'sum(fg_completed_qty)')
+ 'work_order': self.work_order, 'docstatus': 1}, 'sum(fg_completed_qty)') or 0
self.db_set("transferred_qty", self.transferred_qty)
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 4a67eb4e477..0452132abcc 100755
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -579,3 +579,4 @@ erpnext.patches.v10_0.update_user_image_in_employee
erpnext.patches.v11_0.update_delivery_trip_status
erpnext.patches.v10_0.repost_gle_for_purchase_receipts_with_rejected_items
erpnext.patches.v11_0.set_missing_gst_hsn_code
+erpnext.patches.v11_0.update_package_total_in_delivery_trips
\ No newline at end of file
diff --git a/erpnext/patches/v11_0/update_package_total_in_delivery_trips.py b/erpnext/patches/v11_0/update_package_total_in_delivery_trips.py
new file mode 100755
index 00000000000..d609890fb45
--- /dev/null
+++ b/erpnext/patches/v11_0/update_package_total_in_delivery_trips.py
@@ -0,0 +1,7 @@
+import frappe
+
+def execute():
+ for trip in frappe.get_all("Delivery Trip", {"docstatus" : 1}):
+ trip_doc = frappe.get_doc("Delivery Trip", trip.name)
+ total = sum([stop.grand_total for stop in trip_doc.delivery_stops if stop.grand_total])
+ frappe.db.set_value("Delivery Trip", trip.name, "package_total", total, update_modified=False)
\ No newline at end of file
diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js
index 40b065ddff7..faa445af94b 100644
--- a/erpnext/projects/doctype/project/project.js
+++ b/erpnext/projects/doctype/project/project.js
@@ -120,28 +120,3 @@ frappe.ui.form.on("Project Task", {
frm.trigger('tasks_refresh');
},
});
-
-frappe.ui.form.on("Project", "validate", function (frm) {
- if (frm.doc.collect_progress == 1) {
- frappe.call({
- method: "erpnext.projects.doctype.project.project.times_check",
- args: {
- "from1": frm.doc.from,
- "to": frm.doc.to,
- "first_email": frm.doc.first_email,
- "second_email": frm.doc.second_email,
- "daily_time_to_send": frm.doc.daily_time_to_send,
- "weekly_time_to_send": frm.doc.weekly_time_to_send
-
- },
- callback: function (r) {
- frm.set_value("from", r.message.from1);
- frm.set_value("to", r.message.to);
- frm.set_value("first_email", r.message.first_email);
- frm.set_value("second_email", r.message.second_email);
- frm.set_value("daily_time_to_send", r.message.daily_time_to_send);
- frm.set_value("weekly_time_to_send", r.message.weekly_time_to_send);
- }
- });
- }
-});
\ No newline at end of file
diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py
index ff698704f0e..942593a9484 100644
--- a/erpnext/projects/doctype/project/project.py
+++ b/erpnext/projects/doctype/project/project.py
@@ -427,23 +427,6 @@ def weekly():
project = frappe.db.sql("""SELECT `tabProject User`.user FROM `tabProject User` INNER JOIN `tabProject` ON `tabProject`.project_name = `tabProject User`.parent WHERE (`tabProject`.frequency = "Weekly") AND (`tabProject`.day_to_send = %s) AND (`tabProject`.weekly_time_to_send BETWEEN DATE_ADD(curtime(), INTERVAL -15 MINUTE) AND DATE_ADD(curtime(), INTERVAL 15 MINUTE)) AND `tabProject`.collect_progress = 1""", today)
create_project_update(project)
-@frappe.whitelist()
-def times_check(from1, to, first_email, second_email, daily_time_to_send, weekly_time_to_send):
- from1 = datetime.datetime.strptime(from1, "%H:%M:%S.%f")
- from1 = from1.strftime("%H:00:00")
- to = datetime.datetime.strptime(to, "%H:%M:%S.%f")
- to = to.strftime("%H:00:00")
- first_email = datetime.datetime.strptime(first_email, "%H:%M:%S.%f")
- first_email = first_email.strftime("%H:00:00")
- second_email = datetime.datetime.strptime(second_email, "%H:%M:%S.%f")
- second_email = second_email.strftime("%H:00:00")
- daily_time_to_send = datetime.datetime.strptime(daily_time_to_send, "%H:%M:%S.%f")
- daily_time_to_send = daily_time_to_send.strftime("%H:00:00")
- weekly_time_to_send = datetime.datetime.strptime(weekly_time_to_send, "%H:%M:%S.%f")
- weekly_time_to_send = weekly_time_to_send.strftime("%H:00:00")
- return {"from1": from1, "to": to, "first_email": first_email, "second_email": second_email,"daily_time_to_send": daily_time_to_send, "weekly_time_to_send": weekly_time_to_send}
-
-
#Call this function in order to generate the Project Update for a specific project
def create_project_update(project):
data = []
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index 391323d675a..0f52c992e54 100644
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -120,7 +120,7 @@ $.extend(erpnext.utils, {
);
});
}
- else {
+ else if (company_wise_info.length === 1) {
frm.dashboard.stats_area.removeClass('hidden');
frm.dashboard.stats_area_row.append(
'Annual Billing: '
diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js
index 1b7959d7eb0..32c7eb5bff3 100644
--- a/erpnext/selling/doctype/quotation/quotation.js
+++ b/erpnext/selling/doctype/quotation/quotation.js
@@ -206,7 +206,7 @@ cur_frm.cscript['Declare Order Lost'] = function(){
}
-frappe.ui.form.on("Quotation Item", "items_on_form_rendered", function(frm, cdt, cdn) {
+frappe.ui.form.on("Quotation Item", "items_on_form_rendered", "packed_items_on_form_rendered", function(frm, cdt, cdn) {
// enable tax_amount field if Actual
})
diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.py b/erpnext/selling/page/point_of_sale/point_of_sale.py
index a3dfa51a0b2..ced6540e212 100644
--- a/erpnext/selling/page/point_of_sale/point_of_sale.py
+++ b/erpnext/selling/page/point_of_sale/point_of_sale.py
@@ -129,6 +129,8 @@ def search_serial_or_batch_or_barcode_number(search_value):
if batch_no_data:
return batch_no_data
+ return {}
+
def get_conditions(item_code, serial_no, batch_no, barcode):
if serial_no or batch_no or barcode:
return frappe.db.escape(item_code), "i.name = %(item_code)s"
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js
index 9a154846e5f..f8a34972b70 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.js
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.js
@@ -223,6 +223,10 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend(
erpnext.setup_serial_no();
},
+ packed_items_on_form_rendered: function(doc, grid_row) {
+ erpnext.setup_serial_no();
+ },
+
close_delivery_note: function(doc){
this.update_status("Closed")
},
diff --git a/erpnext/stock/doctype/delivery_trip/delivery_trip.py b/erpnext/stock/doctype/delivery_trip/delivery_trip.py
index 01b4734bf58..cafc9380cb6 100644
--- a/erpnext/stock/doctype/delivery_trip/delivery_trip.py
+++ b/erpnext/stock/doctype/delivery_trip/delivery_trip.py
@@ -25,6 +25,8 @@ class DeliveryTrip(Document):
def validate(self):
self.validate_stop_addresses()
+ self.update_status()
+ self.update_package_total()
def on_submit(self):
self.update_status()
@@ -37,11 +39,6 @@ class DeliveryTrip(Document):
self.update_status()
self.update_delivery_notes(delete=True)
- def validate_stop_addresses(self):
- for stop in self.delivery_stops:
- if not stop.customer_address:
- stop.customer_address = get_address_display(frappe.get_doc("Address", stop.address).as_dict())
-
def update_status(self):
status = {
0: "Draft",
@@ -58,6 +55,14 @@ class DeliveryTrip(Document):
self.db_set("status", status)
+ def update_package_total(self):
+ self.package_total = sum([stop.grand_total for stop in self.delivery_stops if stop.grand_total])
+
+ def validate_stop_addresses(self):
+ for stop in self.delivery_stops:
+ if not stop.customer_address:
+ stop.customer_address = get_address_display(frappe.get_doc("Address", stop.address).as_dict())
+
def update_delivery_notes(self, delete=False):
"""
Update all connected Delivery Notes with Delivery Trip details
diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js
index 76aa63a1dae..991fc41fcc4 100644
--- a/erpnext/stock/doctype/material_request/material_request.js
+++ b/erpnext/stock/doctype/material_request/material_request.js
@@ -108,7 +108,7 @@ frappe.ui.form.on('Material Request', {
update_status: function(frm, stop_status) {
frappe.call({
- method: 'erpnext.stock.material_request.material_request.update_status',
+ method: 'erpnext.stock.doctype.material_request.material_request.update_status',
args: { name: frm.doc.name, status: stop_status },
callback(r) {
if (!r.exc) {