mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 11:19:09 +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.20'
|
__version__ = '11.1.21'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
@@ -145,14 +145,3 @@ def is_member():
|
|||||||
if last_membership and getdate(last_membership.to_date) > getdate():
|
if last_membership and getdate(last_membership.to_date) > getdate():
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def check_branch_compatibility_with_frappe():
|
|
||||||
from frappe.utils.change_log import get_versions
|
|
||||||
versions = get_versions()
|
|
||||||
frappe_branch = versions["frappe"]["branch"]
|
|
||||||
erpnext_branch = versions["erpnext"]["branch"]
|
|
||||||
|
|
||||||
if frappe_branch in ("hotfix", "master") and erpnext_branch == "develop":
|
|
||||||
raise frappe.IncompatibleApp("Frappe is on branch: {} and ERPNext is on branch: {}".format(frappe_branch, erpnext_branch))
|
|
||||||
if erpnext_branch in ("hotfix", "master") and frappe_branch == "develop":
|
|
||||||
raise frappe.IncompatibleApp("Frappe is on branch: {} and ERPNext is on branch: {}".format(frappe_branch, erpnext_branch))
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
|
||||||
|
frappe.ui.form.on('Account Subtype', {
|
||||||
|
refresh: function() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
134
erpnext/accounts/doctype/account_subtype/account_subtype.json
Normal file
134
erpnext/accounts/doctype/account_subtype/account_subtype.json
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
{
|
||||||
|
"allow_copy": 0,
|
||||||
|
"allow_events_in_timeline": 0,
|
||||||
|
"allow_guest_to_view": 0,
|
||||||
|
"allow_import": 1,
|
||||||
|
"allow_rename": 1,
|
||||||
|
"autoname": "field:account_subtype",
|
||||||
|
"beta": 0,
|
||||||
|
"creation": "2018-10-25 15:46:08.054586",
|
||||||
|
"custom": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "DocType",
|
||||||
|
"document_type": "",
|
||||||
|
"editable_grid": 1,
|
||||||
|
"engine": "InnoDB",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "account_subtype",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"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": "Account Subtype",
|
||||||
|
"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": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"has_web_view": 0,
|
||||||
|
"hide_heading": 0,
|
||||||
|
"hide_toolbar": 0,
|
||||||
|
"idx": 0,
|
||||||
|
"image_view": 0,
|
||||||
|
"in_create": 0,
|
||||||
|
"is_submittable": 0,
|
||||||
|
"issingle": 0,
|
||||||
|
"istable": 0,
|
||||||
|
"max_attachments": 0,
|
||||||
|
"modified": "2018-10-25 15:47:03.841390",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Accounts",
|
||||||
|
"name": "Account Subtype",
|
||||||
|
"name_case": "",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"permissions": [
|
||||||
|
{
|
||||||
|
"amend": 0,
|
||||||
|
"cancel": 0,
|
||||||
|
"create": 1,
|
||||||
|
"delete": 1,
|
||||||
|
"email": 1,
|
||||||
|
"export": 1,
|
||||||
|
"if_owner": 0,
|
||||||
|
"import": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"print": 1,
|
||||||
|
"read": 1,
|
||||||
|
"report": 1,
|
||||||
|
"role": "System Manager",
|
||||||
|
"set_user_permissions": 0,
|
||||||
|
"share": 1,
|
||||||
|
"submit": 0,
|
||||||
|
"write": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"amend": 0,
|
||||||
|
"cancel": 0,
|
||||||
|
"create": 1,
|
||||||
|
"delete": 1,
|
||||||
|
"email": 1,
|
||||||
|
"export": 1,
|
||||||
|
"if_owner": 0,
|
||||||
|
"import": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"print": 1,
|
||||||
|
"read": 1,
|
||||||
|
"report": 1,
|
||||||
|
"role": "Accounts Manager",
|
||||||
|
"set_user_permissions": 0,
|
||||||
|
"share": 1,
|
||||||
|
"submit": 0,
|
||||||
|
"write": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"amend": 0,
|
||||||
|
"cancel": 0,
|
||||||
|
"create": 1,
|
||||||
|
"delete": 1,
|
||||||
|
"email": 1,
|
||||||
|
"export": 1,
|
||||||
|
"if_owner": 0,
|
||||||
|
"import": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"print": 1,
|
||||||
|
"read": 1,
|
||||||
|
"report": 1,
|
||||||
|
"role": "Accounts User",
|
||||||
|
"set_user_permissions": 0,
|
||||||
|
"share": 1,
|
||||||
|
"submit": 0,
|
||||||
|
"write": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"quick_entry": 1,
|
||||||
|
"read_only": 0,
|
||||||
|
"read_only_onload": 0,
|
||||||
|
"show_name_in_global_search": 0,
|
||||||
|
"sort_field": "modified",
|
||||||
|
"sort_order": "DESC",
|
||||||
|
"track_changes": 0,
|
||||||
|
"track_seen": 0,
|
||||||
|
"track_views": 0
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
from frappe.model.document import Document
|
||||||
|
|
||||||
|
class AccountSubtype(Document):
|
||||||
|
pass
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
// rename this file from _test_[name] to test_[name] to activate
|
||||||
|
// and remove above this line
|
||||||
|
|
||||||
|
QUnit.test("test: Account Subtype", function (assert) {
|
||||||
|
let done = assert.async();
|
||||||
|
|
||||||
|
// number of asserts
|
||||||
|
assert.expect(1);
|
||||||
|
|
||||||
|
frappe.run_serially([
|
||||||
|
// insert a new Account Subtype
|
||||||
|
() => frappe.tests.make('Account Subtype', [
|
||||||
|
// values to be set
|
||||||
|
{key: 'value'}
|
||||||
|
]),
|
||||||
|
() => {
|
||||||
|
assert.equal(cur_frm.doc.key, 'value');
|
||||||
|
},
|
||||||
|
() => done()
|
||||||
|
]);
|
||||||
|
|
||||||
|
});
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
|
# See license.txt
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
class TestAccountSubtype(unittest.TestCase):
|
||||||
|
pass
|
||||||
0
erpnext/accounts/doctype/account_type/__init__.py
Normal file
0
erpnext/accounts/doctype/account_type/__init__.py
Normal file
8
erpnext/accounts/doctype/account_type/account_type.js
Normal file
8
erpnext/accounts/doctype/account_type/account_type.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
|
||||||
|
frappe.ui.form.on('Account Type', {
|
||||||
|
refresh: function() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
134
erpnext/accounts/doctype/account_type/account_type.json
Normal file
134
erpnext/accounts/doctype/account_type/account_type.json
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
{
|
||||||
|
"allow_copy": 0,
|
||||||
|
"allow_events_in_timeline": 0,
|
||||||
|
"allow_guest_to_view": 0,
|
||||||
|
"allow_import": 1,
|
||||||
|
"allow_rename": 1,
|
||||||
|
"autoname": "field:account_type",
|
||||||
|
"beta": 0,
|
||||||
|
"creation": "2018-10-25 15:45:45.789963",
|
||||||
|
"custom": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "DocType",
|
||||||
|
"document_type": "",
|
||||||
|
"editable_grid": 1,
|
||||||
|
"engine": "InnoDB",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "account_type",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"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": "Account Type",
|
||||||
|
"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": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"has_web_view": 0,
|
||||||
|
"hide_heading": 0,
|
||||||
|
"hide_toolbar": 0,
|
||||||
|
"idx": 0,
|
||||||
|
"image_view": 0,
|
||||||
|
"in_create": 0,
|
||||||
|
"is_submittable": 0,
|
||||||
|
"issingle": 0,
|
||||||
|
"istable": 0,
|
||||||
|
"max_attachments": 0,
|
||||||
|
"modified": "2018-10-25 15:46:51.042604",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Accounts",
|
||||||
|
"name": "Account Type",
|
||||||
|
"name_case": "",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"permissions": [
|
||||||
|
{
|
||||||
|
"amend": 0,
|
||||||
|
"cancel": 0,
|
||||||
|
"create": 1,
|
||||||
|
"delete": 1,
|
||||||
|
"email": 1,
|
||||||
|
"export": 1,
|
||||||
|
"if_owner": 0,
|
||||||
|
"import": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"print": 1,
|
||||||
|
"read": 1,
|
||||||
|
"report": 1,
|
||||||
|
"role": "System Manager",
|
||||||
|
"set_user_permissions": 0,
|
||||||
|
"share": 1,
|
||||||
|
"submit": 0,
|
||||||
|
"write": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"amend": 0,
|
||||||
|
"cancel": 0,
|
||||||
|
"create": 1,
|
||||||
|
"delete": 1,
|
||||||
|
"email": 1,
|
||||||
|
"export": 1,
|
||||||
|
"if_owner": 0,
|
||||||
|
"import": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"print": 1,
|
||||||
|
"read": 1,
|
||||||
|
"report": 1,
|
||||||
|
"role": "Accounts Manager",
|
||||||
|
"set_user_permissions": 0,
|
||||||
|
"share": 1,
|
||||||
|
"submit": 0,
|
||||||
|
"write": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"amend": 0,
|
||||||
|
"cancel": 0,
|
||||||
|
"create": 1,
|
||||||
|
"delete": 1,
|
||||||
|
"email": 1,
|
||||||
|
"export": 1,
|
||||||
|
"if_owner": 0,
|
||||||
|
"import": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"print": 1,
|
||||||
|
"read": 1,
|
||||||
|
"report": 1,
|
||||||
|
"role": "Accounts User",
|
||||||
|
"set_user_permissions": 0,
|
||||||
|
"share": 1,
|
||||||
|
"submit": 0,
|
||||||
|
"write": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"quick_entry": 1,
|
||||||
|
"read_only": 0,
|
||||||
|
"read_only_onload": 0,
|
||||||
|
"show_name_in_global_search": 0,
|
||||||
|
"sort_field": "modified",
|
||||||
|
"sort_order": "DESC",
|
||||||
|
"track_changes": 0,
|
||||||
|
"track_seen": 0,
|
||||||
|
"track_views": 0
|
||||||
|
}
|
||||||
9
erpnext/accounts/doctype/account_type/account_type.py
Normal file
9
erpnext/accounts/doctype/account_type/account_type.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
from frappe.model.document import Document
|
||||||
|
|
||||||
|
class AccountType(Document):
|
||||||
|
pass
|
||||||
23
erpnext/accounts/doctype/account_type/test_account_type.js
Normal file
23
erpnext/accounts/doctype/account_type/test_account_type.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
// rename this file from _test_[name] to test_[name] to activate
|
||||||
|
// and remove above this line
|
||||||
|
|
||||||
|
QUnit.test("test: Account Type", function (assert) {
|
||||||
|
let done = assert.async();
|
||||||
|
|
||||||
|
// number of asserts
|
||||||
|
assert.expect(1);
|
||||||
|
|
||||||
|
frappe.run_serially([
|
||||||
|
// insert a new Account Type
|
||||||
|
() => frappe.tests.make('Account Type', [
|
||||||
|
// values to be set
|
||||||
|
{key: 'value'}
|
||||||
|
]),
|
||||||
|
() => {
|
||||||
|
assert.equal(cur_frm.doc.key, 'value');
|
||||||
|
},
|
||||||
|
() => done()
|
||||||
|
]);
|
||||||
|
|
||||||
|
});
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
|
# See license.txt
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
class TestAccountType(unittest.TestCase):
|
||||||
|
pass
|
||||||
@@ -2,7 +2,29 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Bank', {
|
frappe.ui.form.on('Bank', {
|
||||||
|
onload: function(frm) {
|
||||||
|
add_fields_to_mapping_table(frm);
|
||||||
|
},
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
|
add_fields_to_mapping_table(frm);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
let add_fields_to_mapping_table = function (frm) {
|
||||||
|
let options = [];
|
||||||
|
|
||||||
|
frappe.model.with_doctype("Bank Transaction", function() {
|
||||||
|
let meta = frappe.get_meta("Bank Transaction");
|
||||||
|
meta.fields.forEach(value => {
|
||||||
|
if (!["Section Break", "Column Break"].includes(value.fieldtype)) {
|
||||||
|
options.push(value.fieldname);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
frappe.meta.get_docfield("Bank Transaction Mapping", "bank_transaction_field",
|
||||||
|
frm.doc.name).options = options;
|
||||||
|
|
||||||
|
frm.fields_dict.bank_transaction_mapping.grid.refresh();
|
||||||
|
};
|
||||||
@@ -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": 0,
|
"allow_import": 0,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@@ -42,6 +44,134 @@
|
|||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
|
"unique": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 1,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "data_import_configuration_section",
|
||||||
|
"fieldtype": "Section 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,
|
||||||
|
"label": "Data Import Configuration",
|
||||||
|
"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,
|
||||||
|
"fieldname": "bank_transaction_mapping",
|
||||||
|
"fieldtype": "Table",
|
||||||
|
"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": "Bank Transaction Mapping",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Bank Transaction Mapping",
|
||||||
|
"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,
|
||||||
|
"fieldname": "section_break_4",
|
||||||
|
"fieldtype": "Section 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,
|
||||||
|
"fieldname": "plaid_access_token",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"hidden": 1,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Plaid Access Token",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 1,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 1,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -55,7 +185,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-04-07 17:00:21.246202",
|
"modified": "2018-11-27 16:12:13.938776",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Bank",
|
"name": "Bank",
|
||||||
@@ -64,7 +194,6 @@
|
|||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
"amend": 0,
|
"amend": 0,
|
||||||
"apply_user_permissions": 0,
|
|
||||||
"cancel": 0,
|
"cancel": 0,
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"delete": 1,
|
"delete": 1,
|
||||||
@@ -90,5 +219,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
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Bank Account', {
|
frappe.ui.form.on('Bank Account', {
|
||||||
@@ -24,5 +24,13 @@ frappe.ui.form.on('Bank Account', {
|
|||||||
else {
|
else {
|
||||||
frappe.contacts.render_address_and_contact(frm);
|
frappe.contacts.render_address_and_contact(frm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (frm.doc.integration_id) {
|
||||||
|
frm.add_custom_button(__("Unlink external integrations"), function() {
|
||||||
|
frappe.confirm(__("This action will unlink this account from any external service integrating ERPNext with your bank accounts. It cannot be undone. Are you certain ?"), function() {
|
||||||
|
frm.set_value("integration_id", "");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"allow_guest_to_view": 0,
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 0,
|
"allow_import": 0,
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
"autoname": "field:account_name",
|
"autoname": "",
|
||||||
"beta": 0,
|
"beta": 0,
|
||||||
"creation": "2017-05-29 21:35:13.136357",
|
"creation": "2017-05-29 21:35:13.136357",
|
||||||
"custom": 0,
|
"custom": 0,
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 1
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
@@ -62,7 +62,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": "Account",
|
"label": "GL Account",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"options": "Account",
|
"options": "Account",
|
||||||
@@ -112,6 +112,136 @@
|
|||||||
"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,
|
||||||
|
"fieldname": "account_type",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"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": "Account Type",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Account Type",
|
||||||
|
"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,
|
||||||
|
"fieldname": "account_subtype",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"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": "Account Subtype",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Account Subtype",
|
||||||
|
"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,
|
||||||
|
"fieldname": "column_break_7",
|
||||||
|
"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,
|
||||||
|
"label": "",
|
||||||
|
"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": 1,
|
||||||
|
"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,
|
||||||
|
"fieldname": "is_default",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"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": "Is the Default Account",
|
||||||
|
"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,
|
||||||
@@ -178,198 +308,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,
|
|
||||||
"fieldname": "column_break_7",
|
|
||||||
"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,
|
|
||||||
"label": "",
|
|
||||||
"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": 1,
|
|
||||||
"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,
|
|
||||||
"fieldname": "is_default",
|
|
||||||
"fieldtype": "Check",
|
|
||||||
"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": "Is Default",
|
|
||||||
"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,
|
|
||||||
"fieldname": "bank_account_no",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Bank Account No",
|
|
||||||
"length": 30,
|
|
||||||
"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,
|
|
||||||
"fieldname": "iban",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "IBAN",
|
|
||||||
"length": 30,
|
|
||||||
"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,
|
|
||||||
"fieldname": "branch_code",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Branch Code",
|
|
||||||
"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,
|
|
||||||
"fieldname": "swift_number",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"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": "SWIFT number",
|
|
||||||
"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,
|
||||||
@@ -387,6 +325,7 @@
|
|||||||
"in_global_search": 0,
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 0,
|
||||||
|
"label": "Party Details",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
@@ -499,6 +438,197 @@
|
|||||||
"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,
|
||||||
|
"fieldname": "account_details_section",
|
||||||
|
"fieldtype": "Section 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,
|
||||||
|
"label": "Account Details",
|
||||||
|
"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,
|
||||||
|
"fieldname": "iban",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "IBAN",
|
||||||
|
"length": 30,
|
||||||
|
"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,
|
||||||
|
"fieldname": "column_break_12",
|
||||||
|
"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,
|
||||||
|
"fieldname": "bank_account_no",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Bank Account No",
|
||||||
|
"length": 30,
|
||||||
|
"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,
|
||||||
|
"fieldname": "branch_code",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Branch Code",
|
||||||
|
"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,
|
||||||
|
"fieldname": "swift_number",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"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": "SWIFT number",
|
||||||
|
"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,
|
||||||
@@ -603,7 +733,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fieldname": "column_break_12",
|
"fieldname": "column_break_13",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
@@ -658,6 +788,166 @@
|
|||||||
"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,
|
||||||
|
"fieldname": "integration_details_section",
|
||||||
|
"fieldtype": "Section 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,
|
||||||
|
"label": "Integration Details",
|
||||||
|
"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,
|
||||||
|
"fieldname": "integration_id",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"hidden": 1,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Integration ID",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 1,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 1,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
|
"unique": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"description": "Change this date manually to setup the next synchronization start date",
|
||||||
|
"fieldname": "last_integration_date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"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": "Last Integration Date",
|
||||||
|
"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,
|
||||||
|
"fieldname": "column_break_27",
|
||||||
|
"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,
|
||||||
|
"fieldname": "mask",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"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": "Mask",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 1,
|
||||||
|
"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,
|
||||||
@@ -670,7 +960,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2019-03-05 17:56:05.103238",
|
"modified": "2019-03-06 17:56:05.103238",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Bank Account",
|
"name": "Bank Account",
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ class BankAccount(Document):
|
|||||||
"""Load address and contacts in `__onload`"""
|
"""Load address and contacts in `__onload`"""
|
||||||
load_address_and_contact(self)
|
load_address_and_contact(self)
|
||||||
|
|
||||||
|
def autoname(self):
|
||||||
|
self.name = self.account_name + " - " + self.bank
|
||||||
|
|
||||||
def on_trash(self):
|
def on_trash(self):
|
||||||
delete_contact_and_address('BankAccount', self.name)
|
delete_contact_and_address('BankAccount', self.name)
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
|
||||||
|
frappe.ui.form.on('Bank Transaction', {
|
||||||
|
onload: function(frm) {
|
||||||
|
frm.set_query('payment_document', 'payment_entries', function() {
|
||||||
|
return {
|
||||||
|
"filters": {
|
||||||
|
"name": ["in", ["Payment Entry", "Journal Entry", "Sales Invoice", "Purchase Invoice", "Expense Claim"]]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
800
erpnext/accounts/doctype/bank_transaction/bank_transaction.json
Normal file
800
erpnext/accounts/doctype/bank_transaction/bank_transaction.json
Normal file
@@ -0,0 +1,800 @@
|
|||||||
|
{
|
||||||
|
"allow_copy": 0,
|
||||||
|
"allow_events_in_timeline": 0,
|
||||||
|
"allow_guest_to_view": 0,
|
||||||
|
"allow_import": 1,
|
||||||
|
"allow_rename": 0,
|
||||||
|
"autoname": "naming_series:",
|
||||||
|
"beta": 0,
|
||||||
|
"creation": "2018-10-22 18:19:02.784533",
|
||||||
|
"custom": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "DocType",
|
||||||
|
"document_type": "",
|
||||||
|
"editable_grid": 1,
|
||||||
|
"engine": "InnoDB",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"default": "ACC-BTN-.YYYY.-",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "naming_series",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"hidden": 1,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Series",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 1,
|
||||||
|
"options": "ACC-BTN-.YYYY.-",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 1,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 1,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 1,
|
||||||
|
"translatable": 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": "date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"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": "Date",
|
||||||
|
"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,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "column_break_2",
|
||||||
|
"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,
|
||||||
|
"default": "Settled",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "status",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"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": "Status",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "\nPending\nSettled",
|
||||||
|
"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,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "bank_account",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"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": "Bank Account",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Bank Account",
|
||||||
|
"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,
|
||||||
|
"default": "",
|
||||||
|
"fetch_from": "bank_account.company",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "company",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"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": "Company",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Company",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 1,
|
||||||
|
"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,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "section_break_4",
|
||||||
|
"fieldtype": "Section 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,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "debit",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Debit",
|
||||||
|
"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,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "credit",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Credit",
|
||||||
|
"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,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "column_break_7",
|
||||||
|
"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,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "currency",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"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": "Currency",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Currency",
|
||||||
|
"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,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "section_break_10",
|
||||||
|
"fieldtype": "Section 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,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "description",
|
||||||
|
"fieldtype": "Small Text",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Description",
|
||||||
|
"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,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "section_break_14",
|
||||||
|
"fieldtype": "Section 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,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "reference_number",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"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": "Reference Number",
|
||||||
|
"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,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "transaction_id",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"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": "Transaction ID",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 1,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
|
"unique": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 1,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "payment_entries",
|
||||||
|
"fieldtype": "Table",
|
||||||
|
"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": "Payment Entries",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Bank Transaction Payments",
|
||||||
|
"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,
|
||||||
|
"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,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "allocated_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": "Allocated 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_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_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "amended_from",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"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": "Amended From",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 1,
|
||||||
|
"options": "Bank Transaction",
|
||||||
|
"permlevel": 0,
|
||||||
|
"print_hide": 1,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 1,
|
||||||
|
"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,
|
||||||
|
"hide_heading": 0,
|
||||||
|
"hide_toolbar": 0,
|
||||||
|
"idx": 0,
|
||||||
|
"image_view": 0,
|
||||||
|
"in_create": 0,
|
||||||
|
"is_submittable": 1,
|
||||||
|
"issingle": 0,
|
||||||
|
"istable": 0,
|
||||||
|
"max_attachments": 0,
|
||||||
|
"modified": "2019-03-22 10:52:04.540756",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Accounts",
|
||||||
|
"name": "Bank Transaction",
|
||||||
|
"name_case": "",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"permissions": [
|
||||||
|
{
|
||||||
|
"amend": 0,
|
||||||
|
"cancel": 1,
|
||||||
|
"create": 1,
|
||||||
|
"delete": 1,
|
||||||
|
"email": 1,
|
||||||
|
"export": 1,
|
||||||
|
"if_owner": 0,
|
||||||
|
"import": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"print": 1,
|
||||||
|
"read": 1,
|
||||||
|
"report": 1,
|
||||||
|
"role": "System Manager",
|
||||||
|
"set_user_permissions": 0,
|
||||||
|
"share": 1,
|
||||||
|
"submit": 1,
|
||||||
|
"write": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"amend": 0,
|
||||||
|
"cancel": 1,
|
||||||
|
"create": 1,
|
||||||
|
"delete": 1,
|
||||||
|
"email": 1,
|
||||||
|
"export": 1,
|
||||||
|
"if_owner": 0,
|
||||||
|
"import": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"print": 1,
|
||||||
|
"read": 1,
|
||||||
|
"report": 1,
|
||||||
|
"role": "Accounts Manager",
|
||||||
|
"set_user_permissions": 0,
|
||||||
|
"share": 1,
|
||||||
|
"submit": 1,
|
||||||
|
"write": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"amend": 0,
|
||||||
|
"cancel": 0,
|
||||||
|
"create": 1,
|
||||||
|
"delete": 1,
|
||||||
|
"email": 1,
|
||||||
|
"export": 1,
|
||||||
|
"if_owner": 0,
|
||||||
|
"import": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"print": 1,
|
||||||
|
"read": 1,
|
||||||
|
"report": 1,
|
||||||
|
"role": "Accounts User",
|
||||||
|
"set_user_permissions": 0,
|
||||||
|
"share": 1,
|
||||||
|
"submit": 1,
|
||||||
|
"write": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"quick_entry": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"read_only_onload": 0,
|
||||||
|
"show_name_in_global_search": 0,
|
||||||
|
"sort_field": "date",
|
||||||
|
"sort_order": "DESC",
|
||||||
|
"title_field": "bank_account",
|
||||||
|
"track_changes": 0,
|
||||||
|
"track_seen": 0,
|
||||||
|
"track_views": 0
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
from frappe.model.document import Document
|
||||||
|
from frappe.utils import flt
|
||||||
|
|
||||||
|
class BankTransaction(Document):
|
||||||
|
def after_insert(self):
|
||||||
|
self.unallocated_amount = abs(flt(self.credit) - flt(self.debit))
|
||||||
|
|
||||||
|
def on_update_after_submit(self):
|
||||||
|
allocated_amount = reduce(lambda x, y: flt(x) + flt(y), [x.allocated_amount for x in self.payment_entries])
|
||||||
|
|
||||||
|
if allocated_amount:
|
||||||
|
frappe.db.set_value(self.doctype, self.name, "allocated_amount", flt(allocated_amount))
|
||||||
|
frappe.db.set_value(self.doctype, self.name, "unallocated_amount", abs(flt(self.credit) - flt(self.debit)) - flt(allocated_amount))
|
||||||
|
|
||||||
|
else:
|
||||||
|
frappe.db.set_value(self.doctype, self.name, "allocated_amount", 0)
|
||||||
|
frappe.db.set_value(self.doctype, self.name, "unallocated_amount", abs(flt(self.credit) - flt(self.debit)))
|
||||||
|
|
||||||
|
self.reload()
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
|
// License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
frappe.listview_settings['Bank Transaction'] = {
|
||||||
|
add_fields: ["unallocated_amount"],
|
||||||
|
get_indicator: function(doc) {
|
||||||
|
if(flt(doc.unallocated_amount)>0) {
|
||||||
|
return [__("Unreconciled"), "orange", "unallocated_amount,>,0"];
|
||||||
|
} else if(flt(doc.unallocated_amount)===0) {
|
||||||
|
return [__("Reconciled"), "green", "unallocated_amount,=,0"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
import json
|
||||||
|
from frappe.utils import getdate
|
||||||
|
from frappe.utils.dateutils import parse_date
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def upload_bank_statement():
|
||||||
|
if getattr(frappe, "uploaded_file", None):
|
||||||
|
with open(frappe.uploaded_file, "rb") as upfile:
|
||||||
|
fcontent = upfile.read()
|
||||||
|
else:
|
||||||
|
from frappe.utils.file_manager import get_uploaded_content
|
||||||
|
fname, fcontent = get_uploaded_content()
|
||||||
|
|
||||||
|
if frappe.safe_encode(fname).lower().endswith("csv"):
|
||||||
|
from frappe.utils.csvutils import read_csv_content
|
||||||
|
rows = read_csv_content(fcontent, False)
|
||||||
|
|
||||||
|
elif frappe.safe_encode(fname).lower().endswith("xlsx"):
|
||||||
|
from frappe.utils.xlsxutils import read_xlsx_file_from_attached_file
|
||||||
|
rows = read_xlsx_file_from_attached_file(fcontent=fcontent)
|
||||||
|
|
||||||
|
columns = rows[0]
|
||||||
|
rows.pop(0)
|
||||||
|
data = rows
|
||||||
|
return {"columns": columns, "data": data}
|
||||||
|
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def create_bank_entries(columns, data, bank_account):
|
||||||
|
header_map = get_header_mapping(columns, bank_account)
|
||||||
|
|
||||||
|
count = 0
|
||||||
|
for d in json.loads(data):
|
||||||
|
if all(item is None for item in d) is True:
|
||||||
|
continue
|
||||||
|
fields = {}
|
||||||
|
for key, value in header_map.iteritems():
|
||||||
|
fields.update({key: d[int(value)-1]})
|
||||||
|
|
||||||
|
|
||||||
|
bank_transaction = frappe.get_doc({
|
||||||
|
"doctype": "Bank Transaction"
|
||||||
|
})
|
||||||
|
bank_transaction.update(fields)
|
||||||
|
bank_transaction.date = getdate(parse_date(bank_transaction.date))
|
||||||
|
bank_transaction.bank_account = bank_account
|
||||||
|
bank_transaction.insert()
|
||||||
|
bank_transaction.submit()
|
||||||
|
count = count + 1
|
||||||
|
|
||||||
|
return count
|
||||||
|
|
||||||
|
def get_header_mapping(columns, bank_account):
|
||||||
|
mapping = get_bank_mapping(bank_account)
|
||||||
|
|
||||||
|
header_map = {}
|
||||||
|
for column in json.loads(columns):
|
||||||
|
if column["content"] in mapping:
|
||||||
|
header_map.update({mapping[column["content"]]: column["colIndex"]})
|
||||||
|
|
||||||
|
return header_map
|
||||||
|
|
||||||
|
def get_bank_mapping(bank_account):
|
||||||
|
bank_name = frappe.db.get_value("Bank Account", bank_account, "bank")
|
||||||
|
bank = frappe.get_doc("Bank", bank_name)
|
||||||
|
|
||||||
|
mapping = {row.file_field:row.bank_transaction_field for row in bank.bank_transaction_mapping}
|
||||||
|
|
||||||
|
return mapping
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
// rename this file from _test_[name] to test_[name] to activate
|
||||||
|
// and remove above this line
|
||||||
|
|
||||||
|
QUnit.test("test: Bank Transaction", function (assert) {
|
||||||
|
let done = assert.async();
|
||||||
|
|
||||||
|
// number of asserts
|
||||||
|
assert.expect(1);
|
||||||
|
|
||||||
|
frappe.run_serially([
|
||||||
|
// insert a new Bank Transaction
|
||||||
|
() => frappe.tests.make('Bank Transaction', [
|
||||||
|
// values to be set
|
||||||
|
{key: 'value'}
|
||||||
|
]),
|
||||||
|
() => {
|
||||||
|
assert.equal(cur_frm.doc.key, 'value');
|
||||||
|
},
|
||||||
|
() => done()
|
||||||
|
]);
|
||||||
|
|
||||||
|
});
|
||||||
@@ -0,0 +1,286 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
|
# See license.txt
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import frappe
|
||||||
|
import unittest
|
||||||
|
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
|
||||||
|
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice import make_purchase_invoice
|
||||||
|
from erpnext.accounts.doctype.payment_entry.test_payment_entry import get_payment_entry
|
||||||
|
from erpnext.accounts.page.bank_reconciliation.bank_reconciliation import reconcile, get_linked_payments
|
||||||
|
|
||||||
|
test_dependencies = ["Item", "Cost Center"]
|
||||||
|
|
||||||
|
class TestBankTransaction(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
add_transactions()
|
||||||
|
add_payments()
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
for bt in frappe.get_all("Bank Transaction"):
|
||||||
|
doc = frappe.get_doc("Bank Transaction", bt.name)
|
||||||
|
doc.cancel()
|
||||||
|
doc.delete()
|
||||||
|
|
||||||
|
# Delete directly in DB to avoid validation errors for countries not allowing deletion
|
||||||
|
frappe.db.sql("""delete from `tabPayment Entry Reference`""")
|
||||||
|
frappe.db.sql("""delete from `tabPayment Entry`""")
|
||||||
|
|
||||||
|
frappe.flags.test_bank_transactions_created = False
|
||||||
|
frappe.flags.test_payments_created = False
|
||||||
|
|
||||||
|
# This test checks if ERPNext is able to provide a linked payment for a bank transaction based on the amount of the bank transaction.
|
||||||
|
def test_linked_payments(self):
|
||||||
|
bank_transaction = frappe.get_doc("Bank Transaction", dict(description="Re 95282925234 FE/000002917 AT171513000281183046 Conrad Electronic"))
|
||||||
|
linked_payments = get_linked_payments(bank_transaction.name)
|
||||||
|
self.assertTrue(linked_payments[0].party == "Conrad Electronic")
|
||||||
|
|
||||||
|
# This test validates a simple reconciliation leading to the clearance of the bank transaction and the payment
|
||||||
|
def test_reconcile(self):
|
||||||
|
bank_transaction = frappe.get_doc("Bank Transaction", dict(description="1512567 BG/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G"))
|
||||||
|
payment = frappe.get_doc("Payment Entry", dict(party="Mr G", paid_amount=1200))
|
||||||
|
reconcile(bank_transaction.name, "Payment Entry", payment.name)
|
||||||
|
|
||||||
|
unallocated_amount = frappe.db.get_value("Bank Transaction", bank_transaction.name, "unallocated_amount")
|
||||||
|
self.assertTrue(unallocated_amount == 0)
|
||||||
|
|
||||||
|
clearance_date = frappe.db.get_value("Payment Entry", payment.name, "clearance_date")
|
||||||
|
self.assertTrue(clearance_date is not None)
|
||||||
|
|
||||||
|
# Check if ERPNext can correctly fetch a linked payment based on the party
|
||||||
|
def test_linked_payments_based_on_party(self):
|
||||||
|
bank_transaction = frappe.get_doc("Bank Transaction", dict(description="1512567 BG/000003025 OPSKATTUZWXXX AT776000000098709849 Herr G"))
|
||||||
|
linked_payments = get_linked_payments(bank_transaction.name)
|
||||||
|
self.assertTrue(len(linked_payments)==1)
|
||||||
|
|
||||||
|
# Check if ERPNext can correctly filter a linked payments based on the debit/credit amount
|
||||||
|
def test_debit_credit_output(self):
|
||||||
|
bank_transaction = frappe.get_doc("Bank Transaction", dict(description="Auszahlung Karte MC/000002916 AUTOMAT 698769 K002 27.10. 14:07"))
|
||||||
|
linked_payments = get_linked_payments(bank_transaction.name)
|
||||||
|
self.assertTrue(linked_payments[0].payment_type == "Pay")
|
||||||
|
|
||||||
|
# Check error if already reconciled
|
||||||
|
def test_already_reconciled(self):
|
||||||
|
bank_transaction = frappe.get_doc("Bank Transaction", dict(description="1512567 BG/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G"))
|
||||||
|
payment = frappe.get_doc("Payment Entry", dict(party="Mr G", paid_amount=1200))
|
||||||
|
reconcile(bank_transaction.name, "Payment Entry", payment.name)
|
||||||
|
|
||||||
|
bank_transaction = frappe.get_doc("Bank Transaction", dict(description="1512567 BG/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G"))
|
||||||
|
payment = frappe.get_doc("Payment Entry", dict(party="Mr G", paid_amount=1200))
|
||||||
|
self.assertRaises(frappe.ValidationError, reconcile, bank_transaction=bank_transaction.name, payment_doctype="Payment Entry", payment_name=payment.name)
|
||||||
|
|
||||||
|
# Raise an error if creditor transaction vs creditor payment
|
||||||
|
def test_invalid_creditor_reconcilation(self):
|
||||||
|
bank_transaction = frappe.get_doc("Bank Transaction", dict(description="I2015000011 VD/000002514 ATWWXXX AT4701345000003510057 Bio"))
|
||||||
|
payment = frappe.get_doc("Payment Entry", dict(party="Conrad Electronic", paid_amount=690))
|
||||||
|
self.assertRaises(frappe.ValidationError, reconcile, bank_transaction=bank_transaction.name, payment_doctype="Payment Entry", payment_name=payment.name)
|
||||||
|
|
||||||
|
# Raise an error if debitor transaction vs debitor payment
|
||||||
|
def test_invalid_debitor_reconcilation(self):
|
||||||
|
bank_transaction = frappe.get_doc("Bank Transaction", dict(description="Auszahlung Karte MC/000002916 AUTOMAT 698769 K002 27.10. 14:07"))
|
||||||
|
payment = frappe.get_doc("Payment Entry", dict(party="Fayva", paid_amount=109080))
|
||||||
|
self.assertRaises(frappe.ValidationError, reconcile, bank_transaction=bank_transaction.name, payment_doctype="Payment Entry", payment_name=payment.name)
|
||||||
|
|
||||||
|
# Raise an error if debitor transaction vs debitor payment
|
||||||
|
def test_clear_sales_invoice(self):
|
||||||
|
bank_transaction = frappe.get_doc("Bank Transaction", dict(description="I2015000011 VD/000002514 ATWWXXX AT4701345000003510057 Bio"))
|
||||||
|
payment = frappe.get_doc("Sales Invoice", dict(customer="Fayva", status=["=", "Paid"]))
|
||||||
|
reconcile(bank_transaction.name, "Sales Invoice", payment.name)
|
||||||
|
|
||||||
|
self.assertEqual(frappe.db.get_value("Bank Transaction", bank_transaction.name, "unallocated_amount"), 0)
|
||||||
|
self.assertTrue(frappe.db.get_value("Sales Invoice Payment", dict(parent=payment.name), "clearance_date") is not None)
|
||||||
|
|
||||||
|
def add_transactions():
|
||||||
|
if frappe.flags.test_bank_transactions_created:
|
||||||
|
return
|
||||||
|
|
||||||
|
frappe.set_user("Administrator")
|
||||||
|
try:
|
||||||
|
frappe.get_doc({
|
||||||
|
"doctype": "Bank",
|
||||||
|
"bank_name":"Citi Bank",
|
||||||
|
}).insert()
|
||||||
|
except frappe.DuplicateEntryError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
frappe.get_doc({
|
||||||
|
"doctype": "Bank Account",
|
||||||
|
"account_name":"Checking Account",
|
||||||
|
"bank": "Citi Bank",
|
||||||
|
"account": "_Test Bank - _TC"
|
||||||
|
}).insert()
|
||||||
|
except frappe.DuplicateEntryError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
doc = frappe.get_doc({
|
||||||
|
"doctype": "Bank Transaction",
|
||||||
|
"description":"1512567 BG/000002918 OPSKATTUZWXXX AT776000000098709837 Herr G",
|
||||||
|
"date": "2018-10-23",
|
||||||
|
"debit": 1200,
|
||||||
|
"currency": "INR",
|
||||||
|
"bank_account": "Checking Account - Citi Bank"
|
||||||
|
}).insert()
|
||||||
|
doc.submit()
|
||||||
|
|
||||||
|
doc = frappe.get_doc({
|
||||||
|
"doctype": "Bank Transaction",
|
||||||
|
"description":"1512567 BG/000003025 OPSKATTUZWXXX AT776000000098709849 Herr G",
|
||||||
|
"date": "2018-10-23",
|
||||||
|
"debit": 1700,
|
||||||
|
"currency": "INR",
|
||||||
|
"bank_account": "Checking Account - Citi Bank"
|
||||||
|
}).insert()
|
||||||
|
doc.submit()
|
||||||
|
|
||||||
|
doc = frappe.get_doc({
|
||||||
|
"doctype": "Bank Transaction",
|
||||||
|
"description":"Re 95282925234 FE/000002917 AT171513000281183046 Conrad Electronic",
|
||||||
|
"date": "2018-10-26",
|
||||||
|
"debit": 690,
|
||||||
|
"currency": "INR",
|
||||||
|
"bank_account": "Checking Account - Citi Bank"
|
||||||
|
}).insert()
|
||||||
|
doc.submit()
|
||||||
|
|
||||||
|
doc = frappe.get_doc({
|
||||||
|
"doctype": "Bank Transaction",
|
||||||
|
"description":"Auszahlung Karte MC/000002916 AUTOMAT 698769 K002 27.10. 14:07",
|
||||||
|
"date": "2018-10-27",
|
||||||
|
"debit": 3900,
|
||||||
|
"currency": "INR",
|
||||||
|
"bank_account": "Checking Account - Citi Bank"
|
||||||
|
}).insert()
|
||||||
|
doc.submit()
|
||||||
|
|
||||||
|
doc = frappe.get_doc({
|
||||||
|
"doctype": "Bank Transaction",
|
||||||
|
"description":"I2015000011 VD/000002514 ATWWXXX AT4701345000003510057 Bio",
|
||||||
|
"date": "2018-10-27",
|
||||||
|
"credit": 109080,
|
||||||
|
"currency": "INR",
|
||||||
|
"bank_account": "Checking Account - Citi Bank"
|
||||||
|
}).insert()
|
||||||
|
doc.submit()
|
||||||
|
|
||||||
|
frappe.flags.test_bank_transactions_created = True
|
||||||
|
|
||||||
|
def add_payments():
|
||||||
|
if frappe.flags.test_payments_created:
|
||||||
|
return
|
||||||
|
|
||||||
|
frappe.set_user("Administrator")
|
||||||
|
|
||||||
|
try:
|
||||||
|
frappe.get_doc({
|
||||||
|
"doctype": "Supplier",
|
||||||
|
"supplier_group":"All Supplier Groups",
|
||||||
|
"supplier_type": "Company",
|
||||||
|
"supplier_name": "Conrad Electronic"
|
||||||
|
}).insert()
|
||||||
|
|
||||||
|
except frappe.DuplicateEntryError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
pi = make_purchase_invoice(supplier="Conrad Electronic", qty=1, rate=690)
|
||||||
|
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank - _TC")
|
||||||
|
pe.reference_no = "Conrad Oct 18"
|
||||||
|
pe.reference_date = "2018-10-24"
|
||||||
|
pe.insert()
|
||||||
|
pe.submit()
|
||||||
|
|
||||||
|
try:
|
||||||
|
frappe.get_doc({
|
||||||
|
"doctype": "Supplier",
|
||||||
|
"supplier_group":"All Supplier Groups",
|
||||||
|
"supplier_type": "Company",
|
||||||
|
"supplier_name": "Mr G"
|
||||||
|
}).insert()
|
||||||
|
except frappe.DuplicateEntryError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
pi = make_purchase_invoice(supplier="Mr G", qty=1, rate=1200)
|
||||||
|
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank - _TC")
|
||||||
|
pe.reference_no = "Herr G Oct 18"
|
||||||
|
pe.reference_date = "2018-10-24"
|
||||||
|
pe.insert()
|
||||||
|
pe.submit()
|
||||||
|
|
||||||
|
pi = make_purchase_invoice(supplier="Mr G", qty=1, rate=1700)
|
||||||
|
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank - _TC")
|
||||||
|
pe.reference_no = "Herr G Nov 18"
|
||||||
|
pe.reference_date = "2018-11-01"
|
||||||
|
pe.insert()
|
||||||
|
pe.submit()
|
||||||
|
|
||||||
|
try:
|
||||||
|
frappe.get_doc({
|
||||||
|
"doctype": "Supplier",
|
||||||
|
"supplier_group":"All Supplier Groups",
|
||||||
|
"supplier_type": "Company",
|
||||||
|
"supplier_name": "Poore Simon's"
|
||||||
|
}).insert()
|
||||||
|
except frappe.DuplicateEntryError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
frappe.get_doc({
|
||||||
|
"doctype": "Customer",
|
||||||
|
"customer_group":"All Customer Groups",
|
||||||
|
"customer_type": "Company",
|
||||||
|
"customer_name": "Poore Simon's"
|
||||||
|
}).insert()
|
||||||
|
except frappe.DuplicateEntryError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
pi = make_purchase_invoice(supplier="Poore Simon's", qty=1, rate=3900)
|
||||||
|
pe = get_payment_entry("Purchase Invoice", pi.name, bank_account="_Test Bank - _TC")
|
||||||
|
pe.reference_no = "Poore Simon's Oct 18"
|
||||||
|
pe.reference_date = "2018-10-28"
|
||||||
|
pe.insert()
|
||||||
|
pe.submit()
|
||||||
|
|
||||||
|
si = create_sales_invoice(customer="Poore Simon's", qty=1, rate=3900)
|
||||||
|
pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Bank - _TC")
|
||||||
|
pe.reference_no = "Poore Simon's Oct 18"
|
||||||
|
pe.reference_date = "2018-10-28"
|
||||||
|
pe.insert()
|
||||||
|
pe.submit()
|
||||||
|
|
||||||
|
try:
|
||||||
|
frappe.get_doc({
|
||||||
|
"doctype": "Customer",
|
||||||
|
"customer_group":"All Customer Groups",
|
||||||
|
"customer_type": "Company",
|
||||||
|
"customer_name": "Fayva"
|
||||||
|
}).insert()
|
||||||
|
except frappe.DuplicateEntryError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
si = create_sales_invoice(customer="Fayva", qty=1, rate=109080)
|
||||||
|
pe = get_payment_entry("Sales Invoice", si.name, bank_account="_Test Bank - _TC")
|
||||||
|
pe.reference_no = "Fayva Oct 18"
|
||||||
|
pe.reference_date = "2018-10-29"
|
||||||
|
pe.insert()
|
||||||
|
pe.submit()
|
||||||
|
|
||||||
|
company = frappe.db.get_single_value('Global Defaults', 'default_company')
|
||||||
|
frappe.get_doc({
|
||||||
|
"doctype": "Mode of Payment",
|
||||||
|
"name": "Cash"
|
||||||
|
}).append("accounts", {
|
||||||
|
"company": company,
|
||||||
|
"default_account": "_Test Bank - _TC"
|
||||||
|
}).save()
|
||||||
|
si = create_sales_invoice(customer="Fayva", qty=1, rate=109080, do_not_submit=1)
|
||||||
|
si.is_pos = 1
|
||||||
|
si.append("payments", {
|
||||||
|
"mode_of_payment": "Cash",
|
||||||
|
"account": "_Test Bank - _TC",
|
||||||
|
"amount": 109080
|
||||||
|
})
|
||||||
|
si.save()
|
||||||
|
si.submit()
|
||||||
|
|
||||||
|
frappe.flags.test_payments_created = True
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
{
|
||||||
|
"allow_copy": 0,
|
||||||
|
"allow_events_in_timeline": 0,
|
||||||
|
"allow_guest_to_view": 0,
|
||||||
|
"allow_import": 0,
|
||||||
|
"allow_rename": 0,
|
||||||
|
"beta": 0,
|
||||||
|
"creation": "2018-10-24 15:24:56.713277",
|
||||||
|
"custom": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "DocType",
|
||||||
|
"document_type": "",
|
||||||
|
"editable_grid": 1,
|
||||||
|
"engine": "InnoDB",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "bank_transaction_field",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Field in Bank Transaction",
|
||||||
|
"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": 1,
|
||||||
|
"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,
|
||||||
|
"fieldname": "file_field",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Column in Bank File",
|
||||||
|
"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": 1,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
|
"unique": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"has_web_view": 0,
|
||||||
|
"hide_heading": 0,
|
||||||
|
"hide_toolbar": 0,
|
||||||
|
"idx": 0,
|
||||||
|
"image_view": 0,
|
||||||
|
"in_create": 0,
|
||||||
|
"is_submittable": 0,
|
||||||
|
"issingle": 0,
|
||||||
|
"istable": 1,
|
||||||
|
"max_attachments": 0,
|
||||||
|
"modified": "2018-10-24 15:24:56.713277",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Accounts",
|
||||||
|
"name": "Bank Transaction Mapping",
|
||||||
|
"name_case": "",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"permissions": [],
|
||||||
|
"quick_entry": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"read_only_onload": 0,
|
||||||
|
"show_name_in_global_search": 0,
|
||||||
|
"sort_field": "modified",
|
||||||
|
"sort_order": "DESC",
|
||||||
|
"track_changes": 0,
|
||||||
|
"track_seen": 0,
|
||||||
|
"track_views": 0
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
from frappe.model.document import Document
|
||||||
|
|
||||||
|
class BankTransactionMapping(Document):
|
||||||
|
pass
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
{
|
||||||
|
"allow_copy": 0,
|
||||||
|
"allow_events_in_timeline": 0,
|
||||||
|
"allow_guest_to_view": 0,
|
||||||
|
"allow_import": 0,
|
||||||
|
"allow_rename": 0,
|
||||||
|
"beta": 0,
|
||||||
|
"creation": "2018-11-28 08:55:40.815355",
|
||||||
|
"custom": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "DocType",
|
||||||
|
"document_type": "",
|
||||||
|
"editable_grid": 1,
|
||||||
|
"engine": "InnoDB",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "payment_document",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Payment Document",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "DocType",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 1,
|
||||||
|
"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,
|
||||||
|
"fieldname": "payment_entry",
|
||||||
|
"fieldtype": "Dynamic Link",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Payment Entry",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "payment_document",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 1,
|
||||||
|
"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,
|
||||||
|
"fieldname": "allocated_amount",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 1,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Allocated 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": 1,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
|
"unique": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"has_web_view": 0,
|
||||||
|
"hide_heading": 0,
|
||||||
|
"hide_toolbar": 0,
|
||||||
|
"idx": 0,
|
||||||
|
"image_view": 0,
|
||||||
|
"in_create": 0,
|
||||||
|
"is_submittable": 0,
|
||||||
|
"issingle": 0,
|
||||||
|
"istable": 1,
|
||||||
|
"max_attachments": 0,
|
||||||
|
"modified": "2018-12-06 10:57:02.635141",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Accounts",
|
||||||
|
"name": "Bank Transaction Payments",
|
||||||
|
"name_case": "",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"permissions": [],
|
||||||
|
"quick_entry": 1,
|
||||||
|
"read_only": 0,
|
||||||
|
"read_only_onload": 0,
|
||||||
|
"show_name_in_global_search": 0,
|
||||||
|
"sort_field": "modified",
|
||||||
|
"sort_order": "DESC",
|
||||||
|
"track_changes": 1,
|
||||||
|
"track_seen": 0,
|
||||||
|
"track_views": 0
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
from frappe.model.document import Document
|
||||||
|
|
||||||
|
class BankTransactionPayments(Document):
|
||||||
|
pass
|
||||||
@@ -536,9 +536,13 @@ class PaymentEntry(AccountsController):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_outstanding_reference_documents(args):
|
def get_outstanding_reference_documents(args):
|
||||||
|
|
||||||
if isinstance(args, string_types):
|
if isinstance(args, string_types):
|
||||||
args = json.loads(args)
|
args = json.loads(args)
|
||||||
|
|
||||||
|
if args.get('party_type') == 'Member':
|
||||||
|
return
|
||||||
|
|
||||||
# confirm that Supplier is not blocked
|
# confirm that Supplier is not blocked
|
||||||
if args.get('party_type') == 'Supplier':
|
if args.get('party_type') == 'Supplier':
|
||||||
supplier_status = get_supplier_block_status(args['party'])
|
supplier_status = get_supplier_block_status(args['party'])
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class PaymentReconciliation(Document):
|
|||||||
bank_account_condition = "t2.against_account like %(bank_cash_account)s" \
|
bank_account_condition = "t2.against_account like %(bank_cash_account)s" \
|
||||||
if self.bank_cash_account else "1=1"
|
if self.bank_cash_account else "1=1"
|
||||||
|
|
||||||
limit_cond = "limit %s" % (self.limit or 1000)
|
limit_cond = "limit %s" % self.limit if self.limit else ""
|
||||||
|
|
||||||
journal_entries = frappe.db.sql("""
|
journal_entries = frappe.db.sql("""
|
||||||
select
|
select
|
||||||
@@ -83,7 +83,10 @@ class PaymentReconciliation(Document):
|
|||||||
condition = self.check_condition()
|
condition = self.check_condition()
|
||||||
|
|
||||||
non_reconciled_invoices = get_outstanding_invoices(self.party_type, self.party,
|
non_reconciled_invoices = get_outstanding_invoices(self.party_type, self.party,
|
||||||
self.receivable_payable_account, condition=condition, limit=self.limit)
|
self.receivable_payable_account, condition=condition)
|
||||||
|
|
||||||
|
if self.limit:
|
||||||
|
non_reconciled_invoices = non_reconciled_invoices[:self.limit]
|
||||||
|
|
||||||
self.add_invoice_entries(non_reconciled_invoices)
|
self.add_invoice_entries(non_reconciled_invoices)
|
||||||
|
|
||||||
|
|||||||
@@ -522,8 +522,13 @@ frappe.ui.form.on("Purchase Invoice", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onload: function(frm) {
|
onload: function(frm) {
|
||||||
if(frm.doc.__onload && !frm.doc.__onload.supplier_tds) {
|
if(frm.doc.__onload) {
|
||||||
me.frm.set_df_property("apply_tds", "read_only", 1);
|
if(frm.doc.supplier) {
|
||||||
|
frm.doc.apply_tds = frm.doc.__onload.supplier_tds ? 1 : 0;
|
||||||
|
}
|
||||||
|
if(!frm.doc.__onload.supplier_tds) {
|
||||||
|
frm.set_df_property("apply_tds", "read_only", 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
erpnext.queries.setup_queries(frm, "Warehouse", function() {
|
erpnext.queries.setup_queries(frm, "Warehouse", function() {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -789,9 +789,8 @@ class PurchaseInvoice(BuyingController):
|
|||||||
for d in self.items:
|
for d in self.items:
|
||||||
if d.project and d.project not in project_list:
|
if d.project and d.project not in project_list:
|
||||||
project = frappe.get_doc("Project", d.project)
|
project = frappe.get_doc("Project", d.project)
|
||||||
project.flags.dont_sync_tasks = True
|
|
||||||
project.update_purchase_costing()
|
project.update_purchase_costing()
|
||||||
project.save()
|
project.db_update()
|
||||||
project_list.append(d.project)
|
project_list.append(d.project)
|
||||||
|
|
||||||
def validate_supplier_invoice(self):
|
def validate_supplier_invoice(self):
|
||||||
|
|||||||
@@ -344,6 +344,7 @@ class TestPurchaseInvoice(unittest.TestCase):
|
|||||||
|
|
||||||
pi = frappe.copy_doc(test_records[0])
|
pi = frappe.copy_doc(test_records[0])
|
||||||
pi.disable_rounded_total = 1
|
pi.disable_rounded_total = 1
|
||||||
|
pi.allocate_advances_automatically = 0
|
||||||
pi.append("advances", {
|
pi.append("advances", {
|
||||||
"reference_type": "Journal Entry",
|
"reference_type": "Journal Entry",
|
||||||
"reference_name": jv.name,
|
"reference_name": jv.name,
|
||||||
@@ -383,6 +384,7 @@ class TestPurchaseInvoice(unittest.TestCase):
|
|||||||
|
|
||||||
pi = frappe.copy_doc(test_records[0])
|
pi = frappe.copy_doc(test_records[0])
|
||||||
pi.disable_rounded_total = 1
|
pi.disable_rounded_total = 1
|
||||||
|
pi.allocate_advances_automatically = 0
|
||||||
pi.append("advances", {
|
pi.append("advances", {
|
||||||
"reference_type": "Journal Entry",
|
"reference_type": "Journal Entry",
|
||||||
"reference_name": jv.name,
|
"reference_name": jv.name,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1022,9 +1022,8 @@ class SalesInvoice(SellingController):
|
|||||||
def update_project(self):
|
def update_project(self):
|
||||||
if self.project:
|
if self.project:
|
||||||
project = frappe.get_doc("Project", self.project)
|
project = frappe.get_doc("Project", self.project)
|
||||||
project.flags.dont_sync_tasks = True
|
|
||||||
project.update_billed_amount()
|
project.update_billed_amount()
|
||||||
project.save()
|
project.db_update()
|
||||||
|
|
||||||
|
|
||||||
def verify_payment_amount_is_positive(self):
|
def verify_payment_amount_is_positive(self):
|
||||||
|
|||||||
@@ -855,6 +855,7 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
jv.submit()
|
jv.submit()
|
||||||
|
|
||||||
si = frappe.copy_doc(test_records[0])
|
si = frappe.copy_doc(test_records[0])
|
||||||
|
si.allocate_advances_automatically = 0
|
||||||
si.append("advances", {
|
si.append("advances", {
|
||||||
"doctype": "Sales Invoice Advance",
|
"doctype": "Sales Invoice Advance",
|
||||||
"reference_type": "Journal Entry",
|
"reference_type": "Journal Entry",
|
||||||
@@ -1361,7 +1362,7 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
"included_in_print_rate": 1
|
"included_in_print_rate": 1
|
||||||
})
|
})
|
||||||
si.save()
|
si.save()
|
||||||
|
si.submit()
|
||||||
self.assertEqual(si.net_total, 19453.13)
|
self.assertEqual(si.net_total, 19453.13)
|
||||||
self.assertEqual(si.grand_total, 24900)
|
self.assertEqual(si.grand_total, 24900)
|
||||||
self.assertEqual(si.total_taxes_and_charges, 5446.88)
|
self.assertEqual(si.total_taxes_and_charges, 5446.88)
|
||||||
@@ -1383,6 +1384,50 @@ class TestSalesInvoice(unittest.TestCase):
|
|||||||
self.assertEqual(expected_values[gle.account][1], gle.debit)
|
self.assertEqual(expected_values[gle.account][1], gle.debit)
|
||||||
self.assertEqual(expected_values[gle.account][2], gle.credit)
|
self.assertEqual(expected_values[gle.account][2], gle.credit)
|
||||||
|
|
||||||
|
def test_rounding_adjustment_2(self):
|
||||||
|
si = create_sales_invoice(rate=400, do_not_save=True)
|
||||||
|
for rate in [400, 600, 100]:
|
||||||
|
si.append("items", {
|
||||||
|
"item_code": "_Test Item",
|
||||||
|
"gst_hsn_code": "999800",
|
||||||
|
"warehouse": "_Test Warehouse - _TC",
|
||||||
|
"qty": 1,
|
||||||
|
"rate": rate,
|
||||||
|
"income_account": "Sales - _TC",
|
||||||
|
"cost_center": "_Test Cost Center - _TC"
|
||||||
|
})
|
||||||
|
for tax_account in ["_Test Account VAT - _TC", "_Test Account Service Tax - _TC"]:
|
||||||
|
si.append("taxes", {
|
||||||
|
"charge_type": "On Net Total",
|
||||||
|
"account_head": tax_account,
|
||||||
|
"description": tax_account,
|
||||||
|
"rate": 9,
|
||||||
|
"cost_center": "_Test Cost Center - _TC",
|
||||||
|
"included_in_print_rate": 1
|
||||||
|
})
|
||||||
|
si.save()
|
||||||
|
si.submit()
|
||||||
|
self.assertEqual(si.net_total, 1271.19)
|
||||||
|
self.assertEqual(si.grand_total, 1500)
|
||||||
|
self.assertEqual(si.total_taxes_and_charges, 228.82)
|
||||||
|
self.assertEqual(si.rounding_adjustment, -0.01)
|
||||||
|
|
||||||
|
expected_values = dict((d[0], d) for d in [
|
||||||
|
[si.debit_to, 1500, 0.0],
|
||||||
|
["_Test Account Service Tax - _TC", 0.0, 114.41],
|
||||||
|
["_Test Account VAT - _TC", 0.0, 114.41],
|
||||||
|
["Sales - _TC", 0.0, 1271.18]
|
||||||
|
])
|
||||||
|
|
||||||
|
gl_entries = frappe.db.sql("""select account, debit, credit
|
||||||
|
from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s
|
||||||
|
order by account asc""", si.name, as_dict=1)
|
||||||
|
|
||||||
|
for gle in gl_entries:
|
||||||
|
self.assertEqual(expected_values[gle.account][0], gle.account)
|
||||||
|
self.assertEqual(expected_values[gle.account][1], gle.debit)
|
||||||
|
self.assertEqual(expected_values[gle.account][2], gle.credit)
|
||||||
|
|
||||||
def test_sales_invoice_with_shipping_rule(self):
|
def test_sales_invoice_with_shipping_rule(self):
|
||||||
from erpnext.accounts.doctype.shipping_rule.test_shipping_rule \
|
from erpnext.accounts.doctype.shipping_rule.test_shipping_rule \
|
||||||
import create_shipping_rule
|
import create_shipping_rule
|
||||||
|
|||||||
@@ -295,7 +295,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2019-03-06 15:58:37.839241",
|
"modified": "2019-03-19 14:54:56.524556",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Sales Invoice Payment",
|
"name": "Sales Invoice Payment",
|
||||||
|
|||||||
@@ -135,9 +135,9 @@ def round_off_debit_credit(gl_map):
|
|||||||
.format(gl_map[0].voucher_type, gl_map[0].voucher_no, debit_credit_diff))
|
.format(gl_map[0].voucher_type, gl_map[0].voucher_no, debit_credit_diff))
|
||||||
|
|
||||||
elif abs(debit_credit_diff) >= (1.0 / (10**precision)):
|
elif abs(debit_credit_diff) >= (1.0 / (10**precision)):
|
||||||
make_round_off_gle(gl_map, debit_credit_diff)
|
make_round_off_gle(gl_map, debit_credit_diff, precision)
|
||||||
|
|
||||||
def make_round_off_gle(gl_map, debit_credit_diff):
|
def make_round_off_gle(gl_map, debit_credit_diff, precision):
|
||||||
round_off_account, round_off_cost_center = get_round_off_account_and_cost_center(gl_map[0].company)
|
round_off_account, round_off_cost_center = get_round_off_account_and_cost_center(gl_map[0].company)
|
||||||
round_off_account_exists = False
|
round_off_account_exists = False
|
||||||
round_off_gle = frappe._dict()
|
round_off_gle = frappe._dict()
|
||||||
@@ -150,6 +150,10 @@ def make_round_off_gle(gl_map, debit_credit_diff):
|
|||||||
debit_credit_diff += flt(d.credit_in_account_currency)
|
debit_credit_diff += flt(d.credit_in_account_currency)
|
||||||
round_off_account_exists = True
|
round_off_account_exists = True
|
||||||
|
|
||||||
|
if round_off_account_exists and abs(debit_credit_diff) <= (1.0 / (10**precision)):
|
||||||
|
gl_map.remove(round_off_gle)
|
||||||
|
return
|
||||||
|
|
||||||
if not round_off_gle:
|
if not round_off_gle:
|
||||||
for k in ["voucher_type", "voucher_no", "company",
|
for k in ["voucher_type", "voucher_no", "company",
|
||||||
"posting_date", "remarks", "is_opening"]:
|
"posting_date", "remarks", "is_opening"]:
|
||||||
|
|||||||
572
erpnext/accounts/page/bank_reconciliation/bank_reconciliation.js
Normal file
572
erpnext/accounts/page/bank_reconciliation/bank_reconciliation.js
Normal file
@@ -0,0 +1,572 @@
|
|||||||
|
frappe.provide("erpnext.accounts");
|
||||||
|
|
||||||
|
frappe.pages['bank-reconciliation'].on_page_load = function(wrapper) {
|
||||||
|
new erpnext.accounts.bankReconciliation(wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
erpnext.accounts.bankReconciliation = class BankReconciliation {
|
||||||
|
constructor(wrapper) {
|
||||||
|
this.page = frappe.ui.make_app_page({
|
||||||
|
parent: wrapper,
|
||||||
|
title: __("Bank Reconciliation"),
|
||||||
|
single_column: true
|
||||||
|
});
|
||||||
|
this.parent = wrapper;
|
||||||
|
this.page = this.parent.page;
|
||||||
|
|
||||||
|
this.check_plaid_status();
|
||||||
|
this.make();
|
||||||
|
}
|
||||||
|
|
||||||
|
make() {
|
||||||
|
const me = this;
|
||||||
|
|
||||||
|
me.$main_section = $(`<div class="reconciliation page-main-content"></div>`).appendTo(me.page.main);
|
||||||
|
const empty_state = __("Upload a bank statement, link or reconcile a bank account")
|
||||||
|
me.$main_section.append(`<div class="flex justify-center align-center text-muted"
|
||||||
|
style="height: 50vh; display: flex;"><h5 class="text-muted">${empty_state}</h5></div>`)
|
||||||
|
|
||||||
|
me.page.add_field({
|
||||||
|
fieldtype: 'Link',
|
||||||
|
label: __('Company'),
|
||||||
|
fieldname: 'company',
|
||||||
|
options: "Company",
|
||||||
|
onchange: function() {
|
||||||
|
console.log(this.value)
|
||||||
|
if (this.value) {
|
||||||
|
me.company = this.value;
|
||||||
|
} else {
|
||||||
|
me.company = null;
|
||||||
|
me.bank_account = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
me.page.add_field({
|
||||||
|
fieldtype: 'Link',
|
||||||
|
label: __('Bank Account'),
|
||||||
|
fieldname: 'bank_account',
|
||||||
|
options: "Bank Account",
|
||||||
|
get_query: function() {
|
||||||
|
if(!me.company) {
|
||||||
|
frappe.throw(__("Please select company first"));
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
"company": me.company
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onchange: function() {
|
||||||
|
if (this.value) {
|
||||||
|
me.bank_account = this.value;
|
||||||
|
me.add_actions();
|
||||||
|
} else {
|
||||||
|
me.bank_account = null;
|
||||||
|
me.page.hide_actions_menu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
check_plaid_status() {
|
||||||
|
const me = this;
|
||||||
|
frappe.db.get_value("Plaid Settings", "Plaid Settings", "enabled", (r) => {
|
||||||
|
if (r && r.enabled == "1") {
|
||||||
|
me.plaid_status = "active"
|
||||||
|
} else {
|
||||||
|
me.plaid_status = "inactive"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
add_actions() {
|
||||||
|
const me = this;
|
||||||
|
|
||||||
|
me.page.show_menu()
|
||||||
|
|
||||||
|
me.page.add_menu_item(__("Upload a statement"), function() {
|
||||||
|
me.clear_page_content();
|
||||||
|
new erpnext.accounts.bankTransactionUpload(me);
|
||||||
|
}, true)
|
||||||
|
|
||||||
|
if (me.plaid_status==="active") {
|
||||||
|
me.page.add_menu_item(__("Synchronize this account"), function() {
|
||||||
|
me.clear_page_content();
|
||||||
|
new erpnext.accounts.bankTransactionSync(me);
|
||||||
|
}, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
me.page.add_menu_item(__("Reconcile this account"), function() {
|
||||||
|
me.clear_page_content();
|
||||||
|
me.make_reconciliation_tool();
|
||||||
|
}, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
clear_page_content() {
|
||||||
|
const me = this;
|
||||||
|
$(me.page.body).find('.frappe-list').remove();
|
||||||
|
me.$main_section.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
make_reconciliation_tool() {
|
||||||
|
const me = this;
|
||||||
|
frappe.model.with_doctype("Bank Transaction", () => {
|
||||||
|
erpnext.accounts.ReconciliationList = new erpnext.accounts.ReconciliationTool({
|
||||||
|
parent: me.parent,
|
||||||
|
doctype: "Bank Transaction"
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
erpnext.accounts.bankTransactionUpload = class bankTransactionUpload {
|
||||||
|
constructor(parent) {
|
||||||
|
this.parent = parent;
|
||||||
|
this.data = [];
|
||||||
|
|
||||||
|
const assets = [
|
||||||
|
"/assets/frappe/css/frappe-datatable.css",
|
||||||
|
"/assets/frappe/js/lib/clusterize.min.js",
|
||||||
|
"/assets/frappe/js/lib/Sortable.min.js",
|
||||||
|
"/assets/frappe/js/lib/frappe-datatable.js"
|
||||||
|
];
|
||||||
|
|
||||||
|
frappe.require(assets, () => {
|
||||||
|
this.make();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
make() {
|
||||||
|
const me = this;
|
||||||
|
frappe.upload.make({
|
||||||
|
args: {
|
||||||
|
method: 'erpnext.accounts.doctype.bank_transaction.bank_transaction_upload.upload_bank_statement',
|
||||||
|
allow_multiple: 0
|
||||||
|
},
|
||||||
|
no_socketio: true,
|
||||||
|
sample_url: "e.g. http://example.com/somefile.csv",
|
||||||
|
callback: function(attachment, r) {
|
||||||
|
if (!r.exc && r.message) {
|
||||||
|
me.data = r.message;
|
||||||
|
me.setup_transactions_dom();
|
||||||
|
me.create_datatable();
|
||||||
|
me.add_primary_action();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_transactions_dom() {
|
||||||
|
const me = this;
|
||||||
|
me.parent.$main_section.append(`<div class="transactions-table"></div>`)
|
||||||
|
}
|
||||||
|
|
||||||
|
create_datatable() {
|
||||||
|
try {
|
||||||
|
this.datatable = new DataTable('.transactions-table', {
|
||||||
|
columns: this.data.columns,
|
||||||
|
data: this.data.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
catch(err) {
|
||||||
|
let msg = __(`Your file could not be processed by ERPNext.
|
||||||
|
<br>It should be a standard CSV or XLSX file.
|
||||||
|
<br>The headers should be in the first row.`)
|
||||||
|
frappe.throw(msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
add_primary_action() {
|
||||||
|
const me = this;
|
||||||
|
me.parent.page.set_primary_action(__("Submit"), function() {
|
||||||
|
me.add_bank_entries()
|
||||||
|
}, null, __("Creating bank entries..."))
|
||||||
|
}
|
||||||
|
|
||||||
|
add_bank_entries() {
|
||||||
|
const me = this;
|
||||||
|
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}
|
||||||
|
).then((result) => {
|
||||||
|
let result_title = __("{0} bank transaction(s) created", [result])
|
||||||
|
let result_msg = `
|
||||||
|
<div class="flex justify-center align-center text-muted" style="height: 50vh; display: flex;">
|
||||||
|
<h5 class="text-muted">${result_title}</h5>
|
||||||
|
</div>`
|
||||||
|
me.parent.page.clear_primary_action();
|
||||||
|
me.parent.$main_section.empty();
|
||||||
|
me.parent.$main_section.append(result_msg);
|
||||||
|
frappe.show_alert({message:__("All bank transactions have been created"), indicator:'green'});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
erpnext.accounts.bankTransactionSync = class bankTransactionSync {
|
||||||
|
constructor(parent) {
|
||||||
|
this.parent = parent;
|
||||||
|
this.data = [];
|
||||||
|
|
||||||
|
this.init_config()
|
||||||
|
}
|
||||||
|
|
||||||
|
init_config() {
|
||||||
|
const me = this;
|
||||||
|
frappe.xcall('erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.plaid_configuration')
|
||||||
|
.then(result => {
|
||||||
|
me.plaid_env = result.plaid_env;
|
||||||
|
me.plaid_public_key = result.plaid_public_key;
|
||||||
|
me.client_name = result.client_name;
|
||||||
|
me.sync_transactions()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
sync_transactions() {
|
||||||
|
const me = this;
|
||||||
|
frappe.db.get_value("Bank Account", me.parent.bank_account, "bank", (v) => {
|
||||||
|
frappe.xcall('erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.sync_transactions', {
|
||||||
|
bank: v['bank'],
|
||||||
|
bank_account: me.parent.bank_account,
|
||||||
|
freeze: true
|
||||||
|
})
|
||||||
|
.then((result) => {
|
||||||
|
let result_title = (result.length > 0) ? __("{0} bank transaction(s) created", [result.length]) : __("This bank account is already synchronized")
|
||||||
|
let result_msg = `
|
||||||
|
<div class="flex justify-center align-center text-muted" style="height: 50vh; display: flex;">
|
||||||
|
<h5 class="text-muted">${result_title}</h5>
|
||||||
|
</div>`
|
||||||
|
this.parent.$main_section.append(result_msg)
|
||||||
|
frappe.show_alert({message:__("Bank account '{0}' has been synchronized", [me.parent.bank_account]), indicator:'green'});
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
erpnext.accounts.ReconciliationTool = class ReconciliationTool extends frappe.views.BaseList {
|
||||||
|
constructor(opts) {
|
||||||
|
super(opts);
|
||||||
|
this.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_defaults() {
|
||||||
|
super.setup_defaults();
|
||||||
|
|
||||||
|
this.page_title = __("Bank Reconciliation");
|
||||||
|
this.doctype = 'Bank Transaction';
|
||||||
|
this.fields = ['date', 'description', 'debit', 'credit', 'currency']
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_view() {
|
||||||
|
this.render_header();
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_side_bar() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
make_standard_filters() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
freeze() {
|
||||||
|
this.$result.find('.list-count').html(`<span>${__('Refreshing')}...</span>`);
|
||||||
|
}
|
||||||
|
|
||||||
|
get_args() {
|
||||||
|
const args = super.get_args();
|
||||||
|
|
||||||
|
return Object.assign({}, args, {
|
||||||
|
...args.filters.push(["Bank Transaction", "docstatus", "=", 1],
|
||||||
|
["Bank Transaction", "unallocated_amount", ">", 0])
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
update_data(r) {
|
||||||
|
let data = r.message || [];
|
||||||
|
|
||||||
|
if (this.start === 0) {
|
||||||
|
this.data = data;
|
||||||
|
} else {
|
||||||
|
this.data = this.data.concat(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const me = this;
|
||||||
|
this.$result.find('.list-row-container').remove();
|
||||||
|
$('[data-fieldname="name"]').remove();
|
||||||
|
me.data.map((value) => {
|
||||||
|
const row = $('<div class="list-row-container">').data("data", value).appendTo(me.$result).get(0);
|
||||||
|
new erpnext.accounts.ReconciliationRow(row, value);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
render_header() {
|
||||||
|
const me = this;
|
||||||
|
if ($(this.wrapper).find('.transaction-header').length === 0) {
|
||||||
|
me.$result.append(frappe.render_template("bank_transaction_header"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
erpnext.accounts.ReconciliationRow = class ReconciliationRow {
|
||||||
|
constructor(row, data) {
|
||||||
|
this.data = data;
|
||||||
|
this.row = row;
|
||||||
|
this.make();
|
||||||
|
this.bind_events();
|
||||||
|
}
|
||||||
|
|
||||||
|
make() {
|
||||||
|
$(this.row).append(frappe.render_template("bank_transaction_row", this.data))
|
||||||
|
}
|
||||||
|
|
||||||
|
bind_events() {
|
||||||
|
const me = this;
|
||||||
|
$(me.row).on('click', '.clickable-section', function() {
|
||||||
|
me.bank_entry = $(this).attr("data-name");
|
||||||
|
me.show_dialog($(this).attr("data-name"));
|
||||||
|
})
|
||||||
|
|
||||||
|
$(me.row).on('click', '.new-reconciliation', function() {
|
||||||
|
me.bank_entry = $(this).attr("data-name");
|
||||||
|
me.show_dialog($(this).attr("data-name"));
|
||||||
|
})
|
||||||
|
|
||||||
|
$(me.row).on('click', '.new-payment', function() {
|
||||||
|
me.bank_entry = $(this).attr("data-name");
|
||||||
|
me.new_payment();
|
||||||
|
})
|
||||||
|
|
||||||
|
$(me.row).on('click', '.new-invoice', function() {
|
||||||
|
me.bank_entry = $(this).attr("data-name");
|
||||||
|
me.new_invoice();
|
||||||
|
})
|
||||||
|
|
||||||
|
$(me.row).on('click', '.new-expense', function() {
|
||||||
|
me.bank_entry = $(this).attr("data-name");
|
||||||
|
me.new_expense();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
new_payment() {
|
||||||
|
const me = this;
|
||||||
|
const paid_amount = me.data.credit > 0 ? me.data.credit : me.data.debit;
|
||||||
|
const payment_type = me.data.credit > 0 ? "Receive": "Pay";
|
||||||
|
const party_type = me.data.credit > 0 ? "Customer": "Supplier";
|
||||||
|
|
||||||
|
frappe.new_doc("Payment Entry", {"payment_type": payment_type, "paid_amount": paid_amount,
|
||||||
|
"party_type": party_type, "paid_from": me.data.bank_account})
|
||||||
|
}
|
||||||
|
|
||||||
|
new_invoice() {
|
||||||
|
const me = this;
|
||||||
|
const invoice_type = me.data.credit > 0 ? "Sales Invoice" : "Purchase Invoice";
|
||||||
|
|
||||||
|
frappe.new_doc(invoice_type)
|
||||||
|
}
|
||||||
|
|
||||||
|
new_expense() {
|
||||||
|
frappe.new_doc("Expense Claim")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
show_dialog(data) {
|
||||||
|
const me = this;
|
||||||
|
|
||||||
|
frappe.db.get_value("Bank Account", me.data.bank_account, "account", (r) => {
|
||||||
|
me.gl_account = r.account;
|
||||||
|
})
|
||||||
|
|
||||||
|
frappe.xcall('erpnext.accounts.page.bank_reconciliation.bank_reconciliation.get_linked_payments',
|
||||||
|
{bank_transaction: data, freeze:true, freeze_message:__("Finding linked payments")}
|
||||||
|
).then((result) => {
|
||||||
|
me.make_dialog(result)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
make_dialog(data) {
|
||||||
|
const me = this;
|
||||||
|
me.selected_payment = null;
|
||||||
|
|
||||||
|
const fields = [
|
||||||
|
{
|
||||||
|
fieldtype: 'Section Break',
|
||||||
|
fieldname: 'section_break_1',
|
||||||
|
label: __('Automatic Reconciliation')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldtype: 'HTML',
|
||||||
|
fieldname: 'payment_proposals'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldtype: 'Section Break',
|
||||||
|
fieldname: 'section_break_2',
|
||||||
|
label: __('Search for a payment')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldtype: 'Link',
|
||||||
|
fieldname: 'payment_doctype',
|
||||||
|
options: 'DocType',
|
||||||
|
label: 'Payment DocType',
|
||||||
|
get_query: () => {
|
||||||
|
return {
|
||||||
|
filters : {
|
||||||
|
"name": ["in", ["Payment Entry", "Journal Entry", "Sales Invoice", "Purchase Invoice", "Expense Claim"]]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldtype: 'Column Break',
|
||||||
|
fieldname: 'column_break_1',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldtype: 'Dynamic Link',
|
||||||
|
fieldname: 'payment_entry',
|
||||||
|
options: 'payment_doctype',
|
||||||
|
label: 'Payment Document',
|
||||||
|
get_query: () => {
|
||||||
|
let dt = this.dialog.fields_dict.payment_doctype.value;
|
||||||
|
if (dt === "Payment Entry") {
|
||||||
|
return {
|
||||||
|
query: "erpnext.accounts.page.bank_reconciliation.bank_reconciliation.payment_entry_query",
|
||||||
|
filters : {
|
||||||
|
"bank_account": this.data.bank_account,
|
||||||
|
"company": this.data.company
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (dt === "Journal Entry") {
|
||||||
|
return {
|
||||||
|
query: "erpnext.accounts.page.bank_reconciliation.bank_reconciliation.journal_entry_query",
|
||||||
|
filters : {
|
||||||
|
"bank_account": this.data.bank_account,
|
||||||
|
"company": this.data.company
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (dt === "Sales Invoice") {
|
||||||
|
return {
|
||||||
|
query: "erpnext.accounts.page.bank_reconciliation.bank_reconciliation.sales_invoices_query"
|
||||||
|
}
|
||||||
|
} else if (dt === "Purchase Invoice") {
|
||||||
|
return {
|
||||||
|
filters : [
|
||||||
|
["Purchase Invoice", "ifnull(clearance_date, '')", "=", ""],
|
||||||
|
["Purchase Invoice", "docstatus", "=", 1],
|
||||||
|
["Purchase Invoice", "company", "=", this.data.company]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
} else if (dt === "Expense Claim") {
|
||||||
|
return {
|
||||||
|
filters : [
|
||||||
|
["Expense Claim", "ifnull(clearance_date, '')", "=", ""],
|
||||||
|
["Expense Claim", "docstatus", "=", 1],
|
||||||
|
["Expense Claim", "company", "=", this.data.company]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onchange: function() {
|
||||||
|
if (me.selected_payment !== this.value) {
|
||||||
|
me.selected_payment = this.value;
|
||||||
|
me.display_payment_details(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldtype: 'Section Break',
|
||||||
|
fieldname: 'section_break_3'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldtype: 'HTML',
|
||||||
|
fieldname: 'payment_details'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
me.dialog = new frappe.ui.Dialog({
|
||||||
|
title: __("Choose a corresponding payment"),
|
||||||
|
fields: fields,
|
||||||
|
size: "large"
|
||||||
|
});
|
||||||
|
|
||||||
|
const proposals_wrapper = me.dialog.fields_dict.payment_proposals.$wrapper;
|
||||||
|
if (data && data.length > 0) {
|
||||||
|
proposals_wrapper.append(frappe.render_template("linked_payment_header"));
|
||||||
|
data.map(value => {
|
||||||
|
proposals_wrapper.append(frappe.render_template("linked_payment_row", value))
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
const empty_data_msg = __("ERPNext could not find any matching payment entry")
|
||||||
|
proposals_wrapper.append(`<div class="text-center"><h5 class="text-muted">${empty_data_msg}</h5></div>`)
|
||||||
|
}
|
||||||
|
|
||||||
|
$(me.dialog.body).on('click', '.reconciliation-btn', (e) => {
|
||||||
|
const payment_entry = $(e.target).attr('data-name');
|
||||||
|
const payment_doctype = $(e.target).attr('data-doctype');
|
||||||
|
frappe.xcall('erpnext.accounts.page.bank_reconciliation.bank_reconciliation.reconcile',
|
||||||
|
{bank_transaction: me.bank_entry, payment_doctype: payment_doctype, payment_name: payment_entry})
|
||||||
|
.then((result) => {
|
||||||
|
setTimeout(function(){
|
||||||
|
erpnext.accounts.ReconciliationList.refresh();
|
||||||
|
}, 2000);
|
||||||
|
me.dialog.hide();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
me.dialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
display_payment_details(event) {
|
||||||
|
const me = this;
|
||||||
|
if (event.value) {
|
||||||
|
let dt = me.dialog.fields_dict.payment_doctype.value;
|
||||||
|
me.dialog.fields_dict['payment_details'].$wrapper.empty();
|
||||||
|
frappe.db.get_doc(dt, event.value)
|
||||||
|
.then(doc => {
|
||||||
|
let displayed_docs = []
|
||||||
|
if (dt === "Payment Entry") {
|
||||||
|
doc.currency = doc.payment_type == "Receive" ? doc.paid_to_account_currency : doc.paid_from_account_currency;
|
||||||
|
displayed_docs.push(doc);
|
||||||
|
} else if (dt === "Journal Entry") {
|
||||||
|
doc.accounts.forEach(payment => {
|
||||||
|
if (payment.account === me.gl_account) {
|
||||||
|
payment.posting_date = doc.posting_date;
|
||||||
|
payment.party = doc.pay_to_recd_from;
|
||||||
|
payment.reference_no = doc.cheque_no;
|
||||||
|
payment.reference_date = doc.cheque_date;
|
||||||
|
payment.currency = payment.account_currency;
|
||||||
|
payment.paid_amount = payment.credit > 0 ? payment.credit : payment.debit;
|
||||||
|
payment.name = doc.name;
|
||||||
|
displayed_docs.push(payment);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else if (dt === "Sales Invoice") {
|
||||||
|
doc.payments.forEach(payment => {
|
||||||
|
if (payment.clearance_date === null || payment.clearance_date === "") {
|
||||||
|
payment.posting_date = doc.posting_date;
|
||||||
|
payment.party = doc.customer;
|
||||||
|
payment.reference_no = doc.remarks;
|
||||||
|
payment.currency = doc.currency;
|
||||||
|
payment.paid_amount = payment.amount;
|
||||||
|
payment.name = doc.name;
|
||||||
|
displayed_docs.push(payment);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const details_wrapper = me.dialog.fields_dict.payment_details.$wrapper;
|
||||||
|
details_wrapper.append(frappe.render_template("linked_payment_header"));
|
||||||
|
displayed_docs.forEach(values => {
|
||||||
|
details_wrapper.append(frappe.render_template("linked_payment_row", values));
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"content": null,
|
||||||
|
"creation": "2018-11-24 12:03:14.646669",
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "Page",
|
||||||
|
"idx": 0,
|
||||||
|
"modified": "2018-11-24 12:03:14.646669",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Accounts",
|
||||||
|
"name": "bank-reconciliation",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"page_name": "bank-reconciliation",
|
||||||
|
"roles": [
|
||||||
|
{
|
||||||
|
"role": "System Manager"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Accounts Manager"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Accounts User"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"script": null,
|
||||||
|
"standard": "Yes",
|
||||||
|
"style": null,
|
||||||
|
"system_page": 0,
|
||||||
|
"title": "Bank Reconciliation"
|
||||||
|
}
|
||||||
385
erpnext/accounts/page/bank_reconciliation/bank_reconciliation.py
Normal file
385
erpnext/accounts/page/bank_reconciliation/bank_reconciliation.py
Normal file
@@ -0,0 +1,385 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
from frappe import _
|
||||||
|
import difflib
|
||||||
|
from frappe.utils import flt
|
||||||
|
from six import iteritems
|
||||||
|
from erpnext import get_company_currency
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def reconcile(bank_transaction, payment_doctype, payment_name):
|
||||||
|
transaction = frappe.get_doc("Bank Transaction", bank_transaction)
|
||||||
|
payment_entry = frappe.get_doc(payment_doctype, payment_name)
|
||||||
|
|
||||||
|
account = frappe.db.get_value("Bank Account", transaction.bank_account, "account")
|
||||||
|
gl_entry = frappe.get_doc("GL Entry", dict(account=account, voucher_type=payment_doctype, voucher_no=payment_name))
|
||||||
|
|
||||||
|
if transaction.unallocated_amount == 0:
|
||||||
|
frappe.throw(_("This bank transaction is already fully reconciled"))
|
||||||
|
|
||||||
|
if transaction.credit > 0 and gl_entry.credit > 0:
|
||||||
|
frappe.throw(_("The selected payment entry should be linked with a debtor bank transaction"))
|
||||||
|
|
||||||
|
if transaction.debit > 0 and gl_entry.debit > 0:
|
||||||
|
frappe.throw(_("The selected payment entry should be linked with a creditor bank transaction"))
|
||||||
|
|
||||||
|
add_payment_to_transaction(transaction, payment_entry, gl_entry)
|
||||||
|
clear_payment_entry(transaction, payment_entry, gl_entry)
|
||||||
|
|
||||||
|
return 'reconciled'
|
||||||
|
|
||||||
|
def add_payment_to_transaction(transaction, payment_entry, gl_entry):
|
||||||
|
transaction.append("payment_entries", {
|
||||||
|
"payment_document": payment_entry.doctype,
|
||||||
|
"payment_entry": payment_entry.name,
|
||||||
|
"allocated_amount": gl_entry.credit if gl_entry.credit > 0 else gl_entry.debit
|
||||||
|
})
|
||||||
|
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()
|
||||||
|
def get_linked_payments(bank_transaction):
|
||||||
|
transaction = frappe.get_doc("Bank Transaction", bank_transaction)
|
||||||
|
bank_account = frappe.db.get_values("Bank Account", transaction.bank_account, ["account", "company"], as_dict=True)
|
||||||
|
|
||||||
|
# Get all payment entries with a matching amount
|
||||||
|
amount_matching = check_matching_amount(bank_account[0].account, bank_account[0].company, transaction)
|
||||||
|
|
||||||
|
# Get some data from payment entries linked to a corresponding bank transaction
|
||||||
|
description_matching = get_matching_descriptions_data(bank_account[0].account, transaction)
|
||||||
|
|
||||||
|
if amount_matching:
|
||||||
|
return check_amount_vs_description(amount_matching, description_matching)
|
||||||
|
|
||||||
|
elif description_matching:
|
||||||
|
return sorted(description_matching, key = lambda x: x["posting_date"], reverse=True)
|
||||||
|
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
|
||||||
|
def check_matching_amount(bank_account, company, transaction):
|
||||||
|
payments = []
|
||||||
|
amount = transaction.credit if transaction.credit > 0 else transaction.debit
|
||||||
|
|
||||||
|
payment_type = "Receive" if transaction.credit > 0 else "Pay"
|
||||||
|
account_from_to = "paid_to" if transaction.credit > 0 else "paid_from"
|
||||||
|
currency_field = "paid_to_account_currency as currency" if transaction.credit > 0 else "paid_from_account_currency as currency"
|
||||||
|
|
||||||
|
payment_entries = frappe.get_all("Payment Entry", fields=["'Payment Entry' as doctype", "name", "paid_amount", "payment_type", "reference_no", "reference_date",
|
||||||
|
"party", "party_type", "posting_date", "{0}".format(currency_field)], filters=[["paid_amount", "like", "{0}%".format(amount)],
|
||||||
|
["docstatus", "=", "1"], ["payment_type", "=", payment_type], ["ifnull(clearance_date, '')", "=", ""], ["{0}".format(account_from_to), "=", "{0}".format(bank_account)]])
|
||||||
|
|
||||||
|
if transaction.credit > 0:
|
||||||
|
journal_entries = frappe.db.sql("""
|
||||||
|
SELECT
|
||||||
|
'Journal Entry' as doctype, je.name, je.posting_date, je.cheque_no as reference_no,
|
||||||
|
je.pay_to_recd_from as party, je.cheque_date as reference_date, jea.debit_in_account_currency as paid_amount
|
||||||
|
FROM
|
||||||
|
`tabJournal Entry Account` as jea
|
||||||
|
JOIN
|
||||||
|
`tabJournal Entry` as je
|
||||||
|
ON
|
||||||
|
jea.parent = je.name
|
||||||
|
WHERE
|
||||||
|
(je.clearance_date is null or je.clearance_date='0000-00-00')
|
||||||
|
AND
|
||||||
|
jea.account = %s
|
||||||
|
AND
|
||||||
|
jea.debit_in_account_currency like %s
|
||||||
|
AND
|
||||||
|
je.docstatus = 1
|
||||||
|
""", (bank_account, amount), as_dict=True)
|
||||||
|
else:
|
||||||
|
journal_entries = frappe.db.sql("""
|
||||||
|
SELECT
|
||||||
|
'Journal Entry' as doctype, je.name, je.posting_date, je.cheque_no as reference_no,
|
||||||
|
je.pay_to_recd_from as party, je.cheque_date as reference_date, jea.credit_in_account_currency as paid_amount
|
||||||
|
FROM
|
||||||
|
`tabJournal Entry Account` as jea
|
||||||
|
JOIN
|
||||||
|
`tabJournal Entry` as je
|
||||||
|
ON
|
||||||
|
jea.parent = je.name
|
||||||
|
WHERE
|
||||||
|
(je.clearance_date is null or je.clearance_date='0000-00-00')
|
||||||
|
AND
|
||||||
|
jea.account = %s
|
||||||
|
AND
|
||||||
|
jea.credit_in_account_currency like %s
|
||||||
|
AND
|
||||||
|
je.docstatus = 1
|
||||||
|
""", (bank_account, amount), as_dict=True)
|
||||||
|
|
||||||
|
if transaction.credit > 0:
|
||||||
|
sales_invoices = frappe.db.sql("""
|
||||||
|
SELECT
|
||||||
|
'Sales Invoice' as doctype, si.name, si.customer as party,
|
||||||
|
si.posting_date, sip.amount as paid_amount
|
||||||
|
FROM
|
||||||
|
`tabSales Invoice Payment` as sip
|
||||||
|
JOIN
|
||||||
|
`tabSales Invoice` as si
|
||||||
|
ON
|
||||||
|
sip.parent = si.name
|
||||||
|
WHERE
|
||||||
|
(sip.clearance_date is null or sip.clearance_date='0000-00-00')
|
||||||
|
AND
|
||||||
|
sip.account = %s
|
||||||
|
AND
|
||||||
|
sip.amount like %s
|
||||||
|
AND
|
||||||
|
si.docstatus = 1
|
||||||
|
""", (bank_account, amount), as_dict=True)
|
||||||
|
else:
|
||||||
|
sales_invoices = []
|
||||||
|
|
||||||
|
if transaction.debit > 0:
|
||||||
|
purchase_invoices = frappe.get_all("Purchase Invoice",
|
||||||
|
fields = ["'Purchase Invoice' as doctype", "name", "paid_amount", "supplier as party", "posting_date", "currency"],
|
||||||
|
filters=[
|
||||||
|
["paid_amount", "like", "{0}%".format(amount)],
|
||||||
|
["docstatus", "=", "1"],
|
||||||
|
["is_paid", "=", "1"],
|
||||||
|
["ifnull(clearance_date, '')", "=", ""],
|
||||||
|
["cash_bank_account", "=", "{0}".format(bank_account)]
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
mode_of_payments = [x["parent"] for x in frappe.db.get_list("Mode of Payment Account",
|
||||||
|
filters={"default_account": bank_account}, fields=["parent"])]
|
||||||
|
|
||||||
|
company_currency = get_company_currency(company)
|
||||||
|
|
||||||
|
expense_claims = frappe.get_all("Expense Claim",
|
||||||
|
fields=["'Expense Claim' as doctype", "name", "total_sanctioned_amount as paid_amount",
|
||||||
|
"employee as party", "posting_date", "'{0}' as currency".format(company_currency)],
|
||||||
|
filters=[
|
||||||
|
["total_sanctioned_amount", "like", "{0}%".format(amount)],
|
||||||
|
["docstatus", "=", "1"],
|
||||||
|
["is_paid", "=", "1"],
|
||||||
|
["ifnull(clearance_date, '')", "=", ""],
|
||||||
|
["mode_of_payment", "in", "{0}".format(tuple(mode_of_payments))]
|
||||||
|
]
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
purchase_invoices = expense_claims = []
|
||||||
|
|
||||||
|
for data in [payment_entries, journal_entries, sales_invoices, purchase_invoices, expense_claims]:
|
||||||
|
if data:
|
||||||
|
payments.extend(data)
|
||||||
|
|
||||||
|
return payments
|
||||||
|
|
||||||
|
def get_matching_descriptions_data(bank_account, transaction):
|
||||||
|
if not transaction.description :
|
||||||
|
return []
|
||||||
|
|
||||||
|
bank_transactions = frappe.db.sql("""
|
||||||
|
SELECT
|
||||||
|
bt.name, bt.description, bt.date, btp.payment_document, btp.payment_entry
|
||||||
|
FROM
|
||||||
|
`tabBank Transaction` as bt
|
||||||
|
LEFT JOIN
|
||||||
|
`tabBank Transaction Payments` as btp
|
||||||
|
ON
|
||||||
|
bt.name = btp.parent
|
||||||
|
WHERE
|
||||||
|
bt.allocated_amount > 0
|
||||||
|
AND
|
||||||
|
bt.docstatus = 1
|
||||||
|
""", as_dict=True)
|
||||||
|
|
||||||
|
selection = []
|
||||||
|
for bank_transaction in bank_transactions:
|
||||||
|
if bank_transaction.description:
|
||||||
|
seq=difflib.SequenceMatcher(lambda x: x == " ", transaction.description, bank_transaction.description)
|
||||||
|
|
||||||
|
if seq.ratio() > 0.6:
|
||||||
|
bank_transaction["ratio"] = seq.ratio()
|
||||||
|
selection.append(bank_transaction)
|
||||||
|
|
||||||
|
document_types = set([x["payment_document"] for x in selection])
|
||||||
|
|
||||||
|
links = {}
|
||||||
|
for document_type in document_types:
|
||||||
|
links[document_type] = [x["payment_entry"] for x in selection if x["payment_document"]==document_type]
|
||||||
|
|
||||||
|
|
||||||
|
data = []
|
||||||
|
for key, value in iteritems(links):
|
||||||
|
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"]))
|
||||||
|
if key == "Journal Entry":
|
||||||
|
data.extend(frappe.get_all("Journal Entry", filters=[["name", "in", value]], fields=["'Journal Entry' as doctype", "posting_date", "paid_to_recd_from as party", "cheque_no as reference_no", "cheque_date as reference_date"]))
|
||||||
|
if key == "Sales Invoice":
|
||||||
|
data.extend(frappe.get_all("Sales Invoice", filters=[["name", "in", value]], fields=["'Sales Invoice' as doctype", "posting_date", "customer_name as party"]))
|
||||||
|
if key == "Purchase Invoice":
|
||||||
|
data.append(frappe.get_all("Purchase Invoice", filters=[["name", "in", value]], fields=["'Purchase Invoice' as doctype", "posting_date", "supplier_name as party"]))
|
||||||
|
if key == "Purchase Invoice":
|
||||||
|
data.append(frappe.get_all("Expense Claim", filters=[["name", "in", value]], fields=["'Expense Claim' as doctype", "posting_date", "employee_name as party"]))
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
def check_amount_vs_description(amount_matching, description_matching):
|
||||||
|
result = []
|
||||||
|
|
||||||
|
if description_matching:
|
||||||
|
for am_match in amount_matching:
|
||||||
|
for des_match in description_matching:
|
||||||
|
if am_match["party"] == des_match["party"]:
|
||||||
|
if am_match not in result:
|
||||||
|
result.append(am_match)
|
||||||
|
continue
|
||||||
|
|
||||||
|
if hasattr(am_match, "reference_no") and hasattr(des_match, "reference_no"):
|
||||||
|
if difflib.SequenceMatcher(lambda x: x == " ", am_match["reference_no"], des_match["reference_no"]) > 70:
|
||||||
|
if am_match not in result:
|
||||||
|
result.append(am_match)
|
||||||
|
if result:
|
||||||
|
return sorted(result, key = lambda x: x["posting_date"], reverse=True)
|
||||||
|
else:
|
||||||
|
return sorted(amount_matching, key = lambda x: x["posting_date"], reverse=True)
|
||||||
|
|
||||||
|
else:
|
||||||
|
return sorted(amount_matching, key = lambda x: x["posting_date"], reverse=True)
|
||||||
|
|
||||||
|
def get_matching_transactions_payments(description_matching):
|
||||||
|
payments = [x["payment_entry"] for x in description_matching]
|
||||||
|
|
||||||
|
payment_by_ratio = {x["payment_entry"]: x["ratio"] for x in description_matching}
|
||||||
|
|
||||||
|
if payments:
|
||||||
|
reference_payment_list = frappe.get_all("Payment Entry", fields=["name", "paid_amount", "payment_type", "reference_no", "reference_date",
|
||||||
|
"party", "party_type", "posting_date", "paid_to_account_currency"], filters=[["name", "in", payments]])
|
||||||
|
|
||||||
|
return sorted(reference_payment_list, key=lambda x: payment_by_ratio[x["name"]])
|
||||||
|
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
|
||||||
|
def payment_entry_query(doctype, txt, searchfield, start, page_len, filters):
|
||||||
|
account = frappe.db.get_value("Bank Account", filters.get("bank_account"), "account")
|
||||||
|
if not account:
|
||||||
|
return
|
||||||
|
|
||||||
|
return frappe.db.sql("""
|
||||||
|
SELECT
|
||||||
|
name, party, paid_amount, received_amount, reference_no
|
||||||
|
FROM
|
||||||
|
`tabPayment Entry`
|
||||||
|
WHERE
|
||||||
|
(clearance_date is null or clearance_date='0000-00-00')
|
||||||
|
AND (paid_from = %(account)s or paid_to = %(account)s)
|
||||||
|
AND (name like %(txt)s or party like %(txt)s)
|
||||||
|
AND docstatus = 1
|
||||||
|
ORDER BY
|
||||||
|
if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999), name
|
||||||
|
LIMIT
|
||||||
|
%(start)s, %(page_len)s""",
|
||||||
|
{
|
||||||
|
'txt': "%%%s%%" % txt,
|
||||||
|
'_txt': txt.replace("%", ""),
|
||||||
|
'start': start,
|
||||||
|
'page_len': page_len,
|
||||||
|
'account': account
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
def journal_entry_query(doctype, txt, searchfield, start, page_len, filters):
|
||||||
|
account = frappe.db.get_value("Bank Account", filters.get("bank_account"), "account")
|
||||||
|
|
||||||
|
return frappe.db.sql("""
|
||||||
|
SELECT
|
||||||
|
jea.parent, je.pay_to_recd_from,
|
||||||
|
if(jea.debit_in_account_currency > 0, jea.debit_in_account_currency, jea.credit_in_account_currency)
|
||||||
|
FROM
|
||||||
|
`tabJournal Entry Account` as jea
|
||||||
|
LEFT JOIN
|
||||||
|
`tabJournal Entry` as je
|
||||||
|
ON
|
||||||
|
jea.parent = je.name
|
||||||
|
WHERE
|
||||||
|
(je.clearance_date is null or je.clearance_date='0000-00-00')
|
||||||
|
AND
|
||||||
|
jea.account = %(account)s
|
||||||
|
AND
|
||||||
|
(jea.parent like %(txt)s or je.pay_to_recd_from like %(txt)s)
|
||||||
|
AND
|
||||||
|
je.docstatus = 1
|
||||||
|
ORDER BY
|
||||||
|
if(locate(%(_txt)s, jea.parent), locate(%(_txt)s, jea.parent), 99999),
|
||||||
|
jea.parent
|
||||||
|
LIMIT
|
||||||
|
%(start)s, %(page_len)s""",
|
||||||
|
{
|
||||||
|
'txt': "%%%s%%" % txt,
|
||||||
|
'_txt': txt.replace("%", ""),
|
||||||
|
'start': start,
|
||||||
|
'page_len': page_len,
|
||||||
|
'account': account
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
def sales_invoices_query(doctype, txt, searchfield, start, page_len, filters):
|
||||||
|
return frappe.db.sql("""
|
||||||
|
SELECT
|
||||||
|
sip.parent, si.customer, sip.amount, sip.mode_of_payment
|
||||||
|
FROM
|
||||||
|
`tabSales Invoice Payment` as sip
|
||||||
|
LEFT JOIN
|
||||||
|
`tabSales Invoice` as si
|
||||||
|
ON
|
||||||
|
sip.parent = si.name
|
||||||
|
WHERE
|
||||||
|
(sip.clearance_date is null or sip.clearance_date='0000-00-00')
|
||||||
|
AND
|
||||||
|
(sip.parent like %(txt)s or si.customer like %(txt)s)
|
||||||
|
ORDER BY
|
||||||
|
if(locate(%(_txt)s, sip.parent), locate(%(_txt)s, sip.parent), 99999),
|
||||||
|
sip.parent
|
||||||
|
LIMIT
|
||||||
|
%(start)s, %(page_len)s""",
|
||||||
|
{
|
||||||
|
'txt': "%%%s%%" % txt,
|
||||||
|
'_txt': txt.replace("%", ""),
|
||||||
|
'start': start,
|
||||||
|
'page_len': page_len
|
||||||
|
}
|
||||||
|
)
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<div class="transaction-header">
|
||||||
|
<div class="level list-row list-row-head text-muted small">
|
||||||
|
<div class="col-sm-2 ellipsis hidden-xs">
|
||||||
|
{{ __("Date") }}
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-11 col-sm-4 ellipsis list-subject">
|
||||||
|
{{ __("Description") }}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-2 ellipsis hidden-xs">
|
||||||
|
{{ __("Debit") }}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-2 ellipsis hidden-xs">
|
||||||
|
{{ __("Credit") }}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-1 ellipsis hidden-xs">
|
||||||
|
{{ __("Currency") }}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-1 ellipsis">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<div class="list-row transaction-item">
|
||||||
|
<div>
|
||||||
|
<div class="clickable-section" data-name={{ name }}>
|
||||||
|
<div class="col-sm-2 ellipsis hidden-xs">
|
||||||
|
{%= frappe.datetime.str_to_user(date) %}
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-8 col-sm-4 ellipsis list-subject">
|
||||||
|
{{ description }}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-2 ellipsis hidden-xs">
|
||||||
|
{%= format_currency(debit, currency) %}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-2 ellipsis hidden-xs">
|
||||||
|
{%= format_currency(credit, currency) %}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-1 ellipsis hidden-xs">
|
||||||
|
{{ currency }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-3 col-sm-1">
|
||||||
|
<div class="btn-group">
|
||||||
|
<a class="dropdown-toggle btn btn-default btn-xs" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
<span>Actions </span>
|
||||||
|
<span class="caret"></span>
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu reports-dropdown" style="max-height: 300px; overflow-y: auto; right: 0px; left: auto;">
|
||||||
|
<li><a class="new-reconciliation" data-name={{ name }}>{{ __("Reconcile") }}</a></li>
|
||||||
|
<li class="divider"></li>
|
||||||
|
<li><a class="new-payment" data-name={{ name }}>{{ __("New Payment") }}</a></li>
|
||||||
|
<li><a class="new-invoice" data-name={{ name }}>{{ __("New Invoice") }}</a></li>
|
||||||
|
<li><a class="new-expense" data-name={{ name }}>{{ __("New Expense") }}</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<div class="transaction-header">
|
||||||
|
<div class="level list-row list-row-head text-muted small">
|
||||||
|
<div class="col-xs-3 col-sm-2 ellipsis">
|
||||||
|
{{ __("Payment Name") }}
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-3 col-sm-2 ellipsis">
|
||||||
|
{{ __("Reference Date") }}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-2 ellipsis hidden-xs">
|
||||||
|
{{ __("Amount") }}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-2 ellipsis hidden-xs">
|
||||||
|
{{ __("Party") }}
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-3 col-sm-2 ellipsis">
|
||||||
|
{{ __("Reference Number") }}
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-2 col-sm-2">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<div class="list-row">
|
||||||
|
<div>
|
||||||
|
<div class="col-xs-3 col-sm-2 ellipsis">
|
||||||
|
{{ name }}
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-3 col-sm-2 ellipsis">
|
||||||
|
{% if (typeof reference_date !== "undefined") %}
|
||||||
|
{%= frappe.datetime.str_to_user(reference_date) %}
|
||||||
|
{% else %}
|
||||||
|
{% if (typeof posting_date !== "undefined") %}
|
||||||
|
{%= frappe.datetime.str_to_user(posting_date) %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-2 ellipsis hidden-xs">
|
||||||
|
{{ format_currency(paid_amount, currency) }}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-2 ellipsis hidden-xs">
|
||||||
|
{% if (typeof party !== "undefined") %}
|
||||||
|
{{ party }}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-3 col-sm-2 ellipsis">
|
||||||
|
{% if (typeof reference_no !== "undefined") %}
|
||||||
|
{{ reference_no }}
|
||||||
|
{% else %}
|
||||||
|
{{ "" }}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-2 col-sm-2">
|
||||||
|
<div class="text-right margin-bottom">
|
||||||
|
<button class="btn btn-primary btn-xs reconciliation-btn" data-doctype="{{ doctype }}" data-name="{{ name }}">{{ __("Reconcile") }}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -6,17 +6,18 @@
|
|||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<div class="page-break">
|
<div>
|
||||||
|
{% set gl = frappe.get_list(doctype="GL Entry", fields=["account", "party_type", "party", "debit", "credit", "remarks"], filters={"voucher_type": doc.doctype, "voucher_no": doc.name}) %}
|
||||||
{%- if not doc.get("print_heading") and not doc.get("select_print_heading")
|
{%- if not doc.get("print_heading") and not doc.get("select_print_heading")
|
||||||
and doc.set("select_print_heading", _("Payment Entry")) -%}{%- endif -%}
|
and doc.set("select_print_heading", _("Payment Entry")) -%}{%- endif -%}
|
||||||
{{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
|
{{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
|
||||||
<div class="row margin-bottom">
|
<div class="row margin-bottom">
|
||||||
<div class="col-sm-6">
|
<div class="col-xs-6">
|
||||||
<table>
|
<table>
|
||||||
<tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
|
<tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="col-xs-6">
|
||||||
<table>
|
<table>
|
||||||
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
|
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -30,53 +31,46 @@
|
|||||||
<th>Party</th>
|
<th>Party</th>
|
||||||
<th>Amount</th>
|
<th>Amount</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="top-bottom" colspan="5"><strong>Debit</strong></td>
|
||||||
|
</tr>
|
||||||
|
{% for entries in gl %}
|
||||||
|
{% if entries.credit == 0.0 %}
|
||||||
|
<tr>
|
||||||
|
<td class="right top-bottom">{{ entries.account }}</td>
|
||||||
|
<td class="right left top-bottom">{{ entries.party_type }}</td>
|
||||||
|
<td class="right left top-bottom">{{ entries.party }}</td>
|
||||||
|
<td class="left top-bottom">{{ entries.debit }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="top-bottom"colspan="4"><strong> Narration </strong><br>{{ entries.remarks }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
<tr>
|
||||||
|
<td class="right" colspan="3" ><strong>Total (debit) </strong></td>
|
||||||
|
<td class="left" >{{ gl | sum(attribute='debit') }}</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="top-bottom" colspan="5"><strong>Credit</strong></td>
|
<td class="top-bottom" colspan="5"><strong>Credit</strong></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% set total_credit = 0 -%}
|
{% for entries in gl %}
|
||||||
{% for entries in doc.gl_entries %}
|
|
||||||
{% if entries.debit == 0.0 %}
|
{% if entries.debit == 0.0 %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="right top-bottom">{{ entries.account }}</td>
|
<td class="right top-bottom">{{ entries.account }}</td>
|
||||||
<td class="right left top-bottom">{{ entries.party_type }}</td>
|
<td class="right left top-bottom">{{ entries.party_type }}</td>
|
||||||
<td class="right left top-bottom">{{ entries.party }}</td>
|
<td class="right left top-bottom">{{ entries.party }}</td>
|
||||||
<td class="left top-bottom">{{ entries.credit }}</td>
|
<td class="left top-bottom">{{ entries.credit }}</td>
|
||||||
{% set total_credit = total_credit + entries.credit -%}
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="top-bottom" colspan="4"><strong> Narration </strong><br>{{ entries.remarks }}</td>
|
<td class="top-bottom" colspan="4"><strong> Narration </strong><br>{{ entries.remarks }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="right" colspan="3"><strong>Total (credit) </strong></td>
|
<td class="right" colspan="3"><strong>Total (credit) </strong></td>
|
||||||
<td class="left" >{{total_credit}}</td>
|
<td class="left" >{{ gl | sum(attribute='credit') }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
<tr>
|
|
||||||
<td class="top-bottom" colspan="4"> </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="top-bottom" colspan="5"><strong>Debit</strong></td>
|
|
||||||
</tr>
|
|
||||||
{% set total_debit = 0 -%}
|
|
||||||
{% for entries in doc.gl_entries %}
|
|
||||||
{% if entries.credit == 0.0 %}
|
|
||||||
<tr>
|
|
||||||
<td class="right top-bottom">{{ entries.account }}</td>
|
|
||||||
<td class="right left top-bottom">{{ entries.party_type }}</td>
|
|
||||||
<td class="right left top-bottom">{{ entries.party }}</td>
|
|
||||||
{% set total_debit = total_debit + entries.debit -%}
|
|
||||||
<td class="left top-bottom">{{ entries.debit }}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="top-bottom"colspan="4"><strong> Narration </strong><br>{{ entries.remarks }}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="right" colspan="3" ><strong>Total (debit) </strong></td>
|
|
||||||
<td class="left" >{{total_debit}}</td>
|
|
||||||
</tr>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
</table>
|
</table>
|
||||||
<div>
|
<div>
|
||||||
</div>
|
</div>
|
||||||
@@ -3,26 +3,25 @@
|
|||||||
.table-bordered td.top-bottom {border-top: none !important;border-bottom: none !important;}
|
.table-bordered td.top-bottom {border-top: none !important;border-bottom: none !important;}
|
||||||
.table-bordered td.right{border-right: none !important;}
|
.table-bordered td.right{border-right: none !important;}
|
||||||
.table-bordered td.left{border-left: none !important;}
|
.table-bordered td.left{border-left: none !important;}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<div class="page-break">
|
<div>
|
||||||
|
{% set gl = frappe.get_list(doctype="GL Entry", fields=["account", "party_type", "party", "debit", "credit", "remarks"], filters={"voucher_type": doc.doctype, "voucher_no": doc.name}) %}
|
||||||
{%- if not doc.get("print_heading") and not doc.get("select_print_heading")
|
{%- if not doc.get("print_heading") and not doc.get("select_print_heading")
|
||||||
and doc.set("select_print_heading", _("Journal Entry")) -%}{%- endif -%}
|
and doc.set("select_print_heading", _("Journal Entry")) -%}{%- endif -%}
|
||||||
{{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
|
{{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
|
||||||
<div class="row margin-bottom">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-xs-6">
|
||||||
<table>
|
<table>
|
||||||
<tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
|
<tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="col-xs-6">
|
||||||
<table>
|
<table>
|
||||||
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
|
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="margin-top">
|
<div>
|
||||||
<table class="table table-bordered table-condensed">
|
<table class="table table-bordered table-condensed">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Account</th>
|
<th>Account</th>
|
||||||
@@ -30,47 +29,43 @@
|
|||||||
<th>Party</th>
|
<th>Party</th>
|
||||||
<th>Amount</th>
|
<th>Amount</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="top-bottom" colspan="5"><strong>Debit</strong></td>
|
||||||
|
</tr>
|
||||||
|
{% for entries in gl %}
|
||||||
|
{% if entries.credit == 0.0 %}
|
||||||
|
<tr>
|
||||||
|
<td class="right top-bottom">{{ entries.account }}</td>
|
||||||
|
<td class="right left top-bottom">{{ entries.party_type }}</td>
|
||||||
|
<td class="right left top-bottom">{{ entries.party }}</td>
|
||||||
|
<td class="left top-bottom">{{ entries.debit }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
<tr>
|
||||||
|
<td class="right" colspan="3" ><strong>Total (debit) </strong></td>
|
||||||
|
<td class="left" >{{ gl | sum(attribute='debit') }}</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="top-bottom" colspan="5"><strong>Credit</strong></td>
|
<td class="top-bottom" colspan="5"><strong>Credit</strong></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% set total_credit = 0 -%}
|
{% for entries in gl %}
|
||||||
{% for entries in doc.gl_entries %}
|
|
||||||
{% if entries.debit == 0.0 %}
|
{% if entries.debit == 0.0 %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="right top-bottom">{{ entries.account }}</td>
|
<td class="right top-bottom">{{ entries.account }}</td>
|
||||||
<td class="right left top-bottom">{{ entries.party_type }}</td>
|
<td class="right left top-bottom">{{ entries.party_type }}</td>
|
||||||
<td class="right left top-bottom">{{ entries.party }}</td>
|
<td class="right left top-bottom">{{ entries.party }}</td>
|
||||||
<td class="left top-bottom">{{ entries.credit }}</td>
|
<td class="left top-bottom">{{ entries.credit }}</td>
|
||||||
{% set total_credit = total_credit + entries.credit -%}
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="right" colspan="3"><strong>Total (credit) </strong></td>
|
|
||||||
<td class="left" >{{total_credit}}</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="top-bottom" colspan="4"> </td>
|
<td class="right" colspan="3"><strong>Total (credit) </strong></td>
|
||||||
|
<td class="left" >{{ gl | sum(attribute='credit') }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="top-bottom" colspan="5"><strong>Debit</strong></td>
|
<td class="top-bottom" colspan="5"><b>Narration: </b>{{ gl[0].remarks }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% set total_debit = 0 -%}
|
|
||||||
{% for entries in doc.gl_entries %}
|
|
||||||
{% if entries.credit == 0.0 %}
|
|
||||||
<tr>
|
|
||||||
<td class="right top-bottom">{{ entries.account }}</td>
|
|
||||||
<td class="right left top-bottom">{{ entries.party_type }}</td>
|
|
||||||
<td class="right left top-bottom">{{ entries.party }}</td>
|
|
||||||
{% set total_debit = total_debit + entries.debit -%}
|
|
||||||
<td class="left top-bottom">{{ entries.debit }}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="right" colspan="3" ><strong>Total (debit) </strong></td>
|
|
||||||
<td class="left" >{{total_debit}}</td>
|
|
||||||
</tr>
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
</table>
|
</table>
|
||||||
<div>
|
<div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
{%- from "templates/print_formats/standard_macros.html" import add_header -%}
|
{%- from "templates/print_formats/standard_macros.html" import add_header -%}
|
||||||
<div class="page-break">
|
<div>
|
||||||
|
{% set gl = frappe.get_list(doctype="GL Entry", fields=["account", "party_type", "party", "debit", "credit", "remarks"], filters={"voucher_type": doc.doctype, "voucher_no": doc.name}) %}
|
||||||
{%- if not doc.get("print_heading") and not doc.get("select_print_heading")
|
{%- if not doc.get("print_heading") and not doc.get("select_print_heading")
|
||||||
and doc.set("select_print_heading", _("Purchase Invoice")) -%}{%- endif -%}
|
and doc.set("select_print_heading", _("Purchase Invoice")) -%}{%- endif -%}
|
||||||
{{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
|
{{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
|
||||||
<div class="row margin-bottom">
|
<div class="row margin-bottom">
|
||||||
<div class="col-sm-6">
|
<div class="col-xs-6">
|
||||||
<table>
|
<table>
|
||||||
<tr><td><strong>Supplier Name: </strong></td><td>{{ doc.supplier }}</td></tr>
|
<tr><td><strong>Supplier Name: </strong></td><td>{{ doc.supplier }}</td></tr>
|
||||||
<tr><td><strong>Due Date: </strong></td><td>{{ frappe.utils.formatdate(doc.due_date) }}</td></tr>
|
<tr><td><strong>Due Date: </strong></td><td>{{ frappe.utils.formatdate(doc.due_date) }}</td></tr>
|
||||||
@@ -13,7 +14,7 @@
|
|||||||
<tr><td><strong>Mobile no: </strong> </td><td>{{doc.contact_mobile}}</td></tr>
|
<tr><td><strong>Mobile no: </strong> </td><td>{{doc.contact_mobile}}</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="col-xs-6">
|
||||||
<table>
|
<table>
|
||||||
<tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
|
<tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
|
||||||
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
|
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
|
||||||
@@ -49,21 +50,27 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="row margin-bottom">
|
<div class="row margin-bottom">
|
||||||
<div class="col-sm-6">
|
<div class="col-xs-6">
|
||||||
<table>
|
<table>
|
||||||
<tr><td><strong>Total Quantity: </strong></td><td>{{ doc.total_qty }}</td></tr>
|
<tr><td><strong>Total Quantity: </strong></td><td>{{ doc.total_qty }}</td></tr>
|
||||||
<tr><td><strong>Total: </strong></td><td>{{doc.total}}</td></tr>
|
<tr><td><strong>Total: </strong></td><td>{{doc.total}}</td></tr>
|
||||||
<tr><td><strong>Net Weight: </strong></td><td>{{ doc.total_net_weight }}</td></tr>
|
<tr><td><strong>Net Weight: </strong></td><td>{{ doc.total_net_weight }}</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="col-xs-6">
|
||||||
<table>
|
<table>
|
||||||
<tr><td><strong>Tax and Charges: </strong></td><td>{{doc.taxes_and_charges}}</td></tr>
|
<tr><td><strong>Tax and Charges: </strong></td><td>{{doc.taxes_and_charges}}</td></tr>
|
||||||
{% for tax in doc.taxes %}
|
{% for tax in doc.taxes %}
|
||||||
<tr><td><strong>{{ tax.account_head }}: </strong></td><td>{{ tax.tax_amount_after_discount_amount }}</td></tr>
|
{% if tax.tax_amount_after_discount_amount!= 0 %}
|
||||||
|
<tr><td><strong>{{ tax.account_head }}: </strong></td><td>{{ tax.tax_amount_after_discount_amount }}</td></tr>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% if doc.taxes_and_charges_added!= 0 %}
|
||||||
<tr><td><strong> Taxes and Charges Added: </strong></td><td>{{ doc.taxes_and_charges_added }}</td></tr>
|
<tr><td><strong> Taxes and Charges Added: </strong></td><td>{{ doc.taxes_and_charges_added }}</td></tr>
|
||||||
|
{% endif %}
|
||||||
|
{% if doc.taxes_and_charges_deducted!= 0 %}
|
||||||
<tr><td><strong> Taxes and Charges Deducted: </strong></td><td>{{ doc.taxes_and_charges_deducted }}</td></tr>
|
<tr><td><strong> Taxes and Charges Deducted: </strong></td><td>{{ doc.taxes_and_charges_deducted }}</td></tr>
|
||||||
|
{% endif %}
|
||||||
<tr><td><strong> Total Taxes and Charges: </strong></td><td>{{ doc.total_taxes_and_charges }}</td></tr>
|
<tr><td><strong> Total Taxes and Charges: </strong></td><td>{{ doc.total_taxes_and_charges }}</td></tr>
|
||||||
<tr><td><strong> Net Payable: </strong></td><td>{{ doc.grand_total }}</td></tr>
|
<tr><td><strong> Net Payable: </strong></td><td>{{ doc.grand_total }}</td></tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -76,17 +83,17 @@
|
|||||||
<th>Account</th>
|
<th>Account</th>
|
||||||
<th>Party Type</th>
|
<th>Party Type</th>
|
||||||
<th>Party</th>
|
<th>Party</th>
|
||||||
<th>Credit Amount</th>
|
|
||||||
<th>Debit Amount</th>
|
<th>Debit Amount</th>
|
||||||
|
<th>Credit Amount</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for entries in doc.gl_entries %}
|
{% for entries in gl %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ loop.index }}</td>
|
<td>{{ loop.index }}</td>
|
||||||
<td>{{ entries.account }}</td>
|
<td>{{ entries.account }}</td>
|
||||||
<td>{{ entries.party_type }}</td>
|
<td>{{ entries.party_type }}</td>
|
||||||
<td>{{ entries.party }}</td>
|
<td>{{ entries.party }}</td>
|
||||||
<td>{{ entries.credit }}</td>
|
|
||||||
<td>{{ entries.debit }}</td>
|
<td>{{ entries.debit }}</td>
|
||||||
|
<td>{{ entries.credit }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
{%- from "templates/print_formats/standard_macros.html" import add_header -%}
|
{%- from "templates/print_formats/standard_macros.html" import add_header -%}
|
||||||
<div class="page-break">
|
<div>
|
||||||
|
{% set gl = frappe.get_list(doctype="GL Entry", fields=["account", "party_type", "party", "debit", "credit", "remarks"], filters={"voucher_type": doc.doctype, "voucher_no": doc.name}) %}
|
||||||
{%- if not doc.get("print_heading") and not doc.get("select_print_heading")
|
{%- if not doc.get("print_heading") and not doc.get("select_print_heading")
|
||||||
and doc.set("select_print_heading", _("Sales Invoice")) -%}{%- endif -%}
|
and doc.set("select_print_heading", _("Sales Invoice")) -%}{%- endif -%}
|
||||||
{{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
|
{{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
|
||||||
<div class="row margin-bottom">
|
<div class="row margin-bottom">
|
||||||
<div class="col-sm-6">
|
<div class="col-xs-6">
|
||||||
<table>
|
<table>
|
||||||
<tr><td><strong>Customer Name: </strong></td><td>{{ doc.customer }}</td></tr>
|
<tr><td><strong>Customer Name: </strong></td><td>{{ doc.customer }}</td></tr>
|
||||||
<tr><td><strong>Due Date: </strong></td><td>{{ frappe.utils.formatdate(doc.due_date) }}</td></tr>
|
<tr><td><strong>Due Date: </strong></td><td>{{ frappe.utils.formatdate(doc.due_date) }}</td></tr>
|
||||||
@@ -13,7 +14,7 @@
|
|||||||
<tr><td><strong>Mobile no: </strong> </td><td>{{doc.contact_mobile}}</td></tr>
|
<tr><td><strong>Mobile no: </strong> </td><td>{{doc.contact_mobile}}</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="col-xs-6">
|
||||||
<table>
|
<table>
|
||||||
<tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
|
<tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
|
||||||
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
|
<tr><td><strong>Date: </strong></td><td>{{ frappe.utils.formatdate(doc.creation) }}</td></tr>
|
||||||
@@ -45,18 +46,20 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="row margin-bottom">
|
<div class="row margin-bottom">
|
||||||
<div class="col-sm-6">
|
<div class="col-xs-6">
|
||||||
<table>
|
<table>
|
||||||
<tr><td><strong>Total Quantity: </strong></td><td>{{ doc.total_qty }}</td></tr>
|
<tr><td><strong>Total Quantity: </strong></td><td>{{ doc.total_qty }}</td></tr>
|
||||||
<tr><td><strong>Total: </strong></td><td>{{doc.total}}</td></tr>
|
<tr><td><strong>Total: </strong></td><td>{{doc.total}}</td></tr>
|
||||||
<tr><td><strong>Net Weight: </strong></td><td>{{ doc.total_net_weight }}</td></tr>
|
<tr><td><strong>Net Weight: </strong></td><td>{{ doc.total_net_weight }}</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="col-xs-6">
|
||||||
<table>
|
<table>
|
||||||
<tr><td><strong>Tax and Charges: </strong></td><td>{{doc.taxes_and_charges}}</td></tr>
|
<tr><td><strong>Tax and Charges: </strong></td><td>{{doc.taxes_and_charges}}</td></tr>
|
||||||
{% for tax in doc.taxes %}
|
{% for tax in doc.taxes %}
|
||||||
<tr><td><strong>{{ tax.account_head }}: </strong></td><td>{{ tax.tax_amount_after_discount_amount }}</td></tr>
|
{% if tax.tax_amount_after_discount_amount!= 0 %}
|
||||||
|
<tr><td><strong>{{ tax.account_head }}: </strong></td><td>{{ tax.tax_amount_after_discount_amount }}</td></tr>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<tr><td><strong> Total Taxes and Charges: </strong></td><td>{{ doc.total_taxes_and_charges }}</td></tr>
|
<tr><td><strong> Total Taxes and Charges: </strong></td><td>{{ doc.total_taxes_and_charges }}</td></tr>
|
||||||
<tr><td><strong> Net Payable: </strong></td><td>{{ doc.grand_total }}</td></tr>
|
<tr><td><strong> Net Payable: </strong></td><td>{{ doc.grand_total }}</td></tr>
|
||||||
@@ -70,17 +73,17 @@
|
|||||||
<th>Account</th>
|
<th>Account</th>
|
||||||
<th>Party Type</th>
|
<th>Party Type</th>
|
||||||
<th>Party</th>
|
<th>Party</th>
|
||||||
<th>Credit Amount</th>
|
|
||||||
<th>Debit Amount</th>
|
<th>Debit Amount</th>
|
||||||
|
<th>Credit Amount</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for entries in doc.gl_entries %}
|
{% for entries in gl %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ loop.index }}</td>
|
<td>{{ loop.index }}</td>
|
||||||
<td>{{ entries.account }}</td>
|
<td>{{ entries.account }}</td>
|
||||||
<td>{{ entries.party_type }}</td>
|
<td>{{ entries.party_type }}</td>
|
||||||
<td>{{ entries.party }}</td>
|
<td>{{ entries.party }}</td>
|
||||||
<td>{{ entries.credit }}</td>
|
|
||||||
<td>{{ entries.debit }}</td>
|
<td>{{ entries.debit }}</td>
|
||||||
|
<td>{{ entries.credit }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -194,10 +194,9 @@ class ReceivablePayableReport(object):
|
|||||||
self.payment_term_map = self.get_payment_term_detail(voucher_nos)
|
self.payment_term_map = self.get_payment_term_detail(voucher_nos)
|
||||||
|
|
||||||
for gle in gl_entries_data:
|
for gle in gl_entries_data:
|
||||||
if self.is_receivable_or_payable(gle, self.dr_or_cr, future_vouchers):
|
if self.is_receivable_or_payable(gle, self.dr_or_cr, future_vouchers, return_entries):
|
||||||
outstanding_amount, credit_note_amount, payment_amount = self.get_outstanding_amount(
|
outstanding_amount, credit_note_amount, payment_amount = self.get_outstanding_amount(
|
||||||
gle,self.filters.report_date, self.dr_or_cr, return_entries)
|
gle,self.filters.report_date, self.dr_or_cr, return_entries)
|
||||||
|
|
||||||
temp_outstanding_amt = outstanding_amount
|
temp_outstanding_amt = outstanding_amount
|
||||||
temp_credit_note_amt = credit_note_amount
|
temp_credit_note_amt = credit_note_amount
|
||||||
|
|
||||||
@@ -377,7 +376,7 @@ class ReceivablePayableReport(object):
|
|||||||
# returns a generator
|
# returns a generator
|
||||||
return self.get_gl_entries(party_type, report_date)
|
return self.get_gl_entries(party_type, report_date)
|
||||||
|
|
||||||
def is_receivable_or_payable(self, gle, dr_or_cr, future_vouchers):
|
def is_receivable_or_payable(self, gle, dr_or_cr, future_vouchers, return_entries):
|
||||||
return (
|
return (
|
||||||
# advance
|
# advance
|
||||||
(not gle.against_voucher) or
|
(not gle.against_voucher) or
|
||||||
@@ -388,30 +387,37 @@ class ReceivablePayableReport(object):
|
|||||||
# sales invoice/purchase invoice
|
# sales invoice/purchase invoice
|
||||||
(gle.against_voucher==gle.voucher_no and gle.get(dr_or_cr) > 0) or
|
(gle.against_voucher==gle.voucher_no and gle.get(dr_or_cr) > 0) or
|
||||||
|
|
||||||
|
# standalone credit notes
|
||||||
|
(gle.against_voucher==gle.voucher_no and gle.voucher_no in return_entries and not return_entries.get(gle.voucher_no)) or
|
||||||
|
|
||||||
# entries adjusted with future vouchers
|
# entries adjusted with future vouchers
|
||||||
((gle.against_voucher_type, gle.against_voucher) in future_vouchers)
|
((gle.against_voucher_type, gle.against_voucher) in future_vouchers)
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_return_entries(self, party_type):
|
def get_return_entries(self, party_type):
|
||||||
doctype = "Sales Invoice" if party_type=="Customer" else "Purchase Invoice"
|
doctype = "Sales Invoice" if party_type=="Customer" else "Purchase Invoice"
|
||||||
return [d.name for d in frappe.get_all(doctype, filters={"is_return": 1, "docstatus": 1})]
|
return_entries = frappe._dict(frappe.get_all(doctype,
|
||||||
|
filters={"is_return": 1, "docstatus": 1}, fields=["name", "return_against"], as_list=1))
|
||||||
|
return return_entries
|
||||||
|
|
||||||
def get_outstanding_amount(self, gle, report_date, dr_or_cr, return_entries):
|
def get_outstanding_amount(self, gle, report_date, dr_or_cr, return_entries):
|
||||||
payment_amount, credit_note_amount = 0.0, 0.0
|
payment_amount, credit_note_amount = 0.0, 0.0
|
||||||
reverse_dr_or_cr = "credit" if dr_or_cr=="debit" else "debit"
|
reverse_dr_or_cr = "credit" if dr_or_cr=="debit" else "debit"
|
||||||
|
|
||||||
for e in self.get_gl_entries_for(gle.party, gle.party_type, gle.voucher_type, gle.voucher_no):
|
for e in self.get_gl_entries_for(gle.party, gle.party_type, gle.voucher_type, gle.voucher_no):
|
||||||
if getdate(e.posting_date) <= report_date and e.name!=gle.name:
|
if getdate(e.posting_date) <= report_date \
|
||||||
|
and (e.name!=gle.name or (e.voucher_no in return_entries and not return_entries.get(e.voucher_no))):
|
||||||
|
|
||||||
amount = flt(e.get(reverse_dr_or_cr), self.currency_precision) - flt(e.get(dr_or_cr), self.currency_precision)
|
amount = flt(e.get(reverse_dr_or_cr), self.currency_precision) - flt(e.get(dr_or_cr), self.currency_precision)
|
||||||
if e.voucher_no not in return_entries:
|
if e.voucher_no not in return_entries:
|
||||||
payment_amount += amount
|
payment_amount += amount
|
||||||
else:
|
else:
|
||||||
credit_note_amount += amount
|
credit_note_amount += amount
|
||||||
|
|
||||||
outstanding_amount = (flt((flt(gle.get(dr_or_cr), self.currency_precision)
|
voucher_amount = flt(gle.get(dr_or_cr), self.currency_precision) - flt(gle.get(reverse_dr_or_cr), self.currency_precision)
|
||||||
- flt(gle.get(reverse_dr_or_cr), self.currency_precision)
|
if gle.voucher_no in return_entries and not return_entries.get(gle.voucher_no):
|
||||||
- payment_amount - credit_note_amount), self.currency_precision))
|
voucher_amount = 0
|
||||||
|
|
||||||
|
outstanding_amount = flt((voucher_amount - payment_amount - credit_note_amount), self.currency_precision)
|
||||||
credit_note_amount = flt(credit_note_amount, self.currency_precision)
|
credit_note_amount = flt(credit_note_amount, self.currency_precision)
|
||||||
|
|
||||||
return outstanding_amount, credit_note_amount, payment_amount
|
return outstanding_amount, credit_note_amount, payment_amount
|
||||||
|
|||||||
@@ -615,7 +615,7 @@ def get_held_invoices(party_type, party):
|
|||||||
return held_invoices
|
return held_invoices
|
||||||
|
|
||||||
|
|
||||||
def get_outstanding_invoices(party_type, party, account, condition=None, limit=None):
|
def get_outstanding_invoices(party_type, party, account, condition=None):
|
||||||
outstanding_invoices = []
|
outstanding_invoices = []
|
||||||
precision = frappe.get_precision("Sales Invoice", "outstanding_amount") or 2
|
precision = frappe.get_precision("Sales Invoice", "outstanding_amount") or 2
|
||||||
|
|
||||||
@@ -628,7 +628,6 @@ def get_outstanding_invoices(party_type, party, account, condition=None, limit=N
|
|||||||
|
|
||||||
invoice = 'Sales Invoice' if erpnext.get_party_account_type(party_type) == 'Receivable' else 'Purchase Invoice'
|
invoice = 'Sales Invoice' if erpnext.get_party_account_type(party_type) == 'Receivable' else 'Purchase Invoice'
|
||||||
held_invoices = get_held_invoices(party_type, party)
|
held_invoices = get_held_invoices(party_type, party)
|
||||||
limit_cond = "limit %s" % limit if limit else ""
|
|
||||||
|
|
||||||
invoice_list = frappe.db.sql("""
|
invoice_list = frappe.db.sql("""
|
||||||
select
|
select
|
||||||
@@ -643,11 +642,10 @@ def get_outstanding_invoices(party_type, party, account, condition=None, limit=N
|
|||||||
and (against_voucher = '' or against_voucher is null))
|
and (against_voucher = '' or against_voucher is null))
|
||||||
or (voucher_type not in ('Journal Entry', 'Payment Entry')))
|
or (voucher_type not in ('Journal Entry', 'Payment Entry')))
|
||||||
group by voucher_type, voucher_no
|
group by voucher_type, voucher_no
|
||||||
order by posting_date, name {limit_cond}""".format(
|
order by posting_date, name""".format(
|
||||||
dr_or_cr=dr_or_cr,
|
dr_or_cr=dr_or_cr,
|
||||||
invoice = invoice,
|
invoice = invoice,
|
||||||
condition=condition or "",
|
condition=condition or ""
|
||||||
limit_cond = limit_cond
|
|
||||||
), {
|
), {
|
||||||
"party_type": party_type,
|
"party_type": party_type,
|
||||||
"party": party,
|
"party": party,
|
||||||
|
|||||||
@@ -206,12 +206,10 @@ frappe.ui.form.on('Asset', {
|
|||||||
erpnext.asset.set_accululated_depreciation(frm);
|
erpnext.asset.set_accululated_depreciation(frm);
|
||||||
},
|
},
|
||||||
|
|
||||||
depreciation_method: function(frm) {
|
|
||||||
frm.events.make_schedules_editable(frm);
|
|
||||||
},
|
|
||||||
|
|
||||||
make_schedules_editable: function(frm) {
|
make_schedules_editable: function(frm) {
|
||||||
var is_editable = frm.doc.depreciation_method==="Manual" ? true : false;
|
var is_editable = frm.doc.finance_books.filter(d => d.depreciation_method == "Manual").length > 0
|
||||||
|
? true : false;
|
||||||
|
|
||||||
frm.toggle_enable("schedules", is_editable);
|
frm.toggle_enable("schedules", is_editable);
|
||||||
frm.fields_dict["schedules"].grid.toggle_enable("schedule_date", is_editable);
|
frm.fields_dict["schedules"].grid.toggle_enable("schedule_date", is_editable);
|
||||||
frm.fields_dict["schedules"].grid.toggle_enable("depreciation_amount", is_editable);
|
frm.fields_dict["schedules"].grid.toggle_enable("depreciation_amount", is_editable);
|
||||||
@@ -296,6 +294,44 @@ frappe.ui.form.on('Asset', {
|
|||||||
})
|
})
|
||||||
|
|
||||||
frm.toggle_reqd("finance_books", frm.doc.calculate_depreciation);
|
frm.toggle_reqd("finance_books", frm.doc.calculate_depreciation);
|
||||||
|
},
|
||||||
|
|
||||||
|
set_depreciation_rate: function(frm, row) {
|
||||||
|
if (row.total_number_of_depreciations && row.frequency_of_depreciation) {
|
||||||
|
frappe.call({
|
||||||
|
method: "get_depreciation_rate",
|
||||||
|
doc: frm.doc,
|
||||||
|
args: row,
|
||||||
|
callback: function(r) {
|
||||||
|
if (r.message) {
|
||||||
|
frappe.model.set_value(row.doctype, row.name, "rate_of_depreciation", r.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
frappe.ui.form.on('Asset Finance Book', {
|
||||||
|
depreciation_method: function(frm, cdt, cdn) {
|
||||||
|
const row = locals[cdt][cdn];
|
||||||
|
frm.events.set_depreciation_rate(frm, row);
|
||||||
|
frm.events.make_schedules_editable(frm);
|
||||||
|
},
|
||||||
|
|
||||||
|
expected_value_after_useful_life: function(frm, cdt, cdn) {
|
||||||
|
const row = locals[cdt][cdn];
|
||||||
|
frm.events.set_depreciation_rate(frm, row);
|
||||||
|
},
|
||||||
|
|
||||||
|
frequency_of_depreciation: function(frm, cdt, cdn) {
|
||||||
|
const row = locals[cdt][cdn];
|
||||||
|
frm.events.set_depreciation_rate(frm, row);
|
||||||
|
},
|
||||||
|
|
||||||
|
total_number_of_depreciations: function(frm, cdt, cdn) {
|
||||||
|
const row = locals[cdt][cdn];
|
||||||
|
frm.events.set_depreciation_rate(frm, row);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,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,
|
||||||
@@ -54,6 +55,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "asset_name",
|
"fieldname": "asset_name",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -86,6 +88,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "item_code",
|
"fieldname": "item_code",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -120,6 +123,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fetch_from": "item_code.item_name",
|
"fetch_from": "item_code.item_name",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "item_name",
|
"fieldname": "item_name",
|
||||||
"fieldtype": "Read Only",
|
"fieldtype": "Read Only",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -154,6 +158,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fetch_from": "item_code.asset_category",
|
"fetch_from": "item_code.asset_category",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "asset_category",
|
"fieldname": "asset_category",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -187,6 +192,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "asset_owner",
|
"fieldname": "asset_owner",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -221,6 +227,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:doc.asset_owner == \"Company\"",
|
"depends_on": "eval:doc.asset_owner == \"Company\"",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "asset_owner_company",
|
"fieldname": "asset_owner_company",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -255,6 +262,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:doc.asset_owner == \"Supplier\"",
|
"depends_on": "eval:doc.asset_owner == \"Supplier\"",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "supplier",
|
"fieldname": "supplier",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -289,6 +297,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:doc.asset_owner == \"Customer\"",
|
"depends_on": "eval:doc.asset_owner == \"Customer\"",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "customer",
|
"fieldname": "customer",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -322,6 +331,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "image",
|
"fieldname": "image",
|
||||||
"fieldtype": "Attach Image",
|
"fieldtype": "Attach Image",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -354,6 +364,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_3",
|
"fieldname": "column_break_3",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -385,6 +396,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,
|
||||||
@@ -418,6 +430,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "location",
|
"fieldname": "location",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -451,10 +464,11 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "custodian",
|
"fieldname": "custodian",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 1,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_global_search": 0,
|
"in_global_search": 0,
|
||||||
@@ -484,6 +498,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "cost_center",
|
"fieldname": "cost_center",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -517,6 +532,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "department",
|
"fieldname": "department",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -550,6 +566,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "purchase_date",
|
"fieldname": "purchase_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -582,6 +599,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "disposal_date",
|
"fieldname": "disposal_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -614,6 +632,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "journal_entry_for_scrap",
|
"fieldname": "journal_entry_for_scrap",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -647,6 +666,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": 0,
|
"hidden": 0,
|
||||||
@@ -678,6 +698,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "gross_purchase_amount",
|
"fieldname": "gross_purchase_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -711,6 +732,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "available_for_use_date",
|
"fieldname": "available_for_use_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -743,6 +765,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_18",
|
"fieldname": "column_break_18",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -774,6 +797,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "calculate_depreciation",
|
"fieldname": "calculate_depreciation",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -806,6 +830,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "is_existing_asset",
|
"fieldname": "is_existing_asset",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -839,6 +864,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "is_existing_asset",
|
"depends_on": "is_existing_asset",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "opening_accumulated_depreciation",
|
"fieldname": "opening_accumulated_depreciation",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -873,6 +899,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:(doc.is_existing_asset && doc.opening_accumulated_depreciation)",
|
"depends_on": "eval:(doc.is_existing_asset && doc.opening_accumulated_depreciation)",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "number_of_depreciations_booked",
|
"fieldname": "number_of_depreciations_booked",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -906,6 +933,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "calculate_depreciation",
|
"depends_on": "calculate_depreciation",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_23",
|
"fieldname": "section_break_23",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -938,6 +966,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "finance_books",
|
"fieldname": "finance_books",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -971,6 +1000,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_33",
|
"fieldname": "section_break_33",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -1004,6 +1034,7 @@
|
|||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "",
|
"default": "",
|
||||||
"depends_on": "",
|
"depends_on": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "depreciation_method",
|
"fieldname": "depreciation_method",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1037,6 +1068,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "value_after_depreciation",
|
"fieldname": "value_after_depreciation",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -1070,6 +1102,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "total_number_of_depreciations",
|
"fieldname": "total_number_of_depreciations",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1102,6 +1135,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_24",
|
"fieldname": "column_break_24",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1133,6 +1167,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "frequency_of_depreciation",
|
"fieldname": "frequency_of_depreciation",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1166,6 +1201,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "",
|
"depends_on": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "next_depreciation_date",
|
"fieldname": "next_depreciation_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1199,6 +1235,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "calculate_depreciation",
|
"depends_on": "calculate_depreciation",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_14",
|
"fieldname": "section_break_14",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1231,6 +1268,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "schedules",
|
"fieldname": "schedules",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1264,6 +1302,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "insurance_details",
|
"fieldname": "insurance_details",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1296,6 +1335,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "policy_number",
|
"fieldname": "policy_number",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1328,6 +1368,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "insurer",
|
"fieldname": "insurer",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1360,6 +1401,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "insured_value",
|
"fieldname": "insured_value",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1392,6 +1434,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_48",
|
"fieldname": "column_break_48",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1423,6 +1466,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "insurance_start_date",
|
"fieldname": "insurance_start_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1455,6 +1499,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "insurance_end_date",
|
"fieldname": "insurance_end_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1487,6 +1532,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "comprehensive_insurance",
|
"fieldname": "comprehensive_insurance",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1519,6 +1565,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_31",
|
"fieldname": "section_break_31",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1552,6 +1599,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"description": "Check if Asset requires Preventive Maintenance or Calibration",
|
"description": "Check if Asset requires Preventive Maintenance or Calibration",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "maintenance_required",
|
"fieldname": "maintenance_required",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1584,6 +1632,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "other_details",
|
"fieldname": "other_details",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1617,6 +1666,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "Draft",
|
"default": "Draft",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "status",
|
"fieldname": "status",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1651,6 +1701,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "0",
|
"default": "0",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "booked_fixed_asset",
|
"fieldname": "booked_fixed_asset",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1683,6 +1734,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_51",
|
"fieldname": "column_break_51",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1714,6 +1766,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "purchase_receipt",
|
"fieldname": "purchase_receipt",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1747,6 +1800,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "purchase_receipt_amount",
|
"fieldname": "purchase_receipt_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -1779,6 +1833,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "purchase_invoice",
|
"fieldname": "purchase_invoice",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1813,6 +1868,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fetch_from": "company.default_finance_book",
|
"fetch_from": "company.default_finance_book",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "default_finance_book",
|
"fieldname": "default_finance_book",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -1846,6 +1902,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "amended_from",
|
"fieldname": "amended_from",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1883,7 +1940,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2019-02-12 11:29:01.747819",
|
"modified": "2019-04-15 11:13:23.295772",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Assets",
|
"module": "Assets",
|
||||||
"name": "Asset",
|
"name": "Asset",
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
# 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, erpnext
|
import frappe, erpnext, math, json
|
||||||
from frappe import _
|
from frappe import _
|
||||||
|
from six import string_types
|
||||||
from frappe.utils import flt, add_months, cint, nowdate, getdate, today, date_diff
|
from frappe.utils import flt, add_months, cint, nowdate, getdate, today, date_diff
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from erpnext.assets.doctype.asset_category.asset_category import get_asset_category_account
|
from erpnext.assets.doctype.asset_category.asset_category import get_asset_category_account
|
||||||
@@ -20,6 +21,7 @@ class Asset(AccountsController):
|
|||||||
self.validate_item()
|
self.validate_item()
|
||||||
self.set_missing_values()
|
self.set_missing_values()
|
||||||
if self.calculate_depreciation:
|
if self.calculate_depreciation:
|
||||||
|
self.set_depreciation_rate()
|
||||||
self.make_depreciation_schedule()
|
self.make_depreciation_schedule()
|
||||||
self.set_accumulated_depreciation()
|
self.set_accumulated_depreciation()
|
||||||
else:
|
else:
|
||||||
@@ -89,17 +91,22 @@ class Asset(AccountsController):
|
|||||||
if self.is_existing_asset:
|
if self.is_existing_asset:
|
||||||
return
|
return
|
||||||
|
|
||||||
date = nowdate()
|
|
||||||
docname = self.purchase_receipt or self.purchase_invoice
|
docname = self.purchase_receipt or self.purchase_invoice
|
||||||
if docname:
|
if docname:
|
||||||
doctype = 'Purchase Receipt' if self.purchase_receipt else 'Purchase Invoice'
|
doctype = 'Purchase Receipt' if self.purchase_receipt else 'Purchase Invoice'
|
||||||
date = frappe.db.get_value(doctype, docname, 'posting_date')
|
date = frappe.db.get_value(doctype, docname, 'posting_date')
|
||||||
|
|
||||||
if self.available_for_use_date and getdate(self.available_for_use_date) < getdate(date):
|
if self.available_for_use_date and getdate(self.available_for_use_date) < getdate(self.purchase_date):
|
||||||
frappe.throw(_("Available-for-use Date should be after purchase date"))
|
frappe.throw(_("Available-for-use Date should be after purchase date"))
|
||||||
|
|
||||||
|
def set_depreciation_rate(self):
|
||||||
|
for d in self.get("finance_books"):
|
||||||
|
d.rate_of_depreciation = self.get_depreciation_rate(d)
|
||||||
|
|
||||||
def make_depreciation_schedule(self):
|
def make_depreciation_schedule(self):
|
||||||
if self.depreciation_method != 'Manual':
|
depreciation_method = [d.depreciation_method for d in self.finance_books]
|
||||||
|
|
||||||
|
if 'Manual' not in depreciation_method:
|
||||||
self.schedules = []
|
self.schedules = []
|
||||||
|
|
||||||
if not self.get("schedules") and self.available_for_use_date:
|
if not self.get("schedules") and self.available_for_use_date:
|
||||||
@@ -254,14 +261,16 @@ class Asset(AccountsController):
|
|||||||
return flt(self.get('finance_books')[cint(idx)-1].value_after_depreciation)
|
return flt(self.get('finance_books')[cint(idx)-1].value_after_depreciation)
|
||||||
|
|
||||||
def get_depreciation_amount(self, depreciable_value, total_number_of_depreciations, row):
|
def get_depreciation_amount(self, depreciable_value, total_number_of_depreciations, row):
|
||||||
percentage_value = 100.0 if row.depreciation_method == 'Written Down Value' else 200.0
|
if row.depreciation_method in ["Straight Line", "Manual"]:
|
||||||
|
amt = (flt(self.gross_purchase_amount) - flt(row.expected_value_after_useful_life) -
|
||||||
|
flt(self.opening_accumulated_depreciation))
|
||||||
|
|
||||||
factor = percentage_value / cint(total_number_of_depreciations)
|
depreciation_amount = amt * row.rate_of_depreciation
|
||||||
depreciation_amount = flt(depreciable_value * factor / 100, 0)
|
else:
|
||||||
|
depreciation_amount = flt(depreciable_value) * (flt(row.rate_of_depreciation) / 100)
|
||||||
value_after_depreciation = flt(depreciable_value) - depreciation_amount
|
value_after_depreciation = flt(depreciable_value) - depreciation_amount
|
||||||
if value_after_depreciation < flt(row.expected_value_after_useful_life):
|
if value_after_depreciation < flt(row.expected_value_after_useful_life):
|
||||||
depreciation_amount = flt(depreciable_value) - flt(row.expected_value_after_useful_life)
|
depreciation_amount = flt(depreciable_value) - flt(row.expected_value_after_useful_life)
|
||||||
|
|
||||||
return depreciation_amount
|
return depreciation_amount
|
||||||
|
|
||||||
@@ -394,6 +403,32 @@ class Asset(AccountsController):
|
|||||||
make_gl_entries(gl_entries)
|
make_gl_entries(gl_entries)
|
||||||
self.db_set('booked_fixed_asset', 1)
|
self.db_set('booked_fixed_asset', 1)
|
||||||
|
|
||||||
|
def get_depreciation_rate(self, args):
|
||||||
|
if isinstance(args, string_types):
|
||||||
|
args = json.loads(args)
|
||||||
|
|
||||||
|
number_of_depreciations_booked = 0
|
||||||
|
if self.is_existing_asset:
|
||||||
|
number_of_depreciations_booked = self.number_of_depreciations_booked
|
||||||
|
|
||||||
|
float_precision = cint(frappe.db.get_default("float_precision")) or 2
|
||||||
|
tot_no_of_depreciation = flt(args.get("total_number_of_depreciations")) - flt(number_of_depreciations_booked)
|
||||||
|
|
||||||
|
if args.get("depreciation_method") in ["Straight Line", "Manual"]:
|
||||||
|
return 1.0 / tot_no_of_depreciation
|
||||||
|
|
||||||
|
if args.get("depreciation_method") == 'Double Declining Balance':
|
||||||
|
return 200.0 / args.get("total_number_of_depreciations")
|
||||||
|
|
||||||
|
if args.get("depreciation_method") == "Written Down Value" and not args.get("rate_of_depreciation"):
|
||||||
|
no_of_years = flt(args.get("total_number_of_depreciations") * flt(args.get("frequency_of_depreciation"))) / 12
|
||||||
|
value = flt(args.get("expected_value_after_useful_life")) / flt(self.gross_purchase_amount)
|
||||||
|
|
||||||
|
# square root of flt(salvage_value) / flt(asset_cost)
|
||||||
|
depreciation_rate = math.pow(value, 1.0/flt(no_of_years, 2))
|
||||||
|
|
||||||
|
return 100 * (1 - flt(depreciation_rate, float_precision))
|
||||||
|
|
||||||
def update_maintenance_status():
|
def update_maintenance_status():
|
||||||
assets = frappe.get_all('Asset', filters = {'docstatus': 1, 'maintenance_required': 1})
|
assets = frappe.get_all('Asset', filters = {'docstatus': 1, 'maintenance_required': 1})
|
||||||
|
|
||||||
@@ -480,7 +515,6 @@ def create_asset_adjustment(asset, asset_category, company):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def transfer_asset(args):
|
def transfer_asset(args):
|
||||||
import json
|
|
||||||
args = json.loads(args)
|
args = json.loads(args)
|
||||||
|
|
||||||
if args.get('serial_no'):
|
if args.get('serial_no'):
|
||||||
|
|||||||
@@ -160,9 +160,9 @@ class TestAsset(unittest.TestCase):
|
|||||||
asset.save()
|
asset.save()
|
||||||
|
|
||||||
expected_schedules = [
|
expected_schedules = [
|
||||||
["2020-06-06", 66667.0, 66667.0],
|
["2020-06-06", 66666.67, 66666.67],
|
||||||
["2021-04-06", 22222.0, 88889.0],
|
["2021-04-06", 22222.22, 88888.89],
|
||||||
["2022-02-06", 1111.0, 90000.0]
|
["2022-02-06", 1111.11, 90000.0]
|
||||||
]
|
]
|
||||||
|
|
||||||
schedules = [[cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount]
|
schedules = [[cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount]
|
||||||
@@ -192,8 +192,8 @@ class TestAsset(unittest.TestCase):
|
|||||||
asset.save()
|
asset.save()
|
||||||
|
|
||||||
expected_schedules = [
|
expected_schedules = [
|
||||||
["2020-06-06", 33333.0, 83333.0],
|
["2020-06-06", 33333.33, 83333.33],
|
||||||
["2021-04-06", 6667.0, 90000.0]
|
["2021-04-06", 6666.67, 90000.0]
|
||||||
]
|
]
|
||||||
|
|
||||||
schedules = [[cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount]
|
schedules = [[cstr(d.schedule_date), d.depreciation_amount, d.accumulated_depreciation_amount]
|
||||||
@@ -209,7 +209,7 @@ class TestAsset(unittest.TestCase):
|
|||||||
asset_name = frappe.db.get_value("Asset", {"purchase_receipt": pr.name}, 'name')
|
asset_name = frappe.db.get_value("Asset", {"purchase_receipt": pr.name}, 'name')
|
||||||
asset = frappe.get_doc('Asset', asset_name)
|
asset = frappe.get_doc('Asset', asset_name)
|
||||||
asset.calculate_depreciation = 1
|
asset.calculate_depreciation = 1
|
||||||
asset.purchase_date = '2020-06-06'
|
asset.purchase_date = '2020-01-30'
|
||||||
asset.is_existing_asset = 0
|
asset.is_existing_asset = 0
|
||||||
asset.available_for_use_date = "2020-01-30"
|
asset.available_for_use_date = "2020-01-30"
|
||||||
asset.append("finance_books", {
|
asset.append("finance_books", {
|
||||||
@@ -244,7 +244,7 @@ class TestAsset(unittest.TestCase):
|
|||||||
asset_name = frappe.db.get_value("Asset", {"purchase_receipt": pr.name}, 'name')
|
asset_name = frappe.db.get_value("Asset", {"purchase_receipt": pr.name}, 'name')
|
||||||
asset = frappe.get_doc('Asset', asset_name)
|
asset = frappe.get_doc('Asset', asset_name)
|
||||||
asset.calculate_depreciation = 1
|
asset.calculate_depreciation = 1
|
||||||
asset.purchase_date = '2020-06-06'
|
asset.purchase_date = '2020-01-30'
|
||||||
asset.available_for_use_date = "2020-01-30"
|
asset.available_for_use_date = "2020-01-30"
|
||||||
asset.append("finance_books", {
|
asset.append("finance_books", {
|
||||||
"expected_value_after_useful_life": 10000,
|
"expected_value_after_useful_life": 10000,
|
||||||
@@ -277,6 +277,37 @@ class TestAsset(unittest.TestCase):
|
|||||||
self.assertEqual(gle, expected_gle)
|
self.assertEqual(gle, expected_gle)
|
||||||
self.assertEqual(asset.get("value_after_depreciation"), 0)
|
self.assertEqual(asset.get("value_after_depreciation"), 0)
|
||||||
|
|
||||||
|
def test_depreciation_entry_for_wdv(self):
|
||||||
|
pr = make_purchase_receipt(item_code="Macbook Pro",
|
||||||
|
qty=1, rate=8000.0, location="Test Location")
|
||||||
|
|
||||||
|
asset_name = frappe.db.get_value("Asset", {"purchase_receipt": pr.name}, 'name')
|
||||||
|
asset = frappe.get_doc('Asset', asset_name)
|
||||||
|
asset.calculate_depreciation = 1
|
||||||
|
asset.available_for_use_date = '2030-06-06'
|
||||||
|
asset.purchase_date = '2030-06-06'
|
||||||
|
asset.append("finance_books", {
|
||||||
|
"expected_value_after_useful_life": 1000,
|
||||||
|
"depreciation_method": "Written Down Value",
|
||||||
|
"total_number_of_depreciations": 3,
|
||||||
|
"frequency_of_depreciation": 12,
|
||||||
|
"depreciation_start_date": "2030-12-31"
|
||||||
|
})
|
||||||
|
asset.save(ignore_permissions=True)
|
||||||
|
|
||||||
|
self.assertEqual(asset.finance_books[0].rate_of_depreciation, 50.0)
|
||||||
|
|
||||||
|
expected_schedules = [
|
||||||
|
["2030-12-31", 4000.0, 4000.0],
|
||||||
|
["2031-12-31", 2000.0, 6000.0],
|
||||||
|
["2032-12-31", 1000.0, 7000.0],
|
||||||
|
]
|
||||||
|
|
||||||
|
schedules = [[cstr(d.schedule_date), flt(d.depreciation_amount, 2), flt(d.accumulated_depreciation_amount, 2)]
|
||||||
|
for d in asset.get("schedules")]
|
||||||
|
|
||||||
|
self.assertEqual(schedules, expected_schedules)
|
||||||
|
|
||||||
def test_depreciation_entry_cancellation(self):
|
def test_depreciation_entry_cancellation(self):
|
||||||
pr = make_purchase_receipt(item_code="Macbook Pro",
|
pr = make_purchase_receipt(item_code="Macbook Pro",
|
||||||
qty=1, rate=100000.0, location="Test Location")
|
qty=1, rate=100000.0, location="Test Location")
|
||||||
|
|||||||
@@ -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": 0,
|
"allow_import": 0,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
@@ -14,11 +15,13 @@
|
|||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "",
|
"depends_on": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "finance_book",
|
"fieldname": "finance_book",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -42,14 +45,17 @@
|
|||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "depreciation_method",
|
"fieldname": "depreciation_method",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -73,14 +79,17 @@
|
|||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "total_number_of_depreciations",
|
"fieldname": "total_number_of_depreciations",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -103,14 +112,17 @@
|
|||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_5",
|
"fieldname": "column_break_5",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -133,14 +145,17 @@
|
|||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "frequency_of_depreciation",
|
"fieldname": "frequency_of_depreciation",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -163,15 +178,18 @@
|
|||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:parent.doctype == 'Asset'",
|
"depends_on": "eval:parent.doctype == 'Asset'",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "depreciation_start_date",
|
"fieldname": "depreciation_start_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -194,16 +212,19 @@
|
|||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "0",
|
"default": "0",
|
||||||
"depends_on": "eval:parent.doctype == 'Asset'",
|
"depends_on": "eval:parent.doctype == 'Asset'",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "expected_value_after_useful_life",
|
"fieldname": "expected_value_after_useful_life",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -227,14 +248,17 @@
|
|||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "value_after_depreciation",
|
"fieldname": "value_after_depreciation",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -258,20 +282,54 @@
|
|||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 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": "eval:doc.depreciation_method == 'Written Down Value'",
|
||||||
|
"description": "In Percentage",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "rate_of_depreciation",
|
||||||
|
"fieldtype": "Percent",
|
||||||
|
"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": "Rate of Depreciation",
|
||||||
|
"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
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
"has_web_view": 0,
|
||||||
"hide_heading": 0,
|
|
||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"idx": 0,
|
"idx": 0,
|
||||||
"image_view": 0,
|
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-05-12 14:56:44.800046",
|
"modified": "2019-04-09 19:45:14.523488",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Assets",
|
"module": "Assets",
|
||||||
"name": "Asset Finance Book",
|
"name": "Asset Finance Book",
|
||||||
@@ -280,10 +338,10 @@
|
|||||||
"permissions": [],
|
"permissions": [],
|
||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"read_only_onload": 0,
|
|
||||||
"show_name_in_global_search": 0,
|
"show_name_in_global_search": 0,
|
||||||
"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
|
||||||
}
|
}
|
||||||
@@ -379,7 +379,9 @@ def make_purchase_invoice(source_name, target_doc=None):
|
|||||||
def postprocess(source, target):
|
def postprocess(source, target):
|
||||||
set_missing_values(source, target)
|
set_missing_values(source, target)
|
||||||
#Get the advance paid Journal Entries in Purchase Invoice Advance
|
#Get the advance paid Journal Entries in Purchase Invoice Advance
|
||||||
target.set_advances()
|
|
||||||
|
if target.get("allocate_advances_automatically"):
|
||||||
|
target.set_advances()
|
||||||
|
|
||||||
def update_item(obj, target, source_parent):
|
def update_item(obj, target, source_parent):
|
||||||
target.amount = flt(obj.amount) - flt(obj.billed_amt)
|
target.amount = flt(obj.amount) - flt(obj.billed_amt)
|
||||||
|
|||||||
@@ -76,6 +76,14 @@ def get_data():
|
|||||||
{
|
{
|
||||||
"type": "doctype",
|
"type": "doctype",
|
||||||
"name": "Item",
|
"name": "Item",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "Bank",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "Bank Account",
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -135,6 +143,12 @@ def get_data():
|
|||||||
"name": "Bank Reconciliation",
|
"name": "Bank Reconciliation",
|
||||||
"description": _("Update bank payment dates with journals.")
|
"description": _("Update bank payment dates with journals.")
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "page",
|
||||||
|
"label": _("Reconcile payments and bank transactions"),
|
||||||
|
"name": "bank-reconciliation",
|
||||||
|
"description": _("Link bank transactions with payments.")
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "doctype",
|
"type": "doctype",
|
||||||
"label": _("Match Payments with Invoices"),
|
"label": _("Match Payments with Invoices"),
|
||||||
|
|||||||
@@ -35,6 +35,11 @@ def get_data():
|
|||||||
"type": "doctype",
|
"type": "doctype",
|
||||||
"name": "Amazon MWS Settings",
|
"name": "Amazon MWS Settings",
|
||||||
"description": _("Connect Amazon with ERPNext"),
|
"description": _("Connect Amazon with ERPNext"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "Plaid Settings",
|
||||||
|
"description": _("Connect your bank accounts to ERPNext"),
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,8 +30,9 @@ class AccountsController(TransactionBase):
|
|||||||
return self.__company_currency
|
return self.__company_currency
|
||||||
|
|
||||||
def onload(self):
|
def onload(self):
|
||||||
self.get("__onload").make_payment_via_journal_entry \
|
if self.get("__onload"):
|
||||||
= frappe.db.get_single_value('Accounts Settings', 'make_payment_via_journal_entry')
|
self.get("__onload").make_payment_via_journal_entry \
|
||||||
|
= frappe.db.get_single_value('Accounts Settings', 'make_payment_via_journal_entry')
|
||||||
|
|
||||||
if self.is_new():
|
if self.is_new():
|
||||||
relevant_docs = ("Quotation", "Purchase Order", "Sales Order",
|
relevant_docs = ("Quotation", "Purchase Order", "Sales Order",
|
||||||
@@ -116,12 +117,6 @@ class AccountsController(TransactionBase):
|
|||||||
self.validate_non_invoice_documents_schedule()
|
self.validate_non_invoice_documents_schedule()
|
||||||
|
|
||||||
def before_print(self):
|
def before_print(self):
|
||||||
if self.doctype in ['Journal Entry', 'Payment Entry', 'Sales Invoice', 'Purchase Invoice']:
|
|
||||||
self.gl_entries = frappe.get_list("GL Entry", filters={
|
|
||||||
"voucher_type": self.doctype,
|
|
||||||
"voucher_no": self.name
|
|
||||||
}, fields=["account", "party_type", "party", "debit", "credit", "remarks"])
|
|
||||||
|
|
||||||
if self.doctype in ['Purchase Order', 'Sales Order', 'Sales Invoice', 'Purchase Invoice',
|
if self.doctype in ['Purchase Order', 'Sales Order', 'Sales Invoice', 'Purchase Invoice',
|
||||||
'Supplier Quotation', 'Purchase Receipt', 'Delivery Note', 'Quotation']:
|
'Supplier Quotation', 'Purchase Receipt', 'Delivery Note', 'Quotation']:
|
||||||
if self.get("group_same_items"):
|
if self.get("group_same_items"):
|
||||||
@@ -965,11 +960,11 @@ def get_advance_journal_entries(party_type, party, party_account, amount_field,
|
|||||||
|
|
||||||
|
|
||||||
def get_advance_payment_entries(party_type, party, party_account, order_doctype,
|
def get_advance_payment_entries(party_type, party, party_account, order_doctype,
|
||||||
order_list=None, include_unallocated=True, against_all_orders=False, limit=1000):
|
order_list=None, include_unallocated=True, against_all_orders=False, limit=None):
|
||||||
party_account_field = "paid_from" if party_type == "Customer" else "paid_to"
|
party_account_field = "paid_from" if party_type == "Customer" else "paid_to"
|
||||||
payment_type = "Receive" if party_type == "Customer" else "Pay"
|
payment_type = "Receive" if party_type == "Customer" else "Pay"
|
||||||
payment_entries_against_order, unallocated_payment_entries = [], []
|
payment_entries_against_order, unallocated_payment_entries = [], []
|
||||||
limit_cond = "limit %s" % (limit or 1000)
|
limit_cond = "limit %s" % limit if limit else ""
|
||||||
|
|
||||||
if order_list or against_all_orders:
|
if order_list or against_all_orders:
|
||||||
if order_list:
|
if order_list:
|
||||||
|
|||||||
@@ -244,6 +244,10 @@ def make_return_doc(doctype, source_name, target_doc=None):
|
|||||||
doc.paid_amount = -1 * source.paid_amount
|
doc.paid_amount = -1 * source.paid_amount
|
||||||
doc.base_paid_amount = -1 * source.base_paid_amount
|
doc.base_paid_amount = -1 * source.base_paid_amount
|
||||||
|
|
||||||
|
if doc.get("is_return") and hasattr(doc, "packed_items"):
|
||||||
|
for d in doc.get("packed_items"):
|
||||||
|
d.qty = d.qty * -1
|
||||||
|
|
||||||
doc.discount_amount = -1 * source.discount_amount
|
doc.discount_amount = -1 * source.discount_amount
|
||||||
doc.run_method("calculate_taxes_and_totals")
|
doc.run_method("calculate_taxes_and_totals")
|
||||||
|
|
||||||
|
|||||||
@@ -42,10 +42,10 @@ def create_variant_with_tables(item, args):
|
|||||||
return variant
|
return variant
|
||||||
|
|
||||||
def make_item_variant():
|
def make_item_variant():
|
||||||
frappe.delete_doc_if_exists("Item", "_Test Variant Item-S", force=1)
|
frappe.delete_doc_if_exists("Item", "_Test Variant Item-XSL", force=1)
|
||||||
variant = create_variant_with_tables("_Test Variant Item", '{"Test Size": "Small"}')
|
variant = create_variant_with_tables("_Test Variant Item", '{"Test Size": "Extra Small"}')
|
||||||
variant.item_code = "_Test Variant Item-S"
|
variant.item_code = "_Test Variant Item-XSL"
|
||||||
variant.item_name = "_Test Variant Item-S"
|
variant.item_name = "_Test Variant Item-XSL"
|
||||||
variant.save()
|
variant.save()
|
||||||
return variant
|
return variant
|
||||||
|
|
||||||
|
|||||||
@@ -19,27 +19,24 @@ def verify_request():
|
|||||||
frappe.get_request_header("X-Wc-Webhook-Signature") and \
|
frappe.get_request_header("X-Wc-Webhook-Signature") and \
|
||||||
not sig == bytes(frappe.get_request_header("X-Wc-Webhook-Signature").encode()):
|
not sig == bytes(frappe.get_request_header("X-Wc-Webhook-Signature").encode()):
|
||||||
frappe.throw(_("Unverified Webhook Data"))
|
frappe.throw(_("Unverified Webhook Data"))
|
||||||
frappe.set_user(woocommerce_settings.modified_by)
|
frappe.set_user(woocommerce_settings.creation_user)
|
||||||
|
|
||||||
@frappe.whitelist(allow_guest=True)
|
@frappe.whitelist(allow_guest=True)
|
||||||
def order(data=None):
|
def order():
|
||||||
if not data:
|
woocommerce_settings = frappe.get_doc("Woocommerce Settings")
|
||||||
verify_request()
|
if frappe.flags.woocomm_test_order_data:
|
||||||
|
fd = frappe.flags.woocomm_test_order_data
|
||||||
|
event = "created"
|
||||||
|
|
||||||
if frappe.request and frappe.request.data:
|
elif frappe.request and frappe.request.data:
|
||||||
|
verify_request()
|
||||||
fd = json.loads(frappe.request.data)
|
fd = json.loads(frappe.request.data)
|
||||||
elif data:
|
event = frappe.get_request_header("X-Wc-Webhook-Event")
|
||||||
fd = data
|
|
||||||
else:
|
else:
|
||||||
return "success"
|
return "success"
|
||||||
|
|
||||||
if not data:
|
|
||||||
event = frappe.get_request_header("X-Wc-Webhook-Event")
|
|
||||||
else:
|
|
||||||
event = "created"
|
|
||||||
|
|
||||||
if event == "created":
|
if event == "created":
|
||||||
|
|
||||||
raw_billing_data = fd.get("billing")
|
raw_billing_data = fd.get("billing")
|
||||||
customer_woo_com_email = raw_billing_data.get("email")
|
customer_woo_com_email = raw_billing_data.get("email")
|
||||||
|
|
||||||
@@ -73,7 +70,7 @@ def order(data=None):
|
|||||||
|
|
||||||
new_sales_order.po_no = fd.get("id")
|
new_sales_order.po_no = fd.get("id")
|
||||||
new_sales_order.woocommerce_id = fd.get("id")
|
new_sales_order.woocommerce_id = fd.get("id")
|
||||||
new_sales_order.naming_series = "SO-"
|
new_sales_order.naming_series = woocommerce_settings.sales_order_series or "SO-WOO-"
|
||||||
|
|
||||||
placed_order_date = created_date[0]
|
placed_order_date = created_date[0]
|
||||||
raw_date = datetime.datetime.strptime(placed_order_date, "%Y-%m-%d")
|
raw_date = datetime.datetime.strptime(placed_order_date, "%Y-%m-%d")
|
||||||
@@ -100,10 +97,10 @@ def order(data=None):
|
|||||||
"item_name": found_item.item_name,
|
"item_name": found_item.item_name,
|
||||||
"description": found_item.item_name,
|
"description": found_item.item_name,
|
||||||
"delivery_date":order_delivery_date,
|
"delivery_date":order_delivery_date,
|
||||||
"uom": "Nos",
|
"uom": woocommerce_settings.uom or _("Nos"),
|
||||||
"qty": item.get("quantity"),
|
"qty": item.get("quantity"),
|
||||||
"rate": item.get("price"),
|
"rate": item.get("price"),
|
||||||
"warehouse": "Stores" + " - " + company_abbr
|
"warehouse": woocommerce_settings.warehouse or "Stores" + " - " + company_abbr
|
||||||
})
|
})
|
||||||
|
|
||||||
add_tax_details(new_sales_order,ordered_items_tax,"Ordered Item tax",0)
|
add_tax_details(new_sales_order,ordered_items_tax,"Ordered Item tax",0)
|
||||||
@@ -175,6 +172,7 @@ def link_customer_and_address(raw_billing_data,customer_status):
|
|||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
|
|
||||||
def link_item(item_data,item_status):
|
def link_item(item_data,item_status):
|
||||||
|
woocommerce_settings = frappe.get_doc("Woocommerce Settings")
|
||||||
|
|
||||||
if item_status == 0:
|
if item_status == 0:
|
||||||
#Create Item
|
#Create Item
|
||||||
@@ -189,6 +187,7 @@ def link_item(item_data,item_status):
|
|||||||
item.item_code = "woocommerce - " + str(item_data.get("product_id"))
|
item.item_code = "woocommerce - " + str(item_data.get("product_id"))
|
||||||
item.woocommerce_id = str(item_data.get("product_id"))
|
item.woocommerce_id = str(item_data.get("product_id"))
|
||||||
item.item_group = "WooCommerce Products"
|
item.item_group = "WooCommerce Products"
|
||||||
|
item.stock_uom = woocommerce_settings.uom or _("Nos")
|
||||||
item.save()
|
item.save()
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,81 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
from frappe import _
|
||||||
|
import requests
|
||||||
|
from plaid import Client
|
||||||
|
from plaid.errors import APIError, ItemError
|
||||||
|
|
||||||
|
class PlaidConnector():
|
||||||
|
def __init__(self, access_token=None):
|
||||||
|
|
||||||
|
if not(frappe.conf.get("plaid_client_id") and frappe.conf.get("plaid_secret") and frappe.conf.get("plaid_public_key")):
|
||||||
|
frappe.throw(_("Please complete your Plaid API configuration before synchronizing your account"))
|
||||||
|
|
||||||
|
self.config = {
|
||||||
|
"plaid_client_id": frappe.conf.get("plaid_client_id"),
|
||||||
|
"plaid_secret": frappe.conf.get("plaid_secret"),
|
||||||
|
"plaid_public_key": frappe.conf.get("plaid_public_key"),
|
||||||
|
"plaid_env": frappe.conf.get("plaid_env")
|
||||||
|
}
|
||||||
|
|
||||||
|
self.client = Client(client_id=self.config["plaid_client_id"],
|
||||||
|
secret=self.config["plaid_secret"],
|
||||||
|
public_key=self.config["plaid_public_key"],
|
||||||
|
environment=self.config["plaid_env"]
|
||||||
|
)
|
||||||
|
|
||||||
|
self.access_token = access_token
|
||||||
|
|
||||||
|
def get_access_token(self, public_token):
|
||||||
|
if public_token is None:
|
||||||
|
frappe.log_error(_("Public token is missing for this bank"), _("Plaid public token error"))
|
||||||
|
|
||||||
|
response = self.client.Item.public_token.exchange(public_token)
|
||||||
|
access_token = response['access_token']
|
||||||
|
|
||||||
|
return access_token
|
||||||
|
|
||||||
|
def auth(self):
|
||||||
|
try:
|
||||||
|
self.client.Auth.get(self.access_token)
|
||||||
|
print("Authentication successful.....")
|
||||||
|
except ItemError as e:
|
||||||
|
if e.code == 'ITEM_LOGIN_REQUIRED':
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
except APIError as e:
|
||||||
|
if e.code == 'PLANNED_MAINTENANCE':
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
except requests.Timeout:
|
||||||
|
pass
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
frappe.log_error(frappe.get_traceback(), _("Plaid authentication error"))
|
||||||
|
frappe.msgprint({"title": _("Authentication Failed"), "message":e, "raise_exception":1, "indicator":'red'})
|
||||||
|
|
||||||
|
def get_transactions(self, start_date, end_date, account_id=None):
|
||||||
|
try:
|
||||||
|
self.auth()
|
||||||
|
if account_id:
|
||||||
|
account_ids = [account_id]
|
||||||
|
|
||||||
|
response = self.client.Transactions.get(self.access_token, start_date=start_date, end_date=end_date, account_ids=account_ids)
|
||||||
|
|
||||||
|
else:
|
||||||
|
response = self.client.Transactions.get(self.access_token, start_date=start_date, end_date=end_date)
|
||||||
|
|
||||||
|
transactions = response['transactions']
|
||||||
|
|
||||||
|
while len(transactions) < response['total_transactions']:
|
||||||
|
response = self.client.Transactions.get(self.access_token, start_date=start_date, end_date=end_date, offset=len(transactions))
|
||||||
|
transactions.extend(response['transactions'])
|
||||||
|
return transactions
|
||||||
|
except Exception:
|
||||||
|
frappe.log_error(frappe.get_traceback(), _("Plaid transactions sync error"))
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
|
||||||
|
frappe.provide("erpnext.integrations");
|
||||||
|
|
||||||
|
frappe.ui.form.on('Plaid Settings', {
|
||||||
|
link_new_account: function(frm) {
|
||||||
|
new erpnext.integrations.plaidLink(frm);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
erpnext.integrations.plaidLink = class plaidLink {
|
||||||
|
constructor(parent) {
|
||||||
|
this.frm = parent;
|
||||||
|
this.product = ["transactions", "auth"];
|
||||||
|
this.plaidUrl = 'https://cdn.plaid.com/link/v2/stable/link-initialize.js';
|
||||||
|
this.init_config();
|
||||||
|
}
|
||||||
|
|
||||||
|
init_config() {
|
||||||
|
const me = this;
|
||||||
|
frappe.xcall('erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.plaid_configuration')
|
||||||
|
.then(result => {
|
||||||
|
if (result !== "disabled") {
|
||||||
|
me.plaid_env = result.plaid_env;
|
||||||
|
me.plaid_public_key = result.plaid_public_key;
|
||||||
|
me.client_name = result.client_name;
|
||||||
|
me.init_plaid();
|
||||||
|
} else {
|
||||||
|
frappe.throw(__("Please save your document before adding a new account"));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
init_plaid() {
|
||||||
|
const me = this;
|
||||||
|
me.loadScript(me.plaidUrl)
|
||||||
|
.then(() => {
|
||||||
|
me.onScriptLoaded(me);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
if (me.linkHandler) {
|
||||||
|
me.linkHandler.open();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
me.onScriptError(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
loadScript(src) {
|
||||||
|
return new Promise(function (resolve, reject) {
|
||||||
|
if (document.querySelector('script[src="' + src + '"]')) {
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const el = document.createElement('script');
|
||||||
|
el.type = 'text/javascript';
|
||||||
|
el.async = true;
|
||||||
|
el.src = src;
|
||||||
|
el.addEventListener('load', resolve);
|
||||||
|
el.addEventListener('error', reject);
|
||||||
|
el.addEventListener('abort', reject);
|
||||||
|
document.head.appendChild(el);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onScriptLoaded(me) {
|
||||||
|
me.linkHandler = window.Plaid.create({
|
||||||
|
clientName: me.client_name,
|
||||||
|
env: me.plaid_env,
|
||||||
|
key: me.plaid_public_key,
|
||||||
|
onSuccess: me.plaid_success,
|
||||||
|
product: me.product
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onScriptError(error) {
|
||||||
|
frappe.msgprint('There was an issue loading the link-initialize.js script');
|
||||||
|
frappe.msgprint(error);
|
||||||
|
}
|
||||||
|
|
||||||
|
plaid_success(token, response) {
|
||||||
|
const me = this;
|
||||||
|
|
||||||
|
frappe.prompt({
|
||||||
|
fieldtype:"Link",
|
||||||
|
options: "Company",
|
||||||
|
label:__("Company"),
|
||||||
|
fieldname:"company",
|
||||||
|
reqd:1
|
||||||
|
}, (data) => {
|
||||||
|
me.company = data.company;
|
||||||
|
frappe.xcall('erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.add_institution', {token: token, response: response})
|
||||||
|
.then((result) => {
|
||||||
|
frappe.xcall('erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.add_bank_accounts', {response: response,
|
||||||
|
bank: result, company: me.company});
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
frappe.show_alert({message:__("Bank accounts added"), indicator:'green'});
|
||||||
|
});
|
||||||
|
}, __("Select a company"), __("Continue"));
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
{
|
||||||
|
"allow_copy": 0,
|
||||||
|
"allow_events_in_timeline": 0,
|
||||||
|
"allow_guest_to_view": 0,
|
||||||
|
"allow_import": 0,
|
||||||
|
"allow_rename": 0,
|
||||||
|
"beta": 0,
|
||||||
|
"creation": "2018-10-25 10:02:48.656165",
|
||||||
|
"custom": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "DocType",
|
||||||
|
"document_type": "",
|
||||||
|
"editable_grid": 1,
|
||||||
|
"engine": "InnoDB",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fieldname": "enabled",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"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": "Enabled",
|
||||||
|
"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": "eval:doc.enabled==1",
|
||||||
|
"fieldname": "automatic_sync",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"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": "Synchronize all accounts every hour",
|
||||||
|
"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": "eval:(doc.enabled==1)&&(!doc.__islocal)",
|
||||||
|
"fieldname": "link_new_account",
|
||||||
|
"fieldtype": "Button",
|
||||||
|
"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": "Link a new bank account",
|
||||||
|
"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,
|
||||||
|
"hide_heading": 0,
|
||||||
|
"hide_toolbar": 0,
|
||||||
|
"idx": 0,
|
||||||
|
"image_view": 0,
|
||||||
|
"in_create": 0,
|
||||||
|
"is_submittable": 0,
|
||||||
|
"issingle": 1,
|
||||||
|
"istable": 0,
|
||||||
|
"max_attachments": 0,
|
||||||
|
"modified": "2018-12-14 12:51:12.331395",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "ERPNext Integrations",
|
||||||
|
"name": "Plaid Settings",
|
||||||
|
"name_case": "",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"permissions": [
|
||||||
|
{
|
||||||
|
"amend": 0,
|
||||||
|
"cancel": 0,
|
||||||
|
"create": 1,
|
||||||
|
"delete": 1,
|
||||||
|
"email": 1,
|
||||||
|
"export": 0,
|
||||||
|
"if_owner": 0,
|
||||||
|
"import": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"print": 1,
|
||||||
|
"read": 1,
|
||||||
|
"report": 0,
|
||||||
|
"role": "System Manager",
|
||||||
|
"set_user_permissions": 0,
|
||||||
|
"share": 1,
|
||||||
|
"submit": 0,
|
||||||
|
"write": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"quick_entry": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"read_only_onload": 0,
|
||||||
|
"show_name_in_global_search": 0,
|
||||||
|
"sort_field": "modified",
|
||||||
|
"sort_order": "DESC",
|
||||||
|
"track_changes": 0,
|
||||||
|
"track_seen": 0,
|
||||||
|
"track_views": 0
|
||||||
|
}
|
||||||
@@ -0,0 +1,198 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
import json
|
||||||
|
from frappe import _
|
||||||
|
from frappe.model.document import Document
|
||||||
|
from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account
|
||||||
|
from erpnext.erpnext_integrations.doctype.plaid_settings.plaid_connector import PlaidConnector
|
||||||
|
from frappe.utils import getdate, formatdate, today, add_months
|
||||||
|
|
||||||
|
class PlaidSettings(Document):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def plaid_configuration():
|
||||||
|
if frappe.db.get_value("Plaid Settings", None, "enabled") == "1":
|
||||||
|
return {"plaid_public_key": frappe.conf.get("plaid_public_key") or None, "plaid_env": frappe.conf.get("plaid_env") or None, "client_name": frappe.local.site }
|
||||||
|
else:
|
||||||
|
return "disabled"
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def add_institution(token, response):
|
||||||
|
response = json.loads(response)
|
||||||
|
|
||||||
|
plaid = PlaidConnector()
|
||||||
|
access_token = plaid.get_access_token(token)
|
||||||
|
|
||||||
|
if not frappe.db.exists("Bank", response["institution"]["name"]):
|
||||||
|
try:
|
||||||
|
bank = frappe.get_doc({
|
||||||
|
"doctype": "Bank",
|
||||||
|
"bank_name": response["institution"]["name"],
|
||||||
|
"plaid_access_token": access_token
|
||||||
|
})
|
||||||
|
bank.insert()
|
||||||
|
except Exception:
|
||||||
|
frappe.throw(frappe.get_traceback())
|
||||||
|
|
||||||
|
else:
|
||||||
|
bank = frappe.get_doc("Bank", response["institution"]["name"])
|
||||||
|
bank.plaid_access_token = access_token
|
||||||
|
bank.save()
|
||||||
|
|
||||||
|
return bank
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def add_bank_accounts(response, bank, company):
|
||||||
|
response = json.loads(response) if not "accounts" in response else response
|
||||||
|
bank = json.loads(bank)
|
||||||
|
result = []
|
||||||
|
|
||||||
|
default_gl_account = get_default_bank_cash_account(company, "Bank")
|
||||||
|
if not default_gl_account:
|
||||||
|
frappe.throw(_("Please setup a default bank account for company {0}".format(company)))
|
||||||
|
|
||||||
|
for account in response["accounts"]:
|
||||||
|
acc_type = frappe.db.get_value("Account Type", account["type"])
|
||||||
|
if not acc_type:
|
||||||
|
add_account_type(account["type"])
|
||||||
|
|
||||||
|
acc_subtype = frappe.db.get_value("Account Subtype", account["subtype"])
|
||||||
|
if not acc_subtype:
|
||||||
|
add_account_subtype(account["subtype"])
|
||||||
|
|
||||||
|
if not frappe.db.exists("Bank Account", dict(integration_id=account["id"])):
|
||||||
|
try:
|
||||||
|
new_account = frappe.get_doc({
|
||||||
|
"doctype": "Bank Account",
|
||||||
|
"bank": bank["bank_name"],
|
||||||
|
"account": default_gl_account.account,
|
||||||
|
"account_name": account["name"],
|
||||||
|
"account_type": account["type"] or "",
|
||||||
|
"account_subtype": account["subtype"] or "",
|
||||||
|
"mask": account["mask"] or "",
|
||||||
|
"integration_id": account["id"],
|
||||||
|
"is_company_account": 1,
|
||||||
|
"company": company
|
||||||
|
})
|
||||||
|
new_account.insert()
|
||||||
|
|
||||||
|
result.append(new_account.name)
|
||||||
|
|
||||||
|
except frappe.UniqueValidationError:
|
||||||
|
frappe.msgprint(_("Bank account {0} already exists and could not be created again").format(new_account.account_name))
|
||||||
|
except Exception:
|
||||||
|
frappe.throw(frappe.get_traceback())
|
||||||
|
|
||||||
|
else:
|
||||||
|
result.append(frappe.db.get_value("Bank Account", dict(integration_id=account["id"]), "name"))
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
def add_account_type(account_type):
|
||||||
|
try:
|
||||||
|
frappe.get_doc({
|
||||||
|
"doctype": "Account Type",
|
||||||
|
"account_type": account_type
|
||||||
|
}).insert()
|
||||||
|
except Exception:
|
||||||
|
frappe.throw(frappe.get_traceback())
|
||||||
|
|
||||||
|
|
||||||
|
def add_account_subtype(account_subtype):
|
||||||
|
try:
|
||||||
|
frappe.get_doc({
|
||||||
|
"doctype": "Account Subtype",
|
||||||
|
"account_subtype": account_subtype
|
||||||
|
}).insert()
|
||||||
|
except Exception:
|
||||||
|
frappe.throw(frappe.get_traceback())
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def sync_transactions(bank, bank_account):
|
||||||
|
|
||||||
|
last_sync_date = frappe.db.get_value("Bank Account", bank_account, "last_integration_date")
|
||||||
|
if last_sync_date:
|
||||||
|
start_date = formatdate(last_sync_date, "YYYY-MM-dd")
|
||||||
|
else:
|
||||||
|
start_date = formatdate(add_months(today(), -12), "YYYY-MM-dd")
|
||||||
|
end_date = formatdate(today(), "YYYY-MM-dd")
|
||||||
|
|
||||||
|
try:
|
||||||
|
transactions = get_transactions(bank=bank, bank_account=bank_account, start_date=start_date, end_date=end_date)
|
||||||
|
result = []
|
||||||
|
if transactions:
|
||||||
|
for transaction in transactions:
|
||||||
|
result.append(new_bank_transaction(transaction))
|
||||||
|
|
||||||
|
frappe.db.set_value("Bank Account", bank_account, "last_integration_date", getdate(end_date))
|
||||||
|
|
||||||
|
return result
|
||||||
|
except Exception:
|
||||||
|
frappe.log_error(frappe.get_traceback(), _("Plaid transactions sync error"))
|
||||||
|
|
||||||
|
def get_transactions(bank, bank_account=None, start_date=None, end_date=None):
|
||||||
|
access_token = None
|
||||||
|
|
||||||
|
if bank_account:
|
||||||
|
related_bank = frappe.db.get_values("Bank Account", bank_account, ["bank", "integration_id"], as_dict=True)
|
||||||
|
access_token = frappe.db.get_value("Bank", related_bank[0].bank, "plaid_access_token")
|
||||||
|
account_id = related_bank[0].integration_id
|
||||||
|
|
||||||
|
else:
|
||||||
|
access_token = frappe.db.get_value("Bank", bank, "plaid_access_token")
|
||||||
|
account_id = None
|
||||||
|
|
||||||
|
plaid = PlaidConnector(access_token)
|
||||||
|
transactions = plaid.get_transactions(start_date=start_date, end_date=end_date, account_id=account_id)
|
||||||
|
|
||||||
|
return transactions
|
||||||
|
|
||||||
|
def new_bank_transaction(transaction):
|
||||||
|
result = []
|
||||||
|
|
||||||
|
bank_account = frappe.db.get_value("Bank Account", dict(integration_id=transaction["account_id"]))
|
||||||
|
|
||||||
|
if float(transaction["amount"]) >= 0:
|
||||||
|
debit = float(transaction["amount"])
|
||||||
|
credit = 0
|
||||||
|
else:
|
||||||
|
debit = 0
|
||||||
|
credit = abs(float(transaction["amount"]))
|
||||||
|
|
||||||
|
status = "Pending" if transaction["pending"] == "True" else "Settled"
|
||||||
|
|
||||||
|
if not frappe.db.exists("Bank Transaction", dict(transaction_id=transaction["transaction_id"])):
|
||||||
|
try:
|
||||||
|
new_transaction = frappe.get_doc({
|
||||||
|
"doctype": "Bank Transaction",
|
||||||
|
"date": getdate(transaction["date"]),
|
||||||
|
"status": status,
|
||||||
|
"bank_account": bank_account,
|
||||||
|
"debit": debit,
|
||||||
|
"credit": credit,
|
||||||
|
"currency": transaction["iso_currency_code"],
|
||||||
|
"description": transaction["name"]
|
||||||
|
})
|
||||||
|
new_transaction.insert()
|
||||||
|
new_transaction.submit()
|
||||||
|
|
||||||
|
result.append(new_transaction.name)
|
||||||
|
|
||||||
|
except Exception:
|
||||||
|
frappe.throw(frappe.get_traceback())
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
def automatic_synchronization():
|
||||||
|
settings = frappe.get_doc("Plaid Settings", "Plaid Settings")
|
||||||
|
|
||||||
|
if settings.enabled == 1 and settings.automatic_sync == 1:
|
||||||
|
plaid_accounts = frappe.get_all("Bank Account", filter={"integration_id": ["!=", ""]}, fields=["name", "bank"])
|
||||||
|
|
||||||
|
for plaid_account in plaid_accounts:
|
||||||
|
frappe.enqueue("erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.sync_transactions", bank=plaid_account.bank, bank_account=plaid_account.name)
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
// rename this file from _test_[name] to test_[name] to activate
|
||||||
|
// and remove above this line
|
||||||
|
|
||||||
|
QUnit.test("test: Plaid Settings", function (assert) {
|
||||||
|
let done = assert.async();
|
||||||
|
|
||||||
|
// number of asserts
|
||||||
|
assert.expect(1);
|
||||||
|
|
||||||
|
frappe.run_serially([
|
||||||
|
// insert a new Plaid Settings
|
||||||
|
() => frappe.tests.make('Plaid Settings', [
|
||||||
|
// values to be set
|
||||||
|
{key: 'value'}
|
||||||
|
]),
|
||||||
|
() => {
|
||||||
|
assert.equal(cur_frm.doc.key, 'value');
|
||||||
|
},
|
||||||
|
() => done()
|
||||||
|
]);
|
||||||
|
|
||||||
|
});
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
|
# See license.txt
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
import frappe
|
||||||
|
from erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings import plaid_configuration, add_account_type, add_account_subtype, new_bank_transaction, add_bank_accounts
|
||||||
|
import json
|
||||||
|
from frappe.utils.response import json_handler
|
||||||
|
from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account
|
||||||
|
|
||||||
|
class TestPlaidSettings(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
for bt in frappe.get_all("Bank Transaction"):
|
||||||
|
doc = frappe.get_doc("Bank Transaction", bt.name)
|
||||||
|
doc.cancel()
|
||||||
|
doc.delete()
|
||||||
|
|
||||||
|
for ba in frappe.get_all("Bank Account"):
|
||||||
|
frappe.get_doc("Bank Account", ba.name).delete()
|
||||||
|
|
||||||
|
for at in frappe.get_all("Account Type"):
|
||||||
|
frappe.get_doc("Account Type", at.name).delete()
|
||||||
|
|
||||||
|
for ast in frappe.get_all("Account Subtype"):
|
||||||
|
frappe.get_doc("Account Subtype", ast.name).delete()
|
||||||
|
|
||||||
|
def test_plaid_disabled(self):
|
||||||
|
frappe.db.set_value("Plaid Settings", None, "enabled", 0)
|
||||||
|
self.assertTrue(plaid_configuration() == "disabled")
|
||||||
|
|
||||||
|
def test_add_account_type(self):
|
||||||
|
add_account_type("brokerage")
|
||||||
|
self.assertEqual(frappe.get_doc("Account Type", "brokerage").name, "brokerage")
|
||||||
|
|
||||||
|
def test_add_account_subtype(self):
|
||||||
|
add_account_subtype("loan")
|
||||||
|
self.assertEqual(frappe.get_doc("Account Subtype", "loan").name, "loan")
|
||||||
|
|
||||||
|
def test_default_bank_account(self):
|
||||||
|
if not frappe.db.exists("Bank", "Citi"):
|
||||||
|
frappe.get_doc({
|
||||||
|
"doctype": "Bank",
|
||||||
|
"bank_name": "Citi"
|
||||||
|
}).insert()
|
||||||
|
|
||||||
|
bank_accounts = {
|
||||||
|
'account': {
|
||||||
|
'subtype': 'checking',
|
||||||
|
'mask': '0000',
|
||||||
|
'type': 'depository',
|
||||||
|
'id': '6GbM6RRQgdfy3lAqGz4JUnpmR948WZFg8DjQK',
|
||||||
|
'name': 'Plaid Checking'
|
||||||
|
},
|
||||||
|
'account_id': '6GbM6RRQgdfy3lAqGz4JUnpmR948WZFg8DjQK',
|
||||||
|
'link_session_id': 'db673d75-61aa-442a-864f-9b3f174f3725',
|
||||||
|
'accounts': [{
|
||||||
|
'type': 'depository',
|
||||||
|
'subtype': 'checking',
|
||||||
|
'mask': '0000',
|
||||||
|
'id': '6GbM6RRQgdfy3lAqGz4JUnpmR948WZFg8DjQK',
|
||||||
|
'name': 'Plaid Checking'
|
||||||
|
}],
|
||||||
|
'institution': {
|
||||||
|
'institution_id': 'ins_6',
|
||||||
|
'name': 'Citi'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bank = json.dumps(frappe.get_doc("Bank", "Citi").as_dict(), default=json_handler)
|
||||||
|
company = frappe.db.get_single_value('Global Defaults', 'default_company')
|
||||||
|
frappe.db.set_value("Company", company, "default_bank_account", None)
|
||||||
|
|
||||||
|
self.assertRaises(frappe.ValidationError, add_bank_accounts, response=bank_accounts, bank=bank, company=company)
|
||||||
|
|
||||||
|
def test_new_transaction(self):
|
||||||
|
if not frappe.db.exists("Bank", "Citi"):
|
||||||
|
frappe.get_doc({
|
||||||
|
"doctype": "Bank",
|
||||||
|
"bank_name": "Citi"
|
||||||
|
}).insert()
|
||||||
|
|
||||||
|
bank_accounts = {
|
||||||
|
'account': {
|
||||||
|
'subtype': 'checking',
|
||||||
|
'mask': '0000',
|
||||||
|
'type': 'depository',
|
||||||
|
'id': '6GbM6RRQgdfy3lAqGz4JUnpmR948WZFg8DjQK',
|
||||||
|
'name': 'Plaid Checking'
|
||||||
|
},
|
||||||
|
'account_id': '6GbM6RRQgdfy3lAqGz4JUnpmR948WZFg8DjQK',
|
||||||
|
'link_session_id': 'db673d75-61aa-442a-864f-9b3f174f3725',
|
||||||
|
'accounts': [{
|
||||||
|
'type': 'depository',
|
||||||
|
'subtype': 'checking',
|
||||||
|
'mask': '0000',
|
||||||
|
'id': '6GbM6RRQgdfy3lAqGz4JUnpmR948WZFg8DjQK',
|
||||||
|
'name': 'Plaid Checking'
|
||||||
|
}],
|
||||||
|
'institution': {
|
||||||
|
'institution_id': 'ins_6',
|
||||||
|
'name': 'Citi'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bank = json.dumps(frappe.get_doc("Bank", "Citi").as_dict(), default=json_handler)
|
||||||
|
company = frappe.db.get_single_value('Global Defaults', 'default_company')
|
||||||
|
|
||||||
|
if frappe.db.get_value("Company", company, "default_bank_account") is None:
|
||||||
|
frappe.db.set_value("Company", company, "default_bank_account", get_default_bank_cash_account(company, "Cash").get("account"))
|
||||||
|
|
||||||
|
add_bank_accounts(bank_accounts, bank, company)
|
||||||
|
|
||||||
|
transactions = {
|
||||||
|
'account_owner': None,
|
||||||
|
'category': ['Food and Drink', 'Restaurants'],
|
||||||
|
'account_id': 'b4Jkp1LJDZiPgojpr1ansXJrj5Q6w9fVmv6ov',
|
||||||
|
'pending_transaction_id': None,
|
||||||
|
'transaction_id': 'x374xPa7DvUewqlR5mjNIeGK8r8rl3Sn647LM',
|
||||||
|
'unofficial_currency_code': None,
|
||||||
|
'name': 'INTRST PYMNT',
|
||||||
|
'transaction_type': 'place',
|
||||||
|
'amount': -4.22,
|
||||||
|
'location': {
|
||||||
|
'city': None,
|
||||||
|
'zip': None,
|
||||||
|
'store_number': None,
|
||||||
|
'lon': None,
|
||||||
|
'state': None,
|
||||||
|
'address': None,
|
||||||
|
'lat': None
|
||||||
|
},
|
||||||
|
'payment_meta': {
|
||||||
|
'reference_number': None,
|
||||||
|
'payer': None,
|
||||||
|
'payment_method': None,
|
||||||
|
'reason': None,
|
||||||
|
'payee': None,
|
||||||
|
'ppd_id': None,
|
||||||
|
'payment_processor': None,
|
||||||
|
'by_order_of': None
|
||||||
|
},
|
||||||
|
'date': '2017-12-22',
|
||||||
|
'category_id': '13005000',
|
||||||
|
'pending': False,
|
||||||
|
'iso_currency_code': 'USD'
|
||||||
|
}
|
||||||
|
|
||||||
|
new_bank_transaction(transactions)
|
||||||
|
|
||||||
|
self.assertTrue(len(frappe.get_all("Bank Transaction")) == 1)
|
||||||
@@ -43,3 +43,14 @@ frappe.ui.form.on('Woocommerce Settings', {
|
|||||||
frm.set_df_property("api_consumer_secret", "reqd", frm.doc.enable_sync);
|
frm.set_df_property("api_consumer_secret", "reqd", frm.doc.enable_sync);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
frappe.ui.form.on("Woocommerce Settings", "onload", function () {
|
||||||
|
frappe.call({
|
||||||
|
method: "erpnext.erpnext_integrations.doctype.woocommerce_settings.woocommerce_settings.get_series",
|
||||||
|
callback: function (r) {
|
||||||
|
$.each(r.message, function (key, value) {
|
||||||
|
set_field_options(key, value);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
@@ -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": 0,
|
"allow_import": 0,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
@@ -14,10 +15,12 @@
|
|||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "enable_sync",
|
"fieldname": "enable_sync",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -45,10 +48,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "sb_00",
|
"fieldname": "sb_00",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -76,10 +81,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "woocommerce_server_url",
|
"fieldname": "woocommerce_server_url",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -107,10 +114,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "secret",
|
"fieldname": "secret",
|
||||||
"fieldtype": "Code",
|
"fieldtype": "Code",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -138,10 +147,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "cb_00",
|
"fieldname": "cb_00",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -168,10 +179,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "api_consumer_key",
|
"fieldname": "api_consumer_key",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -199,10 +212,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "api_consumer_secret",
|
"fieldname": "api_consumer_secret",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -230,10 +245,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 1,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "sb_accounting_details",
|
"fieldname": "sb_accounting_details",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -261,10 +278,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "tax_account",
|
"fieldname": "tax_account",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -293,10 +312,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_10",
|
"fieldname": "column_break_10",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -323,10 +344,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "f_n_f_account",
|
"fieldname": "f_n_f_account",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -355,10 +378,216 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 1,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "defaults_section",
|
||||||
|
"fieldtype": "Section 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,
|
||||||
|
"label": "Defaults",
|
||||||
|
"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,
|
||||||
|
"description": "The user that will be used to create Customers, Items and Sales Orders. This user should have the relevant permissions.",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "creation_user",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"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": "Creation User",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "User",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 1,
|
||||||
|
"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,
|
||||||
|
"description": "This warehouse will be used to create Sale Orders. The fallback warehouse is \"Stores\".",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "warehouse",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"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": "Warehouse",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Warehouse",
|
||||||
|
"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,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "column_break_14",
|
||||||
|
"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,
|
||||||
|
"description": "The fallback series is \"SO-WOO-\".",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "sales_order_series",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"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": "Sales Order Series",
|
||||||
|
"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,
|
||||||
|
"description": "This is the default UOM used for items and Sales orders. The fallback UOM is \"Nos\".",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "uom",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"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": "UOM",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "UOM",
|
||||||
|
"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,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "endpoints",
|
"fieldname": "endpoints",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -386,10 +615,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "endpoint",
|
"fieldname": "endpoint",
|
||||||
"fieldtype": "Code",
|
"fieldtype": "Code",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -417,16 +648,15 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
"has_web_view": 0,
|
||||||
"hide_heading": 0,
|
|
||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"idx": 0,
|
"idx": 0,
|
||||||
"image_view": 0,
|
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-03-23 16:57:20.880513",
|
"menu_index": 0,
|
||||||
|
"modified": "2019-04-08 17:04:16.720696",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "ERPNext Integrations",
|
"module": "ERPNext Integrations",
|
||||||
"name": "Woocommerce Settings",
|
"name": "Woocommerce Settings",
|
||||||
@@ -435,7 +665,6 @@
|
|||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
"amend": 0,
|
"amend": 0,
|
||||||
"apply_user_permissions": 0,
|
|
||||||
"cancel": 0,
|
"cancel": 0,
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"delete": 0,
|
"delete": 0,
|
||||||
@@ -456,10 +685,10 @@
|
|||||||
],
|
],
|
||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"read_only_onload": 0,
|
|
||||||
"show_name_in_global_search": 0,
|
"show_name_in_global_search": 0,
|
||||||
"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
|
||||||
}
|
}
|
||||||
@@ -122,3 +122,9 @@ def generate_secret():
|
|||||||
woocommerce_settings = frappe.get_doc("Woocommerce Settings")
|
woocommerce_settings = frappe.get_doc("Woocommerce Settings")
|
||||||
woocommerce_settings.secret = frappe.generate_hash()
|
woocommerce_settings.secret = frappe.generate_hash()
|
||||||
woocommerce_settings.save()
|
woocommerce_settings.save()
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def get_series():
|
||||||
|
return {
|
||||||
|
"sales_order_series" : frappe.get_meta("Sales Order").get_options("naming_series") or "SO-WOO-",
|
||||||
|
}
|
||||||
@@ -123,10 +123,10 @@ var btn_invoice_registration = function (frm) {
|
|||||||
|
|
||||||
frappe.ui.form.on('Patient Relation', {
|
frappe.ui.form.on('Patient Relation', {
|
||||||
patient_relation_add: function(frm){
|
patient_relation_add: function(frm){
|
||||||
frm.fields_dict['patient_relation'].grid.get_field('patient').get_query = function(frm){
|
frm.fields_dict['patient_relation'].grid.get_field('patient').get_query = function(doc){
|
||||||
var patient_list = [];
|
var patient_list = [];
|
||||||
if(!frm.doc.__islocal) patient_list.push(frm.doc.name);
|
if(!doc.__islocal) patient_list.push(doc.name);
|
||||||
$.each(frm.doc.patient_relation, function(idx, val){
|
$.each(doc.patient_relation, function(idx, val){
|
||||||
if (val.patient) patient_list.push(val.patient);
|
if (val.patient) patient_list.push(val.patient);
|
||||||
});
|
});
|
||||||
return { filters: [['Patient', 'name', 'not in', patient_list]] };
|
return { filters: [['Patient', 'name', 'not in', patient_list]] };
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ doctype_js = {
|
|||||||
|
|
||||||
welcome_email = "erpnext.setup.utils.welcome_email"
|
welcome_email = "erpnext.setup.utils.welcome_email"
|
||||||
|
|
||||||
connect = "erpnext.check_branch_compatibility_with_frappe"
|
|
||||||
|
|
||||||
# setup wizard
|
# setup wizard
|
||||||
setup_wizard_requires = "assets/erpnext/js/setup_wizard.js"
|
setup_wizard_requires = "assets/erpnext/js/setup_wizard.js"
|
||||||
setup_wizard_stages = "erpnext.setup.setup_wizard.setup_wizard.get_setup_stages"
|
setup_wizard_stages = "erpnext.setup.setup_wizard.setup_wizard.get_setup_stages"
|
||||||
@@ -231,6 +229,7 @@ scheduler_events = {
|
|||||||
'erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group.trigger_emails',
|
'erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group.trigger_emails',
|
||||||
"erpnext.accounts.doctype.subscription.subscription.process_all",
|
"erpnext.accounts.doctype.subscription.subscription.process_all",
|
||||||
"erpnext.erpnext_integrations.doctype.amazon_mws_settings.amazon_mws_settings.schedule_get_order_details",
|
"erpnext.erpnext_integrations.doctype.amazon_mws_settings.amazon_mws_settings.schedule_get_order_details",
|
||||||
|
"erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.automatic_synchronization",
|
||||||
"erpnext.projects.doctype.project.project.hourly_reminder",
|
"erpnext.projects.doctype.project.project.hourly_reminder",
|
||||||
"erpnext.projects.doctype.project.project.collect_project_status"
|
"erpnext.projects.doctype.project.project.collect_project_status"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ class TestEmployeeOnboarding(unittest.TestCase):
|
|||||||
|
|
||||||
# complete the task
|
# complete the task
|
||||||
project = frappe.get_doc('Project', onboarding.project)
|
project = frappe.get_doc('Project', onboarding.project)
|
||||||
|
project.load_tasks()
|
||||||
project.tasks[0].status = 'Closed'
|
project.tasks[0].status = 'Closed'
|
||||||
project.save()
|
project.save()
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ test_dependencies = ["Employee Onboarding"]
|
|||||||
|
|
||||||
class TestEmployeeSeparation(unittest.TestCase):
|
class TestEmployeeSeparation(unittest.TestCase):
|
||||||
def test_employee_separation(self):
|
def test_employee_separation(self):
|
||||||
employee = get_employee()
|
employee = frappe.db.get_value("Employee", {"status": "Active"})
|
||||||
separation = frappe.new_doc('Employee Separation')
|
separation = frappe.new_doc('Employee Separation')
|
||||||
separation.employee = employee.name
|
separation.employee = employee
|
||||||
separation.company = '_Test Company'
|
separation.company = '_Test Company'
|
||||||
separation.append('activities', {
|
separation.append('activities', {
|
||||||
'activity_name': 'Deactivate Employee',
|
'activity_name': 'Deactivate Employee',
|
||||||
@@ -24,6 +24,3 @@ class TestEmployeeSeparation(unittest.TestCase):
|
|||||||
self.assertEqual(separation.docstatus, 1)
|
self.assertEqual(separation.docstatus, 1)
|
||||||
separation.cancel()
|
separation.cancel()
|
||||||
self.assertEqual(separation.project, "")
|
self.assertEqual(separation.project, "")
|
||||||
|
|
||||||
def get_employee():
|
|
||||||
return frappe.get_doc('Employee', {'employee_name': 'Test Researcher'})
|
|
||||||
@@ -844,6 +844,38 @@
|
|||||||
"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,
|
||||||
|
"fieldname": "clearance_date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"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": "Clearance Date",
|
||||||
|
"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,
|
||||||
@@ -1154,7 +1186,7 @@
|
|||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"menu_index": 0,
|
"menu_index": 0,
|
||||||
"modified": "2019-01-30 11:28:10.324137",
|
"modified": "2019-01-31 11:28:10.324137",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Expense Claim",
|
"name": "Expense Claim",
|
||||||
|
|||||||
@@ -13,19 +13,23 @@ test_dependencies = ['Employee']
|
|||||||
class TestExpenseClaim(unittest.TestCase):
|
class TestExpenseClaim(unittest.TestCase):
|
||||||
def test_total_expense_claim_for_project(self):
|
def test_total_expense_claim_for_project(self):
|
||||||
frappe.db.sql("""delete from `tabTask` where project = "_Test Project 1" """)
|
frappe.db.sql("""delete from `tabTask` where project = "_Test Project 1" """)
|
||||||
|
frappe.db.sql("""delete from `tabProject Task` where parent = "_Test Project 1" """)
|
||||||
frappe.db.sql("""delete from `tabProject` where name = "_Test Project 1" """)
|
frappe.db.sql("""delete from `tabProject` where name = "_Test Project 1" """)
|
||||||
|
frappe.db.sql("delete from `tabExpense Claim` where project='_Test Project 1'")
|
||||||
|
|
||||||
frappe.get_doc({
|
frappe.get_doc({
|
||||||
"project_name": "_Test Project 1",
|
"project_name": "_Test Project 1",
|
||||||
"doctype": "Project",
|
"doctype": "Project",
|
||||||
"tasks" :
|
}).save()
|
||||||
[{ "title": "_Test Project Task 1", "status": "Open" }]
|
|
||||||
|
task = frappe.get_doc({
|
||||||
|
"doctype": "Task",
|
||||||
|
"subject": "_Test Project Task 1",
|
||||||
|
"project": "_Test Project 1"
|
||||||
}).save()
|
}).save()
|
||||||
|
|
||||||
task_name = frappe.db.get_value("Task", {"project": "_Test Project 1"})
|
task_name = frappe.db.get_value("Task", {"project": "_Test Project 1"})
|
||||||
payable_account = get_payable_account("Wind Power LLC")
|
payable_account = get_payable_account("Wind Power LLC")
|
||||||
|
|
||||||
make_expense_claim(payable_account, 300, 200, "Wind Power LLC","Travel Expenses - WP", "_Test Project 1", task_name)
|
make_expense_claim(payable_account, 300, 200, "Wind Power LLC","Travel Expenses - WP", "_Test Project 1", task_name)
|
||||||
|
|
||||||
self.assertEqual(frappe.db.get_value("Task", task_name, "total_expense_claim"), 200)
|
self.assertEqual(frappe.db.get_value("Task", task_name, "total_expense_claim"), 200)
|
||||||
@@ -103,9 +107,10 @@ def get_payable_account(company):
|
|||||||
return frappe.get_cached_value('Company', company, 'default_payable_account')
|
return frappe.get_cached_value('Company', company, 'default_payable_account')
|
||||||
|
|
||||||
def make_expense_claim(payable_account,claim_amount, sanctioned_amount, company, account, project=None, task_name=None):
|
def make_expense_claim(payable_account,claim_amount, sanctioned_amount, company, account, project=None, task_name=None):
|
||||||
|
employee = frappe.db.get_value("Employee", {"status": "Active"})
|
||||||
expense_claim = frappe.get_doc({
|
expense_claim = frappe.get_doc({
|
||||||
"doctype": "Expense Claim",
|
"doctype": "Expense Claim",
|
||||||
"employee": "_T-Employee-00001",
|
"employee": employee,
|
||||||
"payable_account": payable_account,
|
"payable_account": payable_account,
|
||||||
"approval_status": "Approved",
|
"approval_status": "Approved",
|
||||||
"company": company,
|
"company": company,
|
||||||
|
|||||||
@@ -452,7 +452,7 @@ class SalarySlip(TransactionBase):
|
|||||||
|
|
||||||
self.set_loan_repayment()
|
self.set_loan_repayment()
|
||||||
|
|
||||||
self.net_pay = (flt(self.gross_pay) - (flt(self.total_deduction) + flt(self.total_loan_repayment))) * flt(self.payment_days / self.total_working_days)
|
self.net_pay = flt(self.gross_pay) - (flt(self.total_deduction) + flt(self.total_loan_repayment))
|
||||||
self.rounded_total = rounded(self.net_pay,
|
self.rounded_total = rounded(self.net_pay,
|
||||||
self.precision("net_pay") if disable_rounded_total else 0)
|
self.precision("net_pay") if disable_rounded_total else 0)
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,11 @@ class TrainingFeedback(Document):
|
|||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
training_event = frappe.get_doc("Training Event", self.training_event)
|
training_event = frappe.get_doc("Training Event", self.training_event)
|
||||||
|
status = None
|
||||||
for e in training_event.employees:
|
for e in training_event.employees:
|
||||||
if e.employee == self.employee:
|
if e.employee == self.employee:
|
||||||
training_event.status = 'Feedback Submitted'
|
status = 'Feedback Submitted'
|
||||||
break
|
break
|
||||||
|
|
||||||
training_event.save()
|
if status:
|
||||||
|
frappe.db.set_value("Training Event", self.training_event, "status", status)
|
||||||
|
|||||||
@@ -590,3 +590,4 @@ erpnext.patches.v10_0.item_barcode_childtable_migrate # 16-02-2019
|
|||||||
erpnext.patches.v11_0.make_italian_localization_fields # 26-03-2019
|
erpnext.patches.v11_0.make_italian_localization_fields # 26-03-2019
|
||||||
erpnext.patches.v11_1.make_job_card_time_logs
|
erpnext.patches.v11_1.make_job_card_time_logs
|
||||||
erpnext.patches.v11_1.set_variant_based_on
|
erpnext.patches.v11_1.set_variant_based_on
|
||||||
|
erpnext.patches.v11_1.woocommerce_set_creation_user
|
||||||
10
erpnext/patches/v11_1/woocommerce_set_creation_user.py
Normal file
10
erpnext/patches/v11_1/woocommerce_set_creation_user.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
woocommerce_setting_enable_sync = frappe.db.sql("SELECT t.value FROM tabSingles t WHERE doctype = 'Woocommerce Settings' AND field = 'enable_sync'", as_dict=True)
|
||||||
|
if len(woocommerce_setting_enable_sync) and woocommerce_setting_enable_sync[0].value == '1':
|
||||||
|
frappe.db.sql("""UPDATE tabSingles
|
||||||
|
SET value = (SELECT t.value FROM tabSingles t WHERE doctype = 'Woocommerce Settings' AND field = 'modified_by')
|
||||||
|
WHERE doctype = 'Woocommerce Settings'
|
||||||
|
AND field = 'creation_user';""")
|
||||||
@@ -30,11 +30,13 @@ class Project(Document):
|
|||||||
|
|
||||||
self.update_costing()
|
self.update_costing()
|
||||||
|
|
||||||
def __setup__(self):
|
def before_print(self):
|
||||||
self.onload()
|
self.onload()
|
||||||
|
|
||||||
def load_tasks(self):
|
def load_tasks(self):
|
||||||
"""Load `tasks` from the database"""
|
"""Load `tasks` from the database"""
|
||||||
|
project_task_custom_fields = frappe.get_all("Custom Field", {"dt": "Project Task"}, "fieldname")
|
||||||
|
|
||||||
self.tasks = []
|
self.tasks = []
|
||||||
for task in self.get_tasks():
|
for task in self.get_tasks():
|
||||||
task_map = {
|
task_map = {
|
||||||
@@ -47,7 +49,7 @@ class Project(Document):
|
|||||||
"task_weight": task.task_weight
|
"task_weight": task.task_weight
|
||||||
}
|
}
|
||||||
|
|
||||||
self.map_custom_fields(task, task_map)
|
self.map_custom_fields(task, task_map, project_task_custom_fields)
|
||||||
|
|
||||||
self.append("tasks", task_map)
|
self.append("tasks", task_map)
|
||||||
|
|
||||||
@@ -149,7 +151,7 @@ class Project(Document):
|
|||||||
"task_weight": t.task_weight
|
"task_weight": t.task_weight
|
||||||
})
|
})
|
||||||
|
|
||||||
self.map_custom_fields(t, task)
|
self.map_custom_fields(t, task, custom_fields)
|
||||||
|
|
||||||
task.flags.ignore_links = True
|
task.flags.ignore_links = True
|
||||||
task.flags.from_project = True
|
task.flags.from_project = True
|
||||||
@@ -173,10 +175,6 @@ class Project(Document):
|
|||||||
for t in frappe.get_all("Task", ["name"], {"project": self.name, "name": ("not in", task_names)}):
|
for t in frappe.get_all("Task", ["name"], {"project": self.name, "name": ("not in", task_names)}):
|
||||||
self.deleted_task_list.append(t.name)
|
self.deleted_task_list.append(t.name)
|
||||||
|
|
||||||
def update_costing_and_percentage_complete(self):
|
|
||||||
self.update_percent_complete()
|
|
||||||
self.update_costing()
|
|
||||||
|
|
||||||
def is_row_updated(self, row, existing_task_data, fields):
|
def is_row_updated(self, row, existing_task_data, fields):
|
||||||
if self.get("__islocal") or not existing_task_data: return True
|
if self.get("__islocal") or not existing_task_data: return True
|
||||||
|
|
||||||
@@ -186,10 +184,8 @@ class Project(Document):
|
|||||||
if row.get(field) != d.get(field):
|
if row.get(field) != d.get(field):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def map_custom_fields(self, source, target):
|
def map_custom_fields(self, source, target, custom_fields):
|
||||||
project_task_custom_fields = frappe.get_all("Custom Field", {"dt": "Project Task"}, "fieldname")
|
for field in custom_fields:
|
||||||
|
|
||||||
for field in project_task_custom_fields:
|
|
||||||
target.update({
|
target.update({
|
||||||
field.fieldname: source.get(field.fieldname)
|
field.fieldname: source.get(field.fieldname)
|
||||||
})
|
})
|
||||||
@@ -197,8 +193,6 @@ class Project(Document):
|
|||||||
def update_project(self):
|
def update_project(self):
|
||||||
self.update_percent_complete()
|
self.update_percent_complete()
|
||||||
self.update_costing()
|
self.update_costing()
|
||||||
self.flags.dont_sync_tasks = True
|
|
||||||
self.save(ignore_permissions=True)
|
|
||||||
|
|
||||||
def after_insert(self):
|
def after_insert(self):
|
||||||
if self.sales_order:
|
if self.sales_order:
|
||||||
@@ -233,6 +227,7 @@ 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"
|
||||||
|
self.db_update()
|
||||||
|
|
||||||
def update_costing(self):
|
def update_costing(self):
|
||||||
from_time_sheet = frappe.db.sql("""select
|
from_time_sheet = frappe.db.sql("""select
|
||||||
@@ -246,7 +241,7 @@ class Project(Document):
|
|||||||
from_expense_claim = frappe.db.sql("""select
|
from_expense_claim = frappe.db.sql("""select
|
||||||
sum(total_sanctioned_amount) as total_sanctioned_amount
|
sum(total_sanctioned_amount) as total_sanctioned_amount
|
||||||
from `tabExpense Claim` where project = %s
|
from `tabExpense Claim` where project = %s
|
||||||
and docstatus = 1""", self.name, as_dict=1)[0]
|
and docstatus = 1""", self.name, as_dict=1, debug=1)[0]
|
||||||
|
|
||||||
self.actual_start_date = from_time_sheet.start_date
|
self.actual_start_date = from_time_sheet.start_date
|
||||||
self.actual_end_date = from_time_sheet.end_date
|
self.actual_end_date = from_time_sheet.end_date
|
||||||
@@ -260,6 +255,7 @@ class Project(Document):
|
|||||||
self.update_sales_amount()
|
self.update_sales_amount()
|
||||||
self.update_billed_amount()
|
self.update_billed_amount()
|
||||||
self.calculate_gross_margin()
|
self.calculate_gross_margin()
|
||||||
|
self.db_update()
|
||||||
|
|
||||||
def calculate_gross_margin(self):
|
def calculate_gross_margin(self):
|
||||||
expense_amount = (flt(self.total_costing_amount) + flt(self.total_expense_claim)
|
expense_amount = (flt(self.total_costing_amount) + flt(self.total_expense_claim)
|
||||||
@@ -313,7 +309,7 @@ class Project(Document):
|
|||||||
def on_update(self):
|
def on_update(self):
|
||||||
self.delete_task()
|
self.delete_task()
|
||||||
self.load_tasks()
|
self.load_tasks()
|
||||||
self.update_costing_and_percentage_complete()
|
self.update_project()
|
||||||
self.update_dependencies_on_duplicated_project()
|
self.update_dependencies_on_duplicated_project()
|
||||||
|
|
||||||
def delete_task(self):
|
def delete_task(self):
|
||||||
|
|||||||
@@ -31,20 +31,20 @@ def get_columns():
|
|||||||
"width": 150
|
"width": 150
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": _("Total Billable Hours"),
|
"label": _("Billable Hours"),
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Float",
|
||||||
"fieldname": "total_billable_hours",
|
"fieldname": "total_billable_hours",
|
||||||
"width": 50
|
"width": 50
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": _("Total Hours"),
|
"label": _("Working Hours"),
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Float",
|
||||||
"fieldname": "total_hours",
|
"fieldname": "total_hours",
|
||||||
"width": 50
|
"width": 50
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": _("Amount"),
|
"label": _("Amount"),
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Currency",
|
||||||
"fieldname": "amount",
|
"fieldname": "amount",
|
||||||
"width": 100
|
"width": 100
|
||||||
}
|
}
|
||||||
@@ -54,12 +54,16 @@ def get_data(filters):
|
|||||||
data = []
|
data = []
|
||||||
record = get_records(filters)
|
record = get_records(filters)
|
||||||
|
|
||||||
|
billable_hours_worked = 0
|
||||||
|
hours_worked = 0
|
||||||
|
working_cost = 0
|
||||||
for entries in record:
|
for entries in record:
|
||||||
total_hours = 0
|
total_hours = 0
|
||||||
total_billable_hours = 0
|
total_billable_hours = 0
|
||||||
total_amount = 0
|
total_amount = 0
|
||||||
entries_exists = False
|
entries_exists = False
|
||||||
timesheet_details = get_timesheet_details(filters, entries.name)
|
timesheet_details = get_timesheet_details(filters, entries.name)
|
||||||
|
|
||||||
for activity in timesheet_details:
|
for activity in timesheet_details:
|
||||||
entries_exists = True
|
entries_exists = True
|
||||||
time_start = activity.from_time
|
time_start = activity.from_time
|
||||||
@@ -67,16 +71,21 @@ def get_data(filters):
|
|||||||
from_date = frappe.utils.get_datetime(filters.from_date)
|
from_date = frappe.utils.get_datetime(filters.from_date)
|
||||||
to_date = frappe.utils.get_datetime(filters.to_date)
|
to_date = frappe.utils.get_datetime(filters.to_date)
|
||||||
|
|
||||||
if time_start <= from_date and time_end <= to_date:
|
if time_start <= from_date and time_end >= from_date:
|
||||||
total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity,
|
total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity,
|
||||||
time_end, from_date, total_hours, total_billable_hours, total_amount)
|
time_end, from_date, total_hours, total_billable_hours, total_amount)
|
||||||
elif time_start >= from_date and time_end >= to_date:
|
elif time_start <= to_date and time_end >= to_date:
|
||||||
total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity,
|
total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity,
|
||||||
to_date, time_start, total_hours, total_billable_hours, total_amount)
|
to_date, time_start, total_hours, total_billable_hours, total_amount)
|
||||||
elif time_start >= from_date and time_end <= to_date:
|
elif time_start >= from_date and time_end <= to_date:
|
||||||
total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity,
|
total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity,
|
||||||
time_end, time_start, total_hours, total_billable_hours, total_amount)
|
time_end, time_start, total_hours, total_billable_hours, total_amount)
|
||||||
|
|
||||||
|
|
||||||
|
hours_worked += total_hours
|
||||||
|
billable_hours_worked += total_billable_hours
|
||||||
|
working_cost += total_amount
|
||||||
|
|
||||||
row = {
|
row = {
|
||||||
"employee": entries.employee,
|
"employee": entries.employee,
|
||||||
"employee_name": entries.employee_name,
|
"employee_name": entries.employee_name,
|
||||||
@@ -85,17 +94,24 @@ def get_data(filters):
|
|||||||
"total_hours": total_hours,
|
"total_hours": total_hours,
|
||||||
"amount": total_amount
|
"amount": total_amount
|
||||||
}
|
}
|
||||||
|
|
||||||
if entries_exists:
|
if entries_exists:
|
||||||
data.append(row)
|
data.append(row)
|
||||||
entries_exists = False
|
entries_exists = False
|
||||||
|
|
||||||
|
total = {
|
||||||
|
"total_billable_hours": billable_hours_worked,
|
||||||
|
"total_hours": hours_worked,
|
||||||
|
"amount": working_cost
|
||||||
|
}
|
||||||
|
if billable_hours_worked !=0 or hours_worked !=0 or working_cost !=0:
|
||||||
|
data.append(total)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def get_records(filters):
|
def get_records(filters):
|
||||||
record_filters = [
|
record_filters = [
|
||||||
["start_date", "<=", filters.to_date],
|
["start_date", "<=", filters.to_date],
|
||||||
["end_date", ">=", filters.from_date]
|
["end_date", ">=", filters.from_date],
|
||||||
|
["docstatus", "=", 1]
|
||||||
]
|
]
|
||||||
|
|
||||||
if "employee" in filters:
|
if "employee" in filters:
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ frappe.query_reports["Employee Billing Summary"] = {
|
|||||||
fieldname:"from_date",
|
fieldname:"from_date",
|
||||||
label: __("From Date"),
|
label: __("From Date"),
|
||||||
fieldtype: "Date",
|
fieldtype: "Date",
|
||||||
default: frappe.datetime.get_today(),
|
default: frappe.datetime.add_months(frappe.datetime.month_start(), -1),
|
||||||
reqd: 1
|
reqd: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldname:"to_date",
|
fieldname:"to_date",
|
||||||
label: __("To Date"),
|
label: __("To Date"),
|
||||||
fieldtype: "Date",
|
fieldtype: "Date",
|
||||||
default: frappe.datetime.add_days(frappe.datetime.get_today(), 30),
|
default: frappe.datetime.add_days(frappe.datetime.month_start(), -1),
|
||||||
reqd: 1
|
reqd: 1
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ frappe.query_reports["Project Billing Summary"] = {
|
|||||||
fieldname:"from_date",
|
fieldname:"from_date",
|
||||||
label: __("From Date"),
|
label: __("From Date"),
|
||||||
fieldtype: "Date",
|
fieldtype: "Date",
|
||||||
default: frappe.datetime.get_today(),
|
default: frappe.datetime.add_months(frappe.datetime.month_start(), -1),
|
||||||
reqd: 1
|
reqd: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldname:"to_date",
|
fieldname:"to_date",
|
||||||
label: __("To Date"),
|
label: __("To Date"),
|
||||||
fieldtype: "Date",
|
fieldtype: "Date",
|
||||||
default: frappe.datetime.add_days(frappe.datetime.get_today(), 30),
|
default: frappe.datetime.add_days(frappe.datetime.month_start(),-1),
|
||||||
reqd: 1
|
reqd: 1
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,58 +1,58 @@
|
|||||||
{
|
{
|
||||||
"css/erpnext.css": [
|
"css/erpnext.css": [
|
||||||
"public/less/erpnext.less",
|
"public/less/erpnext.less",
|
||||||
"public/less/hub.less"
|
"public/less/hub.less"
|
||||||
],
|
],
|
||||||
"css/marketplace.css": [
|
"css/marketplace.css": [
|
||||||
"public/less/hub.less"
|
"public/less/hub.less"
|
||||||
],
|
],
|
||||||
"js/erpnext-web.min.js": [
|
"js/erpnext-web.min.js": [
|
||||||
"public/js/website_utils.js",
|
"public/js/website_utils.js",
|
||||||
"public/js/shopping_cart.js"
|
"public/js/shopping_cart.js"
|
||||||
],
|
],
|
||||||
"css/erpnext-web.css": [
|
"css/erpnext-web.css": [
|
||||||
"public/less/website.less"
|
"public/less/website.less"
|
||||||
],
|
],
|
||||||
"js/marketplace.min.js": [
|
"js/marketplace.min.js": [
|
||||||
"public/js/hub/marketplace.js"
|
"public/js/hub/marketplace.js"
|
||||||
],
|
],
|
||||||
"js/erpnext.min.js": [
|
"js/erpnext.min.js": [
|
||||||
"public/js/conf.js",
|
"public/js/conf.js",
|
||||||
"public/js/utils.js",
|
"public/js/utils.js",
|
||||||
"public/js/queries.js",
|
"public/js/queries.js",
|
||||||
"public/js/sms_manager.js",
|
"public/js/sms_manager.js",
|
||||||
"public/js/utils/party.js",
|
"public/js/utils/party.js",
|
||||||
"public/js/templates/address_list.html",
|
"public/js/templates/address_list.html",
|
||||||
"public/js/templates/contact_list.html",
|
"public/js/templates/contact_list.html",
|
||||||
"public/js/controllers/stock_controller.js",
|
"public/js/controllers/stock_controller.js",
|
||||||
"public/js/payment/payments.js",
|
"public/js/payment/payments.js",
|
||||||
"public/js/controllers/taxes_and_totals.js",
|
"public/js/controllers/taxes_and_totals.js",
|
||||||
"public/js/controllers/transaction.js",
|
"public/js/controllers/transaction.js",
|
||||||
"public/js/pos/pos.html",
|
"public/js/pos/pos.html",
|
||||||
"public/js/pos/pos_bill_item.html",
|
"public/js/pos/pos_bill_item.html",
|
||||||
"public/js/pos/pos_bill_item_new.html",
|
"public/js/pos/pos_bill_item_new.html",
|
||||||
"public/js/pos/pos_selected_item.html",
|
"public/js/pos/pos_selected_item.html",
|
||||||
"public/js/pos/pos_item.html",
|
"public/js/pos/pos_item.html",
|
||||||
"public/js/pos/pos_tax_row.html",
|
"public/js/pos/pos_tax_row.html",
|
||||||
"public/js/pos/customer_toolbar.html",
|
"public/js/pos/customer_toolbar.html",
|
||||||
"public/js/pos/pos_invoice_list.html",
|
"public/js/pos/pos_invoice_list.html",
|
||||||
"public/js/payment/pos_payment.html",
|
"public/js/payment/pos_payment.html",
|
||||||
"public/js/payment/payment_details.html",
|
"public/js/payment/payment_details.html",
|
||||||
"public/js/templates/item_selector.html",
|
"public/js/templates/item_selector.html",
|
||||||
"public/js/templates/employees_to_mark_attendance.html",
|
"public/js/templates/employees_to_mark_attendance.html",
|
||||||
"public/js/utils/item_selector.js",
|
"public/js/utils/item_selector.js",
|
||||||
"public/js/help_links.js",
|
"public/js/help_links.js",
|
||||||
"public/js/agriculture/ternary_plot.js",
|
"public/js/agriculture/ternary_plot.js",
|
||||||
"public/js/templates/item_quick_entry.html",
|
"public/js/templates/item_quick_entry.html",
|
||||||
"public/js/utils/item_quick_entry.js",
|
"public/js/utils/item_quick_entry.js",
|
||||||
"public/js/utils/customer_quick_entry.js",
|
"public/js/utils/customer_quick_entry.js",
|
||||||
"public/js/education/student_button.html",
|
"public/js/education/student_button.html",
|
||||||
"public/js/education/assessment_result_tool.html",
|
"public/js/education/assessment_result_tool.html",
|
||||||
"public/js/hub/hub_factory.js"
|
"public/js/hub/hub_factory.js"
|
||||||
],
|
],
|
||||||
"js/item-dashboard.min.js": [
|
"js/item-dashboard.min.js": [
|
||||||
"stock/dashboard/item_dashboard.html",
|
"stock/dashboard/item_dashboard.html",
|
||||||
"stock/dashboard/item_dashboard_list.html",
|
"stock/dashboard/item_dashboard_list.html",
|
||||||
"stock/dashboard/item_dashboard.js"
|
"stock/dashboard/item_dashboard.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,10 +25,10 @@
|
|||||||
|
|
||||||
.app-icon-svg {
|
.app-icon-svg {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.15);
|
box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "customer_section",
|
"fieldname": "customer_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -53,6 +54,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break0",
|
"fieldname": "column_break0",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -86,6 +88,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "{customer_name}",
|
"default": "{customer_name}",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "title",
|
"fieldname": "title",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -119,6 +122,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,
|
||||||
@@ -153,6 +157,7 @@
|
|||||||
"bold": 1,
|
"bold": 1,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "customer",
|
"fieldname": "customer",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -188,6 +193,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fetch_from": "customer.customer_name",
|
"fetch_from": "customer.customer_name",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "customer_name",
|
"fieldname": "customer_name",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -222,6 +228,7 @@
|
|||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "Sales",
|
"default": "Sales",
|
||||||
"depends_on": "",
|
"depends_on": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "order_type",
|
"fieldname": "order_type",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -256,6 +263,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break1",
|
"fieldname": "column_break1",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -288,6 +296,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "amended_from",
|
"fieldname": "amended_from",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -324,6 +333,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "company",
|
"fieldname": "company",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -360,6 +370,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "Today",
|
"default": "Today",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "transaction_date",
|
"fieldname": "transaction_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -394,6 +405,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "delivery_date",
|
"fieldname": "delivery_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -428,6 +440,7 @@
|
|||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "",
|
"depends_on": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "po_no",
|
"fieldname": "po_no",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -464,6 +477,7 @@
|
|||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:doc.po_no",
|
"depends_on": "eval:doc.po_no",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "po_date",
|
"fieldname": "po_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -498,6 +512,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "tax_id",
|
"fieldname": "tax_id",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -533,6 +548,7 @@
|
|||||||
"collapsible_depends_on": "",
|
"collapsible_depends_on": "",
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "customer",
|
"depends_on": "customer",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "contact_info",
|
"fieldname": "contact_info",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -565,6 +581,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "customer_address",
|
"fieldname": "customer_address",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -597,6 +614,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "address_display",
|
"fieldname": "address_display",
|
||||||
"fieldtype": "Small Text",
|
"fieldtype": "Small Text",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -628,6 +646,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "contact_person",
|
"fieldname": "contact_person",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -660,6 +679,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "contact_display",
|
"fieldname": "contact_display",
|
||||||
"fieldtype": "Small Text",
|
"fieldtype": "Small Text",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -691,6 +711,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "contact_mobile",
|
"fieldname": "contact_mobile",
|
||||||
"fieldtype": "Small Text",
|
"fieldtype": "Small Text",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -722,6 +743,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "contact_email",
|
"fieldname": "contact_email",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -754,38 +776,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fieldname": "company_address_display",
|
"fetch_if_empty": 0,
|
||||||
"fieldtype": "Small Text",
|
|
||||||
"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": "",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
|
||||||
"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,
|
|
||||||
"fieldname": "company_address",
|
"fieldname": "company_address",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -795,7 +786,7 @@
|
|||||||
"in_global_search": 0,
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 0,
|
||||||
"label": "Company Address",
|
"label": "Company Address Name",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"options": "Address",
|
"options": "Address",
|
||||||
@@ -819,6 +810,40 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "company_address_display",
|
||||||
|
"fieldtype": "Small Text",
|
||||||
|
"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": "Company Address",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 1,
|
||||||
|
"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,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "col_break46",
|
"fieldname": "col_break46",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -850,6 +875,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "shipping_address_name",
|
"fieldname": "shipping_address_name",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -882,6 +908,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "shipping_address",
|
"fieldname": "shipping_address",
|
||||||
"fieldtype": "Small Text",
|
"fieldtype": "Small Text",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -914,6 +941,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "customer_group",
|
"fieldname": "customer_group",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -947,6 +975,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "territory",
|
"fieldname": "territory",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -979,6 +1008,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "currency_and_price_list",
|
"fieldname": "currency_and_price_list",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1011,6 +1041,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "currency",
|
"fieldname": "currency",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1047,6 +1078,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"description": "Rate at which customer's currency is converted to company's base currency",
|
"description": "Rate at which customer's currency is converted to company's base currency",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "conversion_rate",
|
"fieldname": "conversion_rate",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1082,6 +1114,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break2",
|
"fieldname": "column_break2",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1113,6 +1146,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "selling_price_list",
|
"fieldname": "selling_price_list",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1148,6 +1182,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "price_list_currency",
|
"fieldname": "price_list_currency",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1181,6 +1216,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"description": "Rate at which Price list currency is converted to company's base currency",
|
"description": "Rate at which Price list currency is converted to company's base currency",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "plc_conversion_rate",
|
"fieldname": "plc_conversion_rate",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1214,6 +1250,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "ignore_pricing_rule",
|
"fieldname": "ignore_pricing_rule",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1245,6 +1282,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "sec_warehouse",
|
"fieldname": "sec_warehouse",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1276,6 +1314,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "set_warehouse",
|
"fieldname": "set_warehouse",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1309,6 +1348,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "items_section",
|
"fieldname": "items_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1342,6 +1382,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "scan_barcode",
|
"fieldname": "scan_barcode",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1374,6 +1415,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "items",
|
"fieldname": "items",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1408,6 +1450,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_31",
|
"fieldname": "section_break_31",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1438,6 +1481,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_33a",
|
"fieldname": "column_break_33a",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1468,6 +1512,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "total_qty",
|
"fieldname": "total_qty",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1500,6 +1545,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "base_total",
|
"fieldname": "base_total",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1533,6 +1579,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "base_net_total",
|
"fieldname": "base_net_total",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1568,6 +1615,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_33",
|
"fieldname": "column_break_33",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1598,6 +1646,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "total",
|
"fieldname": "total",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1631,6 +1680,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "net_total",
|
"fieldname": "net_total",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1663,6 +1713,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "total_net_weight",
|
"fieldname": "total_net_weight",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1695,6 +1746,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "taxes_section",
|
"fieldname": "taxes_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1728,6 +1780,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "taxes_and_charges",
|
"fieldname": "taxes_and_charges",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1762,6 +1815,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_38",
|
"fieldname": "column_break_38",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1792,6 +1846,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "shipping_rule",
|
"fieldname": "shipping_rule",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1825,6 +1880,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_40",
|
"fieldname": "section_break_40",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1855,6 +1911,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "taxes",
|
"fieldname": "taxes",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1889,6 +1946,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "sec_tax_breakup",
|
"fieldname": "sec_tax_breakup",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1921,6 +1979,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "other_charges_calculation",
|
"fieldname": "other_charges_calculation",
|
||||||
"fieldtype": "Text",
|
"fieldtype": "Text",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1953,6 +2012,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_43",
|
"fieldname": "section_break_43",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -1983,6 +2043,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "base_total_taxes_and_charges",
|
"fieldname": "base_total_taxes_and_charges",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2018,6 +2079,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_46",
|
"fieldname": "column_break_46",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2049,6 +2111,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "total_taxes_and_charges",
|
"fieldname": "total_taxes_and_charges",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2081,6 +2144,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "loyalty_points_redemption",
|
"fieldname": "loyalty_points_redemption",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -2113,6 +2177,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "loyalty_points",
|
"fieldname": "loyalty_points",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -2145,6 +2210,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "loyalty_amount",
|
"fieldname": "loyalty_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -2178,6 +2244,7 @@
|
|||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"collapsible_depends_on": "discount_amount",
|
"collapsible_depends_on": "discount_amount",
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_48",
|
"fieldname": "section_break_48",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2211,6 +2278,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "Grand Total",
|
"default": "Grand Total",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "apply_discount_on",
|
"fieldname": "apply_discount_on",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2244,6 +2312,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "base_discount_amount",
|
"fieldname": "base_discount_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2277,6 +2346,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_50",
|
"fieldname": "column_break_50",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2308,6 +2378,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "",
|
"depends_on": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "additional_discount_percentage",
|
"fieldname": "additional_discount_percentage",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2341,6 +2412,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "",
|
"depends_on": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "discount_amount",
|
"fieldname": "discount_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2373,6 +2445,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "totals",
|
"fieldname": "totals",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2406,6 +2479,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "base_grand_total",
|
"fieldname": "base_grand_total",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2441,6 +2515,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "base_rounding_adjustment",
|
"fieldname": "base_rounding_adjustment",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2474,6 +2549,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "base_rounded_total",
|
"fieldname": "base_rounded_total",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2510,6 +2586,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"description": "In Words will be visible once you save the Sales Order.",
|
"description": "In Words will be visible once you save the Sales Order.",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "base_in_words",
|
"fieldname": "base_in_words",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2544,6 +2621,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break3",
|
"fieldname": "column_break3",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2576,6 +2654,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "grand_total",
|
"fieldname": "grand_total",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2612,6 +2691,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "",
|
"depends_on": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "rounding_adjustment",
|
"fieldname": "rounding_adjustment",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2645,6 +2725,7 @@
|
|||||||
"bold": 1,
|
"bold": 1,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "rounded_total",
|
"fieldname": "rounded_total",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2680,6 +2761,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "in_words",
|
"fieldname": "in_words",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2714,6 +2796,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "advance_paid",
|
"fieldname": "advance_paid",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2748,6 +2831,7 @@
|
|||||||
"collapsible_depends_on": "packed_items",
|
"collapsible_depends_on": "packed_items",
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "packing_list",
|
"fieldname": "packing_list",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2781,6 +2865,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "packed_items",
|
"fieldname": "packed_items",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2815,6 +2900,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"collapsible_depends_on": "",
|
"collapsible_depends_on": "",
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "payment_schedule_section",
|
"fieldname": "payment_schedule_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2847,6 +2933,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "payment_terms_template",
|
"fieldname": "payment_terms_template",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2880,6 +2967,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "payment_schedule",
|
"fieldname": "payment_schedule",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2914,6 +3002,7 @@
|
|||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"collapsible_depends_on": "terms",
|
"collapsible_depends_on": "terms",
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "terms_section_break",
|
"fieldname": "terms_section_break",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2947,6 +3036,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "tc_name",
|
"fieldname": "tc_name",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -2981,6 +3071,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "terms",
|
"fieldname": "terms",
|
||||||
"fieldtype": "Text Editor",
|
"fieldtype": "Text Editor",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3015,6 +3106,7 @@
|
|||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"collapsible_depends_on": "project",
|
"collapsible_depends_on": "project",
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "more_info",
|
"fieldname": "more_info",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3049,6 +3141,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"description": "Track this Sales Order against any Project",
|
"description": "Track this Sales Order against any Project",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "project",
|
"fieldname": "project",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3083,6 +3176,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "party_account_currency",
|
"fieldname": "party_account_currency",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -3116,6 +3210,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_77",
|
"fieldname": "column_break_77",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3147,6 +3242,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "source",
|
"fieldname": "source",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3182,6 +3278,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "",
|
"depends_on": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "campaign",
|
"fieldname": "campaign",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3216,6 +3313,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "printing_details",
|
"fieldname": "printing_details",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3248,6 +3346,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "language",
|
"fieldname": "language",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3280,6 +3379,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "letter_head",
|
"fieldname": "letter_head",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3314,6 +3414,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break4",
|
"fieldname": "column_break4",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3346,6 +3447,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "select_print_heading",
|
"fieldname": "select_print_heading",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3380,6 +3482,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "group_same_items",
|
"fieldname": "group_same_items",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3412,6 +3515,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_78",
|
"fieldname": "section_break_78",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3446,6 +3550,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "Draft",
|
"default": "Draft",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "status",
|
"fieldname": "status",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3481,6 +3586,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "delivery_status",
|
"fieldname": "delivery_status",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -3515,6 +3621,7 @@
|
|||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:!doc.__islocal",
|
"depends_on": "eval:!doc.__islocal",
|
||||||
"description": "% of materials delivered against this Sales Order",
|
"description": "% of materials delivered against this Sales Order",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "per_delivered",
|
"fieldname": "per_delivered",
|
||||||
"fieldtype": "Percent",
|
"fieldtype": "Percent",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3549,6 +3656,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_81",
|
"fieldname": "column_break_81",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3581,6 +3689,7 @@
|
|||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:!doc.__islocal",
|
"depends_on": "eval:!doc.__islocal",
|
||||||
"description": "% of materials billed against this Sales Order",
|
"description": "% of materials billed against this Sales Order",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "per_billed",
|
"fieldname": "per_billed",
|
||||||
"fieldtype": "Percent",
|
"fieldtype": "Percent",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3615,6 +3724,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "billing_status",
|
"fieldname": "billing_status",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@@ -3648,6 +3758,7 @@
|
|||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"collapsible_depends_on": "commission_rate",
|
"collapsible_depends_on": "commission_rate",
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "sales_team_section_break",
|
"fieldname": "sales_team_section_break",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3681,6 +3792,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "sales_partner",
|
"fieldname": "sales_partner",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3716,6 +3828,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break7",
|
"fieldname": "column_break7",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3747,6 +3860,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "commission_rate",
|
"fieldname": "commission_rate",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3781,6 +3895,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "total_commission",
|
"fieldname": "total_commission",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3816,6 +3931,7 @@
|
|||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"collapsible_depends_on": "sales_team",
|
"collapsible_depends_on": "sales_team",
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break1",
|
"fieldname": "section_break1",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3847,6 +3963,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "sales_team",
|
"fieldname": "sales_team",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3881,6 +3998,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "subscription_section",
|
"fieldname": "subscription_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3915,6 +4033,7 @@
|
|||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "",
|
"depends_on": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "from_date",
|
"fieldname": "from_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3948,6 +4067,7 @@
|
|||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "",
|
"depends_on": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "to_date",
|
"fieldname": "to_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -3979,6 +4099,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_108",
|
"fieldname": "column_break_108",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -4010,6 +4131,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "auto_repeat",
|
"fieldname": "auto_repeat",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -4044,6 +4166,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval: doc.auto_repeat",
|
"depends_on": "eval: doc.auto_repeat",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "update_auto_repeat_reference",
|
"fieldname": "update_auto_repeat_reference",
|
||||||
"fieldtype": "Button",
|
"fieldtype": "Button",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -4081,7 +4204,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2019-01-09 16:51:47.917329",
|
"modified": "2019-04-05 03:44:46.037178",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Sales Order",
|
"name": "Sales Order",
|
||||||
|
|||||||
@@ -202,9 +202,8 @@ class SalesOrder(SellingController):
|
|||||||
|
|
||||||
if self.project:
|
if self.project:
|
||||||
project = frappe.get_doc("Project", self.project)
|
project = frappe.get_doc("Project", self.project)
|
||||||
project.flags.dont_sync_tasks = True
|
|
||||||
project.update_sales_amount()
|
project.update_sales_amount()
|
||||||
project.save()
|
project.db_update()
|
||||||
|
|
||||||
def check_credit_limit(self):
|
def check_credit_limit(self):
|
||||||
# if bypass credit limit check is set to true (1) at sales order level,
|
# if bypass credit limit check is set to true (1) at sales order level,
|
||||||
@@ -612,7 +611,8 @@ def make_sales_invoice(source_name, target_doc=None, ignore_permissions=False):
|
|||||||
def postprocess(source, target):
|
def postprocess(source, target):
|
||||||
set_missing_values(source, target)
|
set_missing_values(source, target)
|
||||||
#Get the advance paid Journal Entries in Sales Invoice Advance
|
#Get the advance paid Journal Entries in Sales Invoice Advance
|
||||||
target.set_advances()
|
if target.get("allocate_advances_automatically"):
|
||||||
|
target.set_advances()
|
||||||
|
|
||||||
def set_missing_values(source, target):
|
def set_missing_values(source, target):
|
||||||
target.is_pos = 0
|
target.is_pos = 0
|
||||||
|
|||||||
@@ -54,8 +54,16 @@ erpnext.pos.PointOfSale = class PointOfSale {
|
|||||||
this.prepare_menu();
|
this.prepare_menu();
|
||||||
this.set_online_status();
|
this.set_online_status();
|
||||||
},
|
},
|
||||||
() => this.setup_company(),
|
|
||||||
() => this.make_new_invoice(),
|
() => this.make_new_invoice(),
|
||||||
|
() => {
|
||||||
|
if(!this.frm.doc.company) {
|
||||||
|
this.setup_company()
|
||||||
|
.then((company) => {
|
||||||
|
this.frm.doc.company = company;
|
||||||
|
this.get_pos_profile();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
() => {
|
() => {
|
||||||
frappe.dom.unfreeze();
|
frappe.dom.unfreeze();
|
||||||
},
|
},
|
||||||
@@ -63,6 +71,22 @@ erpnext.pos.PointOfSale = class PointOfSale {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_pos_profile() {
|
||||||
|
return frappe.xcall("erpnext.stock.get_item_details.get_pos_profile",
|
||||||
|
{'company': this.frm.doc.company})
|
||||||
|
.then((r) => {
|
||||||
|
if(r) {
|
||||||
|
this.frm.doc.pos_profile = r.name;
|
||||||
|
this.set_pos_profile_data()
|
||||||
|
.then(() => {
|
||||||
|
this.on_change_pos_profile();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.raise_exception_for_pos_profile();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
set_online_status() {
|
set_online_status() {
|
||||||
this.connection_status = false;
|
this.connection_status = false;
|
||||||
this.page.set_indicator(__("Offline"), "grey");
|
this.page.set_indicator(__("Offline"), "grey");
|
||||||
@@ -77,6 +101,11 @@ erpnext.pos.PointOfSale = class PointOfSale {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
raise_exception_for_pos_profile() {
|
||||||
|
setTimeout(() => frappe.set_route('List', 'POS Profile'), 2000);
|
||||||
|
frappe.throw(__("POS Profile is required to use Point-of-Sale"));
|
||||||
|
}
|
||||||
|
|
||||||
prepare_dom() {
|
prepare_dom() {
|
||||||
this.wrapper.append(`
|
this.wrapper.append(`
|
||||||
<div class="pos">
|
<div class="pos">
|
||||||
@@ -447,7 +476,7 @@ erpnext.pos.PointOfSale = class PointOfSale {
|
|||||||
|
|
||||||
setup_company() {
|
setup_company() {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
if(!frappe.sys_defaults.company) {
|
if(!this.frm.doc.company) {
|
||||||
frappe.prompt({fieldname:"company", options: "Company", fieldtype:"Link",
|
frappe.prompt({fieldname:"company", options: "Company", fieldtype:"Link",
|
||||||
label: __("Select Company"), reqd: 1}, (data) => {
|
label: __("Select Company"), reqd: 1}, (data) => {
|
||||||
this.company = data.company;
|
this.company = data.company;
|
||||||
@@ -487,6 +516,10 @@ erpnext.pos.PointOfSale = class PointOfSale {
|
|||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
if (this.frm) {
|
if (this.frm) {
|
||||||
this.frm = get_frm(this.frm);
|
this.frm = get_frm(this.frm);
|
||||||
|
if(this.company) {
|
||||||
|
this.frm.doc.company = this.company;
|
||||||
|
}
|
||||||
|
|
||||||
resolve();
|
resolve();
|
||||||
} else {
|
} else {
|
||||||
frappe.model.with_doctype(doctype, () => {
|
frappe.model.with_doctype(doctype, () => {
|
||||||
@@ -503,6 +536,7 @@ erpnext.pos.PointOfSale = class PointOfSale {
|
|||||||
frm.refresh(name);
|
frm.refresh(name);
|
||||||
frm.doc.items = [];
|
frm.doc.items = [];
|
||||||
frm.doc.is_pos = 1;
|
frm.doc.is_pos = 1;
|
||||||
|
|
||||||
return frm;
|
return frm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -512,6 +546,10 @@ erpnext.pos.PointOfSale = class PointOfSale {
|
|||||||
this.frm.doc.company = this.company;
|
this.frm.doc.company = this.company;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.frm.doc.company) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
return this.frm.call({
|
return this.frm.call({
|
||||||
doc: this.frm.doc,
|
doc: this.frm.doc,
|
||||||
@@ -520,8 +558,7 @@ erpnext.pos.PointOfSale = class PointOfSale {
|
|||||||
if(!r.exc) {
|
if(!r.exc) {
|
||||||
if (!this.frm.doc.pos_profile) {
|
if (!this.frm.doc.pos_profile) {
|
||||||
frappe.dom.unfreeze();
|
frappe.dom.unfreeze();
|
||||||
setTimeout(() => frappe.set_route('List', 'POS Profile'), 2000);
|
this.raise_exception_for_pos_profile();
|
||||||
frappe.throw(__("POS Profile is required to use Point-of-Sale"));
|
|
||||||
}
|
}
|
||||||
this.frm.script_manager.trigger("update_stock");
|
this.frm.script_manager.trigger("update_stock");
|
||||||
frappe.model.set_default_values(this.frm.doc);
|
frappe.model.set_default_values(this.frm.doc);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ def get_items(start, page_length, price_list, item_group, search_value="", pos_p
|
|||||||
|
|
||||||
|
|
||||||
if display_items_in_stock == 0:
|
if display_items_in_stock == 0:
|
||||||
res = frappe.db.sql("""select i.name as item_code, i.item_name, i.image as item_image,
|
res = frappe.db.sql("""select i.name as item_code, i.item_name, i.image as item_image, i.idx as idx,
|
||||||
i.is_stock_item, item_det.price_list_rate, item_det.currency
|
i.is_stock_item, item_det.price_list_rate, item_det.currency
|
||||||
from `tabItem` i LEFT JOIN
|
from `tabItem` i LEFT JOIN
|
||||||
(select item_code, price_list_rate, currency from
|
(select item_code, price_list_rate, currency from
|
||||||
@@ -49,7 +49,7 @@ def get_items(start, page_length, price_list, item_group, search_value="", pos_p
|
|||||||
where
|
where
|
||||||
i.disabled = 0 and i.has_variants = 0 and i.is_sales_item = 1
|
i.disabled = 0 and i.has_variants = 0 and i.is_sales_item = 1
|
||||||
and i.item_group in (select name from `tabItem Group` where lft >= {lft} and rgt <= {rgt})
|
and i.item_group in (select name from `tabItem Group` where lft >= {lft} and rgt <= {rgt})
|
||||||
and {condition} limit {start}, {page_length}""".format(start=start,page_length=page_length,lft=lft, rgt=rgt, condition=condition),
|
and {condition} order by idx desc limit {start}, {page_length}""".format(start=start,page_length=page_length,lft=lft, rgt=rgt, condition=condition),
|
||||||
{
|
{
|
||||||
'item_code': item_code,
|
'item_code': item_code,
|
||||||
'price_list': price_list
|
'price_list': price_list
|
||||||
@@ -60,7 +60,7 @@ def get_items(start, page_length, price_list, item_group, search_value="", pos_p
|
|||||||
}
|
}
|
||||||
|
|
||||||
elif display_items_in_stock == 1:
|
elif display_items_in_stock == 1:
|
||||||
query = """select i.name as item_code, i.item_name, i.image as item_image,
|
query = """select i.name as item_code, i.item_name, i.image as item_image, i.idx as idx,
|
||||||
i.is_stock_item, item_det.price_list_rate, item_det.currency
|
i.is_stock_item, item_det.price_list_rate, item_det.currency
|
||||||
from `tabItem` i LEFT JOIN
|
from `tabItem` i LEFT JOIN
|
||||||
(select item_code, price_list_rate, currency from
|
(select item_code, price_list_rate, currency from
|
||||||
@@ -79,7 +79,7 @@ def get_items(start, page_length, price_list, item_group, search_value="", pos_p
|
|||||||
where
|
where
|
||||||
i.disabled = 0 and i.has_variants = 0 and i.is_sales_item = 1
|
i.disabled = 0 and i.has_variants = 0 and i.is_sales_item = 1
|
||||||
and i.item_group in (select name from `tabItem Group` where lft >= {lft} and rgt <= {rgt})
|
and i.item_group in (select name from `tabItem Group` where lft >= {lft} and rgt <= {rgt})
|
||||||
and {condition} limit {start}, {page_length}""".format
|
and {condition} order by idx desc limit {start}, {page_length}""".format
|
||||||
(start=start,page_length=page_length,lft=lft, rgt=rgt, condition=condition),
|
(start=start,page_length=page_length,lft=lft, rgt=rgt, condition=condition),
|
||||||
{
|
{
|
||||||
'item_code': item_code,
|
'item_code': item_code,
|
||||||
|
|||||||
@@ -47,9 +47,8 @@ def get_columns():
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": _("Material Request"),
|
"label": _("Material Request"),
|
||||||
"options": "Material Request",
|
|
||||||
"fieldname": "material_request",
|
"fieldname": "material_request",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Data",
|
||||||
"width": 140
|
"width": 140
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -116,33 +115,43 @@ def get_data():
|
|||||||
{"sales_order_item": ("!=",""), "docstatus": 1},
|
{"sales_order_item": ("!=",""), "docstatus": 1},
|
||||||
["parent", "qty", "sales_order", "item_code"])
|
["parent", "qty", "sales_order", "item_code"])
|
||||||
|
|
||||||
grouped_records = {}
|
materials_request_dict = {}
|
||||||
|
|
||||||
for record in mr_records:
|
for record in mr_records:
|
||||||
grouped_records.setdefault(record.sales_order, []).append(record)
|
key = (record.sales_order, record.item_code)
|
||||||
|
if key not in materials_request_dict:
|
||||||
|
materials_request_dict.setdefault(key, {
|
||||||
|
'qty': 0,
|
||||||
|
'material_requests': [record.parent]
|
||||||
|
})
|
||||||
|
|
||||||
|
details = materials_request_dict.get(key)
|
||||||
|
details['qty'] += record.qty
|
||||||
|
|
||||||
|
if record.parent not in details.get('material_requests'):
|
||||||
|
details['material_requests'].append(record.parent)
|
||||||
|
|
||||||
pending_so=[]
|
pending_so=[]
|
||||||
for so in sales_order_entry:
|
for so in sales_order_entry:
|
||||||
# fetch all the material request records for a sales order item
|
# fetch all the material request records for a sales order item
|
||||||
mr_list = grouped_records.get(so.name) or [{}]
|
key = (so.name, so.item_code)
|
||||||
mr_item_record = ([mr for mr in mr_list if mr.get('item_code') == so.item_code] or [{}])
|
materials_request = materials_request_dict.get(key) or {}
|
||||||
|
|
||||||
for mr in mr_item_record:
|
# check for pending sales order
|
||||||
# check for pending sales order
|
if cint(so.net_qty) > cint(materials_request.get('qty')):
|
||||||
if cint(so.net_qty) > cint(mr.get('qty')):
|
so_record = {
|
||||||
so_record = {
|
"item_code": so.item_code,
|
||||||
"item_code": so.item_code,
|
"item_name": so.item_name,
|
||||||
"item_name": so.item_name,
|
"description": so.description,
|
||||||
"description": so.description,
|
"sales_order_no": so.name,
|
||||||
"sales_order_no": so.name,
|
"date": so.transaction_date,
|
||||||
"date": so.transaction_date,
|
"material_request": ','.join(materials_request.get('material_requests', [])),
|
||||||
"material_request": cstr(mr.get('parent')),
|
"customer": so.customer,
|
||||||
"customer": so.customer,
|
"territory": so.territory,
|
||||||
"territory": so.territory,
|
"so_qty": so.net_qty,
|
||||||
"so_qty": so.net_qty,
|
"requested_qty": cint(materials_request.get('qty')),
|
||||||
"requested_qty": cint(mr.get('qty')),
|
"pending_qty": so.net_qty - cint(materials_request.get('qty')),
|
||||||
"pending_qty": so.net_qty - cint(mr.get('qty')),
|
"company": so.company
|
||||||
"company": so.company
|
}
|
||||||
}
|
pending_so.append(so_record)
|
||||||
pending_so.append(so_record)
|
|
||||||
return pending_so
|
return pending_so
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user