Merge pull request #18369 from Anurag810/fix_precision_v12
fix: precision for base grand total amount
diff --git a/erpnext/patches/v9_0/fix_subscription_next_date.py b/erpnext/patches/v9_0/fix_subscription_next_date.py
index 1789848..4595c8d 100644
--- a/erpnext/patches/v9_0/fix_subscription_next_date.py
+++ b/erpnext/patches/v9_0/fix_subscription_next_date.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import getdate
-from frappe.desk.doctype.auto_repeat.auto_repeat import get_next_schedule_date
+from frappe.automation.doctype.auto_repeat.auto_repeat import get_next_schedule_date
def execute():
frappe.reload_doc('accounts', 'doctype', 'subscription')
diff --git a/erpnext/public/js/controllers/buying.js b/erpnext/public/js/controllers/buying.js
index 750900e..acc09ed 100644
--- a/erpnext/public/js/controllers/buying.js
+++ b/erpnext/public/js/controllers/buying.js
@@ -346,7 +346,7 @@
update_auto_repeat_reference: function(doc) {
if (doc.auto_repeat) {
frappe.call({
- method:"frappe.desk.doctype.auto_repeat.auto_repeat.update_reference",
+ method:"frappe.automation.doctype.auto_repeat.auto_repeat.update_reference",
args:{
docname: doc.auto_repeat,
reference:doc.name
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index 0cd648e..0252f38 100755
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -180,7 +180,7 @@
make_subscription: function(doctype, docname) {
frappe.call({
- method: "frappe.desk.doctype.auto_repeat.auto_repeat.make_auto_repeat",
+ method: "frappe.automation.doctype.auto_repeat.auto_repeat.make_auto_repeat",
args: {
doctype: doctype,
docname: docname
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index e9b310e..0c5188a 100755
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -14,7 +14,7 @@
from frappe.desk.notifications import clear_doctype_notifications
from frappe.contacts.doctype.address.address import get_company_address
from erpnext.controllers.selling_controller import SellingController
-from frappe.desk.doctype.auto_repeat.auto_repeat import get_next_schedule_date
+from frappe.automation.doctype.auto_repeat.auto_repeat import get_next_schedule_date
from erpnext.selling.doctype.customer.customer import check_credit_limit
from erpnext.stock.doctype.item.item import get_item_defaults
from erpnext.setup.doctype.item_group.item_group import get_item_group_defaults
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index a2bae56..000d666 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -428,7 +428,7 @@
update_auto_repeat_reference: function(doc) {
if (doc.auto_repeat) {
frappe.call({
- method:"frappe.desk.doctype.auto_repeat.auto_repeat.update_reference",
+ method:"frappe.automation.doctype.auto_repeat.auto_repeat.update_reference",
args:{
docname: doc.auto_repeat,
reference:doc.name
diff --git a/erpnext/stock/dashboard/item_dashboard.js b/erpnext/stock/dashboard/item_dashboard.js
index 157dbfe..1bfa2cf 100644
--- a/erpnext/stock/dashboard/item_dashboard.js
+++ b/erpnext/stock/dashboard/item_dashboard.js
@@ -16,18 +16,47 @@
this.content = $(frappe.render_template('item_dashboard')).appendTo(this.parent);
this.result = this.content.find('.result');
- // move
this.content.on('click', '.btn-move', function() {
- erpnext.stock.move_item(unescape($(this).attr('data-item')), $(this).attr('data-warehouse'),
- null, $(this).attr('data-actual_qty'), null, function() { me.refresh(); });
+ handle_move_add($(this), "Move")
});
this.content.on('click', '.btn-add', function() {
- erpnext.stock.move_item(unescape($(this).attr('data-item')), null, $(this).attr('data-warehouse'),
- $(this).attr('data-actual_qty'), $(this).attr('data-rate'),
- function() { me.refresh(); });
+ handle_move_add($(this), "Add")
});
+ function handle_move_add(element, action) {
+ let item = unescape(element.attr('data-item'));
+ let warehouse = unescape(element.attr('data-warehouse'));
+ let actual_qty = unescape(element.attr('data-actual_qty'));
+ let disable_quick_entry = Number(unescape(element.attr('data-disable_quick_entry')));
+ let entry_type = action === "Move" ? "Material Transfer": null;
+
+ if (disable_quick_entry) {
+ open_stock_entry(item, warehouse, entry_type);
+ } else {
+ if (action === "Add") {
+ let rate = unescape($(this).attr('data-rate'));
+ erpnext.stock.move_item(item, null, warehouse, actual_qty, rate, function() { me.refresh(); });
+ }
+ else {
+ erpnext.stock.move_item(item, warehouse, null, actual_qty, null, function() { me.refresh(); });
+ }
+ }
+ }
+
+ function open_stock_entry(item, warehouse, entry_type) {
+ frappe.model.with_doctype('Stock Entry', function() {
+ var doc = frappe.model.get_new_doc('Stock Entry');
+ if (entry_type) doc.stock_entry_type = entry_type;
+
+ var row = frappe.model.add_child(doc, 'items');
+ row.item_code = item;
+ row.s_warehouse = warehouse;
+
+ frappe.set_route('Form', doc.doctype, doc.name);
+ })
+ }
+
// more
this.content.find('.btn-more').on('click', function() {
me.start += 20;
@@ -196,4 +225,4 @@
frappe.set_route('Form', doc.doctype, doc.name);
})
});
-}
\ No newline at end of file
+}
diff --git a/erpnext/stock/dashboard/item_dashboard.py b/erpnext/stock/dashboard/item_dashboard.py
index 487c765..cafb5c3 100644
--- a/erpnext/stock/dashboard/item_dashboard.py
+++ b/erpnext/stock/dashboard/item_dashboard.py
@@ -44,7 +44,9 @@
for item in items:
item.update({
- 'item_name': frappe.get_cached_value("Item", item.item_code, 'item_name')
+ 'item_name': frappe.get_cached_value("Item", item.item_code, 'item_name'),
+ 'disable_quick_entry': frappe.get_cached_value("Item", item.item_code, 'has_batch_no')
+ or frappe.get_cached_value("Item", item.item_code, 'has_serial_no'),
})
return items
diff --git a/erpnext/stock/dashboard/item_dashboard_list.html b/erpnext/stock/dashboard/item_dashboard_list.html
index 5a3fa2e..e1914ed 100644
--- a/erpnext/stock/dashboard/item_dashboard_list.html
+++ b/erpnext/stock/dashboard/item_dashboard_list.html
@@ -43,11 +43,13 @@
<div class="col-sm-2 text-right" style="margin-top: 8px;">
{% if d.actual_qty %}
<button class="btn btn-default btn-xs btn-move"
+ data-disable_quick_entry="{{ d.disable_quick_entry }}"
data-warehouse="{{ d.warehouse }}"
data-actual_qty="{{ d.actual_qty }}"
data-item="{{ escape(d.item_code) }}">{{ __("Move") }}</a>
{% endif %}
<button style="margin-left: 7px;" class="btn btn-default btn-xs btn-add"
+ data-disable_quick_entry="{{ d.disable_quick_entry }}"
data-warehouse="{{ d.warehouse }}"
data-actual_qty="{{ d.actual_qty }}"
data-item="{{ escape(d.item_code) }}"