conflicts resolved
diff --git a/erpnext/__version__.py b/erpnext/__version__.py
index ac6a6d2..4b50747 100644
--- a/erpnext/__version__.py
+++ b/erpnext/__version__.py
@@ -1,2 +1,2 @@
from __future__ import unicode_literals
-__version__ = '6.22.0'
+__version__ = '6.22.1'
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
index d3a72d6..b158ea2 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -24,11 +24,13 @@
if(!doc.is_return) {
if(doc.docstatus==1) {
- if(doc.outstanding_amount != 0) {
+ if(doc.outstanding_amount < 0) {
this.frm.add_custom_button(__('Payment'), this.make_bank_entry, __("Make"));
cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
}
- cur_frm.add_custom_button(__('Debit Note'), this.make_debit_note, __("Make"));
+ if(Math.abs(flt(doc.outstanding_amount)) < flt(doc.grand_total)) {
+ cur_frm.add_custom_button(__('Debit Note'), this.make_debit_note, __("Make"));
+ }
}
if(doc.docstatus===0) {
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 26a9fa6..7b9b803 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -57,10 +57,12 @@
return item.is_delivered_by_supplier ? true : false;
})
- cur_frm.add_custom_button(doc.update_stock ? __('Sales Return') : __('Credit Note'),
- this.make_sales_return, __("Make"));
- cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
-
+ if(Math.abs(flt(doc.outstanding_amount)) < flt(doc.grand_total)) {
+ cur_frm.add_custom_button(doc.update_stock ? __('Sales Return') : __('Credit Note'),
+ this.make_sales_return, __("Make"));
+ cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
+ }
+
if(cint(doc.update_stock)!=1) {
// show Make Delivery Note button only if Sales Invoice is not created from Delivery Note
var from_delivery_note = false;
@@ -75,7 +77,7 @@
}
}
- if(doc.outstanding_amount!=0 && !cint(doc.is_return)) {
+ if(doc.outstanding_amount>0 && !cint(doc.is_return)) {
cur_frm.add_custom_button(__('Payment Request'), this.make_payment_request, __("Make"));
cur_frm.add_custom_button(__('Payment'), cur_frm.cscript.make_bank_entry, __("Make"));
}
diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py
index 6488288..5907ba0 100644
--- a/erpnext/accounts/general_ledger.py
+++ b/erpnext/accounts/general_ledger.py
@@ -117,7 +117,13 @@
debit_credit_diff += entry.debit - entry.credit
debit_credit_diff = flt(debit_credit_diff, precision)
- if abs(debit_credit_diff) >= (5.0 / (10**precision)):
+
+ if gl_map[0]["voucher_type"] == "Journal Entry":
+ allowance = 5.0 / (10**precision)
+ else:
+ allowance = 1
+
+ if abs(debit_credit_diff) >= allowance:
frappe.throw(_("Debit and Credit not equal for {0} #{1}. Difference is {2}.")
.format(gl_map[0].voucher_type, gl_map[0].voucher_no, debit_credit_diff))
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index 6f02a54..d59b179 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -105,11 +105,11 @@
if acc.account_currency == frappe.db.get_value("Company", acc.company, "default_currency"):
in_account_currency = False
else:
- cond.append("""gle.account = "%s" """ % (frappe.db.escape(account), ))
-
+ cond.append("""gle.account = "%s" """ % (frappe.db.escape(account, percent=False), ))
+
if party_type and party:
cond.append("""gle.party_type = "%s" and gle.party = "%s" """ %
- (frappe.db.escape(party_type), frappe.db.escape(party)))
+ (frappe.db.escape(party_type), frappe.db.escape(party, percent=False)))
if account or (party_type and party):
if in_account_currency:
diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json
index bd45949..d579669 100644
--- a/erpnext/buying/doctype/supplier/supplier.json
+++ b/erpnext/buying/doctype/supplier/supplier.json
@@ -235,6 +235,29 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "column_break_10",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "language",
"fieldtype": "Select",
"hidden": 0,
@@ -284,18 +307,31 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+<<<<<<< HEAD
"fieldname": "credit_days_based_on",
"fieldtype": "Select",
+=======
+ "depends_on": "eval:doc.credit_days_based_on == 'Fixed Days'",
+ "fieldname": "credit_days",
+ "fieldtype": "Int",
+>>>>>>> ff321763cf11f306460db22789e31756121dbe67
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
+<<<<<<< HEAD
"label": "Credit Days Based On",
"length": 0,
"no_copy": 0,
"options": "\nFixed Days\nLast Day of the Next Month",
"permlevel": 0,
"precision": "",
+=======
+ "label": "Credit Days",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+>>>>>>> ff321763cf11f306460db22789e31756121dbe67
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
@@ -309,16 +345,30 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+<<<<<<< HEAD
"depends_on": "eval:doc.credit_days_based_on == 'Fixed Days'",
"fieldname": "credit_days",
"fieldtype": "Int",
+=======
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "address_contacts",
+ "fieldtype": "Section Break",
+>>>>>>> ff321763cf11f306460db22789e31756121dbe67
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
+<<<<<<< HEAD
"label": "Credit Days",
"length": 0,
"no_copy": 0,
+=======
+ "label": "Address and Contacts",
+ "length": 0,
+ "no_copy": 0,
+ "oldfieldtype": "Column Break",
+ "options": "icon-map-marker",
+>>>>>>> ff321763cf11f306460db22789e31756121dbe67
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
@@ -333,6 +383,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+<<<<<<< HEAD
"depends_on": "eval:!doc.__islocal",
"fieldname": "address_contacts",
"fieldtype": "Section Break",
@@ -359,6 +410,8 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+=======
+>>>>>>> ff321763cf11f306460db22789e31756121dbe67
"fieldname": "address_html",
"fieldtype": "HTML",
"hidden": 0,
@@ -585,7 +638,11 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
+<<<<<<< HEAD
+ "modified": "2016-02-22 16:50:55.710869",
+=======
"modified": "2016-02-17 12:28:05.386806",
+>>>>>>> ff321763cf11f306460db22789e31756121dbe67
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier",
@@ -737,4 +794,4 @@
"search_fields": "supplier_name, supplier_type",
"sort_order": "ASC",
"title_field": "supplier_name"
-}
\ No newline at end of file
+}
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
index e940b03..b6dc61b 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
@@ -1532,7 +1532,7 @@
"collapsible": 0,
"fieldname": "language",
"fieldtype": "Data",
- "hidden": 0,
+ "hidden": 1,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
@@ -1541,7 +1541,7 @@
"no_copy": 0,
"permlevel": 0,
"precision": "",
- "print_hide": 0,
+ "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
@@ -1738,7 +1738,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-02-18 12:18:22.464056",
+ "modified": "2016-02-22 16:30:39.776128",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation",
@@ -1892,4 +1892,4 @@
"sort_order": "DESC",
"timeline_field": "supplier",
"title_field": "title"
-}
\ No newline at end of file
+}
diff --git a/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.json b/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.json
index 4cfda96..4659b36 100644
--- a/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.json
+++ b/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.json
@@ -2,17 +2,18 @@
"add_total_row": 1,
"apply_user_permissions": 1,
"creation": "2013-05-03 14:55:53",
+ "disabled": 0,
"docstatus": 0,
"doctype": "Report",
"idx": 1,
"is_standard": "Yes",
- "modified": "2016-01-28 15:36:46.837095",
+ "modified": "2016-02-22 11:27:39.445257",
"modified_by": "Administrator",
"module": "Buying",
"name": "Item-wise Purchase History",
"owner": "Administrator",
- "query": "select\n po_item.item_code as \"Item Code:Link/Item:120\",\n\tpo_item.item_name as \"Item Name::120\",\n po_item.item_group as \"Item Group:Link/Item Group:120\",\n\tpo_item.description as \"Description::150\",\n\tpo_item.qty as \"Qty:Float:100\",\n\tpo_item.stock_uom as \"UOM:Link/UOM:80\",\n\tpo_item.base_rate as \"Rate:Currency:120\",\n\tpo_item.base_amount as \"Amount:Currency:120\",\n\tpo.name as \"Purchase Order:Link/Purchase Order:120\",\n\tpo.transaction_date as \"Transaction Date:Date:140\",\n\tpo.supplier as \"Supplier:Link/Supplier:130\",\n sup.supplier_name as \"Supplier Name::150\",\n\tpo_item.project_name as \"Project:Link/Project:130\",\n\tifnull(po_item.received_qty, 0) as \"Received Qty:Float:120\",\n\tpo.company as \"Company:Link/Company:\"\nfrom\n\t`tabPurchase Order` po, `tabPurchase Order Item` po_item, `tabSupplier` sup\nwhere\n\tpo.name = po_item.parent and po.supplier = sup.name and po.docstatus = 1\norder by po.name desc",
+ "query": "select\n po_item.item_code as \"Item Code:Link/Item:120\",\n\tpo_item.item_name as \"Item Name::120\",\n po_item.item_group as \"Item Group:Link/Item Group:120\",\n\tpo_item.description as \"Description::150\",\n\tpo_item.qty as \"Qty:Float:100\",\n\tpo_item.uom as \"UOM:Link/UOM:80\",\n\tpo_item.base_rate as \"Rate:Currency:120\",\n\tpo_item.base_amount as \"Amount:Currency:120\",\n\tpo.name as \"Purchase Order:Link/Purchase Order:120\",\n\tpo.transaction_date as \"Transaction Date:Date:140\",\n\tpo.supplier as \"Supplier:Link/Supplier:130\",\n sup.supplier_name as \"Supplier Name::150\",\n\tpo_item.project_name as \"Project:Link/Project:130\",\n\tifnull(po_item.received_qty, 0) as \"Received Qty:Float:120\",\n\tpo.company as \"Company:Link/Company:\"\nfrom\n\t`tabPurchase Order` po, `tabPurchase Order Item` po_item, `tabSupplier` sup\nwhere\n\tpo.name = po_item.parent and po.supplier = sup.name and po.docstatus = 1\norder by po.name desc",
"ref_doctype": "Purchase Order",
"report_name": "Item-wise Purchase History",
"report_type": "Query Report"
-}
+}
\ No newline at end of file
diff --git a/erpnext/change_log/v6/v6_22_1.md b/erpnext/change_log/v6/v6_22_1.md
new file mode 100644
index 0000000..6f93910
--- /dev/null
+++ b/erpnext/change_log/v6/v6_22_1.md
@@ -0,0 +1,3 @@
+- Employee Attendance Report: Also show inactive employees
+- Bank Reconciliation table: Show Debit/Credit
+- Allow a rounding loss of upto 1.0 instead of 0.05 when posting General Ledger Entry
diff --git a/erpnext/docs/assets/img/multilingual_print_format/alternate_language.png b/erpnext/docs/assets/img/multilingual_print_format/alternate_language.png
new file mode 100644
index 0000000..12aa0dd
--- /dev/null
+++ b/erpnext/docs/assets/img/multilingual_print_format/alternate_language.png
Binary files differ
diff --git a/erpnext/docs/assets/img/multilingual_print_format/custom_translation.png b/erpnext/docs/assets/img/multilingual_print_format/custom_translation.png
new file mode 100644
index 0000000..c3fc2fc
--- /dev/null
+++ b/erpnext/docs/assets/img/multilingual_print_format/custom_translation.png
Binary files differ
diff --git a/erpnext/docs/assets/img/multilingual_print_format/customer_quotation.png b/erpnext/docs/assets/img/multilingual_print_format/customer_quotation.png
new file mode 100644
index 0000000..7ea61d9
--- /dev/null
+++ b/erpnext/docs/assets/img/multilingual_print_format/customer_quotation.png
Binary files differ
diff --git a/erpnext/docs/assets/img/multilingual_print_format/set_customer_default_lang.png b/erpnext/docs/assets/img/multilingual_print_format/set_customer_default_lang.png
new file mode 100644
index 0000000..1984e74
--- /dev/null
+++ b/erpnext/docs/assets/img/multilingual_print_format/set_customer_default_lang.png
Binary files differ
diff --git a/erpnext/docs/assets/img/multilingual_print_format/set_supplier_default_lang.png b/erpnext/docs/assets/img/multilingual_print_format/set_supplier_default_lang.png
new file mode 100644
index 0000000..3f46d98
--- /dev/null
+++ b/erpnext/docs/assets/img/multilingual_print_format/set_supplier_default_lang.png
Binary files differ
diff --git a/erpnext/docs/assets/img/multilingual_print_format/supplier_quotation.png b/erpnext/docs/assets/img/multilingual_print_format/supplier_quotation.png
new file mode 100644
index 0000000..990ebe3
--- /dev/null
+++ b/erpnext/docs/assets/img/multilingual_print_format/supplier_quotation.png
Binary files differ
diff --git a/erpnext/docs/assets/img/multilingual_print_format/translation.png b/erpnext/docs/assets/img/multilingual_print_format/translation.png
new file mode 100644
index 0000000..40716d5
--- /dev/null
+++ b/erpnext/docs/assets/img/multilingual_print_format/translation.png
Binary files differ
diff --git a/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/date-validation.md b/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/date-validation.md
index 0d080af..d68ab56 100644
--- a/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/date-validation.md
+++ b/erpnext/docs/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/date-validation.md
@@ -1,10 +1,10 @@
# Date Validation
- frappe.ui.form.on("Event", "validate", function(frm) {
+ frappe.ui.form.on("Task", "validate", function(frm) {
if (frm.doc.from_date < get_today()) {
msgprint(__("You can not select past date in From Date"));
- throw "past date selected"
+ validated = false;
}
});
diff --git a/erpnext/docs/user/manual/en/using-erpnext/index.txt b/erpnext/docs/user/manual/en/using-erpnext/index.txt
index 0dfa0d5..63f4a64 100644
--- a/erpnext/docs/user/manual/en/using-erpnext/index.txt
+++ b/erpnext/docs/user/manual/en/using-erpnext/index.txt
@@ -7,3 +7,4 @@
tags
articles
pos-view
+multilingual_print_format
diff --git a/erpnext/docs/user/manual/en/using-erpnext/multilingual_print_format.md b/erpnext/docs/user/manual/en/using-erpnext/multilingual_print_format.md
new file mode 100644
index 0000000..bb48278
--- /dev/null
+++ b/erpnext/docs/user/manual/en/using-erpnext/multilingual_print_format.md
@@ -0,0 +1,50 @@
+####What is Multlingual Print Format?
+
+User can print the customer's and supplier's document in their local language. For an example if I have customers from germany, france who want quotation in german, french language will be possible with these feature.
+
+####How does it work?
+Set print language for customer, supplier on their respective form.
+
+`Selling -> Customer -> Customer List -> Click on New`
+
+Here user has set default language for customer Adalbert as <b>deutsch</b>.
+
+<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/set_customer_default_lang.png" class="screenshot">
+
+`Buying -> Supplier -> Supplier List -> Click on New`
+
+Here user has set default language for supplier Piero as <b>Italiano</b>.
+<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/set_supplier_default_lang.png" class="screenshot">
+
+When user click on print icon on the document, system will load the print preview in their default language.
+
+Customer quotation standard print preview in customer's default language.
+
+<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/customer_quotation.png" class="screenshot">
+
+Supplier quotation standard print preview in supplier's default language.
+
+<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/supplier_quotation.png" class="screenshot">
+
+####What to do if want to print with another language?
+
+User can have option to select alternate language on print view.
+
+<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/alternate_language.png" class="screenshot">
+
+
+####Custom Translation
+
+User can set their custom translations using translation form. For example user want to set description of the product in customer's language(Italiano). For that create new translation with language as Italiano, enter source data and Translated information.
+
+`Setup -> Settings -> Translation List -> Click on New`
+
+<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/translation.png" class="screenshot">
+
+The translation is applied when user select language as Italiano on supplier quotation's print prieview.
+
+<img src="{{ docs_base_url }}/assets/img/multilingual_print_format/custom_translation.png" class="screenshot">
+
+
+
+
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 2cb3bd5..d77c0f7 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -7,7 +7,7 @@
app_description = """ERP made simple"""
app_icon = "icon-th"
app_color = "#e74c3c"
-app_version = "6.22.0"
+app_version = "6.22.1"
app_email = "info@erpnext.com"
app_license = "GNU General Public License (v3)"
source_link = "https://github.com/frappe/erpnext"
diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py
index 6cfbc99..349c778 100644
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -12,7 +12,8 @@
class BOM(Document):
def autoname(self):
last_name = frappe.db.sql("""select max(name) from `tabBOM`
- where name like "BOM/{0}/%%" and item=%s""".format(frappe.db.escape(self.item)), self.item)
+ where name like "BOM/{0}/%%" and item=%s
+ """.format(frappe.db.escape(self.item, percent=False)), self.item)
if last_name:
idx = cint(cstr(last_name[0][0]).split('/')[-1].split('-')[0]) + 1
else:
diff --git a/erpnext/selling/doctype/customer/customer.json b/erpnext/selling/doctype/customer/customer.json
index 1aecd02..8e4434b 100644
--- a/erpnext/selling/doctype/customer/customer.json
+++ b/erpnext/selling/doctype/customer/customer.json
@@ -338,6 +338,29 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "column_break_14",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "language",
"fieldtype": "Select",
"hidden": 0,
@@ -844,7 +867,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-02-18 12:21:08.037196",
+ "modified": "2016-02-22 16:16:41.563405",
"modified_by": "Administrator",
"module": "Selling",
"name": "Customer",
@@ -1036,4 +1059,4 @@
"search_fields": "customer_name,customer_group,territory",
"sort_order": "ASC",
"title_field": "customer_name"
-}
\ No newline at end of file
+}
diff --git a/erpnext/setup/doctype/company/delete_company_transactions.py b/erpnext/setup/doctype/company/delete_company_transactions.py
index 00ac76c..d32e14f 100644
--- a/erpnext/setup/doctype/company/delete_company_transactions.py
+++ b/erpnext/setup/doctype/company/delete_company_transactions.py
@@ -29,7 +29,7 @@
else:
# un-set company
- frappe.db.sql('update `tab{0}` set company="" where company=%s', company_name)
+ frappe.db.sql('update `tab{0}` set company="" where company=%s'.format(doctype), company_name)
# Clear notification counts
clear_notifications()
diff --git a/erpnext/setup/doctype/translation/translation.json b/erpnext/setup/doctype/translation/translation.json
index ef108e1..98b7f6d 100644
--- a/erpnext/setup/doctype/translation/translation.json
+++ b/erpnext/setup/doctype/translation/translation.json
@@ -44,7 +44,7 @@
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "Source Name",
+ "label": "Source Data",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -139,7 +139,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2016-02-18 19:04:42.900104",
+ "modified": "2016-02-23 02:05:54.341357",
"modified_by": "Administrator",
"module": "Setup",
"name": "Translation",
@@ -172,4 +172,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "source_name"
-}
\ No newline at end of file
+}
diff --git a/erpnext/stock/reorder_item.py b/erpnext/stock/reorder_item.py
index cca2456..c637a12 100644
--- a/erpnext/stock/reorder_item.py
+++ b/erpnext/stock/reorder_item.py
@@ -48,7 +48,7 @@
# projected_qty will be 0 if Bin does not exist
projected_qty = flt(item_warehouse_projected_qty.get(item_code, {}).get(warehouse))
- if reorder_level and projected_qty <= reorder_level:
+ if (reorder_level or reorder_qty) and projected_qty < reorder_level:
deficiency = reorder_level - projected_qty
if deficiency > reorder_qty:
reorder_qty = deficiency
diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py
index 0a9abc2..7dd728f 100644
--- a/erpnext/stock/report/stock_balance/stock_balance.py
+++ b/erpnext/stock/report/stock_balance/stock_balance.py
@@ -66,7 +66,7 @@
frappe.throw(_("'To Date' is required"))
if filters.get("item_code"):
- conditions += " and item_code = '%s'" % frappe.db.escape(filters.get("item_code"))
+ conditions += " and item_code = '%s'" % frappe.db.escape(filters.get("item_code"), percent=False)
return conditions
diff --git a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py
index fd9ff5d..b21b402 100644
--- a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py
+++ b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.py
@@ -47,7 +47,7 @@
re_order_level = d.warehouse_reorder_level
re_order_qty = d.warehouse_reorder_qty
- shortage_qty = re_order_level - flt(bin.projected_qty) if re_order_level else 0
+ shortage_qty = re_order_level - flt(bin.projected_qty) if (re_order_level or re_order_qty) else 0
data.append([item.name, item.item_name, item.description, item.item_group, item.brand, bin.warehouse,
item.stock_uom, bin.actual_qty, bin.planned_qty, bin.indented_qty, bin.ordered_qty,
@@ -73,7 +73,7 @@
condition = ""
if item_code:
- condition = 'and item_code = "{0}"'.format(frappe.db.escape(item_code))
+ condition = 'and item_code = "{0}"'.format(frappe.db.escape(item_code, percent=False))
items = frappe.db.sql("""select * from `tabItem` item
where is_stock_item = 1
@@ -85,7 +85,7 @@
condition = ""
if item_code:
- condition = 'where parent="{0}"'.format(frappe.db.escape(item_code))
+ condition = 'where parent="{0}"'.format(frappe.db.escape(item_code, percent=False))
reorder_levels = frappe._dict()
for ir in frappe.db.sql("""select * from `tabItem Reorder` {condition}""".format(condition=condition), as_dict=1):
diff --git a/setup.py b/setup.py
index 449c92c..885d74b 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
from pip.req import parse_requirements
-version = "6.22.0"
+version = "6.22.1"
requirements = parse_requirements("requirements.txt", session="")
setup(