field renaming
This commit is contained in:
parent
4b8185db19
commit
79f091e2fe
@ -24,7 +24,7 @@ frappe.ui.form.on("Payment Tool", "onload", function(frm) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
frm.set_query("against_voucher_type", "against_vouchers", function() {
|
frm.set_query("against_voucher_type", "vouchers", function() {
|
||||||
return {
|
return {
|
||||||
filters: {"name": ["in", ["Sales Invoice", "Purchase Invoice", "Journal Entry", "Sales Order", "Purchase Order"]]}
|
filters: {"name": ["in", ["Sales Invoice", "Purchase Invoice", "Journal Entry", "Sales Order", "Purchase Order"]]}
|
||||||
};
|
};
|
||||||
@ -75,7 +75,7 @@ erpnext.payment_tool.check_mandatory_to_set_button = function(frm) {
|
|||||||
frappe.ui.form.on("Payment Tool", "get_outstanding_vouchers", function(frm) {
|
frappe.ui.form.on("Payment Tool", "get_outstanding_vouchers", function(frm) {
|
||||||
erpnext.payment_tool.check_mandatory_to_fetch(frm.doc);
|
erpnext.payment_tool.check_mandatory_to_fetch(frm.doc);
|
||||||
|
|
||||||
frm.set_value("against_vouchers", []);
|
frm.set_value("vouchers", []);
|
||||||
|
|
||||||
return frappe.call({
|
return frappe.call({
|
||||||
method: 'erpnext.accounts.doctype.payment_tool.payment_tool.get_outstanding_vouchers',
|
method: 'erpnext.accounts.doctype.payment_tool.payment_tool.get_outstanding_vouchers',
|
||||||
@ -93,16 +93,16 @@ frappe.ui.form.on("Payment Tool", "get_outstanding_vouchers", function(frm) {
|
|||||||
frm.fields_dict.get_outstanding_vouchers.$input.removeClass("btn-primary");
|
frm.fields_dict.get_outstanding_vouchers.$input.removeClass("btn-primary");
|
||||||
frm.fields_dict.make_journal_entry.$input.addClass("btn-primary");
|
frm.fields_dict.make_journal_entry.$input.addClass("btn-primary");
|
||||||
|
|
||||||
frappe.model.clear_table(frm.doc, "against_vouchers");
|
frappe.model.clear_table(frm.doc, "vouchers");
|
||||||
$.each(r.message, function(i, d) {
|
$.each(r.message, function(i, d) {
|
||||||
var invoice_detail = frappe.model.add_child(frm.doc, "Payment Tool Detail", "against_vouchers");
|
var invoice_detail = frappe.model.add_child(frm.doc, "Payment Tool Detail", "vouchers");
|
||||||
invoice_detail.against_voucher_type = d.voucher_type;
|
invoice_detail.against_voucher_type = d.voucher_type;
|
||||||
invoice_detail.against_voucher_no = d.voucher_no;
|
invoice_detail.against_voucher_no = d.voucher_no;
|
||||||
invoice_detail.total_amount = d.invoice_amount;
|
invoice_detail.total_amount = d.invoice_amount;
|
||||||
invoice_detail.outstanding_amount = d.outstanding_amount;
|
invoice_detail.outstanding_amount = d.outstanding_amount;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
refresh_field("against_vouchers");
|
refresh_field("vouchers");
|
||||||
erpnext.payment_tool.set_total_payment_amount(frm);
|
erpnext.payment_tool.set_total_payment_amount(frm);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -114,7 +114,7 @@ frappe.ui.form.on("Payment Tool Detail", "against_voucher_type", function(frm) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
erpnext.payment_tool.validate_against_voucher = function(frm) {
|
erpnext.payment_tool.validate_against_voucher = function(frm) {
|
||||||
$.each(frm.doc.against_vouchers || [], function(i, row) {
|
$.each(frm.doc.vouchers || [], function(i, row) {
|
||||||
if(frm.doc.party_type=="Customer"
|
if(frm.doc.party_type=="Customer"
|
||||||
&& !in_list(["Sales Order", "Sales Invoice", "Journal Entry"], row.against_voucher_type)) {
|
&& !in_list(["Sales Order", "Sales Invoice", "Journal Entry"], row.against_voucher_type)) {
|
||||||
frappe.model.set_value(row.doctype, row.name, "against_voucher_type", "");
|
frappe.model.set_value(row.doctype, row.name, "against_voucher_type", "");
|
||||||
@ -154,13 +154,13 @@ frappe.ui.form.on("Payment Tool Detail", "payment_amount", function(frm) {
|
|||||||
erpnext.payment_tool.set_total_payment_amount(frm);
|
erpnext.payment_tool.set_total_payment_amount(frm);
|
||||||
});
|
});
|
||||||
|
|
||||||
frappe.ui.form.on("Payment Tool Detail", "against_vouchers_remove", function(frm) {
|
frappe.ui.form.on("Payment Tool Detail", "vouchers_remove", function(frm) {
|
||||||
erpnext.payment_tool.set_total_payment_amount(frm);
|
erpnext.payment_tool.set_total_payment_amount(frm);
|
||||||
});
|
});
|
||||||
|
|
||||||
erpnext.payment_tool.set_total_payment_amount = function(frm) {
|
erpnext.payment_tool.set_total_payment_amount = function(frm) {
|
||||||
var total_amount = 0.00;
|
var total_amount = 0.00;
|
||||||
$.each(frm.doc.against_vouchers || [], function(i, row) {
|
$.each(frm.doc.vouchers || [], function(i, row) {
|
||||||
if (row.payment_amount && (row.payment_amount <= row.outstanding_amount)) {
|
if (row.payment_amount && (row.payment_amount <= row.outstanding_amount)) {
|
||||||
total_amount = total_amount + row.payment_amount;
|
total_amount = total_amount + row.payment_amount;
|
||||||
} else {
|
} else {
|
||||||
|
@ -222,7 +222,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"fieldname": "against_vouchers",
|
"fieldname": "vouchers",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"ignore_user_permissions": 0,
|
"ignore_user_permissions": 0,
|
||||||
@ -310,7 +310,7 @@
|
|||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"modified": "2014-12-25 16:28:30.612640",
|
"modified": "2014-12-26 16:28:30.612640",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Tool",
|
"name": "Payment Tool",
|
||||||
|
@ -29,7 +29,7 @@ class PaymentTool(Document):
|
|||||||
if not self.total_payment_amount:
|
if not self.total_payment_amount:
|
||||||
frappe.throw(_("Please enter Payment Amount in atleast one row"))
|
frappe.throw(_("Please enter Payment Amount in atleast one row"))
|
||||||
|
|
||||||
for v in self.get("against_vouchers"):
|
for v in self.get("vouchers"):
|
||||||
if not frappe.db.get_value(v.against_voucher_type, {"name": v.against_voucher_no}):
|
if not frappe.db.get_value(v.against_voucher_type, {"name": v.against_voucher_no}):
|
||||||
frappe.throw(_("Row {0}: {1} is not a valid {2}").format(v.idx, v.against_voucher_no,
|
frappe.throw(_("Row {0}: {1} is not a valid {2}").format(v.idx, v.against_voucher_no,
|
||||||
v.against_voucher_type))
|
v.against_voucher_type))
|
||||||
|
@ -154,7 +154,7 @@ class TestPaymentTool(unittest.TestCase):
|
|||||||
|
|
||||||
def check_jv_entries(self, paytool, outstanding_entries, expected_outstanding):
|
def check_jv_entries(self, paytool, outstanding_entries, expected_outstanding):
|
||||||
for e in outstanding_entries:
|
for e in outstanding_entries:
|
||||||
d1 = paytool.append("against_vouchers")
|
d1 = paytool.append("vouchers")
|
||||||
d1.against_voucher_type = e.get("voucher_type")
|
d1.against_voucher_type = e.get("voucher_type")
|
||||||
d1.against_voucher_no = e.get("voucher_no")
|
d1.against_voucher_no = e.get("voucher_no")
|
||||||
d1.total_amount = e.get("invoice_amount")
|
d1.total_amount = e.get("invoice_amount")
|
||||||
|
@ -539,9 +539,9 @@
|
|||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "educational_qualifications",
|
"fieldname": "education",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"label": "Educational Qualifications",
|
"label": "Education",
|
||||||
"options": "Employee Education",
|
"options": "Employee Education",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
@ -553,9 +553,9 @@
|
|||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "external_work_experiences",
|
"fieldname": "external_work_history",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"label": "External Work Experiences",
|
"label": "External Work History",
|
||||||
"options": "Employee External Work History",
|
"options": "Employee External Work History",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
@ -567,9 +567,9 @@
|
|||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "internal_work_experiences",
|
"fieldname": "internal_work_history",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"label": "Internal Work Experiences",
|
"label": "Internal Work History",
|
||||||
"options": "Employee Internal Work History",
|
"options": "Employee Internal Work History",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
@ -673,7 +673,7 @@
|
|||||||
],
|
],
|
||||||
"icon": "icon-user",
|
"icon": "icon-user",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"modified": "2014-12-24 15:28:06.576523",
|
"modified": "2014-12-26 11:12:57.631617",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Employee",
|
"name": "Employee",
|
||||||
|
@ -100,9 +100,9 @@ rename_map = {
|
|||||||
],
|
],
|
||||||
"Employee": [
|
"Employee": [
|
||||||
["employee_leave_approvers", "leave_approvers"],
|
["employee_leave_approvers", "leave_approvers"],
|
||||||
# ["educational_qualification_details", "educational_qualifications"],
|
["educational_qualification_details", "education"],
|
||||||
# ["previous_experience_details", "external_work_experiences"], work_history
|
["previous_experience_details", "external_work_history"],
|
||||||
# ["experience_in_company_details", "internal_work_experiences"], internal_work_history
|
["experience_in_company_details", "internal_work_history"]
|
||||||
],
|
],
|
||||||
"Event": [
|
"Event": [
|
||||||
["event_individuals", "users"],
|
["event_individuals", "users"],
|
||||||
@ -124,8 +124,8 @@ rename_map = {
|
|||||||
["item_variants", "variants"],
|
["item_variants", "variants"],
|
||||||
["item_reorder", "reorder_levels"],
|
["item_reorder", "reorder_levels"],
|
||||||
["uom_conversion_details", "uoms"],
|
["uom_conversion_details", "uoms"],
|
||||||
# ["item_supplier_details", "supplier_item_codes"],
|
["item_supplier_details", "supplier_items"],
|
||||||
# ["item_customer_details", "customer_item_codes"],
|
["item_customer_details", "customer_items"],
|
||||||
["item_tax", "taxes"],
|
["item_tax", "taxes"],
|
||||||
["item_specification_details", "quality_parameters"],
|
["item_specification_details", "quality_parameters"],
|
||||||
["item_website_specifications", "website_specifications"]
|
["item_website_specifications", "website_specifications"]
|
||||||
@ -161,7 +161,7 @@ rename_map = {
|
|||||||
["party_accounts", "accounts"]
|
["party_accounts", "accounts"]
|
||||||
],
|
],
|
||||||
"Payment Tool": [
|
"Payment Tool": [
|
||||||
# ["payment_tool_details", "against_vouchers"]
|
["payment_tool_details", "vouchers"]
|
||||||
],
|
],
|
||||||
"Production Planning Tool": [
|
"Production Planning Tool": [
|
||||||
["pp_so_details", "sales_orders"],
|
["pp_so_details", "sales_orders"],
|
||||||
@ -185,7 +185,7 @@ rename_map = {
|
|||||||
["sales_bom_items", "items"]
|
["sales_bom_items", "items"]
|
||||||
],
|
],
|
||||||
"SMS Settings": [
|
"SMS Settings": [
|
||||||
# ["static_parameter_details", "static_parameters"]
|
["static_parameter_details", "parameters"]
|
||||||
],
|
],
|
||||||
"Stock Entry": [
|
"Stock Entry": [
|
||||||
["mtn_details", "items"]
|
["mtn_details", "items"]
|
||||||
@ -203,7 +203,7 @@ rename_map = {
|
|||||||
["time_log_batch_details", "time_logs"]
|
["time_log_batch_details", "time_logs"]
|
||||||
],
|
],
|
||||||
"Workflow": [
|
"Workflow": [
|
||||||
# ["workflow_document_states", "document_states"],
|
["workflow_document_states", "states"],
|
||||||
["workflow_transitions", "transitions"]
|
["workflow_transitions", "transitions"]
|
||||||
],
|
],
|
||||||
"Workstation": [
|
"Workstation": [
|
||||||
|
@ -142,14 +142,14 @@ pscript.feature_dict = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
'fs_item_advanced': {
|
'fs_item_advanced': {
|
||||||
'Item': {'fields':['customer_item_codes']}
|
'Item': {'fields':['customer_items']}
|
||||||
},
|
},
|
||||||
'fs_sales_extras': {
|
'fs_sales_extras': {
|
||||||
'Address': {'fields':['sales_partner']},
|
'Address': {'fields':['sales_partner']},
|
||||||
'Contact': {'fields':['sales_partner']},
|
'Contact': {'fields':['sales_partner']},
|
||||||
'Customer': {'fields':['sales_team']},
|
'Customer': {'fields':['sales_team']},
|
||||||
'Delivery Note': {'fields':['sales_team']},
|
'Delivery Note': {'fields':['sales_team']},
|
||||||
'Item': {'fields':['customer_item_codes']},
|
'Item': {'fields':['customer_items']},
|
||||||
'Sales Invoice': {'fields':['sales_team']},
|
'Sales Invoice': {'fields':['sales_team']},
|
||||||
'Sales Order': {'fields':['sales_team']}
|
'Sales Order': {'fields':['sales_team']}
|
||||||
},
|
},
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "Enter static url parameters here (Eg. sender=ERPNext, username=ERPNext, password=1234 etc.)",
|
"description": "Enter static url parameters here (Eg. sender=ERPNext, username=ERPNext, password=1234 etc.)",
|
||||||
"fieldname": "static_parameters",
|
"fieldname": "parameters",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"label": "Static Parameters",
|
"label": "Static Parameters",
|
||||||
"options": "SMS Parameter",
|
"options": "SMS Parameter",
|
||||||
@ -58,7 +58,7 @@
|
|||||||
"idx": 1,
|
"idx": 1,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"modified": "2014-12-24 16:42:57.956544",
|
"modified": "2014-12-26 16:42:57.956544",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "SMS Settings",
|
"name": "SMS Settings",
|
||||||
|
@ -71,7 +71,7 @@ def send_sms(receiver_list, msg, sender_name = ''):
|
|||||||
def send_via_gateway(arg):
|
def send_via_gateway(arg):
|
||||||
ss = frappe.get_doc('SMS Settings', 'SMS Settings')
|
ss = frappe.get_doc('SMS Settings', 'SMS Settings')
|
||||||
args = {ss.message_parameter : arg.get('message')}
|
args = {ss.message_parameter : arg.get('message')}
|
||||||
for d in ss.get("static_parameters"):
|
for d in ss.get("parameters"):
|
||||||
args[d.parameter] = d.value
|
args[d.parameter] = d.value
|
||||||
|
|
||||||
resp = []
|
resp = []
|
||||||
|
@ -178,11 +178,11 @@ cur_frm.cscript.validate = function(doc, cdt, cdn){
|
|||||||
cur_frm.cscript.weight_to_validate(doc, cdt, cdn);
|
cur_frm.cscript.weight_to_validate(doc, cdt, cdn);
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.fields_dict.customer_item_codes.grid.get_field("customer_name").get_query = function(doc, cdt, cdn) {
|
cur_frm.fields_dict.customer_items.grid.get_field("customer_name").get_query = function(doc, cdt, cdn) {
|
||||||
return { query: "erpnext.controllers.queries.customer_query" }
|
return { query: "erpnext.controllers.queries.customer_query" }
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.fields_dict.supplier_item_codes.grid.get_field("supplier").get_query = function(doc, cdt, cdn) {
|
cur_frm.fields_dict.supplier_items.grid.get_field("supplier").get_query = function(doc, cdt, cdn) {
|
||||||
return { query: "erpnext.controllers.queries.supplier_query" }
|
return { query: "erpnext.controllers.queries.supplier_query" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -528,9 +528,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"depends_on": "eval:doc.is_purchase_item==\"Yes\"",
|
"depends_on": "eval:doc.is_purchase_item==\"Yes\"",
|
||||||
"fieldname": "suppliers",
|
"fieldname": "supplier_items",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"label": "Suppliers",
|
"label": "Supplier Items",
|
||||||
"options": "Item Supplier",
|
"options": "Item Supplier",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read_only": 0
|
"read_only": 0
|
||||||
@ -615,9 +615,9 @@
|
|||||||
{
|
{
|
||||||
"depends_on": "eval:doc.is_sales_item==\"Yes\"",
|
"depends_on": "eval:doc.is_sales_item==\"Yes\"",
|
||||||
"description": "For the convenience of customers, these codes can be used in print formats like Invoices and Delivery Notes",
|
"description": "For the convenience of customers, these codes can be used in print formats like Invoices and Delivery Notes",
|
||||||
"fieldname": "customer_codes",
|
"fieldname": "customer_items",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"label": "Customer Codes",
|
"label": "Customer Items",
|
||||||
"options": "Item Customer Detail",
|
"options": "Item Customer Detail",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read_only": 0
|
"read_only": 0
|
||||||
@ -876,7 +876,7 @@
|
|||||||
"icon": "icon-tag",
|
"icon": "icon-tag",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"max_attachments": 1,
|
"max_attachments": 1,
|
||||||
"modified": "2014-12-24 15:44:02.266086",
|
"modified": "2014-12-26 11:17:46.327235",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Item",
|
"name": "Item",
|
||||||
|
@ -302,7 +302,7 @@ class Item(WebsiteGenerator):
|
|||||||
def fill_customer_code(self):
|
def fill_customer_code(self):
|
||||||
""" Append all the customer codes and insert into "customer_code" field of item table """
|
""" Append all the customer codes and insert into "customer_code" field of item table """
|
||||||
cust_code=[]
|
cust_code=[]
|
||||||
for d in self.get('customer_item_codes'):
|
for d in self.get('customer_items'):
|
||||||
cust_code.append(d.ref_code)
|
cust_code.append(d.ref_code)
|
||||||
self.customer_code=','.join(cust_code)
|
self.customer_code=','.join(cust_code)
|
||||||
|
|
||||||
|
@ -251,10 +251,10 @@ def validate_conversion_rate(args, meta):
|
|||||||
|
|
||||||
def get_party_item_code(args, item_doc, out):
|
def get_party_item_code(args, item_doc, out):
|
||||||
if args.transaction_type == "selling":
|
if args.transaction_type == "selling":
|
||||||
customer_item_code = item_doc.get("customer_item_codes", {"customer_name": args.customer})
|
customer_item_code = item_doc.get("customer_items", {"customer_name": args.customer})
|
||||||
out.customer_item_code = customer_item_code[0].ref_code if customer_item_code else None
|
out.customer_item_code = customer_item_code[0].ref_code if customer_item_code else None
|
||||||
else:
|
else:
|
||||||
item_supplier = item_doc.get("supplier_item_codes", {"supplier": args.supplier})
|
item_supplier = item_doc.get("supplier_items", {"supplier": args.supplier})
|
||||||
out.supplier_part_no = item_supplier[0].supplier_part_no if item_supplier else None
|
out.supplier_part_no = item_supplier[0].supplier_part_no if item_supplier else None
|
||||||
|
|
||||||
def get_pos_settings_item_details(company, args, pos_settings=None):
|
def get_pos_settings_item_details(company, args, pos_settings=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user