Merge branch 'develop' into develop_copy_payment_schedule_from_quot_to_SO
This commit is contained in:
commit
275185438a
@ -1,5 +1,5 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<img src="https://github.com/frappe/design/blob/master/logos/erpnext-logo.svg" height="128">
|
<img src="https://raw.githubusercontent.com/frappe/erpnext/develop/erpnext/public/images/erpnext-logo.png" height="128">
|
||||||
<h2>ERPNext</h2>
|
<h2>ERPNext</h2>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<p>ERP made simple</p>
|
<p>ERP made simple</p>
|
||||||
|
@ -42,16 +42,15 @@ frappe.ui.form.on('Account', {
|
|||||||
// show / hide convert buttons
|
// show / hide convert buttons
|
||||||
frm.trigger('add_toolbar_buttons');
|
frm.trigger('add_toolbar_buttons');
|
||||||
}
|
}
|
||||||
|
if (frm.has_perm('write')) {
|
||||||
frm.add_custom_button(__('Update Account Name / Number'), function () {
|
frm.add_custom_button(__('Update Account Name / Number'), function () {
|
||||||
frm.trigger("update_account_number");
|
frm.trigger("update_account_number");
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
if(!frm.doc.__islocal) {
|
|
||||||
frm.add_custom_button(__('Merge Account'), function () {
|
frm.add_custom_button(__('Merge Account'), function () {
|
||||||
frm.trigger("merge_account");
|
frm.trigger("merge_account");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
account_type: function (frm) {
|
account_type: function (frm) {
|
||||||
if (frm.doc.is_group == 0) {
|
if (frm.doc.is_group == 0) {
|
||||||
|
@ -105,20 +105,27 @@ class Account(NestedSet):
|
|||||||
descendants = get_descendants_of('Company', self.company)
|
descendants = get_descendants_of('Company', self.company)
|
||||||
if not descendants: return
|
if not descendants: return
|
||||||
|
|
||||||
acc_name_map = {}
|
parent_acc_name_map = {}
|
||||||
acc_name = frappe.db.get_value('Account', self.parent_account, "account_name")
|
parent_acc_name = frappe.db.get_value('Account', self.parent_account, "account_name")
|
||||||
for d in frappe.db.get_values('Account',
|
for d in frappe.db.get_values('Account',
|
||||||
{"company": ["in", descendants], "account_name": acc_name},
|
{"company": ["in", descendants], "account_name": parent_acc_name},
|
||||||
["company", "name"], as_dict=True):
|
["company", "name"], as_dict=True):
|
||||||
acc_name_map[d["company"]] = d["name"]
|
parent_acc_name_map[d["company"]] = d["name"]
|
||||||
|
|
||||||
if not acc_name_map: return
|
if not parent_acc_name_map: return
|
||||||
|
|
||||||
for company in descendants:
|
for company in descendants:
|
||||||
|
if not parent_acc_name_map.get(company):
|
||||||
|
frappe.throw(_("While creating account for child Company {0}, parent account {1} not found. Please create the parent account in corresponding COA")
|
||||||
|
.format(company, parent_acc_name))
|
||||||
|
|
||||||
doc = frappe.copy_doc(self)
|
doc = frappe.copy_doc(self)
|
||||||
doc.flags.ignore_root_company_validation = True
|
doc.flags.ignore_root_company_validation = True
|
||||||
doc.update({"company": company, "account_currency": None,
|
doc.update({
|
||||||
"parent": acc_name_map[company], "parent_account": acc_name_map[company]})
|
"company": company,
|
||||||
|
"account_currency": None,
|
||||||
|
"parent_account": parent_acc_name_map[company]
|
||||||
|
})
|
||||||
doc.save()
|
doc.save()
|
||||||
frappe.msgprint(_("Account {0} is added in the child company {1}")
|
frappe.msgprint(_("Account {0} is added in the child company {1}")
|
||||||
.format(doc.name, company))
|
.format(doc.name, company))
|
||||||
@ -261,7 +268,7 @@ def update_account_number(name, account_name, account_number=None):
|
|||||||
|
|
||||||
new_name = get_account_autoname(account_number, account_name, account.company)
|
new_name = get_account_autoname(account_number, account_name, account.company)
|
||||||
if name != new_name:
|
if name != new_name:
|
||||||
frappe.rename_doc("Account", name, new_name, ignore_permissions=1)
|
frappe.rename_doc("Account", name, new_name, force=1)
|
||||||
return new_name
|
return new_name
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@ -280,7 +287,7 @@ def merge_account(old, new, is_group, root_type, company):
|
|||||||
frappe.db.set_value("Account", new, "parent_account",
|
frappe.db.set_value("Account", new, "parent_account",
|
||||||
frappe.db.get_value("Account", old, "parent_account"))
|
frappe.db.get_value("Account", old, "parent_account"))
|
||||||
|
|
||||||
frappe.rename_doc("Account", old, new, merge=1, ignore_permissions=1)
|
frappe.rename_doc("Account", old, new, merge=1, force=1)
|
||||||
|
|
||||||
return new
|
return new
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
"Accrued Rebates Due from Suppliers": {
|
"Accrued Rebates Due from Suppliers": {
|
||||||
"account_type": "Receivable"
|
"account_type": "Receivable"
|
||||||
},
|
},
|
||||||
"Accured Income from Suppliers": {
|
"Accrued Income from Suppliers": {
|
||||||
"account_type": "Receivable"
|
"account_type": "Receivable"
|
||||||
},
|
},
|
||||||
"Other Debtors": {
|
"Other Debtors": {
|
||||||
@ -54,7 +54,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Petty Cash": {
|
"Petty Cash": {
|
||||||
"Petty Cash - Admininistration": {
|
"Petty Cash - Administration": {
|
||||||
"account_type": "Cash"
|
"account_type": "Cash"
|
||||||
},
|
},
|
||||||
"Petty Cash - Others": {
|
"Petty Cash - Others": {
|
||||||
@ -85,13 +85,13 @@
|
|||||||
"Handling Difference in Inventory": {
|
"Handling Difference in Inventory": {
|
||||||
"account_type": "Stock Adjustment"
|
"account_type": "Stock Adjustment"
|
||||||
},
|
},
|
||||||
"Items Delivered to Customs on temprary Base": {}
|
"Items Delivered to Customs on temporary Base": {}
|
||||||
},
|
},
|
||||||
"Stock in Hand": {
|
"Stock in Hand": {
|
||||||
"account_type": "Stock"
|
"account_type": "Stock"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Perliminary and Preoperating Expenses": {
|
"Preliminary and Preoperating Expenses": {
|
||||||
"Preoperating Expenses": {}
|
"Preoperating Expenses": {}
|
||||||
},
|
},
|
||||||
"Prepayments & Deposits": {
|
"Prepayments & Deposits": {
|
||||||
@ -150,16 +150,16 @@
|
|||||||
"account_type": "Fixed Asset"
|
"account_type": "Fixed Asset"
|
||||||
},
|
},
|
||||||
"Leasehold Improvement": {},
|
"Leasehold Improvement": {},
|
||||||
"Motor Vehicules": {
|
"Motor Vehicles": {
|
||||||
"account_type": "Fixed Asset"
|
"account_type": "Fixed Asset"
|
||||||
},
|
},
|
||||||
"Work In Progrees": {},
|
"Work In Progress": {},
|
||||||
"account_type": "Fixed Asset"
|
"account_type": "Fixed Asset"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Intangible Assets": {
|
"Intangible Assets": {
|
||||||
"Computer Card Renewal": {},
|
"Computer Card Renewal": {},
|
||||||
"Dispoal of Outlets": {},
|
"Disposal of Outlets": {},
|
||||||
"Registration of Trademarks": {}
|
"Registration of Trademarks": {}
|
||||||
},
|
},
|
||||||
"Intercompany Accounts": {},
|
"Intercompany Accounts": {},
|
||||||
@ -218,7 +218,7 @@
|
|||||||
},
|
},
|
||||||
"MISC Charges": {
|
"MISC Charges": {
|
||||||
"Other Charges": {
|
"Other Charges": {
|
||||||
"Captial Loss": {
|
"Capital Loss": {
|
||||||
"Disposal of Business Branch": {},
|
"Disposal of Business Branch": {},
|
||||||
"Loss On Fixed Assets Disposal": {},
|
"Loss On Fixed Assets Disposal": {},
|
||||||
"Loss on Difference on Exchange": {}
|
"Loss on Difference on Exchange": {}
|
||||||
@ -253,14 +253,14 @@
|
|||||||
"Other Bank Charges": {}
|
"Other Bank Charges": {}
|
||||||
},
|
},
|
||||||
"Communications": {
|
"Communications": {
|
||||||
"Courrier": {},
|
"Courier": {},
|
||||||
"Others - Communication": {},
|
"Others - Communication": {},
|
||||||
"Telephone": {},
|
"Telephone": {},
|
||||||
"Web Site Hosting Fees": {}
|
"Web Site Hosting Fees": {}
|
||||||
},
|
},
|
||||||
"Office & Various Expenses": {
|
"Office & Various Expenses": {
|
||||||
"Cleaning": {},
|
"Cleaning": {},
|
||||||
"Convoyance Expenses": {},
|
"Conveyance Expenses": {},
|
||||||
"Gifts & Donations": {},
|
"Gifts & Donations": {},
|
||||||
"Insurance": {},
|
"Insurance": {},
|
||||||
"Kitchen and Buffet Expenses": {},
|
"Kitchen and Buffet Expenses": {},
|
||||||
@ -325,7 +325,7 @@
|
|||||||
"Current Liabilities": {
|
"Current Liabilities": {
|
||||||
"Accounts Payable": {
|
"Accounts Payable": {
|
||||||
"Payables": {
|
"Payables": {
|
||||||
"Advance Paybale to Suppliers": {
|
"Advance Payable to Suppliers": {
|
||||||
"account_type": "Payable"
|
"account_type": "Payable"
|
||||||
},
|
},
|
||||||
"Consigned Payable": {
|
"Consigned Payable": {
|
||||||
|
@ -1,837 +1,203 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
|
||||||
"allow_events_in_timeline": 0,
|
|
||||||
"allow_guest_to_view": 0,
|
|
||||||
"allow_import": 0,
|
|
||||||
"allow_rename": 0,
|
|
||||||
"beta": 0,
|
|
||||||
"creation": "2013-06-24 15:49:57",
|
"creation": "2013-06-24 15:49:57",
|
||||||
"custom": 0,
|
|
||||||
"description": "Settings for Accounts",
|
"description": "Settings for Accounts",
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "Other",
|
"document_type": "Other",
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"auto_accounting_for_stock",
|
||||||
|
"acc_frozen_upto",
|
||||||
|
"frozen_accounts_modifier",
|
||||||
|
"determine_address_tax_category_from",
|
||||||
|
"column_break_4",
|
||||||
|
"credit_controller",
|
||||||
|
"check_supplier_invoice_uniqueness",
|
||||||
|
"make_payment_via_journal_entry",
|
||||||
|
"unlink_payment_on_cancellation_of_invoice",
|
||||||
|
"unlink_advance_payment_on_cancelation_of_order",
|
||||||
|
"book_asset_depreciation_entry_automatically",
|
||||||
|
"allow_cost_center_in_entry_of_bs_account",
|
||||||
|
"add_taxes_from_item_tax_template",
|
||||||
|
"automatically_fetch_payment_terms",
|
||||||
|
"print_settings",
|
||||||
|
"show_inclusive_tax_in_print",
|
||||||
|
"column_break_12",
|
||||||
|
"show_payment_schedule_in_print",
|
||||||
|
"currency_exchange_section",
|
||||||
|
"allow_stale",
|
||||||
|
"stale_days",
|
||||||
|
"report_settings_sb",
|
||||||
|
"use_custom_cash_flow"
|
||||||
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "1",
|
"default": "1",
|
||||||
"description": "If enabled, the system will post accounting entries for inventory automatically.",
|
"description": "If enabled, the system will post accounting entries for inventory automatically.",
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "auto_accounting_for_stock",
|
"fieldname": "auto_accounting_for_stock",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"label": "Make Accounting Entry For Every Stock Movement"
|
||||||
"label": "Make Accounting Entry For Every Stock Movement",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"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": "Accounting entry frozen up to this date, nobody can do / modify entry except role specified below.",
|
"description": "Accounting entry frozen up to this date, nobody can do / modify entry except role specified below.",
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "acc_frozen_upto",
|
"fieldname": "acc_frozen_upto",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"label": "Accounts Frozen Upto"
|
||||||
"label": "Accounts Frozen Upto",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"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": "Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts",
|
"description": "Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts",
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "frozen_accounts_modifier",
|
"fieldname": "frozen_accounts_modifier",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Role Allowed to Set Frozen Accounts & Edit Frozen Entries",
|
"label": "Role Allowed to Set Frozen Accounts & Edit Frozen Entries",
|
||||||
"length": 0,
|
"options": "Role"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Role",
|
|
||||||
"permlevel": 0,
|
|
||||||
"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": "Billing Address",
|
"default": "Billing Address",
|
||||||
"description": "Address used to determine Tax Category in transactions.",
|
"description": "Address used to determine Tax Category in transactions.",
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "determine_address_tax_category_from",
|
"fieldname": "determine_address_tax_category_from",
|
||||||
"fieldtype": "Select",
|
"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": "Determine Address Tax Category From",
|
"label": "Determine Address Tax Category From",
|
||||||
"length": 0,
|
"options": "Billing Address\nShipping Address"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Billing Address\nShipping Address",
|
|
||||||
"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_4",
|
"fieldname": "column_break_4",
|
||||||
"fieldtype": "Column Break",
|
"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": "Role that is allowed to submit transactions that exceed credit limits set.",
|
"description": "Role that is allowed to submit transactions that exceed credit limits set.",
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "credit_controller",
|
"fieldname": "credit_controller",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Credit Controller",
|
"label": "Credit Controller",
|
||||||
"length": 0,
|
"options": "Role"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Role",
|
|
||||||
"permlevel": 0,
|
|
||||||
"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": "check_supplier_invoice_uniqueness",
|
"fieldname": "check_supplier_invoice_uniqueness",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Check Supplier Invoice Number Uniqueness"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Check Supplier Invoice Number Uniqueness",
|
|
||||||
"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": "make_payment_via_journal_entry",
|
"fieldname": "make_payment_via_journal_entry",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Make Payment via Journal Entry"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Make Payment via Journal Entry",
|
|
||||||
"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": "1",
|
"default": "1",
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "unlink_payment_on_cancellation_of_invoice",
|
"fieldname": "unlink_payment_on_cancellation_of_invoice",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Unlink Payment on Cancellation of Invoice"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Unlink Payment on Cancellation of Invoice",
|
|
||||||
"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": "1",
|
"default": "1",
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "unlink_advance_payment_on_cancelation_of_order",
|
"fieldname": "unlink_advance_payment_on_cancelation_of_order",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Unlink Advance Payment on Cancelation of Order"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Unlink Advance Payment on Cancelation of Order",
|
|
||||||
"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": "1",
|
"default": "1",
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "book_asset_depreciation_entry_automatically",
|
"fieldname": "book_asset_depreciation_entry_automatically",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Book Asset Depreciation Entry Automatically"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Book Asset Depreciation Entry Automatically",
|
|
||||||
"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": "allow_cost_center_in_entry_of_bs_account",
|
"fieldname": "allow_cost_center_in_entry_of_bs_account",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Allow Cost Center In Entry of Balance Sheet Account"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Allow Cost Center In Entry of Balance Sheet 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_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "1",
|
"default": "1",
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "add_taxes_from_item_tax_template",
|
"fieldname": "add_taxes_from_item_tax_template",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Automatically Add Taxes and Charges from Item Tax Template"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Automatically Add Taxes and Charges from Item Tax Template",
|
|
||||||
"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": "print_settings",
|
"fieldname": "print_settings",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"label": "Print Settings"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Print Settings",
|
|
||||||
"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": "show_inclusive_tax_in_print",
|
"fieldname": "show_inclusive_tax_in_print",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Show Inclusive Tax In Print"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Show Inclusive Tax In Print",
|
|
||||||
"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_12",
|
"fieldname": "column_break_12",
|
||||||
"fieldtype": "Column Break",
|
"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": "show_payment_schedule_in_print",
|
"fieldname": "show_payment_schedule_in_print",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Show Payment Schedule in Print"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Show Payment Schedule in Print",
|
|
||||||
"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_exchange_section",
|
"fieldname": "currency_exchange_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"label": "Currency Exchange Settings"
|
||||||
"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 Exchange Settings",
|
|
||||||
"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": "1",
|
"default": "1",
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "allow_stale",
|
"fieldname": "allow_stale",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"label": "Allow Stale Exchange Rates"
|
||||||
"label": "Allow Stale Exchange Rates",
|
|
||||||
"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": "1",
|
"default": "1",
|
||||||
"depends_on": "eval:doc.allow_stale==0",
|
"depends_on": "eval:doc.allow_stale==0",
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "stale_days",
|
"fieldname": "stale_days",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"hidden": 0,
|
"label": "Stale Days"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Stale Days",
|
|
||||||
"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": "report_settings_sb",
|
"fieldname": "report_settings_sb",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"label": "Report Settings"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Report Settings",
|
|
||||||
"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": "0",
|
"default": "0",
|
||||||
"description": "Only select if you have setup Cash Flow Mapper documents",
|
"description": "Only select if you have setup Cash Flow Mapper documents",
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "use_custom_cash_flow",
|
"fieldname": "use_custom_cash_flow",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Use Custom Cash Flow Format"
|
||||||
"ignore_user_permissions": 0,
|
},
|
||||||
"ignore_xss_filter": 0,
|
{
|
||||||
"in_filter": 0,
|
"fieldname": "automatically_fetch_payment_terms",
|
||||||
"in_global_search": 0,
|
"fieldtype": "Check",
|
||||||
"in_list_view": 0,
|
"label": "Automatically Fetch Payment Terms"
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Use Custom Cash Flow Format",
|
|
||||||
"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_toolbar": 0,
|
|
||||||
"icon": "icon-cog",
|
"icon": "icon-cog",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"in_create": 0,
|
|
||||||
"is_submittable": 0,
|
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"istable": 0,
|
"modified": "2019-04-28 18:20:55.789946",
|
||||||
"max_attachments": 0,
|
|
||||||
"modified": "2019-04-06 12:28:43.026250",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Accounts Settings",
|
"name": "Accounts Settings",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
"amend": 0,
|
|
||||||
"cancel": 0,
|
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"delete": 0,
|
|
||||||
"email": 1,
|
"email": 1,
|
||||||
"export": 0,
|
|
||||||
"if_owner": 0,
|
|
||||||
"import": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print": 1,
|
"print": 1,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 0,
|
|
||||||
"role": "Accounts Manager",
|
"role": "Accounts Manager",
|
||||||
"set_user_permissions": 0,
|
|
||||||
"share": 1,
|
"share": 1,
|
||||||
"submit": 0,
|
|
||||||
"write": 1
|
"write": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"amend": 0,
|
|
||||||
"cancel": 0,
|
|
||||||
"create": 0,
|
|
||||||
"delete": 0,
|
|
||||||
"email": 0,
|
|
||||||
"export": 0,
|
|
||||||
"if_owner": 0,
|
|
||||||
"import": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print": 0,
|
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 0,
|
"role": "Sales User"
|
||||||
"role": "Sales User",
|
|
||||||
"set_user_permissions": 0,
|
|
||||||
"share": 0,
|
|
||||||
"submit": 0,
|
|
||||||
"write": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"amend": 0,
|
|
||||||
"cancel": 0,
|
|
||||||
"create": 0,
|
|
||||||
"delete": 0,
|
|
||||||
"email": 0,
|
|
||||||
"export": 0,
|
|
||||||
"if_owner": 0,
|
|
||||||
"import": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print": 0,
|
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 0,
|
"role": "Purchase User"
|
||||||
"role": "Purchase User",
|
|
||||||
"set_user_permissions": 0,
|
|
||||||
"share": 0,
|
|
||||||
"submit": 0,
|
|
||||||
"write": 0
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"read_only": 0,
|
|
||||||
"show_name_in_global_search": 0,
|
|
||||||
"sort_order": "ASC",
|
"sort_order": "ASC",
|
||||||
"track_changes": 1,
|
"track_changes": 1
|
||||||
"track_seen": 0,
|
|
||||||
"track_views": 0
|
|
||||||
}
|
}
|
@ -22,7 +22,5 @@ class BankGuarantee(Document):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_vouchar_detials(column_list, doctype, docname):
|
def get_vouchar_detials(column_list, doctype, docname):
|
||||||
print (column_list, doctype, docname)
|
|
||||||
return frappe.db.sql(''' select {columns} from `tab{doctype}` where name=%s'''
|
return frappe.db.sql(''' select {columns} from `tab{doctype}` where name=%s'''
|
||||||
.format(columns=", ".join(json.loads(column_list)), doctype=doctype), docname, as_dict=1)[0]
|
.format(columns=", ".join(json.loads(column_list)), doctype=doctype), docname, as_dict=1)[0]
|
||||||
|
|
||||||
|
@ -354,9 +354,7 @@ cur_frm.cscript.update_totals = function(doc) {
|
|||||||
|
|
||||||
cur_frm.cscript.get_balance = function(doc,dt,dn) {
|
cur_frm.cscript.get_balance = function(doc,dt,dn) {
|
||||||
cur_frm.cscript.update_totals(doc);
|
cur_frm.cscript.update_totals(doc);
|
||||||
return $c_obj(cur_frm.doc, 'get_balance', '', function(r, rt){
|
cur_frm.call('get_balance', null, () => { cur_frm.refresh(); });
|
||||||
cur_frm.refresh();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.validate = function(doc,cdt,cdn) {
|
cur_frm.cscript.validate = function(doc,cdt,cdn) {
|
||||||
|
@ -30,6 +30,20 @@ frappe.ui.form.on('Payment Entry', {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
frm.set_query("party_bank_account", function() {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
"is_company_account":0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frm.set_query("bank_account", function() {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
"is_company_account":1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
frm.set_query("contact_person", function() {
|
frm.set_query("contact_person", function() {
|
||||||
if (frm.doc.party) {
|
if (frm.doc.party) {
|
||||||
return {
|
return {
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -967,3 +967,37 @@ def get_party_and_account_balance(company, date, paid_from=None, paid_to=None, p
|
|||||||
"paid_from_account_balance": get_balance_on(paid_from, date, cost_center=cost_center),
|
"paid_from_account_balance": get_balance_on(paid_from, date, cost_center=cost_center),
|
||||||
"paid_to_account_balance": get_balance_on(paid_to, date=date, cost_center=cost_center)
|
"paid_to_account_balance": get_balance_on(paid_to, date=date, cost_center=cost_center)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def make_payment_order(source_name, target_doc=None):
|
||||||
|
from frappe.model.mapper import get_mapped_doc
|
||||||
|
def set_missing_values(source, target):
|
||||||
|
target.payment_order_type = "Payment Entry"
|
||||||
|
|
||||||
|
def update_item(source_doc, target_doc, source_parent):
|
||||||
|
target_doc.bank_account = source_parent.party_bank_account
|
||||||
|
target_doc.amount = source_parent.base_paid_amount
|
||||||
|
target_doc.account = source_parent.paid_to
|
||||||
|
target_doc.payment_entry = source_parent.name
|
||||||
|
target_doc.supplier = source_parent.party
|
||||||
|
target_doc.mode_of_payment = source_parent.mode_of_payment
|
||||||
|
|
||||||
|
|
||||||
|
doclist = get_mapped_doc("Payment Entry", source_name, {
|
||||||
|
"Payment Entry": {
|
||||||
|
"doctype": "Payment Order",
|
||||||
|
"validation": {
|
||||||
|
"docstatus": ["=", 1]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Payment Entry Reference": {
|
||||||
|
"doctype": "Payment Order Reference",
|
||||||
|
"validation": {
|
||||||
|
"docstatus": ["=", 1]
|
||||||
|
},
|
||||||
|
"postprocess": update_item
|
||||||
|
},
|
||||||
|
|
||||||
|
}, target_doc, set_missing_values)
|
||||||
|
|
||||||
|
return doclist
|
||||||
|
@ -2,23 +2,79 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Payment Order', {
|
frappe.ui.form.on('Payment Order', {
|
||||||
|
setup: function(frm) {
|
||||||
|
frm.set_query("company_bank_account", function() {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
"is_company_account":1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
if (frm.doc.docstatus == 0) {
|
if (frm.doc.docstatus == 0) {
|
||||||
frm.add_custom_button(__('Payment Request'), function() {
|
frm.add_custom_button(__('Payment Request'), function() {
|
||||||
frm.trigger("get_from_payment_request");
|
frm.trigger("get_from_payment_request");
|
||||||
}, __("Get from"));
|
}, __("Get from"));
|
||||||
|
|
||||||
|
frm.add_custom_button(__('Payment Entry'), function() {
|
||||||
|
frm.trigger("get_from_payment_entry");
|
||||||
|
}, __("Get from"));
|
||||||
|
|
||||||
|
frm.trigger('remove_button');
|
||||||
}
|
}
|
||||||
|
|
||||||
// payment Entry
|
// payment Entry
|
||||||
if (frm.doc.docstatus==1) {
|
if (frm.doc.docstatus===1 && frm.doc.payment_order_type==='Payment Request') {
|
||||||
frm.add_custom_button(__('Create Payment Entries'),
|
frm.add_custom_button(__('Create Payment Entries'), function() {
|
||||||
function() {
|
|
||||||
frm.trigger("make_payment_records");
|
frm.trigger("make_payment_records");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
remove_row_if_empty: function(frm) {
|
||||||
|
// remove if first row is empty
|
||||||
|
if (frm.doc.references.length > 0 && !frm.doc.references[0].reference_name) {
|
||||||
|
frm.doc.references = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
remove_button: function(frm) {
|
||||||
|
// remove custom button of order type that is not imported
|
||||||
|
|
||||||
|
let label = ["Payment Request", "Payment Entry"];
|
||||||
|
|
||||||
|
if (frm.doc.references.length > 0 && frm.doc.payment_order_type) {
|
||||||
|
label = label.reduce(x => {
|
||||||
|
x!= frm.doc.payment_order_type;
|
||||||
|
return x;
|
||||||
|
});
|
||||||
|
frm.remove_custom_button(label, "Get from");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
get_from_payment_entry: function(frm) {
|
||||||
|
frm.trigger("remove_row_if_empty");
|
||||||
|
erpnext.utils.map_current_doc({
|
||||||
|
method: "erpnext.accounts.doctype.payment_entry.payment_entry.make_payment_order",
|
||||||
|
source_doctype: "Payment Entry",
|
||||||
|
target: frm,
|
||||||
|
date_field: "posting_date",
|
||||||
|
setters: {
|
||||||
|
party: frm.doc.supplier || ""
|
||||||
|
},
|
||||||
|
get_query_filters: {
|
||||||
|
bank: frm.doc.bank,
|
||||||
|
docstatus: 1,
|
||||||
|
bank_account: frm.doc.company_bank_account,
|
||||||
|
paid_from: frm.doc.account,
|
||||||
|
status: ["=", "Initiated"],
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
get_from_payment_request: function(frm) {
|
get_from_payment_request: function(frm) {
|
||||||
|
frm.trigger("remove_row_if_empty");
|
||||||
erpnext.utils.map_current_doc({
|
erpnext.utils.map_current_doc({
|
||||||
method: "erpnext.accounts.doctype.payment_request.payment_request.make_payment_order",
|
method: "erpnext.accounts.doctype.payment_request.payment_request.make_payment_order",
|
||||||
source_doctype: "Payment Request",
|
source_doctype: "Payment Request",
|
||||||
@ -79,5 +135,4 @@ frappe.ui.form.on('Payment Order', {
|
|||||||
|
|
||||||
dialog.show();
|
dialog.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
@ -1,327 +1,117 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
|
||||||
"allow_guest_to_view": 0,
|
|
||||||
"allow_import": 0,
|
|
||||||
"allow_rename": 0,
|
|
||||||
"autoname": "naming_series:",
|
"autoname": "naming_series:",
|
||||||
"beta": 0,
|
|
||||||
"creation": "2018-07-20 16:43:08.505978",
|
"creation": "2018-07-20 16:43:08.505978",
|
||||||
"custom": 0,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "",
|
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"naming_series",
|
||||||
|
"company",
|
||||||
|
"payment_order_type",
|
||||||
|
"party",
|
||||||
|
"column_break_2",
|
||||||
|
"posting_date",
|
||||||
|
"company_bank",
|
||||||
|
"company_bank_account",
|
||||||
|
"account",
|
||||||
|
"section_break_5",
|
||||||
|
"references",
|
||||||
|
"amended_from"
|
||||||
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "PMO-",
|
"default": "PMO-",
|
||||||
"fieldname": "naming_series",
|
"fieldname": "naming_series",
|
||||||
"fieldtype": "Select",
|
"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": "Series",
|
"label": "Series",
|
||||||
"length": 0,
|
"no_copy": 1,
|
||||||
"no_copy": 0,
|
|
||||||
"options": "PMO-",
|
"options": "PMO-",
|
||||||
"permlevel": 0,
|
"reqd": 1
|
||||||
"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": "company",
|
"fieldname": "company",
|
||||||
"fieldtype": "Link",
|
"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",
|
"label": "Company",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Company",
|
"options": "Company",
|
||||||
"permlevel": 0,
|
"reqd": 1
|
||||||
"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,
|
"depends_on": "eval: doc.payment_order_type=='Payment Request';",
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "party",
|
"fieldname": "party",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Supplier",
|
"label": "Supplier",
|
||||||
"length": 0,
|
"options": "Supplier"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Supplier",
|
|
||||||
"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_2",
|
"fieldname": "column_break_2",
|
||||||
"fieldtype": "Column Break",
|
"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": "Today",
|
"default": "Today",
|
||||||
"fieldname": "posting_date",
|
"fieldname": "posting_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"label": "Posting Date"
|
||||||
"label": "Posting 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": "bank",
|
|
||||||
"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": "Bank",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Bank",
|
|
||||||
"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_5",
|
"fieldname": "section_break_5",
|
||||||
"fieldtype": "Section Break",
|
"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_bulk_edit": 1,
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "references",
|
"fieldname": "references",
|
||||||
"fieldtype": "Table",
|
"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 Order Reference",
|
"label": "Payment Order Reference",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Payment Order Reference",
|
"options": "Payment Order Reference",
|
||||||
"permlevel": 0,
|
"reqd": 1
|
||||||
"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": "amended_from",
|
"fieldname": "amended_from",
|
||||||
"fieldtype": "Link",
|
"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",
|
"label": "Amended From",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"options": "Payment Order",
|
"options": "Payment Order",
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_hide_if_no_value": 0,
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "payment_order_type",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"label": "Payment Order Type",
|
||||||
|
"options": "\nPayment Request\nPayment Entry",
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"remember_last_selected_value": 0,
|
"reqd": 1
|
||||||
"report_hide": 0,
|
},
|
||||||
"reqd": 0,
|
{
|
||||||
"search_index": 0,
|
"fieldname": "company_bank_account",
|
||||||
"set_only_once": 0,
|
"fieldtype": "Link",
|
||||||
"translatable": 0,
|
"label": "Company Bank Account",
|
||||||
"unique": 0
|
"options": "Bank Account",
|
||||||
|
"reqd": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"depends_on": "company_bank_account",
|
||||||
|
"fetch_from": "company_bank_account.bank",
|
||||||
|
"fieldname": "company_bank",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Bank",
|
||||||
|
"options": "Bank"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"depends_on": "company_bank_account",
|
||||||
|
"fetch_from": "company_bank_account.account",
|
||||||
|
"fieldname": "account",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"label": "Account"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
|
||||||
"hide_heading": 0,
|
|
||||||
"hide_toolbar": 0,
|
|
||||||
"idx": 0,
|
|
||||||
"image_view": 0,
|
|
||||||
"in_create": 0,
|
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"issingle": 0,
|
"modified": "2019-05-14 17:12:24.912666",
|
||||||
"istable": 0,
|
|
||||||
"max_attachments": 0,
|
|
||||||
"modified": "2018-07-31 18:48:00.681271",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Order",
|
"name": "Payment Order",
|
||||||
"name_case": "",
|
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
@ -331,14 +121,10 @@
|
|||||||
"delete": 1,
|
"delete": 1,
|
||||||
"email": 1,
|
"email": 1,
|
||||||
"export": 1,
|
"export": 1,
|
||||||
"if_owner": 0,
|
|
||||||
"import": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print": 1,
|
"print": 1,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 1,
|
"report": 1,
|
||||||
"role": "Accounts User",
|
"role": "Accounts User",
|
||||||
"set_user_permissions": 0,
|
|
||||||
"share": 1,
|
"share": 1,
|
||||||
"submit": 1,
|
"submit": 1,
|
||||||
"write": 1
|
"write": 1
|
||||||
@ -350,26 +136,16 @@
|
|||||||
"delete": 1,
|
"delete": 1,
|
||||||
"email": 1,
|
"email": 1,
|
||||||
"export": 1,
|
"export": 1,
|
||||||
"if_owner": 0,
|
|
||||||
"import": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print": 1,
|
"print": 1,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 1,
|
"report": 1,
|
||||||
"role": "Accounts Manager",
|
"role": "Accounts Manager",
|
||||||
"set_user_permissions": 0,
|
|
||||||
"share": 1,
|
"share": 1,
|
||||||
"submit": 1,
|
"submit": 1,
|
||||||
"write": 1
|
"write": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"quick_entry": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"read_only_onload": 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_views": 0
|
|
||||||
}
|
}
|
@ -11,18 +11,20 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
class PaymentOrder(Document):
|
class PaymentOrder(Document):
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
self.update_payment_request_status()
|
self.update_payment_status()
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
self.update_payment_request_status(cancel=True)
|
self.update_payment_status(cancel=True)
|
||||||
|
|
||||||
def update_payment_request_status(self, cancel=False):
|
def update_payment_status(self, cancel=False):
|
||||||
status = 'Payment Ordered'
|
status = 'Payment Ordered'
|
||||||
if cancel:
|
if cancel:
|
||||||
status = 'Initiated'
|
status = 'Initiated'
|
||||||
|
|
||||||
|
ref_field = "status" if self.payment_order_type == "Payment Request" else "payment_order_status"
|
||||||
|
|
||||||
for d in self.references:
|
for d in self.references:
|
||||||
frappe.db.set_value('Payment Request', d.payment_request, 'status', status)
|
frappe.db.set_value(self.payment_order_type, d.get(frappe.scrub(self.payment_order_type)), ref_field, status)
|
||||||
|
|
||||||
def get_mop_query(doctype, txt, searchfield, start, page_len, filters):
|
def get_mop_query(doctype, txt, searchfield, start, page_len, filters):
|
||||||
return frappe.db.sql(""" select mode_of_payment from `tabPayment Order Reference`
|
return frappe.db.sql(""" select mode_of_payment from `tabPayment Order Reference`
|
||||||
|
29
erpnext/accounts/doctype/payment_order/regional/india.js
Normal file
29
erpnext/accounts/doctype/payment_order/regional/india.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
frappe.ui.form.on('Payment Order', {
|
||||||
|
refresh: function(frm) {
|
||||||
|
if (frm.doc.docstatus==1 && frm.doc.payment_order_type==='Payment Entry') {
|
||||||
|
frm.add_custom_button(__('Generate Text File'), function() {
|
||||||
|
frm.trigger("generate_text_and_download_file");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
generate_text_and_download_file: (frm) => {
|
||||||
|
return frappe.call({
|
||||||
|
method: "erpnext.regional.india.bank_remittance_txt.generate_report",
|
||||||
|
args: {
|
||||||
|
name: frm.doc.name
|
||||||
|
},
|
||||||
|
freeze: true,
|
||||||
|
callback: function(r) {
|
||||||
|
{
|
||||||
|
frm.reload_doc();
|
||||||
|
const a = document.createElement('a');
|
||||||
|
let file_obj = r.message;
|
||||||
|
a.href = file_obj.file_url;
|
||||||
|
a.target = '_blank';
|
||||||
|
a.download = file_obj.file_name;
|
||||||
|
a.click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
@ -1,433 +1,126 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
|
||||||
"allow_guest_to_view": 0,
|
|
||||||
"allow_import": 0,
|
|
||||||
"allow_rename": 0,
|
|
||||||
"beta": 0,
|
|
||||||
"creation": "2018-07-20 16:38:06.630813",
|
"creation": "2018-07-20 16:38:06.630813",
|
||||||
"custom": 0,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "",
|
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"reference_doctype",
|
||||||
|
"reference_name",
|
||||||
|
"amount",
|
||||||
|
"column_break_4",
|
||||||
|
"supplier",
|
||||||
|
"payment_request",
|
||||||
|
"payment_entry",
|
||||||
|
"mode_of_payment",
|
||||||
|
"bank_account_details",
|
||||||
|
"bank_account",
|
||||||
|
"column_break_10",
|
||||||
|
"account",
|
||||||
|
"payment_reference"
|
||||||
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "reference_doctype",
|
"fieldname": "reference_doctype",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Type",
|
"label": "Type",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "DocType",
|
"options": "DocType",
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"remember_last_selected_value": 0,
|
"reqd": 1
|
||||||
"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": "reference_name",
|
"fieldname": "reference_name",
|
||||||
"fieldtype": "Dynamic Link",
|
"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_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Name",
|
"label": "Name",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "reference_doctype",
|
"options": "reference_doctype",
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"remember_last_selected_value": 0,
|
"reqd": 1
|
||||||
"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": "amount",
|
"fieldname": "amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Amount",
|
"label": "Amount",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"remember_last_selected_value": 0,
|
"reqd": 1
|
||||||
"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_4",
|
"fieldname": "column_break_4",
|
||||||
"fieldtype": "Column Break",
|
"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": "supplier",
|
"fieldname": "supplier",
|
||||||
"fieldtype": "Link",
|
"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": 1,
|
"in_standard_filter": 1,
|
||||||
"label": "Supplier",
|
"label": "Supplier",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Supplier",
|
"options": "Supplier",
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"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": "payment_request",
|
"fieldname": "payment_request",
|
||||||
"fieldtype": "Link",
|
"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": "Payment Request",
|
"label": "Payment Request",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Payment Request",
|
"options": "Payment Request",
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"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_from": "payment_request.mode_of_payment",
|
"fetch_from": "payment_request.mode_of_payment",
|
||||||
"fieldname": "mode_of_payment",
|
"fieldname": "mode_of_payment",
|
||||||
"fieldtype": "Link",
|
"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": "Mode of Payment",
|
"label": "Mode of Payment",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Mode of Payment",
|
"options": "Mode of Payment",
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"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": "bank_account_details",
|
"fieldname": "bank_account_details",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"label": "Bank Account Details"
|
||||||
"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 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": "bank_account",
|
"fieldname": "bank_account",
|
||||||
"fieldtype": "Link",
|
"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",
|
"label": "Bank Account",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Bank Account",
|
"options": "Bank Account",
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"remember_last_selected_value": 0,
|
"reqd": 1
|
||||||
"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_10",
|
"fieldname": "column_break_10",
|
||||||
"fieldtype": "Column Break",
|
"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": "account",
|
"fieldname": "account",
|
||||||
"fieldtype": "Link",
|
"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",
|
"label": "Account",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Account",
|
"options": "Account",
|
||||||
"permlevel": 0,
|
"read_only": 1
|
||||||
"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": "payment_reference",
|
"fieldname": "payment_reference",
|
||||||
"fieldtype": "Data",
|
"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": "Payment Reference",
|
"label": "Payment Reference",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"options": "",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_hide_if_no_value": 0,
|
"read_only": 1
|
||||||
"read_only": 1,
|
},
|
||||||
"remember_last_selected_value": 0,
|
{
|
||||||
"report_hide": 0,
|
"fieldname": "payment_entry",
|
||||||
"reqd": 0,
|
"fieldtype": "Link",
|
||||||
"search_index": 0,
|
"label": "Payment Entry",
|
||||||
"set_only_once": 0,
|
"options": "Payment Entry",
|
||||||
"translatable": 0,
|
"read_only": 1
|
||||||
"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,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"modified": "2019-05-08 13:56:25.724557",
|
||||||
"modified": "2018-07-31 17:21:37.698644",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Order Reference",
|
"name": "Payment Order Reference",
|
||||||
"name_case": "",
|
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [],
|
"permissions": [],
|
||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"read_only": 0,
|
|
||||||
"read_only_onload": 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_views": 0
|
|
||||||
}
|
}
|
@ -14,7 +14,6 @@ from frappe.integrations.utils import get_payment_gateway_controller
|
|||||||
from frappe.utils.background_jobs import enqueue
|
from frappe.utils.background_jobs import enqueue
|
||||||
from erpnext.erpnext_integrations.stripe_integration import create_stripe_subscription
|
from erpnext.erpnext_integrations.stripe_integration import create_stripe_subscription
|
||||||
from erpnext.accounts.doctype.subscription_plan.subscription_plan import get_plan_rate
|
from erpnext.accounts.doctype.subscription_plan.subscription_plan import get_plan_rate
|
||||||
from frappe.model.mapper import get_mapped_doc
|
|
||||||
|
|
||||||
class PaymentRequest(Document):
|
class PaymentRequest(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
@ -426,7 +425,9 @@ def get_subscription_details(reference_doctype, reference_name):
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def make_payment_order(source_name, target_doc=None):
|
def make_payment_order(source_name, target_doc=None):
|
||||||
|
from frappe.model.mapper import get_mapped_doc
|
||||||
def set_missing_values(source, target):
|
def set_missing_values(source, target):
|
||||||
|
target.payment_order_type = "Payment Request"
|
||||||
target.append('references', {
|
target.append('references', {
|
||||||
'reference_doctype': source.reference_doctype,
|
'reference_doctype': source.reference_doctype,
|
||||||
'reference_name': source.reference_name,
|
'reference_name': source.reference_name,
|
||||||
|
@ -100,6 +100,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
self.validate_fixed_asset()
|
self.validate_fixed_asset()
|
||||||
self.create_remarks()
|
self.create_remarks()
|
||||||
self.set_status()
|
self.set_status()
|
||||||
|
self.validate_purchase_receipt_if_update_stock()
|
||||||
validate_inter_company_party(self.doctype, self.supplier, self.company, self.inter_company_invoice_reference)
|
validate_inter_company_party(self.doctype, self.supplier, self.company, self.inter_company_invoice_reference)
|
||||||
|
|
||||||
def validate_release_date(self):
|
def validate_release_date(self):
|
||||||
@ -284,7 +285,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
|
|
||||||
def update_status_updater_args(self):
|
def update_status_updater_args(self):
|
||||||
if cint(self.update_stock):
|
if cint(self.update_stock):
|
||||||
self.status_updater.extend([{
|
self.status_updater.append({
|
||||||
'source_dt': 'Purchase Invoice Item',
|
'source_dt': 'Purchase Invoice Item',
|
||||||
'target_dt': 'Purchase Order Item',
|
'target_dt': 'Purchase Order Item',
|
||||||
'join_field': 'po_detail',
|
'join_field': 'po_detail',
|
||||||
@ -292,28 +293,29 @@ class PurchaseInvoice(BuyingController):
|
|||||||
'target_parent_dt': 'Purchase Order',
|
'target_parent_dt': 'Purchase Order',
|
||||||
'target_parent_field': 'per_received',
|
'target_parent_field': 'per_received',
|
||||||
'target_ref_field': 'qty',
|
'target_ref_field': 'qty',
|
||||||
'source_field': 'qty',
|
'source_field': 'received_qty',
|
||||||
|
'second_source_dt': 'Purchase Receipt Item',
|
||||||
|
'second_source_field': 'received_qty',
|
||||||
|
'second_join_field': 'purchase_order_item',
|
||||||
'percent_join_field':'purchase_order',
|
'percent_join_field':'purchase_order',
|
||||||
# 'percent_join_field': 'prevdoc_docname',
|
|
||||||
'overflow_type': 'receipt',
|
'overflow_type': 'receipt',
|
||||||
'extra_cond': """ and exists(select name from `tabPurchase Invoice`
|
'extra_cond': """ and exists(select name from `tabPurchase Invoice`
|
||||||
where name=`tabPurchase Invoice Item`.parent and update_stock = 1)"""
|
where name=`tabPurchase Invoice Item`.parent and update_stock = 1)"""
|
||||||
},
|
})
|
||||||
{
|
if cint(self.is_return):
|
||||||
|
self.status_updater.append({
|
||||||
'source_dt': 'Purchase Invoice Item',
|
'source_dt': 'Purchase Invoice Item',
|
||||||
'target_dt': 'Purchase Order Item',
|
'target_dt': 'Purchase Order Item',
|
||||||
'join_field': 'po_detail',
|
'join_field': 'po_detail',
|
||||||
'target_field': 'returned_qty',
|
'target_field': 'returned_qty',
|
||||||
'target_parent_dt': 'Purchase Order',
|
|
||||||
# 'target_parent_field': 'per_received',
|
|
||||||
# 'target_ref_field': 'qty',
|
|
||||||
'source_field': '-1 * qty',
|
'source_field': '-1 * qty',
|
||||||
# 'percent_join_field': 'prevdoc_docname',
|
'second_source_dt': 'Purchase Receipt Item',
|
||||||
# 'overflow_type': 'receipt',
|
'second_source_field': '-1 * qty',
|
||||||
|
'second_join_field': 'purchase_order_item',
|
||||||
|
'overflow_type': 'receipt',
|
||||||
'extra_cond': """ and exists (select name from `tabPurchase Invoice`
|
'extra_cond': """ and exists (select name from `tabPurchase Invoice`
|
||||||
where name=`tabPurchase Invoice Item`.parent and update_stock=1 and is_return=1)"""
|
where name=`tabPurchase Invoice Item`.parent and update_stock=1 and is_return=1)"""
|
||||||
}
|
})
|
||||||
])
|
|
||||||
|
|
||||||
def validate_purchase_receipt_if_update_stock(self):
|
def validate_purchase_receipt_if_update_stock(self):
|
||||||
if self.update_stock:
|
if self.update_stock:
|
||||||
@ -327,13 +329,13 @@ class PurchaseInvoice(BuyingController):
|
|||||||
|
|
||||||
self.check_prev_docstatus()
|
self.check_prev_docstatus()
|
||||||
self.update_status_updater_args()
|
self.update_status_updater_args()
|
||||||
|
self.update_prevdoc_status()
|
||||||
|
|
||||||
frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype,
|
frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype,
|
||||||
self.company, self.base_grand_total)
|
self.company, self.base_grand_total)
|
||||||
|
|
||||||
if not self.is_return:
|
if not self.is_return:
|
||||||
self.update_against_document_in_jv()
|
self.update_against_document_in_jv()
|
||||||
self.update_prevdoc_status()
|
|
||||||
self.update_billing_status_for_zero_amount_refdoc("Purchase Order")
|
self.update_billing_status_for_zero_amount_refdoc("Purchase Order")
|
||||||
self.update_billing_status_in_pr()
|
self.update_billing_status_in_pr()
|
||||||
|
|
||||||
@ -763,9 +765,9 @@ class PurchaseInvoice(BuyingController):
|
|||||||
self.check_on_hold_or_closed_status()
|
self.check_on_hold_or_closed_status()
|
||||||
|
|
||||||
self.update_status_updater_args()
|
self.update_status_updater_args()
|
||||||
|
self.update_prevdoc_status()
|
||||||
|
|
||||||
if not self.is_return:
|
if not self.is_return:
|
||||||
self.update_prevdoc_status()
|
|
||||||
self.update_billing_status_for_zero_amount_refdoc("Purchase Order")
|
self.update_billing_status_for_zero_amount_refdoc("Purchase Order")
|
||||||
self.update_billing_status_in_pr()
|
self.update_billing_status_in_pr()
|
||||||
|
|
||||||
|
@ -402,9 +402,9 @@ class TestPurchaseInvoice(unittest.TestCase):
|
|||||||
|
|
||||||
pi.save()
|
pi.save()
|
||||||
pi.submit()
|
pi.submit()
|
||||||
self.assertEqual(pi.payment_schedule[0].payment_amount, 756.15)
|
self.assertEqual(pi.payment_schedule[0].payment_amount, 606.15)
|
||||||
self.assertEqual(pi.payment_schedule[0].due_date, pi.posting_date)
|
self.assertEqual(pi.payment_schedule[0].due_date, pi.posting_date)
|
||||||
self.assertEqual(pi.payment_schedule[1].payment_amount, 756.15)
|
self.assertEqual(pi.payment_schedule[1].payment_amount, 606.15)
|
||||||
self.assertEqual(pi.payment_schedule[1].due_date, add_days(pi.posting_date, 30))
|
self.assertEqual(pi.payment_schedule[1].due_date, add_days(pi.posting_date, 30))
|
||||||
|
|
||||||
pi.load_from_db()
|
pi.load_from_db()
|
||||||
|
@ -254,7 +254,7 @@ class SalesInvoice(SellingController):
|
|||||||
|
|
||||||
def update_status_updater_args(self):
|
def update_status_updater_args(self):
|
||||||
if cint(self.update_stock):
|
if cint(self.update_stock):
|
||||||
self.status_updater.extend([{
|
self.status_updater.append({
|
||||||
'source_dt':'Sales Invoice Item',
|
'source_dt':'Sales Invoice Item',
|
||||||
'target_dt':'Sales Order Item',
|
'target_dt':'Sales Order Item',
|
||||||
'target_parent_dt':'Sales Order',
|
'target_parent_dt':'Sales Order',
|
||||||
@ -272,21 +272,20 @@ class SalesInvoice(SellingController):
|
|||||||
'overflow_type': 'delivery',
|
'overflow_type': 'delivery',
|
||||||
'extra_cond': """ and exists(select name from `tabSales Invoice`
|
'extra_cond': """ and exists(select name from `tabSales Invoice`
|
||||||
where name=`tabSales Invoice Item`.parent and update_stock = 1)"""
|
where name=`tabSales Invoice Item`.parent and update_stock = 1)"""
|
||||||
},
|
})
|
||||||
{
|
if cint(self.is_return):
|
||||||
|
self.status_updater.append({
|
||||||
'source_dt': 'Sales Invoice Item',
|
'source_dt': 'Sales Invoice Item',
|
||||||
'target_dt': 'Sales Order Item',
|
'target_dt': 'Sales Order Item',
|
||||||
'join_field': 'so_detail',
|
'join_field': 'so_detail',
|
||||||
'target_field': 'returned_qty',
|
'target_field': 'returned_qty',
|
||||||
'target_parent_dt': 'Sales Order',
|
'target_parent_dt': 'Sales Order',
|
||||||
# 'target_parent_field': 'per_delivered',
|
|
||||||
# 'target_ref_field': 'qty',
|
|
||||||
'source_field': '-1 * qty',
|
'source_field': '-1 * qty',
|
||||||
# 'percent_join_field': 'sales_order',
|
'second_source_dt': 'Delivery Note Item',
|
||||||
# 'overflow_type': 'delivery',
|
'second_source_field': '-1 * qty',
|
||||||
|
'second_join_field': 'so_detail',
|
||||||
'extra_cond': """ and exists (select name from `tabSales Invoice` where name=`tabSales Invoice Item`.parent and update_stock=1 and is_return=1)"""
|
'extra_cond': """ and exists (select name from `tabSales Invoice` where name=`tabSales Invoice Item`.parent and update_stock=1 and is_return=1)"""
|
||||||
}
|
})
|
||||||
])
|
|
||||||
|
|
||||||
def check_credit_limit(self):
|
def check_credit_limit(self):
|
||||||
from erpnext.selling.doctype.customer.customer import check_credit_limit
|
from erpnext.selling.doctype.customer.customer import check_credit_limit
|
||||||
@ -502,11 +501,14 @@ class SalesInvoice(SellingController):
|
|||||||
|
|
||||||
def so_dn_required(self):
|
def so_dn_required(self):
|
||||||
"""check in manage account if sales order / delivery note required or not."""
|
"""check in manage account if sales order / delivery note required or not."""
|
||||||
|
if self.is_return:
|
||||||
|
return
|
||||||
dic = {'Sales Order':['so_required', 'is_pos'],'Delivery Note':['dn_required', 'update_stock']}
|
dic = {'Sales Order':['so_required', 'is_pos'],'Delivery Note':['dn_required', 'update_stock']}
|
||||||
for i in dic:
|
for i in dic:
|
||||||
if frappe.db.get_single_value('Selling Settings', dic[i][0]) == 'Yes':
|
if frappe.db.get_single_value('Selling Settings', dic[i][0]) == 'Yes':
|
||||||
for d in self.get('items'):
|
for d in self.get('items'):
|
||||||
if frappe.get_cached_value('Item', d.item_code, 'is_stock_item') == 1 \
|
is_stock_item = frappe.get_cached_value('Item', d.item_code, 'is_stock_item')
|
||||||
|
if d.item_code and is_stock_item == 1\
|
||||||
and not d.get(i.lower().replace(' ','_')) and not self.get(dic[i][1]):
|
and not d.get(i.lower().replace(' ','_')) and not self.get(dic[i][1]):
|
||||||
msgprint(_("{0} is mandatory for Item {1}").format(i,d.item_code), raise_exception=1)
|
msgprint(_("{0} is mandatory for Item {1}").format(i,d.item_code), raise_exception=1)
|
||||||
|
|
||||||
@ -1166,6 +1168,9 @@ class SalesInvoice(SellingController):
|
|||||||
self.set_missing_values(for_validate = True)
|
self.set_missing_values(for_validate = True)
|
||||||
|
|
||||||
def validate_inter_company_party(doctype, party, company, inter_company_reference):
|
def validate_inter_company_party(doctype, party, company, inter_company_reference):
|
||||||
|
if not party:
|
||||||
|
return
|
||||||
|
|
||||||
if doctype in ["Sales Invoice", "Sales Order"]:
|
if doctype in ["Sales Invoice", "Sales Order"]:
|
||||||
partytype, ref_partytype, internal = "Customer", "Supplier", "is_internal_customer"
|
partytype, ref_partytype, internal = "Customer", "Supplier", "is_internal_customer"
|
||||||
|
|
||||||
|
@ -463,8 +463,8 @@ def get_timeline_data(doctype, name):
|
|||||||
after = add_years(None, -1).strftime('%Y-%m-%d')
|
after = add_years(None, -1).strftime('%Y-%m-%d')
|
||||||
group_by='group by date(creation)'
|
group_by='group by date(creation)'
|
||||||
|
|
||||||
data = get_communication_data(doctype, name,
|
data = get_communication_data(doctype, name, after=after, group_by='group by date(creation)',
|
||||||
fields=fields, after=after, group_by=group_by, as_dict=False)
|
fields='date(C.creation) as creation, count(C.name)',as_dict=False)
|
||||||
|
|
||||||
# fetch and append data from Activity Log
|
# fetch and append data from Activity Log
|
||||||
data += frappe.db.sql("""select {fields}
|
data += frappe.db.sql("""select {fields}
|
||||||
|
@ -44,6 +44,13 @@ frappe.query_reports["Accounts Payable"] = {
|
|||||||
"default": "90",
|
"default": "90",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname":"range4",
|
||||||
|
"label": __("Ageing Range 4"),
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"default": "120",
|
||||||
|
"reqd": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"finance_book",
|
"fieldname":"finance_book",
|
||||||
"label": __("Finance Book"),
|
"label": __("Finance Book"),
|
||||||
|
@ -44,6 +44,13 @@ frappe.query_reports["Accounts Payable Summary"] = {
|
|||||||
"default": "90",
|
"default": "90",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname":"range4",
|
||||||
|
"label": __("Ageing Range 4"),
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"default": "120",
|
||||||
|
"reqd": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"finance_book",
|
"fieldname":"finance_book",
|
||||||
"label": __("Finance Book"),
|
"label": __("Finance Book"),
|
||||||
|
@ -111,10 +111,10 @@
|
|||||||
<th style="width: 4%">{%= __("Age (Days)") %}</th>
|
<th style="width: 4%">{%= __("Age (Days)") %}</th>
|
||||||
|
|
||||||
{% if(report.report_name === "Accounts Receivable" && filters.show_sales_person_in_print) { %}
|
{% if(report.report_name === "Accounts Receivable" && filters.show_sales_person_in_print) { %}
|
||||||
<th style="width: 16%">{%= __("Reference") %}</th>
|
<th style="width: 14%">{%= __("Reference") %}</th>
|
||||||
<th style="width: 10%">{%= __("Sales Person") %}</th>
|
<th style="width: 10%">{%= __("Sales Person") %}</th>
|
||||||
{% } else { %}
|
{% } else { %}
|
||||||
<th style="width: 26%">{%= __("Reference") %}</th>
|
<th style="width: 24%">{%= __("Reference") %}</th>
|
||||||
{% } %}
|
{% } %}
|
||||||
{% if(!filters.show_pdc_in_print) { %}
|
{% if(!filters.show_pdc_in_print) { %}
|
||||||
<th style="width: 20%">{%= (filters.customer || filters.supplier) ? __("Remarks"): __("Party") %}</th>
|
<th style="width: 20%">{%= (filters.customer || filters.supplier) ? __("Remarks"): __("Party") %}</th>
|
||||||
@ -127,7 +127,7 @@
|
|||||||
<th style="width: 10%; text-align: right">{%= __("Outstanding Amount") %}</th>
|
<th style="width: 10%; text-align: right">{%= __("Outstanding Amount") %}</th>
|
||||||
{% if(filters.show_pdc_in_print) { %}
|
{% if(filters.show_pdc_in_print) { %}
|
||||||
{% if(report.report_name === "Accounts Receivable") { %}
|
{% if(report.report_name === "Accounts Receivable") { %}
|
||||||
<th style="width: 10%">{%= __("Customer LPO No.") %}</th>
|
<th style="width: 12%">{%= __("Customer LPO No.") %}</th>
|
||||||
{% } %}
|
{% } %}
|
||||||
<th style="width: 10%">{%= __("PDC/LC Ref") %}</th>
|
<th style="width: 10%">{%= __("PDC/LC Ref") %}</th>
|
||||||
<th style="width: 10%">{%= __("PDC/LC Amount") %}</th>
|
<th style="width: 10%">{%= __("PDC/LC Amount") %}</th>
|
||||||
|
@ -44,6 +44,13 @@ frappe.query_reports["Accounts Receivable"] = {
|
|||||||
"default": "90",
|
"default": "90",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname":"range4",
|
||||||
|
"label": __("Ageing Range 4"),
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"default": "120",
|
||||||
|
"reqd": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"finance_book",
|
"fieldname":"finance_book",
|
||||||
"label": __("Finance Book"),
|
"label": __("Finance Book"),
|
||||||
|
@ -100,11 +100,14 @@ class ReceivablePayableReport(object):
|
|||||||
self.filters["range2"] = "60"
|
self.filters["range2"] = "60"
|
||||||
if not "range3" in self.filters:
|
if not "range3" in self.filters:
|
||||||
self.filters["range3"] = "90"
|
self.filters["range3"] = "90"
|
||||||
|
if not "range4" in self.filters:
|
||||||
|
self.filters["range4"] = "120"
|
||||||
|
|
||||||
for label in ("0-{range1}".format(range1=self.filters["range1"]),
|
for label in ("0-{range1}".format(range1=self.filters["range1"]),
|
||||||
"{range1}-{range2}".format(range1=cint(self.filters["range1"])+ 1, range2=self.filters["range2"]),
|
"{range1}-{range2}".format(range1=cint(self.filters["range1"])+ 1, range2=self.filters["range2"]),
|
||||||
"{range2}-{range3}".format(range2=cint(self.filters["range2"])+ 1, range3=self.filters["range3"]),
|
"{range2}-{range3}".format(range2=cint(self.filters["range2"])+ 1, range3=self.filters["range3"]),
|
||||||
"{range3}-{above}".format(range3=cint(self.filters["range3"])+ 1, above=_("Above"))):
|
"{range3}-{range4}".format(range3=cint(self.filters["range3"])+ 1, range4=self.filters["range4"]),
|
||||||
|
"{range4}-{above}".format(range4=cint(self.filters["range4"])+ 1, above=_("Above"))):
|
||||||
columns.append({
|
columns.append({
|
||||||
"label": label,
|
"label": label,
|
||||||
"fieldname":label,
|
"fieldname":label,
|
||||||
@ -329,18 +332,17 @@ class ReceivablePayableReport(object):
|
|||||||
entry_date = gle.posting_date
|
entry_date = gle.posting_date
|
||||||
|
|
||||||
row += get_ageing_data(cint(self.filters.range1), cint(self.filters.range2),
|
row += get_ageing_data(cint(self.filters.range1), cint(self.filters.range2),
|
||||||
cint(self.filters.range3), self.age_as_on, entry_date, outstanding_amount)
|
cint(self.filters.range3), cint(self.filters.range4), self.age_as_on, entry_date, outstanding_amount)
|
||||||
|
|
||||||
|
|
||||||
# issue 6371-Ageing buckets should not have amounts if due date is not reached
|
# issue 6371-Ageing buckets should not have amounts if due date is not reached
|
||||||
if self.filters.ageing_based_on == "Due Date" \
|
if self.filters.ageing_based_on == "Due Date" \
|
||||||
and getdate(due_date) > getdate(self.filters.report_date):
|
and getdate(due_date) > getdate(self.filters.report_date):
|
||||||
row[-1]=row[-2]=row[-3]=row[-4]=0
|
row[-1]=row[-2]=row[-3]=row[-4]=row[-5]=0
|
||||||
|
|
||||||
if self.filters.ageing_based_on == "Supplier Invoice Date" \
|
if self.filters.ageing_based_on == "Supplier Invoice Date" \
|
||||||
and getdate(bill_date) > getdate(self.filters.report_date):
|
and getdate(bill_date) > getdate(self.filters.report_date):
|
||||||
|
|
||||||
row[-1]=row[-2]=row[-3]=row[-4]=0
|
row[-1]=row[-2]=row[-3]=row[-4]=row[-5]=0
|
||||||
|
|
||||||
if self.filters.get(scrub(args.get("party_type"))):
|
if self.filters.get(scrub(args.get("party_type"))):
|
||||||
row.append(gle.account_currency)
|
row.append(gle.account_currency)
|
||||||
@ -586,13 +588,13 @@ class ReceivablePayableReport(object):
|
|||||||
return payment_term_map
|
return payment_term_map
|
||||||
|
|
||||||
def get_chart_data(self, columns, data):
|
def get_chart_data(self, columns, data):
|
||||||
ageing_columns = columns[self.ageing_col_idx_start : self.ageing_col_idx_start+4]
|
ageing_columns = columns[self.ageing_col_idx_start : self.ageing_col_idx_start+5]
|
||||||
|
|
||||||
rows = []
|
rows = []
|
||||||
for d in data:
|
for d in data:
|
||||||
rows.append(
|
rows.append(
|
||||||
{
|
{
|
||||||
'values': d[self.ageing_col_idx_start : self.ageing_col_idx_start+4]
|
'values': d[self.ageing_col_idx_start : self.ageing_col_idx_start+5]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -611,21 +613,22 @@ def execute(filters=None):
|
|||||||
}
|
}
|
||||||
return ReceivablePayableReport(filters).run(args)
|
return ReceivablePayableReport(filters).run(args)
|
||||||
|
|
||||||
def get_ageing_data(first_range, second_range, third_range, age_as_on, entry_date, outstanding_amount):
|
def get_ageing_data(first_range, second_range, third_range,
|
||||||
# [0-30, 30-60, 60-90, 90-above]
|
fourth_range, age_as_on, entry_date, outstanding_amount):
|
||||||
outstanding_range = [0.0, 0.0, 0.0, 0.0]
|
# [0-30, 30-60, 60-90, 90-120, 120-above]
|
||||||
|
outstanding_range = [0.0, 0.0, 0.0, 0.0, 0.0]
|
||||||
|
|
||||||
if not (age_as_on and entry_date):
|
if not (age_as_on and entry_date):
|
||||||
return [0] + outstanding_range
|
return [0] + outstanding_range
|
||||||
|
|
||||||
age = (getdate(age_as_on) - getdate(entry_date)).days or 0
|
age = (getdate(age_as_on) - getdate(entry_date)).days or 0
|
||||||
index = None
|
index = None
|
||||||
for i, days in enumerate([first_range, second_range, third_range]):
|
for i, days in enumerate([first_range, second_range, third_range, fourth_range]):
|
||||||
if age <= days:
|
if age <= days:
|
||||||
index = i
|
index = i
|
||||||
break
|
break
|
||||||
|
|
||||||
if index is None: index = 3
|
if index is None: index = 4
|
||||||
outstanding_range[index] = outstanding_amount
|
outstanding_range[index] = outstanding_amount
|
||||||
|
|
||||||
return [age] + outstanding_range
|
return [age] + outstanding_range
|
||||||
|
@ -44,6 +44,13 @@ frappe.query_reports["Accounts Receivable Summary"] = {
|
|||||||
"default": "90",
|
"default": "90",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname":"range4",
|
||||||
|
"label": __("Ageing Range 4"),
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"default": "120",
|
||||||
|
"reqd": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"finance_book",
|
"fieldname":"finance_book",
|
||||||
"label": __("Finance Book"),
|
"label": __("Finance Book"),
|
||||||
|
@ -82,8 +82,15 @@ class AccountsReceivableSummary(ReceivablePayableReport):
|
|||||||
"width": 160
|
"width": 160
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": _(str(self.filters.range3) + _("-Above")),
|
"label": _(str(self.filters.range3) + "-" + str(self.filters.range4)),
|
||||||
"fieldname": scrub(str(self.filters.range3) + _("-Above")),
|
"fieldname": scrub(str(self.filters.range3) + "-" + str(self.filters.range4)),
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"options": "currency",
|
||||||
|
"width": 160
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _(str(self.filters.range4) + _("-Above")),
|
||||||
|
"fieldname": scrub(str(self.filters.range4) + _("-Above")),
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"options": "currency",
|
"options": "currency",
|
||||||
"width": 160
|
"width": 160
|
||||||
@ -152,7 +159,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
|
|||||||
|
|
||||||
row += [
|
row += [
|
||||||
party_dict.invoiced_amt, paid_amt, party_dict.credit_amt, party_dict.outstanding_amt,
|
party_dict.invoiced_amt, paid_amt, party_dict.credit_amt, party_dict.outstanding_amt,
|
||||||
party_dict.range1, party_dict.range2, party_dict.range3, party_dict.range4,
|
party_dict.range1, party_dict.range2, party_dict.range3, party_dict.range4, party_dict.range5
|
||||||
]
|
]
|
||||||
|
|
||||||
if args.get("party_type") == "Customer":
|
if args.get("party_type") == "Customer":
|
||||||
@ -178,6 +185,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
|
|||||||
"range2": 0,
|
"range2": 0,
|
||||||
"range3": 0,
|
"range3": 0,
|
||||||
"range4": 0,
|
"range4": 0,
|
||||||
|
"range5": 0,
|
||||||
"sales_person": []
|
"sales_person": []
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@ -209,7 +217,7 @@ class AccountsReceivableSummary(ReceivablePayableReport):
|
|||||||
cols += ["bill_no", "bill_date"]
|
cols += ["bill_no", "bill_date"]
|
||||||
|
|
||||||
cols += ["invoiced_amt", "paid_amt", "credit_amt",
|
cols += ["invoiced_amt", "paid_amt", "credit_amt",
|
||||||
"outstanding_amt", "age", "range1", "range2", "range3", "range4", "currency", "pdc/lc_date", "pdc/lc_ref",
|
"outstanding_amt", "age", "range1", "range2", "range3", "range4", "range5", "currency", "pdc/lc_date", "pdc/lc_ref",
|
||||||
"pdc/lc_amount"]
|
"pdc/lc_amount"]
|
||||||
|
|
||||||
if args.get("party_type") == "Supplier":
|
if args.get("party_type") == "Supplier":
|
||||||
|
@ -331,8 +331,7 @@ def sort_accounts(accounts, is_root=False, key="name"):
|
|||||||
if a.root_type == "Income" and b.root_type == "Expense":
|
if a.root_type == "Income" and b.root_type == "Expense":
|
||||||
return -1
|
return -1
|
||||||
else:
|
else:
|
||||||
if re.split('\W+', a[key])[0].isdigit():
|
# sort by key (number) or name
|
||||||
# if chart of accounts is numbered, then sort by number
|
|
||||||
return cmp(a[key], b[key])
|
return cmp(a[key], b[key])
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
@ -211,6 +211,11 @@ frappe.query_reports["General Ledger"] = {
|
|||||||
"label": __("Currency"),
|
"label": __("Currency"),
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"options": erpnext.get_presentation_currency_list()
|
"options": erpnext.get_presentation_currency_list()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "show_opening_entries",
|
||||||
|
"label": __("Show Opening Entries"),
|
||||||
|
"fieldtype": "Check"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -283,7 +283,8 @@ def get_accountwise_gle(filters, gl_entries, gle_map):
|
|||||||
|
|
||||||
from_date, to_date = getdate(filters.from_date), getdate(filters.to_date)
|
from_date, to_date = getdate(filters.from_date), getdate(filters.to_date)
|
||||||
for gle in gl_entries:
|
for gle in gl_entries:
|
||||||
if gle.posting_date < from_date or cstr(gle.is_opening) == "Yes":
|
if (gle.posting_date < from_date or
|
||||||
|
(cstr(gle.is_opening) == "Yes" and not filters.get("show_opening_entries"))):
|
||||||
update_value_in_dict(gle_map[gle.get(group_by)].totals, 'opening', gle)
|
update_value_in_dict(gle_map[gle.get(group_by)].totals, 'opening', gle)
|
||||||
update_value_in_dict(totals, 'opening', gle)
|
update_value_in_dict(totals, 'opening', gle)
|
||||||
|
|
||||||
|
@ -23,6 +23,12 @@ frappe.query_reports["Gross Profit"] = {
|
|||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"default": frappe.defaults.get_user_default("year_end_date")
|
"default": frappe.defaults.get_user_default("year_end_date")
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname":"sales_invoice",
|
||||||
|
"label": __("Sales Invoice"),
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": "Sales Invoice"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname":"group_by",
|
"fieldname":"group_by",
|
||||||
"label": __("Group By"),
|
"label": __("Group By"),
|
||||||
|
@ -302,6 +302,12 @@ class GrossProfitGenerator(object):
|
|||||||
sales_person_cols = ""
|
sales_person_cols = ""
|
||||||
sales_team_table = ""
|
sales_team_table = ""
|
||||||
|
|
||||||
|
if self.filters.get("sales_invoice"):
|
||||||
|
conditions += " and `tabSales Invoice`.name = %(sales_invoice)s"
|
||||||
|
|
||||||
|
if self.filters.get("item_code"):
|
||||||
|
conditions += " and `tabSales Invoice Item`.item_code = %(item_code)s"
|
||||||
|
|
||||||
self.si_list = frappe.db.sql("""
|
self.si_list = frappe.db.sql("""
|
||||||
select
|
select
|
||||||
`tabSales Invoice Item`.parenttype, `tabSales Invoice Item`.parent,
|
`tabSales Invoice Item`.parenttype, `tabSales Invoice Item`.parent,
|
||||||
|
@ -4,6 +4,13 @@
|
|||||||
|
|
||||||
frappe.query_reports["Inactive Sales Items"] = {
|
frappe.query_reports["Inactive Sales Items"] = {
|
||||||
"filters": [
|
"filters": [
|
||||||
|
{
|
||||||
|
fieldname: "territory",
|
||||||
|
label: __("Territory"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Territory",
|
||||||
|
reqd: 1,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
fieldname: "item",
|
fieldname: "item",
|
||||||
label: __("Item"),
|
label: __("Item"),
|
||||||
|
@ -7,13 +7,11 @@ from frappe.utils import getdate, add_days, today, cint
|
|||||||
from frappe import _
|
from frappe import _
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
|
|
||||||
columns = get_columns()
|
columns = get_columns()
|
||||||
data = get_data(filters)
|
data = get_data(filters)
|
||||||
return columns, data
|
return columns, data
|
||||||
|
|
||||||
def get_columns():
|
def get_columns():
|
||||||
|
|
||||||
columns = [
|
columns = [
|
||||||
{
|
{
|
||||||
"fieldname": "territory",
|
"fieldname": "territory",
|
||||||
@ -30,7 +28,7 @@ def get_columns():
|
|||||||
"width": 150
|
"width": 150
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "item_name",
|
"fieldname": "item",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"options": "Item",
|
"options": "Item",
|
||||||
"label": "Item",
|
"label": "Item",
|
||||||
@ -74,59 +72,68 @@ def get_columns():
|
|||||||
|
|
||||||
|
|
||||||
def get_data(filters):
|
def get_data(filters):
|
||||||
|
|
||||||
data = []
|
data = []
|
||||||
items = get_items(filters)
|
items = get_items(filters)
|
||||||
|
territories = get_territories(filters)
|
||||||
sales_invoice_data = get_sales_details(filters)
|
sales_invoice_data = get_sales_details(filters)
|
||||||
|
|
||||||
|
for territory in territories:
|
||||||
for item in items:
|
for item in items:
|
||||||
if sales_invoice_data.get(item.name):
|
|
||||||
item_obj = sales_invoice_data[item.name]
|
|
||||||
if item_obj.days_since_last_order > cint(filters['days']):
|
|
||||||
row = {
|
row = {
|
||||||
|
"territory": territory.name,
|
||||||
|
"item_group": item.item_group,
|
||||||
|
"item": item.item_code,
|
||||||
|
"item_name": item.item_name
|
||||||
|
}
|
||||||
|
|
||||||
|
if sales_invoice_data.get((territory.name,item.item_code)):
|
||||||
|
item_obj = sales_invoice_data[(territory.name,item.item_code)]
|
||||||
|
if item_obj.days_since_last_order > cint(filters['days']):
|
||||||
|
row.update({
|
||||||
"territory": item_obj.territory,
|
"territory": item_obj.territory,
|
||||||
"item_group": item_obj.item_group,
|
|
||||||
"item": item_obj.name,
|
|
||||||
"item_name": item_obj.item_name,
|
|
||||||
"customer": item_obj.customer,
|
"customer": item_obj.customer,
|
||||||
"last_order_date": item_obj.last_order_date,
|
"last_order_date": item_obj.last_order_date,
|
||||||
"qty": item_obj.qty,
|
"qty": item_obj.qty,
|
||||||
"days_since_last_order": item_obj.days_since_last_order
|
"days_since_last_order": item_obj.days_since_last_order
|
||||||
}
|
})
|
||||||
data.append(row)
|
|
||||||
else:
|
else:
|
||||||
row = {
|
continue
|
||||||
"item_group": item.item_group,
|
|
||||||
"item": item.name,
|
|
||||||
"item_name": item.item_name
|
|
||||||
}
|
|
||||||
data.append(row)
|
data.append(row)
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
def get_sales_details(filters):
|
def get_sales_details(filters):
|
||||||
|
|
||||||
data = []
|
data = []
|
||||||
item_details_map = {}
|
item_details_map = {}
|
||||||
|
|
||||||
date_field = "s.transaction_date" if filters["based_on"] == "Sales Order" else "s.posting_date"
|
date_field = "s.transaction_date" if filters["based_on"] == "Sales Order" else "s.posting_date"
|
||||||
|
|
||||||
sales_data = frappe.db.sql("""
|
sales_data = frappe.db.sql("""
|
||||||
select s.territory, s.customer, si.item_group, si.item_name, si.qty, {date_field} as last_order_date,
|
select s.territory, s.customer, si.item_group, si.item_code, si.qty, {date_field} as last_order_date,
|
||||||
DATEDIFF(CURDATE(), {date_field}) as days_since_last_order
|
DATEDIFF(CURDATE(), {date_field}) as days_since_last_order
|
||||||
from `tab{doctype}` s, `tab{doctype} Item` si
|
from `tab{doctype}` s, `tab{doctype} Item` si
|
||||||
where s.name = si.parent and s.docstatus = 1
|
where s.name = si.parent and s.docstatus = 1
|
||||||
group by si.name order by days_since_last_order """ #nosec
|
order by days_since_last_order """ #nosec
|
||||||
.format(date_field = date_field, doctype = filters['based_on']), as_dict=1)
|
.format(date_field = date_field, doctype = filters['based_on']), as_dict=1)
|
||||||
|
|
||||||
for d in sales_data:
|
for d in sales_data:
|
||||||
item_details_map.setdefault(d.item_name, d)
|
item_details_map.setdefault((d.territory,d.item_code), d)
|
||||||
|
|
||||||
return item_details_map
|
return item_details_map
|
||||||
|
|
||||||
def get_items(filters):
|
def get_territories(filters):
|
||||||
|
|
||||||
|
filter_dict = {}
|
||||||
|
if filters.get("territory"):
|
||||||
|
filter_dict.update({'name': filters['territory']})
|
||||||
|
|
||||||
|
territories = frappe.get_all("Territory", fields=["name"], filters=filter_dict)
|
||||||
|
|
||||||
|
return territories
|
||||||
|
|
||||||
|
def get_items(filters):
|
||||||
filters_dict = {
|
filters_dict = {
|
||||||
"disabled": 0,
|
"disabled": 0,
|
||||||
"is_stock_item": 1
|
"is_stock_item": 1
|
||||||
@ -142,6 +149,6 @@ def get_items(filters):
|
|||||||
"name": filters["item"]
|
"name": filters["item"]
|
||||||
})
|
})
|
||||||
|
|
||||||
items = frappe.get_all("Item", fields=["name", "item_group", "item_name"], filters=filters_dict, order_by="name")
|
items = frappe.get_all("Item", fields=["name", "item_group", "item_name", "item_code"], filters=filters_dict, order_by="name")
|
||||||
|
|
||||||
return items
|
return items
|
||||||
|
@ -135,3 +135,25 @@ def get_appropriate_company(filters):
|
|||||||
company = get_default_company()
|
company = get_default_company()
|
||||||
|
|
||||||
return company
|
return company
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def get_invoiced_item_gross_margin(sales_invoice=None, item_code=None, company=None, with_item_data=False):
|
||||||
|
from erpnext.accounts.report.gross_profit.gross_profit import GrossProfitGenerator
|
||||||
|
|
||||||
|
sales_invoice = sales_invoice or frappe.form_dict.get('sales_invoice')
|
||||||
|
item_code = item_code or frappe.form_dict.get('item_code')
|
||||||
|
company = company or frappe.get_cached_value("Sales Invoice", sales_invoice, 'company')
|
||||||
|
|
||||||
|
filters = {
|
||||||
|
'sales_invoice': sales_invoice,
|
||||||
|
'item_code': item_code,
|
||||||
|
'company': company,
|
||||||
|
'group_by': 'Invoice'
|
||||||
|
}
|
||||||
|
|
||||||
|
gross_profit_data = GrossProfitGenerator(filters)
|
||||||
|
result = gross_profit_data.grouped_data
|
||||||
|
if not with_item_data:
|
||||||
|
result = sum([d.gross_profit for d in result])
|
||||||
|
|
||||||
|
return result
|
||||||
|
@ -333,6 +333,9 @@ def reconcile_against_document(args):
|
|||||||
doc = frappe.get_doc(d.voucher_type, d.voucher_no)
|
doc = frappe.get_doc(d.voucher_type, d.voucher_no)
|
||||||
doc.make_gl_entries(cancel = 0, adv_adj =1)
|
doc.make_gl_entries(cancel = 0, adv_adj =1)
|
||||||
|
|
||||||
|
if d.voucher_type in ('Payment Entry', 'Journal Entry'):
|
||||||
|
doc.update_expense_claim()
|
||||||
|
|
||||||
def check_if_advance_entry_modified(args):
|
def check_if_advance_entry_modified(args):
|
||||||
"""
|
"""
|
||||||
check if there is already a voucher reference
|
check if there is already a voucher reference
|
||||||
@ -377,7 +380,7 @@ def validate_allocated_amount(args):
|
|||||||
if args.get("allocated_amount") < 0:
|
if args.get("allocated_amount") < 0:
|
||||||
throw(_("Allocated amount cannot be negative"))
|
throw(_("Allocated amount cannot be negative"))
|
||||||
elif args.get("allocated_amount") > args.get("unadjusted_amount"):
|
elif args.get("allocated_amount") > args.get("unadjusted_amount"):
|
||||||
throw(_("Allocated amount can not greater than unadjusted amount"))
|
throw(_("Allocated amount cannot be greater than unadjusted amount"))
|
||||||
|
|
||||||
def update_reference_in_journal_entry(d, jv_obj):
|
def update_reference_in_journal_entry(d, jv_obj):
|
||||||
"""
|
"""
|
||||||
|
@ -369,7 +369,9 @@ def make_purchase_receipt(source_name, target_doc=None):
|
|||||||
"field_map": {
|
"field_map": {
|
||||||
"name": "purchase_order_item",
|
"name": "purchase_order_item",
|
||||||
"parent": "purchase_order",
|
"parent": "purchase_order",
|
||||||
"bom": "bom"
|
"bom": "bom",
|
||||||
|
"material_request": "material_request",
|
||||||
|
"material_request_item": "material_request_item"
|
||||||
},
|
},
|
||||||
"postprocess": update_item,
|
"postprocess": update_item,
|
||||||
"condition": lambda doc: abs(doc.received_qty) < abs(doc.qty) and doc.delivered_by_supplier!=1
|
"condition": lambda doc: abs(doc.received_qty) < abs(doc.qty) and doc.delivered_by_supplier!=1
|
||||||
@ -403,7 +405,7 @@ def make_purchase_invoice(source_name, target_doc=None):
|
|||||||
or item.get("buying_cost_center")
|
or item.get("buying_cost_center")
|
||||||
or item_group.get("buying_cost_center"))
|
or item_group.get("buying_cost_center"))
|
||||||
|
|
||||||
doc = get_mapped_doc("Purchase Order", source_name, {
|
fields = {
|
||||||
"Purchase Order": {
|
"Purchase Order": {
|
||||||
"doctype": "Purchase Invoice",
|
"doctype": "Purchase Invoice",
|
||||||
"field_map": {
|
"field_map": {
|
||||||
@ -426,8 +428,16 @@ def make_purchase_invoice(source_name, target_doc=None):
|
|||||||
"Purchase Taxes and Charges": {
|
"Purchase Taxes and Charges": {
|
||||||
"doctype": "Purchase Taxes and Charges",
|
"doctype": "Purchase Taxes and Charges",
|
||||||
"add_if_empty": True
|
"add_if_empty": True
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}, target_doc, postprocess)
|
|
||||||
|
if frappe.get_single("Accounts Settings").automatically_fetch_payment_terms == 1:
|
||||||
|
fields["Payment Schedule"] = {
|
||||||
|
"doctype": "Payment Schedule",
|
||||||
|
"add_if_empty": True
|
||||||
|
}
|
||||||
|
|
||||||
|
doc = get_mapped_doc("Purchase Order", source_name, fields, target_doc, postprocess)
|
||||||
|
|
||||||
return doc
|
return doc
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import unittest
|
|||||||
import frappe
|
import frappe
|
||||||
import frappe.defaults
|
import frappe.defaults
|
||||||
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
|
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
|
||||||
from frappe.utils import flt, add_days, nowdate
|
from frappe.utils import flt, add_days, nowdate, getdate
|
||||||
from erpnext.stock.doctype.item.test_item import make_item
|
from erpnext.stock.doctype.item.test_item import make_item
|
||||||
from erpnext.buying.doctype.purchase_order.purchase_order import (make_purchase_receipt, make_purchase_invoice, make_rm_stock_entry as make_subcontract_transfer_entry)
|
from erpnext.buying.doctype.purchase_order.purchase_order import (make_purchase_receipt, make_purchase_invoice, make_rm_stock_entry as make_subcontract_transfer_entry)
|
||||||
from erpnext.stock.doctype.material_request.test_material_request import make_material_request
|
from erpnext.stock.doctype.material_request.test_material_request import make_material_request
|
||||||
@ -108,6 +108,69 @@ class TestPurchaseOrder(unittest.TestCase):
|
|||||||
self.assertEqual(po.get("items")[0].amount, 1400)
|
self.assertEqual(po.get("items")[0].amount, 1400)
|
||||||
self.assertEqual(get_ordered_qty(), existing_ordered_qty + 3)
|
self.assertEqual(get_ordered_qty(), existing_ordered_qty + 3)
|
||||||
|
|
||||||
|
def test_update_qty(self):
|
||||||
|
po = create_purchase_order()
|
||||||
|
|
||||||
|
make_pr_against_po(po.name, 6)
|
||||||
|
|
||||||
|
po.load_from_db()
|
||||||
|
self.assertEqual(po.get("items")[0].received_qty, 6)
|
||||||
|
|
||||||
|
# Check received_qty after make_purchase_invoice without update_stock checked
|
||||||
|
pi1 = make_purchase_invoice(po.name)
|
||||||
|
pi1.get("items")[0].qty = 6
|
||||||
|
pi1.insert()
|
||||||
|
pi1.submit()
|
||||||
|
|
||||||
|
po.load_from_db()
|
||||||
|
self.assertEqual(po.get("items")[0].received_qty, 6)
|
||||||
|
|
||||||
|
# Check received_qty after make_purchase_invoice with update_stock checked
|
||||||
|
pi2 = make_purchase_invoice(po.name)
|
||||||
|
pi2.set("update_stock", 1)
|
||||||
|
pi2.get("items")[0].qty = 3
|
||||||
|
pi2.insert()
|
||||||
|
pi2.submit()
|
||||||
|
|
||||||
|
po.load_from_db()
|
||||||
|
self.assertEqual(po.get("items")[0].received_qty, 9)
|
||||||
|
|
||||||
|
def test_return_against_purchase_order(self):
|
||||||
|
po = create_purchase_order()
|
||||||
|
|
||||||
|
pr = make_pr_against_po(po.name, 6)
|
||||||
|
|
||||||
|
po.load_from_db()
|
||||||
|
self.assertEqual(po.get("items")[0].received_qty, 6)
|
||||||
|
|
||||||
|
pi2 = make_purchase_invoice(po.name)
|
||||||
|
pi2.set("update_stock", 1)
|
||||||
|
pi2.get("items")[0].qty = 3
|
||||||
|
pi2.insert()
|
||||||
|
pi2.submit()
|
||||||
|
|
||||||
|
po.load_from_db()
|
||||||
|
self.assertEqual(po.get("items")[0].received_qty, 9)
|
||||||
|
|
||||||
|
# Make return purchase receipt, purchase invoice and check quantity
|
||||||
|
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt \
|
||||||
|
import make_purchase_receipt as make_purchase_receipt_return
|
||||||
|
from erpnext.accounts.doctype.purchase_invoice.test_purchase_invoice \
|
||||||
|
import make_purchase_invoice as make_purchase_invoice_return
|
||||||
|
|
||||||
|
pr1 = make_purchase_receipt_return(is_return=1, return_against=pr.name, qty=-3, do_not_submit=True)
|
||||||
|
pr1.items[0].purchase_order = po.name
|
||||||
|
pr1.items[0].purchase_order_item = po.items[0].name
|
||||||
|
pr1.submit()
|
||||||
|
|
||||||
|
pi1= make_purchase_invoice_return(is_return=1, return_against=pi2.name, qty=-1, update_stock=1, do_not_submit=True)
|
||||||
|
pi1.items[0].purchase_order = po.name
|
||||||
|
pi1.items[0].po_detail = po.items[0].name
|
||||||
|
pi1.submit()
|
||||||
|
|
||||||
|
|
||||||
|
po.load_from_db()
|
||||||
|
self.assertEqual(po.get("items")[0].received_qty, 5)
|
||||||
|
|
||||||
def test_make_purchase_invoice(self):
|
def test_make_purchase_invoice(self):
|
||||||
po = create_purchase_order(do_not_submit=True)
|
po = create_purchase_order(do_not_submit=True)
|
||||||
@ -142,9 +205,9 @@ class TestPurchaseOrder(unittest.TestCase):
|
|||||||
po.submit()
|
po.submit()
|
||||||
|
|
||||||
self.assertEqual(po.payment_schedule[0].payment_amount, 2500.0)
|
self.assertEqual(po.payment_schedule[0].payment_amount, 2500.0)
|
||||||
self.assertEqual(po.payment_schedule[0].due_date, po.transaction_date)
|
self.assertEqual(getdate(po.payment_schedule[0].due_date), getdate(po.transaction_date))
|
||||||
self.assertEqual(po.payment_schedule[1].payment_amount, 2500.0)
|
self.assertEqual(po.payment_schedule[1].payment_amount, 2500.0)
|
||||||
self.assertEqual(po.payment_schedule[1].due_date, add_days(po.transaction_date, 30))
|
self.assertEqual(getdate(po.payment_schedule[1].due_date), add_days(getdate(po.transaction_date), 30))
|
||||||
pi = make_purchase_invoice(po.name)
|
pi = make_purchase_invoice(po.name)
|
||||||
pi.save()
|
pi.save()
|
||||||
|
|
||||||
@ -152,9 +215,9 @@ class TestPurchaseOrder(unittest.TestCase):
|
|||||||
self.assertEqual(len(pi.get("items", [])), 1)
|
self.assertEqual(len(pi.get("items", [])), 1)
|
||||||
|
|
||||||
self.assertEqual(pi.payment_schedule[0].payment_amount, 2500.0)
|
self.assertEqual(pi.payment_schedule[0].payment_amount, 2500.0)
|
||||||
self.assertEqual(pi.payment_schedule[0].due_date, po.transaction_date)
|
self.assertEqual(getdate(pi.payment_schedule[0].due_date), getdate(po.transaction_date))
|
||||||
self.assertEqual(pi.payment_schedule[1].payment_amount, 2500.0)
|
self.assertEqual(pi.payment_schedule[1].payment_amount, 2500.0)
|
||||||
self.assertEqual(pi.payment_schedule[1].due_date, add_days(po.transaction_date, 30))
|
self.assertEqual(getdate(pi.payment_schedule[1].due_date), add_days(getdate(po.transaction_date), 30))
|
||||||
|
|
||||||
def test_subcontracting(self):
|
def test_subcontracting(self):
|
||||||
po = create_purchase_order(item_code="_Test FG Item", is_subcontracted="Yes")
|
po = create_purchase_order(item_code="_Test FG Item", is_subcontracted="Yes")
|
||||||
@ -303,6 +366,10 @@ class TestPurchaseOrder(unittest.TestCase):
|
|||||||
make_stock_entry(target="_Test Warehouse - _TC", qty=10, basic_rate=100)
|
make_stock_entry(target="_Test Warehouse - _TC", qty=10, basic_rate=100)
|
||||||
make_stock_entry(target="_Test Warehouse - _TC", item_code="_Test Item Home Desktop 100",
|
make_stock_entry(target="_Test Warehouse - _TC", item_code="_Test Item Home Desktop 100",
|
||||||
qty=20, basic_rate=100)
|
qty=20, basic_rate=100)
|
||||||
|
make_stock_entry(target="_Test Warehouse 1 - _TC", item_code="_Test Item",
|
||||||
|
qty=30, basic_rate=100)
|
||||||
|
make_stock_entry(target="_Test Warehouse 1 - _TC", item_code="_Test Item Home Desktop 100",
|
||||||
|
qty=30, basic_rate=100)
|
||||||
|
|
||||||
bin1 = frappe.db.get_value("Bin",
|
bin1 = frappe.db.get_value("Bin",
|
||||||
filters={"warehouse": "_Test Warehouse - _TC", "item_code": "_Test Item"},
|
filters={"warehouse": "_Test Warehouse - _TC", "item_code": "_Test Item"},
|
||||||
@ -349,6 +416,11 @@ class TestPurchaseOrder(unittest.TestCase):
|
|||||||
|
|
||||||
self.assertEquals(bin5.reserved_qty_for_sub_contract, bin2.reserved_qty_for_sub_contract - 6)
|
self.assertEquals(bin5.reserved_qty_for_sub_contract, bin2.reserved_qty_for_sub_contract - 6)
|
||||||
|
|
||||||
|
make_stock_entry(target="_Test Warehouse 1 - _TC", item_code="_Test Item",
|
||||||
|
qty=40, basic_rate=100)
|
||||||
|
make_stock_entry(target="_Test Warehouse 1 - _TC", item_code="_Test Item Home Desktop 100",
|
||||||
|
qty=40, basic_rate=100)
|
||||||
|
|
||||||
# make Purchase Receipt against PO
|
# make Purchase Receipt against PO
|
||||||
pr = make_purchase_receipt(po.name)
|
pr = make_purchase_receipt(po.name)
|
||||||
pr.supplier_warehouse = "_Test Warehouse 1 - _TC"
|
pr.supplier_warehouse = "_Test Warehouse 1 - _TC"
|
||||||
@ -501,6 +573,13 @@ class TestPurchaseOrder(unittest.TestCase):
|
|||||||
frappe.db.set_value("Accounts Settings", "Accounts Settings",
|
frappe.db.set_value("Accounts Settings", "Accounts Settings",
|
||||||
"unlink_advance_payment_on_cancelation_of_order", 0)
|
"unlink_advance_payment_on_cancelation_of_order", 0)
|
||||||
|
|
||||||
|
def make_pr_against_po(po, received_qty=0):
|
||||||
|
pr = make_purchase_receipt(po)
|
||||||
|
pr.get("items")[0].qty = received_qty or 5
|
||||||
|
pr.insert()
|
||||||
|
pr.submit()
|
||||||
|
return pr
|
||||||
|
|
||||||
def make_subcontracted_item(item_code):
|
def make_subcontracted_item(item_code):
|
||||||
from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom
|
from erpnext.manufacturing.doctype.production_plan.test_production_plan import make_bom
|
||||||
|
|
||||||
|
@ -17,6 +17,13 @@ frappe.ui.form.on("Supplier", {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
frm.set_query("default_bank_account", function() {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
"is_company_account":1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
refresh: function (frm) {
|
refresh: function (frm) {
|
||||||
frappe.dynamic_link = { doc: frm.doc, fieldname: 'name', doctype: 'Supplier' }
|
frappe.dynamic_link = { doc: frm.doc, fieldname: 'name', doctype: 'Supplier' }
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
/* eslint-disable */
|
||||||
|
|
||||||
|
frappe.query_reports["Procurement Tracker"] = {
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
fieldname: "company",
|
||||||
|
label: __("Company"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Company",
|
||||||
|
default: frappe.defaults.get_user_default("Company"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname: "cost_center",
|
||||||
|
label: __("Cost Center"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Cost Center",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname: "project",
|
||||||
|
label: __("Project"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Project",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname: "from_date",
|
||||||
|
label: __("From Date"),
|
||||||
|
fieldtype: "Date",
|
||||||
|
default: frappe.defaults.get_user_default("year_start_date"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"to_date",
|
||||||
|
label: __("To Date"),
|
||||||
|
fieldtype: "Date",
|
||||||
|
default: frappe.defaults.get_user_default("year_end_date"),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"add_total_row": 1,
|
||||||
|
"creation": "2019-03-29 17:05:45.196949",
|
||||||
|
"disable_prepared_report": 0,
|
||||||
|
"disabled": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "Report",
|
||||||
|
"idx": 0,
|
||||||
|
"is_standard": "Yes",
|
||||||
|
"modified": "2019-03-29 17:18:06.678728",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Buying",
|
||||||
|
"name": "Procurement Tracker",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"prepared_report": 0,
|
||||||
|
"ref_doctype": "Purchase Order",
|
||||||
|
"report_name": "Procurement Tracker",
|
||||||
|
"report_type": "Script Report",
|
||||||
|
"roles": []
|
||||||
|
}
|
282
erpnext/buying/report/procurement_tracker/procurement_tracker.py
Normal file
282
erpnext/buying/report/procurement_tracker/procurement_tracker.py
Normal file
@ -0,0 +1,282 @@
|
|||||||
|
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
from frappe import _
|
||||||
|
|
||||||
|
def execute(filters=None):
|
||||||
|
columns = get_columns(filters)
|
||||||
|
data = get_data(filters)
|
||||||
|
return columns, data
|
||||||
|
|
||||||
|
def get_columns(filters):
|
||||||
|
columns = [
|
||||||
|
{
|
||||||
|
"label": _("Material Request Date"),
|
||||||
|
"fieldname": "material_request_date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Material Request No"),
|
||||||
|
"options": "Material Request",
|
||||||
|
"fieldname": "material_request_no",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Cost Center"),
|
||||||
|
"options": "Cost Center",
|
||||||
|
"fieldname": "cost_center",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Project"),
|
||||||
|
"options": "Project",
|
||||||
|
"fieldname": "project",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Requesting Site"),
|
||||||
|
"options": "Warehouse",
|
||||||
|
"fieldname": "requesting_site",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Requestor"),
|
||||||
|
"options": "Employee",
|
||||||
|
"fieldname": "requestor",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Description"),
|
||||||
|
"fieldname": "description",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"width": 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Quantity"),
|
||||||
|
"fieldname": "quantity",
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Unit of Measure"),
|
||||||
|
"options": "UOM",
|
||||||
|
"fieldname": "unit_of_measurement",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Status"),
|
||||||
|
"fieldname": "status",
|
||||||
|
"fieldtype": "data",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Purchase Order Date"),
|
||||||
|
"fieldname": "purchase_order_date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Purchase Order"),
|
||||||
|
"options": "Purchase Order",
|
||||||
|
"fieldname": "purchase_order",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Supplier"),
|
||||||
|
"options": "Supplier",
|
||||||
|
"fieldname": "supplier",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Estimated Cost"),
|
||||||
|
"fieldname": "estimated_cost",
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Actual Cost"),
|
||||||
|
"fieldname": "actual_cost",
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Purchase Order Amount"),
|
||||||
|
"fieldname": "purchase_order_amt",
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Purchase Order Amount(Company Currency)"),
|
||||||
|
"fieldname": "purchase_order_amt_usd",
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Expected Delivery Date"),
|
||||||
|
"fieldname": "expected_delivery_date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Actual Delivery Date"),
|
||||||
|
"fieldname": "actual_delivery_date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"width": 140
|
||||||
|
},
|
||||||
|
]
|
||||||
|
return columns
|
||||||
|
|
||||||
|
def get_conditions(filters):
|
||||||
|
conditions = ""
|
||||||
|
|
||||||
|
if filters.get("company"):
|
||||||
|
conditions += " AND company='%s'"% filters.get('company')
|
||||||
|
|
||||||
|
if filters.get("cost_center") or filters.get("project"):
|
||||||
|
conditions += """
|
||||||
|
AND (cost_center='%s'
|
||||||
|
OR project='%s')
|
||||||
|
"""% (filters.get('cost_center'), filters.get('project'))
|
||||||
|
|
||||||
|
if filters.get("from_date"):
|
||||||
|
conditions += "AND transaction_date>=%s"% filters.get('from_date')
|
||||||
|
|
||||||
|
if filters.get("to_date"):
|
||||||
|
conditions += "AND transaction_date<=%s"% filters.get('to_date')
|
||||||
|
return conditions
|
||||||
|
|
||||||
|
def get_data(filters):
|
||||||
|
conditions = get_conditions(filters)
|
||||||
|
purchase_order_entry = get_po_entries(conditions)
|
||||||
|
mr_records, procurement_record_against_mr = get_mapped_mr_details(conditions)
|
||||||
|
pr_records = get_mapped_pr_records()
|
||||||
|
pi_records = get_mapped_pi_records()
|
||||||
|
print(pi_records)
|
||||||
|
|
||||||
|
procurement_record=[]
|
||||||
|
if procurement_record_against_mr:
|
||||||
|
procurement_record += procurement_record_against_mr
|
||||||
|
for po in purchase_order_entry:
|
||||||
|
# fetch material records linked to the purchase order item
|
||||||
|
mr_record = mr_records.get(po.material_request_item, [{}])[0]
|
||||||
|
procurement_detail = {
|
||||||
|
"material_request_date": mr_record.get('transaction_date'),
|
||||||
|
"cost_center": po.cost_center,
|
||||||
|
"project": po.project,
|
||||||
|
"requesting_site": po.warehouse,
|
||||||
|
"requestor": po.owner,
|
||||||
|
"material_request_no": po.material_request,
|
||||||
|
"description": po.description,
|
||||||
|
"quantity": po.qty,
|
||||||
|
"unit_of_measurement": po.stock_uom,
|
||||||
|
"status": po.status,
|
||||||
|
"purchase_order_date": po.transaction_date,
|
||||||
|
"purchase_order": po.parent,
|
||||||
|
"supplier": po.supplier,
|
||||||
|
"estimated_cost": mr_record.get('amount'),
|
||||||
|
"actual_cost": pi_records.get(po.name),
|
||||||
|
"purchase_order_amt": po.amount,
|
||||||
|
"purchase_order_amt_in_company_currency": po.base_amount,
|
||||||
|
"expected_delivery_date": po.schedule_date,
|
||||||
|
"actual_delivery_date": pr_records.get(po.name)
|
||||||
|
}
|
||||||
|
procurement_record.append(procurement_detail)
|
||||||
|
return procurement_record
|
||||||
|
|
||||||
|
def get_mapped_mr_details(conditions):
|
||||||
|
mr_records = {}
|
||||||
|
mr_details = frappe.db.sql("""
|
||||||
|
SELECT
|
||||||
|
mr.transaction_date,
|
||||||
|
mr.per_ordered,
|
||||||
|
mr_item.name,
|
||||||
|
mr_item.parent,
|
||||||
|
mr_item.amount
|
||||||
|
FROM `tabMaterial Request` mr, `tabMaterial Request Item` mr_item
|
||||||
|
WHERE
|
||||||
|
mr.per_ordered>=0
|
||||||
|
AND mr.name=mr_item.parent
|
||||||
|
AND mr.docstatus=1
|
||||||
|
{conditions}
|
||||||
|
""".format(conditions=conditions), as_dict=1) #nosec
|
||||||
|
|
||||||
|
procurement_record_against_mr = []
|
||||||
|
for record in mr_details:
|
||||||
|
if record.per_ordered:
|
||||||
|
mr_records.setdefault(record.name, []).append(frappe._dict(record))
|
||||||
|
else:
|
||||||
|
procurement_record_details = dict(
|
||||||
|
material_request_date=record.transaction_date,
|
||||||
|
material_request_no=record.parent,
|
||||||
|
estimated_cost=record.amount
|
||||||
|
)
|
||||||
|
procurement_record_against_mr.append(procurement_record_details)
|
||||||
|
return mr_records, procurement_record_against_mr
|
||||||
|
|
||||||
|
def get_mapped_pi_records():
|
||||||
|
return frappe._dict(frappe.db.sql("""
|
||||||
|
SELECT
|
||||||
|
pi_item.po_detail,
|
||||||
|
pi_item.base_amount
|
||||||
|
FROM `tabPurchase Invoice Item` as pi_item
|
||||||
|
INNER JOIN `tabPurchase Order` as po
|
||||||
|
ON pi_item.`purchase_order` = po.`name`
|
||||||
|
WHERE
|
||||||
|
pi_item.docstatus = 1
|
||||||
|
AND po.status not in ("Closed","Completed","Cancelled")
|
||||||
|
AND pi_item.po_detail IS NOT NULL
|
||||||
|
"""))
|
||||||
|
|
||||||
|
def get_mapped_pr_records():
|
||||||
|
return frappe._dict(frappe.db.sql("""
|
||||||
|
SELECT
|
||||||
|
pr_item.purchase_order_item,
|
||||||
|
pr.posting_date
|
||||||
|
FROM `tabPurchase Receipt` pr, `tabPurchase Receipt Item` pr_item
|
||||||
|
WHERE
|
||||||
|
pr.docstatus=1
|
||||||
|
AND pr.name=pr_item.parent
|
||||||
|
AND pr_item.purchase_order_item IS NOT NULL
|
||||||
|
AND pr.status not in ("Closed","Completed","Cancelled")
|
||||||
|
"""))
|
||||||
|
|
||||||
|
def get_po_entries(conditions):
|
||||||
|
return frappe.db.sql("""
|
||||||
|
SELECT
|
||||||
|
po_item.name,
|
||||||
|
po_item.parent,
|
||||||
|
po_item.cost_center,
|
||||||
|
po_item.project,
|
||||||
|
po_item.warehouse,
|
||||||
|
po_item.material_request,
|
||||||
|
po_item.material_request_item,
|
||||||
|
po_item.description,
|
||||||
|
po_item.stock_uom,
|
||||||
|
po_item.qty,
|
||||||
|
po_item.amount,
|
||||||
|
po_item.base_amount,
|
||||||
|
po_item.schedule_date,
|
||||||
|
po.transaction_date,
|
||||||
|
po.supplier,
|
||||||
|
po.status,
|
||||||
|
po.owner
|
||||||
|
FROM `tabPurchase Order` po, `tabPurchase Order Item` po_item
|
||||||
|
WHERE
|
||||||
|
po.docstatus = 1
|
||||||
|
AND po.name = po_item.parent
|
||||||
|
AND po.status not in ("Closed","Completed","Cancelled")
|
||||||
|
{conditions}
|
||||||
|
GROUP BY
|
||||||
|
po.name,po_item.item_code
|
||||||
|
""".format(conditions=conditions), as_dict=1) #nosec
|
@ -0,0 +1,67 @@
|
|||||||
|
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import unittest
|
||||||
|
from datetime import datetime
|
||||||
|
import frappe
|
||||||
|
from erpnext.buying.report.procurement_tracker.procurement_tracker import execute
|
||||||
|
from erpnext.stock.doctype.material_request.test_material_request import make_material_request
|
||||||
|
from erpnext.stock.doctype.material_request.material_request import make_purchase_order
|
||||||
|
from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt
|
||||||
|
from erpnext.stock.doctype.warehouse.test_warehouse import create_warehouse
|
||||||
|
|
||||||
|
class TestProcurementTracker(unittest.TestCase):
|
||||||
|
def test_result_for_procurement_tracker(self):
|
||||||
|
filters = {
|
||||||
|
'company': '_Test Procurement Company',
|
||||||
|
'cost_center': '_Test Cost Center - _TC'
|
||||||
|
}
|
||||||
|
expected_data = self.generate_expected_data()
|
||||||
|
report = execute(filters)
|
||||||
|
|
||||||
|
length = len(report[1])
|
||||||
|
self.assertEqual(expected_data, report[1][length-1])
|
||||||
|
|
||||||
|
def generate_expected_data(self):
|
||||||
|
if not frappe.db.exists("Company", "_Test Procurement Company"):
|
||||||
|
frappe.get_doc(dict(
|
||||||
|
doctype="Company",
|
||||||
|
company_name="_Test Procurement Company",
|
||||||
|
abbr="_TPC",
|
||||||
|
default_currency="INR",
|
||||||
|
country="India"
|
||||||
|
)).insert()
|
||||||
|
warehouse = create_warehouse("_Test Procurement Warehouse", company="_Test Procurement Company")
|
||||||
|
mr = make_material_request(company="_Test Procurement Company", warehouse=warehouse)
|
||||||
|
po = make_purchase_order(mr.name)
|
||||||
|
po.supplier = "_Test Supplier"
|
||||||
|
po.get("items")[0].cost_center = "_Test Cost Center - _TC"
|
||||||
|
po.submit()
|
||||||
|
pr = make_purchase_receipt(po.name)
|
||||||
|
pr.submit()
|
||||||
|
frappe.db.commit()
|
||||||
|
date_obj = datetime.date(datetime.now())
|
||||||
|
|
||||||
|
expected_data = {
|
||||||
|
"material_request_date": date_obj,
|
||||||
|
"cost_center": "_Test Cost Center - _TC",
|
||||||
|
"project": None,
|
||||||
|
"requesting_site": "_Test Procurement Warehouse - _TPC",
|
||||||
|
"requestor": "Administrator",
|
||||||
|
"material_request_no": mr.name,
|
||||||
|
"description": '_Test Item 1',
|
||||||
|
"quantity": 10.0,
|
||||||
|
"unit_of_measurement": "_Test UOM",
|
||||||
|
"status": "To Bill",
|
||||||
|
"purchase_order_date": date_obj,
|
||||||
|
"purchase_order": po.name,
|
||||||
|
"supplier": "_Test Supplier",
|
||||||
|
"estimated_cost": 0.0,
|
||||||
|
"actual_cost": None,
|
||||||
|
"purchase_order_amt": 5000.0,
|
||||||
|
"purchase_order_amt_in_company_currency": 300000.0,
|
||||||
|
"expected_delivery_date": date_obj,
|
||||||
|
"actual_delivery_date": date_obj
|
||||||
|
}
|
||||||
|
return expected_data
|
@ -0,0 +1,29 @@
|
|||||||
|
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
/* eslint-disable */
|
||||||
|
|
||||||
|
frappe.query_reports["Subcontracted Item To Be Received"] = {
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
fieldname: "supplier",
|
||||||
|
label: __("Supplier"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Supplier",
|
||||||
|
reqd: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"from_date",
|
||||||
|
label: __("From Date"),
|
||||||
|
fieldtype: "Date",
|
||||||
|
default: frappe.datetime.add_months(frappe.datetime.month_start(), -1),
|
||||||
|
reqd: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"to_date",
|
||||||
|
label: __("To Date"),
|
||||||
|
fieldtype: "Date",
|
||||||
|
default: frappe.datetime.add_days(frappe.datetime.month_start(),-1),
|
||||||
|
reqd: 1
|
||||||
|
},
|
||||||
|
]
|
||||||
|
};
|
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"add_total_row": 1,
|
||||||
|
"creation": "2019-05-03 11:25:03.685247",
|
||||||
|
"disable_prepared_report": 0,
|
||||||
|
"disabled": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "Report",
|
||||||
|
"idx": 0,
|
||||||
|
"is_standard": "Yes",
|
||||||
|
"modified": "2019-05-03 11:25:03.685247",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Buying",
|
||||||
|
"name": "Subcontracted Item To Be Received",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"prepared_report": 0,
|
||||||
|
"ref_doctype": "Purchase Order",
|
||||||
|
"report_name": "Subcontracted Item To Be Received",
|
||||||
|
"report_type": "Script Report",
|
||||||
|
"roles": [
|
||||||
|
{
|
||||||
|
"role": "Stock User"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Purchase Manager"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Purchase User"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,104 @@
|
|||||||
|
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
from frappe import _
|
||||||
|
|
||||||
|
def execute(filters=None):
|
||||||
|
if filters.from_date >= filters.to_date:
|
||||||
|
frappe.msgprint(_("To Date must be greater than From Date"))
|
||||||
|
|
||||||
|
data = []
|
||||||
|
columns = get_columns()
|
||||||
|
get_data(data , filters)
|
||||||
|
return columns, data
|
||||||
|
|
||||||
|
def get_columns():
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
"label": _("Purchase Order"),
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"fieldname": "purchase_order",
|
||||||
|
"options": "Purchase Order",
|
||||||
|
"width": 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Date"),
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"fieldname": "date",
|
||||||
|
"hidden": 1,
|
||||||
|
"width": 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Supplier"),
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"fieldname": "supplier",
|
||||||
|
"options": "Supplier",
|
||||||
|
"width": 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Finished Good Item Code"),
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"fieldname": "fg_item_code",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Item name"),
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"fieldname": "item_name",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Required Quantity"),
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"fieldname": "required_qty",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Received Quantity"),
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"fieldname": "received_qty",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Pending Quantity"),
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"fieldname": "pending_qty",
|
||||||
|
"width": 100
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
def get_data(data, filters):
|
||||||
|
po = get_po(filters)
|
||||||
|
po_name = [v.name for v in po]
|
||||||
|
sub_items = get_purchase_order_item_supplied(po_name)
|
||||||
|
for item in sub_items:
|
||||||
|
for order in po:
|
||||||
|
if order.name == item.parent and item.received_qty < item.qty:
|
||||||
|
row ={
|
||||||
|
'purchase_order': item.parent,
|
||||||
|
'date': order.transaction_date,
|
||||||
|
'supplier': order.supplier,
|
||||||
|
'fg_item_code': item.item_code,
|
||||||
|
'item_name': item.item_name,
|
||||||
|
'required_qty': item.qty,
|
||||||
|
'received_qty':item.received_qty,
|
||||||
|
'pending_qty':item.qty - item.received_qty
|
||||||
|
}
|
||||||
|
data.append(row)
|
||||||
|
|
||||||
|
def get_po(filters):
|
||||||
|
record_filters = [
|
||||||
|
["is_subcontracted", "=", "Yes"],
|
||||||
|
["supplier", "=", filters.supplier],
|
||||||
|
["transaction_date", "<=", filters.to_date],
|
||||||
|
["transaction_date", ">=", filters.from_date],
|
||||||
|
["docstatus", "=", 1]
|
||||||
|
]
|
||||||
|
return frappe.get_all("Purchase Order", filters=record_filters, fields=["name", "transaction_date", "supplier"])
|
||||||
|
|
||||||
|
def get_purchase_order_item_supplied(po):
|
||||||
|
return frappe.get_all("Purchase Order Item", filters=[
|
||||||
|
('parent', 'IN', po)
|
||||||
|
], fields=["parent", "item_code", "item_name", "qty", "received_qty"])
|
@ -0,0 +1,36 @@
|
|||||||
|
# Python bytecode 2.7 (62211)
|
||||||
|
# Embedded file name: /Users/anuragmishra/frappe-develop/apps/erpnext/erpnext/buying/report/subcontracted_item_to_be_received/test_subcontracted_item_to_be_received.py
|
||||||
|
# Compiled at: 2019-05-06 09:51:46
|
||||||
|
# Decompiled by https://python-decompiler.com
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
|
||||||
|
from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt
|
||||||
|
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry
|
||||||
|
from erpnext.buying.report.subcontracted_item_to_be_received.subcontracted_item_to_be_received import execute
|
||||||
|
import frappe, unittest
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
class TestSubcontractedItemToBeReceived(unittest.TestCase):
|
||||||
|
|
||||||
|
def test_pending_and_received_qty(self):
|
||||||
|
po = create_purchase_order(item_code='_Test FG Item', is_subcontracted='Yes')
|
||||||
|
transfer_param = []
|
||||||
|
make_stock_entry(item_code='_Test Item', target='_Test Warehouse 1 - _TC', qty=100, basic_rate=100)
|
||||||
|
make_stock_entry(item_code='_Test Item Home Desktop 100', target='_Test Warehouse 1 - _TC', qty=100, basic_rate=100)
|
||||||
|
make_purchase_receipt_against_po(po.name)
|
||||||
|
po.reload()
|
||||||
|
col, data = execute(filters=frappe._dict({'supplier': po.supplier,
|
||||||
|
'from_date': frappe.utils.get_datetime(frappe.utils.add_to_date(po.transaction_date, days=-10)),
|
||||||
|
'to_date': frappe.utils.get_datetime(frappe.utils.add_to_date(po.transaction_date, days=10))}))
|
||||||
|
self.assertEqual(data[0]['pending_qty'], 5)
|
||||||
|
self.assertEqual(data[0]['received_qty'], 5)
|
||||||
|
self.assertEqual(data[0]['purchase_order'], po.name)
|
||||||
|
self.assertEqual(data[0]['supplier'], po.supplier)
|
||||||
|
|
||||||
|
|
||||||
|
def make_purchase_receipt_against_po(po, quantity=5):
|
||||||
|
pr = make_purchase_receipt(po)
|
||||||
|
pr.items[0].qty = quantity
|
||||||
|
pr.supplier_warehouse = '_Test Warehouse 1 - _TC'
|
||||||
|
pr.insert()
|
||||||
|
pr.submit()
|
@ -0,0 +1,29 @@
|
|||||||
|
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
/* eslint-disable */
|
||||||
|
|
||||||
|
frappe.query_reports["Subcontracted Raw Materials To Be Transferred"] = {
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
fieldname: "supplier",
|
||||||
|
label: __("Supplier"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Supplier",
|
||||||
|
reqd: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"from_date",
|
||||||
|
label: __("From Date"),
|
||||||
|
fieldtype: "Date",
|
||||||
|
default: frappe.datetime.add_months(frappe.datetime.month_start(), -1),
|
||||||
|
reqd: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"to_date",
|
||||||
|
label: __("To Date"),
|
||||||
|
fieldtype: "Date",
|
||||||
|
default: frappe.datetime.add_days(frappe.datetime.month_start(),-1),
|
||||||
|
reqd: 1
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"add_total_row": 1,
|
||||||
|
"creation": "2019-05-03 12:04:14.438345",
|
||||||
|
"disable_prepared_report": 0,
|
||||||
|
"disabled": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "Report",
|
||||||
|
"idx": 0,
|
||||||
|
"is_standard": "Yes",
|
||||||
|
"modified": "2019-05-03 12:04:24.203721",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Buying",
|
||||||
|
"name": "Subcontracted Raw Materials To Be Transferred",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"prepared_report": 0,
|
||||||
|
"ref_doctype": "Purchase Order",
|
||||||
|
"report_name": "Subcontracted Raw Materials To Be Transferred",
|
||||||
|
"report_type": "Script Report",
|
||||||
|
"roles": [
|
||||||
|
{
|
||||||
|
"role": "Stock User"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Purchase Manager"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Purchase User"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,137 @@
|
|||||||
|
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
from frappe import _
|
||||||
|
|
||||||
|
def execute(filters=None):
|
||||||
|
if filters.from_date >= filters.to_date:
|
||||||
|
frappe.msgprint(_("To Date must be greater than From Date"))
|
||||||
|
|
||||||
|
data = []
|
||||||
|
columns = get_columns()
|
||||||
|
get_data(data , filters)
|
||||||
|
return columns, data
|
||||||
|
|
||||||
|
def get_columns():
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
"label": _("Purchase Order"),
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"fieldname": "purchase_order",
|
||||||
|
"options": "Purchase Order",
|
||||||
|
"width": 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Date"),
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"fieldname": "date",
|
||||||
|
"hidden": 1,
|
||||||
|
"width": 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Supplier"),
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"fieldname": "supplier",
|
||||||
|
"options": "Supplier",
|
||||||
|
"width": 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Item Code"),
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"fieldname": "rm_item_code",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Required Quantity"),
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"fieldname": "r_qty",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Transferred Quantity"),
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"fieldname": "t_qty",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Pending Quantity"),
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"fieldname": "p_qty",
|
||||||
|
"width": 100
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
def get_data(data, filters):
|
||||||
|
po = get_po(filters)
|
||||||
|
po_transferred_qty_map = frappe._dict(get_transferred_quantity([v.name for v in po]))
|
||||||
|
|
||||||
|
sub_items = get_purchase_order_item_supplied([v.name for v in po])
|
||||||
|
|
||||||
|
for order in po:
|
||||||
|
for item in sub_items:
|
||||||
|
if order.name == item.parent and order.name in po_transferred_qty_map and \
|
||||||
|
item.required_qty != po_transferred_qty_map.get(order.name).get(item.rm_item_code):
|
||||||
|
transferred_qty = po_transferred_qty_map.get(order.name).get(item.rm_item_code) \
|
||||||
|
if po_transferred_qty_map.get(order.name).get(item.rm_item_code) else 0
|
||||||
|
row ={
|
||||||
|
'purchase_order': item.parent,
|
||||||
|
'date': order.transaction_date,
|
||||||
|
'supplier': order.supplier,
|
||||||
|
'rm_item_code': item.rm_item_code,
|
||||||
|
'r_qty': item.required_qty,
|
||||||
|
't_qty':transferred_qty,
|
||||||
|
'p_qty':item.required_qty - transferred_qty
|
||||||
|
}
|
||||||
|
|
||||||
|
data.append(row)
|
||||||
|
|
||||||
|
return(data)
|
||||||
|
|
||||||
|
def get_po(filters):
|
||||||
|
record_filters = [
|
||||||
|
["is_subcontracted", "=", "Yes"],
|
||||||
|
["supplier", "=", filters.supplier],
|
||||||
|
["transaction_date", "<=", filters.to_date],
|
||||||
|
["transaction_date", ">=", filters.from_date],
|
||||||
|
["docstatus", "=", 1]
|
||||||
|
]
|
||||||
|
return frappe.get_all("Purchase Order", filters=record_filters, fields=["name", "transaction_date", "supplier"])
|
||||||
|
|
||||||
|
def get_transferred_quantity(po_name):
|
||||||
|
stock_entries = get_stock_entry(po_name)
|
||||||
|
stock_entries_detail = get_stock_entry_detail([v.name for v in stock_entries])
|
||||||
|
po_transferred_qty_map = {}
|
||||||
|
|
||||||
|
|
||||||
|
for entry in stock_entries:
|
||||||
|
for details in stock_entries_detail:
|
||||||
|
if details.parent == entry.name:
|
||||||
|
details["Purchase_order"] = entry.purchase_order
|
||||||
|
if entry.purchase_order not in po_transferred_qty_map:
|
||||||
|
po_transferred_qty_map[entry.purchase_order] = {}
|
||||||
|
po_transferred_qty_map[entry.purchase_order][details.item_code] = details.qty
|
||||||
|
else:
|
||||||
|
po_transferred_qty_map[entry.purchase_order][details.item_code] = po_transferred_qty_map[entry.purchase_order].get(details.item_code, 0) + details.qty
|
||||||
|
|
||||||
|
return po_transferred_qty_map
|
||||||
|
|
||||||
|
|
||||||
|
def get_stock_entry(po):
|
||||||
|
return frappe.get_all("Stock Entry", filters=[
|
||||||
|
('purchase_order', 'IN', po),
|
||||||
|
('stock_entry_type', '=', 'Send to Subcontractor'),
|
||||||
|
('docstatus', '=', 1)
|
||||||
|
], fields=["name", "purchase_order"])
|
||||||
|
|
||||||
|
def get_stock_entry_detail(se):
|
||||||
|
return frappe.get_all("Stock Entry Detail", filters=[
|
||||||
|
["parent", "in", se]
|
||||||
|
],
|
||||||
|
fields=["parent", "item_code", "qty"])
|
||||||
|
|
||||||
|
def get_purchase_order_item_supplied(po):
|
||||||
|
return frappe.get_all("Purchase Order Item Supplied", filters=[
|
||||||
|
('parent', 'IN', po)
|
||||||
|
], fields=['parent', 'rm_item_code', 'required_qty'])
|
@ -0,0 +1,44 @@
|
|||||||
|
# Python bytecode 2.7 (62211)
|
||||||
|
# Embedded file name: /Users/anuragmishra/frappe-develop/apps/erpnext/erpnext/buying/report/subcontracted_raw_materials_to_be_transferred/test_subcontracted_raw_materials_to_be_transferred.py
|
||||||
|
# Compiled at: 2019-05-06 10:24:35
|
||||||
|
# Decompiled by https://python-decompiler.com
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
from erpnext.buying.doctype.purchase_order.test_purchase_order import create_purchase_order
|
||||||
|
from erpnext.buying.doctype.purchase_order.purchase_order import make_rm_stock_entry
|
||||||
|
from erpnext.stock.doctype.stock_entry.test_stock_entry import make_stock_entry
|
||||||
|
from erpnext.buying.report.subcontracted_raw_materials_to_be_transferred.subcontracted_raw_materials_to_be_transferred import execute
|
||||||
|
import json, frappe, unittest
|
||||||
|
|
||||||
|
class TestSubcontractedItemToBeReceived(unittest.TestCase):
|
||||||
|
|
||||||
|
def test_pending_and_received_qty(self):
|
||||||
|
po = create_purchase_order(item_code='_Test FG Item', is_subcontracted='Yes')
|
||||||
|
make_stock_entry(item_code='_Test Item', target='_Test Warehouse 1 - _TC', qty=100, basic_rate=100)
|
||||||
|
make_stock_entry(item_code='_Test Item Home Desktop 100', target='_Test Warehouse 1 - _TC', qty=100, basic_rate=100)
|
||||||
|
transfer_subcontracted_raw_materials(po.name)
|
||||||
|
col, data = execute(filters=frappe._dict({'supplier': po.supplier,
|
||||||
|
'from_date': frappe.utils.get_datetime(frappe.utils.add_to_date(po.transaction_date, days=-10)),
|
||||||
|
'to_date': frappe.utils.get_datetime(frappe.utils.add_to_date(po.transaction_date, days=10))}))
|
||||||
|
self.assertEqual(data[0]['purchase_order'], po.name)
|
||||||
|
self.assertIn(data[0]['rm_item_code'], ['_Test Item', '_Test Item Home Desktop 100'])
|
||||||
|
self.assertIn(data[0]['p_qty'], [9, 18])
|
||||||
|
self.assertIn(data[0]['t_qty'], [1, 2])
|
||||||
|
|
||||||
|
self.assertEqual(data[1]['purchase_order'], po.name)
|
||||||
|
self.assertIn(data[1]['rm_item_code'], ['_Test Item', '_Test Item Home Desktop 100'])
|
||||||
|
self.assertIn(data[1]['p_qty'], [9, 18])
|
||||||
|
self.assertIn(data[1]['t_qty'], [1, 2])
|
||||||
|
|
||||||
|
|
||||||
|
def transfer_subcontracted_raw_materials(po):
|
||||||
|
rm_item = [
|
||||||
|
{'item_code': '_Test Item', 'rm_item_code': '_Test Item', 'item_name': '_Test Item', 'qty': 1,
|
||||||
|
'warehouse': '_Test Warehouse - _TC', 'rate': 100, 'amount': 100, 'stock_uom': 'Nos'},
|
||||||
|
{'item_code': '_Test Item Home Desktop 100', 'rm_item_code': '_Test Item Home Desktop 100', 'item_name': '_Test Item Home Desktop 100', 'qty': 2,
|
||||||
|
'warehouse': '_Test Warehouse - _TC', 'rate': 100, 'amount': 200, 'stock_uom': 'Nos'}]
|
||||||
|
rm_item_string = json.dumps(rm_item)
|
||||||
|
se = frappe.get_doc(make_rm_stock_entry(po, rm_item_string))
|
||||||
|
se.to_warehouse = '_Test Warehouse 1 - _TC'
|
||||||
|
se.stock_entry_type = 'Send to Subcontractor'
|
||||||
|
se.save()
|
||||||
|
se.submit()
|
@ -10,7 +10,7 @@ def get_data():
|
|||||||
{
|
{
|
||||||
"type": "doctype",
|
"type": "doctype",
|
||||||
"name": "Customer",
|
"name": "Customer",
|
||||||
"description": _("Customer database."),
|
"description": _("Customer Database."),
|
||||||
"onboard": 1,
|
"onboard": 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -34,6 +34,13 @@ def get_data():
|
|||||||
"onboard": 1,
|
"onboard": 1,
|
||||||
"dependencies": ["Item", "Customer"],
|
"dependencies": ["Item", "Customer"],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "Blanket Order",
|
||||||
|
"description": _("Blanket Orders from Costumers."),
|
||||||
|
"onboard": 1,
|
||||||
|
"dependencies": ["Item", "Customer"],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "doctype",
|
"type": "doctype",
|
||||||
"name": "Sales Partner",
|
"name": "Sales Partner",
|
||||||
@ -292,6 +299,12 @@ def get_data():
|
|||||||
"name": "Customers Without Any Sales Transactions",
|
"name": "Customers Without Any Sales Transactions",
|
||||||
"doctype": "Customer"
|
"doctype": "Customer"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "report",
|
||||||
|
"is_query_report": True,
|
||||||
|
"name": "Sales Partners Commission",
|
||||||
|
"doctype": "Customer"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -90,12 +90,6 @@ def get_data():
|
|||||||
"label": _("Email"),
|
"label": _("Email"),
|
||||||
"icon": "fa fa-envelope",
|
"icon": "fa fa-envelope",
|
||||||
"items": [
|
"items": [
|
||||||
{
|
|
||||||
"type": "doctype",
|
|
||||||
"name": "Feedback Trigger",
|
|
||||||
"label": _("Feedback Trigger"),
|
|
||||||
"description": _("Automatically triggers the feedback request based on conditions.")
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "doctype",
|
"type": "doctype",
|
||||||
"name": "Email Digest",
|
"name": "Email Digest",
|
||||||
|
@ -55,6 +55,19 @@ def get_data():
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": _("Maintenance"),
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "Maintenance Schedule",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "doctype",
|
||||||
|
"name": "Maintenance Visit",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": _("Reports"),
|
"label": _("Reports"),
|
||||||
"icon": "fa fa-list",
|
"icon": "fa fa-list",
|
||||||
|
@ -355,7 +355,7 @@ class AccountsController(TransactionBase):
|
|||||||
'fiscal_year': fiscal_year,
|
'fiscal_year': fiscal_year,
|
||||||
'voucher_type': self.doctype,
|
'voucher_type': self.doctype,
|
||||||
'voucher_no': self.name,
|
'voucher_no': self.name,
|
||||||
'remarks': self.get("remarks"),
|
'remarks': self.get("remarks") or self.get("remark"),
|
||||||
'debit': 0,
|
'debit': 0,
|
||||||
'credit': 0,
|
'credit': 0,
|
||||||
'debit_in_account_currency': 0,
|
'debit_in_account_currency': 0,
|
||||||
@ -787,6 +787,9 @@ class AccountsController(TransactionBase):
|
|||||||
if self.doctype in ("Sales Invoice", "Purchase Invoice"):
|
if self.doctype in ("Sales Invoice", "Purchase Invoice"):
|
||||||
grand_total = grand_total - flt(self.write_off_amount)
|
grand_total = grand_total - flt(self.write_off_amount)
|
||||||
|
|
||||||
|
if self.get("total_advance"):
|
||||||
|
grand_total -= self.get("total_advance")
|
||||||
|
|
||||||
if not self.get("payment_schedule"):
|
if not self.get("payment_schedule"):
|
||||||
if self.get("payment_terms_template"):
|
if self.get("payment_terms_template"):
|
||||||
data = get_payment_terms(self.payment_terms_template, posting_date, grand_total)
|
data = get_payment_terms(self.payment_terms_template, posting_date, grand_total)
|
||||||
@ -832,6 +835,9 @@ class AccountsController(TransactionBase):
|
|||||||
total = flt(total, self.precision("grand_total"))
|
total = flt(total, self.precision("grand_total"))
|
||||||
|
|
||||||
grand_total = flt(self.get("rounded_total") or self.grand_total, self.precision('grand_total'))
|
grand_total = flt(self.get("rounded_total") or self.grand_total, self.precision('grand_total'))
|
||||||
|
if self.get("total_advance"):
|
||||||
|
grand_total -= self.get("total_advance")
|
||||||
|
|
||||||
if self.doctype in ("Sales Invoice", "Purchase Invoice"):
|
if self.doctype in ("Sales Invoice", "Purchase Invoice"):
|
||||||
grand_total = grand_total - flt(self.write_off_amount)
|
grand_total = grand_total - flt(self.write_off_amount)
|
||||||
if total != grand_total:
|
if total != grand_total:
|
||||||
|
@ -124,16 +124,8 @@ def find_variant(template, args, variant_item_code=None):
|
|||||||
|
|
||||||
conditions = " or ".join(conditions)
|
conditions = " or ".join(conditions)
|
||||||
|
|
||||||
# use approximate match and shortlist possible variant matches
|
from erpnext.portal.product_configurator.utils import get_item_codes_by_attributes
|
||||||
# it is approximate because we are matching using OR condition
|
possible_variants = [i for i in get_item_codes_by_attributes(args, template) if i != variant_item_code]
|
||||||
# and it need not be exact match at this stage
|
|
||||||
# this uses a simpler query instead of using multiple exists conditions
|
|
||||||
possible_variants = frappe.db.sql_list("""select name from `tabItem` item
|
|
||||||
where variant_of=%s and exists (
|
|
||||||
select name from `tabItem Variant Attribute` iv_attribute
|
|
||||||
where iv_attribute.parent=item.name
|
|
||||||
and ({conditions}) and parent != %s
|
|
||||||
)""".format(conditions=conditions), (template, cstr(variant_item_code)))
|
|
||||||
|
|
||||||
for variant in possible_variants:
|
for variant in possible_variants:
|
||||||
variant = frappe.get_doc("Item", variant)
|
variant = frappe.get_doc("Item", variant)
|
||||||
@ -317,7 +309,7 @@ def make_variant_item_code(template_item_code, template_item_name, variant):
|
|||||||
}, as_dict=True)
|
}, as_dict=True)
|
||||||
|
|
||||||
if not item_attribute:
|
if not item_attribute:
|
||||||
return
|
continue
|
||||||
# frappe.throw(_('Invalid attribute {0} {1}').format(frappe.bold(attr.attribute),
|
# frappe.throw(_('Invalid attribute {0} {1}').format(frappe.bold(attr.attribute),
|
||||||
# frappe.bold(attr.attribute_value)), title=_('Invalid Attribute'),
|
# frappe.bold(attr.attribute_value)), title=_('Invalid Attribute'),
|
||||||
# exc=InvalidItemAttributeValueError)
|
# exc=InvalidItemAttributeValueError)
|
||||||
|
@ -253,11 +253,13 @@ def get_delivery_notes_to_be_billed(doctype, txt, searchfield, start, page_len,
|
|||||||
and return_against in (select name from `tabDelivery Note` where per_billed < 100)
|
and return_against in (select name from `tabDelivery Note` where per_billed < 100)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
%(mcond)s order by `tabDelivery Note`.`%(key)s` asc
|
%(mcond)s order by `tabDelivery Note`.`%(key)s` asc limit %(start)s, %(page_len)s
|
||||||
""" % {
|
""" % {
|
||||||
"key": searchfield,
|
"key": searchfield,
|
||||||
"fcond": get_filters_cond(doctype, filters, []),
|
"fcond": get_filters_cond(doctype, filters, []),
|
||||||
"mcond": get_match_cond(doctype),
|
"mcond": get_match_cond(doctype),
|
||||||
|
"start": start,
|
||||||
|
"page_len": page_len,
|
||||||
"txt": "%(txt)s"
|
"txt": "%(txt)s"
|
||||||
}, {"txt": ("%%%s%%" % txt)}, as_dict=as_dict)
|
}, {"txt": ("%%%s%%" % txt)}, as_dict=as_dict)
|
||||||
|
|
||||||
|
@ -96,7 +96,9 @@ status_map = {
|
|||||||
["Partially Ordered", "eval:self.status != 'Stopped' and self.per_ordered < 100 and self.per_ordered > 0 and self.docstatus == 1"],
|
["Partially Ordered", "eval:self.status != 'Stopped' and self.per_ordered < 100 and self.per_ordered > 0 and self.docstatus == 1"],
|
||||||
["Ordered", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Purchase'"],
|
["Ordered", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Purchase'"],
|
||||||
["Transferred", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Transfer'"],
|
["Transferred", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Transfer'"],
|
||||||
["Issued", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Issue'"]
|
["Issued", "eval:self.status != 'Stopped' and self.per_ordered == 100 and self.docstatus == 1 and self.material_request_type == 'Material Issue'"],
|
||||||
|
["Received", "eval:self.status != 'Stopped' and self.per_received == 100 and self.docstatus == 1 and self.material_request_type == 'Purchase'"],
|
||||||
|
["Partially Received", "eval:self.status != 'Stopped' and self.per_received > 0 and self.per_received < 100 and self.docstatus == 1 and self.material_request_type == 'Purchase'"]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,6 +80,7 @@ class StockController(AccountsController):
|
|||||||
"cost_center": item_row.cost_center,
|
"cost_center": item_row.cost_center,
|
||||||
"remarks": self.get("remarks") or "Accounting Entry for Stock",
|
"remarks": self.get("remarks") or "Accounting Entry for Stock",
|
||||||
"debit": flt(sle.stock_value_difference, 2),
|
"debit": flt(sle.stock_value_difference, 2),
|
||||||
|
"is_opening": item_row.get("is_opening"),
|
||||||
}, warehouse_account[sle.warehouse]["account_currency"]))
|
}, warehouse_account[sle.warehouse]["account_currency"]))
|
||||||
|
|
||||||
# to target warehouse / expense account
|
# to target warehouse / expense account
|
||||||
@ -89,7 +90,8 @@ class StockController(AccountsController):
|
|||||||
"cost_center": item_row.cost_center,
|
"cost_center": item_row.cost_center,
|
||||||
"remarks": self.get("remarks") or "Accounting Entry for Stock",
|
"remarks": self.get("remarks") or "Accounting Entry for Stock",
|
||||||
"credit": flt(sle.stock_value_difference, 2),
|
"credit": flt(sle.stock_value_difference, 2),
|
||||||
"project": item_row.get("project") or self.get("project")
|
"project": item_row.get("project") or self.get("project"),
|
||||||
|
"is_opening": item_row.get("is_opening")
|
||||||
}))
|
}))
|
||||||
elif sle.warehouse not in warehouse_with_no_account:
|
elif sle.warehouse not in warehouse_with_no_account:
|
||||||
warehouse_with_no_account.append(sle.warehouse)
|
warehouse_with_no_account.append(sle.warehouse)
|
||||||
@ -123,8 +125,17 @@ class StockController(AccountsController):
|
|||||||
|
|
||||||
def get_voucher_details(self, default_expense_account, default_cost_center, sle_map):
|
def get_voucher_details(self, default_expense_account, default_cost_center, sle_map):
|
||||||
if self.doctype == "Stock Reconciliation":
|
if self.doctype == "Stock Reconciliation":
|
||||||
return [frappe._dict({ "name": voucher_detail_no, "expense_account": default_expense_account,
|
reconciliation_purpose = frappe.db.get_value(self.doctype, self.name, "purpose")
|
||||||
"cost_center": default_cost_center }) for voucher_detail_no, sle in sle_map.items()]
|
is_opening = "Yes" if reconciliation_purpose == "Opening Stock" else "No"
|
||||||
|
details = []
|
||||||
|
for voucher_detail_no, sle in sle_map.items():
|
||||||
|
details.append(frappe._dict({
|
||||||
|
"name": voucher_detail_no,
|
||||||
|
"expense_account": default_expense_account,
|
||||||
|
"cost_center": default_cost_center,
|
||||||
|
"is_opening": is_opening
|
||||||
|
}))
|
||||||
|
return details
|
||||||
else:
|
else:
|
||||||
details = self.get("items")
|
details = self.get("items")
|
||||||
|
|
||||||
|
@ -7,11 +7,13 @@ cur_frm.email_field = "email_id";
|
|||||||
erpnext.LeadController = frappe.ui.form.Controller.extend({
|
erpnext.LeadController = frappe.ui.form.Controller.extend({
|
||||||
setup: function () {
|
setup: function () {
|
||||||
this.frm.fields_dict.customer.get_query = function (doc, cdt, cdn) {
|
this.frm.fields_dict.customer.get_query = function (doc, cdt, cdn) {
|
||||||
return { query: "erpnext.controllers.queries.customer_query" } }
|
return { query: "erpnext.controllers.queries.customer_query" }
|
||||||
|
}
|
||||||
|
|
||||||
|
this.frm.toggle_reqd("lead_name", !this.frm.doc.organization_lead);
|
||||||
},
|
},
|
||||||
|
|
||||||
onload: function () {
|
onload: function () {
|
||||||
|
|
||||||
if (cur_frm.fields_dict.lead_owner.df.options.match(/^User/)) {
|
if (cur_frm.fields_dict.lead_owner.df.options.match(/^User/)) {
|
||||||
cur_frm.fields_dict.lead_owner.get_query = function (doc, cdt, cdn) {
|
cur_frm.fields_dict.lead_owner.get_query = function (doc, cdt, cdn) {
|
||||||
return { query: "frappe.core.doctype.user.user.user_query" }
|
return { query: "frappe.core.doctype.user.user.user_query" }
|
||||||
@ -20,7 +22,8 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({
|
|||||||
|
|
||||||
if (cur_frm.fields_dict.contact_by.df.options.match(/^User/)) {
|
if (cur_frm.fields_dict.contact_by.df.options.match(/^User/)) {
|
||||||
cur_frm.fields_dict.contact_by.get_query = function (doc, cdt, cdn) {
|
cur_frm.fields_dict.contact_by.get_query = function (doc, cdt, cdn) {
|
||||||
return { query: "frappe.core.doctype.user.user.user_query" } }
|
return { query: "frappe.core.doctype.user.user.user_query" }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -64,11 +67,8 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
organization_lead: function () {
|
organization_lead: function () {
|
||||||
if (this.frm.doc.organization_lead == 1) {
|
this.frm.toggle_reqd("lead_name", !this.frm.doc.organization_lead);
|
||||||
this.frm.set_df_property('company_name', 'reqd', 1);
|
this.frm.toggle_reqd("company_name", this.frm.doc.organization_lead);
|
||||||
} else {
|
|
||||||
this.frm.set_df_property('company_name', 'reqd', 0);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
company_name: function () {
|
company_name: function () {
|
||||||
|
@ -145,7 +145,7 @@
|
|||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"remember_last_selected_value": 0,
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 1,
|
"reqd": 0,
|
||||||
"search_index": 1,
|
"search_index": 1,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
@ -268,7 +268,7 @@
|
|||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 0,
|
"in_filter": 0,
|
||||||
"in_global_search": 0,
|
"in_global_search": 0,
|
||||||
"in_list_view": 0,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 0,
|
||||||
"label": "Lead Owner",
|
"label": "Lead Owner",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
@ -1419,17 +1419,18 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
"has_web_view": 0,
|
||||||
|
"hide_heading": 0,
|
||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"icon": "fa fa-user",
|
"icon": "fa fa-user",
|
||||||
"idx": 5,
|
"idx": 5,
|
||||||
"image_field": "image",
|
"image_field": "image",
|
||||||
|
"image_view": 0,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"menu_index": 0,
|
"modified": "2019-05-10 03:22:57.283628",
|
||||||
"modified": "2019-04-11 22:12:50.029368",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "CRM",
|
"module": "CRM",
|
||||||
"name": "Lead",
|
"name": "Lead",
|
||||||
|
@ -109,7 +109,11 @@ class Lead(SellingController):
|
|||||||
|
|
||||||
def set_lead_name(self):
|
def set_lead_name(self):
|
||||||
if not self.lead_name:
|
if not self.lead_name:
|
||||||
frappe.db.set_value("Lead", self.name, "lead_name", self.company_name)
|
# Check for leads being created through data import
|
||||||
|
if not self.company_name and not self.flags.ignore_mandatory:
|
||||||
|
frappe.throw(_("A Lead requires either a person's name or an organization's name"))
|
||||||
|
|
||||||
|
self.lead_name = self.company_name
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def make_customer(source_name, target_doc=None):
|
def make_customer(source_name, target_doc=None):
|
||||||
|
@ -21,6 +21,17 @@ frappe.ui.form.on("Opportunity", {
|
|||||||
frm.trigger('set_contact_link');
|
frm.trigger('set_contact_link');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onload_post_render: function(frm) {
|
||||||
|
frm.get_field("items").grid.set_multiple_add("item_code", "qty");
|
||||||
|
},
|
||||||
|
|
||||||
|
party_name: function(frm) {
|
||||||
|
if (frm.doc.opportunity_from == "Customer") {
|
||||||
|
frm.trigger('set_contact_link');
|
||||||
|
erpnext.utils.get_party_details(frm);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
with_items: function(frm) {
|
with_items: function(frm) {
|
||||||
frm.trigger('toggle_mandatory');
|
frm.trigger('toggle_mandatory');
|
||||||
},
|
},
|
||||||
@ -104,13 +115,15 @@ erpnext.crm.Opportunity = frappe.ui.form.Controller.extend({
|
|||||||
if(!this.frm.doc.enquiry_from && this.frm.doc.lead)
|
if(!this.frm.doc.enquiry_from && this.frm.doc.lead)
|
||||||
this.frm.doc.enquiry_from = "Lead";
|
this.frm.doc.enquiry_from = "Lead";
|
||||||
|
|
||||||
if(!this.frm.doc.status)
|
if(!this.frm.doc.status) {
|
||||||
set_multiple(this.frm.doc.doctype, this.frm.doc.name, { status:'Open' });
|
frm.set_value('status', 'Open');
|
||||||
if(!this.frm.doc.company && frappe.defaults.get_user_default("Company"))
|
}
|
||||||
set_multiple(this.frm.doc.doctype, this.frm.doc.name,
|
if(!this.frm.doc.company && frappe.defaults.get_user_default("Company")) {
|
||||||
{ company:frappe.defaults.get_user_default("Company") });
|
frm.set_value('company', frappe.defaults.get_user_default("Company"));
|
||||||
if(!this.frm.doc.currency)
|
}
|
||||||
set_multiple(this.frm.doc.doctype, this.frm.doc.name, { currency:frappe.defaults.get_user_default("Currency") });
|
if(!this.frm.doc.currency) {
|
||||||
|
frm.set_value('currency', frappe.defaults.get_user_default("Currency"));
|
||||||
|
}
|
||||||
|
|
||||||
this.setup_queries();
|
this.setup_queries();
|
||||||
},
|
},
|
||||||
@ -180,4 +193,3 @@ cur_frm.cscript.lead = function(doc, cdt, cdn) {
|
|||||||
frm: cur_frm
|
frm: cur_frm
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,9 +20,9 @@ class Course(Document):
|
|||||||
frappe.throw(_("Total Weightage of all Assessment Criteria must be 100%"))
|
frappe.throw(_("Total Weightage of all Assessment Criteria must be 100%"))
|
||||||
|
|
||||||
def get_topics(self):
|
def get_topics(self):
|
||||||
try:
|
topic_data= []
|
||||||
topic_list = self.get_all_children()
|
for topic in self.topics:
|
||||||
topic_data = [frappe.get_doc("Topic", topic.topic) for topic in topic_list]
|
topic_doc = frappe.get_doc("Topic", topic.topic)
|
||||||
except frappe.DoesNotExistError:
|
if topic_doc.topic_content:
|
||||||
return None
|
topic_data.append(topic_doc)
|
||||||
return topic_data
|
return topic_data
|
@ -3,6 +3,7 @@
|
|||||||
# See license.txt
|
# See license.txt
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
from erpnext.education.doctype.topic.test_topic import make_topic
|
from erpnext.education.doctype.topic.test_topic import make_topic
|
||||||
|
from erpnext.education.doctype.topic.test_topic import make_topic_and_linked_content
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
import unittest
|
import unittest
|
||||||
@ -11,6 +12,8 @@ import unittest
|
|||||||
|
|
||||||
class TestCourse(unittest.TestCase):
|
class TestCourse(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
make_topic_and_linked_content("_Test Topic 1", [{"type":"Article", "name": "_Test Article 1"}])
|
||||||
|
make_topic_and_linked_content("_Test Topic 2", [{"type":"Article", "name": "_Test Article 2"}])
|
||||||
make_course_and_linked_topic("_Test Course 1", ["_Test Topic 1", "_Test Topic 2"])
|
make_course_and_linked_topic("_Test Course 1", ["_Test Topic 1", "_Test Topic 2"])
|
||||||
|
|
||||||
def test_get_topics(self):
|
def test_get_topics(self):
|
||||||
|
@ -21,7 +21,10 @@ class CourseEnrollment(Document):
|
|||||||
progress = []
|
progress = []
|
||||||
for topic in topics:
|
for topic in topics:
|
||||||
progress.append(student.get_topic_progress(self.name, topic))
|
progress.append(student.get_topic_progress(self.name, topic))
|
||||||
|
if progress:
|
||||||
return reduce(lambda x,y: x+y, progress) # Flatten out the List
|
return reduce(lambda x,y: x+y, progress) # Flatten out the List
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
|
||||||
def validate_duplication(self):
|
def validate_duplication(self):
|
||||||
enrollment = frappe.get_all("Course Enrollment", filters={
|
enrollment = frappe.get_all("Course Enrollment", filters={
|
||||||
|
@ -1,492 +1,136 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
|
||||||
"allow_events_in_timeline": 0,
|
|
||||||
"allow_guest_to_view": 0,
|
|
||||||
"allow_import": 0,
|
|
||||||
"allow_rename": 0,
|
|
||||||
"beta": 0,
|
|
||||||
"creation": "2017-04-05 13:33:04.519313",
|
"creation": "2017-04-05 13:33:04.519313",
|
||||||
"custom": 0,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "",
|
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"current_academic_year",
|
||||||
|
"current_academic_term",
|
||||||
|
"attendance_freeze_date",
|
||||||
|
"column_break_4",
|
||||||
|
"validate_batch",
|
||||||
|
"validate_course",
|
||||||
|
"academic_term_reqd",
|
||||||
|
"section_break_7",
|
||||||
|
"instructor_created_by",
|
||||||
|
"web_academy_settings_section",
|
||||||
|
"enable_lms",
|
||||||
|
"portal_title",
|
||||||
|
"description"
|
||||||
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "current_academic_year",
|
"fieldname": "current_academic_year",
|
||||||
"fieldtype": "Link",
|
"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": "Current Academic Year",
|
"label": "Current Academic Year",
|
||||||
"length": 0,
|
"options": "Academic Year"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Academic Year",
|
|
||||||
"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": "current_academic_term",
|
"fieldname": "current_academic_term",
|
||||||
"fieldtype": "Link",
|
"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": "Current Academic Term",
|
"label": "Current Academic Term",
|
||||||
"length": 0,
|
"options": "Academic Term"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Academic Term",
|
|
||||||
"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": "attendance_freeze_date",
|
"fieldname": "attendance_freeze_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"label": "Attendance Freeze Date"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Attendance Freeze 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_4",
|
"fieldname": "column_break_4",
|
||||||
"fieldtype": "Column Break",
|
"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": "For Batch based Student Group, the Student Batch will be validated for every Student from the Program Enrollment.",
|
"description": "For Batch based Student Group, the Student Batch will be validated for every Student from the Program Enrollment.",
|
||||||
"fieldname": "validate_batch",
|
"fieldname": "validate_batch",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Validate Batch for Students in Student Group"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Validate Batch for Students in Student Group",
|
|
||||||
"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": "For Course based Student Group, the Course will be validated for every Student from the enrolled Courses in Program Enrollment.",
|
"description": "For Course based Student Group, the Course will be validated for every Student from the enrolled Courses in Program Enrollment.",
|
||||||
"fieldname": "validate_course",
|
"fieldname": "validate_course",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Validate Enrolled Course for Students in Student Group"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Validate Enrolled Course for Students in Student Group",
|
|
||||||
"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": "0",
|
"default": "0",
|
||||||
"description": "If enabled, field Academic Term will be Mandatory in Program Enrollment Tool.",
|
"description": "If enabled, field Academic Term will be Mandatory in Program Enrollment Tool.",
|
||||||
"fieldname": "academic_term_reqd",
|
"fieldname": "academic_term_reqd",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Make Academic Term Mandatory"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Make Academic Term Mandatory",
|
|
||||||
"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": "section_break_7",
|
"fieldname": "section_break_7",
|
||||||
"fieldtype": "Section Break",
|
"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,
|
|
||||||
"default": "Full Name",
|
"default": "Full Name",
|
||||||
"fieldname": "instructor_created_by",
|
"fieldname": "instructor_created_by",
|
||||||
"fieldtype": "Select",
|
"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": "Instructor Records to be created by",
|
"label": "Instructor Records to be created by",
|
||||||
"length": 0,
|
"options": "Full Name\nNaming Series\nEmployee Number"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Full Name\nNaming Series\nEmployee Number",
|
|
||||||
"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": "web_academy_settings_section",
|
"fieldname": "web_academy_settings_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"label": "LMS Settings"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "LMS Settings",
|
|
||||||
"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,
|
"depends_on": "eval: doc.enable_lms",
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "portal_title",
|
"fieldname": "portal_title",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"label": "LMS Title"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Portal Title",
|
|
||||||
"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,
|
"depends_on": "eval: doc.enable_lms",
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "description",
|
"fieldname": "description",
|
||||||
"fieldtype": "Small Text",
|
"fieldtype": "Small Text",
|
||||||
"hidden": 0,
|
"label": "Description"
|
||||||
"ignore_user_permissions": 0,
|
},
|
||||||
"ignore_xss_filter": 0,
|
{
|
||||||
"in_filter": 0,
|
"fieldname": "enable_lms",
|
||||||
"in_global_search": 0,
|
"fieldtype": "Check",
|
||||||
"in_list_view": 0,
|
"label": "Enable LMS"
|
||||||
"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
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
|
||||||
"hide_heading": 0,
|
|
||||||
"hide_toolbar": 0,
|
|
||||||
"idx": 0,
|
|
||||||
"image_view": 0,
|
|
||||||
"in_create": 0,
|
|
||||||
"is_submittable": 0,
|
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"istable": 0,
|
"modified": "2019-05-13 18:36:13.127563",
|
||||||
"max_attachments": 0,
|
|
||||||
"modified": "2018-12-11 15:49:15.045116",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Education",
|
"module": "Education",
|
||||||
"name": "Education Settings",
|
"name": "Education Settings",
|
||||||
"name_case": "",
|
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
"amend": 0,
|
|
||||||
"cancel": 0,
|
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"delete": 1,
|
"delete": 1,
|
||||||
"email": 1,
|
"email": 1,
|
||||||
"export": 0,
|
|
||||||
"if_owner": 0,
|
|
||||||
"import": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print": 1,
|
"print": 1,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 0,
|
|
||||||
"role": "System Manager",
|
"role": "System Manager",
|
||||||
"set_user_permissions": 0,
|
|
||||||
"share": 1,
|
"share": 1,
|
||||||
"submit": 0,
|
|
||||||
"write": 1
|
"write": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"amend": 0,
|
|
||||||
"cancel": 0,
|
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"delete": 1,
|
"delete": 1,
|
||||||
"email": 1,
|
"email": 1,
|
||||||
"export": 0,
|
|
||||||
"if_owner": 0,
|
|
||||||
"import": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print": 1,
|
"print": 1,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 0,
|
|
||||||
"role": "Education Manager",
|
"role": "Education Manager",
|
||||||
"set_user_permissions": 0,
|
|
||||||
"share": 1,
|
"share": 1,
|
||||||
"submit": 0,
|
|
||||||
"write": 1
|
"write": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"amend": 0,
|
|
||||||
"cancel": 0,
|
|
||||||
"create": 0,
|
|
||||||
"delete": 0,
|
|
||||||
"email": 1,
|
"email": 1,
|
||||||
"export": 0,
|
|
||||||
"if_owner": 0,
|
|
||||||
"import": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print": 1,
|
"print": 1,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 0,
|
|
||||||
"role": "Guest",
|
"role": "Guest",
|
||||||
"set_user_permissions": 0,
|
"share": 1
|
||||||
"share": 1,
|
|
||||||
"submit": 0,
|
|
||||||
"write": 0
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"read_only": 0,
|
|
||||||
"read_only_onload": 0,
|
|
||||||
"restrict_to_domain": "Education",
|
"restrict_to_domain": "Education",
|
||||||
"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_views": 0
|
|
||||||
}
|
}
|
@ -34,3 +34,6 @@ class EducationSettings(Document):
|
|||||||
make_property_setter('Instructor', "naming_series", "hidden", 0, "Check")
|
make_property_setter('Instructor', "naming_series", "hidden", 0, "Check")
|
||||||
else:
|
else:
|
||||||
make_property_setter('Instructor', "naming_series", "hidden", 1, "Check")
|
make_property_setter('Instructor', "naming_series", "hidden", 1, "Check")
|
||||||
|
|
||||||
|
def update_website_context(context):
|
||||||
|
context["lms_enabled"] = frappe.get_doc("Education Settings").enable_lms
|
@ -9,6 +9,6 @@ from frappe.model.document import Document
|
|||||||
class Program(Document):
|
class Program(Document):
|
||||||
|
|
||||||
def get_course_list(self):
|
def get_course_list(self):
|
||||||
program_course_list = self.get_all_children()
|
program_course_list = self.courses
|
||||||
course_list = [frappe.get_doc("Course", program_course.course) for program_course in program_course_list]
|
course_list = [frappe.get_doc("Course", program_course.course) for program_course in program_course_list]
|
||||||
return course_list
|
return course_list
|
@ -90,6 +90,7 @@ class Student(Document):
|
|||||||
"""
|
"""
|
||||||
contents = topic.get_contents()
|
contents = topic.get_contents()
|
||||||
progress = []
|
progress = []
|
||||||
|
if contents:
|
||||||
for content in contents:
|
for content in contents:
|
||||||
if content.doctype in ('Article', 'Video'):
|
if content.doctype in ('Article', 'Video'):
|
||||||
status = check_content_completion(content.name, content.doctype, course_enrollment_name)
|
status = check_content_completion(content.name, content.doctype, course_enrollment_name)
|
||||||
|
@ -9,7 +9,7 @@ from frappe.model.document import Document
|
|||||||
class Topic(Document):
|
class Topic(Document):
|
||||||
def get_contents(self):
|
def get_contents(self):
|
||||||
try:
|
try:
|
||||||
topic_content_list = self.get_all_children()
|
topic_content_list = self.topic_content
|
||||||
content_data = [frappe.get_doc(topic_content.content_type, topic_content.content) for topic_content in topic_content_list]
|
content_data = [frappe.get_doc(topic_content.content_type, topic_content.content) for topic_content in topic_content_list]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
frappe.log_error(frappe.get_traceback())
|
frappe.log_error(frappe.get_traceback())
|
||||||
|
@ -1,140 +1,44 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
|
||||||
"allow_events_in_timeline": 0,
|
|
||||||
"allow_guest_to_view": 0,
|
|
||||||
"allow_import": 0,
|
|
||||||
"allow_rename": 0,
|
|
||||||
"beta": 0,
|
|
||||||
"creation": "2018-12-12 11:42:57.987434",
|
"creation": "2018-12-12 11:42:57.987434",
|
||||||
"custom": 0,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "",
|
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"content_type",
|
||||||
|
"column_break_2",
|
||||||
|
"content"
|
||||||
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "content_type",
|
"fieldname": "content_type",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Content Type",
|
"label": "Content Type",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "\nArticle\nVideo\nQuiz",
|
"options": "\nArticle\nVideo\nQuiz",
|
||||||
"permlevel": 0,
|
"reqd": 1
|
||||||
"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_2",
|
"fieldname": "column_break_2",
|
||||||
"fieldtype": "Column Break",
|
"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": "content",
|
"fieldname": "content",
|
||||||
"fieldtype": "Dynamic Link",
|
"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_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Content",
|
"label": "Content",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "content_type",
|
"options": "content_type",
|
||||||
"permlevel": 0,
|
"reqd": 1
|
||||||
"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": 0,
|
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"modified": "2019-05-14 11:12:49.153771",
|
||||||
"modified": "2018-12-12 11:46:46.112018",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Education",
|
"module": "Education",
|
||||||
"name": "Topic Content",
|
"name": "Topic Content",
|
||||||
"name_case": "",
|
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [],
|
"permissions": [],
|
||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"read_only": 0,
|
|
||||||
"read_only_onload": 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_views": 0
|
|
||||||
}
|
}
|
@ -186,7 +186,7 @@ def link_item(item_data,item_status):
|
|||||||
item.item_name = str(item_data.get("name"))
|
item.item_name = str(item_data.get("name"))
|
||||||
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.stock_uom = woocommerce_settings.uom or _("Nos")
|
||||||
item.save()
|
item.save()
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
from frappe import _
|
from frappe import _
|
||||||
|
from frappe.utils.nestedset import get_root_of
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from six.moves.urllib.parse import urlparse
|
from six.moves.urllib.parse import urlparse
|
||||||
|
|
||||||
@ -62,10 +62,10 @@ class WoocommerceSettings(Document):
|
|||||||
custom.read_only = 1
|
custom.read_only = 1
|
||||||
custom.save()
|
custom.save()
|
||||||
|
|
||||||
if not frappe.get_value("Item Group",{"name": "WooCommerce Products"}):
|
if not frappe.get_value("Item Group",{"name": _("WooCommerce Products")}):
|
||||||
item_group = frappe.new_doc("Item Group")
|
item_group = frappe.new_doc("Item Group")
|
||||||
item_group.item_group_name = "WooCommerce Products"
|
item_group.item_group_name = _("WooCommerce Products")
|
||||||
item_group.parent_item_group = _("All Item Groups")
|
item_group.parent_item_group = get_root_of("Item Group")
|
||||||
item_group.save()
|
item_group.save()
|
||||||
|
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ class WoocommerceSettings(Document):
|
|||||||
for name in email_names:
|
for name in email_names:
|
||||||
frappe.delete_doc("Custom Field",name)
|
frappe.delete_doc("Custom Field",name)
|
||||||
|
|
||||||
frappe.delete_doc("Item Group","WooCommerce Products")
|
frappe.delete_doc("Item Group", _("WooCommerce Products"))
|
||||||
|
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ on_logout = "erpnext.shopping_cart.utils.clear_cart_count"
|
|||||||
treeviews = ['Account', 'Cost Center', 'Warehouse', 'Item Group', 'Customer Group', 'Sales Person', 'Territory', 'Assessment Group']
|
treeviews = ['Account', 'Cost Center', 'Warehouse', 'Item Group', 'Customer Group', 'Sales Person', 'Territory', 'Assessment Group']
|
||||||
|
|
||||||
# website
|
# website
|
||||||
update_website_context = "erpnext.shopping_cart.utils.update_website_context"
|
update_website_context = ["erpnext.shopping_cart.utils.update_website_context", "erpnext.education.doctype.education_settings.education_settings.update_website_context"]
|
||||||
my_account_context = "erpnext.shopping_cart.utils.update_my_account_context"
|
my_account_context = "erpnext.shopping_cart.utils.update_my_account_context"
|
||||||
|
|
||||||
email_append_to = ["Job Applicant", "Lead", "Opportunity", "Issue"]
|
email_append_to = ["Job Applicant", "Lead", "Opportunity", "Issue"]
|
||||||
|
@ -3,13 +3,8 @@
|
|||||||
|
|
||||||
frappe.ui.form.on('Additional Salary', {
|
frappe.ui.form.on('Additional Salary', {
|
||||||
setup: function(frm) {
|
setup: function(frm) {
|
||||||
frm.set_query("salary_component", function() {
|
frm.add_fetch("salary_component", "deduct_full_tax_on_selected_payroll_date", "deduct_full_tax_on_selected_payroll_date");
|
||||||
return {
|
|
||||||
filters: {
|
|
||||||
is_additional_component: true
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
frm.set_query("employee", function() {
|
frm.set_query("employee", function() {
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
|
"allow_events_in_timeline": 0,
|
||||||
"allow_guest_to_view": 0,
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
@ -21,6 +22,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 +56,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "employee",
|
"fieldname": "employee",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -87,6 +90,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "salary_component",
|
"fieldname": "salary_component",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -120,6 +124,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "amount",
|
"fieldname": "amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -153,6 +158,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "1",
|
"default": "1",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "overwrite_salary_structure_amount",
|
"fieldname": "overwrite_salary_structure_amount",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -185,6 +191,40 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "deduct_full_tax_on_selected_payroll_date",
|
||||||
|
"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": "Deduct Full Tax on Selected Payroll 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_5",
|
"fieldname": "column_break_5",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -217,6 +257,8 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "",
|
"default": "",
|
||||||
|
"description": "Date on which this component is applied",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "payroll_date",
|
"fieldname": "payroll_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -250,6 +292,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fetch_from": "employee.employee_name",
|
"fetch_from": "employee.employee_name",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "employee_name",
|
"fieldname": "employee_name",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -284,6 +327,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fetch_from": "employee.department",
|
"fetch_from": "employee.department",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "department",
|
"fieldname": "department",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -317,6 +361,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,
|
||||||
@ -350,6 +395,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "salary_slip",
|
"fieldname": "salary_slip",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -384,6 +430,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fetch_from": "salary_component.type",
|
"fetch_from": "salary_component.type",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "type",
|
"fieldname": "type",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -417,6 +464,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,
|
||||||
@ -453,7 +501,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-08-21 14:44:22.921926",
|
"modified": "2019-05-09 19:53:37.475839",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Additional Salary",
|
"name": "Additional Salary",
|
||||||
|
@ -9,6 +9,12 @@ from frappe import _
|
|||||||
from frappe.utils import getdate, date_diff
|
from frappe.utils import getdate, date_diff
|
||||||
|
|
||||||
class AdditionalSalary(Document):
|
class AdditionalSalary(Document):
|
||||||
|
def before_insert(self):
|
||||||
|
if frappe.db.exists("Additional Salary", {"employee": self.employee, "salary_component": self.salary_component,
|
||||||
|
"amount": self.amount, "payroll_date": self.payroll_date, "company": self.company}):
|
||||||
|
|
||||||
|
frappe.throw(_("Additional Salary Component Exists."))
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_dates()
|
self.validate_dates()
|
||||||
if self.amount < 0:
|
if self.amount < 0:
|
||||||
@ -35,7 +41,8 @@ class AdditionalSalary(Document):
|
|||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_additional_salary_component(employee, start_date, end_date):
|
def get_additional_salary_component(employee, start_date, end_date):
|
||||||
additional_components = frappe.db.sql("""
|
additional_components = frappe.db.sql("""
|
||||||
select salary_component, sum(amount) as amount, overwrite_salary_structure_amount from `tabAdditional Salary`
|
select salary_component, sum(amount) as amount, overwrite_salary_structure_amount, deduct_full_tax_on_selected_payroll_date
|
||||||
|
from `tabAdditional Salary`
|
||||||
where employee=%(employee)s
|
where employee=%(employee)s
|
||||||
and docstatus = 1
|
and docstatus = 1
|
||||||
and payroll_date between %(from_date)s and %(to_date)s
|
and payroll_date between %(from_date)s and %(to_date)s
|
||||||
@ -48,16 +55,20 @@ def get_additional_salary_component(employee, start_date, end_date):
|
|||||||
}, as_dict=1)
|
}, as_dict=1)
|
||||||
|
|
||||||
additional_components_list = []
|
additional_components_list = []
|
||||||
|
component_fields = ["depends_on_payment_days", "salary_component_abbr", "is_tax_applicable", "variable_based_on_taxable_salary", 'type']
|
||||||
for d in additional_components:
|
for d in additional_components:
|
||||||
component = frappe.get_doc("Salary Component", d.salary_component)
|
struct_row = frappe._dict({'salary_component': d.salary_component})
|
||||||
struct_row = {'salary_component': d.salary_component}
|
component = frappe.get_all("Salary Component", filters={'name': d.salary_component}, fields=component_fields)
|
||||||
for field in ["depends_on_payment_days", "abbr", "is_tax_applicable", "variable_based_on_taxable_salary", "is_additional_component"]:
|
if component:
|
||||||
struct_row[field] = component.get(field)
|
struct_row.update(component[0])
|
||||||
|
|
||||||
additional_components_list.append({
|
struct_row['deduct_full_tax_on_selected_payroll_date'] = d.deduct_full_tax_on_selected_payroll_date
|
||||||
|
struct_row['is_additional_component'] = 1
|
||||||
|
|
||||||
|
additional_components_list.append(frappe._dict({
|
||||||
'amount': d.amount,
|
'amount': d.amount,
|
||||||
'type': component.type,
|
'type': component[0].type,
|
||||||
'struct_row': struct_row,
|
'struct_row': struct_row,
|
||||||
'overwrite': d.overwrite_salary_structure_amount
|
'overwrite': d.overwrite_salary_structure_amount,
|
||||||
})
|
}))
|
||||||
return additional_components_list
|
return additional_components_list
|
@ -1,49 +1,42 @@
|
|||||||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
// License: GNU General Public License v3. See license.txt
|
// License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
cur_frm.add_fetch('employee', 'company', 'company');
|
frappe.ui.form.on('Appraisal', {
|
||||||
cur_frm.add_fetch('employee', 'employee_name', 'employee_name');
|
setup: function(frm) {
|
||||||
|
frm.add_fetch('employee', 'company', 'company');
|
||||||
|
frm.add_fetch('employee', 'employee_name', 'employee_name');
|
||||||
|
frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
|
||||||
|
return{ query: "erpnext.controllers.queries.employee_query" }
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
cur_frm.cscript.onload = function(doc,cdt,cdn){
|
onload: function(frm) {
|
||||||
if(!doc.status)
|
if(!frm.doc.status) {
|
||||||
set_multiple(cdt,cdn,{status:'Draft'});
|
frm.set_value('status', 'Draft');
|
||||||
if(doc.amended_from && doc.__islocal) {
|
|
||||||
doc.status = "Draft";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
cur_frm.cscript.onload_post_render = function(doc,cdt,cdn){
|
kra_template: function(frm) {
|
||||||
if(doc.__islocal && doc.employee==frappe.defaults.get_user_default("Employee")) {
|
frm.doc.goals = [];
|
||||||
cur_frm.set_value("employee", "");
|
|
||||||
cur_frm.set_value("employee_name", "")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_frm.cscript.refresh = function(doc,cdt,cdn){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_frm.cscript.kra_template = function(doc, dt, dn) {
|
|
||||||
doc.goals = [];
|
|
||||||
erpnext.utils.map_current_doc({
|
erpnext.utils.map_current_doc({
|
||||||
method: "erpnext.hr.doctype.appraisal.appraisal.fetch_appraisal_template",
|
method: "erpnext.hr.doctype.appraisal.appraisal.fetch_appraisal_template",
|
||||||
source_name: cur_frm.doc.kra_template,
|
source_name: frm.doc.kra_template,
|
||||||
frm: cur_frm
|
frm: frm
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
|
||||||
cur_frm.cscript.calculate_total_score = function(doc,cdt,cdn){
|
calculate_total: function(frm) {
|
||||||
//return get_server_fields('calculate_total','','',doc,cdt,cdn,1);
|
let goals = frm.doc.goals || [];
|
||||||
var val = doc.goals || [];
|
let total =0;
|
||||||
var total =0;
|
for(let i = 0; i<goals.length; i++){
|
||||||
for(var i = 0; i<val.length; i++){
|
total = flt(total)+flt(goals[i].score_earned)
|
||||||
total = flt(total)+flt(val[i].score_earned)
|
|
||||||
}
|
}
|
||||||
doc.total_score = flt(total)
|
frm.set_value('total_score', total);
|
||||||
refresh_field('total_score')
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
cur_frm.cscript.score = function(doc,cdt,cdn){
|
frappe.ui.form.on('Appraisal Goal', {
|
||||||
|
score: function(frm, cdt, cdn) {
|
||||||
var d = locals[cdt][cdn];
|
var d = locals[cdt][cdn];
|
||||||
if (d.score) {
|
if (d.score) {
|
||||||
if (flt(d.score) > 5) {
|
if (flt(d.score) > 5) {
|
||||||
@ -51,27 +44,11 @@ cur_frm.cscript.score = function(doc,cdt,cdn){
|
|||||||
d.score = 0;
|
d.score = 0;
|
||||||
refresh_field('score', d.name, 'goals');
|
refresh_field('score', d.name, 'goals');
|
||||||
}
|
}
|
||||||
var total = flt(d.per_weightage*d.score)/100;
|
d.score_earned = flt(d.per_weightage*d.score, precision("score_earned", d))/100;
|
||||||
d.score_earned = total.toPrecision(2);
|
} else {
|
||||||
refresh_field('score_earned', d.name, 'goals');
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
d.score_earned = 0;
|
d.score_earned = 0;
|
||||||
|
}
|
||||||
refresh_field('score_earned', d.name, 'goals');
|
refresh_field('score_earned', d.name, 'goals');
|
||||||
|
frm.trigger('calculate_total');
|
||||||
}
|
}
|
||||||
cur_frm.cscript.calculate_total(doc,cdt,cdn);
|
});
|
||||||
}
|
|
||||||
|
|
||||||
cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
|
|
||||||
var val = doc.goals || [];
|
|
||||||
var total =0;
|
|
||||||
for(var i = 0; i<val.length; i++){
|
|
||||||
total = flt(total)+flt(val[i].score_earned);
|
|
||||||
}
|
|
||||||
doc.total_score = flt(total);
|
|
||||||
refresh_field('total_score');
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_frm.fields_dict.employee.get_query = function(doc,cdt,cdn) {
|
|
||||||
return{ query: "erpnext.controllers.queries.employee_query" }
|
|
||||||
}
|
|
@ -3,13 +3,18 @@
|
|||||||
|
|
||||||
frappe.ui.form.on('Employee Benefit Application', {
|
frappe.ui.form.on('Employee Benefit Application', {
|
||||||
setup: function(frm) {
|
setup: function(frm) {
|
||||||
|
if(!frm.doc.employee || !frm.doc.date) {
|
||||||
|
frappe.throw(__("Please select Employee and Date first"));
|
||||||
|
} else {
|
||||||
frm.set_query("earning_component", "employee_benefits", function() {
|
frm.set_query("earning_component", "employee_benefits", function() {
|
||||||
return {
|
return {
|
||||||
query : "erpnext.hr.doctype.employee_benefit_application.employee_benefit_application.get_earning_components",
|
query : "erpnext.hr.doctype.employee_benefit_application.employee_benefit_application.get_earning_components",
|
||||||
filters: {date: frm.doc.date, employee: frm.doc.employee}
|
filters: {date: frm.doc.date, employee: frm.doc.employee}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
employee: function(frm) {
|
employee: function(frm) {
|
||||||
var method, args;
|
var method, args;
|
||||||
if(frm.doc.employee && frm.doc.date && frm.doc.payroll_period){
|
if(frm.doc.employee && frm.doc.date && frm.doc.payroll_period){
|
||||||
|
@ -7,7 +7,7 @@ import frappe
|
|||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.utils import date_diff, getdate, rounded, add_days, cstr, cint, flt
|
from frappe.utils import date_diff, getdate, rounded, add_days, cstr, cint, flt
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from erpnext.hr.doctype.payroll_period.payroll_period import get_payroll_period_days
|
from erpnext.hr.doctype.payroll_period.payroll_period import get_payroll_period_days, get_period_factor
|
||||||
from erpnext.hr.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure
|
from erpnext.hr.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure
|
||||||
from erpnext.hr.utils import get_sal_slip_total_benefit_given, get_holidays_for_employee, get_previous_claimed_amount
|
from erpnext.hr.utils import get_sal_slip_total_benefit_given, get_holidays_for_employee, get_previous_claimed_amount
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ def get_max_benefits_remaining(employee, on_date, payroll_period):
|
|||||||
salary_component = frappe.get_doc("Salary Component", sal_struct_row.salary_component)
|
salary_component = frappe.get_doc("Salary Component", sal_struct_row.salary_component)
|
||||||
if salary_component.depends_on_payment_days == 1 and salary_component.pay_against_benefit_claim != 1:
|
if salary_component.depends_on_payment_days == 1 and salary_component.pay_against_benefit_claim != 1:
|
||||||
have_depends_on_payment_days = True
|
have_depends_on_payment_days = True
|
||||||
benefit_amount = get_benefit_pro_rata_ratio_amount(sal_struct, salary_component.max_benefit_amount)
|
benefit_amount = get_benefit_amount_based_on_pro_rata(sal_struct, salary_component.max_benefit_amount)
|
||||||
amount_per_day = benefit_amount / payroll_period_days
|
amount_per_day = benefit_amount / payroll_period_days
|
||||||
per_day_amount_total += amount_per_day
|
per_day_amount_total += amount_per_day
|
||||||
|
|
||||||
@ -167,16 +167,14 @@ def calculate_lwp(employee, start_date, holidays, working_days):
|
|||||||
lwp = cint(leave[0][1]) and (lwp + 0.5) or (lwp + 1)
|
lwp = cint(leave[0][1]) and (lwp + 0.5) or (lwp + 1)
|
||||||
return lwp
|
return lwp
|
||||||
|
|
||||||
def get_benefit_component_amount(employee, start_date, end_date, struct_row, sal_struct, period_length, frequency):
|
def get_benefit_component_amount(employee, start_date, end_date, salary_component, sal_struct, payroll_frequency, payroll_period):
|
||||||
payroll_period, period_factor, actual_payroll_days = get_payroll_period_days(start_date, end_date, employee)
|
|
||||||
|
|
||||||
if not payroll_period:
|
if not payroll_period:
|
||||||
frappe.msgprint(_("Start and end dates not in a valid Payroll Period, cannot calculate {0}.")
|
frappe.msgprint(_("Start and end dates not in a valid Payroll Period, cannot calculate {0}")
|
||||||
.format(struct_row.salary_component))
|
.format(salary_component))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Considering there is only one application for a year
|
# Considering there is only one application for a year
|
||||||
benefit_application_name = frappe.db.sql("""
|
benefit_application = frappe.db.sql("""
|
||||||
select name
|
select name
|
||||||
from `tabEmployee Benefit Application`
|
from `tabEmployee Benefit Application`
|
||||||
where
|
where
|
||||||
@ -185,69 +183,58 @@ def get_benefit_component_amount(employee, start_date, end_date, struct_row, sal
|
|||||||
and docstatus = 1
|
and docstatus = 1
|
||||||
""", {
|
""", {
|
||||||
'employee': employee,
|
'employee': employee,
|
||||||
'payroll_period': payroll_period
|
'payroll_period': payroll_period.name
|
||||||
})
|
})
|
||||||
|
|
||||||
if frappe.db.get_value("Salary Component", struct_row.salary_component, "depends_on_payment_days") != 1:
|
current_benefit_amount = 0.0
|
||||||
if frequency == "Monthly" and actual_payroll_days in range(360, 370):
|
component_max_benefit, depends_on_payment_days = frappe.db.get_value("Salary Component",
|
||||||
period_length = 1
|
salary_component, ["max_benefit_amount", "depends_on_payment_days"])
|
||||||
period_factor = 12
|
|
||||||
|
|
||||||
if period_factor:
|
if benefit_application:
|
||||||
# If there is application for benefit then fetch the amount from the application.
|
benefit_amount = frappe.db.get_value("Employee Benefit Application Detail",
|
||||||
# else Split the max benefits to the pro-rata components with the ratio of their max_benefit_amount
|
{"parent": benefit_application[0][0], "earning_component": salary_component}, "amount")
|
||||||
if benefit_application_name:
|
elif component_max_benefit:
|
||||||
benefit_application = frappe.get_doc("Employee Benefit Application", benefit_application_name[0][0])
|
benefit_amount = get_benefit_amount_based_on_pro_rata(sal_struct, component_max_benefit)
|
||||||
return get_benefit_amount(benefit_application, struct_row, period_factor, period_length)
|
|
||||||
|
|
||||||
# TODO: Check if there is benefit claim for employee then pro-rata divide the rest of amount (Late Benefit Application)
|
current_benefit_amount = 0
|
||||||
else:
|
if benefit_amount:
|
||||||
component_max = frappe.db.get_value("Salary Component", struct_row.salary_component, "max_benefit_amount")
|
total_sub_periods = get_period_factor(employee,
|
||||||
if component_max:
|
start_date, end_date, payroll_frequency, payroll_period, depends_on_payment_days)[0]
|
||||||
benefit_amount = get_benefit_pro_rata_ratio_amount(sal_struct, component_max)
|
|
||||||
return get_amount(period_factor, benefit_amount, period_length)
|
|
||||||
return False
|
|
||||||
|
|
||||||
def get_benefit_pro_rata_ratio_amount(sal_struct, component_max):
|
current_benefit_amount = benefit_amount / total_sub_periods
|
||||||
total_pro_rata_max = 0
|
|
||||||
|
return current_benefit_amount
|
||||||
|
|
||||||
|
def get_benefit_amount_based_on_pro_rata(sal_struct, component_max_benefit):
|
||||||
|
max_benefits_total = 0
|
||||||
benefit_amount = 0
|
benefit_amount = 0
|
||||||
for sal_struct_row in sal_struct.get("earnings"):
|
for d in sal_struct.get("earnings"):
|
||||||
pay_against_benefit_claim, max_benefit_amount = frappe.db.get_value("Salary Component",
|
if d.is_flexible_benefit == 1:
|
||||||
sal_struct_row.salary_component, ["pay_against_benefit_claim", "max_benefit_amount"])
|
component = frappe.db.get_value("Salary Component", d.salary_component, ["max_benefit_amount", "pay_against_benefit_claim"], as_dict=1)
|
||||||
if sal_struct_row.is_flexible_benefit == 1 and pay_against_benefit_claim != 1:
|
if not component.pay_against_benefit_claim:
|
||||||
total_pro_rata_max += max_benefit_amount
|
max_benefits_total += component.max_benefit_amount
|
||||||
if total_pro_rata_max > 0:
|
|
||||||
benefit_amount = component_max * sal_struct.max_benefits / total_pro_rata_max
|
if max_benefits_total > 0:
|
||||||
if benefit_amount > component_max:
|
benefit_amount = sal_struct.max_benefits * component.max_benefit_amount / max_benefits_total
|
||||||
benefit_amount = component_max
|
if benefit_amount > component_max_benefit:
|
||||||
|
benefit_amount = component_max_benefit
|
||||||
|
|
||||||
return benefit_amount
|
return benefit_amount
|
||||||
|
|
||||||
def get_benefit_amount(application, struct_row, period_factor, period_length):
|
|
||||||
amount = 0
|
|
||||||
for employee_benefit in application.employee_benefits:
|
|
||||||
if employee_benefit.earning_component == struct_row.salary_component:
|
|
||||||
amount += get_amount(period_factor, employee_benefit.amount, period_length)
|
|
||||||
return amount if amount > 0 else False
|
|
||||||
|
|
||||||
def get_amount(period_factor, amount, period_length):
|
|
||||||
amount_per_day = amount / period_factor
|
|
||||||
total_amount = amount_per_day * period_length
|
|
||||||
return total_amount
|
|
||||||
|
|
||||||
def get_earning_components(doctype, txt, searchfield, start, page_len, filters):
|
def get_earning_components(doctype, txt, searchfield, start, page_len, filters):
|
||||||
if len(filters) < 2:
|
if len(filters) < 2:
|
||||||
return {}
|
return {}
|
||||||
employee = filters['employee']
|
|
||||||
date = filters['date']
|
salary_structure = get_assigned_salary_structure(filters['employee'], filters['date'])
|
||||||
salary_structure = get_assigned_salary_structure(employee, date)
|
|
||||||
|
|
||||||
if salary_structure:
|
if salary_structure:
|
||||||
query = """select salary_component from `tabSalary Detail` where parent = '{salary_structure}'
|
return frappe.db.sql("""
|
||||||
and is_flexible_benefit = 1
|
select salary_component
|
||||||
order by name"""
|
from `tabSalary Detail`
|
||||||
|
where parent = %s and is_flexible_benefit = 1
|
||||||
return frappe.db.sql(query.format(**{
|
order by name
|
||||||
"salary_structure": salary_structure
|
""", salary_structure)
|
||||||
}))
|
else:
|
||||||
|
frappe.throw(_("Salary Structure not found for employee {0} and date {1}")
|
||||||
return {}
|
.format(filters['employee'], filters['date']))
|
@ -5,9 +5,11 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
|
from frappe.utils import flt
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from erpnext.hr.doctype.employee_benefit_application.employee_benefit_application import get_max_benefits
|
from erpnext.hr.doctype.employee_benefit_application.employee_benefit_application import get_max_benefits
|
||||||
from erpnext.hr.utils import get_payroll_period, get_previous_claimed_amount
|
from erpnext.hr.utils import get_previous_claimed_amount
|
||||||
|
from erpnext.hr.doctype.payroll_period.payroll_period import get_payroll_period
|
||||||
from erpnext.hr.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure
|
from erpnext.hr.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure
|
||||||
|
|
||||||
class EmployeeBenefitClaim(Document):
|
class EmployeeBenefitClaim(Document):
|
||||||
@ -97,31 +99,28 @@ def get_benefit_pro_rata_ratio_amount(employee, on_date, sal_struct):
|
|||||||
benefit_amount_total += benefit_amount
|
benefit_amount_total += benefit_amount
|
||||||
return benefit_amount_total
|
return benefit_amount_total
|
||||||
|
|
||||||
def get_benefit_claim_amount(employee, start_date, end_date, salary_component):
|
def get_benefit_claim_amount(employee, start_date, end_date, salary_component=None):
|
||||||
query = """select claimed_amount from `tabEmployee Benefit Claim`
|
query = """
|
||||||
where employee=%(employee)s
|
select sum(claimed_amount)
|
||||||
and docstatus = 1 and pay_against_benefit_claim = 1
|
from `tabEmployee Benefit Claim`
|
||||||
|
where
|
||||||
|
employee=%(employee)s
|
||||||
|
and docstatus = 1
|
||||||
|
and pay_against_benefit_claim = 1
|
||||||
|
and claim_date between %(start_date)s and %(end_date)s
|
||||||
"""
|
"""
|
||||||
if not start_date:
|
|
||||||
query += "and claim_date <= %(end_date)s"
|
|
||||||
else:
|
|
||||||
query += "and (claim_date between %(start_date)s and %(end_date)s)"
|
|
||||||
|
|
||||||
if salary_component:
|
if salary_component:
|
||||||
query += " and earning_component = %(earning_component)s"
|
query += " and earning_component = %(earning_component)s"
|
||||||
|
|
||||||
benefit_claim_details = frappe.db.sql(query, {
|
claimed_amount = flt(frappe.db.sql(query, {
|
||||||
'employee': employee,
|
'employee': employee,
|
||||||
'start_date': start_date,
|
'start_date': start_date,
|
||||||
'end_date': end_date,
|
'end_date': end_date,
|
||||||
'earning_component': salary_component
|
'earning_component': salary_component
|
||||||
}, as_dict = True)
|
})[0][0])
|
||||||
if benefit_claim_details:
|
|
||||||
claimed_amount = 0
|
|
||||||
for claim_detail in benefit_claim_details:
|
|
||||||
claimed_amount += claim_detail.claimed_amount
|
|
||||||
return claimed_amount
|
return claimed_amount
|
||||||
return False
|
|
||||||
|
|
||||||
def get_total_benefit_dispensed(employee, sal_struct, sal_slip_start_date, payroll_period):
|
def get_total_benefit_dispensed(employee, sal_struct, sal_slip_start_date, payroll_period):
|
||||||
pro_rata_amount = 0
|
pro_rata_amount = 0
|
||||||
@ -140,11 +139,11 @@ def get_total_benefit_dispensed(employee, sal_struct, sal_slip_start_date, payro
|
|||||||
else:
|
else:
|
||||||
pro_rata_amount = get_benefit_pro_rata_ratio_amount(employee, sal_slip_start_date, sal_struct)
|
pro_rata_amount = get_benefit_pro_rata_ratio_amount(employee, sal_slip_start_date, sal_struct)
|
||||||
|
|
||||||
claimed_amount += get_benefit_claim_amount(employee, payroll_period.start_date, payroll_period.end_date, False)
|
claimed_amount += get_benefit_claim_amount(employee, payroll_period.start_date, payroll_period.end_date)
|
||||||
|
|
||||||
return claimed_amount + pro_rata_amount
|
return claimed_amount + pro_rata_amount
|
||||||
|
|
||||||
def get_last_payroll_period_benefits(employee, sal_slip_start_date, sal_slip_end_date, current_flexi_amount, payroll_period, sal_struct):
|
def get_last_payroll_period_benefits(employee, sal_slip_start_date, sal_slip_end_date, payroll_period, sal_struct):
|
||||||
max_benefits = get_max_benefits(employee, payroll_period.end_date)
|
max_benefits = get_max_benefits(employee, payroll_period.end_date)
|
||||||
if not max_benefits:
|
if not max_benefits:
|
||||||
max_benefits = 0
|
max_benefits = 0
|
||||||
|
@ -446,6 +446,72 @@
|
|||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "other_incomes_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": "Other Incomes",
|
||||||
|
"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": "income_from_other_sources",
|
||||||
|
"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": "Income From Other Sources",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
"has_web_view": 0,
|
||||||
@ -458,7 +524,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2019-04-25 16:38:05.847925",
|
"modified": "2019-05-11 16:13:50.472670",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Employee Tax Exemption Declaration",
|
"name": "Employee Tax Exemption Declaration",
|
||||||
|
@ -25,7 +25,8 @@ class EmployeeTaxExemptionDeclaration(Document):
|
|||||||
filters = {
|
filters = {
|
||||||
"employee": self.employee,
|
"employee": self.employee,
|
||||||
"payroll_period": self.payroll_period,
|
"payroll_period": self.payroll_period,
|
||||||
"name": ["!=", self.name]
|
"name": ["!=", self.name],
|
||||||
|
"docstatus": ["!=", 2]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if duplicate:
|
if duplicate:
|
||||||
|
@ -448,6 +448,72 @@
|
|||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "other_incomes_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": "Other Incomes",
|
||||||
|
"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": "income_from_other_sources",
|
||||||
|
"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": "Income From Other Sources",
|
||||||
|
"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,
|
||||||
@ -558,7 +624,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2019-04-25 17:06:36.569549",
|
"modified": "2019-05-13 12:17:18.045171",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Employee Tax Exemption Proof Submission",
|
"name": "Employee Tax Exemption Proof Submission",
|
||||||
|
@ -219,7 +219,8 @@ frappe.ui.form.on("Expense Claim", {
|
|||||||
frm.fields_dict["cost_center"].get_query = function() {
|
frm.fields_dict["cost_center"].get_query = function() {
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
"company": frm.doc.company
|
"company": frm.doc.company,
|
||||||
|
"is_group": 0
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -230,7 +231,9 @@ frappe.ui.form.on("Expense Claim", {
|
|||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
"report_type": "Balance Sheet",
|
"report_type": "Balance Sheet",
|
||||||
"account_type": "Payable"
|
"account_type": "Payable",
|
||||||
|
"company": frm.doc.company,
|
||||||
|
"is_group": 0
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
20
erpnext/hr/doctype/expense_claim/expense_claim_dashboard.py
Normal file
20
erpnext/hr/doctype/expense_claim/expense_claim_dashboard.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
from frappe import _
|
||||||
|
|
||||||
|
def get_data():
|
||||||
|
return {
|
||||||
|
'fieldname': 'reference_name',
|
||||||
|
'internal_links': {
|
||||||
|
'Employee Advance': ['advances', 'employee_advance']
|
||||||
|
},
|
||||||
|
'transactions': [
|
||||||
|
{
|
||||||
|
'label': _('Payment'),
|
||||||
|
'items': ['Payment Entry', 'Journal Entry']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'label': _('Reference'),
|
||||||
|
'items': ['Employee Advance']
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
@ -79,6 +79,7 @@ def get_events(start, end, filters=None):
|
|||||||
filters.append(['Holiday', 'holiday_date', '>', getdate(start)])
|
filters.append(['Holiday', 'holiday_date', '>', getdate(start)])
|
||||||
if end:
|
if end:
|
||||||
filters.append(['Holiday', 'holiday_date', '<', getdate(end)])
|
filters.append(['Holiday', 'holiday_date', '<', getdate(end)])
|
||||||
|
|
||||||
return frappe.get_list('Holiday List',
|
return frappe.get_list('Holiday List',
|
||||||
fields=['name', '`tabHoliday`.holiday_date', '`tabHoliday`.description', '`tabHoliday List`.color'],
|
fields=['name', '`tabHoliday`.holiday_date', '`tabHoliday`.description', '`tabHoliday List`.color'],
|
||||||
filters = filters,
|
filters = filters,
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
frappe.views.calendar["Holiday List"] = {
|
frappe.views.calendar["Holiday List"] = {
|
||||||
field_map: {
|
field_map: {
|
||||||
"start": "from_date",
|
"start": "holiday_date",
|
||||||
"end": "to_date",
|
"end": "holiday_date",
|
||||||
"id": "name",
|
"id": "name",
|
||||||
"title": "description",
|
"title": "description",
|
||||||
"allDay": "allDay"
|
"allDay": "allDay"
|
||||||
|
@ -4,5 +4,20 @@
|
|||||||
frappe.ui.form.on('HR Settings', {
|
frappe.ui.form.on('HR Settings', {
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
encrypt_salary_slips_in_emails: function(frm) {
|
||||||
|
let encrypt_state = frm.doc.encrypt_salary_slips_in_emails;
|
||||||
|
frm.set_df_property('password_policy', 'reqd', encrypt_state);
|
||||||
|
},
|
||||||
|
|
||||||
|
validate: function(frm) {
|
||||||
|
let policy = frm.doc.password_policy;
|
||||||
|
if (policy) {
|
||||||
|
if (policy.includes(' ') || policy.includes('--')) {
|
||||||
|
frappe.msgprint("Password policy cannot contain spaces or simultaneous hyphens. The format will be restructured automatically");
|
||||||
|
}
|
||||||
|
frm.set_value('password_policy', policy.split(new RegExp(" |-", 'g')).filter((token) => token).join('-'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -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,
|
||||||
@ -13,10 +14,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": "employee_settings",
|
"fieldname": "employee_settings",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -43,12 +46,14 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"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": "",
|
"default": "",
|
||||||
"description": "Enter retirement age in years",
|
"description": "Enter retirement age in years",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "retirement_age",
|
"fieldname": "retirement_age",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -76,12 +81,14 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"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": "Naming Series",
|
"default": "Naming Series",
|
||||||
"description": "Employee record is created using selected field. ",
|
"description": "Employee record is created using selected field. ",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "emp_created_by",
|
"fieldname": "emp_created_by",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -109,11 +116,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"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": "",
|
"default": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "leave_approval_notification_template",
|
"fieldname": "leave_approval_notification_template",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -142,10 +151,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": "leave_status_notification_template",
|
"fieldname": "leave_status_notification_template",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -174,10 +185,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_4",
|
"fieldname": "column_break_4",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -204,11 +217,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"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,
|
||||||
"description": "Don't send Employee Birthday Reminders",
|
"description": "Don't send Employee Birthday Reminders",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "stop_birthday_reminders",
|
"fieldname": "stop_birthday_reminders",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -235,10 +250,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": "maintain_bill_work_hours_same",
|
"fieldname": "maintain_bill_work_hours_same",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -266,11 +283,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"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": "1",
|
"default": "1",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "leave_approver_mandatory_in_leave_application",
|
"fieldname": "leave_approver_mandatory_in_leave_application",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -298,11 +317,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"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": "1",
|
"default": "1",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "expense_approver_mandatory_in_expense_claim",
|
"fieldname": "expense_approver_mandatory_in_expense_claim",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -330,10 +351,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"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": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "payroll_settings",
|
"fieldname": "payroll_settings",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -360,11 +384,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"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,
|
||||||
"description": "If checked, Total no. of Working Days will include holidays, and this will reduce the value of Salary Per Day",
|
"description": "If checked, Total no. of Working Days will include holidays, and this will reduce the value of Salary Per Day",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "include_holidays_in_total_working_days",
|
"fieldname": "include_holidays_in_total_working_days",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -391,12 +417,14 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"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": "1",
|
"default": "1",
|
||||||
"description": "Emails salary slip to employee based on preferred email selected in Employee",
|
"description": "Emails salary slip to employee based on preferred email selected in Employee",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "email_salary_slip_to_employee",
|
"fieldname": "email_salary_slip_to_employee",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -424,10 +452,82 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"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: doc.email_salary_slip_to_employee == 1;",
|
||||||
|
"description": "The salary slip emailed to the employee will be password protected, the password will be generated based on the password policy.",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "encrypt_salary_slips_in_emails",
|
||||||
|
"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": "Encrypt Salary Slips in Emails",
|
||||||
|
"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.encrypt_salary_slips_in_emails == 1",
|
||||||
|
"description": "<b>Example:</b> SAL-{first_name}-{date_of_birth.year} <br>This will generate a password like SAL-Jane-1972",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "password_policy",
|
||||||
|
"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": "Password Policy",
|
||||||
|
"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": "max_working_hours_against_timesheet",
|
"fieldname": "max_working_hours_against_timesheet",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -455,10 +555,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": "leave_settings",
|
"fieldname": "leave_settings",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -481,14 +583,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": "show_leaves_of_all_department_members_in_calendar",
|
"fieldname": "show_leaves_of_all_department_members_in_calendar",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -511,22 +616,21 @@
|
|||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 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,
|
||||||
"icon": "fa fa-cog",
|
"icon": "fa fa-cog",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"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-05-03 15:36:13.015466",
|
"modified": "2019-04-25 15:08:12.983571",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "shivam@example.com",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "HR Settings",
|
"name": "HR Settings",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
@ -553,9 +657,9 @@
|
|||||||
],
|
],
|
||||||
"quick_entry": 0,
|
"quick_entry": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"read_only_onload": 0,
|
|
||||||
"show_name_in_global_search": 0,
|
"show_name_in_global_search": 0,
|
||||||
"sort_order": "ASC",
|
"sort_order": "ASC",
|
||||||
"track_changes": 0,
|
"track_changes": 0,
|
||||||
"track_seen": 0
|
"track_seen": 0,
|
||||||
|
"track_views": 0
|
||||||
}
|
}
|
@ -5,11 +5,21 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
from frappe import _
|
||||||
|
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class HRSettings(Document):
|
class HRSettings(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
self.set_naming_series()
|
||||||
|
self.validate_password_policy()
|
||||||
|
|
||||||
|
def set_naming_series(self):
|
||||||
from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series
|
from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series
|
||||||
set_by_naming_series("Employee", "employee_number",
|
set_by_naming_series("Employee", "employee_number",
|
||||||
self.get("emp_created_by")=="Naming Series", hide_name_field=True)
|
self.get("emp_created_by")=="Naming Series", hide_name_field=True)
|
||||||
|
|
||||||
|
def validate_password_policy(self):
|
||||||
|
if self.email_salary_slip_to_employee and self.encrypt_salary_slips_in_emails:
|
||||||
|
if not self.password_policy:
|
||||||
|
frappe.throw(_("Password policy for Salary Slips is not set"))
|
@ -1,32 +1,15 @@
|
|||||||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
// License: GNU General Public License v3. See license.txt
|
// License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
cur_frm.cscript.onload = function (doc, dt, dn) {
|
|
||||||
if (!doc.posting_date)
|
|
||||||
set_multiple(dt, dn, { posting_date: frappe.datetime.get_today() });
|
|
||||||
if (!doc.leave_transaction_type)
|
|
||||||
set_multiple(dt, dn, { leave_transaction_type: 'Allocation' });
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_frm.cscript.to_date = function (doc, cdt, cdn) {
|
|
||||||
return $c('runserverobj', { 'method': 'to_date_validation', 'docs': doc },
|
|
||||||
function (r, rt) {
|
|
||||||
var doc = locals[cdt][cdn];
|
|
||||||
if (r.message) {
|
|
||||||
frappe.msgprint(__("To date cannot be before from date"));
|
|
||||||
doc.to_date = '';
|
|
||||||
refresh_field('to_date');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_frm.cscript.allocation_type = function (doc, cdt, cdn) {
|
|
||||||
doc.no_of_days = '';
|
|
||||||
refresh_field('no_of_days');
|
|
||||||
}
|
|
||||||
|
|
||||||
frappe.ui.form.on("Leave Control Panel", {
|
frappe.ui.form.on("Leave Control Panel", {
|
||||||
|
onload: function(frm) {
|
||||||
|
if (!frm.doc.from_date) {
|
||||||
|
frm.set_value('from_date', frappe.datetime.get_today());
|
||||||
|
}
|
||||||
|
},
|
||||||
|
refresh: function(frm) {
|
||||||
|
frm.disable_save();
|
||||||
|
},
|
||||||
company: function(frm) {
|
company: function(frm) {
|
||||||
if(frm.doc.company) {
|
if(frm.doc.company) {
|
||||||
frm.set_query("department", function() {
|
frm.set_query("department", function() {
|
||||||
@ -37,8 +20,5 @@ frappe.ui.form.on("Leave Control Panel", {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
|
||||||
refresh: function(frm) {
|
|
||||||
frm.disable_save();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
@ -1,530 +1,150 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 1,
|
"allow_copy": 1,
|
||||||
"allow_guest_to_view": 0,
|
|
||||||
"allow_import": 0,
|
|
||||||
"allow_rename": 0,
|
|
||||||
"beta": 0,
|
|
||||||
"creation": "2013-01-10 16:34:15",
|
"creation": "2013-01-10 16:34:15",
|
||||||
"custom": 0,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"editable_grid": 0,
|
"field_order": [
|
||||||
|
"select_employees_section",
|
||||||
|
"company",
|
||||||
|
"employment_type",
|
||||||
|
"branch",
|
||||||
|
"column_break1",
|
||||||
|
"department",
|
||||||
|
"designation",
|
||||||
|
"employee_grade",
|
||||||
|
"employee",
|
||||||
|
"allocate_leaves_section",
|
||||||
|
"from_date",
|
||||||
|
"to_date",
|
||||||
|
"leave_policy",
|
||||||
|
"leave_type",
|
||||||
|
"carry_forward",
|
||||||
|
"no_of_days",
|
||||||
|
"allocate"
|
||||||
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "company",
|
"fieldname": "company",
|
||||||
"fieldtype": "Link",
|
"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",
|
"label": "Company",
|
||||||
"length": 0,
|
"options": "Company"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Company",
|
|
||||||
"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_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"description": "Leave blank if considered for all employee types",
|
|
||||||
"fieldname": "employment_type",
|
"fieldname": "employment_type",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"label": "Employment Type (optional)",
|
||||||
"label": "Employment Type",
|
"options": "Employment Type"
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Employment Type",
|
|
||||||
"permlevel": 0,
|
|
||||||
"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_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"description": "Leave blank if considered for all branches",
|
|
||||||
"fieldname": "branch",
|
"fieldname": "branch",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"label": "Branch (optional)",
|
||||||
"label": "Branch",
|
"options": "Branch"
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Branch",
|
|
||||||
"permlevel": 0,
|
|
||||||
"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_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"description": "Leave blank if considered for all departments",
|
|
||||||
"fieldname": "department",
|
"fieldname": "department",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"label": "Department (optional)",
|
||||||
"label": "Department",
|
"options": "Department"
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Department",
|
|
||||||
"permlevel": 0,
|
|
||||||
"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_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"description": "Leave blank if considered for all designations",
|
|
||||||
"fieldname": "designation",
|
"fieldname": "designation",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"label": "Designation (optional)",
|
||||||
"label": "Designation",
|
"options": "Designation"
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Designation",
|
|
||||||
"permlevel": 0,
|
|
||||||
"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_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "employee_grade",
|
"fieldname": "employee_grade",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"label": "Employee Grade (optional)",
|
||||||
"ignore_user_permissions": 0,
|
"options": "Employee Grade"
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Employee Grade",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Employee Grade",
|
|
||||||
"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_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "employee",
|
"fieldname": "employee",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"label": "Employee (optional)",
|
||||||
"ignore_user_permissions": 0,
|
"options": "Employee"
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Employee",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Employee",
|
|
||||||
"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_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break1",
|
"fieldname": "column_break1",
|
||||||
"fieldtype": "Column Break",
|
"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,
|
|
||||||
"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,
|
|
||||||
"width": "50%"
|
"width": "50%"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "from_date",
|
"fieldname": "from_date",
|
||||||
"fieldtype": "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": "From Date",
|
"label": "From Date",
|
||||||
"length": 0,
|
"reqd": 1
|
||||||
"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_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "to_date",
|
"fieldname": "to_date",
|
||||||
"fieldtype": "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": "To Date",
|
"label": "To Date",
|
||||||
"length": 0,
|
"reqd": 1
|
||||||
"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_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "leave_policy",
|
"fieldname": "leave_policy",
|
||||||
"fieldtype": "Link",
|
"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": "Leave Policy",
|
"label": "Leave Policy",
|
||||||
"length": 0,
|
"options": "Leave Policy"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Leave Policy",
|
|
||||||
"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_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "leave_type",
|
"fieldname": "leave_type",
|
||||||
"fieldtype": "Link",
|
"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": "Leave Type",
|
"label": "Leave Type",
|
||||||
"length": 0,
|
"options": "Leave Type"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Leave Type",
|
|
||||||
"permlevel": 0,
|
|
||||||
"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,
|
"default": "0",
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"description": "Please select Carry Forward if you also want to include previous fiscal year's balance leaves to this fiscal year",
|
"description": "Please select Carry Forward if you also want to include previous fiscal year's balance leaves to this fiscal year",
|
||||||
"fieldname": "carry_forward",
|
"fieldname": "carry_forward",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Carry Forward"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Carry Forward",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"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_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "no_of_days",
|
"fieldname": "no_of_days",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"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": "New Leaves Allocated (In Days)",
|
"label": "New Leaves Allocated (In Days)",
|
||||||
"length": 0,
|
"reqd": 1
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"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_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "allocate",
|
"fieldname": "allocate",
|
||||||
"fieldtype": "Button",
|
"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": "Allocate",
|
"label": "Allocate",
|
||||||
"length": 0,
|
"options": "allocate_leave"
|
||||||
"no_copy": 0,
|
},
|
||||||
"options": "allocate_leave",
|
{
|
||||||
"permlevel": 0,
|
"fieldname": "select_employees_section",
|
||||||
"print_hide": 0,
|
"fieldtype": "Section Break",
|
||||||
"print_hide_if_no_value": 0,
|
"label": "Select Employees"
|
||||||
"read_only": 0,
|
},
|
||||||
"remember_last_selected_value": 0,
|
{
|
||||||
"report_hide": 0,
|
"fieldname": "allocate_leaves_section",
|
||||||
"reqd": 0,
|
"fieldtype": "Section Break",
|
||||||
"search_index": 0,
|
"label": "Allocate Leaves"
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
|
||||||
"hide_heading": 0,
|
|
||||||
"hide_toolbar": 1,
|
"hide_toolbar": 1,
|
||||||
"icon": "fa fa-cog",
|
"icon": "fa fa-cog",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"image_view": 0,
|
|
||||||
"in_create": 0,
|
|
||||||
"is_submittable": 0,
|
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"istable": 0,
|
"modified": "2019-05-24 09:41:34.105741",
|
||||||
"max_attachments": 0,
|
|
||||||
"modified": "2018-04-13 16:17:15.115389",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Leave Control Panel",
|
"name": "Leave Control Panel",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
"amend": 0,
|
|
||||||
"cancel": 0,
|
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"delete": 0,
|
|
||||||
"email": 0,
|
|
||||||
"export": 0,
|
|
||||||
"if_owner": 0,
|
|
||||||
"import": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print": 0,
|
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 0,
|
|
||||||
"role": "HR User",
|
"role": "HR User",
|
||||||
"set_user_permissions": 0,
|
|
||||||
"share": 0,
|
|
||||||
"submit": 0,
|
|
||||||
"write": 1
|
"write": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"quick_entry": 0,
|
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"read_only_onload": 0,
|
|
||||||
"show_name_in_global_search": 0,
|
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC"
|
||||||
"track_changes": 0,
|
|
||||||
"track_seen": 0
|
|
||||||
}
|
}
|
@ -27,10 +27,7 @@ class LeaveControlPanel(Document):
|
|||||||
for f in ["from_date", "to_date", "leave_type", "no_of_days"]:
|
for f in ["from_date", "to_date", "leave_type", "no_of_days"]:
|
||||||
if not self.get(f):
|
if not self.get(f):
|
||||||
frappe.throw(_("{0} is required").format(self.meta.get_label(f)))
|
frappe.throw(_("{0} is required").format(self.meta.get_label(f)))
|
||||||
|
self.validate_from_to_dates('from_date', 'to_date')
|
||||||
def to_date_validation(self):
|
|
||||||
if date_diff(self.to_date, self.from_date) <= 0:
|
|
||||||
return "Invalid period"
|
|
||||||
|
|
||||||
def allocate_leave(self):
|
def allocate_leave(self):
|
||||||
self.validate_values()
|
self.validate_values()
|
||||||
|
@ -172,6 +172,7 @@ frappe.ui.form.on('Loan', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
mode_of_payment: function (frm) {
|
mode_of_payment: function (frm) {
|
||||||
|
if (frm.doc.mode_of_payment && frm.doc.company) {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_bank_cash_account",
|
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_bank_cash_account",
|
||||||
args: {
|
args: {
|
||||||
@ -184,6 +185,7 @@ frappe.ui.form.on('Loan', {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
loan_application: function (frm) {
|
loan_application: function (frm) {
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break0",
|
"fieldname": "section_break0",
|
||||||
"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": "Today",
|
"default": "Today",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "posting_date",
|
"fieldname": "posting_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -120,6 +123,7 @@
|
|||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "",
|
"default": "",
|
||||||
"depends_on": "eval:doc.salary_slip_based_on_timesheet == 0",
|
"depends_on": "eval:doc.salary_slip_based_on_timesheet == 0",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "payroll_frequency",
|
"fieldname": "payroll_frequency",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -153,6 +157,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,
|
||||||
@ -186,6 +191,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "",
|
"default": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "company",
|
"fieldname": "company",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -220,6 +226,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"collapsible_depends_on": "",
|
"collapsible_depends_on": "",
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_8",
|
"fieldname": "section_break_8",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -252,6 +259,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "branch",
|
"fieldname": "branch",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -285,6 +293,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,
|
||||||
@ -318,6 +327,7 @@
|
|||||||
"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,
|
||||||
@ -349,6 +359,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "designation",
|
"fieldname": "designation",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -382,6 +393,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "number_of_employees",
|
"fieldname": "number_of_employees",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -414,6 +426,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "sec_break20",
|
"fieldname": "sec_break20",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -445,6 +458,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "employees",
|
"fieldname": "employees",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -478,6 +492,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_13",
|
"fieldname": "section_break_13",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -509,6 +524,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "validate_attendance",
|
"fieldname": "validate_attendance",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -541,6 +557,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "attendance_detail_html",
|
"fieldname": "attendance_detail_html",
|
||||||
"fieldtype": "HTML",
|
"fieldtype": "HTML",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -572,6 +589,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_12",
|
"fieldname": "section_break_12",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -604,6 +622,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "0",
|
"default": "0",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "salary_slip_based_on_timesheet",
|
"fieldname": "salary_slip_based_on_timesheet",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -637,6 +656,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "select_payroll_period",
|
"fieldname": "select_payroll_period",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -670,6 +690,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "",
|
"default": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "start_date",
|
"fieldname": "start_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -703,6 +724,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "",
|
"default": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "end_date",
|
"fieldname": "end_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -735,6 +757,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_11",
|
"fieldname": "column_break_11",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -766,6 +789,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "deduct_tax_for_unclaimed_employee_benefits",
|
"fieldname": "deduct_tax_for_unclaimed_employee_benefits",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -798,6 +822,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "deduct_tax_for_unsubmitted_tax_exemption_proof",
|
"fieldname": "deduct_tax_for_unsubmitted_tax_exemption_proof",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -830,6 +855,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_16",
|
"fieldname": "section_break_16",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -864,6 +890,7 @@
|
|||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": ":Company",
|
"default": ":Company",
|
||||||
"fetch_from": "",
|
"fetch_from": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "cost_center",
|
"fieldname": "cost_center",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -897,6 +924,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,
|
||||||
@ -928,6 +956,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "project",
|
"fieldname": "project",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -961,6 +990,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,
|
||||||
@ -993,6 +1023,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "account",
|
"fieldname": "account",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1026,6 +1057,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"description": "Select Payment Account to make Bank Entry",
|
"description": "Select Payment Account to make Bank Entry",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "payment_account",
|
"fieldname": "payment_account",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1059,6 +1091,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break2",
|
"fieldname": "section_break2",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1090,6 +1123,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,
|
||||||
@ -1122,6 +1156,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "salary_slips_created",
|
"fieldname": "salary_slips_created",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@ -1154,6 +1189,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "salary_slips_submitted",
|
"fieldname": "salary_slips_submitted",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@ -1181,17 +1217,16 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
"has_web_view": 0,
|
||||||
"hide_heading": 0,
|
|
||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"icon": "fa fa-cog",
|
"icon": "fa fa-cog",
|
||||||
"idx": 0,
|
"idx": 0,
|
||||||
"image_view": 0,
|
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2019-02-05 10:41:08.865842",
|
"menu_index": 0,
|
||||||
|
"modified": "2019-03-26 16:55:04.158800",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Payroll Entry",
|
"name": "Payroll Entry",
|
||||||
@ -1210,7 +1245,7 @@
|
|||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print": 0,
|
"print": 0,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 0,
|
"report": 1,
|
||||||
"role": "HR Manager",
|
"role": "HR Manager",
|
||||||
"set_user_permissions": 0,
|
"set_user_permissions": 0,
|
||||||
"share": 1,
|
"share": 1,
|
||||||
@ -1220,7 +1255,6 @@
|
|||||||
],
|
],
|
||||||
"quick_entry": 0,
|
"quick_entry": 0,
|
||||||
"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",
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user