mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 21:19:19 +00:00
Merge branch 'hotfix'
This commit is contained in:
@@ -5,7 +5,7 @@ import frappe
|
|||||||
from erpnext.hooks import regional_overrides
|
from erpnext.hooks import regional_overrides
|
||||||
from frappe.utils import getdate
|
from frappe.utils import getdate
|
||||||
|
|
||||||
__version__ = '11.1.23'
|
__version__ = '11.1.24'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
|||||||
@@ -12,6 +12,11 @@ frappe.ui.form.on('Bank Account', {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
frm.set_query("party_type", function() {
|
||||||
|
return {
|
||||||
|
query: "erpnext.setup.doctype.party_type.party_type.get_party_type",
|
||||||
|
};
|
||||||
|
});
|
||||||
},
|
},
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
frappe.dynamic_link = { doc: frm.doc, fieldname: 'name', doctype: 'Bank Account' }
|
frappe.dynamic_link = { doc: frm.doc, fieldname: 'name', doctype: 'Bank Account' }
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
"allow_events_in_timeline": 0,
|
"allow_events_in_timeline": 0,
|
||||||
"allow_guest_to_view": 0,
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 0,
|
"allow_import": 1,
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
"autoname": "",
|
"autoname": "",
|
||||||
"beta": 0,
|
"beta": 0,
|
||||||
@@ -975,7 +975,7 @@
|
|||||||
"email": 1,
|
"email": 1,
|
||||||
"export": 1,
|
"export": 1,
|
||||||
"if_owner": 0,
|
"if_owner": 0,
|
||||||
"import": 0,
|
"import": 1,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print": 1,
|
"print": 1,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Bank Transaction', {
|
frappe.ui.form.on('Bank Transaction', {
|
||||||
onload: function(frm) {
|
onload(frm) {
|
||||||
frm.set_query('payment_document', 'payment_entries', function() {
|
frm.set_query('payment_document', 'payment_entries', function() {
|
||||||
return {
|
return {
|
||||||
"filters": {
|
"filters": {
|
||||||
@@ -12,3 +12,21 @@ frappe.ui.form.on('Bank Transaction', {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
frappe.ui.form.on('Bank Transaction Payments', {
|
||||||
|
payment_entries_remove: function(frm, cdt, cdn) {
|
||||||
|
update_clearance_date(frm, cdt, cdn);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const update_clearance_date = (frm, cdt, cdn) => {
|
||||||
|
if (frm.doc.docstatus === 1) {
|
||||||
|
frappe.xcall('erpnext.accounts.doctype.bank_transaction.bank_transaction.unclear_reference_payment',
|
||||||
|
{doctype: cdt, docname: cdn})
|
||||||
|
.then(e => {
|
||||||
|
if (e == "success") {
|
||||||
|
frappe.show_alert({message:__("Document {0} successfully uncleared", [e]), indicator:'green'});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -131,11 +131,11 @@
|
|||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_global_search": 0,
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 1,
|
||||||
"label": "Status",
|
"label": "Status",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"options": "\nPending\nSettled",
|
"options": "\nPending\nSettled\nUnreconciled\nReconciled",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
@@ -165,7 +165,7 @@
|
|||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_global_search": 0,
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 1,
|
||||||
"label": "Bank Account",
|
"label": "Bank Account",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -201,7 +201,7 @@
|
|||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_global_search": 0,
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 1,
|
||||||
"label": "Company",
|
"label": "Company",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -588,8 +588,8 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fetch_if_empty": 0,
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_17",
|
"fieldname": "section_break_18",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
@@ -645,39 +645,6 @@
|
|||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "unallocated_amount",
|
|
||||||
"fieldtype": "Currency",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Unallocated Amount",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
"allow_in_quick_entry": 0,
|
"allow_in_quick_entry": 0,
|
||||||
@@ -710,6 +677,72 @@
|
|||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "column_break_17",
|
||||||
|
"fieldtype": "Column Break",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"depends_on": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "unallocated_amount",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Unallocated Amount",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
"has_web_view": 0,
|
||||||
@@ -722,7 +755,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2019-03-22 10:52:04.540756",
|
"modified": "2019-04-26 14:32:16.437813",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Bank Transaction",
|
"name": "Bank Transaction",
|
||||||
|
|||||||
@@ -1,19 +1,32 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.model.document import Document
|
from erpnext.controllers.status_updater import StatusUpdater
|
||||||
from frappe.utils import flt
|
from frappe.utils import flt
|
||||||
from six.moves import reduce
|
from six.moves import reduce
|
||||||
|
from frappe import _
|
||||||
|
|
||||||
class BankTransaction(Document):
|
class BankTransaction(StatusUpdater):
|
||||||
def after_insert(self):
|
def after_insert(self):
|
||||||
self.unallocated_amount = abs(flt(self.credit) - flt(self.debit))
|
self.unallocated_amount = abs(flt(self.credit) - flt(self.debit))
|
||||||
|
|
||||||
|
def on_submit(self):
|
||||||
|
self.clear_linked_payment_entries()
|
||||||
|
self.set_status()
|
||||||
|
|
||||||
def on_update_after_submit(self):
|
def on_update_after_submit(self):
|
||||||
|
self.update_allocations()
|
||||||
|
self.clear_linked_payment_entries()
|
||||||
|
self.set_status(update=True)
|
||||||
|
|
||||||
|
def update_allocations(self):
|
||||||
|
if self.payment_entries:
|
||||||
allocated_amount = reduce(lambda x, y: flt(x) + flt(y), [x.allocated_amount for x in self.payment_entries])
|
allocated_amount = reduce(lambda x, y: flt(x) + flt(y), [x.allocated_amount for x in self.payment_entries])
|
||||||
|
else:
|
||||||
|
allocated_amount = 0
|
||||||
|
|
||||||
if allocated_amount:
|
if allocated_amount:
|
||||||
frappe.db.set_value(self.doctype, self.name, "allocated_amount", flt(allocated_amount))
|
frappe.db.set_value(self.doctype, self.name, "allocated_amount", flt(allocated_amount))
|
||||||
@@ -24,3 +37,66 @@ class BankTransaction(Document):
|
|||||||
frappe.db.set_value(self.doctype, self.name, "unallocated_amount", abs(flt(self.credit) - flt(self.debit)))
|
frappe.db.set_value(self.doctype, self.name, "unallocated_amount", abs(flt(self.credit) - flt(self.debit)))
|
||||||
|
|
||||||
self.reload()
|
self.reload()
|
||||||
|
|
||||||
|
def clear_linked_payment_entries(self):
|
||||||
|
for payment_entry in self.payment_entries:
|
||||||
|
allocated_amount = get_total_allocated_amount(payment_entry)
|
||||||
|
paid_amount = get_paid_amount(payment_entry)
|
||||||
|
|
||||||
|
if paid_amount and allocated_amount:
|
||||||
|
if flt(allocated_amount[0]["allocated_amount"]) > flt(paid_amount):
|
||||||
|
frappe.throw(_("The total allocated amount ({0}) is greated than the paid amount ({1}).".format(flt(allocated_amount[0]["allocated_amount"]), flt(paid_amount))))
|
||||||
|
elif flt(allocated_amount[0]["allocated_amount"]) == flt(paid_amount):
|
||||||
|
if payment_entry.payment_document in ["Payment Entry", "Journal Entry", "Purchase Invoice", "Expense Claim"]:
|
||||||
|
self.clear_simple_entry(payment_entry)
|
||||||
|
|
||||||
|
elif payment_entry.payment_document == "Sales Invoice":
|
||||||
|
self.clear_sales_invoice(payment_entry)
|
||||||
|
|
||||||
|
def clear_simple_entry(self, payment_entry):
|
||||||
|
frappe.db.set_value(payment_entry.payment_document, payment_entry.payment_entry, "clearance_date", self.date)
|
||||||
|
|
||||||
|
def clear_sales_invoice(self, payment_entry):
|
||||||
|
frappe.db.set_value("Sales Invoice Payment", dict(parenttype=payment_entry.payment_document,
|
||||||
|
parent=payment_entry.payment_entry), "clearance_date", self.date)
|
||||||
|
|
||||||
|
def get_total_allocated_amount(payment_entry):
|
||||||
|
return frappe.db.sql("""
|
||||||
|
SELECT
|
||||||
|
SUM(btp.allocated_amount) as allocated_amount,
|
||||||
|
bt.name
|
||||||
|
FROM
|
||||||
|
`tabBank Transaction Payments` as btp
|
||||||
|
LEFT JOIN
|
||||||
|
`tabBank Transaction` bt ON bt.name=btp.parent
|
||||||
|
WHERE
|
||||||
|
btp.payment_document = %s
|
||||||
|
AND
|
||||||
|
btp.payment_entry = %s
|
||||||
|
AND
|
||||||
|
bt.docstatus = 1""", (payment_entry.payment_document, payment_entry.payment_entry), as_dict=True)
|
||||||
|
|
||||||
|
def get_paid_amount(payment_entry):
|
||||||
|
if payment_entry.payment_document in ["Payment Entry", "Sales Invoice", "Purchase Invoice"]:
|
||||||
|
return frappe.db.get_value(payment_entry.payment_document, payment_entry.payment_entry, "paid_amount")
|
||||||
|
|
||||||
|
elif payment_entry.payment_document == "Journal Entry":
|
||||||
|
return frappe.db.get_value(payment_entry.payment_document, payment_entry.payment_entry, "total_credit")
|
||||||
|
|
||||||
|
elif payment_entry.payment_document == "Expense Claim":
|
||||||
|
return frappe.db.get_value(payment_entry.payment_document, payment_entry.payment_entry, "total_amount_reimbursed")
|
||||||
|
|
||||||
|
else:
|
||||||
|
frappe.throw("Please reconcile {0}: {1} manually".format(payment_entry.payment_document, payment_entry.payment_entry))
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def unclear_reference_payment(doctype, docname):
|
||||||
|
if frappe.db.exists(doctype, docname):
|
||||||
|
doc = frappe.get_doc(doctype, docname)
|
||||||
|
if doctype == "Sales Invoice":
|
||||||
|
frappe.db.set_value("Sales Invoice Payment", dict(parenttype=doc.payment_document,
|
||||||
|
parent=doc.payment_entry), "clearance_date", None)
|
||||||
|
else:
|
||||||
|
frappe.db.set_value(doc.payment_document, doc.payment_entry, "clearance_date", None)
|
||||||
|
|
||||||
|
return doc.payment_entry
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ frappe.listview_settings['Bank Transaction'] = {
|
|||||||
get_indicator: function(doc) {
|
get_indicator: function(doc) {
|
||||||
if(flt(doc.unallocated_amount)>0) {
|
if(flt(doc.unallocated_amount)>0) {
|
||||||
return [__("Unreconciled"), "orange", "unallocated_amount,>,0"];
|
return [__("Unreconciled"), "orange", "unallocated_amount,>,0"];
|
||||||
} else if(flt(doc.unallocated_amount)===0) {
|
} else if(flt(doc.unallocated_amount)<=0) {
|
||||||
return [__("Reconciled"), "green", "unallocated_amount,=,0"];
|
return [__("Reconciled"), "green", "unallocated_amount,=,0"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ def upload_bank_statement():
|
|||||||
def create_bank_entries(columns, data, bank_account):
|
def create_bank_entries(columns, data, bank_account):
|
||||||
header_map = get_header_mapping(columns, bank_account)
|
header_map = get_header_mapping(columns, bank_account)
|
||||||
|
|
||||||
count = 0
|
success = 0
|
||||||
|
errors = 0
|
||||||
for d in json.loads(data):
|
for d in json.loads(data):
|
||||||
if all(item is None for item in d) is True:
|
if all(item is None for item in d) is True:
|
||||||
continue
|
continue
|
||||||
@@ -44,7 +45,6 @@ def create_bank_entries(columns, data, bank_account):
|
|||||||
for key, value in iteritems(header_map):
|
for key, value in iteritems(header_map):
|
||||||
fields.update({key: d[int(value)-1]})
|
fields.update({key: d[int(value)-1]})
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
bank_transaction = frappe.get_doc({
|
bank_transaction = frappe.get_doc({
|
||||||
"doctype": "Bank Transaction"
|
"doctype": "Bank Transaction"
|
||||||
@@ -54,12 +54,12 @@ def create_bank_entries(columns, data, bank_account):
|
|||||||
bank_transaction.bank_account = bank_account
|
bank_transaction.bank_account = bank_account
|
||||||
bank_transaction.insert()
|
bank_transaction.insert()
|
||||||
bank_transaction.submit()
|
bank_transaction.submit()
|
||||||
count = count + 1
|
success += 1
|
||||||
except Exception as e:
|
except Exception:
|
||||||
frappe.throw(e)
|
|
||||||
frappe.log_error(frappe.get_traceback())
|
frappe.log_error(frappe.get_traceback())
|
||||||
|
errors += 1
|
||||||
|
|
||||||
return count
|
return {"success": success, "errors": errors}
|
||||||
|
|
||||||
def get_header_mapping(columns, bank_account):
|
def get_header_mapping(columns, bank_account):
|
||||||
mapping = get_bank_mapping(bank_account)
|
mapping = get_bank_mapping(bank_account)
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ erpnext.accounts.bankTransactionUpload = class bankTransactionUpload {
|
|||||||
frappe.xcall('erpnext.accounts.doctype.bank_transaction.bank_transaction_upload.create_bank_entries',
|
frappe.xcall('erpnext.accounts.doctype.bank_transaction.bank_transaction_upload.create_bank_entries',
|
||||||
{columns: this.datatable.datamanager.columns, data: this.datatable.datamanager.data, bank_account: me.parent.bank_account}
|
{columns: this.datatable.datamanager.columns, data: this.datatable.datamanager.data, bank_account: me.parent.bank_account}
|
||||||
).then((result) => {
|
).then((result) => {
|
||||||
let result_title = __("{0} bank transaction(s) created", [result])
|
let result_title = result.errors == 0 ? __("{0} bank transaction(s) created", [result.success]) : __("{0} bank transaction(s) created and {1} errors", [result.success, result.errors])
|
||||||
let result_msg = `
|
let result_msg = `
|
||||||
<div class="flex justify-center align-center text-muted" style="height: 50vh; display: flex;">
|
<div class="flex justify-center align-center text-muted" style="height: 50vh; display: flex;">
|
||||||
<h5 class="text-muted">${result_title}</h5>
|
<h5 class="text-muted">${result_title}</h5>
|
||||||
@@ -199,7 +199,11 @@ erpnext.accounts.bankTransactionUpload = class bankTransactionUpload {
|
|||||||
me.parent.page.clear_primary_action();
|
me.parent.page.clear_primary_action();
|
||||||
me.parent.$main_section.empty();
|
me.parent.$main_section.empty();
|
||||||
me.parent.$main_section.append(result_msg);
|
me.parent.$main_section.append(result_msg);
|
||||||
|
if (result.errors == 0) {
|
||||||
frappe.show_alert({message:__("All bank transactions have been created"), indicator:'green'});
|
frappe.show_alert({message:__("All bank transactions have been created"), indicator:'green'});
|
||||||
|
} else {
|
||||||
|
frappe.show_alert({message:__("Please check the error log for details about the import errors"), indicator:'red'});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -530,11 +534,13 @@ erpnext.accounts.ReconciliationRow = class ReconciliationRow {
|
|||||||
.then(doc => {
|
.then(doc => {
|
||||||
let displayed_docs = []
|
let displayed_docs = []
|
||||||
if (dt === "Payment Entry") {
|
if (dt === "Payment Entry") {
|
||||||
doc.currency = doc.payment_type == "Receive" ? doc.paid_to_account_currency : doc.paid_from_account_currency;
|
payment.currency = doc.payment_type == "Receive" ? doc.paid_to_account_currency : doc.paid_from_account_currency;
|
||||||
displayed_docs.push(doc);
|
payment.doctype = dt
|
||||||
|
displayed_docs.push(payment);
|
||||||
} else if (dt === "Journal Entry") {
|
} else if (dt === "Journal Entry") {
|
||||||
doc.accounts.forEach(payment => {
|
doc.accounts.forEach(payment => {
|
||||||
if (payment.account === me.gl_account) {
|
if (payment.account === me.gl_account) {
|
||||||
|
payment.doctype = dt;
|
||||||
payment.posting_date = doc.posting_date;
|
payment.posting_date = doc.posting_date;
|
||||||
payment.party = doc.pay_to_recd_from;
|
payment.party = doc.pay_to_recd_from;
|
||||||
payment.reference_no = doc.cheque_no;
|
payment.reference_no = doc.cheque_no;
|
||||||
@@ -548,6 +554,7 @@ erpnext.accounts.ReconciliationRow = class ReconciliationRow {
|
|||||||
} else if (dt === "Sales Invoice") {
|
} else if (dt === "Sales Invoice") {
|
||||||
doc.payments.forEach(payment => {
|
doc.payments.forEach(payment => {
|
||||||
if (payment.clearance_date === null || payment.clearance_date === "") {
|
if (payment.clearance_date === null || payment.clearance_date === "") {
|
||||||
|
payment.doctype = dt;
|
||||||
payment.posting_date = doc.posting_date;
|
payment.posting_date = doc.posting_date;
|
||||||
payment.party = doc.customer;
|
payment.party = doc.customer;
|
||||||
payment.reference_no = doc.remarks;
|
payment.reference_no = doc.remarks;
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ def reconcile(bank_transaction, payment_doctype, payment_name):
|
|||||||
frappe.throw(_("The selected payment entry should be linked with a creditor bank transaction"))
|
frappe.throw(_("The selected payment entry should be linked with a creditor bank transaction"))
|
||||||
|
|
||||||
add_payment_to_transaction(transaction, payment_entry, gl_entry)
|
add_payment_to_transaction(transaction, payment_entry, gl_entry)
|
||||||
clear_payment_entry(transaction, payment_entry, gl_entry)
|
|
||||||
|
|
||||||
return 'reconciled'
|
return 'reconciled'
|
||||||
|
|
||||||
@@ -42,40 +41,6 @@ def add_payment_to_transaction(transaction, payment_entry, gl_entry):
|
|||||||
})
|
})
|
||||||
transaction.save()
|
transaction.save()
|
||||||
|
|
||||||
def clear_payment_entry(transaction, payment_entry, gl_entry):
|
|
||||||
linked_bank_transactions = frappe.db.sql("""
|
|
||||||
SELECT
|
|
||||||
bt.credit, bt.debit
|
|
||||||
FROM
|
|
||||||
`tabBank Transaction Payments` as btp
|
|
||||||
LEFT JOIN
|
|
||||||
`tabBank Transaction` as bt on btp.parent=bt.name
|
|
||||||
WHERE
|
|
||||||
btp.payment_document = %s
|
|
||||||
AND
|
|
||||||
btp.payment_entry = %s
|
|
||||||
AND
|
|
||||||
bt.docstatus = 1
|
|
||||||
""", (payment_entry.doctype, payment_entry.name), as_dict=True)
|
|
||||||
|
|
||||||
amount_cleared = (flt(linked_bank_transactions[0].credit) - flt(linked_bank_transactions[0].debit))
|
|
||||||
amount_to_be_cleared = (flt(gl_entry.debit) - flt(gl_entry.credit))
|
|
||||||
|
|
||||||
if payment_entry.doctype in ("Payment Entry", "Journal Entry", "Purchase Invoice", "Expense Claim"):
|
|
||||||
clear_simple_entry(amount_cleared, amount_to_be_cleared, payment_entry, transaction)
|
|
||||||
|
|
||||||
elif payment_entry.doctype == "Sales Invoice":
|
|
||||||
clear_sales_invoice(amount_cleared, amount_to_be_cleared, payment_entry, transaction)
|
|
||||||
|
|
||||||
def clear_simple_entry(amount_cleared, amount_to_be_cleared, payment_entry, transaction):
|
|
||||||
if amount_cleared >= amount_to_be_cleared:
|
|
||||||
frappe.db.set_value(payment_entry.doctype, payment_entry.name, "clearance_date", transaction.date)
|
|
||||||
|
|
||||||
def clear_sales_invoice(amount_cleared, amount_to_be_cleared, payment_entry, transaction):
|
|
||||||
if amount_cleared >= amount_to_be_cleared:
|
|
||||||
frappe.db.set_value("Sales Invoice Payment", dict(parenttype=payment_entry.doctype,
|
|
||||||
parent=payment_entry.name), "clearance_date", transaction.date)
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_linked_payments(bank_transaction):
|
def get_linked_payments(bank_transaction):
|
||||||
transaction = frappe.get_doc("Bank Transaction", bank_transaction)
|
transaction = frappe.get_doc("Bank Transaction", bank_transaction)
|
||||||
@@ -250,7 +215,7 @@ def get_matching_descriptions_data(company, transaction):
|
|||||||
if key == "Payment Entry":
|
if key == "Payment Entry":
|
||||||
data.extend(frappe.get_all("Payment Entry", filters=[["name", "in", value]], fields=["'Payment Entry' as doctype", "posting_date", "party", "reference_no", "reference_date", "paid_amount", "paid_to_account_currency as currency"]))
|
data.extend(frappe.get_all("Payment Entry", filters=[["name", "in", value]], fields=["'Payment Entry' as doctype", "posting_date", "party", "reference_no", "reference_date", "paid_amount", "paid_to_account_currency as currency"]))
|
||||||
if key == "Journal Entry":
|
if key == "Journal Entry":
|
||||||
journal_entries = frappe.get_all("Journal Entry", filters=[["name", "in", value]], fields=["name", "'Journal Entry' as doctype", "posting_date", "paid_to_recd_from as party", "cheque_no as reference_no", "cheque_date as reference_date", "total_credit as paid_amount"])
|
journal_entries = frappe.get_all("Journal Entry", filters=[["name", "in", value]], fields=["name", "'Journal Entry' as doctype", "posting_date", "pay_to_recd_from as party", "cheque_no as reference_no", "cheque_date as reference_date", "total_credit as paid_amount"])
|
||||||
for journal_entry in journal_entries:
|
for journal_entry in journal_entries:
|
||||||
journal_entry_accounts = frappe.get_all("Journal Entry Account", filters={"parenttype": journal_entry["doctype"], "parent": journal_entry["name"]}, fields=["account_currency"])
|
journal_entry_accounts = frappe.get_all("Journal Entry Account", filters={"parenttype": journal_entry["doctype"], "parent": journal_entry["name"]}, fields=["account_currency"])
|
||||||
journal_entry["currency"] = journal_entry_accounts[0]["account_currency"] if journal_entry_accounts else company_currency
|
journal_entry["currency"] = journal_entry_accounts[0]["account_currency"] if journal_entry_accounts else company_currency
|
||||||
|
|||||||
@@ -95,6 +95,10 @@ status_map = {
|
|||||||
["Ordered", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Purchase'"],
|
["Ordered", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Purchase'"],
|
||||||
["Transferred", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Transfer'"],
|
["Transferred", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Transfer'"],
|
||||||
["Issued", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Issue'"]
|
["Issued", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Issue'"]
|
||||||
|
],
|
||||||
|
"Bank Transaction": [
|
||||||
|
["Unreconciled", "eval:self.docstatus == 1 and self.unallocated_amount>0"],
|
||||||
|
["Reconciled", "eval:self.docstatus == 1 and self.unallocated_amount<=0"]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ scheduler_events = {
|
|||||||
"daily_long": [
|
"daily_long": [
|
||||||
"erpnext.manufacturing.doctype.bom_update_tool.bom_update_tool.update_latest_price_in_all_boms"
|
"erpnext.manufacturing.doctype.bom_update_tool.bom_update_tool.update_latest_price_in_all_boms"
|
||||||
],
|
],
|
||||||
"monthly": [
|
"monthly_long": [
|
||||||
"erpnext.accounts.deferred_revenue.convert_deferred_revenue_to_income",
|
"erpnext.accounts.deferred_revenue.convert_deferred_revenue_to_income",
|
||||||
"erpnext.accounts.deferred_revenue.convert_deferred_expense_to_expense",
|
"erpnext.accounts.deferred_revenue.convert_deferred_expense_to_expense",
|
||||||
"erpnext.hr.utils.allocate_earned_leaves"
|
"erpnext.hr.utils.allocate_earned_leaves"
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class Employee(NestedSet):
|
|||||||
|
|
||||||
def update_user_permissions(self):
|
def update_user_permissions(self):
|
||||||
if not self.create_user_permission: return
|
if not self.create_user_permission: return
|
||||||
if not has_permission('User Permission', ptype='write'): return
|
if not has_permission('User Permission', ptype='write', raise_exception=False): return
|
||||||
|
|
||||||
employee_user_permission_exists = frappe.db.exists('User Permission', {
|
employee_user_permission_exists = frappe.db.exists('User Permission', {
|
||||||
'allow': 'Employee',
|
'allow': 'Employee',
|
||||||
@@ -237,7 +237,7 @@ def validate_employee_role(doc, method):
|
|||||||
def update_user_permissions(doc, method):
|
def update_user_permissions(doc, method):
|
||||||
# called via User hook
|
# called via User hook
|
||||||
if "Employee" in [d.role for d in doc.get("roles")]:
|
if "Employee" in [d.role for d in doc.get("roles")]:
|
||||||
if not has_permission('User Permission', ptype='write'): return
|
if not has_permission('User Permission', ptype='write', raise_exception=False): return
|
||||||
employee = frappe.get_doc("Employee", {"user_id": doc.name})
|
employee = frappe.get_doc("Employee", {"user_id": doc.name})
|
||||||
employee.update_user_permissions()
|
employee.update_user_permissions()
|
||||||
|
|
||||||
|
|||||||
@@ -177,8 +177,11 @@ def get_benefit_component_amount(employee, start_date, end_date, struct_row, sal
|
|||||||
|
|
||||||
# Considering there is only one application for a year
|
# Considering there is only one application for a year
|
||||||
benefit_application_name = frappe.db.sql("""
|
benefit_application_name = frappe.db.sql("""
|
||||||
select name from `tabEmployee Benefit Application`
|
select name
|
||||||
where payroll_period=%(payroll_period)s and employee=%(employee)s
|
from `tabEmployee Benefit Application`
|
||||||
|
where
|
||||||
|
payroll_period=%(payroll_period)s
|
||||||
|
and employee=%(employee)s
|
||||||
and docstatus = 1
|
and docstatus = 1
|
||||||
""", {
|
""", {
|
||||||
'employee': employee,
|
'employee': employee,
|
||||||
@@ -209,7 +212,8 @@ def get_benefit_pro_rata_ratio_amount(sal_struct, component_max):
|
|||||||
total_pro_rata_max = 0
|
total_pro_rata_max = 0
|
||||||
benefit_amount = 0
|
benefit_amount = 0
|
||||||
for sal_struct_row in sal_struct.get("earnings"):
|
for sal_struct_row in sal_struct.get("earnings"):
|
||||||
pay_against_benefit_claim, max_benefit_amount = frappe.db.get_value("Salary Component", sal_struct_row.salary_component, ["pay_against_benefit_claim", "max_benefit_amount"])
|
pay_against_benefit_claim, max_benefit_amount = frappe.db.get_value("Salary Component",
|
||||||
|
sal_struct_row.salary_component, ["pay_against_benefit_claim", "max_benefit_amount"])
|
||||||
if sal_struct_row.is_flexible_benefit == 1 and pay_against_benefit_claim != 1:
|
if sal_struct_row.is_flexible_benefit == 1 and pay_against_benefit_claim != 1:
|
||||||
total_pro_rata_max += max_benefit_amount
|
total_pro_rata_max += max_benefit_amount
|
||||||
if total_pro_rata_max > 0:
|
if total_pro_rata_max > 0:
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
"in_global_search": 0,
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 0,
|
||||||
"label": "Maximum Exemption Amount",
|
"label": "Maximum Exempted Amount",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fetch_if_empty": 0,
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "amount",
|
"fieldname": "amount",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2019-04-25 15:45:11.279158",
|
"modified": "2019-04-26 11:28:14.023086",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Employee Tax Exemption Declaration Category",
|
"name": "Employee Tax Exemption Declaration Category",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
|
"allow_events_in_timeline": 0,
|
||||||
"allow_guest_to_view": 0,
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "company",
|
"fieldname": "company",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -53,6 +55,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_2",
|
"fieldname": "column_break_2",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -84,6 +87,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "start_date",
|
"fieldname": "start_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -116,6 +120,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "end_date",
|
"fieldname": "end_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -148,6 +153,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_5",
|
"fieldname": "section_break_5",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -180,6 +186,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "periods",
|
"fieldname": "periods",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -213,6 +220,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_7",
|
"fieldname": "section_break_7",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -245,6 +253,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "taxable_salary_slabs",
|
"fieldname": "taxable_salary_slabs",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -270,6 +279,39 @@
|
|||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "standard_tax_exemption_amount",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Standard Tax Exemption Amount",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
"has_web_view": 0,
|
||||||
@@ -282,7 +324,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-05-25 12:29:07.207927",
|
"modified": "2019-04-26 01:45:03.160929",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Payroll Period",
|
"name": "Payroll Period",
|
||||||
@@ -354,5 +396,6 @@
|
|||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"track_changes": 1,
|
"track_changes": 1,
|
||||||
"track_seen": 0
|
"track_seen": 0,
|
||||||
|
"track_views": 0
|
||||||
}
|
}
|
||||||
@@ -5,10 +5,8 @@ frappe.ui.form.on('Salary Component', {
|
|||||||
setup: function(frm) {
|
setup: function(frm) {
|
||||||
frm.set_query("default_account", "accounts", function(doc, cdt, cdn) {
|
frm.set_query("default_account", "accounts", function(doc, cdt, cdn) {
|
||||||
var d = locals[cdt][cdn];
|
var d = locals[cdt][cdn];
|
||||||
var root_types = ["Expense", "Liability"];
|
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
"root_type": ["in", root_types],
|
|
||||||
"is_group": 0,
|
"is_group": 0,
|
||||||
"company": d.company
|
"company": d.company
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class SalarySlip(TransactionBase):
|
|||||||
for d in self.get("earnings"):
|
for d in self.get("earnings"):
|
||||||
if d.is_flexible_benefit == 1:
|
if d.is_flexible_benefit == 1:
|
||||||
current_flexi_amount += d.amount
|
current_flexi_amount += d.amount
|
||||||
last_benefits = get_last_payroll_period_benefits(self.employee, self.start_date, self.end_date,\
|
last_benefits = get_last_payroll_period_benefits(self.employee, self.start_date, self.end_date,
|
||||||
current_flexi_amount, payroll_period, self._salary_structure_doc)
|
current_flexi_amount, payroll_period, self._salary_structure_doc)
|
||||||
if last_benefits:
|
if last_benefits:
|
||||||
for last_benefit in last_benefits:
|
for last_benefit in last_benefits:
|
||||||
@@ -418,7 +418,7 @@ class SalarySlip(TransactionBase):
|
|||||||
|
|
||||||
for d in self.get(component_type):
|
for d in self.get(component_type):
|
||||||
if (self.salary_structure and
|
if (self.salary_structure and
|
||||||
cint(d.depends_on_payment_days) and
|
cint(d.depends_on_payment_days) and cint(self.total_working_days) and
|
||||||
(not
|
(not
|
||||||
self.salary_slip_based_on_timesheet or
|
self.salary_slip_based_on_timesheet or
|
||||||
getdate(self.start_date) < joining_date or
|
getdate(self.start_date) < joining_date or
|
||||||
@@ -574,8 +574,8 @@ class SalarySlip(TransactionBase):
|
|||||||
|
|
||||||
def calculate_variable_tax(self, tax_component, payroll_period):
|
def calculate_variable_tax(self, tax_component, payroll_period):
|
||||||
annual_taxable_earning, period_factor = 0, 0
|
annual_taxable_earning, period_factor = 0, 0
|
||||||
pro_rata_tax_paid, additional_tax_paid, benefit_tax_paid = 0, 0, 0
|
pro_rata_tax_paid, additional_tax_paid, benefit_tax_paid = 0.0, 0.0, 0.0
|
||||||
unclaimed_earning, unclaimed_benefit, additional_income = 0, 0, 0
|
unclaimed_earning, unclaimed_benefit, additional_income = 0.0, 0.0, 0.0
|
||||||
|
|
||||||
# get taxable_earning, additional_income in this slip
|
# get taxable_earning, additional_income in this slip
|
||||||
taxable_earning = self.get_taxable_earnings()
|
taxable_earning = self.get_taxable_earnings()
|
||||||
@@ -604,6 +604,7 @@ class SalarySlip(TransactionBase):
|
|||||||
{"employee": self.employee, "payroll_period": payroll_period.name, "docstatus": 1},
|
{"employee": self.employee, "payroll_period": payroll_period.name, "docstatus": 1},
|
||||||
"total_exemption_amount")
|
"total_exemption_amount")
|
||||||
annual_taxable_earning = annual_earning - exemption_amount
|
annual_taxable_earning = annual_earning - exemption_amount
|
||||||
|
|
||||||
if self.deduct_tax_for_unclaimed_employee_benefits or self.deduct_tax_for_unsubmitted_tax_exemption_proof:
|
if self.deduct_tax_for_unclaimed_employee_benefits or self.deduct_tax_for_unsubmitted_tax_exemption_proof:
|
||||||
tax_detail = self.get_tax_paid_in_period(payroll_period, tax_component)
|
tax_detail = self.get_tax_paid_in_period(payroll_period, tax_component)
|
||||||
if tax_detail:
|
if tax_detail:
|
||||||
@@ -613,11 +614,17 @@ class SalarySlip(TransactionBase):
|
|||||||
|
|
||||||
# add any additional income in this slip
|
# add any additional income in this slip
|
||||||
additional_income += taxable_earning["additional_income"]
|
additional_income += taxable_earning["additional_income"]
|
||||||
args = {"payroll_period": payroll_period.name, "tax_component": tax_component,
|
args = {
|
||||||
"annual_taxable_earning": annual_taxable_earning, "period_factor": period_factor,
|
"payroll_period": payroll_period.name,
|
||||||
"unclaimed_benefit": unclaimed_benefit, "additional_income": additional_income,
|
"tax_component": tax_component,
|
||||||
"pro_rata_tax_paid": pro_rata_tax_paid, "benefit_tax_paid": benefit_tax_paid,
|
"period_factor": period_factor,
|
||||||
"additional_tax_paid": additional_tax_paid}
|
"annual_taxable_earning": annual_taxable_earning,
|
||||||
|
"additional_income": additional_income,
|
||||||
|
"unclaimed_benefit": unclaimed_benefit,
|
||||||
|
"pro_rata_tax_paid": pro_rata_tax_paid,
|
||||||
|
"benefit_tax_paid": benefit_tax_paid,
|
||||||
|
"additional_tax_paid": additional_tax_paid
|
||||||
|
}
|
||||||
return self.calculate_tax(args)
|
return self.calculate_tax(args)
|
||||||
|
|
||||||
def calculate_unclaimed_taxable_benefit(self, payroll_period):
|
def calculate_unclaimed_taxable_benefit(self, payroll_period):
|
||||||
@@ -664,27 +671,49 @@ class SalarySlip(TransactionBase):
|
|||||||
return total_taxable_earning
|
return total_taxable_earning
|
||||||
|
|
||||||
def get_total_additional_income(self, from_date):
|
def get_total_additional_income(self, from_date):
|
||||||
total_additional_pay = 0
|
sum_additional_earning = frappe.db.sql("""
|
||||||
sum_additional_earning = frappe.db.sql("""select sum(sd.amount) from `tabSalary Detail` sd join
|
select sum(sd.amount)
|
||||||
`tabSalary Slip` ss on sd.parent=ss.name where sd.parentfield='earnings'
|
from
|
||||||
and sd.is_tax_applicable=1 and is_additional_component=1 and is_flexible_benefit=0
|
`tabSalary Detail` sd join `tabSalary Slip` ss on sd.parent=ss.name
|
||||||
and ss.docstatus=1 and ss.employee='{0}' and ss.start_date between '{1}' and '{2}'
|
where
|
||||||
and ss.end_date between '{1}' and '{2}'""".format(self.employee,
|
sd.parentfield='earnings'
|
||||||
from_date, self.start_date))
|
and sd.is_tax_applicable=1 and is_additional_component=1
|
||||||
if sum_additional_earning and sum_additional_earning[0][0]:
|
and is_flexible_benefit=0 and ss.docstatus=1
|
||||||
total_additional_pay = sum_additional_earning[0][0]
|
and ss.employee=%(employee)s
|
||||||
return total_additional_pay
|
and ss.start_date between %(from_date)s and %(to_date)s
|
||||||
|
and ss.end_date between %(from_date)s and %(to_date)s
|
||||||
|
""", {
|
||||||
|
"employee": self.employee,
|
||||||
|
"from_date": from_date,
|
||||||
|
"to_date": self.start_date
|
||||||
|
})
|
||||||
|
return flt(sum_additional_earning[0][0]) if sum_additional_earning else 0
|
||||||
|
|
||||||
def get_tax_paid_in_period(self, payroll_period, tax_component, only_total=False):
|
def get_tax_paid_in_period(self, payroll_period, tax_component, only_total=False):
|
||||||
# find total_tax_paid, tax paid for benefit, additional_salary
|
# find total_tax_paid, tax paid for benefit, additional_salary
|
||||||
sum_tax_paid = frappe.db.sql("""select sum(sd.amount), sum(tax_on_flexible_benefit),
|
sum_tax_paid = frappe.db.sql("""
|
||||||
sum(tax_on_additional_salary) from `tabSalary Detail` sd join `tabSalary Slip`
|
select
|
||||||
ss on sd.parent=ss.name where sd.parentfield='deductions' and sd.salary_component='{3}'
|
sum(sd.amount), sum(tax_on_flexible_benefit), sum(tax_on_additional_salary)
|
||||||
and sd.variable_based_on_taxable_salary=1 and ss.docstatus=1 and ss.employee='{0}'
|
from
|
||||||
and ss.start_date between '{1}' and '{2}' and ss.end_date between '{1}' and
|
`tabSalary Detail` sd join `tabSalary Slip` ss on sd.parent=ss.name
|
||||||
'{2}'""".format(self.employee, payroll_period.start_date, self.start_date, tax_component))
|
where
|
||||||
|
sd.parentfield='deductions' and sd.salary_component=%(salary_component)s
|
||||||
|
and sd.variable_based_on_taxable_salary=1
|
||||||
|
and ss.docstatus=1 and ss.employee=%(employee)s
|
||||||
|
and ss.start_date between %(from_date)s and %(to_date)s
|
||||||
|
and ss.end_date between %(from_date)s and %(to_date)s
|
||||||
|
""", {
|
||||||
|
"salary_component": tax_component,
|
||||||
|
"employee": self.employee,
|
||||||
|
"from_date": payroll_period.start_date,
|
||||||
|
"to_date": self.start_date
|
||||||
|
})
|
||||||
if sum_tax_paid and sum_tax_paid[0][0]:
|
if sum_tax_paid and sum_tax_paid[0][0]:
|
||||||
return {'total_tax_paid': sum_tax_paid[0][0], 'benefit_tax':sum_tax_paid[0][1], 'additional_tax': sum_tax_paid[0][2]}
|
return {
|
||||||
|
'total_tax_paid': sum_tax_paid[0][0],
|
||||||
|
'benefit_tax':sum_tax_paid[0][1],
|
||||||
|
'additional_tax': sum_tax_paid[0][2]
|
||||||
|
}
|
||||||
|
|
||||||
def get_taxable_earnings(self, include_flexi=0, only_flexi=0):
|
def get_taxable_earnings(self, include_flexi=0, only_flexi=0):
|
||||||
taxable_earning = 0
|
taxable_earning = 0
|
||||||
@@ -695,22 +724,22 @@ class SalarySlip(TransactionBase):
|
|||||||
additional_income += earning.amount
|
additional_income += earning.amount
|
||||||
continue
|
continue
|
||||||
if only_flexi:
|
if only_flexi:
|
||||||
if earning.is_tax_applicable and earning.is_flexible_benefit:
|
if earning.is_flexible_benefit:
|
||||||
taxable_earning += earning.amount
|
taxable_earning += earning.amount
|
||||||
continue
|
continue
|
||||||
if include_flexi:
|
if include_flexi or not earning.is_flexible_benefit:
|
||||||
if earning.is_tax_applicable or (earning.is_tax_applicable and earning.is_flexible_benefit):
|
|
||||||
taxable_earning += earning.amount
|
taxable_earning += earning.amount
|
||||||
else:
|
return {
|
||||||
if earning.is_tax_applicable and not earning.is_flexible_benefit:
|
"taxable_earning": taxable_earning,
|
||||||
taxable_earning += earning.amount
|
"additional_income": additional_income
|
||||||
return {"taxable_earning": taxable_earning, "additional_income": additional_income}
|
}
|
||||||
|
|
||||||
def calculate_tax(self, args):
|
def calculate_tax(self, args):
|
||||||
tax_amount, benefit_tax, additional_tax = 0, 0, 0
|
tax_amount, benefit_tax, additional_tax = 0, 0, 0
|
||||||
annual_taxable_earning = args.get("annual_taxable_earning")
|
annual_taxable_earning = args.get("annual_taxable_earning")
|
||||||
benefit_to_tax = args.get("unclaimed_benefit")
|
benefit_to_tax = args.get("unclaimed_benefit")
|
||||||
additional_income = args.get("additional_income")
|
additional_income = args.get("additional_income")
|
||||||
|
|
||||||
# Get tax calc by period
|
# Get tax calc by period
|
||||||
annual_tax = self.calculate_tax_by_tax_slab(args.get("payroll_period"), annual_taxable_earning)
|
annual_tax = self.calculate_tax_by_tax_slab(args.get("payroll_period"), annual_taxable_earning)
|
||||||
|
|
||||||
@@ -741,8 +770,10 @@ class SalarySlip(TransactionBase):
|
|||||||
|
|
||||||
def calculate_tax_by_tax_slab(self, payroll_period, annual_taxable_earning):
|
def calculate_tax_by_tax_slab(self, payroll_period, annual_taxable_earning):
|
||||||
payroll_period_obj = frappe.get_doc("Payroll Period", payroll_period)
|
payroll_period_obj = frappe.get_doc("Payroll Period", payroll_period)
|
||||||
|
annual_taxable_earning -= flt(payroll_period_obj.standard_tax_exemption_amount)
|
||||||
data = self.get_data_for_eval()
|
data = self.get_data_for_eval()
|
||||||
data.update({"annual_taxable_earning": annual_taxable_earning})
|
data.update({"annual_taxable_earning": annual_taxable_earning})
|
||||||
|
|
||||||
taxable_amount = 0
|
taxable_amount = 0
|
||||||
for slab in payroll_period_obj.taxable_salary_slabs:
|
for slab in payroll_period_obj.taxable_salary_slabs:
|
||||||
if slab.condition and not self.eval_tax_slab_condition(slab.condition, data):
|
if slab.condition and not self.eval_tax_slab_condition(slab.condition, data):
|
||||||
|
|||||||
@@ -159,21 +159,21 @@ class TestSalarySlip(unittest.TestCase):
|
|||||||
month = "%02d" % getdate(nowdate()).month
|
month = "%02d" % getdate(nowdate()).month
|
||||||
m = get_month_details(fiscal_year, month)
|
m = get_month_details(fiscal_year, month)
|
||||||
|
|
||||||
for payroll_frequncy in ["Monthly", "Bimonthly", "Fortnightly", "Weekly", "Daily"]:
|
for payroll_frequency in ["Monthly", "Bimonthly", "Fortnightly", "Weekly", "Daily"]:
|
||||||
make_employee(payroll_frequncy + "_test_employee@salary.com")
|
make_employee(payroll_frequency + "_test_employee@salary.com")
|
||||||
ss = make_employee_salary_slip(payroll_frequncy + "_test_employee@salary.com", payroll_frequncy)
|
ss = make_employee_salary_slip(payroll_frequency + "_test_employee@salary.com", payroll_frequency)
|
||||||
if payroll_frequncy == "Monthly":
|
if payroll_frequency == "Monthly":
|
||||||
self.assertEqual(ss.end_date, m['month_end_date'])
|
self.assertEqual(ss.end_date, m['month_end_date'])
|
||||||
elif payroll_frequncy == "Bimonthly":
|
elif payroll_frequency == "Bimonthly":
|
||||||
if getdate(ss.start_date).day <= 15:
|
if getdate(ss.start_date).day <= 15:
|
||||||
self.assertEqual(ss.end_date, m['month_mid_end_date'])
|
self.assertEqual(ss.end_date, m['month_mid_end_date'])
|
||||||
else:
|
else:
|
||||||
self.assertEqual(ss.end_date, m['month_end_date'])
|
self.assertEqual(ss.end_date, m['month_end_date'])
|
||||||
elif payroll_frequncy == "Fortnightly":
|
elif payroll_frequency == "Fortnightly":
|
||||||
self.assertEqual(ss.end_date, add_days(nowdate(),13))
|
self.assertEqual(ss.end_date, add_days(nowdate(),13))
|
||||||
elif payroll_frequncy == "Weekly":
|
elif payroll_frequency == "Weekly":
|
||||||
self.assertEqual(ss.end_date, add_days(nowdate(),6))
|
self.assertEqual(ss.end_date, add_days(nowdate(),6))
|
||||||
elif payroll_frequncy == "Daily":
|
elif payroll_frequency == "Daily":
|
||||||
self.assertEqual(ss.end_date, nowdate())
|
self.assertEqual(ss.end_date, nowdate())
|
||||||
|
|
||||||
def test_tax_for_payroll_period(self):
|
def test_tax_for_payroll_period(self):
|
||||||
|
|||||||
@@ -57,11 +57,12 @@ class SalaryStructure(Document):
|
|||||||
have_a_flexi = True
|
have_a_flexi = True
|
||||||
max_of_component = frappe.db.get_value("Salary Component", earning_component.salary_component, "max_benefit_amount")
|
max_of_component = frappe.db.get_value("Salary Component", earning_component.salary_component, "max_benefit_amount")
|
||||||
flexi_amount += max_of_component
|
flexi_amount += max_of_component
|
||||||
|
|
||||||
if have_a_flexi and flt(self.max_benefits) == 0:
|
if have_a_flexi and flt(self.max_benefits) == 0:
|
||||||
frappe.throw(_("Max benefits should be greater than zero to dispense benefits"))
|
frappe.throw(_("Max benefits should be greater than zero to dispense benefits"))
|
||||||
if have_a_flexi and flt(self.max_benefits) > flexi_amount:
|
if have_a_flexi and flexi_amount and flt(self.max_benefits) > flexi_amount:
|
||||||
frappe.throw(_("Total flexible benefit component amount {0} should not be less \
|
frappe.throw(_("Total flexible benefit component amount {0} should not be less than max benefits {1}")
|
||||||
than max benefits {1}").format(flexi_amount, self.max_benefits))
|
.format(flexi_amount, self.max_benefits))
|
||||||
if not have_a_flexi and flt(self.max_benefits) > 0:
|
if not have_a_flexi and flt(self.max_benefits) > 0:
|
||||||
frappe.throw(_("Salary Structure should have flexible benefit component(s) to dispense benefit amount"))
|
frappe.throw(_("Salary Structure should have flexible benefit component(s) to dispense benefit amount"))
|
||||||
|
|
||||||
|
|||||||
@@ -571,7 +571,7 @@ execute:frappe.delete_doc_if_exists("Page", "sales-analytics")
|
|||||||
execute:frappe.delete_doc_if_exists("Page", "purchase-analytics")
|
execute:frappe.delete_doc_if_exists("Page", "purchase-analytics")
|
||||||
execute:frappe.delete_doc_if_exists("Page", "stock-analytics")
|
execute:frappe.delete_doc_if_exists("Page", "stock-analytics")
|
||||||
execute:frappe.delete_doc_if_exists("Page", "production-analytics")
|
execute:frappe.delete_doc_if_exists("Page", "production-analytics")
|
||||||
erpnext.patches.v11_0.ewaybill_fields_gst_india #2018-11-13 #2019-01-09 #2019-04-01
|
erpnext.patches.v11_0.ewaybill_fields_gst_india #2018-11-13 #2019-01-09 #2019-04-01 #2019-04-26
|
||||||
erpnext.patches.v11_0.drop_column_max_days_allowed
|
erpnext.patches.v11_0.drop_column_max_days_allowed
|
||||||
erpnext.patches.v11_0.change_healthcare_desktop_icons
|
erpnext.patches.v11_0.change_healthcare_desktop_icons
|
||||||
erpnext.patches.v10_0.update_user_image_in_employee
|
erpnext.patches.v10_0.update_user_image_in_employee
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class Project(Document):
|
|||||||
self.load_tasks()
|
self.load_tasks()
|
||||||
self.validate_dates()
|
self.validate_dates()
|
||||||
self.send_welcome_email()
|
self.send_welcome_email()
|
||||||
self.update_percent_complete()
|
self.update_percent_complete(from_validate=True)
|
||||||
|
|
||||||
def validate_project_name(self):
|
def validate_project_name(self):
|
||||||
if self.get("__islocal") and frappe.db.exists("Project", self.project_name):
|
if self.get("__islocal") and frappe.db.exists("Project", self.project_name):
|
||||||
@@ -198,7 +198,7 @@ class Project(Document):
|
|||||||
if self.sales_order:
|
if self.sales_order:
|
||||||
frappe.db.set_value("Sales Order", self.sales_order, "project", self.name)
|
frappe.db.set_value("Sales Order", self.sales_order, "project", self.name)
|
||||||
|
|
||||||
def update_percent_complete(self):
|
def update_percent_complete(self, from_validate=False):
|
||||||
if not self.tasks: return
|
if not self.tasks: return
|
||||||
total = frappe.db.sql("""select count(name) from tabTask where project=%s""", self.name)[0][0]
|
total = frappe.db.sql("""select count(name) from tabTask where project=%s""", self.name)[0][0]
|
||||||
if not total and self.percent_complete:
|
if not total and self.percent_complete:
|
||||||
@@ -227,6 +227,8 @@ class Project(Document):
|
|||||||
self.status = "Completed"
|
self.status = "Completed"
|
||||||
elif not self.status == "Cancelled":
|
elif not self.status == "Cancelled":
|
||||||
self.status = "Open"
|
self.status = "Open"
|
||||||
|
|
||||||
|
if not from_validate:
|
||||||
self.db_update()
|
self.db_update()
|
||||||
|
|
||||||
def update_costing(self):
|
def update_costing(self):
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_global_search": 1,
|
"in_global_search": 1,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 1,
|
||||||
"label": "Subject",
|
"label": "Subject",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -1396,7 +1396,7 @@
|
|||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 5,
|
"max_attachments": 5,
|
||||||
"menu_index": 0,
|
"menu_index": 0,
|
||||||
"modified": "2019-04-18 22:33:03.798331",
|
"modified": "2019-04-24 23:10:00.014378",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Projects",
|
"module": "Projects",
|
||||||
"name": "Task",
|
"name": "Task",
|
||||||
|
|||||||
@@ -544,7 +544,7 @@ def make_project(source_name, target_doc=None):
|
|||||||
"Sales Order Item": {
|
"Sales Order Item": {
|
||||||
"doctype": "Project Task",
|
"doctype": "Project Task",
|
||||||
"field_map": {
|
"field_map": {
|
||||||
"description": "title",
|
"item_code": "title",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}, target_doc, postprocess)
|
}, target_doc, postprocess)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
|
"allow_events_in_timeline": 0,
|
||||||
"allow_guest_to_view": 0,
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "subject_section",
|
"fieldname": "subject_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -53,6 +55,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "",
|
"default": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "naming_series",
|
"fieldname": "naming_series",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -85,6 +88,7 @@
|
|||||||
"bold": 1,
|
"bold": 1,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "subject",
|
"fieldname": "subject",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -93,7 +97,7 @@
|
|||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_global_search": 1,
|
"in_global_search": 1,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 1,
|
||||||
"label": "Subject",
|
"label": "Subject",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
@@ -116,6 +120,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "issue_type",
|
"fieldname": "issue_type",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -149,6 +154,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "cb00",
|
"fieldname": "cb00",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -180,6 +186,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "Open",
|
"default": "Open",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "status",
|
"fieldname": "status",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -215,6 +222,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "Medium",
|
"default": "Medium",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "priority",
|
"fieldname": "priority",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -249,6 +257,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:doc.__islocal",
|
"depends_on": "eval:doc.__islocal",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "raised_by",
|
"fieldname": "raised_by",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -283,6 +292,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "email_account",
|
"fieldname": "email_account",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -316,6 +326,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "customer",
|
"fieldname": "customer",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -350,6 +361,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_7",
|
"fieldname": "section_break_7",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -383,6 +395,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "",
|
"depends_on": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "description",
|
"fieldname": "description",
|
||||||
"fieldtype": "Text Editor",
|
"fieldtype": "Text Editor",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -416,6 +429,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "response",
|
"fieldname": "response",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -448,6 +462,7 @@
|
|||||||
"bold": 1,
|
"bold": 1,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "mins_to_first_response",
|
"fieldname": "mins_to_first_response",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -480,6 +495,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "first_responded_on",
|
"fieldname": "first_responded_on",
|
||||||
"fieldtype": "Datetime",
|
"fieldtype": "Datetime",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -511,6 +527,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "additional_info",
|
"fieldname": "additional_info",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -543,6 +560,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "lead",
|
"fieldname": "lead",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -575,6 +593,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "contact",
|
"fieldname": "contact",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -607,6 +626,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_16",
|
"fieldname": "column_break_16",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -638,6 +658,7 @@
|
|||||||
"bold": 1,
|
"bold": 1,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "customer_name",
|
"fieldname": "customer_name",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -671,6 +692,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "project",
|
"fieldname": "project",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -704,6 +726,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "company",
|
"fieldname": "company",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -736,6 +759,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_19",
|
"fieldname": "section_break_19",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -769,6 +793,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:!doc.__islocal",
|
"depends_on": "eval:!doc.__islocal",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "resolution_details",
|
"fieldname": "resolution_details",
|
||||||
"fieldtype": "Text Editor",
|
"fieldtype": "Text Editor",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -803,6 +828,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:!doc.__islocal",
|
"depends_on": "eval:!doc.__islocal",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break1",
|
"fieldname": "column_break1",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -835,6 +861,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "Today",
|
"default": "Today",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "opening_date",
|
"fieldname": "opening_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -868,6 +895,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "opening_time",
|
"fieldname": "opening_time",
|
||||||
"fieldtype": "Time",
|
"fieldtype": "Time",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -902,6 +930,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:!doc.__islocal",
|
"depends_on": "eval:!doc.__islocal",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "resolution_date",
|
"fieldname": "resolution_date",
|
||||||
"fieldtype": "Datetime",
|
"fieldtype": "Datetime",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -935,6 +964,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "content_type",
|
"fieldname": "content_type",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -966,6 +996,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "attachment",
|
"fieldname": "attachment",
|
||||||
"fieldtype": "Attach",
|
"fieldtype": "Attach",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -998,6 +1029,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "via_customer_portal",
|
"fieldname": "via_customer_portal",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1035,7 +1067,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-08-21 14:44:27.615004",
|
"modified": "2019-04-24 23:09:48.711076",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Support",
|
"module": "Support",
|
||||||
"name": "Issue",
|
"name": "Issue",
|
||||||
|
|||||||
Reference in New Issue
Block a user