Merge branch 'develop' of github.com:frappe/erpnext into call-summary-dialog
This commit is contained in:
commit
d382f1d470
@ -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
|
|
||||||
}
|
}
|
@ -12,6 +12,11 @@ frappe.ui.form.on('Bank Account', {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
frm.set_query("party_type", function() {
|
||||||
|
return {
|
||||||
|
query: "erpnext.setup.doctype.party_type.party_type.get_party_type",
|
||||||
|
};
|
||||||
|
});
|
||||||
},
|
},
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
frappe.dynamic_link = { doc: frm.doc, fieldname: 'name', doctype: 'Bank Account' }
|
frappe.dynamic_link = { doc: frm.doc, fieldname: 'name', doctype: 'Bank Account' }
|
||||||
|
@ -1,729 +1,189 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_import": 1,
|
||||||
"allow_events_in_timeline": 0,
|
|
||||||
"allow_guest_to_view": 0,
|
|
||||||
"allow_import": 0,
|
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
"autoname": "field:account_name",
|
"autoname": "field:account_name",
|
||||||
"beta": 0,
|
|
||||||
"creation": "2017-05-29 21:35:13.136357",
|
"creation": "2017-05-29 21:35:13.136357",
|
||||||
"custom": 0,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "Setup",
|
"document_type": "Setup",
|
||||||
"editable_grid": 0,
|
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"account_name",
|
||||||
|
"account",
|
||||||
|
"bank",
|
||||||
|
"is_company_account",
|
||||||
|
"company",
|
||||||
|
"column_break_7",
|
||||||
|
"is_default",
|
||||||
|
"bank_account_no",
|
||||||
|
"iban",
|
||||||
|
"branch_code",
|
||||||
|
"swift_number",
|
||||||
|
"section_break_11",
|
||||||
|
"party_type",
|
||||||
|
"column_break_14",
|
||||||
|
"party",
|
||||||
|
"address_and_contact",
|
||||||
|
"address_html",
|
||||||
|
"website",
|
||||||
|
"column_break_12",
|
||||||
|
"contact_html"
|
||||||
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "account_name",
|
"fieldname": "account_name",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 1,
|
"in_global_search": 1,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 1,
|
"in_standard_filter": 1,
|
||||||
"label": "Account Name",
|
"label": "Account Name",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 1
|
"unique": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"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": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Account",
|
"label": "Account",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Account",
|
"options": "Account",
|
||||||
"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": "bank",
|
"fieldname": "bank",
|
||||||
"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",
|
"label": "Bank",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Bank",
|
"options": "Bank",
|
||||||
"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": "is_company_account",
|
"fieldname": "is_company_account",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Is Company 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": "Is Company 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,
|
|
||||||
"depends_on": "is_company_account",
|
"depends_on": "is_company_account",
|
||||||
"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": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 1,
|
"in_standard_filter": 1,
|
||||||
"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_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break_7",
|
"fieldname": "column_break_7",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"search_index": 1
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 1,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "is_default",
|
"fieldname": "is_default",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"label": "Is Default"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Is Default",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "bank_account_no",
|
"fieldname": "bank_account_no",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"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": "Bank Account No",
|
"label": "Bank Account No",
|
||||||
"length": 30,
|
"length": 30
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "iban",
|
"fieldname": "iban",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"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": "IBAN",
|
"label": "IBAN",
|
||||||
"length": 30,
|
"length": 30
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "branch_code",
|
"fieldname": "branch_code",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"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 Code"
|
||||||
"label": "Branch Code",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "swift_number",
|
"fieldname": "swift_number",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"label": "SWIFT number"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "SWIFT number",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"depends_on": "eval:!doc.is_company_account",
|
"depends_on": "eval:!doc.is_company_account",
|
||||||
"fieldname": "section_break_11",
|
"fieldname": "section_break_11",
|
||||||
"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,
|
|
||||||
"fieldname": "party_type",
|
"fieldname": "party_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": "Party Type",
|
"label": "Party Type",
|
||||||
"length": 0,
|
"options": "DocType"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "DocType",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 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_14",
|
"fieldname": "column_break_14",
|
||||||
"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": "party",
|
"fieldname": "party",
|
||||||
"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": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Party",
|
"label": "Party",
|
||||||
"length": 0,
|
"options": "party_type"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "party_type",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "address_and_contact",
|
"fieldname": "address_and_contact",
|
||||||
"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,
|
|
||||||
"label": "Address and Contact",
|
"label": "Address and Contact",
|
||||||
"length": 0,
|
"options": "fa fa-map-marker"
|
||||||
"no_copy": 0,
|
|
||||||
"options": "fa fa-map-marker",
|
|
||||||
"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": "address_html",
|
"fieldname": "address_html",
|
||||||
"fieldtype": "HTML",
|
"fieldtype": "HTML",
|
||||||
"hidden": 0,
|
"label": "Address HTML"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Address HTML",
|
|
||||||
"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": "website",
|
"fieldname": "website",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"label": "Website"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Website",
|
|
||||||
"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_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,
|
|
||||||
"fieldname": "contact_html",
|
"fieldname": "contact_html",
|
||||||
"fieldtype": "HTML",
|
"fieldtype": "HTML",
|
||||||
"hidden": 0,
|
"label": "Contact HTML"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Contact HTML",
|
|
||||||
"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,
|
"modified": "2019-04-25 22:10:07.951351",
|
||||||
"hide_heading": 0,
|
|
||||||
"hide_toolbar": 0,
|
|
||||||
"idx": 0,
|
|
||||||
"image_view": 0,
|
|
||||||
"in_create": 0,
|
|
||||||
"is_submittable": 0,
|
|
||||||
"issingle": 0,
|
|
||||||
"istable": 0,
|
|
||||||
"max_attachments": 0,
|
|
||||||
"modified": "2019-03-05 17:56:05.103238",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Bank Account",
|
"name": "Bank Account",
|
||||||
"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": 1,
|
"export": 1,
|
||||||
"if_owner": 0,
|
"import": 1,
|
||||||
"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": 0,
|
|
||||||
"write": 1
|
"write": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"amend": 0,
|
|
||||||
"cancel": 0,
|
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"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": 0,
|
|
||||||
"write": 1
|
"write": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"quick_entry": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"read_only_onload": 0,
|
|
||||||
"search_fields": "bank,account",
|
"search_fields": "bank,account",
|
||||||
"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
|
|
||||||
}
|
}
|
@ -3,6 +3,7 @@
|
|||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
from functools import reduce
|
||||||
import frappe, csv
|
import frappe, csv
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.utils import cstr
|
from frappe.utils import cstr
|
||||||
|
@ -161,7 +161,7 @@ class PaymentEntry(AccountsController):
|
|||||||
d.reference_name, self.party_account_currency)
|
d.reference_name, self.party_account_currency)
|
||||||
|
|
||||||
for field, value in iteritems(ref_details):
|
for field, value in iteritems(ref_details):
|
||||||
if not d.get(field) or force:
|
if field == 'exchange_rate' or not d.get(field) or force:
|
||||||
d.set(field, value)
|
d.set(field, value)
|
||||||
|
|
||||||
def validate_payment_type(self):
|
def validate_payment_type(self):
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 2,
|
"columns": 2,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "reference_doctype",
|
"fieldname": "reference_doctype",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -53,6 +54,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 2,
|
"columns": 2,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "reference_name",
|
"fieldname": "reference_name",
|
||||||
"fieldtype": "Dynamic Link",
|
"fieldtype": "Dynamic Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -86,6 +88,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "due_date",
|
"fieldname": "due_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -119,6 +122,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "",
|
"depends_on": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "bill_no",
|
"fieldname": "bill_no",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -151,6 +155,7 @@
|
|||||||
"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,
|
||||||
@ -182,6 +187,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 2,
|
"columns": 2,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "total_amount",
|
"fieldname": "total_amount",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -214,6 +220,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 2,
|
"columns": 2,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "outstanding_amount",
|
"fieldname": "outstanding_amount",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -246,6 +253,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 2,
|
"columns": 2,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "allocated_amount",
|
"fieldname": "allocated_amount",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -279,6 +287,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:(doc.reference_doctype=='Purchase Invoice')",
|
"depends_on": "eval:(doc.reference_doctype=='Purchase Invoice')",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "exchange_rate",
|
"fieldname": "exchange_rate",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -315,7 +324,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2019-01-07 16:52:06.884796",
|
"modified": "2019-05-01 13:24:56.586677",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Entry Reference",
|
"name": "Payment Entry Reference",
|
||||||
|
@ -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()
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -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
|
||||||
@ -506,8 +505,8 @@ class SalesInvoice(SellingController):
|
|||||||
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 \
|
if (d.item_code and frappe.get_cached_value('Item', d.item_code, '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)
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -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
|
||||||
|
|
||||||
|
@ -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,
|
||||||
|
@ -2,8 +2,15 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
|
|
||||||
frappe.query_reports["Inactive 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"),
|
||||||
@ -31,4 +38,4 @@ frappe.query_reports["Inactive Items"] = {
|
|||||||
default: 30
|
default: 30
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
};
|
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"add_total_row": 0,
|
||||||
|
"creation": "2019-05-01 13:46:23.044979",
|
||||||
|
"disable_prepared_report": 0,
|
||||||
|
"disabled": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "Report",
|
||||||
|
"idx": 0,
|
||||||
|
"is_standard": "Yes",
|
||||||
|
"letter_head": "Test Letter Head 1",
|
||||||
|
"modified": "2019-05-01 13:46:23.044979",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Accounts",
|
||||||
|
"name": "Inactive Sales Items",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"prepared_report": 0,
|
||||||
|
"ref_doctype": "Sales Invoice",
|
||||||
|
"report_name": "Inactive Sales Items",
|
||||||
|
"report_type": "Script Report",
|
||||||
|
"roles": []
|
||||||
|
}
|
@ -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",
|
||||||
@ -74,39 +72,39 @@ 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 = {
|
|
||||||
"territory": item_obj.territory,
|
|
||||||
"item_group": item_obj.item_group,
|
|
||||||
"item": item_obj.name,
|
|
||||||
"item_name": item_obj.item_name,
|
|
||||||
"customer": item_obj.customer,
|
|
||||||
"last_order_date": item_obj.last_order_date,
|
|
||||||
"qty": item_obj.qty,
|
|
||||||
"days_since_last_order": item_obj.days_since_last_order
|
|
||||||
}
|
|
||||||
data.append(row)
|
|
||||||
else:
|
|
||||||
row = {
|
row = {
|
||||||
|
"territory": territory.name,
|
||||||
"item_group": item.item_group,
|
"item_group": item.item_group,
|
||||||
"item": item.name,
|
"item": item.name,
|
||||||
"item_name": item.item_name
|
"item_name": item.item_name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if sales_invoice_data.get((territory.name,item.name)):
|
||||||
|
item_obj = sales_invoice_data[(territory.name,item.name)]
|
||||||
|
if item_obj.days_since_last_order > cint(filters['days']):
|
||||||
|
row.update({
|
||||||
|
"territory": item_obj.territory,
|
||||||
|
"customer": item_obj.customer,
|
||||||
|
"last_order_date": item_obj.last_order_date,
|
||||||
|
"qty": item_obj.qty,
|
||||||
|
"days_since_last_order": item_obj.days_since_last_order
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
|
||||||
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 = {}
|
||||||
|
|
||||||
@ -121,12 +119,21 @@ def get_sales_details(filters):
|
|||||||
.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_name), 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
|
||||||
@ -145,4 +152,3 @@ def get_items(filters):
|
|||||||
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"], 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
|
||||||
|
@ -75,8 +75,8 @@ class AssetValueAdjustment(Document):
|
|||||||
rate_per_day = flt(d.value_after_depreciation) / flt(total_days)
|
rate_per_day = flt(d.value_after_depreciation) / flt(total_days)
|
||||||
from_date = self.date
|
from_date = self.date
|
||||||
else:
|
else:
|
||||||
no_of_depreciations = len([e.name for e in asset.schedules
|
no_of_depreciations = len([s.name for s in asset.schedules
|
||||||
if (cint(s.finance_book_id) == d.idx and not e.journal_entry)])
|
if (cint(s.finance_book_id) == d.idx and not s.journal_entry)])
|
||||||
|
|
||||||
value_after_depreciation = d.value_after_depreciation
|
value_after_depreciation = d.value_after_depreciation
|
||||||
for data in asset.schedules:
|
for data in asset.schedules:
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,738 +1,234 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
|
||||||
"allow_import": 0,
|
|
||||||
"allow_rename": 0,
|
|
||||||
"autoname": "hash",
|
"autoname": "hash",
|
||||||
"beta": 0,
|
|
||||||
"creation": "2016-02-25 08:04:02.452958",
|
"creation": "2016-02-25 08:04:02.452958",
|
||||||
"custom": 0,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "",
|
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"item_code",
|
||||||
|
"supplier_part_no",
|
||||||
|
"column_break_3",
|
||||||
|
"item_name",
|
||||||
|
"section_break_5",
|
||||||
|
"description",
|
||||||
|
"item_group",
|
||||||
|
"brand",
|
||||||
|
"image_section",
|
||||||
|
"image",
|
||||||
|
"image_view",
|
||||||
|
"quantity",
|
||||||
|
"qty",
|
||||||
|
"col_break2",
|
||||||
|
"schedule_date",
|
||||||
|
"uom",
|
||||||
|
"warehouse_and_reference",
|
||||||
|
"warehouse",
|
||||||
|
"project_name",
|
||||||
|
"col_break4",
|
||||||
|
"material_request",
|
||||||
|
"material_request_item",
|
||||||
|
"section_break_23",
|
||||||
|
"page_break"
|
||||||
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 1,
|
"bold": 1,
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 3,
|
"columns": 3,
|
||||||
"fieldname": "item_code",
|
"fieldname": "item_code",
|
||||||
"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": "Item Code",
|
"label": "Item Code",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "item_code",
|
"oldfieldname": "item_code",
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "Item",
|
"options": "Item",
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 1,
|
"search_index": 1
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "supplier_part_no",
|
"fieldname": "supplier_part_no",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Supplier Part No",
|
"label": "Supplier Part No",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break_3",
|
"fieldname": "column_break_3",
|
||||||
"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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "item_name",
|
"fieldname": "item_name",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 1,
|
"in_global_search": 1,
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Item Name",
|
"label": "Item Name",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "item_name",
|
"oldfieldname": "item_name",
|
||||||
"oldfieldtype": "Data",
|
"oldfieldtype": "Data",
|
||||||
"permlevel": 0,
|
"search_index": 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": 1,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "section_break_5",
|
"fieldname": "section_break_5",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"label": "Description"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "description",
|
"fieldname": "description",
|
||||||
"fieldtype": "Text Editor",
|
"fieldtype": "Text Editor",
|
||||||
"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": "Description",
|
"label": "Description",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "description",
|
"oldfieldname": "description",
|
||||||
"oldfieldtype": "Small Text",
|
"oldfieldtype": "Small Text",
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"print_width": "300px",
|
"print_width": "300px",
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0,
|
|
||||||
"width": "300px"
|
"width": "300px"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "col_break1",
|
|
||||||
"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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "image",
|
"fieldname": "image",
|
||||||
"fieldtype": "Attach",
|
"fieldtype": "Attach",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
"ignore_user_permissions": 0,
|
"label": "Image"
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Image",
|
|
||||||
"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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "image_view",
|
"fieldname": "image_view",
|
||||||
"fieldtype": "Image",
|
"fieldtype": "Image",
|
||||||
"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": "Image View",
|
"label": "Image View",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "image",
|
"options": "image",
|
||||||
"permlevel": 0,
|
"print_hide": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 1,
|
|
||||||
"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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "quantity",
|
"fieldname": "quantity",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"label": "Quantity"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Quantity",
|
|
||||||
"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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 1,
|
"bold": 1,
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 2,
|
"columns": 2,
|
||||||
"fieldname": "qty",
|
"fieldname": "qty",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"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": "Quantity",
|
"label": "Quantity",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "qty",
|
"oldfieldname": "qty",
|
||||||
"oldfieldtype": "Currency",
|
"oldfieldtype": "Currency",
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"print_width": "60px",
|
"print_width": "60px",
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0,
|
|
||||||
"width": "60px"
|
"width": "60px"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "col_break2",
|
"fieldname": "col_break2",
|
||||||
"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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 2,
|
"columns": 2,
|
||||||
"default": "Today",
|
"default": "Today",
|
||||||
"fieldname": "schedule_date",
|
"fieldname": "schedule_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": "Required Date",
|
"label": "Required 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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "uom",
|
"fieldname": "uom",
|
||||||
"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": "UOM",
|
"label": "UOM",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "uom",
|
"oldfieldname": "uom",
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "UOM",
|
"options": "UOM",
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"print_width": "100px",
|
"print_width": "100px",
|
||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0,
|
|
||||||
"width": "100px"
|
"width": "100px"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "warehouse_and_reference",
|
"fieldname": "warehouse_and_reference",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"label": "Warehouse and Reference"
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Warehouse and Reference",
|
|
||||||
"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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 3,
|
"columns": 3,
|
||||||
"fieldname": "warehouse",
|
"fieldname": "warehouse",
|
||||||
"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": "Warehouse",
|
"label": "Warehouse",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "warehouse",
|
"oldfieldname": "warehouse",
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "Warehouse",
|
"options": "Warehouse",
|
||||||
"permlevel": 0,
|
"print_hide": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 1,
|
|
||||||
"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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "project_name",
|
"fieldname": "project_name",
|
||||||
"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": "Project Name",
|
"label": "Project Name",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Project",
|
"options": "Project",
|
||||||
"permlevel": 0,
|
"print_hide": 1
|
||||||
"precision": "",
|
|
||||||
"print_hide": 1,
|
|
||||||
"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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "material_request",
|
"fieldname": "material_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": "Material Request",
|
"label": "Material Request",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Material Request",
|
"options": "Material Request",
|
||||||
"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,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "col_break4",
|
"fieldname": "col_break4",
|
||||||
"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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "material_request_item",
|
"fieldname": "material_request_item",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Material Request Item",
|
"label": "Material Request Item",
|
||||||
"length": 0,
|
"print_hide": 1
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 1,
|
|
||||||
"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,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "brand",
|
"fieldname": "brand",
|
||||||
"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": "Brand",
|
"label": "Brand",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "brand",
|
"oldfieldname": "brand",
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "Brand",
|
"options": "Brand",
|
||||||
"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,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"description": "",
|
|
||||||
"fieldname": "item_group",
|
"fieldname": "item_group",
|
||||||
"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": "Item Group",
|
"label": "Item Group",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"oldfieldname": "item_group",
|
"oldfieldname": "item_group",
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "Item Group",
|
"options": "Item Group",
|
||||||
"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,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 1,
|
"allow_on_submit": 1,
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "page_break",
|
"fieldname": "page_break",
|
||||||
"fieldtype": "Check",
|
"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": "Page Break",
|
"label": "Page Break",
|
||||||
"length": 0,
|
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"oldfieldname": "page_break",
|
"oldfieldname": "page_break",
|
||||||
"oldfieldtype": "Check",
|
"oldfieldtype": "Check",
|
||||||
"permlevel": 0,
|
"print_hide": 1
|
||||||
"precision": "",
|
},
|
||||||
"print_hide": 1,
|
{
|
||||||
"print_hide_if_no_value": 0,
|
"collapsible": 1,
|
||||||
"read_only": 0,
|
"fieldname": "image_section",
|
||||||
"remember_last_selected_value": 0,
|
"fieldtype": "Section Break",
|
||||||
"report_hide": 0,
|
"label": "Image"
|
||||||
"reqd": 0,
|
},
|
||||||
"search_index": 0,
|
{
|
||||||
"set_only_once": 0,
|
"fieldname": "section_break_23",
|
||||||
"unique": 0
|
"fieldtype": "Section Break"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"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-01 17:50:23.703801",
|
||||||
"modified": "2017-02-17 16:43:46.152268",
|
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"name": "Request for Quotation Item",
|
"name": "Request for Quotation Item",
|
||||||
"name_case": "",
|
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [],
|
"permissions": [],
|
||||||
"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
|
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
@ -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
|
@ -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",
|
||||||
|
@ -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",
|
||||||
|
@ -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'"]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,19 +59,21 @@ class calculate_taxes_and_totals(object):
|
|||||||
|
|
||||||
if item.discount_percentage == 100:
|
if item.discount_percentage == 100:
|
||||||
item.rate = 0.0
|
item.rate = 0.0
|
||||||
elif (not item.rate or item.discount_percentage > 0) and item.price_list_rate:
|
elif item.price_list_rate:
|
||||||
|
if not item.rate or (item.pricing_rules and item.discount_percentage > 0):
|
||||||
item.rate = flt(item.price_list_rate *
|
item.rate = flt(item.price_list_rate *
|
||||||
(1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))
|
(1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))
|
||||||
item.discount_amount = item.price_list_rate * (item.discount_percentage / 100.0)
|
item.discount_amount = item.price_list_rate * (item.discount_percentage / 100.0)
|
||||||
elif item.discount_amount and item.price_list_rate:
|
elif item.discount_amount and item.pricing_rules:
|
||||||
item.rate = item.price_list_rate - item.discount_amount
|
item.rate = item.price_list_rate - item.discount_amount
|
||||||
|
|
||||||
if item.doctype in ['Quotation Item', 'Sales Order Item', 'Delivery Note Item', 'Sales Invoice Item']:
|
if item.doctype in ['Quotation Item', 'Sales Order Item', 'Delivery Note Item', 'Sales Invoice Item']:
|
||||||
item.rate_with_margin, item.base_rate_with_margin = self.calculate_margin(item)
|
item.rate_with_margin, item.base_rate_with_margin = self.calculate_margin(item)
|
||||||
|
|
||||||
if flt(item.rate_with_margin) > 0:
|
if flt(item.rate_with_margin) > 0:
|
||||||
item.rate = flt(item.rate_with_margin * (1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))
|
item.rate = flt(item.rate_with_margin * (1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))
|
||||||
item.discount_amount = item.rate_with_margin - item.rate
|
item.discount_amount = item.rate_with_margin - item.rate
|
||||||
|
elif flt(item.price_list_rate) > 0:
|
||||||
|
item.discount_amount = item.price_list_rate - item.rate
|
||||||
elif flt(item.price_list_rate) > 0 and not item.discount_amount:
|
elif flt(item.price_list_rate) > 0 and not item.discount_amount:
|
||||||
item.discount_amount = item.price_list_rate - item.rate
|
item.discount_amount = item.price_list_rate - item.rate
|
||||||
|
|
||||||
|
@ -5,29 +5,32 @@ frappe.provide("erpnext");
|
|||||||
cur_frm.email_field = "email_id";
|
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" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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" }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
refresh: function() {
|
refresh: function () {
|
||||||
var doc = this.frm.doc;
|
var doc = this.frm.doc;
|
||||||
erpnext.toggle_naming_series();
|
erpnext.toggle_naming_series();
|
||||||
frappe.dynamic_link = {doc: doc, fieldname: 'name', doctype: 'Lead'}
|
frappe.dynamic_link = { doc: doc, fieldname: 'name', doctype: 'Lead' }
|
||||||
|
|
||||||
if(!doc.__islocal && doc.__onload && !doc.__onload.is_customer) {
|
if(!doc.__islocal && doc.__onload && !doc.__onload.is_customer) {
|
||||||
this.frm.add_custom_button(__("Customer"), this.create_customer, __('Create'));
|
this.frm.add_custom_button(__("Customer"), this.create_customer, __('Create'));
|
||||||
@ -35,49 +38,46 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({
|
|||||||
this.frm.add_custom_button(__("Quotation"), this.make_quotation, __('Create'));
|
this.frm.add_custom_button(__("Quotation"), this.make_quotation, __('Create'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this.frm.doc.__islocal) {
|
if (!this.frm.doc.__islocal) {
|
||||||
frappe.contacts.render_address_and_contact(cur_frm);
|
frappe.contacts.render_address_and_contact(cur_frm);
|
||||||
} else {
|
} else {
|
||||||
frappe.contacts.clear_address_and_contact(cur_frm);
|
frappe.contacts.clear_address_and_contact(cur_frm);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
create_customer: function() {
|
create_customer: function () {
|
||||||
frappe.model.open_mapped_doc({
|
frappe.model.open_mapped_doc({
|
||||||
method: "erpnext.crm.doctype.lead.lead.make_customer",
|
method: "erpnext.crm.doctype.lead.lead.make_customer",
|
||||||
frm: cur_frm
|
frm: cur_frm
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
create_opportunity: function() {
|
create_opportunity: function () {
|
||||||
frappe.model.open_mapped_doc({
|
frappe.model.open_mapped_doc({
|
||||||
method: "erpnext.crm.doctype.lead.lead.make_opportunity",
|
method: "erpnext.crm.doctype.lead.lead.make_opportunity",
|
||||||
frm: cur_frm
|
frm: cur_frm
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
make_quotation: function() {
|
make_quotation: function () {
|
||||||
frappe.model.open_mapped_doc({
|
frappe.model.open_mapped_doc({
|
||||||
method: "erpnext.crm.doctype.lead.lead.make_quotation",
|
method: "erpnext.crm.doctype.lead.lead.make_quotation",
|
||||||
frm: cur_frm
|
frm: cur_frm
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
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 () {
|
||||||
if (this.frm.doc.organization_lead == 1) {
|
if (this.frm.doc.organization_lead == 1) {
|
||||||
this.frm.set_value("lead_name", this.frm.doc.company_name);
|
this.frm.set_value("lead_name", this.frm.doc.company_name);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
contact_date: function() {
|
contact_date: function () {
|
||||||
if (this.frm.doc.contact_date) {
|
if (this.frm.doc.contact_date) {
|
||||||
let d = moment(this.frm.doc.contact_date);
|
let d = moment(this.frm.doc.contact_date);
|
||||||
d.add(1, "hours");
|
d.add(1, "hours");
|
||||||
@ -86,4 +86,4 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$.extend(cur_frm.cscript, new erpnext.LeadController({frm: cur_frm}));
|
$.extend(cur_frm.cscript, new erpnext.LeadController({ frm: cur_frm }));
|
||||||
|
@ -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:
|
||||||
|
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):
|
||||||
|
@ -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"]
|
||||||
@ -269,7 +269,7 @@ scheduler_events = {
|
|||||||
"daily_long": [
|
"daily_long": [
|
||||||
"erpnext.manufacturing.doctype.bom_update_tool.bom_update_tool.update_latest_price_in_all_boms"
|
"erpnext.manufacturing.doctype.bom_update_tool.bom_update_tool.update_latest_price_in_all_boms"
|
||||||
],
|
],
|
||||||
"monthly": [
|
"monthly_long": [
|
||||||
"erpnext.accounts.deferred_revenue.convert_deferred_revenue_to_income",
|
"erpnext.accounts.deferred_revenue.convert_deferred_revenue_to_income",
|
||||||
"erpnext.accounts.deferred_revenue.convert_deferred_expense_to_expense",
|
"erpnext.accounts.deferred_revenue.convert_deferred_expense_to_expense",
|
||||||
"erpnext.hr.utils.allocate_earned_leaves"
|
"erpnext.hr.utils.allocate_earned_leaves"
|
||||||
|
@ -177,8 +177,11 @@ def get_benefit_component_amount(employee, start_date, end_date, struct_row, sal
|
|||||||
|
|
||||||
# Considering there is only one application for a year
|
# Considering there is only one application for a year
|
||||||
benefit_application_name = frappe.db.sql("""
|
benefit_application_name = frappe.db.sql("""
|
||||||
select name from `tabEmployee Benefit Application`
|
select name
|
||||||
where payroll_period=%(payroll_period)s and employee=%(employee)s
|
from `tabEmployee Benefit Application`
|
||||||
|
where
|
||||||
|
payroll_period=%(payroll_period)s
|
||||||
|
and employee=%(employee)s
|
||||||
and docstatus = 1
|
and docstatus = 1
|
||||||
""", {
|
""", {
|
||||||
'employee': employee,
|
'employee': employee,
|
||||||
@ -209,7 +212,8 @@ def get_benefit_pro_rata_ratio_amount(sal_struct, component_max):
|
|||||||
total_pro_rata_max = 0
|
total_pro_rata_max = 0
|
||||||
benefit_amount = 0
|
benefit_amount = 0
|
||||||
for sal_struct_row in sal_struct.get("earnings"):
|
for sal_struct_row in sal_struct.get("earnings"):
|
||||||
pay_against_benefit_claim, max_benefit_amount = frappe.db.get_value("Salary Component", sal_struct_row.salary_component, ["pay_against_benefit_claim", "max_benefit_amount"])
|
pay_against_benefit_claim, max_benefit_amount = frappe.db.get_value("Salary Component",
|
||||||
|
sal_struct_row.salary_component, ["pay_against_benefit_claim", "max_benefit_amount"])
|
||||||
if sal_struct_row.is_flexible_benefit == 1 and pay_against_benefit_claim != 1:
|
if sal_struct_row.is_flexible_benefit == 1 and pay_against_benefit_claim != 1:
|
||||||
total_pro_rata_max += max_benefit_amount
|
total_pro_rata_max += max_benefit_amount
|
||||||
if total_pro_rata_max > 0:
|
if total_pro_rata_max > 0:
|
||||||
|
@ -100,7 +100,7 @@
|
|||||||
"in_global_search": 0,
|
"in_global_search": 0,
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 0,
|
"in_standard_filter": 0,
|
||||||
"label": "Maximum Exemption Amount",
|
"label": "Maximum Exempted Amount",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
@ -125,7 +125,7 @@
|
|||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fetch_if_empty": 0,
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "amount",
|
"fieldname": "amount",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
@ -160,7 +160,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2019-04-25 15:45:11.279158",
|
"modified": "2019-04-26 11:28:14.023086",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Employee Tax Exemption Declaration Category",
|
"name": "Employee Tax Exemption Declaration Category",
|
||||||
|
@ -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"))
|
@ -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",
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
|
"allow_events_in_timeline": 0,
|
||||||
"allow_guest_to_view": 0,
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
@ -20,6 +21,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "company",
|
"fieldname": "company",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -53,6 +55,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_2",
|
"fieldname": "column_break_2",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -84,6 +87,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "start_date",
|
"fieldname": "start_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -116,6 +120,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "end_date",
|
"fieldname": "end_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -148,6 +153,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_5",
|
"fieldname": "section_break_5",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
@ -180,6 +186,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "periods",
|
"fieldname": "periods",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -213,6 +220,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_7",
|
"fieldname": "section_break_7",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -245,6 +253,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "taxable_salary_slabs",
|
"fieldname": "taxable_salary_slabs",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -270,6 +279,39 @@
|
|||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "standard_tax_exemption_amount",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Standard Tax Exemption Amount",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"has_web_view": 0,
|
"has_web_view": 0,
|
||||||
@ -282,7 +324,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-05-25 12:29:07.207927",
|
"modified": "2019-04-26 01:45:03.160929",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Payroll Period",
|
"name": "Payroll Period",
|
||||||
@ -354,5 +396,6 @@
|
|||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"track_changes": 1,
|
"track_changes": 1,
|
||||||
"track_seen": 0
|
"track_seen": 0,
|
||||||
|
"track_views": 0
|
||||||
}
|
}
|
@ -5,10 +5,8 @@ frappe.ui.form.on('Salary Component', {
|
|||||||
setup: function(frm) {
|
setup: function(frm) {
|
||||||
frm.set_query("default_account", "accounts", function(doc, cdt, cdn) {
|
frm.set_query("default_account", "accounts", function(doc, cdt, cdn) {
|
||||||
var d = locals[cdt][cdn];
|
var d = locals[cdt][cdn];
|
||||||
var root_types = ["Expense", "Liability"];
|
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
"root_type": ["in", root_types],
|
|
||||||
"is_group": 0,
|
"is_group": 0,
|
||||||
"company": d.company
|
"company": d.company
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ class SalarySlip(TransactionBase):
|
|||||||
for d in self.get("earnings"):
|
for d in self.get("earnings"):
|
||||||
if d.is_flexible_benefit == 1:
|
if d.is_flexible_benefit == 1:
|
||||||
current_flexi_amount += d.amount
|
current_flexi_amount += d.amount
|
||||||
last_benefits = get_last_payroll_period_benefits(self.employee, self.start_date, self.end_date,\
|
last_benefits = get_last_payroll_period_benefits(self.employee, self.start_date, self.end_date,
|
||||||
current_flexi_amount, payroll_period, self._salary_structure_doc)
|
current_flexi_amount, payroll_period, self._salary_structure_doc)
|
||||||
if last_benefits:
|
if last_benefits:
|
||||||
for last_benefit in last_benefits:
|
for last_benefit in last_benefits:
|
||||||
@ -418,7 +418,7 @@ class SalarySlip(TransactionBase):
|
|||||||
|
|
||||||
for d in self.get(component_type):
|
for d in self.get(component_type):
|
||||||
if (self.salary_structure and
|
if (self.salary_structure and
|
||||||
cint(d.depends_on_payment_days) and
|
cint(d.depends_on_payment_days) and cint(self.total_working_days) and
|
||||||
(not
|
(not
|
||||||
self.salary_slip_based_on_timesheet or
|
self.salary_slip_based_on_timesheet or
|
||||||
getdate(self.start_date) < joining_date or
|
getdate(self.start_date) < joining_date or
|
||||||
@ -520,13 +520,20 @@ class SalarySlip(TransactionBase):
|
|||||||
|
|
||||||
def email_salary_slip(self):
|
def email_salary_slip(self):
|
||||||
receiver = frappe.db.get_value("Employee", self.employee, "prefered_email")
|
receiver = frappe.db.get_value("Employee", self.employee, "prefered_email")
|
||||||
|
hr_settings = frappe.get_single("HR Settings")
|
||||||
|
message = "Please see attachment"
|
||||||
|
password = None
|
||||||
|
if hr_settings.encrypt_salary_slips_in_emails:
|
||||||
|
password = generate_password_for_pdf(hr_settings.password_policy, self.employee)
|
||||||
|
message += """<br>Note: Your salary slip is password protected,
|
||||||
|
the password to unlock the PDF is of the format {0}. """.format(hr_settings.password_policy)
|
||||||
|
|
||||||
if receiver:
|
if receiver:
|
||||||
email_args = {
|
email_args = {
|
||||||
"recipients": [receiver],
|
"recipients": [receiver],
|
||||||
"message": _("Please see attachment"),
|
"message": _(message),
|
||||||
"subject": 'Salary Slip - from {0} to {1}'.format(self.start_date, self.end_date),
|
"subject": 'Salary Slip - from {0} to {1}'.format(self.start_date, self.end_date),
|
||||||
"attachments": [frappe.attach_print(self.doctype, self.name, file_name=self.name)],
|
"attachments": [frappe.attach_print(self.doctype, self.name, file_name=self.name, password=password)],
|
||||||
"reference_doctype": self.doctype,
|
"reference_doctype": self.doctype,
|
||||||
"reference_name": self.name
|
"reference_name": self.name
|
||||||
}
|
}
|
||||||
@ -577,8 +584,8 @@ class SalarySlip(TransactionBase):
|
|||||||
|
|
||||||
def calculate_variable_tax(self, tax_component, payroll_period):
|
def calculate_variable_tax(self, tax_component, payroll_period):
|
||||||
annual_taxable_earning, period_factor = 0, 0
|
annual_taxable_earning, period_factor = 0, 0
|
||||||
pro_rata_tax_paid, additional_tax_paid, benefit_tax_paid = 0, 0, 0
|
pro_rata_tax_paid, additional_tax_paid, benefit_tax_paid = 0.0, 0.0, 0.0
|
||||||
unclaimed_earning, unclaimed_benefit, additional_income = 0, 0, 0
|
unclaimed_earning, unclaimed_benefit, additional_income = 0.0, 0.0, 0.0
|
||||||
|
|
||||||
# get taxable_earning, additional_income in this slip
|
# get taxable_earning, additional_income in this slip
|
||||||
taxable_earning = self.get_taxable_earnings()
|
taxable_earning = self.get_taxable_earnings()
|
||||||
@ -607,6 +614,7 @@ class SalarySlip(TransactionBase):
|
|||||||
{"employee": self.employee, "payroll_period": payroll_period.name, "docstatus": 1},
|
{"employee": self.employee, "payroll_period": payroll_period.name, "docstatus": 1},
|
||||||
"total_exemption_amount")
|
"total_exemption_amount")
|
||||||
annual_taxable_earning = annual_earning - exemption_amount
|
annual_taxable_earning = annual_earning - exemption_amount
|
||||||
|
|
||||||
if self.deduct_tax_for_unclaimed_employee_benefits or self.deduct_tax_for_unsubmitted_tax_exemption_proof:
|
if self.deduct_tax_for_unclaimed_employee_benefits or self.deduct_tax_for_unsubmitted_tax_exemption_proof:
|
||||||
tax_detail = self.get_tax_paid_in_period(payroll_period, tax_component)
|
tax_detail = self.get_tax_paid_in_period(payroll_period, tax_component)
|
||||||
if tax_detail:
|
if tax_detail:
|
||||||
@ -616,11 +624,17 @@ class SalarySlip(TransactionBase):
|
|||||||
|
|
||||||
# add any additional income in this slip
|
# add any additional income in this slip
|
||||||
additional_income += taxable_earning["additional_income"]
|
additional_income += taxable_earning["additional_income"]
|
||||||
args = {"payroll_period": payroll_period.name, "tax_component": tax_component,
|
args = {
|
||||||
"annual_taxable_earning": annual_taxable_earning, "period_factor": period_factor,
|
"payroll_period": payroll_period.name,
|
||||||
"unclaimed_benefit": unclaimed_benefit, "additional_income": additional_income,
|
"tax_component": tax_component,
|
||||||
"pro_rata_tax_paid": pro_rata_tax_paid, "benefit_tax_paid": benefit_tax_paid,
|
"period_factor": period_factor,
|
||||||
"additional_tax_paid": additional_tax_paid}
|
"annual_taxable_earning": annual_taxable_earning,
|
||||||
|
"additional_income": additional_income,
|
||||||
|
"unclaimed_benefit": unclaimed_benefit,
|
||||||
|
"pro_rata_tax_paid": pro_rata_tax_paid,
|
||||||
|
"benefit_tax_paid": benefit_tax_paid,
|
||||||
|
"additional_tax_paid": additional_tax_paid
|
||||||
|
}
|
||||||
return self.calculate_tax(args)
|
return self.calculate_tax(args)
|
||||||
|
|
||||||
def calculate_unclaimed_taxable_benefit(self, payroll_period):
|
def calculate_unclaimed_taxable_benefit(self, payroll_period):
|
||||||
@ -667,27 +681,49 @@ class SalarySlip(TransactionBase):
|
|||||||
return total_taxable_earning
|
return total_taxable_earning
|
||||||
|
|
||||||
def get_total_additional_income(self, from_date):
|
def get_total_additional_income(self, from_date):
|
||||||
total_additional_pay = 0
|
sum_additional_earning = frappe.db.sql("""
|
||||||
sum_additional_earning = frappe.db.sql("""select sum(sd.amount) from `tabSalary Detail` sd join
|
select sum(sd.amount)
|
||||||
`tabSalary Slip` ss on sd.parent=ss.name where sd.parentfield='earnings'
|
from
|
||||||
and sd.is_tax_applicable=1 and is_additional_component=1 and is_flexible_benefit=0
|
`tabSalary Detail` sd join `tabSalary Slip` ss on sd.parent=ss.name
|
||||||
and ss.docstatus=1 and ss.employee='{0}' and ss.start_date between '{1}' and '{2}'
|
where
|
||||||
and ss.end_date between '{1}' and '{2}'""".format(self.employee,
|
sd.parentfield='earnings'
|
||||||
from_date, self.start_date))
|
and sd.is_tax_applicable=1 and is_additional_component=1
|
||||||
if sum_additional_earning and sum_additional_earning[0][0]:
|
and is_flexible_benefit=0 and ss.docstatus=1
|
||||||
total_additional_pay = sum_additional_earning[0][0]
|
and ss.employee=%(employee)s
|
||||||
return total_additional_pay
|
and ss.start_date between %(from_date)s and %(to_date)s
|
||||||
|
and ss.end_date between %(from_date)s and %(to_date)s
|
||||||
|
""", {
|
||||||
|
"employee": self.employee,
|
||||||
|
"from_date": from_date,
|
||||||
|
"to_date": self.start_date
|
||||||
|
})
|
||||||
|
return flt(sum_additional_earning[0][0]) if sum_additional_earning else 0
|
||||||
|
|
||||||
def get_tax_paid_in_period(self, payroll_period, tax_component, only_total=False):
|
def get_tax_paid_in_period(self, payroll_period, tax_component, only_total=False):
|
||||||
# find total_tax_paid, tax paid for benefit, additional_salary
|
# find total_tax_paid, tax paid for benefit, additional_salary
|
||||||
sum_tax_paid = frappe.db.sql("""select sum(sd.amount), sum(tax_on_flexible_benefit),
|
sum_tax_paid = frappe.db.sql("""
|
||||||
sum(tax_on_additional_salary) from `tabSalary Detail` sd join `tabSalary Slip`
|
select
|
||||||
ss on sd.parent=ss.name where sd.parentfield='deductions' and sd.salary_component='{3}'
|
sum(sd.amount), sum(tax_on_flexible_benefit), sum(tax_on_additional_salary)
|
||||||
and sd.variable_based_on_taxable_salary=1 and ss.docstatus=1 and ss.employee='{0}'
|
from
|
||||||
and ss.start_date between '{1}' and '{2}' and ss.end_date between '{1}' and
|
`tabSalary Detail` sd join `tabSalary Slip` ss on sd.parent=ss.name
|
||||||
'{2}'""".format(self.employee, payroll_period.start_date, self.start_date, tax_component))
|
where
|
||||||
|
sd.parentfield='deductions' and sd.salary_component=%(salary_component)s
|
||||||
|
and sd.variable_based_on_taxable_salary=1
|
||||||
|
and ss.docstatus=1 and ss.employee=%(employee)s
|
||||||
|
and ss.start_date between %(from_date)s and %(to_date)s
|
||||||
|
and ss.end_date between %(from_date)s and %(to_date)s
|
||||||
|
""", {
|
||||||
|
"salary_component": tax_component,
|
||||||
|
"employee": self.employee,
|
||||||
|
"from_date": payroll_period.start_date,
|
||||||
|
"to_date": self.start_date
|
||||||
|
})
|
||||||
if sum_tax_paid and sum_tax_paid[0][0]:
|
if sum_tax_paid and sum_tax_paid[0][0]:
|
||||||
return {'total_tax_paid': sum_tax_paid[0][0], 'benefit_tax':sum_tax_paid[0][1], 'additional_tax': sum_tax_paid[0][2]}
|
return {
|
||||||
|
'total_tax_paid': sum_tax_paid[0][0],
|
||||||
|
'benefit_tax':sum_tax_paid[0][1],
|
||||||
|
'additional_tax': sum_tax_paid[0][2]
|
||||||
|
}
|
||||||
|
|
||||||
def get_taxable_earnings(self, include_flexi=0, only_flexi=0):
|
def get_taxable_earnings(self, include_flexi=0, only_flexi=0):
|
||||||
taxable_earning = 0
|
taxable_earning = 0
|
||||||
@ -698,22 +734,22 @@ class SalarySlip(TransactionBase):
|
|||||||
additional_income += earning.amount
|
additional_income += earning.amount
|
||||||
continue
|
continue
|
||||||
if only_flexi:
|
if only_flexi:
|
||||||
if earning.is_tax_applicable and earning.is_flexible_benefit:
|
if earning.is_flexible_benefit:
|
||||||
taxable_earning += earning.amount
|
taxable_earning += earning.amount
|
||||||
continue
|
continue
|
||||||
if include_flexi:
|
if include_flexi or not earning.is_flexible_benefit:
|
||||||
if earning.is_tax_applicable or (earning.is_tax_applicable and earning.is_flexible_benefit):
|
|
||||||
taxable_earning += earning.amount
|
taxable_earning += earning.amount
|
||||||
else:
|
return {
|
||||||
if earning.is_tax_applicable and not earning.is_flexible_benefit:
|
"taxable_earning": taxable_earning,
|
||||||
taxable_earning += earning.amount
|
"additional_income": additional_income
|
||||||
return {"taxable_earning": taxable_earning, "additional_income": additional_income}
|
}
|
||||||
|
|
||||||
def calculate_tax(self, args):
|
def calculate_tax(self, args):
|
||||||
tax_amount, benefit_tax, additional_tax = 0, 0, 0
|
tax_amount, benefit_tax, additional_tax = 0, 0, 0
|
||||||
annual_taxable_earning = args.get("annual_taxable_earning")
|
annual_taxable_earning = args.get("annual_taxable_earning")
|
||||||
benefit_to_tax = args.get("unclaimed_benefit")
|
benefit_to_tax = args.get("unclaimed_benefit")
|
||||||
additional_income = args.get("additional_income")
|
additional_income = args.get("additional_income")
|
||||||
|
|
||||||
# Get tax calc by period
|
# Get tax calc by period
|
||||||
annual_tax = self.calculate_tax_by_tax_slab(args.get("payroll_period"), annual_taxable_earning)
|
annual_tax = self.calculate_tax_by_tax_slab(args.get("payroll_period"), annual_taxable_earning)
|
||||||
|
|
||||||
@ -744,8 +780,10 @@ class SalarySlip(TransactionBase):
|
|||||||
|
|
||||||
def calculate_tax_by_tax_slab(self, payroll_period, annual_taxable_earning):
|
def calculate_tax_by_tax_slab(self, payroll_period, annual_taxable_earning):
|
||||||
payroll_period_obj = frappe.get_doc("Payroll Period", payroll_period)
|
payroll_period_obj = frappe.get_doc("Payroll Period", payroll_period)
|
||||||
|
annual_taxable_earning -= flt(payroll_period_obj.standard_tax_exemption_amount)
|
||||||
data = self.get_data_for_eval()
|
data = self.get_data_for_eval()
|
||||||
data.update({"annual_taxable_earning": annual_taxable_earning})
|
data.update({"annual_taxable_earning": annual_taxable_earning})
|
||||||
|
|
||||||
taxable_amount = 0
|
taxable_amount = 0
|
||||||
for slab in payroll_period_obj.taxable_salary_slabs:
|
for slab in payroll_period_obj.taxable_salary_slabs:
|
||||||
if slab.condition and not self.eval_tax_slab_condition(slab.condition, data):
|
if slab.condition and not self.eval_tax_slab_condition(slab.condition, data):
|
||||||
@ -812,3 +850,7 @@ def unlink_ref_doc_from_salary_slip(ref_no):
|
|||||||
for ss in linked_ss:
|
for ss in linked_ss:
|
||||||
ss_doc = frappe.get_doc("Salary Slip", ss)
|
ss_doc = frappe.get_doc("Salary Slip", ss)
|
||||||
frappe.db.set_value("Salary Slip", ss_doc.name, "journal_entry", "")
|
frappe.db.set_value("Salary Slip", ss_doc.name, "journal_entry", "")
|
||||||
|
|
||||||
|
def generate_password_for_pdf(policy_template, employee):
|
||||||
|
employee = frappe.get_doc("Employee", employee)
|
||||||
|
return policy_template.format(**employee.as_dict())
|
||||||
|
@ -159,21 +159,21 @@ class TestSalarySlip(unittest.TestCase):
|
|||||||
month = "%02d" % getdate(nowdate()).month
|
month = "%02d" % getdate(nowdate()).month
|
||||||
m = get_month_details(fiscal_year, month)
|
m = get_month_details(fiscal_year, month)
|
||||||
|
|
||||||
for payroll_frequncy in ["Monthly", "Bimonthly", "Fortnightly", "Weekly", "Daily"]:
|
for payroll_frequency in ["Monthly", "Bimonthly", "Fortnightly", "Weekly", "Daily"]:
|
||||||
make_employee(payroll_frequncy + "_test_employee@salary.com")
|
make_employee(payroll_frequency + "_test_employee@salary.com")
|
||||||
ss = make_employee_salary_slip(payroll_frequncy + "_test_employee@salary.com", payroll_frequncy)
|
ss = make_employee_salary_slip(payroll_frequency + "_test_employee@salary.com", payroll_frequency)
|
||||||
if payroll_frequncy == "Monthly":
|
if payroll_frequency == "Monthly":
|
||||||
self.assertEqual(ss.end_date, m['month_end_date'])
|
self.assertEqual(ss.end_date, m['month_end_date'])
|
||||||
elif payroll_frequncy == "Bimonthly":
|
elif payroll_frequency == "Bimonthly":
|
||||||
if getdate(ss.start_date).day <= 15:
|
if getdate(ss.start_date).day <= 15:
|
||||||
self.assertEqual(ss.end_date, m['month_mid_end_date'])
|
self.assertEqual(ss.end_date, m['month_mid_end_date'])
|
||||||
else:
|
else:
|
||||||
self.assertEqual(ss.end_date, m['month_end_date'])
|
self.assertEqual(ss.end_date, m['month_end_date'])
|
||||||
elif payroll_frequncy == "Fortnightly":
|
elif payroll_frequency == "Fortnightly":
|
||||||
self.assertEqual(ss.end_date, add_days(nowdate(),13))
|
self.assertEqual(ss.end_date, add_days(nowdate(),13))
|
||||||
elif payroll_frequncy == "Weekly":
|
elif payroll_frequency == "Weekly":
|
||||||
self.assertEqual(ss.end_date, add_days(nowdate(),6))
|
self.assertEqual(ss.end_date, add_days(nowdate(),6))
|
||||||
elif payroll_frequncy == "Daily":
|
elif payroll_frequency == "Daily":
|
||||||
self.assertEqual(ss.end_date, nowdate())
|
self.assertEqual(ss.end_date, nowdate())
|
||||||
|
|
||||||
def test_tax_for_payroll_period(self):
|
def test_tax_for_payroll_period(self):
|
||||||
|
@ -57,11 +57,12 @@ class SalaryStructure(Document):
|
|||||||
have_a_flexi = True
|
have_a_flexi = True
|
||||||
max_of_component = frappe.db.get_value("Salary Component", earning_component.salary_component, "max_benefit_amount")
|
max_of_component = frappe.db.get_value("Salary Component", earning_component.salary_component, "max_benefit_amount")
|
||||||
flexi_amount += max_of_component
|
flexi_amount += max_of_component
|
||||||
|
|
||||||
if have_a_flexi and flt(self.max_benefits) == 0:
|
if have_a_flexi and flt(self.max_benefits) == 0:
|
||||||
frappe.throw(_("Max benefits should be greater than zero to dispense benefits"))
|
frappe.throw(_("Max benefits should be greater than zero to dispense benefits"))
|
||||||
if have_a_flexi and flt(self.max_benefits) > flexi_amount:
|
if have_a_flexi and flexi_amount and flt(self.max_benefits) > flexi_amount:
|
||||||
frappe.throw(_("Total flexible benefit component amount {0} should not be less \
|
frappe.throw(_("Total flexible benefit component amount {0} should not be less than max benefits {1}")
|
||||||
than max benefits {1}").format(flexi_amount, self.max_benefits))
|
.format(flexi_amount, self.max_benefits))
|
||||||
if not have_a_flexi and flt(self.max_benefits) > 0:
|
if not have_a_flexi and flt(self.max_benefits) > 0:
|
||||||
frappe.throw(_("Salary Structure should have flexible benefit component(s) to dispense benefit amount"))
|
frappe.throw(_("Salary Structure should have flexible benefit component(s) to dispense benefit amount"))
|
||||||
|
|
||||||
|
@ -5,9 +5,19 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
from frappe import _
|
||||||
|
from frappe.utils import time_diff_in_seconds
|
||||||
from erpnext.hr.doctype.employee.employee import get_employee_emails
|
from erpnext.hr.doctype.employee.employee import get_employee_emails
|
||||||
|
|
||||||
class TrainingEvent(Document):
|
class TrainingEvent(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
self.set_employee_emails()
|
||||||
|
self.validate_period()
|
||||||
|
|
||||||
|
def set_employee_emails(self):
|
||||||
self.employee_emails = ', '.join(get_employee_emails([d.employee
|
self.employee_emails = ', '.join(get_employee_emails([d.employee
|
||||||
for d in self.employees]))
|
for d in self.employees]))
|
||||||
|
|
||||||
|
def validate_period(self):
|
||||||
|
if time_diff_in_seconds(self.end_time, self.start_time) <= 0:
|
||||||
|
frappe.throw(_('End time cannot be before start time'))
|
0
erpnext/hr/report/bank_remittance/__init__.py
Normal file
0
erpnext/hr/report/bank_remittance/__init__.py
Normal file
28
erpnext/hr/report/bank_remittance/bank_remittance.js
Normal file
28
erpnext/hr/report/bank_remittance/bank_remittance.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
/* eslint-disable */
|
||||||
|
|
||||||
|
frappe.query_reports["Bank Remittance"] = {
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
"fieldname":"company",
|
||||||
|
"label": __("Company"),
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": "Company",
|
||||||
|
"default": frappe.defaults.get_user_default("Company"),
|
||||||
|
"reqd": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"from_date",
|
||||||
|
label: __("From Date"),
|
||||||
|
fieldtype: "Date",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"to_date",
|
||||||
|
label: __("To Date"),
|
||||||
|
fieldtype: "Date",
|
||||||
|
},
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
25
erpnext/hr/report/bank_remittance/bank_remittance.json
Normal file
25
erpnext/hr/report/bank_remittance/bank_remittance.json
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"add_total_row": 0,
|
||||||
|
"creation": "2019-03-26 16:57:52.558895",
|
||||||
|
"disable_prepared_report": 0,
|
||||||
|
"disabled": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "Report",
|
||||||
|
"idx": 0,
|
||||||
|
"is_standard": "Yes",
|
||||||
|
"letter_head": "Gadgets International",
|
||||||
|
"modified": "2019-03-26 16:57:52.558895",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "HR",
|
||||||
|
"name": "Bank Remittance",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"prepared_report": 0,
|
||||||
|
"ref_doctype": "Payroll Entry",
|
||||||
|
"report_name": "Bank Remittance",
|
||||||
|
"report_type": "Script Report",
|
||||||
|
"roles": [
|
||||||
|
{
|
||||||
|
"role": "HR Manager"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
154
erpnext/hr/report/bank_remittance/bank_remittance.py
Normal file
154
erpnext/hr/report/bank_remittance/bank_remittance.py
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
# 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.utils import formatdate
|
||||||
|
import itertools
|
||||||
|
from frappe import _, get_all
|
||||||
|
|
||||||
|
def execute(filters=None):
|
||||||
|
columns = [
|
||||||
|
{
|
||||||
|
"label": _("Payroll Number"),
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"fieldname": "payroll_no",
|
||||||
|
"options": "Payroll Entry",
|
||||||
|
"width": 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Debit A/C Number"),
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"fieldname": "debit_account",
|
||||||
|
"hidden": 1,
|
||||||
|
"width": 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Payment Date"),
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"fieldname": "payment_date",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Employee Name"),
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"fieldname": "employee_name",
|
||||||
|
"options": "Employee",
|
||||||
|
"width": 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Bank Name"),
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"fieldname": "bank_name",
|
||||||
|
"width": 50
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Employee A/C Number"),
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"fieldname": "employee_account_no",
|
||||||
|
"width": 50
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("IFSC Code"),
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"fieldname": "bank_code",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Currency"),
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"fieldname": "currency",
|
||||||
|
"width": 50
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Net Salary Amount"),
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"options": "currency",
|
||||||
|
"fieldname": "amount",
|
||||||
|
"width": 100
|
||||||
|
}
|
||||||
|
]
|
||||||
|
data = []
|
||||||
|
|
||||||
|
accounts = get_bank_accounts()
|
||||||
|
payroll_entries = get_payroll_entries(accounts, filters)
|
||||||
|
salary_slips = get_salary_slips(payroll_entries)
|
||||||
|
get_emp_bank_ifsc_code(salary_slips)
|
||||||
|
|
||||||
|
for salary in salary_slips:
|
||||||
|
if salary.bank_name and salary.bank_account_no and salary.debit_acc_no and salary.status in ["Submitted", "Paid"]:
|
||||||
|
row = {
|
||||||
|
"payroll_no": salary.payroll_entry,
|
||||||
|
"debit_account": salary.debit_acc_no,
|
||||||
|
"payment_date": frappe.utils.formatdate(salary.modified.strftime('%Y-%m-%d')),
|
||||||
|
"bank_name": salary.bank_name,
|
||||||
|
"employee_account_no": salary.bank_account_no,
|
||||||
|
"bank_code": salary.ifsc_code,
|
||||||
|
"employee_name": salary.employee+": " + salary.employee_name,
|
||||||
|
"currency": frappe.get_cached_value('Company', filters.company, 'default_currency'),
|
||||||
|
"amount": salary.net_pay,
|
||||||
|
}
|
||||||
|
data.append(row)
|
||||||
|
return columns, data
|
||||||
|
|
||||||
|
def get_bank_accounts():
|
||||||
|
accounts = [d.name for d in get_all("Account", filters={"account_type": "Bank"})]
|
||||||
|
return accounts
|
||||||
|
|
||||||
|
def get_payroll_entries(accounts, filters):
|
||||||
|
payroll_filter = [
|
||||||
|
('payment_account', 'IN', accounts),
|
||||||
|
('number_of_employees', '>', 0),
|
||||||
|
('Company', '=', filters.company)
|
||||||
|
]
|
||||||
|
if filters.to_date:
|
||||||
|
payroll_filter.append(('posting_date', '<', filters.to_date))
|
||||||
|
|
||||||
|
if filters.from_date:
|
||||||
|
payroll_filter.append(('posting_date', '>', filters.from_date))
|
||||||
|
|
||||||
|
entries = get_all("Payroll Entry", payroll_filter, ["name", "payment_account"])
|
||||||
|
|
||||||
|
payment_accounts = [d.payment_account for d in entries]
|
||||||
|
set_company_account(payment_accounts, entries)
|
||||||
|
return entries
|
||||||
|
|
||||||
|
def get_salary_slips(payroll_entries):
|
||||||
|
payroll = [d.name for d in payroll_entries]
|
||||||
|
salary_slips = get_all("Salary Slip", filters = [("payroll_entry", "IN", payroll)],
|
||||||
|
fields = ["modified", "net_pay", "bank_name", "bank_account_no", "payroll_entry", "employee", "employee_name", "status"]
|
||||||
|
)
|
||||||
|
|
||||||
|
payroll_entry_map = {}
|
||||||
|
for entry in payroll_entries:
|
||||||
|
payroll_entry_map[entry.name] = entry
|
||||||
|
|
||||||
|
# appending company debit accounts
|
||||||
|
for slip in salary_slips:
|
||||||
|
slip["debit_acc_no"] = payroll_entry_map[slip.payroll_entry]['company_account']
|
||||||
|
|
||||||
|
return salary_slips
|
||||||
|
|
||||||
|
def get_emp_bank_ifsc_code(salary_slips):
|
||||||
|
emp_names = [d.employee for d in salary_slips]
|
||||||
|
ifsc_codes = get_all("Employee", [("name", "IN", emp_names)], ["ifsc_code", "name"])
|
||||||
|
|
||||||
|
ifsc_codes_map = {}
|
||||||
|
for code in ifsc_codes:
|
||||||
|
ifsc_codes_map[code.name] = code
|
||||||
|
|
||||||
|
for slip in salary_slips:
|
||||||
|
slip["ifsc_code"] = ifsc_codes_map[code.name]['ifsc_code']
|
||||||
|
|
||||||
|
return salary_slips
|
||||||
|
|
||||||
|
def set_company_account(payment_accounts, payroll_entries):
|
||||||
|
company_accounts = get_all("Bank Account", [("account", "in", payment_accounts)], ["account", "bank_account_no"])
|
||||||
|
company_accounts_map = {}
|
||||||
|
for acc in company_accounts:
|
||||||
|
company_accounts_map[acc.account] = acc
|
||||||
|
|
||||||
|
for entry in payroll_entries:
|
||||||
|
entry["company_account"] = company_accounts_map[entry.payment_account]['bank_account_no']
|
||||||
|
|
||||||
|
return payroll_entries
|
0
erpnext/hr/report/loan_repayment/__init__.py
Normal file
0
erpnext/hr/report/loan_repayment/__init__.py
Normal file
9
erpnext/hr/report/loan_repayment/loan_repayment.js
Normal file
9
erpnext/hr/report/loan_repayment/loan_repayment.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
/* eslint-disable */
|
||||||
|
|
||||||
|
frappe.query_reports["Loan Repayment"] = {
|
||||||
|
"filters": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
28
erpnext/hr/report/loan_repayment/loan_repayment.json
Normal file
28
erpnext/hr/report/loan_repayment/loan_repayment.json
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"add_total_row": 0,
|
||||||
|
"creation": "2019-03-29 18:58:00.166032",
|
||||||
|
"disable_prepared_report": 0,
|
||||||
|
"disabled": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "Report",
|
||||||
|
"idx": 0,
|
||||||
|
"is_standard": "Yes",
|
||||||
|
"letter_head": "",
|
||||||
|
"modified": "2019-03-29 18:58:00.166032",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "HR",
|
||||||
|
"name": "Loan Repayment",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"prepared_report": 0,
|
||||||
|
"ref_doctype": "Loan",
|
||||||
|
"report_name": "Loan Repayment",
|
||||||
|
"report_type": "Script Report",
|
||||||
|
"roles": [
|
||||||
|
{
|
||||||
|
"role": "HR Manager"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Employee"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
95
erpnext/hr/report/loan_repayment/loan_repayment.py
Normal file
95
erpnext/hr/report/loan_repayment/loan_repayment.py
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
# 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 = create_columns()
|
||||||
|
data = get_record()
|
||||||
|
return columns, data
|
||||||
|
|
||||||
|
def create_columns():
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
"label": _("Employee"),
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"fieldname": "employee",
|
||||||
|
"options": "Employee",
|
||||||
|
"width": 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Loan"),
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"fieldname": "loan_name",
|
||||||
|
"options": "Loan",
|
||||||
|
"width": 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Loan Amount"),
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"fieldname": "loan_amount",
|
||||||
|
"options": "currency",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Interest"),
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"fieldname": "interest",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Payable Amount"),
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"fieldname": "payable_amount",
|
||||||
|
"options": "currency",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("EMI"),
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"fieldname": "emi",
|
||||||
|
"options": "currency",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Paid Amount"),
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"fieldname": "paid_amount",
|
||||||
|
"options": "currency",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Outstanding Amount"),
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"fieldname": "out_amt",
|
||||||
|
"options": "currency",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
def get_record():
|
||||||
|
data = []
|
||||||
|
loans = frappe.get_all("Loan",
|
||||||
|
filters=[("status", "=", "Fully Disbursed")],
|
||||||
|
fields=["applicant", "applicant_name", "name", "loan_amount", "rate_of_interest",
|
||||||
|
"total_payment", "monthly_repayment_amount", "total_amount_paid"]
|
||||||
|
)
|
||||||
|
|
||||||
|
for loan in loans:
|
||||||
|
row = {
|
||||||
|
"employee": loan.applicant + ": " + loan.applicant_name,
|
||||||
|
"loan_name": loan.name,
|
||||||
|
"loan_amount": loan.loan_amount,
|
||||||
|
"interest": str(loan.rate_of_interest) + "%",
|
||||||
|
"payable_amount": loan.total_payment,
|
||||||
|
"emi": loan.monthly_repayment_amount,
|
||||||
|
"paid_amount": loan.total_amount_paid,
|
||||||
|
"out_amt": loan.total_payment - loan.total_amount_paid
|
||||||
|
}
|
||||||
|
|
||||||
|
data.append(row)
|
||||||
|
|
||||||
|
return data
|
@ -5,11 +5,6 @@ frappe.provide("erpnext.bom");
|
|||||||
|
|
||||||
frappe.ui.form.on("BOM", {
|
frappe.ui.form.on("BOM", {
|
||||||
setup: function(frm) {
|
setup: function(frm) {
|
||||||
frm.add_fetch("item", "description", "description");
|
|
||||||
frm.add_fetch("item", "image", "image");
|
|
||||||
frm.add_fetch("item", "item_name", "item_name");
|
|
||||||
frm.add_fetch("item", "stock_uom", "uom");
|
|
||||||
|
|
||||||
frm.set_query("bom_no", "items", function() {
|
frm.set_query("bom_no", "items", function() {
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
@ -414,7 +409,3 @@ frappe.ui.form.on("BOM", "with_operations", function(frm) {
|
|||||||
}
|
}
|
||||||
toggle_operations(frm);
|
toggle_operations(frm);
|
||||||
});
|
});
|
||||||
|
|
||||||
cur_frm.cscript.image = function() {
|
|
||||||
refresh_field("image_view");
|
|
||||||
};
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"description": "Item to be manufactured or repacked",
|
"description": "Item to be manufactured or repacked",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "item",
|
"fieldname": "item",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -55,6 +56,8 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "",
|
"depends_on": "",
|
||||||
|
"fetch_from": "item.item_name",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "item_name",
|
"fieldname": "item_name",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -87,6 +90,43 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_from": "item.image",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "image",
|
||||||
|
"fieldtype": "Attach Image",
|
||||||
|
"hidden": 1,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Image",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "image",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 1,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 1,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"columns": 0,
|
||||||
|
"fetch_from": "item.stock_uom",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "uom",
|
"fieldname": "uom",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -121,6 +161,7 @@
|
|||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "1",
|
"default": "1",
|
||||||
"description": "Quantity of item obtained after manufacturing / repacking from given quantities of raw materials",
|
"description": "Quantity of item obtained after manufacturing / repacking from given quantities of raw materials",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "quantity",
|
"fieldname": "quantity",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -154,6 +195,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "cb0",
|
"fieldname": "cb0",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -185,6 +227,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "1",
|
"default": "1",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "is_active",
|
"fieldname": "is_active",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -219,6 +262,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "1",
|
"default": "1",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "is_default",
|
"fieldname": "is_default",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -253,6 +297,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"description": "Manage cost of operations",
|
"description": "Manage cost of operations",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "with_operations",
|
"fieldname": "with_operations",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -284,6 +329,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "inspection_required",
|
"fieldname": "inspection_required",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -316,6 +362,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "allow_alternative_item",
|
"fieldname": "allow_alternative_item",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -348,6 +395,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "allow_same_item_multiple_times",
|
"fieldname": "allow_same_item_multiple_times",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -381,6 +429,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "1",
|
"default": "1",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "set_rate_of_sub_assembly_item_based_on_bom",
|
"fieldname": "set_rate_of_sub_assembly_item_based_on_bom",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -414,6 +463,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "inspection_required",
|
"depends_on": "inspection_required",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "quality_inspection_template",
|
"fieldname": "quality_inspection_template",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -447,6 +497,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "currency_detail",
|
"fieldname": "currency_detail",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -479,6 +530,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,
|
||||||
@ -513,6 +565,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "",
|
"default": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "transfer_material_against",
|
"fieldname": "transfer_material_against",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -546,6 +599,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "conversion_rate",
|
"fieldname": "conversion_rate",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -578,6 +632,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_12",
|
"fieldname": "column_break_12",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -609,6 +664,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "currency",
|
"fieldname": "currency",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -643,6 +699,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"default": "Valuation Rate",
|
"default": "Valuation Rate",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "rm_cost_as_per",
|
"fieldname": "rm_cost_as_per",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -676,6 +733,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:doc.rm_cost_as_per===\"Price List\"",
|
"depends_on": "eval:doc.rm_cost_as_per===\"Price List\"",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "buying_price_list",
|
"fieldname": "buying_price_list",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -710,6 +768,7 @@
|
|||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "",
|
"depends_on": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "operations_section",
|
"fieldname": "operations_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -742,6 +801,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "routing",
|
"fieldname": "routing",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -775,6 +835,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "operations",
|
"fieldname": "operations",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -809,6 +870,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "materials_section",
|
"fieldname": "materials_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -841,6 +903,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "items",
|
"fieldname": "items",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -875,6 +938,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "scrap_section",
|
"fieldname": "scrap_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -907,6 +971,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "scrap_items",
|
"fieldname": "scrap_items",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -940,6 +1005,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "costing",
|
"fieldname": "costing",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -972,6 +1038,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "operating_cost",
|
"fieldname": "operating_cost",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1004,6 +1071,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "raw_material_cost",
|
"fieldname": "raw_material_cost",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1036,6 +1104,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "scrap_material_cost",
|
"fieldname": "scrap_material_cost",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1069,6 +1138,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "cb1",
|
"fieldname": "cb1",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1099,6 +1169,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "base_operating_cost",
|
"fieldname": "base_operating_cost",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1132,6 +1203,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "base_raw_material_cost",
|
"fieldname": "base_raw_material_cost",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1165,6 +1237,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "base_scrap_material_cost",
|
"fieldname": "base_scrap_material_cost",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1198,6 +1271,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "total_cost_of_bom",
|
"fieldname": "total_cost_of_bom",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1229,6 +1303,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "total_cost",
|
"fieldname": "total_cost",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1261,6 +1336,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_26",
|
"fieldname": "column_break_26",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1292,6 +1368,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "base_total_cost",
|
"fieldname": "base_total_cost",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1325,6 +1402,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "more_info_section",
|
"fieldname": "more_info_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1356,6 +1434,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,
|
||||||
@ -1390,6 +1469,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,
|
||||||
@ -1422,6 +1502,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "col_break23",
|
"fieldname": "col_break23",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1452,6 +1533,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break_25",
|
"fieldname": "section_break_25",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1483,6 +1565,8 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_from": "item.description",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "description",
|
"fieldname": "description",
|
||||||
"fieldtype": "Small Text",
|
"fieldtype": "Small Text",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1514,6 +1598,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "column_break_27",
|
"fieldname": "column_break_27",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1538,71 +1623,6 @@
|
|||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "image",
|
|
||||||
"fieldtype": "Attach",
|
|
||||||
"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": "Image",
|
|
||||||
"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": "image_view",
|
|
||||||
"fieldtype": "Image",
|
|
||||||
"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": "Image View",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "image",
|
|
||||||
"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,
|
||||||
@ -1611,6 +1631,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:!doc.__islocal",
|
"depends_on": "eval:!doc.__islocal",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "section_break0",
|
"fieldname": "section_break0",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1642,6 +1663,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "exploded_items",
|
"fieldname": "exploded_items",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1676,6 +1698,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "website_section",
|
"fieldname": "website_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1710,6 +1733,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "",
|
"depends_on": "",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "show_in_website",
|
"fieldname": "show_in_website",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1742,6 +1766,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "route",
|
"fieldname": "route",
|
||||||
"fieldtype": "Small Text",
|
"fieldtype": "Small Text",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1776,6 +1801,7 @@
|
|||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "show_in_website",
|
"depends_on": "show_in_website",
|
||||||
"description": "Item Image (if not slideshow)",
|
"description": "Item Image (if not slideshow)",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "website_image",
|
"fieldname": "website_image",
|
||||||
"fieldtype": "Attach Image",
|
"fieldtype": "Attach Image",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1808,6 +1834,7 @@
|
|||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "thumbnail",
|
"fieldname": "thumbnail",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1842,6 +1869,7 @@
|
|||||||
"collapsible_depends_on": "website_items",
|
"collapsible_depends_on": "website_items",
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "show_in_website",
|
"depends_on": "show_in_website",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "sb_web_spec",
|
"fieldname": "sb_web_spec",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1875,6 +1903,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "show_in_website",
|
"depends_on": "show_in_website",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "web_long_description",
|
"fieldname": "web_long_description",
|
||||||
"fieldtype": "Text Editor",
|
"fieldtype": "Text Editor",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1908,6 +1937,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "show_in_website",
|
"depends_on": "show_in_website",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "show_items",
|
"fieldname": "show_items",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1941,6 +1971,7 @@
|
|||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"depends_on": "eval:(doc.show_in_website && doc.with_operations)",
|
"depends_on": "eval:(doc.show_in_website && doc.with_operations)",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
"fieldname": "show_operations",
|
"fieldname": "show_operations",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -1972,13 +2003,14 @@
|
|||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"icon": "fa fa-sitemap",
|
"icon": "fa fa-sitemap",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
|
"image_field": "image",
|
||||||
"image_view": 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-01-30 16:39:34.353721",
|
"modified": "2019-05-01 16:36:05.197126",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "BOM",
|
"name": "BOM",
|
||||||
@ -2026,7 +2058,7 @@
|
|||||||
"quick_entry": 0,
|
"quick_entry": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"read_only_onload": 0,
|
"read_only_onload": 0,
|
||||||
"search_fields": "item",
|
"search_fields": "item, item_name",
|
||||||
"show_name_in_global_search": 1,
|
"show_name_in_global_search": 1,
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
|
@ -181,6 +181,41 @@
|
|||||||
"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_from": "production_item.image",
|
||||||
|
"fetch_if_empty": 0,
|
||||||
|
"fieldname": "image",
|
||||||
|
"fieldtype": "Attach Image",
|
||||||
|
"hidden": 1,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_global_search": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
|
"label": "Image",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "image",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 1,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 1,
|
||||||
|
"remember_last_selected_value": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"translatable": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
"allow_in_quick_entry": 0,
|
"allow_in_quick_entry": 0,
|
||||||
@ -1702,13 +1737,14 @@
|
|||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"icon": "fa fa-cogs",
|
"icon": "fa fa-cogs",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
|
"image_field": "image",
|
||||||
"image_view": 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 03:02:39.126868",
|
"modified": "2019-05-01 03:02:39.126868",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "Work Order",
|
"name": "Work Order",
|
||||||
@ -1762,4 +1798,4 @@
|
|||||||
"track_changes": 1,
|
"track_changes": 1,
|
||||||
"track_seen": 1,
|
"track_seen": 1,
|
||||||
"track_views": 0
|
"track_views": 0
|
||||||
}
|
}
|
0
erpnext/manufacturing/notification/__init__.py
Normal file
0
erpnext/manufacturing/notification/__init__.py
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"attach_print": 0,
|
||||||
|
"channel": "Email",
|
||||||
|
"condition": "doc.status == \"Received\" or doc.status == \"Partially Received\"",
|
||||||
|
"creation": "2019-04-29 11:53:23.981418",
|
||||||
|
"days_in_advance": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "Notification",
|
||||||
|
"document_type": "Material Request",
|
||||||
|
"enabled": 1,
|
||||||
|
"event": "Value Change",
|
||||||
|
"idx": 0,
|
||||||
|
"is_standard": 1,
|
||||||
|
"message": "<b>Material Request Type</b>: {{ doc.material_request_type }}<br>\n<b>Company</b>: {{ doc.company }}\n\n<h3>Order Summary</h3>\n\n<table border=2 >\n <tr align=\"center\">\n <th>Item Name</th>\n <th>Received Quantity</th>\n </tr>\n {% for item in doc.items %}\n {% if frappe.utils.flt(item.received_qty, 2) > 0.0 %}\n <tr align=\"center\">\n <td>{{ item.item_code }}</td>\n <td>{{ frappe.utils.flt(item.received_qty, 2) }}</td>\n </tr>\n {% endif %}\n {% endfor %}\n</table>",
|
||||||
|
"method": "",
|
||||||
|
"modified": "2019-05-01 18:02:51.090037",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Manufacturing",
|
||||||
|
"name": "Material Request Receipt Notification",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"recipients": [
|
||||||
|
{
|
||||||
|
"email_by_document_field": "requested_by"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"sender_email": "",
|
||||||
|
"subject": "{{ doc.name }} has been received",
|
||||||
|
"value_changed": "status"
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
<b>Material Request Type</b>: {{ doc.material_request_type }}<br>
|
||||||
|
<b>Company</b>: {{ doc.company }}
|
||||||
|
|
||||||
|
<h3>Order Summary</h3>
|
||||||
|
|
||||||
|
<table border=2 >
|
||||||
|
<tr align="center">
|
||||||
|
<th>Item Name</th>
|
||||||
|
<th>Received Quantity</th>
|
||||||
|
</tr>
|
||||||
|
{% for item in doc.items %}
|
||||||
|
{% if frappe.utils.flt(item.received_qty, 2) > 0.0 %}
|
||||||
|
<tr align="center">
|
||||||
|
<td>{{ item.item_code }}</td>
|
||||||
|
<td>{{ frappe.utils.flt(item.received_qty, 2) }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
@ -0,0 +1,7 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def get_context(context):
|
||||||
|
# do your magic here
|
||||||
|
pass
|
@ -512,6 +512,7 @@ erpnext.patches.v11_0.rename_employee_loan_to_loan
|
|||||||
erpnext.patches.v11_0.move_leave_approvers_from_employee #13-06-2018
|
erpnext.patches.v11_0.move_leave_approvers_from_employee #13-06-2018
|
||||||
erpnext.patches.v11_0.update_department_lft_rgt
|
erpnext.patches.v11_0.update_department_lft_rgt
|
||||||
erpnext.patches.v11_0.add_default_email_template_for_leave
|
erpnext.patches.v11_0.add_default_email_template_for_leave
|
||||||
|
execute:frappe.reload_doc("HR", "doctype", "HR Settings")
|
||||||
erpnext.patches.v11_0.set_default_email_template_in_hr #08-06-2018
|
erpnext.patches.v11_0.set_default_email_template_in_hr #08-06-2018
|
||||||
erpnext.patches.v11_0.uom_conversion_data #30-06-2018
|
erpnext.patches.v11_0.uom_conversion_data #30-06-2018
|
||||||
erpnext.patches.v10_0.taxes_issue_with_pos
|
erpnext.patches.v10_0.taxes_issue_with_pos
|
||||||
@ -568,7 +569,7 @@ execute:frappe.delete_doc_if_exists("Page", "sales-analytics")
|
|||||||
execute:frappe.delete_doc_if_exists("Page", "purchase-analytics")
|
execute:frappe.delete_doc_if_exists("Page", "purchase-analytics")
|
||||||
execute:frappe.delete_doc_if_exists("Page", "stock-analytics")
|
execute:frappe.delete_doc_if_exists("Page", "stock-analytics")
|
||||||
execute:frappe.delete_doc_if_exists("Page", "production-analytics")
|
execute:frappe.delete_doc_if_exists("Page", "production-analytics")
|
||||||
erpnext.patches.v11_0.ewaybill_fields_gst_india #2018-11-13 #2019-01-09 #2019-04-01
|
erpnext.patches.v11_0.ewaybill_fields_gst_india #2019-05-01
|
||||||
erpnext.patches.v11_0.drop_column_max_days_allowed
|
erpnext.patches.v11_0.drop_column_max_days_allowed
|
||||||
erpnext.patches.v10_0.update_user_image_in_employee
|
erpnext.patches.v10_0.update_user_image_in_employee
|
||||||
erpnext.patches.v10_0.repost_gle_for_purchase_receipts_with_rejected_items
|
erpnext.patches.v10_0.repost_gle_for_purchase_receipts_with_rejected_items
|
||||||
@ -599,3 +600,5 @@ erpnext.patches.v11_1.set_variant_based_on
|
|||||||
erpnext.patches.v11_1.woocommerce_set_creation_user
|
erpnext.patches.v11_1.woocommerce_set_creation_user
|
||||||
erpnext.patches.v11_1.set_salary_details_submittable
|
erpnext.patches.v11_1.set_salary_details_submittable
|
||||||
erpnext.patches.v11_1.rename_depends_on_lwp
|
erpnext.patches.v11_1.rename_depends_on_lwp
|
||||||
|
execute:frappe.delete_doc("Report", "Inactive Items")
|
||||||
|
erpnext.patches.v11_1.delete_scheduling_tool
|
||||||
|
@ -70,7 +70,7 @@ def update_instructors(comp_dict):
|
|||||||
emp_details = frappe.get_all("Employee", fields=["name", "company"])
|
emp_details = frappe.get_all("Employee", fields=["name", "company"])
|
||||||
|
|
||||||
for employee in emp_details:
|
for employee in emp_details:
|
||||||
records = comp_dict[employee.company]
|
records = comp_dict[employee.company] if employee.company else []
|
||||||
|
|
||||||
for department in records:
|
for department in records:
|
||||||
when_then.append('''
|
when_then.append('''
|
||||||
|
@ -8,6 +8,17 @@ def execute():
|
|||||||
return
|
return
|
||||||
frappe.reload_doc("hr", "doctype", "Employee Tax Exemption Declaration")
|
frappe.reload_doc("hr", "doctype", "Employee Tax Exemption Declaration")
|
||||||
frappe.reload_doc("hr", "doctype", "Employee Tax Exemption Proof Submission")
|
frappe.reload_doc("hr", "doctype", "Employee Tax Exemption Proof Submission")
|
||||||
|
frappe.reload_doc("hr", "doctype", "Employee Grade")
|
||||||
|
frappe.reload_doc("hr", "doctype", "Leave Policy")
|
||||||
|
|
||||||
|
frappe.reload_doc("accounts", "doctype", "Bank Account")
|
||||||
|
frappe.reload_doc("accounts", "doctype", "Tax Withholding Category")
|
||||||
|
frappe.reload_doc("accounts", "doctype", "Allowed To Transact With")
|
||||||
|
frappe.reload_doc("accounts", "doctype", "Finance Book")
|
||||||
|
frappe.reload_doc("accounts", "doctype", "Loyalty Program")
|
||||||
|
|
||||||
|
frappe.reload_doc("stock", "doctype", "Item Barcode")
|
||||||
|
|
||||||
make_custom_fields()
|
make_custom_fields()
|
||||||
|
|
||||||
frappe.reload_doc("accounts", "doctype", "sales_taxes_and_charges")
|
frappe.reload_doc("accounts", "doctype", "sales_taxes_and_charges")
|
||||||
|
@ -2,7 +2,6 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
|
|
||||||
hr_settings = frappe.get_single("HR Settings")
|
hr_settings = frappe.get_single("HR Settings")
|
||||||
hr_settings.leave_approval_notification_template = "Leave Approval Notification"
|
hr_settings.leave_approval_notification_template = "Leave Approval Notification"
|
||||||
hr_settings.leave_status_notification_template = "Leave Status Notification"
|
hr_settings.leave_status_notification_template = "Leave Status Notification"
|
||||||
|
9
erpnext/patches/v11_1/delete_scheduling_tool.py
Normal file
9
erpnext/patches/v11_1/delete_scheduling_tool.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
if frappe.db.exists("DocType", "Scheduling Tool"):
|
||||||
|
frappe.delete_doc("DocType", "Scheduling Tool", ignore_permissions=True)
|
@ -7,6 +7,9 @@ def execute():
|
|||||||
if not company:
|
if not company:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
frappe.reload_doc('hr', 'doctype', 'payroll_period')
|
||||||
|
frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_declaration_category')
|
||||||
|
frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_proof_submission_detail')
|
||||||
frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_declaration')
|
frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_declaration')
|
||||||
frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_proof_submission')
|
frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_proof_submission')
|
||||||
|
|
||||||
|
@ -66,9 +66,12 @@ class ItemVariantsCacheManager:
|
|||||||
as_list=1
|
as_list=1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
disabled_items = set([i.name for i in frappe.db.get_all('Item', {'disabled': 1})])
|
||||||
|
|
||||||
attribute_value_item_map = frappe._dict({})
|
attribute_value_item_map = frappe._dict({})
|
||||||
item_attribute_value_map = frappe._dict({})
|
item_attribute_value_map = frappe._dict({})
|
||||||
|
|
||||||
|
item_variants_data = [r for r in item_variants_data if r[0] not in disabled_items]
|
||||||
for row in item_variants_data:
|
for row in item_variants_data:
|
||||||
item_code, attribute, attribute_value = row
|
item_code, attribute, attribute_value = row
|
||||||
# (attr, value) => [item1, item2]
|
# (attr, value) => [item1, item2]
|
||||||
@ -93,10 +96,13 @@ class ItemVariantsCacheManager:
|
|||||||
for key in keys:
|
for key in keys:
|
||||||
frappe.cache().hdel(key, self.item_code)
|
frappe.cache().hdel(key, self.item_code)
|
||||||
|
|
||||||
|
def rebuild_cache(self):
|
||||||
|
self.clear_cache()
|
||||||
|
enqueue_build_cache(self.item_code)
|
||||||
|
|
||||||
|
|
||||||
def build_cache(item_code):
|
def build_cache(item_code):
|
||||||
frappe.cache().hset('item_cache_build_in_progress', item_code, 1)
|
frappe.cache().hset('item_cache_build_in_progress', item_code, 1)
|
||||||
print('ItemVariantsCacheManager: Building cache for', item_code)
|
|
||||||
i = ItemVariantsCacheManager(item_code)
|
i = ItemVariantsCacheManager(item_code)
|
||||||
i.build_cache()
|
i.build_cache()
|
||||||
frappe.cache().hset('item_cache_build_in_progress', item_code, 0)
|
frappe.cache().hset('item_cache_build_in_progress', item_code, 0)
|
||||||
|
@ -102,6 +102,9 @@ def get_item_codes_by_attributes(attribute_filters, template_item_code=None):
|
|||||||
for attribute, values in attribute_filters.items():
|
for attribute, values in attribute_filters.items():
|
||||||
attribute_values = values
|
attribute_values = values
|
||||||
|
|
||||||
|
if not isinstance(attribute_values, list):
|
||||||
|
attribute_values = [attribute_values]
|
||||||
|
|
||||||
if not attribute_values: continue
|
if not attribute_values: continue
|
||||||
|
|
||||||
wheres = []
|
wheres = []
|
||||||
@ -257,7 +260,8 @@ def get_items_with_selected_attributes(item_code, selected_attributes):
|
|||||||
|
|
||||||
items = []
|
items = []
|
||||||
for attribute, value in selected_attributes.items():
|
for attribute, value in selected_attributes.items():
|
||||||
items.append(set(attribute_value_item_map[(attribute, value)]))
|
filtered_items = attribute_value_item_map.get((attribute, value), [])
|
||||||
|
items.append(set(filtered_items))
|
||||||
|
|
||||||
return set.intersection(*items)
|
return set.intersection(*items)
|
||||||
|
|
||||||
|
@ -109,6 +109,18 @@ frappe.ui.form.on("Project", {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
status: function(frm) {
|
||||||
|
if (frm.doc.status === 'Cancelled') {
|
||||||
|
frappe.confirm(__('Set tasks in this project as cancelled?'), () => {
|
||||||
|
frm.doc.tasks = frm.doc.tasks.map(task => {
|
||||||
|
task.status = 'Cancelled';
|
||||||
|
return task;
|
||||||
|
});
|
||||||
|
frm.refresh_field('tasks');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
frappe.ui.form.on("Project Task", {
|
frappe.ui.form.on("Project Task", {
|
||||||
|
@ -35,6 +35,9 @@ class Project(Document):
|
|||||||
|
|
||||||
def load_tasks(self):
|
def load_tasks(self):
|
||||||
"""Load `tasks` from the database"""
|
"""Load `tasks` from the database"""
|
||||||
|
if frappe.flags.in_import:
|
||||||
|
return
|
||||||
|
|
||||||
self.tasks = []
|
self.tasks = []
|
||||||
for task in self.get_tasks():
|
for task in self.get_tasks():
|
||||||
task_map = {
|
task_map = {
|
||||||
@ -358,7 +361,8 @@ class Project(Document):
|
|||||||
if not self.get('deleted_task_list'): return
|
if not self.get('deleted_task_list'): return
|
||||||
|
|
||||||
for d in self.get('deleted_task_list'):
|
for d in self.get('deleted_task_list'):
|
||||||
frappe.delete_doc("Task", d)
|
# unlink project
|
||||||
|
frappe.db.set_value('Task', d, 'project', '')
|
||||||
|
|
||||||
self.deleted_task_list = []
|
self.deleted_task_list = []
|
||||||
|
|
||||||
@ -481,16 +485,17 @@ def daily_reminder():
|
|||||||
projects = get_projects_for_collect_progress("Daily", fields)
|
projects = get_projects_for_collect_progress("Daily", fields)
|
||||||
|
|
||||||
for project in projects:
|
for project in projects:
|
||||||
if not check_project_update_exists(project.name, project.get("daily_time_to_send")):
|
if allow_to_make_project_update(project.name, project.get("daily_time_to_send"), "Daily"):
|
||||||
send_project_update_email_to_users(project.name)
|
send_project_update_email_to_users(project.name)
|
||||||
|
|
||||||
def twice_daily_reminder():
|
def twice_daily_reminder():
|
||||||
fields = ["first_email", "second_email"]
|
fields = ["first_email", "second_email"]
|
||||||
projects = get_projects_for_collect_progress("Twice Daily", fields)
|
projects = get_projects_for_collect_progress("Twice Daily", fields)
|
||||||
|
fields.remove("name")
|
||||||
|
|
||||||
for project in projects:
|
for project in projects:
|
||||||
for d in fields:
|
for d in fields:
|
||||||
if not check_project_update_exists(project.name, project.get(d)):
|
if allow_to_make_project_update(project.name, project.get(d), "Twicely"):
|
||||||
send_project_update_email_to_users(project.name)
|
send_project_update_email_to_users(project.name)
|
||||||
|
|
||||||
def weekly_reminder():
|
def weekly_reminder():
|
||||||
@ -502,14 +507,19 @@ def weekly_reminder():
|
|||||||
if current_day != project.day_to_send:
|
if current_day != project.day_to_send:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not check_project_update_exists(project.name, project.get("weekly_time_to_send")):
|
if allow_to_make_project_update(project.name, project.get("weekly_time_to_send"), "Weekly"):
|
||||||
send_project_update_email_to_users(project.name)
|
send_project_update_email_to_users(project.name)
|
||||||
|
|
||||||
def check_project_update_exists(project, time):
|
def allow_to_make_project_update(project, time, frequency):
|
||||||
data = frappe.db.sql(""" SELECT name from `tabProject Update`
|
data = frappe.db.sql(""" SELECT name from `tabProject Update`
|
||||||
WHERE project = %s and date = %s and time >= %s """, (project, today(), time))
|
WHERE project = %s and date = %s """, (project, today()))
|
||||||
|
|
||||||
return True if data and data[0][0] else False
|
# len(data) > 1 condition is checked for twicely frequency
|
||||||
|
if data and (frequency in ['Daily', 'Weekly'] or len(data) > 1):
|
||||||
|
return False
|
||||||
|
|
||||||
|
if get_time(nowtime()) >= get_time(time):
|
||||||
|
return True
|
||||||
|
|
||||||
def get_projects_for_collect_progress(frequency, fields):
|
def get_projects_for_collect_progress(frequency, fields):
|
||||||
fields.extend(["name"])
|
fields.extend(["name"])
|
||||||
|
@ -3,7 +3,7 @@ frappe.listview_settings['Project'] = {
|
|||||||
filters:[["status","=", "Open"]],
|
filters:[["status","=", "Open"]],
|
||||||
get_indicator: function(doc) {
|
get_indicator: function(doc) {
|
||||||
if(doc.status=="Open" && doc.percent_complete) {
|
if(doc.status=="Open" && doc.percent_complete) {
|
||||||
return [__("{0}% Complete", [cint(doc.percent_complete)]), "orange", "percent_complete,>,0|status,=,Open"];
|
return [__("{0}%", [cint(doc.percent_complete)]), "orange", "percent_complete,>,0|status,=,Open"];
|
||||||
} else {
|
} else {
|
||||||
return [__(doc.status), frappe.utils.guess_colour(doc.status), "status,=," + doc.status];
|
return [__(doc.status), frappe.utils.guess_colour(doc.status), "status,=," + doc.status];
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "depends_on_tasks",
|
"fieldname": "depends_on_tasks",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Code",
|
||||||
"hidden": 1,
|
"hidden": 1,
|
||||||
"label": "Depends on Tasks",
|
"label": "Depends on Tasks",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
@ -351,7 +351,7 @@
|
|||||||
"icon": "fa fa-check",
|
"icon": "fa fa-check",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"max_attachments": 5,
|
"max_attachments": 5,
|
||||||
"modified": "2019-04-29 14:48:10.204819",
|
"modified": "2019-05-01 13:30:29.458916",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Projects",
|
"module": "Projects",
|
||||||
"name": "Task",
|
"name": "Task",
|
||||||
|
@ -48,7 +48,7 @@ class Task(NestedSet):
|
|||||||
if self.status!=self.get_db_value("status") and self.status == "Completed":
|
if self.status!=self.get_db_value("status") and self.status == "Completed":
|
||||||
for d in self.depends_on:
|
for d in self.depends_on:
|
||||||
if frappe.db.get_value("Task", d.task, "status") != "Completed":
|
if frappe.db.get_value("Task", d.task, "status") != "Completed":
|
||||||
frappe.throw(_("Cannot close task as its dependant task {0} is not closed.").format(d.task))
|
frappe.throw(_("Cannot close task {0} as its dependant task {1} is not closed.").format(frappe.bold(self.name), frappe.bold(d.task)))
|
||||||
|
|
||||||
from frappe.desk.form.assign_to import clear
|
from frappe.desk.form.assign_to import clear
|
||||||
clear(self.doctype, self.name)
|
clear(self.doctype, self.name)
|
||||||
@ -105,7 +105,7 @@ class Task(NestedSet):
|
|||||||
|
|
||||||
def update_project(self):
|
def update_project(self):
|
||||||
if self.project and not self.flags.from_project:
|
if self.project and not self.flags.from_project:
|
||||||
frappe.get_doc("Project", self.project).update_project()
|
frappe.get_cached_doc("Project", self.project).update_project()
|
||||||
|
|
||||||
def check_recursion(self):
|
def check_recursion(self):
|
||||||
if self.flags.ignore_recursion_check: return
|
if self.flags.ignore_recursion_check: return
|
||||||
@ -150,7 +150,7 @@ class Task(NestedSet):
|
|||||||
|
|
||||||
def populate_depends_on(self):
|
def populate_depends_on(self):
|
||||||
if self.parent_task:
|
if self.parent_task:
|
||||||
parent = frappe.get_doc('Task', self.parent_task)
|
parent = frappe.get_cached_doc('Task', self.parent_task)
|
||||||
if not self.name in [row.task for row in parent.depends_on]:
|
if not self.name in [row.task for row in parent.depends_on]:
|
||||||
parent.append("depends_on", {
|
parent.append("depends_on", {
|
||||||
"doctype": "Task Depends On",
|
"doctype": "Task Depends On",
|
||||||
@ -163,6 +163,13 @@ class Task(NestedSet):
|
|||||||
if check_if_child_exists(self.name):
|
if check_if_child_exists(self.name):
|
||||||
throw(_("Child Task exists for this Task. You can not delete this Task."))
|
throw(_("Child Task exists for this Task. You can not delete this Task."))
|
||||||
|
|
||||||
|
if self.project:
|
||||||
|
tasks = frappe.get_doc('Project', self.project).tasks
|
||||||
|
for task in tasks:
|
||||||
|
if task.get('task_id') == self.name:
|
||||||
|
frappe.delete_doc('Project Task', task.name)
|
||||||
|
|
||||||
|
|
||||||
self.update_nsm_model()
|
self.update_nsm_model()
|
||||||
|
|
||||||
def update_status(self):
|
def update_status(self):
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.utils import time_diff_in_hours
|
from frappe.utils import time_diff_in_hours, flt
|
||||||
|
|
||||||
def get_columns():
|
def get_columns():
|
||||||
return [
|
return [
|
||||||
@ -43,7 +43,7 @@ def get_columns():
|
|||||||
"width": 50
|
"width": 50
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": _("Amount"),
|
"label": _("Billing Amount"),
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"fieldname": "amount",
|
"fieldname": "amount",
|
||||||
"width": 100
|
"width": 100
|
||||||
@ -52,69 +52,53 @@ def get_columns():
|
|||||||
|
|
||||||
def get_data(filters):
|
def get_data(filters):
|
||||||
data = []
|
data = []
|
||||||
record = get_records(filters)
|
if(filters.from_date > filters.to_date):
|
||||||
|
frappe.msgprint(_(" From Date can not be greater than To Date"))
|
||||||
billable_hours_worked = 0
|
|
||||||
hours_worked = 0
|
|
||||||
working_cost = 0
|
|
||||||
for entries in record:
|
|
||||||
total_hours = 0
|
|
||||||
total_billable_hours = 0
|
|
||||||
total_amount = 0
|
|
||||||
entries_exists = False
|
|
||||||
timesheet_details = get_timesheet_details(filters, entries.name)
|
|
||||||
for activity in timesheet_details:
|
|
||||||
entries_exists = True
|
|
||||||
time_start = activity.from_time
|
|
||||||
time_end = frappe.utils.add_to_date(activity.from_time, hours=activity.hours)
|
|
||||||
from_date = frappe.utils.get_datetime(filters.from_date)
|
|
||||||
to_date = frappe.utils.get_datetime(filters.to_date)
|
|
||||||
|
|
||||||
if time_start <= from_date and time_end >= from_date:
|
|
||||||
total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity,
|
|
||||||
time_end, from_date, total_hours, total_billable_hours, total_amount)
|
|
||||||
|
|
||||||
billable_hours_worked += total_billable_hours
|
|
||||||
hours_worked += total_hours
|
|
||||||
working_cost += total_amount
|
|
||||||
elif time_start >= from_date and time_end >= to_date:
|
|
||||||
total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity,
|
|
||||||
to_date, time_start, total_hours, total_billable_hours, total_amount)
|
|
||||||
|
|
||||||
billable_hours_worked += total_billable_hours
|
|
||||||
hours_worked += total_hours
|
|
||||||
working_cost += total_amount
|
|
||||||
elif time_start >= from_date and time_end <= to_date:
|
|
||||||
total_hours, total_billable_hours, total_amount = get_billable_and_total_hours(activity,
|
|
||||||
time_end, time_start, total_hours, total_billable_hours, total_amount)
|
|
||||||
|
|
||||||
billable_hours_worked += total_billable_hours
|
|
||||||
hours_worked += total_hours
|
|
||||||
working_cost += total_amount
|
|
||||||
|
|
||||||
row = {
|
|
||||||
"employee": entries.employee,
|
|
||||||
"employee_name": entries.employee_name,
|
|
||||||
"timesheet": entries.name,
|
|
||||||
"total_billable_hours": total_billable_hours,
|
|
||||||
"total_hours": total_hours,
|
|
||||||
"amount": total_amount
|
|
||||||
}
|
|
||||||
|
|
||||||
if entries_exists:
|
|
||||||
data.append(row)
|
|
||||||
entries_exists = False
|
|
||||||
|
|
||||||
total = {
|
|
||||||
"total_billable_hours": billable_hours_worked,
|
|
||||||
"total_hours": hours_worked,
|
|
||||||
"amount": working_cost
|
|
||||||
}
|
|
||||||
if billable_hours_worked !=0 or hours_worked !=0 or working_cost !=0:
|
|
||||||
data.append(total)
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def get_records(filters):
|
timesheets = get_timesheets(filters)
|
||||||
|
|
||||||
|
filters.from_date = frappe.utils.get_datetime(filters.from_date)
|
||||||
|
filters.to_date = frappe.utils.add_to_date(frappe.utils.get_datetime(filters.to_date), days=1, seconds=-1)
|
||||||
|
|
||||||
|
timesheet_details = get_timesheet_details(filters, timesheets.keys())
|
||||||
|
|
||||||
|
for ts, ts_details in timesheet_details.items():
|
||||||
|
total_hours = 0
|
||||||
|
total_billing_hours = 0
|
||||||
|
total_amount = 0
|
||||||
|
|
||||||
|
for row in ts_details:
|
||||||
|
from_time, to_time = filters.from_date, filters.to_date
|
||||||
|
|
||||||
|
if row.to_time < from_time or row.from_time > to_time:
|
||||||
|
continue
|
||||||
|
|
||||||
|
if row.from_time > from_time:
|
||||||
|
from_time = row.from_time
|
||||||
|
|
||||||
|
if row.to_time < to_time:
|
||||||
|
to_time = row.to_time
|
||||||
|
|
||||||
|
activity_duration, billing_duration = get_billable_and_total_duration(row, from_time, to_time)
|
||||||
|
|
||||||
|
total_hours += activity_duration
|
||||||
|
total_billing_hours += billing_duration
|
||||||
|
total_amount += billing_duration * flt(row.billing_rate)
|
||||||
|
|
||||||
|
if total_hours:
|
||||||
|
data.append({
|
||||||
|
"employee": timesheets.get(ts).employee,
|
||||||
|
"employee_name": timesheets.get(ts).employee_name,
|
||||||
|
"timesheet": ts,
|
||||||
|
"total_billable_hours": total_billing_hours,
|
||||||
|
"total_hours": total_hours,
|
||||||
|
"amount": total_amount
|
||||||
|
})
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
def get_timesheets(filters):
|
||||||
record_filters = [
|
record_filters = [
|
||||||
["start_date", "<=", filters.to_date],
|
["start_date", "<=", filters.to_date],
|
||||||
["end_date", ">=", filters.from_date],
|
["end_date", ">=", filters.from_date],
|
||||||
@ -124,23 +108,39 @@ def get_records(filters):
|
|||||||
if "employee" in filters:
|
if "employee" in filters:
|
||||||
record_filters.append(["employee", "=", filters.employee])
|
record_filters.append(["employee", "=", filters.employee])
|
||||||
|
|
||||||
return frappe.get_all("Timesheet", filters=record_filters, fields=[" * "] )
|
timesheets = frappe.get_all("Timesheet", filters=record_filters, fields=["employee", "employee_name", "name"])
|
||||||
|
timesheet_map = frappe._dict()
|
||||||
|
for d in timesheets:
|
||||||
|
timesheet_map.setdefault(d.name, d)
|
||||||
|
|
||||||
def get_billable_and_total_hours(activity, end, start, total_hours, total_billable_hours, total_amount):
|
return timesheet_map
|
||||||
total_hours += abs(time_diff_in_hours(end, start))
|
|
||||||
if activity.billable:
|
|
||||||
total_billable_hours += abs(time_diff_in_hours(end, start))
|
|
||||||
total_amount += total_billable_hours * activity.billing_rate
|
|
||||||
return total_hours, total_billable_hours, total_amount
|
|
||||||
|
|
||||||
def get_timesheet_details(filters, parent):
|
def get_timesheet_details(filters, timesheet_list):
|
||||||
timesheet_details_filter = {"parent": parent}
|
timesheet_details_filter = {
|
||||||
|
"parent": ["in", timesheet_list]
|
||||||
|
}
|
||||||
|
|
||||||
if "project" in filters:
|
if "project" in filters:
|
||||||
timesheet_details_filter["project"] = filters.project
|
timesheet_details_filter["project"] = filters.project
|
||||||
|
|
||||||
return frappe.get_all(
|
timesheet_details = frappe.get_all(
|
||||||
"Timesheet Detail",
|
"Timesheet Detail",
|
||||||
filters = timesheet_details_filter,
|
filters = timesheet_details_filter,
|
||||||
fields=["*"]
|
fields=["from_time", "to_time", "hours", "billable", "billing_hours", "billing_rate", "parent"]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
timesheet_details_map = frappe._dict()
|
||||||
|
for d in timesheet_details:
|
||||||
|
timesheet_details_map.setdefault(d.parent, []).append(d)
|
||||||
|
|
||||||
|
return timesheet_details_map
|
||||||
|
|
||||||
|
def get_billable_and_total_duration(activity, start_time, end_time):
|
||||||
|
activity_duration = time_diff_in_hours(end_time, start_time)
|
||||||
|
billing_duration = 0.0
|
||||||
|
if activity.billable:
|
||||||
|
billing_duration = activity.billing_hours
|
||||||
|
if activity_duration != activity.billing_hours:
|
||||||
|
billing_duration = activity_duration * activity.billing_hours / activity.hours
|
||||||
|
|
||||||
|
return flt(activity_duration, 2), flt(billing_duration, 2)
|
@ -147,6 +147,8 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
discount_amount: function(doc, cdt, cdn) {
|
discount_amount: function(doc, cdt, cdn) {
|
||||||
|
var item = frappe.get_doc(cdt, cdn);
|
||||||
|
item.discount_percentage = 0.0;
|
||||||
this.price_list_rate(doc, cdt, cdn);
|
this.price_list_rate(doc, cdt, cdn);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
} else {
|
} else {
|
||||||
item.discount_percentage = flt((1 - item.rate / item.price_list_rate) * 100.0,
|
item.discount_percentage = flt((1 - item.rate / item.price_list_rate) * 100.0,
|
||||||
precision("discount_percentage", item));
|
precision("discount_percentage", item));
|
||||||
|
item.discount_amount = flt(item.price_list_rate) - flt(item.rate);
|
||||||
item.margin_type = '';
|
item.margin_type = '';
|
||||||
item.margin_rate_or_amount = 0;
|
item.margin_rate_or_amount = 0;
|
||||||
item.rate_with_margin = 0;
|
item.rate_with_margin = 0;
|
||||||
|
@ -8,12 +8,7 @@
|
|||||||
<div class='card-body'>
|
<div class='card-body'>
|
||||||
<h5 class="card-title">{{ course.course_name }}</h5>
|
<h5 class="card-title">{{ course.course_name }}</h5>
|
||||||
<span class="course-list text-muted" id="getting-started">
|
<span class="course-list text-muted" id="getting-started">
|
||||||
Topics
|
{{ course.course_intro }}
|
||||||
<ul class="mb-0 mt-1" style="padding-left: 1.5em;">
|
|
||||||
<li v-for="topic in course.topics" :key="topic.name">
|
|
||||||
<div>{{ topic.topic_name }}</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class='p-3' style="display: flex; justify-content: space-between;">
|
<div class='p-3' style="display: flex; justify-content: space-between;">
|
||||||
|
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