From 6988fbb82d84d4c6164b8fba06599ed0445c00c5 Mon Sep 17 00:00:00 2001 From: marination Date: Thu, 13 Aug 2020 12:17:13 +0530 Subject: [PATCH 1/5] fix: Validate or Set Loan Amount first --- .../doctype/loan_application/loan_application.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/loan_management/doctype/loan_application/loan_application.py b/erpnext/loan_management/doctype/loan_application/loan_application.py index f051755f67..4ea6f92a6a 100644 --- a/erpnext/loan_management/doctype/loan_application/loan_application.py +++ b/erpnext/loan_management/doctype/loan_application/loan_application.py @@ -16,14 +16,15 @@ from six import string_types class LoanApplication(Document): def validate(self): + self.set_loan_amount() + self.validate_loan_amount() validate_repayment_method(self.repayment_method, self.loan_amount, self.repayment_amount, self.repayment_periods, self.is_term_loan) self.validate_loan_type() self.set_pledge_amount() - self.set_loan_amount() - self.validate_loan_amount() + self.get_repayment_details() self.check_sanctioned_amount_limit() From 8264fcd0a53c4261d8836f171f7aa055471185f0 Mon Sep 17 00:00:00 2001 From: marination Date: Thu, 13 Aug 2020 12:47:34 +0530 Subject: [PATCH 2/5] fix: Only validate repayment if term loan --- .../doctype/loan_application/loan_application.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/loan_management/doctype/loan_application/loan_application.py b/erpnext/loan_management/doctype/loan_application/loan_application.py index 4ea6f92a6a..93446a08bd 100644 --- a/erpnext/loan_management/doctype/loan_application/loan_application.py +++ b/erpnext/loan_management/doctype/loan_application/loan_application.py @@ -19,8 +19,9 @@ class LoanApplication(Document): self.set_loan_amount() self.validate_loan_amount() - validate_repayment_method(self.repayment_method, self.loan_amount, self.repayment_amount, - self.repayment_periods, self.is_term_loan) + if self.is_term_loan: + validate_repayment_method(self.repayment_method, self.loan_amount, self.repayment_amount, + self.repayment_periods, self.is_term_loan) self.validate_loan_type() self.set_pledge_amount() From a647bef68240d11c9d560a49a7f54fa5d5f84d0c Mon Sep 17 00:00:00 2001 From: bhavesh95863 <34086262+bhavesh95863@users.noreply.github.com> Date: Thu, 13 Aug 2020 17:41:55 +0530 Subject: [PATCH 3/5] fix: warehouse mandatory even update stock uncheck (#23023) --- erpnext/accounts/doctype/pos_profile/pos_profile.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.json b/erpnext/accounts/doctype/pos_profile/pos_profile.json index 454c598d63..d4c1791789 100644 --- a/erpnext/accounts/doctype/pos_profile/pos_profile.json +++ b/erpnext/accounts/doctype/pos_profile/pos_profile.json @@ -302,10 +302,10 @@ "fieldname": "warehouse", "fieldtype": "Link", "label": "Warehouse", + "mandatory_depends_on": "update_stock", "oldfieldname": "warehouse", "oldfieldtype": "Link", - "options": "Warehouse", - "reqd": 1 + "options": "Warehouse" }, { "default": "0", @@ -350,4 +350,4 @@ ], "sort_field": "modified", "sort_order": "DESC" -} \ No newline at end of file +} From 1151f888baf399b7125619c2cc8b82553aef7867 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Thu, 13 Aug 2020 18:52:23 +0530 Subject: [PATCH 4/5] fix: Set pledge amount before setting loan amount --- .../doctype/loan_application/loan_application.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/loan_management/doctype/loan_application/loan_application.py b/erpnext/loan_management/doctype/loan_application/loan_application.py index 93446a08bd..71773f1459 100644 --- a/erpnext/loan_management/doctype/loan_application/loan_application.py +++ b/erpnext/loan_management/doctype/loan_application/loan_application.py @@ -16,6 +16,7 @@ from six import string_types class LoanApplication(Document): def validate(self): + self.set_pledge_amount() self.set_loan_amount() self.validate_loan_amount() @@ -24,7 +25,6 @@ class LoanApplication(Document): self.repayment_periods, self.is_term_loan) self.validate_loan_type() - self.set_pledge_amount() self.get_repayment_details() self.check_sanctioned_amount_limit() @@ -108,7 +108,7 @@ class LoanApplication(Document): if self.is_secured_loan and self.proposed_pledges: self.maximum_loan_amount = 0 for security in self.proposed_pledges: - self.maximum_loan_amount += security.post_haircut_amount + self.maximum_loan_amount += flt(security.post_haircut_amount) if not self.loan_amount and self.is_secured_loan and self.proposed_pledges: self.loan_amount = self.maximum_loan_amount From d7d92c520eed44e8fa0a8a51782e177da6657693 Mon Sep 17 00:00:00 2001 From: Afshan <33727827+AfshanKhan@users.noreply.github.com> Date: Thu, 13 Aug 2020 19:40:09 +0530 Subject: [PATCH 5/5] fix: removed code relating to standard working hours (#23009) --- erpnext/projects/doctype/timesheet/timesheet.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js index 5de2930c1c..607c3fd974 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.js +++ b/erpnext/projects/doctype/timesheet/timesheet.js @@ -94,13 +94,6 @@ frappe.ui.form.on("Timesheet", { } }, - company: function(frm) { - frappe.db.get_value('Company', { 'company_name' : frm.doc.company }, 'standard_working_hours') - .then(({ message }) => { - (frappe.working_hours = message.standard_working_hours || 0); - }); - }, - make_invoice: function(frm) { let dialog = new frappe.ui.Dialog({ title: __("Select Item (optional)"),