Merge branch 'develop' of https://github.com/frappe/erpnext into accounting_dimension_filters

This commit is contained in:
Deepesh Garg
2021-01-04 14:24:00 +05:30
6 changed files with 27 additions and 20 deletions

View File

@@ -267,6 +267,8 @@ class POSInvoice(SalesInvoice):
from erpnext.stock.get_item_details import get_pos_profile_item_details, get_pos_profile from erpnext.stock.get_item_details import get_pos_profile_item_details, get_pos_profile
if not self.pos_profile: if not self.pos_profile:
pos_profile = get_pos_profile(self.company) or {} pos_profile = get_pos_profile(self.company) or {}
if not pos_profile:
frappe.throw(_("No POS Profile found. Please create a New POS Profile first"))
self.pos_profile = pos_profile.get('name') self.pos_profile = pos_profile.get('name')
profile = {} profile = {}

View File

@@ -111,13 +111,14 @@
], ],
"is_submittable": 1, "is_submittable": 1,
"links": [], "links": [],
"modified": "2020-12-17 16:27:20.311060", "modified": "2020-12-31 16:43:30.695206",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Leave Policy Assignment", "name": "Leave Policy Assignment",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
"cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
@@ -131,6 +132,7 @@
"write": 1 "write": 1
}, },
{ {
"cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,
@@ -144,6 +146,7 @@
"write": 1 "write": 1
}, },
{ {
"cancel": 1,
"create": 1, "create": 1,
"delete": 1, "delete": 1,
"email": 1, "email": 1,

View File

@@ -1,7 +1,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import frappe import frappe
from frappe import _ from frappe import _
from frappe.utils import nowdate from frappe.utils import nowdate, flt
from erpnext.accounts.doctype.account.test_account import create_account from erpnext.accounts.doctype.account.test_account import create_account
from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import process_loan_interest_accrual_for_term_loans from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import process_loan_interest_accrual_for_term_loans
from erpnext.loan_management.doctype.loan.loan import make_repayment_entry from erpnext.loan_management.doctype.loan.loan import make_repayment_entry
@@ -113,15 +113,15 @@ def execute():
interest_paid = 0 interest_paid = 0
principal_paid = 0 principal_paid = 0
if total_interest > entry.interest_amount: if flt(total_interest) > flt(entry.interest_amount):
interest_paid = entry.interest_amount interest_paid = flt(entry.interest_amount)
else: else:
interest_paid = total_interest interest_paid = flt(total_interest)
if total_principal > entry.payable_principal_amount: if flt(total_principal) > flt(entry.payable_principal_amount):
principal_paid = entry.payable_principal_amount principal_paid = flt(entry.payable_principal_amount)
else: else:
principal_paid = total_principal principal_paid = flt(total_principal)
frappe.db.sql(""" UPDATE `tabLoan Interest Accrual` frappe.db.sql(""" UPDATE `tabLoan Interest Accrual`
SET paid_principal_amount = `paid_principal_amount` + %s, SET paid_principal_amount = `paid_principal_amount` + %s,
@@ -129,8 +129,8 @@ def execute():
WHERE name = %s""", WHERE name = %s""",
(principal_paid, interest_paid, entry.name)) (principal_paid, interest_paid, entry.name))
total_principal -= principal_paid total_principal = flt(total_principal) - principal_paid
total_interest -= interest_paid total_interest = flt(total_interest) - interest_paid
def create_loan_type(loan, loan_type_name, penalty_account): def create_loan_type(loan, loan_type_name, penalty_account):
loan_type_doc = frappe.new_doc('Loan Type') loan_type_doc = frappe.new_doc('Loan Type')

View File

@@ -214,14 +214,16 @@ frappe.ui.form.on('Salary Slip Timesheet', {
}); });
var calculate_totals = function(frm) { var calculate_totals = function(frm) {
if (frm.doc.earnings || frm.doc.deductions) { if (frm.doc.docstatus === 0) {
frappe.call({ if (frm.doc.earnings || frm.doc.deductions) {
method: "set_totals", frappe.call({
doc: frm.doc, method: "set_totals",
callback: function() { doc: frm.doc,
frm.refresh_fields(); callback: function() {
} frm.refresh_fields();
}); }
});
}
} }
}; };

View File

@@ -43,7 +43,7 @@ class SalaryStructureAssignment(Document):
def set_payroll_payable_account(self): def set_payroll_payable_account(self):
if not self.payroll_payable_account: if not self.payroll_payable_account:
payroll_payable_account = frappe.db.get_value('Company', self.company, 'default_payable_account') payroll_payable_account = frappe.db.get_value('Company', self.company, 'default_payroll_payable_account')
if not payroll_payable_account: if not payroll_payable_account:
payroll_payable_account = frappe.db.get_value( payroll_payable_account = frappe.db.get_value(
"Account", { "Account", {

View File

@@ -88,7 +88,7 @@ def get_party_details(address_name):
gstin = address.get('gstin') gstin = address.get('gstin')
gstin_details = get_gstin_details(gstin) gstin_details = get_gstin_details(gstin)
legal_name = gstin_details.get('LegalName') legal_name = gstin_details.get('LegalName') or gstin_details.get('TradeName')
location = gstin_details.get('AddrLoc') or address.get('city') location = gstin_details.get('AddrLoc') or address.get('city')
state_code = gstin_details.get('StateCode') state_code = gstin_details.get('StateCode')
pincode = gstin_details.get('AddrPncd') pincode = gstin_details.get('AddrPncd')