Merge branch 'hotfix'
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index 07db5e8..2a06423 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -4,7 +4,7 @@
import frappe
from erpnext.hooks import regional_overrides
-__version__ = '9.2.17'
+__version__ = '9.2.18'
def get_default_company(user=None):
'''Get default company for user'''
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.js b/erpnext/accounts/report/general_ledger/general_ledger.js
index e5c55de..282c767 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.js
+++ b/erpnext/accounts/report/general_ledger/general_ledger.js
@@ -83,7 +83,7 @@
return;
}
- var fieldname = party_type.toLowerCase() + "_name";
+ var fieldname = frappe.scrub(party_type) + "_name";
frappe.db.get_value(party_type, party, fieldname, function(value) {
frappe.query_report_filters_by_name.party_name.set_value(value[fieldname]);
});
diff --git a/erpnext/patches/v8_1/set_delivery_date_in_so_item.py b/erpnext/patches/v8_1/set_delivery_date_in_so_item.py
index 963b82a..aa5cbc5 100644
--- a/erpnext/patches/v8_1/set_delivery_date_in_so_item.py
+++ b/erpnext/patches/v8_1/set_delivery_date_in_so_item.py
@@ -18,4 +18,6 @@
and so.order_type = 'Sales'
and (so_item.delivery_date is null or so_item.delivery_date = ''
or so_item.delivery_date = '0000-00-00')
- """)
\ No newline at end of file
+ and (so.delivery_date is not null and so.delivery_date != ''
+ and so.delivery_date != '0000-00-00')
+ """)
diff --git a/erpnext/public/css/pos.css b/erpnext/public/css/pos.css
index f66abc8..bc81182 100644
--- a/erpnext/public/css/pos.css
+++ b/erpnext/public/css/pos.css
@@ -34,7 +34,7 @@
margin-left: 15px;
}
.cart-wrapper {
- margin-bottom: 10px;
+ margin-bottom: 12px;
}
.cart-wrapper .list-item__content:not(:first-child) {
justify-content: flex-end;
@@ -121,7 +121,6 @@
border-collapse: collapse;
cursor: pointer;
display: table;
- margin: auto;
}
.num-row {
display: table-row;
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index b07d090..cb1cf3a 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -550,7 +550,7 @@
}
// Make read only if Accounts Settings doesn't allow stale rates
- this.frm.set_df_property("conversion_rate", "read_only", erpnext.stale_rate_allowed());
+ this.frm.set_df_property("conversion_rate", "read_only", erpnext.stale_rate_allowed() ? 0 : 1);
},
set_actual_charges_based_on_currency: function() {
diff --git a/erpnext/public/less/pos.less b/erpnext/public/less/pos.less
index 9653a82..0fcb654 100644
--- a/erpnext/public/less/pos.less
+++ b/erpnext/public/less/pos.less
@@ -50,7 +50,7 @@
}
.cart-wrapper {
- margin-bottom: 10px;
+ margin-bottom: 12px;
.list-item__content:not(:first-child) {
justify-content: flex-end;
}
@@ -155,7 +155,6 @@
border-collapse: collapse;
cursor: pointer;
display: table;
- margin: auto;
}
.num-row {
display: table-row;
diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py
index 8f2dacd..2cd71a5 100644
--- a/erpnext/regional/india/utils.py
+++ b/erpnext/regional/india/utils.py
@@ -14,15 +14,15 @@
if not p.match(doc.gstin):
frappe.throw(_("Invalid GSTIN or Enter NA for Unregistered"))
- if not doc.gst_state:
- if doc.state in states:
- doc.gst_state = doc.state
+ if not doc.gst_state:
+ if doc.state in states:
+ doc.gst_state = doc.state
- if doc.gst_state:
- doc.gst_state_number = state_numbers[doc.gst_state]
- if doc.gstin != "NA" and doc.gst_state_number != doc.gstin[:2]:
- frappe.throw(_("First 2 digits of GSTIN should match with State number {0}")
- .format(doc.gst_state_number))
+ if doc.gst_state:
+ doc.gst_state_number = state_numbers[doc.gst_state]
+ if doc.gstin and doc.gstin != "NA" and doc.gst_state_number != doc.gstin[:2]:
+ frappe.throw(_("First 2 digits of GSTIN should match with State number {0}")
+ .format(doc.gst_state_number))
def get_itemised_tax_breakup_header(item_doctype, tax_accounts):
if frappe.get_meta(item_doctype).has_field('gst_hsn_code'):
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 0a70bb9..6ac0a5f 100644
--- a/erpnext/selling/page/point_of_sale/point_of_sale.js
+++ b/erpnext/selling/page/point_of_sale/point_of_sale.js
@@ -206,7 +206,7 @@
select_batch_and_serial_no(item) {
erpnext.show_serial_batch_selector(this.frm, item, () => {
- this.update_item_in_frm(item)
+ this.update_item_in_frm(item, 'qty', item.qty)
.then(() => {
// update cart
if (item.qty === 0) {
@@ -321,19 +321,17 @@
make_new_invoice() {
return frappe.run_serially([
+ () => this.make_sales_invoice_frm(),
+ () => this.set_pos_profile_data(),
() => {
- this.make_sales_invoice_frm()
- .then(() => this.set_pos_profile_data())
- .then(() => {
- if (this.cart) {
- this.cart.frm = this.frm;
- this.cart.reset();
- } else {
- this.make_items();
- this.make_cart();
- }
- this.toggle_editing(true);
- })
+ if (this.cart) {
+ this.cart.frm = this.frm;
+ this.cart.reset();
+ } else {
+ this.make_items();
+ this.make_cart();
+ }
+ this.toggle_editing(true);
},
]);
}
@@ -376,7 +374,10 @@
this.frm.script_manager.trigger("update_stock");
frappe.model.set_default_values(this.frm.doc);
this.frm.cscript.calculate_taxes_and_totals();
- this.frm.meta.default_print_format = r.message.print_format || 'POS Invoice';
+
+ if (r.message) {
+ this.frm.meta.default_print_format = r.message.print_format || 'POS Invoice';
+ }
}
resolve();
@@ -915,7 +916,7 @@
this.search_field = frappe.ui.form.make_control({
df: {
fieldtype: 'Data',
- label: 'Search Item ( Ctrl + i )',
+ label: 'Search Item (Ctrl + i)',
placeholder: 'Search by item code, serial number, batch no or barcode'
},
parent: this.wrapper.find('.search-field'),