Merge pull request #22478 from michellealva/cost_center_filter
fix: apply filters in all transactions
diff --git a/erpnext/loan_management/doctype/loan/loan.py b/erpnext/loan_management/doctype/loan/loan.py
index 76e10e5..4e805d4 100644
--- a/erpnext/loan_management/doctype/loan/loan.py
+++ b/erpnext/loan_management/doctype/loan/loan.py
@@ -235,8 +235,10 @@
@frappe.whitelist()
def create_loan_security_unpledge(loan, applicant_type, applicant, company, as_dict=1):
loan_security_pledge_details = frappe.db.sql("""
- SELECT p.parent, p.loan_security, p.qty as qty FROM `tabLoan Security Pledge` lsp , `tabPledge` p
+ SELECT p.loan_security, sum(p.qty) as qty
+ FROM `tabLoan Security Pledge` lsp , `tabPledge` p
WHERE p.parent = lsp.name AND lsp.loan = %s AND lsp.docstatus = 1
+ GROUP BY p.loan_security
""",(loan), as_dict=1)
unpledge_request = frappe.new_doc("Loan Security Unpledge")
diff --git a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py
index c28994e..9605045 100644
--- a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py
+++ b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py
@@ -116,7 +116,7 @@
def allocate_amounts(self, paid_entries):
self.set('repayment_details', [])
self.principal_amount_paid = 0
- interest_paid = 0
+ interest_paid = self.amount_paid - self.penalty_amount
if self.amount_paid - self.penalty_amount > 0 and paid_entries:
interest_paid = self.amount_paid - self.penalty_amount
diff --git a/erpnext/loan_management/doctype/loan_security_price/loan_security_price.json b/erpnext/loan_management/doctype/loan_security_price/loan_security_price.json
index db260a4..a55b482 100644
--- a/erpnext/loan_management/doctype/loan_security_price/loan_security_price.json
+++ b/erpnext/loan_management/doctype/loan_security_price/loan_security_price.json
@@ -1,4 +1,5 @@
{
+ "actions": [],
"autoname": "LM-LSP-.####",
"creation": "2019-09-03 18:20:31.382887",
"doctype": "DocType",
@@ -46,6 +47,7 @@
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Loan Security Price",
+ "options": "Company:company:default_currency",
"reqd": 1
},
{
@@ -79,7 +81,8 @@
"read_only": 1
}
],
- "modified": "2019-10-26 09:46:46.069667",
+ "links": [],
+ "modified": "2020-06-11 03:41:33.900340",
"modified_by": "Administrator",
"module": "Loan Management",
"name": "Loan Security Price",
diff --git a/erpnext/loan_management/doctype/loan_security_shortfall/loan_security_shortfall.py b/erpnext/loan_management/doctype/loan_security_shortfall/loan_security_shortfall.py
index 308c438..ffd9673 100644
--- a/erpnext/loan_management/doctype/loan_security_shortfall/loan_security_shortfall.py
+++ b/erpnext/loan_management/doctype/loan_security_shortfall/loan_security_shortfall.py
@@ -19,7 +19,9 @@
return
if security_value >= loan_security_shortfall.shortfall_amount:
- frappe.db.set_value("Loan Security Shortfall", loan_security_shortfall.name, "status", "Completed")
+ frappe.db.set_value("Loan Security Shortfall", loan_security_shortfall.name, {
+ "status": "Completed",
+ "shortfall_value": loan_security_shortfall.shortfall_amount})
else:
frappe.db.set_value("Loan Security Shortfall", loan_security_shortfall.name,
"shortfall_amount", loan_security_shortfall.shortfall_amount - security_value)
diff --git a/erpnext/payroll/doctype/salary_slip/salary_slip.json b/erpnext/payroll/doctype/salary_slip/salary_slip.json
index 663a3ef..88931c2 100644
--- a/erpnext/payroll/doctype/salary_slip/salary_slip.json
+++ b/erpnext/payroll/doctype/salary_slip/salary_slip.json
@@ -381,7 +381,6 @@
{
"fieldname": "earning",
"fieldtype": "Column Break",
- "label": "Earning",
"oldfieldtype": "Column Break",
"show_days": 1,
"show_seconds": 1,
@@ -400,7 +399,6 @@
{
"fieldname": "deduction",
"fieldtype": "Column Break",
- "label": "Deduction",
"oldfieldtype": "Column Break",
"show_days": 1,
"show_seconds": 1,
@@ -616,7 +614,7 @@
"idx": 9,
"is_submittable": 1,
"links": [],
- "modified": "2020-06-22 14:42:43.921828",
+ "modified": "2020-06-25 14:42:43.921828",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Salary Slip",
diff --git a/erpnext/shopping_cart/product_info.py b/erpnext/shopping_cart/product_info.py
index 7c08f5b..29617a8 100644
--- a/erpnext/shopping_cart/product_info.py
+++ b/erpnext/shopping_cart/product_info.py
@@ -55,7 +55,7 @@
def set_product_info_for_website(item):
"""set product price uom for website"""
- product_info = get_product_info_for_website(item.item_code, skip_quotation_creation=True)
+ product_info = get_product_info_for_website(item.item_code, skip_quotation_creation=True).get("product_info")
if product_info:
item.update(product_info)
diff --git a/erpnext/stock/doctype/customs_tariff_number/customs_tariff_number.json b/erpnext/stock/doctype/customs_tariff_number/customs_tariff_number.json
index 07992b8..7eeb147 100644
--- a/erpnext/stock/doctype/customs_tariff_number/customs_tariff_number.json
+++ b/erpnext/stock/doctype/customs_tariff_number/customs_tariff_number.json
@@ -71,7 +71,7 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
- "reqd": 1,
+ "reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
@@ -88,7 +88,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-09-12 09:30:03.951743",
+ "modified": "2020-06-26 09:30:03.951743",
"modified_by": "Administrator",
"module": "Stock",
"name": "Customs Tariff Number",
@@ -143,4 +143,4 @@
"track_changes": 1,
"track_seen": 0,
"track_views": 0
-}
\ No newline at end of file
+}
diff --git a/erpnext/stock/doctype/serial_no/serial_no.json b/erpnext/stock/doctype/serial_no/serial_no.json
index d9f8b62..2be14c8 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.json
+++ b/erpnext/stock/doctype/serial_no/serial_no.json
@@ -1,7 +1,6 @@
{
"actions": [],
"allow_import": 1,
- "allow_rename": 1,
"autoname": "field:serial_no",
"creation": "2013-05-16 10:59:15",
"description": "Distinct unit of an Item",
@@ -427,7 +426,7 @@
"icon": "fa fa-barcode",
"idx": 1,
"links": [],
- "modified": "2020-05-21 19:29:58.517772",
+ "modified": "2020-06-25 15:53:50.900855",
"modified_by": "Administrator",
"module": "Stock",
"name": "Serial No",
diff --git a/erpnext/support/doctype/issue/issue.js b/erpnext/support/doctype/issue/issue.js
index e7e5bd3..9e15757 100644
--- a/erpnext/support/doctype/issue/issue.js
+++ b/erpnext/support/doctype/issue/issue.js
@@ -79,7 +79,7 @@
method: "erpnext.support.doctype.issue.issue.make_task",
frm: frm
});
- }, __("Make"));
+ }, __("Create"));
} else {
if (frm.doc.service_level_agreement) {
@@ -232,4 +232,4 @@
} else {
return {"diff_display": "Failed", "indicator": "red"};
}
-}
\ No newline at end of file
+}