From 1906f6da3aedeaf4e199308bda29f6589b5d7f54 Mon Sep 17 00:00:00 2001 From: Jay Parikh Date: Fri, 8 Feb 2019 11:13:09 +0000 Subject: [PATCH 01/34] Fix - POS >> Item listing after submit pos >> list all the items which are not restricted to that pos profile #16588 --- erpnext/selling/page/point_of_sale/point_of_sale.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js index 8b4d684466..c54430fd56 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -166,7 +166,7 @@ erpnext.pos.PointOfSale = class PointOfSale { }); frappe.ui.form.on('Sales Invoice', 'selling_price_list', (frm) => { - if(this.items) { + if(this.items && frm.doc.pos_profile) { this.items.reset_items(); } }) From afef9c1cc7cfa32da5fdc190762c2b9e47ec714f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 12 Feb 2019 11:28:20 +0530 Subject: [PATCH 02/34] fix: Ignore tds account while creating tax withholding category --- erpnext/regional/india/setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py index a6d723a824..c5498c7770 100644 --- a/erpnext/regional/india/setup.py +++ b/erpnext/regional/india/setup.py @@ -345,13 +345,14 @@ def set_tax_withholding_category(company): if company and tds_account: accounts = [dict(company=company, account=tds_account)] - fiscal_year = get_fiscal_year(today(), company=accounts[0].get('company'))[0] + fiscal_year = get_fiscal_year(today(), company=company)[0] docs = get_tds_details(accounts, fiscal_year) for d in docs: try: doc = frappe.get_doc(d) doc.flags.ignore_permissions = True + doc.flags.ignore_mandatory = True doc.insert() except frappe.DuplicateEntryError: doc = frappe.get_doc("Tax Withholding Category", d.get("name")) From 88baf53cc12d7ffd3aa322610cf93378a963bcec Mon Sep 17 00:00:00 2001 From: karthikeyan5 Date: Wed, 30 Jan 2019 17:40:40 +0530 Subject: [PATCH 03/34] feat(marketplace): navigation link to seller profile from item page --- .../public/js/hub/components/DetailHeaderItem.vue | 14 ++++++++++---- erpnext/public/js/hub/pages/Item.vue | 6 ++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/erpnext/public/js/hub/components/DetailHeaderItem.vue b/erpnext/public/js/hub/components/DetailHeaderItem.vue index 8ca4379701..a6c5f066f2 100644 --- a/erpnext/public/js/hub/components/DetailHeaderItem.vue +++ b/erpnext/public/js/hub/components/DetailHeaderItem.vue @@ -1,5 +1,12 @@ + + diff --git a/erpnext/public/js/hub/pages/Item.vue b/erpnext/public/js/hub/pages/Item.vue index c379fc7343..841d0046db 100644 --- a/erpnext/public/js/hub/pages/Item.vue +++ b/erpnext/public/js/hub/pages/Item.vue @@ -72,6 +72,11 @@ export default { condition: hub.is_user_registered() && !this.is_own_item, action: this.add_to_saved_items }, + { + label: __('Add to Featured Item'), + condition: hub.is_user_registered() && this.is_own_item, + action: this.add_to_featured_items + }, { label: __('Report this Item'), condition: !this.is_own_item, @@ -212,6 +217,21 @@ export default { }); }, + add_to_featured_items() { + hub.call('add_item_to_seller_featured_items', { + hub_item_name: this.hub_item_name, + hub_user: frappe.session.user + },) + .then(() => { + const featured_items_link = `${__('Added to Featured Items')}` + frappe.show_alert(featured_items_link); + erpnext.hub.trigger('action:item_feature'); + }) + .catch(e => { + console.error(e); + }); + }, + make_contact_seller_dialog() { this.contact_seller_dialog = new frappe.ui.Dialog({ title: __('Send a message'), From 4df6003bd9d230a874b655dfea3cf16754712f70 Mon Sep 17 00:00:00 2001 From: karthikeyan5 Date: Fri, 8 Feb 2019 17:51:01 +0530 Subject: [PATCH 05/34] feat(marketplace): seller profile page --- erpnext/public/js/hub/PageContainer.vue | 5 +- erpnext/public/js/hub/pages/Profile.vue | 81 ------------- erpnext/public/js/hub/pages/Seller.vue | 122 ++++++++++++++++++-- erpnext/public/js/hub/pages/SellerItems.vue | 57 +++++++++ 4 files changed, 170 insertions(+), 95 deletions(-) delete mode 100644 erpnext/public/js/hub/pages/Profile.vue create mode 100644 erpnext/public/js/hub/pages/SellerItems.vue diff --git a/erpnext/public/js/hub/PageContainer.vue b/erpnext/public/js/hub/PageContainer.vue index 79358376ff..f151add8d5 100644 --- a/erpnext/public/js/hub/PageContainer.vue +++ b/erpnext/public/js/hub/PageContainer.vue @@ -14,11 +14,11 @@ import FeaturedItems from './pages/FeaturedItems.vue'; import PublishedItems from './pages/PublishedItems.vue'; import Item from './pages/Item.vue'; import Seller from './pages/Seller.vue'; +import SellerItems from './pages/SellerItems.vue'; import Publish from './pages/Publish.vue'; import Buying from './pages/Buying.vue'; import Selling from './pages/Selling.vue'; import Messages from './pages/Messages.vue'; -import Profile from './pages/Profile.vue'; import NotFound from './pages/NotFound.vue'; function get_route_map() { @@ -28,10 +28,11 @@ function get_route_map() { 'marketplace/category/:category': Category, 'marketplace/item/:item': Item, 'marketplace/seller/:seller': Seller, + 'marketplace/seller/:seller/items': SellerItems, 'marketplace/not-found': NotFound, } const registered_routes = { - 'marketplace/profile': Profile, + 'marketplace/profile': Seller, 'marketplace/saved-items': SavedItems, 'marketplace/featured-items': FeaturedItems, 'marketplace/publish': Publish, diff --git a/erpnext/public/js/hub/pages/Profile.vue b/erpnext/public/js/hub/pages/Profile.vue deleted file mode 100644 index 91ed946761..0000000000 --- a/erpnext/public/js/hub/pages/Profile.vue +++ /dev/null @@ -1,81 +0,0 @@ - - - - - diff --git a/erpnext/public/js/hub/pages/Seller.vue b/erpnext/public/js/hub/pages/Seller.vue index c80865bfbd..7d9b76e884 100644 --- a/erpnext/public/js/hub/pages/Seller.vue +++ b/erpnext/public/js/hub/pages/Seller.vue @@ -22,30 +22,77 @@ -
{{ item_container_heading }}
- - +
+
+ {{ item_container_heading }} + + Customize your Featured Items + +
+ + + Show all items +
+ +
+
Customer Reviews
+
+
+ + + + + {{ review.subject }} + +
+ by {{ review.username }} + + + + +
+
+
+ +
+
Stats
+
+
+ + + + + From 4324dc6ea890fb471e2927c9df70d04bf6df1aa2 Mon Sep 17 00:00:00 2001 From: karthikeyan5 Date: Tue, 12 Feb 2019 15:09:41 +0530 Subject: [PATCH 06/34] fix(marketplace): fixing hubmarket server specific error --- erpnext/public/js/hub/pages/Seller.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/erpnext/public/js/hub/pages/Seller.vue b/erpnext/public/js/hub/pages/Seller.vue index 7d9b76e884..e339eaa3e5 100644 --- a/erpnext/public/js/hub/pages/Seller.vue +++ b/erpnext/public/js/hub/pages/Seller.vue @@ -125,15 +125,14 @@ export default { return hub.is_user_registered() }, get_seller_profile_and_items() { + let post_data = {company: this.seller_company} if (this.page_name == 'profile'){ this.seller_company = null; this.hub_seller = hub.settings.hub_seller_name + post_data = {hub_seller: this.hub_seller} } - hub.call( - 'get_hub_seller_page_info', - { company: this.seller_company, - hub_seller: this.hub_seller } - ).then(data => { + hub.call('get_hub_seller_page_info', post_data) + .then(data => { this.init = false; this.profile = data.profile; this.items = data.items; From 6447069e50403a9493b7f6a1e5dfdf47a451cf0b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 12 Feb 2019 16:41:20 +0530 Subject: [PATCH 07/34] fix: show values in account/party currency based in actual entry, no conversion --- erpnext/accounts/report/general_ledger/general_ledger.py | 2 +- erpnext/accounts/report/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index 8c3deaff48..be6633282a 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -101,7 +101,7 @@ def set_account_currency(filters): frappe.db.get_value(filters.party_type, filters.party[0], "default_currency")) filters["account_currency"] = account_currency or filters.company_currency - if filters.account_currency != filters.company_currency: + if filters.account_currency != filters.company_currency and not filters.presentation_currency: filters.presentation_currency = filters.account_currency return filters diff --git a/erpnext/accounts/report/utils.py b/erpnext/accounts/report/utils.py index a8ae94f879..8a39744738 100644 --- a/erpnext/accounts/report/utils.py +++ b/erpnext/accounts/report/utils.py @@ -104,7 +104,7 @@ def convert_to_presentation_currency(gl_entries, currency_info): credit_in_account_currency = flt(entry['credit_in_account_currency']) account_currency = entry['account_currency'] - if account_currency != presentation_currency or (account_currency == presentation_currency and not is_p_or_l_account(account)): + if account_currency != presentation_currency: value = debit or credit date = currency_info['report_date'] if not is_p_or_l_account(account) else entry['posting_date'] From 5631ffca683ff3175dce52c2a95e6ad5fb592ca5 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 12 Feb 2019 17:12:48 +0530 Subject: [PATCH 08/34] fix: Barcode scanning UX --- erpnext/public/js/controllers/transaction.js | 69 ++++++++++---------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 20e1098806..cf62af7b70 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -276,13 +276,11 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ scan_barcode: function() { let scan_barcode_field = this.frm.fields_dict["scan_barcode"]; - let show_description = function(idx, item_code, exist=null) { - if(exist) { - scan_barcode_field.set_new_description(__('Row : ') + idx + ' ' + - item_code + __(' Qty increased by 1')); + let show_description = function(idx, exist = null) { + if (exist) { + scan_barcode_field.set_new_description(__('Row #{0}: Qty increased by 1', [idx])); } else { - scan_barcode_field.set_new_description(__('New row : ') + idx + ' ' + - item_code + __(' Created')); + scan_barcode_field.set_new_description(__('Row #{0}: Item added', [idx])); } } @@ -291,38 +289,39 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ method: "erpnext.selling.page.point_of_sale.point_of_sale.search_serial_or_batch_or_barcode_number", args: { search_value: this.frm.doc.scan_barcode } }).then(r => { - - if(r && r.message && r.message.item_code) { - let child = ""; - let add_row_index = -1; - let cur_grid= this.frm.fields_dict["items"].grid; - - this.frm.doc.items.map(d => { - if(d.item_code==r.message.item_code){ - add_row_index = d.idx; - return; - } else if(!d.item_code && add_row_index==-1) { - add_row_index = d.idx; - } - }); - - if(add_row_index == -1) { - child = frappe.model.add_child(this.frm.doc, cur_grid.doctype, "items", add_row_index); - } else { - child = cur_grid.get_grid_row(add_row_index-1).doc; - } - show_description(child.idx, r.message.item_code, child.item_code); - - frappe.model.set_value(child.doctype, child.name, { - "item_code": r.message.item_code, - "qty": (child.qty || 0) + 1 - }); + const data = r && r.message; + if (!data) { + scan_barcode_field.set_new_description(__('Cannot find Item with this barcode')); + return; } - else{ - scan_barcode_field.set_new_description(this.frm.doc.scan_barcode +__(' does not exist!')); + + let cur_grid = this.frm.fields_dict.items.grid; + + let row_to_modify = null; + const existing_item_row = this.frm.doc.items.find(d => d.item_code === data.item_code); + const blank_item_row = this.frm.doc.items.find(d => !d.item_code); + + if (existing_item_row) { + row_to_modify = existing_item_row; + } else if (blank_item_row) { + row_to_modify = blank_item_row; } + + if (!row_to_modify) { + // add new row + row_to_modify = frappe.model.add_child(this.frm.doc, cur_grid.doctype, 'items'); + } + + show_description(row_to_modify.idx, row_to_modify.item_code); + + frappe.model.set_value(row_to_modify.doctype, row_to_modify.name, { + item_code: data.item_code, + qty: (row_to_modify.qty || 0) + 1 + }); + + this.frm.refresh_field('items'); }); - scan_barcode_field.set_value(""); + scan_barcode_field.set_value(''); } return false; }, From 1a3c27bbeae137d616c1641d3bd82cf744dbe25a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 12 Feb 2019 17:38:37 +0530 Subject: [PATCH 09/34] fix: Make work order from production plan considering already ordered qty --- .../manufacturing/doctype/production_plan/production_plan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.py b/erpnext/manufacturing/doctype/production_plan/production_plan.py index d17adf6369..97a8ea7e3c 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.py +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.py @@ -276,8 +276,8 @@ class ProductionPlan(Document): item_dict[(d.item_code, d.material_request_item, d.warehouse)] = item_details else: item_details.update({ - "qty":flt(item_dict.get((d.item_code, d.sales_order, d.warehouse),{}) - .get("qty")) + flt(d.planned_qty) + "qty": flt(item_dict.get((d.item_code, d.sales_order, d.warehouse),{}) + .get("qty")) + (flt(d.planned_qty) - flt(d.ordered_qty)) }) item_dict[(d.item_code, d.sales_order, d.warehouse)] = item_details From db527bfb245a628b1963b2bc9b0aba60540bfc69 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 12 Feb 2019 18:30:00 +0530 Subject: [PATCH 10/34] fix: Enqueued item variants updation if there are more than 30 variants --- erpnext/stock/doctype/item/item.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 566b6386fe..bd06688caa 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -700,15 +700,14 @@ class Item(WebsiteGenerator): frappe.db.get_single_value('Item Variant Settings', 'do_not_update_variants'): return if self.has_variants: - updated = [] variants = frappe.db.get_all("Item", fields=["item_code"], filters={"variant_of": self.name}) - for d in variants: - variant = frappe.get_doc("Item", d) - copy_attributes_to_variant(self, variant) - variant.save() - updated.append(d.item_code) - if updated: - frappe.msgprint(_("Item Variants {0} updated").format(", ".join(updated))) + if variants: + if len(variants) <= 30: + update_variants(variants, self, publish_progress=False) + frappe.msgprint(_("Item Variants updated")) + else: + frappe.enqueue("erpnext.stock.doctype.item.item.update_variants", + variants=variants, template=self, now=frappe.flags.in_test, timeout=600) def validate_has_variants(self): if not self.has_variants and frappe.db.get_value("Item", self.name, "has_variants"): @@ -997,3 +996,13 @@ def get_item_attribute(parent, attribute_value=''): return frappe.get_all("Item Attribute Value", fields = ["attribute_value"], filters = {'parent': parent, 'attribute_value': ("like", "%%%s%%" % attribute_value)}) + +def update_variants(variants, template, publish_progress=True): + count=0 + for d in variants: + variant = frappe.get_doc("Item", d) + copy_attributes_to_variant(template, variant) + variant.save() + count+=1 + if publish_progress: + frappe.publish_progress(count*100/len(variants), title = _("Updating Variants...")) \ No newline at end of file From 4d1bc0ca853030bdbcaec5a6ca4fcd4063fe399e Mon Sep 17 00:00:00 2001 From: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> Date: Wed, 13 Feb 2019 16:58:46 +0530 Subject: [PATCH 11/34] fix: Add total row in analytics report (#16648) --- .../buying/report/purchase_analytics/purchase_analytics.json | 5 +++-- .../report/production_analytics/production_analytics.json | 5 +++-- erpnext/selling/report/sales_analytics/sales_analytics.json | 5 +++-- erpnext/stock/report/stock_analytics/stock_analytics.json | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/erpnext/buying/report/purchase_analytics/purchase_analytics.json b/erpnext/buying/report/purchase_analytics/purchase_analytics.json index 996e3eef45..7ce779d773 100644 --- a/erpnext/buying/report/purchase_analytics/purchase_analytics.json +++ b/erpnext/buying/report/purchase_analytics/purchase_analytics.json @@ -1,12 +1,13 @@ { - "add_total_row": 0, + "add_total_row": 1, "creation": "2018-10-05 16:08:24.156448", + "disable_prepared_report": 0, "disabled": 0, "docstatus": 0, "doctype": "Report", "idx": 0, "is_standard": "Yes", - "modified": "2018-10-05 16:08:33.272201", + "modified": "2019-02-12 14:32:29.107109", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Analytics", diff --git a/erpnext/manufacturing/report/production_analytics/production_analytics.json b/erpnext/manufacturing/report/production_analytics/production_analytics.json index 023e0a8929..946cd33a1a 100644 --- a/erpnext/manufacturing/report/production_analytics/production_analytics.json +++ b/erpnext/manufacturing/report/production_analytics/production_analytics.json @@ -1,13 +1,14 @@ { - "add_total_row": 0, + "add_total_row": 1, "creation": "2018-10-11 19:28:37.085066", + "disable_prepared_report": 0, "disabled": 0, "docstatus": 0, "doctype": "Report", "idx": 0, "is_standard": "Yes", "letter_head": "", - "modified": "2018-10-11 19:28:37.085066", + "modified": "2019-02-12 14:32:16.392521", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Analytics", diff --git a/erpnext/selling/report/sales_analytics/sales_analytics.json b/erpnext/selling/report/sales_analytics/sales_analytics.json index 5c95f28410..bd8230230b 100644 --- a/erpnext/selling/report/sales_analytics/sales_analytics.json +++ b/erpnext/selling/report/sales_analytics/sales_analytics.json @@ -1,12 +1,13 @@ { - "add_total_row": 0, + "add_total_row": 1, "creation": "2018-09-21 12:46:29.451048", + "disable_prepared_report": 0, "disabled": 0, "docstatus": 0, "doctype": "Report", "idx": 0, "is_standard": "Yes", - "modified": "2018-09-21 12:46:29.451048", + "modified": "2019-02-12 14:30:40.043652", "modified_by": "Administrator", "module": "Selling", "name": "Sales Analytics", diff --git a/erpnext/stock/report/stock_analytics/stock_analytics.json b/erpnext/stock/report/stock_analytics/stock_analytics.json index efd5e99cbc..7a2ed2bfc2 100644 --- a/erpnext/stock/report/stock_analytics/stock_analytics.json +++ b/erpnext/stock/report/stock_analytics/stock_analytics.json @@ -1,12 +1,13 @@ { - "add_total_row": 0, + "add_total_row": 1, "creation": "2018-10-08 12:11:32.133020", + "disable_prepared_report": 0, "disabled": 0, "docstatus": 0, "doctype": "Report", "idx": 0, "is_standard": "Yes", - "modified": "2018-10-08 12:18:42.834270", + "modified": "2019-02-12 14:32:22.874082", "modified_by": "Administrator", "module": "Stock", "name": "Stock Analytics", From 29fcb14c42130f87817f0da028cd1e3435b2a672 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 13 Feb 2019 17:18:12 +0530 Subject: [PATCH 12/34] fix: errors in deferred revenue booking --- erpnext/accounts/deferred_revenue.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/deferred_revenue.py b/erpnext/accounts/deferred_revenue.py index 9ff8b04281..ae0b2593a1 100644 --- a/erpnext/accounts/deferred_revenue.py +++ b/erpnext/accounts/deferred_revenue.py @@ -60,7 +60,7 @@ def get_booking_dates(doc, item, start_date=None, end_date=None): deferred_account = "deferred_revenue_account" if doc.doctype=="Sales Invoice" else "deferred_expense_account" last_gl_entry, skip = False, False - booking_end_date = getdate(add_days(today(), -1)) if not end_date else end_date + booking_end_date = getdate(add_days(today(), -1) if not end_date else end_date) if booking_end_date < item.service_start_date or \ (item.service_stop_date and booking_end_date.month > item.service_stop_date.month): return None, None, None, True @@ -71,7 +71,7 @@ def get_booking_dates(doc, item, start_date=None, end_date=None): last_gl_entry = True booking_end_date = item.service_stop_date - booking_start_date = getdate(add_months(today(), -1)) if not start_date else start_date + booking_start_date = getdate(add_months(today(), -1) if not start_date else start_date) booking_start_date = booking_start_date \ if booking_start_date > item.service_start_date else item.service_start_date @@ -113,7 +113,6 @@ def calculate_amount_and_base_amount(doc, item, last_gl_entry, total_days, total group by voucher_detail_no '''.format(total_credit_debit, total_credit_debit_currency), (doc.company, item.get(deferred_account), doc.doctype, doc.name, item.name), as_dict=True) - already_booked_amount = gl_entries_details[0].total_credit if gl_entries_details else 0 base_amount = flt(item.base_net_amount - already_booked_amount, item.precision("base_net_amount")) if account_currency==doc.company_currency: @@ -136,7 +135,7 @@ def book_deferred_income_or_expense(doc, start_date=None, end_date=None): get_booking_dates(doc, item, start_date, end_date) if skip: continue - total_days = date_diff(item.service_end_date, item.service_start_date) + total_days = date_diff(item.service_end_date, item.service_start_date) + 1 total_booking_days = date_diff(booking_end_date, booking_start_date) + 1 account_currency = get_account_currency(item.expense_account) @@ -175,6 +174,10 @@ def book_deferred_income_or_expense(doc, start_date=None, end_date=None): 'project': project }, account_currency) ) - if gl_entries: - make_gl_entries(gl_entries, cancel=(doc.docstatus == 2), merge_entries=True) + try: + make_gl_entries(gl_entries, cancel=(doc.docstatus == 2), merge_entries=True) + frappe.db.commit() + except: + frappe.db.rollback() + frappe.log_error(message = frappe.get_traceback(), title = _("Error while processing deferred accounting for {0}").format(doc.name)) \ No newline at end of file From 34f4f24e214f99c9c075eb72eb26cfac573a7bf6 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Thu, 14 Feb 2019 17:26:49 +0530 Subject: [PATCH 13/34] fix: Address and contact report --- .../report/address_and_contacts/address_and_contacts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/report/address_and_contacts/address_and_contacts.py b/erpnext/selling/report/address_and_contacts/address_and_contacts.py index a9e43034b4..eb242d0a73 100644 --- a/erpnext/selling/report/address_and_contacts/address_and_contacts.py +++ b/erpnext/selling/report/address_and_contacts/address_and_contacts.py @@ -102,7 +102,8 @@ def get_party_details(party_type, party_list, doctype, party_details): records = frappe.get_list(doctype, filters=filters, fields=fields, as_list=True) for d in records: details = party_details.get(d[0]) - details.setdefault(frappe.scrub(doctype), []).append(d[1:]) + if details: + details.setdefault(frappe.scrub(doctype), []).append(d[1:]) return party_details From 4902f7b2a05d4a54a6089f40f8b31af5e4877795 Mon Sep 17 00:00:00 2001 From: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> Date: Thu, 14 Feb 2019 17:32:52 +0530 Subject: [PATCH 14/34] fix: Show tasks in timesheet with status as Closed (#16660) --- erpnext/projects/doctype/timesheet/timesheet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js index e890befd1a..8811ab9543 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.js +++ b/erpnext/projects/doctype/timesheet/timesheet.js @@ -18,7 +18,7 @@ frappe.ui.form.on("Timesheet", { return{ filters: { 'project': child.project, - 'status': ["!=", "Closed"] + 'status': ["!=", "Cancelled"] } } } From 867ca63750f04cd6dcc081e31e682c55207bdf92 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Thu, 14 Feb 2019 18:08:37 +0530 Subject: [PATCH 15/34] fix: Purchase order item description fix --- erpnext/buying/doctype/purchase_order/purchase_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 3c4ef2b17f..a4a636d6ba 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -456,7 +456,7 @@ def make_rm_stock_entry(purchase_order, rm_items): items_dict = { rm_item_code: { "item_name": rm_item_data["item_name"], - "description": item_wh[rm_item_code].get('description'), + "description": item_wh.get(rm_item_code, {}).get('description', ""), 'qty': rm_item_data["qty"], 'from_warehouse': rm_item_data["warehouse"], 'stock_uom': rm_item_data["stock_uom"], From 0d1ccc357f522528e59511f431ccb3ca7ce42cb3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 14 Feb 2019 18:30:10 +0530 Subject: [PATCH 16/34] fix: get item details --- erpnext/stock/get_item_details.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index ec1031c70f..74f35953e2 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -16,6 +16,9 @@ from erpnext.setup.doctype.item_group.item_group import get_item_group_defaults from six import string_types, iteritems +sales_doctypes = ['Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice'] +purchase_doctypes = ['Material Request', 'Supplier Quotation', 'Purchase Order', 'Purchase Receipt', 'Purchase Invoice'] + @frappe.whitelist() def get_item_details(args): """ @@ -228,7 +231,7 @@ def get_basic_details(args, item): #Set the UOM to the Default Sales UOM or Default Purchase UOM if configured in the Item Master if not args.uom: - if args.get('doctype') in ['Quotation', 'Sales Order', 'Delivery Note', 'Sales Invoice']: + if args.get('doctype') in sales_doctypes: args.uom = item.sales_uom if item.sales_uom else item.stock_uom elif (args.get('doctype') in ['Purchase Order', 'Purchase Receipt', 'Purchase Invoice']) or \ (args.get('doctype') == 'Material Request' and args.get('material_request_type') == 'Purchase'): @@ -281,14 +284,15 @@ def get_basic_details(args, item): out.conversion_factor = 1.0 else: out.conversion_factor = args.conversion_factor or \ - get_conversion_factor(item.item_code, args.uom).get("conversion_factor") + get_conversion_factor(item.name, args.uom).get("conversion_factor") args.conversion_factor = out.conversion_factor out.stock_qty = out.qty * out.conversion_factor # calculate last purchase rate - from erpnext.buying.doctype.purchase_order.purchase_order import item_last_purchase_rate - out.last_purchase_rate = item_last_purchase_rate(args.name, args.conversion_rate, item.item_code, out.conversion_factor) + if args.get('doctype') in purchase_doctypes: + from erpnext.buying.doctype.purchase_order.purchase_order import item_last_purchase_rate + out.last_purchase_rate = item_last_purchase_rate(args.name, args.conversion_rate, item.name, out.conversion_factor) # if default specified in item is for another company, fetch from company for d in [ From 6f7a4d94cefb2458c4ec973e35d13d93510c0b0f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 14 Feb 2019 19:34:43 +0530 Subject: [PATCH 17/34] fix: Consider parenttype while updating total qty in transactions --- erpnext/patches/v11_0/update_total_qty_field.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/patches/v11_0/update_total_qty_field.py b/erpnext/patches/v11_0/update_total_qty_field.py index fcb76af459..cc8524f3c2 100644 --- a/erpnext/patches/v11_0/update_total_qty_field.py +++ b/erpnext/patches/v11_0/update_total_qty_field.py @@ -19,9 +19,10 @@ def execute(): SELECT parent, SUM(qty) as qty FROM - `tab%s Item` + `tab{0} Item` + where parenttype = %s GROUP BY parent - ''' % (doctype), as_dict = True) + '''.format(doctype), doctype, as_dict = True) # Query to update total_qty might become too big, Update in batches # batch_size is chosen arbitrarily, Don't try too hard to reason about it From 4df7679c65b8b1ebe07d9d02cee6c72b01319507 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 15 Feb 2019 13:08:04 +0530 Subject: [PATCH 18/34] fix: Get outstanding invoices --- erpnext/accounts/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 58e3e8793d..d4e1840eb9 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -615,7 +615,7 @@ def get_held_invoices(party_type, party): return held_invoices -def get_outstanding_invoices(party_type, party, account, condition=None, limit=1000): +def get_outstanding_invoices(party_type, party, account, condition=None, limit=None): outstanding_invoices = [] precision = frappe.get_precision("Sales Invoice", "outstanding_amount") or 2 @@ -628,7 +628,7 @@ def get_outstanding_invoices(party_type, party, account, condition=None, limit=1 invoice = 'Sales Invoice' if erpnext.get_party_account_type(party_type) == 'Receivable' else 'Purchase Invoice' held_invoices = get_held_invoices(party_type, party) - limit_cond = "limit %s" % (limit or 1000) + limit_cond = "limit %s" % limit if limit else "" invoice_list = frappe.db.sql(""" select From a0c9c7501b7aa378cf1001b1bc1c41f61db8bbd9 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 15 Feb 2019 14:24:08 +0530 Subject: [PATCH 19/34] Update update_total_qty_field.py --- erpnext/patches/v11_0/update_total_qty_field.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/patches/v11_0/update_total_qty_field.py b/erpnext/patches/v11_0/update_total_qty_field.py index cc8524f3c2..992454ac7c 100644 --- a/erpnext/patches/v11_0/update_total_qty_field.py +++ b/erpnext/patches/v11_0/update_total_qty_field.py @@ -20,9 +20,9 @@ def execute(): parent, SUM(qty) as qty FROM `tab{0} Item` - where parenttype = %s + where parenttype = '{0}' GROUP BY parent - '''.format(doctype), doctype, as_dict = True) + '''.format(doctype), as_dict = True) # Query to update total_qty might become too big, Update in batches # batch_size is chosen arbitrarily, Don't try too hard to reason about it From acf26c8569f8c34354cdc2c15935beaaa558e19a Mon Sep 17 00:00:00 2001 From: Frappe Bot Date: Fri, 15 Feb 2019 10:22:32 +0000 Subject: [PATCH 20/34] bumped to version 11.1.6 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 40e094d1ba..465c283ad9 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '11.1.5' +__version__ = '11.1.6' def get_default_company(user=None): '''Get default company for user''' From cc0222a28a9a5d48f408937335507c7b9968cc7d Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Sat, 16 Feb 2019 17:53:23 +0530 Subject: [PATCH 21/34] Remove unwanted barcode field from item --- erpnext/stock/doctype/item/item.json | 90 ++++++++++++++++++---------- 1 file changed, 58 insertions(+), 32 deletions(-) diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 81997edfb4..58c907793a 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -38,6 +38,7 @@ "oldfieldtype": "Section Break", "options": "fa fa-flag", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -70,6 +71,7 @@ "no_copy": 0, "options": "STO-ITEM-.YYYY.-", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -104,6 +106,7 @@ "oldfieldname": "item_code", "oldfieldtype": "Data", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -172,6 +175,7 @@ "oldfieldname": "item_name", "oldfieldtype": "Data", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -183,37 +187,6 @@ "translatable": 0, "unique": 0 }, - { - "allow_bulk_edit": 0, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "barcode", - "fieldtype": "Data", - "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": "Barcode", - "length": 0, - "no_copy": 1, - "permlevel": 0, - "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, @@ -238,6 +211,7 @@ "oldfieldtype": "Link", "options": "Item Group", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -305,6 +279,7 @@ "oldfieldtype": "Link", "options": "UOM", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -335,6 +310,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -435,6 +411,7 @@ "oldfieldtype": "Select", "options": "", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -701,6 +678,7 @@ "oldfieldname": "tolerance", "oldfieldtype": "Currency", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -800,6 +778,7 @@ "oldfieldtype": "Link", "options": "Brand", "permlevel": 0, + "precision": "", "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 0, @@ -833,6 +812,7 @@ "oldfieldname": "description", "oldfieldtype": "Text", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -933,6 +913,7 @@ "oldfieldtype": "Section Break", "options": "fa fa-truck", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -1000,6 +981,7 @@ "oldfieldname": "end_of_life", "oldfieldtype": "Date", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -1067,6 +1049,7 @@ "no_copy": 0, "options": "\nFIFO\nMoving Average", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -1099,6 +1082,7 @@ "no_copy": 0, "oldfieldtype": "Column Break", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -1134,6 +1118,7 @@ "oldfieldname": "warranty_period", "oldfieldtype": "Data", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -1167,6 +1152,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -1200,6 +1186,7 @@ "no_copy": 0, "options": "UOM", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -1234,6 +1221,7 @@ "no_copy": 0, "options": "fa fa-rss", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -1268,6 +1256,7 @@ "no_copy": 0, "options": "Item Reorder", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -1337,6 +1326,7 @@ "oldfieldtype": "Table", "options": "UOM Conversion Detail", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -1407,6 +1397,7 @@ "oldfieldtype": "Select", "options": "", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -1643,6 +1634,7 @@ "oldfieldtype": "Select", "options": "", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -1676,6 +1668,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -1913,6 +1906,7 @@ "oldfieldtype": "Section Break", "options": "fa fa-shopping-cart", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -2015,6 +2009,7 @@ "oldfieldname": "min_order_qty", "oldfieldtype": "Currency", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -2114,6 +2109,7 @@ "oldfieldname": "lead_time_days", "oldfieldtype": "Int", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -2148,6 +2144,7 @@ "oldfieldname": "last_purchase_rate", "oldfieldtype": "Currency", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, @@ -2246,6 +2243,7 @@ "no_copy": 0, "options": "Manufacturer", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -2278,6 +2276,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -2311,6 +2310,7 @@ "no_copy": 0, "oldfieldtype": "Column Break", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -2345,6 +2345,7 @@ "no_copy": 0, "options": "Item Supplier", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -2507,6 +2508,7 @@ "oldfieldtype": "Section Break", "options": "fa fa-tag", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -2606,6 +2608,7 @@ "no_copy": 0, "oldfieldtype": "Column Break", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -2641,6 +2644,7 @@ "oldfieldname": "max_discount", "oldfieldtype": "Currency", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3031,6 +3035,7 @@ "no_copy": 0, "options": "Item Customer Detail", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3064,6 +3069,7 @@ "oldfieldtype": "Section Break", "options": "fa fa-money", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3099,6 +3105,7 @@ "oldfieldtype": "Table", "options": "Item Tax", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3132,6 +3139,7 @@ "oldfieldtype": "Section Break", "options": "fa fa-search", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3167,6 +3175,7 @@ "oldfieldtype": "Select", "options": "", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3267,6 +3276,7 @@ "oldfieldtype": "Section Break", "options": "fa fa-cogs", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3302,6 +3312,7 @@ "oldfieldtype": "Link", "options": "BOM", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, @@ -3338,6 +3349,7 @@ "oldfieldtype": "Select", "options": "", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3400,6 +3412,7 @@ "length": 0, "no_copy": 1, "permlevel": 0, + "precision": "", "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 0, @@ -3432,6 +3445,7 @@ "no_copy": 0, "options": "fa fa-globe", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3464,6 +3478,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3563,6 +3578,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3597,6 +3613,7 @@ "no_copy": 0, "options": "Website Slideshow", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3631,6 +3648,7 @@ "no_copy": 0, "options": "", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3693,6 +3711,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3727,6 +3746,7 @@ "no_copy": 0, "options": "Warehouse", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3761,6 +3781,7 @@ "no_copy": 0, "options": "Website Item Group", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3794,6 +3815,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3826,6 +3848,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3859,6 +3882,7 @@ "no_copy": 0, "options": "Item Website Specification", "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -3891,6 +3915,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -4114,10 +4139,11 @@ "issingle": 0, "istable": 0, "max_attachments": 1, - "modified": "2019-01-07 16:52:05.096907", + "modified": "2019-02-16 17:43:56.039611", "modified_by": "Administrator", "module": "Stock", "name": "Item", + "name_case": "", "owner": "Administrator", "permissions": [ { From 8cbe824c5b196d776e23eca9a4f85a593a955e72 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Sat, 16 Feb 2019 17:54:15 +0530 Subject: [PATCH 22/34] Rerun item_barcode_chidtable_migrate patch --- erpnext/patches.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index b8e2e358b1..b3ccda666b 100755 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -488,7 +488,7 @@ erpnext.patches.v10_0.update_assessment_plan erpnext.patches.v10_0.update_assessment_result erpnext.patches.v10_0.set_default_payment_terms_based_on_company erpnext.patches.v10_0.update_sales_order_link_to_purchase_order -erpnext.patches.v10_0.item_barcode_childtable_migrate +erpnext.patches.v10_0.item_barcode_childtable_migrate # 16-02-2019 erpnext.patches.v10_0.rename_price_to_rate_in_pricing_rule erpnext.patches.v10_0.set_currency_in_pricing_rule erpnext.patches.v10_0.set_b2c_limit From 1399fbe986f6a0a10a5721571c32851766ef542f Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Sat, 16 Feb 2019 21:02:34 +0530 Subject: [PATCH 23/34] Move patch --- erpnext/patches.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index b3ccda666b..2199491a71 100755 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -488,7 +488,6 @@ erpnext.patches.v10_0.update_assessment_plan erpnext.patches.v10_0.update_assessment_result erpnext.patches.v10_0.set_default_payment_terms_based_on_company erpnext.patches.v10_0.update_sales_order_link_to_purchase_order -erpnext.patches.v10_0.item_barcode_childtable_migrate # 16-02-2019 erpnext.patches.v10_0.rename_price_to_rate_in_pricing_rule erpnext.patches.v10_0.set_currency_in_pricing_rule erpnext.patches.v10_0.set_b2c_limit @@ -586,3 +585,4 @@ erpnext.patches.v11_0.renamed_from_to_fields_in_project erpnext.patches.v11_0.add_permissions_in_gst_settings erpnext.patches.v11_1.setup_guardian_role execute:frappe.delete_doc('DocType', 'Notification Control') +erpnext.patches.v10_0.item_barcode_childtable_migrate # 16-02-2019 \ No newline at end of file From 3a2f342ac180f53456b2def5bb809cd00047ef6d Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Sat, 16 Feb 2019 21:09:24 +0530 Subject: [PATCH 24/34] Ignore duplicate entry --- .../v10_0/item_barcode_childtable_migrate.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/erpnext/patches/v10_0/item_barcode_childtable_migrate.py b/erpnext/patches/v10_0/item_barcode_childtable_migrate.py index c939dd5d33..a2e25795eb 100644 --- a/erpnext/patches/v10_0/item_barcode_childtable_migrate.py +++ b/erpnext/patches/v10_0/item_barcode_childtable_migrate.py @@ -16,11 +16,14 @@ def execute(): barcode = item.barcode.strip() if barcode and '<' not in barcode: - frappe.get_doc({ - 'idx': 0, - 'doctype': 'Item Barcode', - 'barcode': barcode, - 'parenttype': 'Item', - 'parent': item.name, - 'parentfield': 'barcodes' - }).insert() + try: + frappe.get_doc({ + 'idx': 0, + 'doctype': 'Item Barcode', + 'barcode': barcode, + 'parenttype': 'Item', + 'parent': item.name, + 'parentfield': 'barcodes' + }).insert() + except frappe.DuplicateEntryError: + continue From 053d6a2ca13b1f36a02fa3223092a10af35f6579 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Sun, 17 Feb 2019 11:24:51 +0530 Subject: [PATCH 25/34] Move reload doc before get query --- erpnext/patches/v10_0/item_barcode_childtable_migrate.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/patches/v10_0/item_barcode_childtable_migrate.py b/erpnext/patches/v10_0/item_barcode_childtable_migrate.py index a2e25795eb..bc6005677d 100644 --- a/erpnext/patches/v10_0/item_barcode_childtable_migrate.py +++ b/erpnext/patches/v10_0/item_barcode_childtable_migrate.py @@ -7,11 +7,13 @@ import frappe def execute(): - items_barcode = frappe.get_all('Item', ['name', 'barcode'], { 'barcode': ('!=', '') }) - - frappe.reload_doc("stock", "doctype", "item") frappe.reload_doc("stock", "doctype", "item_barcode") + items_barcode = frappe.get_all('Item', ['name', 'barcode'], { 'barcode': ('!=', '') }) + frappe.reload_doc("stock", "doctype", "item") + + + for item in items_barcode: barcode = item.barcode.strip() From 48a7262fae307274515333b61edcfda5a3752230 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 18 Feb 2019 15:05:36 +0530 Subject: [PATCH 26/34] fix: Precision issue in POS payment --- .../sales_invoice_payment.json | 36 ++++++++++++------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json b/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json index 438328d60d..ccdabfe544 100644 --- a/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json +++ b/erpnext/accounts/doctype/sales_invoice_payment/sales_invoice_payment.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_events_in_timeline": 0, "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, @@ -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, @@ -72,16 +75,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, - "default": "0.0", + "default": "", "depends_on": "eval:parent.doctype == 'Sales Invoice'", "fieldname": "amount", "fieldtype": "Currency", @@ -97,7 +101,7 @@ "no_copy": 0, "options": "currency", "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -106,11 +110,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, @@ -136,11 +141,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, @@ -168,16 +174,17 @@ "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, - "fetch_from": "mode_of_payment.type", + "fetch_from": "mode_of_payment.type", "fieldname": "type", "fieldtype": "Read Only", "hidden": 0, @@ -201,11 +208,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, @@ -233,11 +241,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, @@ -264,7 +273,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, - "translatable": 0, + "translatable": 0, "unique": 0 } ], @@ -278,7 +287,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2018-05-16 22:42:52.033991", + "modified": "2019-02-18 15:03:59.720469", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Payment", @@ -292,5 +301,6 @@ "sort_field": "modified", "sort_order": "DESC", "track_changes": 0, - "track_seen": 0 + "track_seen": 0, + "track_views": 0 } \ No newline at end of file From 99e736200679cdf10f26a047ee64c6a266fbe025 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 18 Feb 2019 18:26:50 +0530 Subject: [PATCH 27/34] fix: Allow to make material request from draft job card --- erpnext/manufacturing/doctype/job_card/job_card.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/erpnext/manufacturing/doctype/job_card/job_card.py b/erpnext/manufacturing/doctype/job_card/job_card.py index 5ed03be545..ea9f714fc8 100644 --- a/erpnext/manufacturing/doctype/job_card/job_card.py +++ b/erpnext/manufacturing/doctype/job_card/job_card.py @@ -172,9 +172,6 @@ def make_material_request(source_name, target_doc=None): doclist = get_mapped_doc("Job Card", source_name, { "Job Card": { "doctype": "Material Request", - "validation": { - "docstatus": ["=", 1] - }, "field_map": { "name": "job_card", }, @@ -206,9 +203,6 @@ def make_stock_entry(source_name, target_doc=None): doclist = get_mapped_doc("Job Card", source_name, { "Job Card": { "doctype": "Stock Entry", - "validation": { - "docstatus": ["=", 1] - }, "field_map": { "name": "job_card", "for_quantity": "fg_completed_qty" From 9a19e06856798ce3b225ea9df974d136e746953a Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 18 Feb 2019 18:42:15 +0530 Subject: [PATCH 28/34] fix: Change Received qty to accepted qty and validation for indicators --- .../doctype/purchase_invoice/purchase_invoice.js | 9 ++++++--- .../purchase_invoice_item/purchase_invoice_item.json | 6 +++--- .../purchase_receipt_item/purchase_receipt_item.json | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index 263b5bb75e..b4fd91f6e4 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -9,9 +9,12 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ this.setup_posting_date_time_check(); this._super(doc); - // formatter for material request item - this.frm.set_indicator_formatter('item_code', - function(doc) { return (doc.qty<=doc.received_qty) ? "green" : "orange" }) + // formatter for purchase invoice item + if(this.frm.doc.update_stock) { + this.frm.set_indicator_formatter('item_code', function(doc) { + return (doc.qty<=doc.received_qty) ? "green" : "orange"; + }); + } }, onload: function() { this._super(); diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json index c2309b264a..7734163f3a 100644 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json @@ -293,7 +293,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -321,7 +321,7 @@ "in_global_search": 0, "in_list_view": 1, "in_standard_filter": 0, - "label": "Qty", + "label": "Accepted Qty", "length": 0, "no_copy": 0, "oldfieldname": "qty", @@ -2626,7 +2626,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2019-01-07 16:52:00.749414", + "modified": "2019-02-18 18:13:40.390806", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice Item", diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json index 3746dfb223..528f799aa7 100644 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json @@ -417,7 +417,7 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Recd Quantity", + "label": "Received Quantity", "length": 0, "no_copy": 0, "oldfieldname": "received_qty", @@ -2608,7 +2608,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2019-01-07 16:51:59.002215", + "modified": "2019-02-18 16:04:36.138776", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt Item", From 750fe6eaea0a9b3da7ac01b7da97e4baddffd2ea Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 18 Feb 2019 18:55:53 +0530 Subject: [PATCH 29/34] fix: get item rate in bom --- erpnext/manufacturing/doctype/bom/bom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index ba3b7192a3..88d346ff0f 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -183,7 +183,7 @@ class BOM(WebsiteGenerator): args = frappe._dict({ "doctype": "BOM", "price_list": self.buying_price_list, - "qty": arg.get("qty"), + "qty": arg.get("qty") or 1, "uom": arg.get("uom") or arg.get("stock_uom"), "stock_uom": arg.get("stock_uom"), "transaction_type": "buying", From 5821b672adbdd20e91a641f635fcc027f6ce2415 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 18 Feb 2019 20:07:44 +0530 Subject: [PATCH 30/34] fix: multi-uom not working for the pricing rule rate --- erpnext/accounts/doctype/pricing_rule/pricing_rule.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py index fe99763a35..ac0cd7e895 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -196,8 +196,9 @@ def get_pricing_rule_for_item(args): pricing_rule_rate = 0.0 if pricing_rule.currency == args.currency: pricing_rule_rate = pricing_rule.rate + item_details.update({ - "price_list_rate": pricing_rule_rate, + "price_list_rate": pricing_rule_rate * args.get("conversion_factor"), "discount_percentage": 0.0 }) else: From de0f59b818142e55435c12e87f83804651425e34 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Tue, 19 Feb 2019 08:40:16 +0530 Subject: [PATCH 31/34] fix: Removed precision from multiple doctypes --- .../cashier_closing/cashier_closing.json | 37 +++++++++++++---- .../cashier_closing_payments.json | 12 ++++-- .../journal_entry_account.json | 5 ++- .../payment_request/payment_request.json | 5 ++- .../purchase_invoice_item.json | 8 ++-- .../doctype/sales_invoice/sales_invoice.json | 4 +- .../sales_invoice_item.json | 6 +-- .../sales_invoice_timesheet.json | 23 +++++++++-- .../supplier_quotation_item.json | 4 +- .../hr/doctype/salary_slip/salary_slip.json | 10 ++--- .../salary_slip_timesheet.json | 27 ++++++++++-- .../salary_structure/salary_structure.json | 5 ++- .../timesheet_detail/timesheet_detail.json | 41 ++++++++++++++++--- .../quotation_item/quotation_item.json | 4 +- .../sales_order_item/sales_order_item.json | 4 +- .../delivery_note_item.json | 6 +-- 16 files changed, 149 insertions(+), 52 deletions(-) diff --git a/erpnext/accounts/doctype/cashier_closing/cashier_closing.json b/erpnext/accounts/doctype/cashier_closing/cashier_closing.json index 57a9c7aadd..14e9070f30 100644 --- a/erpnext/accounts/doctype/cashier_closing/cashier_closing.json +++ b/erpnext/accounts/doctype/cashier_closing/cashier_closing.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_events_in_timeline": 0, "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, @@ -15,6 +16,7 @@ "fields": [ { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -32,7 +34,7 @@ "label": "Series", "length": 0, "no_copy": 0, - "options": "Cashier-closing-\n", + "options": "Cashier-closing-", "permlevel": 0, "precision": "", "print_hide": 0, @@ -43,10 +45,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, @@ -74,10 +78,12 @@ "reqd": 1, "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, @@ -105,10 +111,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, @@ -135,10 +143,12 @@ "reqd": 1, "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, @@ -166,10 +176,12 @@ "reqd": 1, "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, @@ -188,7 +200,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -197,10 +209,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, @@ -219,7 +233,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -228,10 +242,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, @@ -250,7 +266,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, @@ -259,10 +275,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, @@ -291,10 +309,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, @@ -321,10 +341,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, @@ -351,6 +373,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 } ], @@ -364,7 +387,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-09-03 10:59:54.500567", + "modified": "2019-02-19 08:35:23.157327", "modified_by": "Administrator", "module": "Accounts", "name": "Cashier Closing", @@ -373,7 +396,6 @@ "permissions": [ { "amend": 0, - "apply_user_permissions": 0, "cancel": 0, "create": 1, "delete": 1, @@ -399,5 +421,6 @@ "sort_field": "modified", "sort_order": "DESC", "track_changes": 1, - "track_seen": 0 + "track_seen": 0, + "track_views": 0 } \ No newline at end of file diff --git a/erpnext/accounts/doctype/cashier_closing_payments/cashier_closing_payments.json b/erpnext/accounts/doctype/cashier_closing_payments/cashier_closing_payments.json index bdfc70f8b1..7f16beafc3 100644 --- a/erpnext/accounts/doctype/cashier_closing_payments/cashier_closing_payments.json +++ b/erpnext/accounts/doctype/cashier_closing_payments/cashier_closing_payments.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_events_in_timeline": 0, "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, @@ -14,6 +15,7 @@ "fields": [ { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -41,10 +43,12 @@ "reqd": 1, "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, @@ -63,7 +67,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -72,6 +76,7 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 0, "unique": 0 } ], @@ -85,7 +90,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2018-09-02 14:45:36.303520", + "modified": "2019-02-19 08:34:20.268037", "modified_by": "Administrator", "module": "Accounts", "name": "Cashier Closing Payments", @@ -99,5 +104,6 @@ "sort_field": "modified", "sort_order": "DESC", "track_changes": 1, - "track_seen": 0 + "track_seen": 0, + "track_views": 0 } \ No newline at end of file diff --git a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json index 5a827bea81..32e49dbde4 100644 --- a/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json +++ b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_events_in_timeline": 0, "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, @@ -398,7 +399,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, - "precision": "6", + "precision": "9", "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 0, @@ -911,7 +912,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2018-08-19 04:08:44.742510", + "modified": "2019-02-18 19:00:53.662788", "modified_by": "Administrator", "module": "Accounts", "name": "Journal Entry Account", diff --git a/erpnext/accounts/doctype/payment_request/payment_request.json b/erpnext/accounts/doctype/payment_request/payment_request.json index 76fe884165..bff995ec5a 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.json +++ b/erpnext/accounts/doctype/payment_request/payment_request.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_events_in_timeline": 0, "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, @@ -425,7 +426,7 @@ "no_copy": 0, "options": "currency", "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -1501,7 +1502,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-09-06 14:44:43.563367", + "modified": "2019-02-18 18:52:34.203239", "modified_by": "Administrator", "module": "Accounts", "name": "Payment Request", diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json index c2309b264a..9e1d4bb916 100644 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json @@ -293,7 +293,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -321,7 +321,7 @@ "in_global_search": 0, "in_list_view": 1, "in_standard_filter": 0, - "label": "Qty", + "label": "Accepted Qty", "length": 0, "no_copy": 0, "oldfieldname": "qty", @@ -358,7 +358,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -2626,7 +2626,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2019-01-07 16:52:00.749414", + "modified": "2019-02-18 19:03:19.250250", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice Item", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 13ba053bae..077d99512a 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -1966,7 +1966,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 1, @@ -5644,7 +5644,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2019-01-07 16:51:53.914523", + "modified": "2019-02-18 18:56:51.265257", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json index d6ce11536e..a95f314661 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json @@ -779,7 +779,7 @@ "no_copy": 0, "options": "currency", "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 1, @@ -913,7 +913,7 @@ "no_copy": 0, "options": "Company:company:default_currency", "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 1, @@ -2766,7 +2766,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2019-01-07 16:51:55.018091", + "modified": "2019-02-18 18:59:52.223628", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Item", diff --git a/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.json b/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.json index 50eed241d4..f7b9aef96c 100644 --- a/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.json +++ b/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.json @@ -1,5 +1,7 @@ { "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, "beta": 0, @@ -12,6 +14,8 @@ "engine": "InnoDB", "fields": [ { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -39,9 +43,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, @@ -68,9 +75,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, @@ -88,7 +98,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, @@ -97,9 +107,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": 1, "bold": 0, "collapsible": 0, @@ -126,20 +139,21 @@ "reqd": 0, "search_index": 0, "set_only_once": 0, + "translatable": 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": 0, "istable": 1, "max_attachments": 0, - "modified": "2017-02-17 16:47:04.413420", + "modified": "2019-02-18 18:50:44.770361", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Timesheet", @@ -153,5 +167,6 @@ "sort_field": "modified", "sort_order": "DESC", "track_changes": 1, - "track_seen": 0 + "track_seen": 0, + "track_views": 0 } \ No newline at end of file diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json index 94d93f6a61..3c775cd6d9 100644 --- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json +++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json @@ -848,7 +848,7 @@ "oldfieldtype": "Currency", "options": "Company:company:default_currency", "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 1, "print_hide_if_no_value": 0, "print_width": "100px", @@ -1786,7 +1786,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2019-01-07 16:52:02.125715", + "modified": "2019-02-18 18:58:10.351451", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation Item", diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.json b/erpnext/hr/doctype/salary_slip/salary_slip.json index 76e43d6ea7..c9a5d87281 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.json +++ b/erpnext/hr/doctype/salary_slip/salary_slip.json @@ -195,7 +195,7 @@ "columns": 0, "fetch_from": "employee.branch", "fieldname": "branch", - "fieldtype": "Link", + "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -208,11 +208,11 @@ "no_copy": 0, "oldfieldname": "branch", "oldfieldtype": "Link", - "options": "Branch", + "options": "Branch", "permlevel": 0, "print_hide": 0, "print_hide_if_no_value": 0, - "read_only": 1, + "read_only": 1, "remember_last_selected_value": 0, "report_hide": 0, "reqd": 0, @@ -901,7 +901,7 @@ "no_copy": 0, "options": "Company:company:default_currency", "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 0, "print_hide_if_no_value": 1, "read_only": 0, @@ -1906,7 +1906,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-02-12 11:24:20.848207", + "modified": "2019-02-18 18:54:36.161027", "modified_by": "Administrator", "module": "HR", "name": "Salary Slip", diff --git a/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.json b/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.json index 7a9393c332..797f8f7c02 100644 --- a/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.json +++ b/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.json @@ -1,5 +1,7 @@ { "allow_copy": 0, + "allow_events_in_timeline": 0, + "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, "beta": 0, @@ -11,16 +13,21 @@ "editable_grid": 1, "fields": [ { + "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, + "columns": 0, "fieldname": "time_sheet", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 1, + "in_standard_filter": 0, "label": "Time Sheet", "length": 0, "no_copy": 0, @@ -30,49 +37,58 @@ "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, + "remember_last_selected_value": 0, "report_hide": 0, "reqd": 1, "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": "working_hours", "fieldtype": "Float", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, + "in_global_search": 0, "in_list_view": 1, + "in_standard_filter": 0, "label": "Working Hours", "length": 0, "no_copy": 1, "permlevel": 0, - "precision": "3", + "precision": "", "print_hide": 0, "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, + "translatable": 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": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-07-11 03:28:07.152366", + "modified": "2019-02-19 08:33:41.762144", "modified_by": "Administrator", "module": "HR", "name": "Salary Slip Timesheet", @@ -82,7 +98,10 @@ "quick_entry": 1, "read_only": 0, "read_only_onload": 0, + "show_name_in_global_search": 0, "sort_field": "modified", "sort_order": "DESC", - "track_seen": 0 + "track_changes": 0, + "track_seen": 0, + "track_views": 0 } \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.json b/erpnext/hr/doctype/salary_structure/salary_structure.json index ce8b64eb4d..0e47278a3e 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.json +++ b/erpnext/hr/doctype/salary_structure/salary_structure.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_events_in_timeline": 0, "allow_guest_to_view": 0, "allow_import": 1, "allow_rename": 1, @@ -365,7 +366,7 @@ "no_copy": 0, "options": "Company:company:default_currency", "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -950,7 +951,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-07-24 18:36:25.169098", + "modified": "2019-02-18 18:51:53.932518", "modified_by": "Administrator", "module": "HR", "name": "Salary Structure", diff --git a/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json b/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json index b1f737296d..a9b3bfb06f 100644 --- a/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json +++ b/erpnext/projects/doctype/timesheet_detail/timesheet_detail.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_events_in_timeline": 0, "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, @@ -13,6 +14,7 @@ "fields": [ { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -44,6 +46,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -75,6 +78,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -105,6 +109,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -136,6 +141,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -166,6 +172,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -197,6 +204,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -230,6 +238,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -260,6 +269,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -278,7 +288,7 @@ "length": 0, "no_copy": 0, "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -292,6 +302,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -325,6 +336,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -355,6 +367,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -388,6 +401,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -420,6 +434,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -450,6 +465,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -482,6 +498,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -512,6 +529,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -545,6 +563,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -575,6 +594,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 1, "bold": 0, "collapsible": 0, @@ -607,6 +627,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -637,6 +658,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 1, "bold": 0, "collapsible": 0, @@ -669,6 +691,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -700,6 +723,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -718,7 +742,7 @@ "length": 0, "no_copy": 0, "permlevel": 1, - "precision": "2", + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -732,6 +756,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 1, "bold": 0, "collapsible": 0, @@ -752,7 +777,7 @@ "length": 0, "no_copy": 0, "permlevel": 1, - "precision": "2", + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 1, @@ -766,6 +791,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -796,6 +822,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -827,6 +854,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 1, "bold": 0, "collapsible": 0, @@ -860,6 +888,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -891,6 +920,7 @@ }, { "allow_bulk_edit": 0, + "allow_in_quick_entry": 0, "allow_on_submit": 1, "bold": 0, "collapsible": 0, @@ -932,7 +962,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2018-05-07 15:12:31.510813", + "modified": "2019-02-18 18:55:53.190526", "modified_by": "Administrator", "module": "Projects", "name": "Timesheet Detail", @@ -944,5 +974,6 @@ "show_name_in_global_search": 0, "sort_order": "ASC", "track_changes": 0, - "track_seen": 0 + "track_seen": 0, + "track_views": 0 } \ No newline at end of file diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.json b/erpnext/selling/doctype/quotation_item/quotation_item.json index 3a8b0df5c5..24cb405657 100644 --- a/erpnext/selling/doctype/quotation_item/quotation_item.json +++ b/erpnext/selling/doctype/quotation_item/quotation_item.json @@ -762,7 +762,7 @@ "no_copy": 0, "options": "currency", "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 1, @@ -1914,7 +1914,7 @@ "istable": 1, "max_attachments": 0, "menu_index": 0, - "modified": "2019-01-07 16:51:56.248107", + "modified": "2019-02-18 18:57:25.277633", "modified_by": "Administrator", "module": "Selling", "name": "Quotation Item", diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.json b/erpnext/selling/doctype/sales_order_item/sales_order_item.json index 19065dfa37..5ca2f81864 100644 --- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json +++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json @@ -961,7 +961,7 @@ "no_copy": 0, "options": "Company:company:default_currency", "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 1, @@ -2477,7 +2477,7 @@ "istable": 1, "max_attachments": 0, "menu_index": 0, - "modified": "2019-01-07 16:51:51.852343", + "modified": "2019-02-18 18:53:23.425126", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order Item", diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json index 9fe741a11e..1e73d68fef 100644 --- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json +++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json @@ -793,7 +793,7 @@ "no_copy": 0, "options": "currency", "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 1, @@ -928,7 +928,7 @@ "no_copy": 0, "options": "Company:company:default_currency", "permlevel": 0, - "precision": "2", + "precision": "", "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 1, @@ -2310,7 +2310,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2019-01-07 16:51:53.322875", + "modified": "2019-02-18 18:58:51.342901", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note Item", From a4aa80fe0538830516576e2c116bdb900a938b78 Mon Sep 17 00:00:00 2001 From: Gaurav Date: Sun, 6 Jan 2019 12:40:28 +0530 Subject: [PATCH 32/34] feature(regional): Italian Localization Added setup.py for italy under regional Included fiscal regimes, tax exemption reasons and custom fields Issue #16259 --- erpnext/regional/italy/__init__.py | 32 ++++++++++++++++++++++++++ erpnext/regional/italy/setup.py | 37 ++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 erpnext/regional/italy/__init__.py create mode 100644 erpnext/regional/italy/setup.py diff --git a/erpnext/regional/italy/__init__.py b/erpnext/regional/italy/__init__.py new file mode 100644 index 0000000000..d7dbddce95 --- /dev/null +++ b/erpnext/regional/italy/__init__.py @@ -0,0 +1,32 @@ +# coding=utf-8 + +fiscal_regimes = [ + "RF01-Ordinario", + "RF02-Contribuenti minimi (art.1, c.96-117, L. 244/07)", + "RF04-Agricoltura e attività connesse e pesca (artt.34 e 34-bis, DPR 633/72)", + "RF05-Vendita sali e tabacchi (art.74, c.1, DPR. 633/72)", + "RF06-Commercio fiammiferi (art.74, c.1, DPR 633/72)", + "RF07-Editoria (art.74, c.1, DPR 633/72)", + "RF08-Gestione servizi telefonia pubblica (art.74, c.1, DPR 633/72)", + "RF09-Rivendita documenti di trasporto pubblico e di sosta (art.74, c.1, DPR 633/72)", + "RF10-Intrattenimenti, giochi e altre attività di cui alla tariffa allegata al DPR 640/72 (art.74, c.6, DPR 633/72)", + "RF11-Agenzie viaggi e turismo (art.74-ter, DPR 633/72)", + "RF12-Agriturismo (art.5, c.2, L. 413/91)", + "RF13-Vendite a domicilio (art.25-bis, c.6, DPR 600/73)", + "RF14-Rivendita beni usati, oggetti d’arte, d’antiquariato o da collezione (art.36, DL 41/95)", + "RF15-Agenzie di vendite all’asta di oggetti d’arte, antiquariato o da collezione (art.40-bis, DL 41/95)", + "RF16-IVA per cassa P.A. (art.6, c.5, DPR 633/72)", + "RF17-IVA per cassa (art. 32-bis, DL 83/2012)", + "RF18-Altro", + "RF19-Regime forfettario (art.1, c.54-89, L. 190/2014)" +] + +tax_exemption_reasons = [ + "N1-Escluse ex art. 15", + "N2-Non Soggette", + "N3-Non Imponibili", + "N4-Esenti", + "N5-Regime del margine / IVA non esposta in fattura", + "N6-Inversione Contabile", + "N7-IVA assolta in altro stato UE" +] diff --git a/erpnext/regional/italy/setup.py b/erpnext/regional/italy/setup.py new file mode 100644 index 0000000000..1931fdc581 --- /dev/null +++ b/erpnext/regional/italy/setup.py @@ -0,0 +1,37 @@ +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt +# coding=utf-8 + +from __future__ import unicode_literals + +import frappe +from frappe.custom.doctype.custom_field.custom_field import create_custom_fields +from erpnext.regional.italy import fiscal_regimes, tax_exemption_reasons + +def setup(company=None, patch=True): + make_custom_fields() + +def make_custom_fields(update=True): + fiscal_code_field = dict(fieldname='fiscal_code', label='Fiscal Code', fieldtype='Data', insert_after='tax_id', print_hide=1) + custom_fields = { + 'Company': [ + fiscal_code_field, + dict(fieldname='fiscal_regime', label='Fiscal Regime', + fieldtype='Select', insert_after='fiscal_code', print_hide=1, + options="\n".join(map(lambda x: x.decode('utf-8'), fiscal_regimes))) + ], + 'Customer': [ + fiscal_code_field, + dict(fieldname='recipient_code', label='Recipient Code', + fieldtype='Data', insert_after='fiscal_code', print_hide=1, default="0000000"), + dict(fieldname='pec', label='Recipient PEC', + fieldtype='Data', insert_after='fiscal_code', print_hide=1) + ], + 'Sales Taxes and Charges': [ + dict(fieldname='tax_exemption_reason', label='Tax Exemption Reason', + fieldtype='Select', insert_after='included_in_print_rate', print_hide=1, + options="\n".join(map(lambda x: x.decode('utf-8'), tax_exemption_reasons))) + ] + } + + create_custom_fields(custom_fields, ignore_validate = frappe.flags.in_patch, update=update) From f1e28e0e8dea00f92832022279cad20b5f0392ee Mon Sep 17 00:00:00 2001 From: Gaurav Date: Wed, 13 Feb 2019 16:46:24 +0530 Subject: [PATCH 33/34] mod(regional,italy): Updates to Italian Localization fixes: removed cleanup_files from italy/utils removed extract_doc_number from italy/utils added country filter to italian localization patch replaced dict assignment with dot operator in prepare_invoice correcions in e-invoice xml following changes in prepare_invoice added setup_report in patch added section for e-invoicing custom fields in company added Italy in test_company --- .../doctype/sales_invoice/sales_invoice.py | 5 + erpnext/controllers/accounts_controller.py | 14 + erpnext/hooks.py | 6 + erpnext/patches.txt | 3 +- .../v11_0/make_italian_localization_fields.py | 14 + erpnext/regional/italy/__init__.py | 31 +++ erpnext/regional/italy/e-invoice.xml | 208 +++++++++++++++ erpnext/regional/italy/setup.py | 147 +++++++++- erpnext/regional/italy/utils.py | 251 ++++++++++++++++++ .../electronic_invoice_register/__init__.py | 0 .../electronic_invoice_register.js | 53 ++++ .../electronic_invoice_register.json | 21 ++ .../electronic_invoice_register.py | 8 + erpnext/setup/doctype/company/test_company.py | 2 +- 14 files changed, 747 insertions(+), 16 deletions(-) create mode 100644 erpnext/patches/v11_0/make_italian_localization_fields.py create mode 100644 erpnext/regional/italy/e-invoice.xml create mode 100644 erpnext/regional/italy/utils.py create mode 100644 erpnext/regional/report/electronic_invoice_register/__init__.py create mode 100644 erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.js create mode 100644 erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.json create mode 100644 erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.py diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 895ca07da2..abd201f5c7 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -24,6 +24,7 @@ from erpnext.accounts.general_ledger import get_round_off_account_and_cost_cente from erpnext.accounts.doctype.loyalty_program.loyalty_program import \ get_loyalty_program_details_with_points, get_loyalty_details, validate_loyalty_points from erpnext.accounts.deferred_revenue import validate_service_stop_date +from erpnext.controllers.accounts_controller import on_submit_regional, on_cancel_regional from erpnext.healthcare.utils import manage_invoice_submit_cancel @@ -198,6 +199,8 @@ class SalesInvoice(SellingController): if "Healthcare" in active_domains: manage_invoice_submit_cancel(self, "on_submit") + on_submit_regional(self) + def validate_pos_paid_amount(self): if len(self.payments) == 0 and self.is_pos: frappe.throw(_("At least one mode of payment is required for POS invoice.")) @@ -253,6 +256,8 @@ class SalesInvoice(SellingController): if "Healthcare" in active_domains: manage_invoice_submit_cancel(self, "on_cancel") + on_cancel_regional(self) + def update_status_updater_args(self): if cint(self.update_stock): self.status_updater.extend([{ diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 0ba47edfc1..5a765aa273 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -94,6 +94,8 @@ class AccountsController(TransactionBase): if self.is_return: self.validate_qty() + validate_regional(self) + def validate_invoice_documents_schedule(self): self.validate_payment_schedule_dates() self.set_due_date() @@ -1132,3 +1134,15 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name): p_doctype.update_blanket_order() p_doctype.update_billing_percentage() p_doctype.set_status() + +@erpnext.allow_regional +def validate_regional(doc): + pass + +@erpnext.allow_regional +def on_submit_regional(doc): + pass + +@erpnext.allow_regional +def on_cancel_regional(doc): + pass diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 7d77f90afa..2a871f0bc6 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -301,5 +301,11 @@ regional_overrides = { }, 'Saudi Arabia': { 'erpnext.controllers.taxes_and_totals.update_itemised_tax_data': 'erpnext.regional.united_arab_emirates.utils.update_itemised_tax_data' + }, + 'Italy': { + 'erpnext.controllers.taxes_and_totals.update_itemised_tax_data': 'erpnext.regional.italy.utils.update_itemised_tax_data', + 'erpnext.controllers.accounts_controller.validate_regional': 'erpnext.regional.italy.utils.sales_invoice_validate', + 'erpnext.controllers.accounts_controller.on_submit_regional': 'erpnext.regional.italy.utils.sales_invoice_on_submit', + 'erpnext.controllers.accounts_controller.on_cancel_regional': 'erpnext.regional.italy.utils.sales_invoice_on_cancel' } } diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 2199491a71..45ee8dc2d7 100755 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -585,4 +585,5 @@ erpnext.patches.v11_0.renamed_from_to_fields_in_project erpnext.patches.v11_0.add_permissions_in_gst_settings erpnext.patches.v11_1.setup_guardian_role execute:frappe.delete_doc('DocType', 'Notification Control') -erpnext.patches.v10_0.item_barcode_childtable_migrate # 16-02-2019 \ No newline at end of file +erpnext.patches.v10_0.item_barcode_childtable_migrate # 16-02-2019 +erpnext.patches.v11_0.make_italian_localization_fields diff --git a/erpnext/patches/v11_0/make_italian_localization_fields.py b/erpnext/patches/v11_0/make_italian_localization_fields.py new file mode 100644 index 0000000000..b0b5ef159b --- /dev/null +++ b/erpnext/patches/v11_0/make_italian_localization_fields.py @@ -0,0 +1,14 @@ +# Copyright (c) 2017, Frappe and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +from erpnext.regional.italy.setup import make_custom_fields, setup_report +import frappe + +def execute(): + company = frappe.get_all('Company', filters = {'country': 'Italy'}) + if not company: + return + + make_custom_fields() + setup_report() diff --git a/erpnext/regional/italy/__init__.py b/erpnext/regional/italy/__init__.py index d7dbddce95..22bf84e4d0 100644 --- a/erpnext/regional/italy/__init__.py +++ b/erpnext/regional/italy/__init__.py @@ -30,3 +30,34 @@ tax_exemption_reasons = [ "N6-Inversione Contabile", "N7-IVA assolta in altro stato UE" ] + +mode_of_payment_codes = [ + "MP01-Contanti", + "MP02-Assegno", + "MP03-Assegno circolare", + "MP04-Contanti presso Tesoreria", + "MP05-Bonifico", + "MP06-Vaglia cambiario", + "MP07-Bollettino bancario", + "MP08-Carta di pagamento", + "MP09-RID", + "MP10-RID utenze", + "MP11-RID veloce", + "MP12-RIBA", + "MP13-MAV", + "MP14-Quietanza erario", + "MP15-Giroconto su conti di contabilità speciale", + "MP16-Domiciliazione bancaria", + "MP17-Domiciliazione postale", + "MP18-Bollettino di c/c postale", + "MP19-SEPA Direct Debit", + "MP20-SEPA Direct Debit CORE", + "MP21-SEPA Direct Debit B2B", + "MP22-Trattenuta su somme già riscosse" +] + +vat_collectability_options = [ + "I-Immediata", + "D-Differita", + "S-Scissione dei Pagamenti" +] diff --git a/erpnext/regional/italy/e-invoice.xml b/erpnext/regional/italy/e-invoice.xml new file mode 100644 index 0000000000..84b7fffbbc --- /dev/null +++ b/erpnext/regional/italy/e-invoice.xml @@ -0,0 +1,208 @@ +{%- macro format_float(value) -%} +{{ "%.2f" % value|abs }} +{%- endmacro -%} + +{%- macro render_address(address) %} +{{ address.address_line1 }} +{{ address.pincode }} +{{ address.city }} +{%- if address.state %} +{{ address.state }} +{%- endif %} +{{ address.country_code|upper }} +{%- endmacro %} + +{%- macro render_discount_or_margin(item) -%} +{%- if item.discount_percentage > 0.0 or item.margin_type %} + + {%- if item.discount_percentage > 0.0 %} + SC + {{ format_float(item.discount_percentage) }} + {%- endif %} + {%- if item.margin_rate_or_amount > 0.0 -%} + MG + {%- if item.margin_type == "Percentage" -%} + {{ format_float(item.margin_rate_or_amount) }} + {%- elif item.margin_type == "Amount" -%} + {{ format_float(item.margin_rate_or_amount) }} + {%- endif -%} + {%- endif %} + +{%- endif -%} +{%- endmacro -%} + + + + + + + {{ doc.company_address_data.country_code|upper or "IT" }} + {{ doc.company_fiscal_code or doc.company_tax_id | replace("IT","") }} + + {{ doc.progressive_number }} + {{ doc.transmission_format_code }} + {{ doc.customer_data.recipient_code }} + {% if doc.company_data.phone or doc.company_data.email -%} + + {% if doc.company_data.phone -%}{{ doc.company_data.phone }}{%- endif %} + {% if doc.company_data.email -%}{{ doc.company_data.email }}{%- endif %} + + {% endif -%} + + + + + {{ doc.company_address_data.country_code|upper or "IT"}} + {{ doc.company_tax_id | replace("IT","") }} + + {%- if doc.company_fiscal_code %} + {{ doc.company_fiscal_code }} + {%- endif %} + + {{ doc.company }} + + {{ doc.company_fiscal_regime.split("-")[0] }} + + + {{ render_address(doc.company_address_data) }} + + {%- if doc.company_data.registration_number %} + + {{ doc.company_data.registrar_office_province }} + {{ doc.company_data.registration_number }} + {%- if doc.company_data.share_capital_amount %} + {{ format_float(doc.company_data.share_capital_amount) }} + {%- endif %} + {%- if doc.company_data.no_of_members %} + {{ doc.company_data.no_of_members.split("-")[0] }} + {%- endif %} + {%- if doc.company_data.liquidation_state %} + {{ doc.company_data.liquidation_state.split("-")[0] }} + {%- endif %} + + {%- endif %} + + + + {%- if doc.customer_data.customer_type == "Individual" %} + {{ doc.customer_data.fiscal_code }} + + {{ doc.customer_data.first_name }} + {{ doc.customer_data.last_name }} + + {%- else %} + {%- if doc.customer_data.is_public_administration %} + {{ doc.customer_data.fiscal_code }} + {%- else %} + + {{ doc.customer_address_data.country_code|upper or "IT" }} + {{ doc.tax_id | replace("IT","") }} + + {%- endif %} + + {{ doc.customer_name }} + + {%- endif %} + + {%- if doc.customer_address_data %} + + {{ render_address(doc.customer_address_data) }} + + {%- endif %} + + + + + + {{ doc.type_of_document }} + EUR + {{ doc.posting_date }} + {{ doc.unamended_name }} + {%- if doc.stamp_duty %} + + SI + {{ format_float(doc.stamp_duty) }} + + {%- endif %} + {{ format_float(doc.grand_total) }} + VENDITA + + {%- if doc.po_no %} + + {{ doc.po_no }} + {%- if doc.po_date %} + {{ doc.po_date }} + {%- endif %} + + {%- endif %} + {%- if doc.is_return and doc.return_against_unamended %} + + {{ doc.return_against_unamended }} + + {%- endif %} + {%- if doc.shipping_address_data %} + + + {{ render_address(doc.shipping_address_data) }} + + + {%- endif %} + + + {%- for item in doc.items %} + + {{ item.idx }} + + CODICE + {{ item.item_code }} + + {{ item.description or item.item_name }} + {{ format_float(item.qty) }} + {{ item.stock_uom }} + {{ format_float(item.price_list_rate or item.rate) }} + {{ render_discount_or_margin(item) }} + {{ format_float(item.amount) }} + {{ format_float(item.tax_rate) }} + {%- if item.tax_exemption_reason %} + {{ item.tax_exemption_reason.split("-")[0] }} + {%- endif %} + + {%- endfor %} + {%- for tax, data in doc.tax_data.items() %} + + {{ format_float(tax|flt) }} + {%- if data.tax_exemption_reason %} + {{ data.tax_exemption_reason.split("-")[0] }} + {%- endif %} + {{ format_float(data.taxable_amount) }} + {{ format_float(data.tax_amount) }} + {{ doc.vat_collectability.split("-")[0] }} + {%- if data.tax_exemption_law %} + {{ data.tax_exemption_law }} + {%- endif %} + + {%- endfor %} + + {%- if doc.payment_schedule %} + + {%- if payment_schedule|length > 1 %} + TP01 + {%- else %} + TP02 + {%- endif %} + {%- for payment_term in doc.payment_schedule %} + + {{ payment_term.mode_of_payment_code.split("-")[0] }} + {{ payment_term.due_date }} + {{ format_float(payment_term.payment_amount) }} + {%- if payment_term.bank_account_iban %}{{ payment_term.bank_account_iban }}{%- endif %} + + {%- endfor %} + + {%- endif %} + + diff --git a/erpnext/regional/italy/setup.py b/erpnext/regional/italy/setup.py index 1931fdc581..b4ab26f9c7 100644 --- a/erpnext/regional/italy/setup.py +++ b/erpnext/regional/italy/setup.py @@ -5,33 +5,152 @@ from __future__ import unicode_literals import frappe +from frappe import _ from frappe.custom.doctype.custom_field.custom_field import create_custom_fields -from erpnext.regional.italy import fiscal_regimes, tax_exemption_reasons +from erpnext.regional.italy import fiscal_regimes, tax_exemption_reasons, mode_of_payment_codes, vat_collectability_options def setup(company=None, patch=True): - make_custom_fields() + make_custom_fields() + setup_report() def make_custom_fields(update=True): - fiscal_code_field = dict(fieldname='fiscal_code', label='Fiscal Code', fieldtype='Data', insert_after='tax_id', print_hide=1) + invoice_item_fields = [ + dict(fieldname='tax_rate', label='Tax Rate', + fieldtype='Float', insert_after='description', + print_hide=1, hidden=1, read_only=1), + dict(fieldname='tax_amount', label='Tax Amount', + fieldtype='Currency', insert_after='tax_rate', + print_hide=1, hidden=1, read_only=1, options="currency"), + dict(fieldname='total_amount', label='Total Amount', + fieldtype='Currency', insert_after='tax_amount', + print_hide=1, hidden=1, read_only=1, options="currency") + ] + custom_fields = { 'Company': [ - fiscal_code_field, + dict(fieldname='sb_e_invoicing', label='E-Invoicing', + fieldtype='Section Break', insert_after='date_of_establishment', print_hide=1), dict(fieldname='fiscal_regime', label='Fiscal Regime', - fieldtype='Select', insert_after='fiscal_code', print_hide=1, - options="\n".join(map(lambda x: x.decode('utf-8'), fiscal_regimes))) - ], - 'Customer': [ - fiscal_code_field, - dict(fieldname='recipient_code', label='Recipient Code', - fieldtype='Data', insert_after='fiscal_code', print_hide=1, default="0000000"), - dict(fieldname='pec', label='Recipient PEC', - fieldtype='Data', insert_after='fiscal_code', print_hide=1) + fieldtype='Select', insert_after='sb_e_invoicing', print_hide=1, + options="\n".join(map(lambda x: x.decode('utf-8'), fiscal_regimes))), + dict(fieldname='fiscal_code', label='Fiscal Code', fieldtype='Data', insert_after='fiscal_regime', print_hide=1, + description=_("Applicable if the company is an Individual or a Proprietorship")), + dict(fieldname='vat_collectability', label='VAT Collectability', + fieldtype='Select', insert_after='fiscal_code', print_hide=1, + options="\n".join(map(lambda x: x.decode('utf-8'), vat_collectability_options))), + dict(fieldname='cb_e_invoicing1', fieldtype='Column Break', insert_after='vat_collectability', print_hide=1), + dict(fieldname='registrar_office_province', label='Province of the Registrar Office', + fieldtype='Data', insert_after='cb_e_invoicing1', print_hide=1, length=2), + dict(fieldname='registration_number', label='Registration Number', + fieldtype='Data', insert_after='registrar_office_province', print_hide=1, length=20), + dict(fieldname='share_capital_amount', label='Share Capital', + fieldtype='Currency', insert_after='registration_number', print_hide=1, + description=_('Applicable if the company is SpA, SApA or SRL')), + dict(fieldname='no_of_members', label='No of Members', + fieldtype='Select', insert_after='share_capital_amount', print_hide=1, + options="\nSU-Socio Unico\nSM-Piu Soci", description=_("Applicable if the company is a limited liability company")), + dict(fieldname='liquidation_state', label='Liquidation State', + fieldtype='Select', insert_after='no_of_members', print_hide=1, + options="\nLS-In Liquidazione\nLN-Non in Liquidazione") ], 'Sales Taxes and Charges': [ dict(fieldname='tax_exemption_reason', label='Tax Exemption Reason', + fieldtype='Select', insert_after='included_in_print_rate', print_hide=1, + depends_on='eval:doc.charge_type!="Actual" && doc.rate==0.0', + options="\n" + "\n".join(map(lambda x: x.decode('utf-8'), tax_exemption_reasons))), + dict(fieldname='tax_exemption_law', label='Tax Exempt Under', + fieldtype='Text', insert_after='tax_exemption_reason', print_hide=1, + depends_on='eval:doc.charge_type!="Actual" && doc.rate==0.0') + ], + 'Customer': [ + dict(fieldname='fiscal_code', label='Fiscal Code', fieldtype='Data', insert_after='tax_id', print_hide=1), + dict(fieldname='recipient_code', label='Recipient Code', + fieldtype='Data', insert_after='fiscal_code', print_hide=1, default="0000000"), + dict(fieldname='pec', label='Recipient PEC', + fieldtype='Data', insert_after='fiscal_code', print_hide=1), + dict(fieldname='is_public_administration', label='Is Public Administration', + fieldtype='Check', insert_after='is_internal_customer', print_hide=1, + description=_("Set this if the customer is a Public Administration company."), + depends_on='eval:doc.customer_type=="Company"'), + dict(fieldname='first_name', label='First Name', fieldtype='Data', + insert_after='salutation', print_hide=1, depends_on='eval:doc.customer_type!="Company"'), + dict(fieldname='last_name', label='Last Name', fieldtype='Data', + insert_after='first_name', print_hide=1, depends_on='eval:doc.customer_type!="Company"') + ], + 'Mode of Payment': [ + dict(fieldname='mode_of_payment_code', label='Code', fieldtype='Select', insert_after='included_in_print_rate', print_hide=1, - options="\n".join(map(lambda x: x.decode('utf-8'), tax_exemption_reasons))) + options="\n".join(map(lambda x: x.decode('utf-8'), mode_of_payment_codes))) + ], + 'Payment Schedule': [ + dict(fieldname='mode_of_payment_code', label='Code', + fieldtype='Select', insert_after='mode_of_payment', print_hide=1, + options="\n".join(map(lambda x: x.decode('utf-8'), mode_of_payment_codes)), + fetch_from="mode_of_payment.mode_of_payment_code", read_only=1), + dict(fieldname='bank_account', label='Bank Account', + fieldtype='Link', insert_after='mode_of_payment_code', print_hide=1, + options="Bank Account"), + dict(fieldname='bank_account_name', label='Bank Account Name', + fieldtype='Data', insert_after='bank_account', print_hide=1, + fetch_from="bank_account.account_name", read_only=1), + dict(fieldname='bank_account_no', label='Bank Account No', + fieldtype='Data', insert_after='bank_account_name', print_hide=1, + fetch_from="bank_account.bank_account_no", read_only=1), + dict(fieldname='bank_account_iban', label='IBAN', + fieldtype='Data', insert_after='bank_account_name', print_hide=1, + fetch_from="bank_account.iban", read_only=1), + ], + "Sales Invoice": [ + dict(fieldname='vat_collectability', label='VAT Collectability', + fieldtype='Select', insert_after='taxes_and_charges', print_hide=1, + options="\n".join(map(lambda x: x.decode('utf-8'), vat_collectability_options)), + fetch_from="company.vat_collectability"), + dict(fieldname='sb_e_invoicing_reference', label='E-Invoicing', + fieldtype='Section Break', insert_after='pos_total_qty', print_hide=1), + dict(fieldname='company_tax_id', label='Company Tax ID', + fieldtype='Data', insert_after='sb_e_invoicing_reference', print_hide=1, read_only=1, + fetch_from="company.tax_id"), + dict(fieldname='company_fiscal_code', label='Company Fiscal Code', + fieldtype='Data', insert_after='company_tax_id', print_hide=1, read_only=1, + fetch_from="company.fiscal_code"), + dict(fieldname='company_fiscal_regime', label='Company Fiscal Regime', + fieldtype='Data', insert_after='company_fiscal_code', print_hide=1, read_only=1, + fetch_from="company.fiscal_regime"), + dict(fieldname='cb_e_invoicing_reference', fieldtype='Column Break', + insert_after='company_fiscal_regime', print_hide=1), + dict(fieldname='customer_fiscal_code', label='Customer Fiscal Code', + fieldtype='Data', insert_after='cb_e_invoicing_reference', read_only=1, + fetch_from="customer.fiscal_code"), + ], + 'Purchase Invoice Item': invoice_item_fields, + 'Sales Order Item': invoice_item_fields, + 'Delivery Note Item': invoice_item_fields, + 'Sales Invoice Item': invoice_item_fields, + 'Quotation Item': invoice_item_fields, + 'Purchase Order Item': invoice_item_fields, + 'Purchase Receipt Item': invoice_item_fields, + 'Supplier Quotation Item': invoice_item_fields, + 'Address': [ + dict(fieldname='country_code', label='Country Code', + fieldtype='Data', insert_after='country', print_hide=1, read_only=1, + fetch_from="country.code") ] } create_custom_fields(custom_fields, ignore_validate = frappe.flags.in_patch, update=update) + +def setup_report(): + report_name = 'Electronic Invoice Register' + + frappe.db.sql(""" update `tabReport` set disabled = 0 where + name = %s """, report_name) + + if not frappe.db.get_value('Custom Role', dict(report=report_name)): + frappe.get_doc(dict( + doctype='Custom Role', + report=report_name, + roles= [ + dict(role='Accounts User'), + dict(role='Accounts Manager') + ] + )).insert() diff --git a/erpnext/regional/italy/utils.py b/erpnext/regional/italy/utils.py new file mode 100644 index 0000000000..69f7b464c9 --- /dev/null +++ b/erpnext/regional/italy/utils.py @@ -0,0 +1,251 @@ +import frappe, json, os +from frappe.utils import flt +from erpnext.controllers.taxes_and_totals import get_itemised_tax +from frappe import _ +from frappe.utils.file_manager import save_file, remove_file +from frappe.desk.form.load import get_attachments + + +def update_itemised_tax_data(doc): + if not doc.taxes: return + + itemised_tax = get_itemised_tax(doc.taxes) + + for row in doc.items: + tax_rate = 0.0 + if itemised_tax.get(row.item_code): + tax_rate = sum([tax.get('tax_rate', 0) for d, tax in itemised_tax.get(row.item_code).items()]) + + row.tax_rate = flt(tax_rate, row.precision("tax_rate")) + row.tax_amount = flt((row.net_amount * tax_rate) / 100, row.precision("net_amount")) + row.total_amount = flt((row.net_amount + row.tax_amount), row.precision("total_amount")) + +@frappe.whitelist() +def export_invoices(filters=None): + saved_xmls = [] + + invoices = frappe.get_all("Sales Invoice", filters=get_conditions(filters), fields=["*"]) + + for invoice in invoices: + attachments = get_e_invoice_attachments(invoice) + saved_xmls += [attachment.file_name for attachment in attachments] + + zip_filename = "{0}-einvoices.zip".format(frappe.utils.get_datetime().strftime("%Y%m%d_%H%M%S")) + + download_zip(saved_xmls, zip_filename) + + +@frappe.whitelist() +def prepare_invoice(invoice, progressive_number): + #set company information + company = frappe.get_doc("Company", invoice.company) + + invoice.progressive_number = progressive_number + invoice.unamended_name = get_unamended_name(invoice) + invoice.company_data = company + company_address = frappe.get_doc("Address", invoice.company_address) + invoice.company_address_data = company_address + + #Set invoice type + if invoice.is_return and invoice.return_against: + invoice.type_of_document = "TD04" #Credit Note (Nota di Credito) + invoice.return_against_unamended = get_unamended_name(frappe.get_doc("Sales Invoice", invoice.return_against)) + else: + invoice.type_of_document = "TD01" #Sales Invoice (Fattura) + + #set customer information + invoice.customer_data = frappe.get_doc("Customer", invoice.customer) + customer_address = frappe.get_doc("Address", invoice.customer_address) + invoice.customer_address_data = customer_address + + if invoice.shipping_address_name: + invoice.shipping_address_data = frappe.get_doc("Address", invoice.shipping_address_name) + + if invoice.customer_data.is_public_administration: + invoice.transmission_format_code = "FPA12" + else: + invoice.transmission_format_code = "FPR12" + + tax_data = get_invoice_summary(invoice.items, invoice.taxes) + invoice.tax_data = tax_data + + #Check if stamp duty (Bollo) of 2 EUR exists. + stamp_duty_charge_row = next((tax for tax in invoice.taxes if tax.charge_type == _("Actual") and tax.tax_amount == 2.0 ), None) + if stamp_duty_charge_row: + invoice.stamp_duty = stamp_duty_charge_row.tax_amount + + for item in invoice.items: + if item.tax_rate == 0.0: + item.tax_exemption_reason = tax_data["0.0"]["tax_exemption_reason"] + + return invoice + +def get_conditions(filters): + filters = json.loads(filters) + + conditions = {"docstatus": 1} + + if filters.get("company"): conditions["company"] = filters["company"] + if filters.get("customer"): conditions["customer"] = filters["customer"] + + if filters.get("from_date"): conditions["posting_date"] = (">=", filters["from_date"]) + if filters.get("to_date"): conditions["posting_date"] = ("<=", filters["to_date"]) + + if filters.get("from_date") and filters.get("to_date"): + conditions["posting_date"] = ("between", [filters.get("from_date"), filters.get("to_date")]) + + return conditions + +#TODO: Use function from frappe once PR #6853 is merged. +def download_zip(files, output_filename): + from zipfile import ZipFile + + input_files = [frappe.get_site_path('private', 'files', filename) for filename in files] + output_path = frappe.get_site_path('private', 'files', output_filename) + + with ZipFile(output_path, 'w') as output_zip: + for input_file in input_files: + output_zip.write(input_file, arcname=os.path.basename(input_file)) + + with open(output_path, 'rb') as fileobj: + filedata = fileobj.read() + + frappe.local.response.filename = output_filename + frappe.local.response.filecontent = filedata + frappe.local.response.type = "download" + +def get_invoice_summary(items, taxes): + summary_data = frappe._dict() + for tax in taxes: + #Include only VAT charges. + if tax.charge_type == "Actual": + continue + + #Check item tax rates if tax rate is zero. + if tax.rate == 0: + for item in items: + item_tax_rate = json.loads(item.item_tax_rate) + if tax.account_head in item_tax_rate: + key = str(item_tax_rate[tax.account_head]) + summary_data.setdefault(key, {"tax_amount": 0.0, "taxable_amount": 0.0, "tax_exemption_reason": "", "tax_exemption_law": ""}) + summary_data[key]["tax_amount"] += item.tax_amount + summary_data[key]["taxable_amount"] += item.net_amount + if key == "0.0": + summary_data[key]["tax_exemption_reason"] = tax.tax_exemption_reason + summary_data[key]["tax_exemption_law"] = tax.tax_exemption_law + + if summary_data == {}: #Implies that Zero VAT has not been set on any item. + summary_data.setdefault("0.0", {"tax_amount": 0.0, "taxable_amount": tax.total, + "tax_exemption_reason": tax.tax_exemption_reason, "tax_exemption_law": tax.tax_exemption_law}) + + else: + item_wise_tax_detail = json.loads(tax.item_wise_tax_detail) + for rate_item in [tax_item for tax_item in item_wise_tax_detail.items() if tax_item[1][0] == tax.rate]: + key = str(tax.rate) + if not summary_data.get(key): summary_data.setdefault(key, {"tax_amount": 0.0, "taxable_amount": 0.0}) + summary_data[key]["tax_amount"] += rate_item[1][1] + summary_data[key]["taxable_amount"] += sum([item.net_amount for item in items if item.item_code == rate_item[0]]) + + return summary_data + +#Preflight for successful e-invoice export. +def sales_invoice_validate(doc): + #Validate company + if not doc.company_address: + frappe.throw(_("Please set an Address on the Company '%s'" % doc.company), title=_("E-Invoicing Information Missing")) + else: + validate_address(doc.company_address, "Company") + + if not doc.company_tax_id and not doc.company_fiscal_code: + frappe.throw(_("Please set either the Tax ID or Fiscal Code on Company '%s'" % doc.company), title=_("E-Invoicing Information Missing")) + + #Validate customer details + customer_type, is_public_administration = frappe.db.get_value("Customer", doc.customer, ["customer_type", "is_public_administration"]) + if customer_type == _("Individual"): + if not doc.customer_fiscal_code: + frappe.throw(_("Please set Fiscal Code for the customer '%s'" % doc.customer), title=_("E-Invoicing Information Missing")) + else: + if is_public_administration: + if not doc.customer_fiscal_code: + frappe.throw(_("Please set Fiscal Code for the public administration '%s'" % doc.customer), title=_("E-Invoicing Information Missing")) + else: + if not doc.tax_id: + frappe.throw(_("Please set Tax ID for the customer '%s'" % doc.customer), title=_("E-Invoicing Information Missing")) + + if not doc.customer_address: + frappe.throw(_("Please set the Customer Address"), title=_("E-Invoicing Information Missing")) + else: + validate_address(doc.customer_address, "Customer") + + if not len(doc.taxes): + frappe.throw(_("Please set at least one row in the Taxes and Charges Table"), title=_("E-Invoicing Information Missing")) + else: + for row in doc.taxes: + if row.rate == 0 and row.tax_amount == 0 and not row.tax_exemption_reason: + frappe.throw(_("Row {0}: Please set at Tax Exemption Reason in Sales Taxes and Charges".format(row.idx)), + title=_("E-Invoicing Information Missing")) + + +#Ensure payment details are valid for e-invoice. +def sales_invoice_on_submit(doc): + #Validate payment details + if not len(doc.payment_schedule): + frappe.throw(_("Please set the Payment Schedule"), title=_("E-Invoicing Information Missing")) + else: + for schedule in doc.payment_schedule: + if not schedule.mode_of_payment: + frappe.throw(_("Row {0}: Please set the Mode of Payment in Payment Schedule".format(schedule.idx)), + title=_("E-Invoicing Information Missing")) + + prepare_and_attach_invoice(doc) + +def prepare_and_attach_invoice(doc): + progressive_name, progressive_number = get_progressive_name_and_number(doc) + + invoice = prepare_invoice(doc, progressive_number) + invoice_xml = frappe.render_template('erpnext/regional/italy/e-invoice.xml', context={"doc": invoice}, is_path=True) + + xml_filename = progressive_name + ".xml" + save_file(xml_filename, invoice_xml, dt=doc.doctype, dn=doc.name, is_private=True) + +#Delete e-invoice attachment on cancel. +def sales_invoice_on_cancel(doc): + for attachment in get_e_invoice_attachments(doc): + remove_file(attachment.name, attached_to_doctype=doc.doctype, attached_to_name=doc.name) + +def get_e_invoice_attachments(invoice): + out = [] + attachments = get_attachments(invoice.doctype, invoice.name) + company_tax_id = invoice.company_tax_id if invoice.company_tax_id.startswith("IT") else "IT" + invoice.company_tax_id + + for attachment in attachments: + if attachment.file_name.startswith(company_tax_id) and attachment.file_name.endswith(".xml"): + out.append(attachment) + + return out + +def validate_address(address_name, address_context): + pincode, city = frappe.db.get_value("Address", address_name, ["pincode", "city"]) + if not pincode: + frappe.throw(_("Please set pin code on %s Address" % address_context), title=_("E-Invoicing Information Missing")) + if not city: + frappe.throw(_("Please set city on %s Address" % address_context), title=_("E-Invoicing Information Missing")) + + +def get_unamended_name(doc): + attributes = ["naming_series", "amended_from"] + for attribute in attributes: + if not hasattr(doc, attribute): + return doc.name + + if doc.amended_from: + return "-".join(doc.name.split("-")[:-1]) + else: + return doc.name + +def get_progressive_name_and_number(doc): + company_tax_id = doc.company_tax_id if doc.company_tax_id.startswith("IT") else "IT" + doc.company_tax_id + progressive_name = frappe.model.naming.make_autoname(company_tax_id + "_.#####") + progressive_number = progressive_name.split("_")[1] + + return progressive_name, progressive_number \ No newline at end of file diff --git a/erpnext/regional/report/electronic_invoice_register/__init__.py b/erpnext/regional/report/electronic_invoice_register/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.js b/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.js new file mode 100644 index 0000000000..67297f757c --- /dev/null +++ b/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.js @@ -0,0 +1,53 @@ +// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt +/* eslint-disable */ + +frappe.query_reports["Electronic Invoice Register"] = { + "filters": [ + { + "fieldname":"from_date", + "label": __("From Date"), + "fieldtype": "Date", + "default": frappe.datetime.add_months(frappe.datetime.get_today(), -1), + "width": "80" + }, + { + "fieldname":"to_date", + "label": __("To Date"), + "fieldtype": "Date", + "default": frappe.datetime.get_today() + }, + { + "fieldname":"customer", + "label": __("Customer"), + "fieldtype": "Link", + "options": "Customer" + }, + { + "fieldname":"company", + "label": __("Company"), + "fieldtype": "Link", + "options": "Company", + "default": frappe.defaults.get_user_default("Company") + }, + ], + "onload": function(reportview) { + reportview.page.add_inner_button(__("Export E-Invoices"), function() { + //TODO: refactor condition to disallow export if report has no data. + if (!reportview.data.length) { + frappe.msgprint(__("No data to export")); + return + } + + var w = window.open( + frappe.urllib.get_full_url( + "/api/method/erpnext.regional.italy.utils.export_invoices?" + + "filters=" + JSON.stringify(reportview.get_filter_values()) + ) + ); + if (!w) { + frappe.msgprint(__("Please enable pop-ups")); return; + } + }) + } +} diff --git a/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.json b/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.json new file mode 100644 index 0000000000..5470c49c57 --- /dev/null +++ b/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.json @@ -0,0 +1,21 @@ +{ + "add_total_row": 0, + "color": "green", + "creation": "2019-01-13 17:43:21.903589", + "disabled": 1, + "docstatus": 0, + "doctype": "Report", + "icon": "fa fa-file-code-o", + "idx": 0, + "is_standard": "Yes", + "modified": "2019-01-13 19:03:56.187748", + "modified_by": "Administrator", + "module": "Regional", + "name": "Electronic Invoice Register", + "owner": "Administrator", + "prepared_report": 0, + "ref_doctype": "Sales Invoice", + "report_name": "Electronic Invoice Register", + "report_type": "Script Report", + "roles": [] +} \ No newline at end of file diff --git a/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.py b/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.py new file mode 100644 index 0000000000..376ba3ee47 --- /dev/null +++ b/erpnext/regional/report/electronic_invoice_register/electronic_invoice_register.py @@ -0,0 +1,8 @@ +# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +from erpnext.accounts.report.sales_register.sales_register import _execute + +def execute(filters=None): + return _execute(filters) diff --git a/erpnext/setup/doctype/company/test_company.py b/erpnext/setup/doctype/company/test_company.py index c3260ab906..1b08a228b6 100644 --- a/erpnext/setup/doctype/company/test_company.py +++ b/erpnext/setup/doctype/company/test_company.py @@ -46,7 +46,7 @@ class TestCompany(unittest.TestCase): def test_coa_based_on_country_template(self): countries = ["India", "Brazil", "United Arab Emirates", "Canada", "Germany", "France", - "Guatemala", "Indonesia", "Mexico", "Nicaragua", "Netherlands", "Singapore", + "Guatemala", "Indonesia", "Italy", "Mexico", "Nicaragua", "Netherlands", "Singapore", "Brazil", "Argentina", "Hungary", "Taiwan"] for country in countries: From 2670ad7eb251c78c206e0e32fad4b91300bdc9ac Mon Sep 17 00:00:00 2001 From: Gaurav Date: Tue, 19 Feb 2019 10:17:17 +0530 Subject: [PATCH 34/34] mod(regional,italy): adjusted calculation logic for charges validation for missing code on mode of payment UOM from settings Replace str with cstr --- erpnext/regional/italy/e-invoice.xml | 2 +- erpnext/regional/italy/utils.py | 46 ++++++++++++++++++++++++---- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/erpnext/regional/italy/e-invoice.xml b/erpnext/regional/italy/e-invoice.xml index 84b7fffbbc..1c416eeec6 100644 --- a/erpnext/regional/italy/e-invoice.xml +++ b/erpnext/regional/italy/e-invoice.xml @@ -153,7 +153,7 @@ {%- endif %} - {%- for item in doc.items %} + {%- for item in doc.e_invoice_items %} {{ item.idx }} diff --git a/erpnext/regional/italy/utils.py b/erpnext/regional/italy/utils.py index 69f7b464c9..85f744774f 100644 --- a/erpnext/regional/italy/utils.py +++ b/erpnext/regional/italy/utils.py @@ -1,5 +1,7 @@ +from __future__ import unicode_literals + import frappe, json, os -from frappe.utils import flt +from frappe.utils import flt, cstr from erpnext.controllers.taxes_and_totals import get_itemised_tax from frappe import _ from frappe.utils.file_manager import save_file, remove_file @@ -66,7 +68,8 @@ def prepare_invoice(invoice, progressive_number): else: invoice.transmission_format_code = "FPR12" - tax_data = get_invoice_summary(invoice.items, invoice.taxes) + invoice.e_invoice_items = [item for item in invoice.items] + tax_data = get_invoice_summary(invoice.e_invoice_items, invoice.taxes) invoice.tax_data = tax_data #Check if stamp duty (Bollo) of 2 EUR exists. @@ -74,8 +77,8 @@ def prepare_invoice(invoice, progressive_number): if stamp_duty_charge_row: invoice.stamp_duty = stamp_duty_charge_row.tax_amount - for item in invoice.items: - if item.tax_rate == 0.0: + for item in invoice.e_invoice_items: + if item.tax_rate == 0.0 and item.tax_amount == 0.0: item.tax_exemption_reason = tax_data["0.0"]["tax_exemption_reason"] return invoice @@ -121,12 +124,34 @@ def get_invoice_summary(items, taxes): if tax.charge_type == "Actual": continue + #Charges to appear as items in the e-invoice. + if tax.charge_type in ["On Previous Row Total", "On Previous Row Amount"]: + reference_row = next((row for row in taxes if row.idx == int(tax.row_id or 0)), None) + if reference_row: + items.append( + frappe._dict( + idx=len(items)+1, + item_code=reference_row.description, + item_name=reference_row.description, + rate=reference_row.tax_amount, + qty=1.0, + amount=reference_row.tax_amount, + stock_uom=frappe.db.get_single_value("Stock Settings", "stock_uom") or _("Nos"), + tax_rate=tax.rate, + tax_amount=(reference_row.tax_amount * tax.rate) / 100, + net_amount=reference_row.tax_amount, + taxable_amount=reference_row.tax_amount, + item_tax_rate="{}", + charges=True + ) + ) + #Check item tax rates if tax rate is zero. if tax.rate == 0: for item in items: item_tax_rate = json.loads(item.item_tax_rate) if tax.account_head in item_tax_rate: - key = str(item_tax_rate[tax.account_head]) + key = cstr(item_tax_rate[tax.account_head]) summary_data.setdefault(key, {"tax_amount": 0.0, "taxable_amount": 0.0, "tax_exemption_reason": "", "tax_exemption_law": ""}) summary_data[key]["tax_amount"] += item.tax_amount summary_data[key]["taxable_amount"] += item.net_amount @@ -141,11 +166,17 @@ def get_invoice_summary(items, taxes): else: item_wise_tax_detail = json.loads(tax.item_wise_tax_detail) for rate_item in [tax_item for tax_item in item_wise_tax_detail.items() if tax_item[1][0] == tax.rate]: - key = str(tax.rate) + key = cstr(tax.rate) if not summary_data.get(key): summary_data.setdefault(key, {"tax_amount": 0.0, "taxable_amount": 0.0}) summary_data[key]["tax_amount"] += rate_item[1][1] summary_data[key]["taxable_amount"] += sum([item.net_amount for item in items if item.item_code == rate_item[0]]) + for item in items: + key = cstr(tax.rate) + if item.get("charges"): + if not summary_data.get(key): summary_data.setdefault(key, {"taxable_amount": 0.0}) + summary_data[key]["taxable_amount"] += item.taxable_amount + return summary_data #Preflight for successful e-invoice export. @@ -196,6 +227,9 @@ def sales_invoice_on_submit(doc): if not schedule.mode_of_payment: frappe.throw(_("Row {0}: Please set the Mode of Payment in Payment Schedule".format(schedule.idx)), title=_("E-Invoicing Information Missing")) + elif not frappe.db.get_value("Mode of Payment", schedule.mode_of_payment, "mode_of_payment_code"): + frappe.throw(_("Row {0}: Please set the correct code on Mode of Payment {1}".format(schedule.idx, schedule.mode_of_payment)), + title=_("E-Invoicing Information Missing")) prepare_and_attach_invoice(doc)