mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 13:49:13 +00:00
feat: add Company Contact Person in selling transactions (#44362)
This commit is contained in:
@@ -48,6 +48,7 @@
|
|||||||
"shipping_address",
|
"shipping_address",
|
||||||
"company_address",
|
"company_address",
|
||||||
"company_address_display",
|
"company_address_display",
|
||||||
|
"company_contact_person",
|
||||||
"currency_and_price_list",
|
"currency_and_price_list",
|
||||||
"currency",
|
"currency",
|
||||||
"conversion_rate",
|
"conversion_rate",
|
||||||
@@ -1549,10 +1550,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "utm_medium",
|
"fieldname": "utm_medium",
|
||||||
"print_hide": 1,
|
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Medium",
|
"label": "Medium",
|
||||||
"options": "UTM Medium"
|
"options": "UTM Medium",
|
||||||
|
"print_hide": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "utm_campaign",
|
"fieldname": "utm_campaign",
|
||||||
@@ -1571,12 +1572,19 @@
|
|||||||
"oldfieldtype": "Select",
|
"oldfieldtype": "Select",
|
||||||
"options": "UTM Source",
|
"options": "UTM Source",
|
||||||
"print_hide": 1
|
"print_hide": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "company_contact_person",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Company Contact Person",
|
||||||
|
"options": "Contact",
|
||||||
|
"print_hide": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-file-text",
|
"icon": "fa fa-file-text",
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-06-28 10:55:34.941200",
|
"modified": "2024-11-26 13:10:50.309570",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "POS Invoice",
|
"name": "POS Invoice",
|
||||||
|
|||||||
@@ -32,12 +32,8 @@ class POSInvoice(SalesInvoice):
|
|||||||
from erpnext.accounts.doctype.payment_schedule.payment_schedule import PaymentSchedule
|
from erpnext.accounts.doctype.payment_schedule.payment_schedule import PaymentSchedule
|
||||||
from erpnext.accounts.doctype.pos_invoice_item.pos_invoice_item import POSInvoiceItem
|
from erpnext.accounts.doctype.pos_invoice_item.pos_invoice_item import POSInvoiceItem
|
||||||
from erpnext.accounts.doctype.pricing_rule_detail.pricing_rule_detail import PricingRuleDetail
|
from erpnext.accounts.doctype.pricing_rule_detail.pricing_rule_detail import PricingRuleDetail
|
||||||
from erpnext.accounts.doctype.sales_invoice_advance.sales_invoice_advance import (
|
from erpnext.accounts.doctype.sales_invoice_advance.sales_invoice_advance import SalesInvoiceAdvance
|
||||||
SalesInvoiceAdvance,
|
from erpnext.accounts.doctype.sales_invoice_payment.sales_invoice_payment import SalesInvoicePayment
|
||||||
)
|
|
||||||
from erpnext.accounts.doctype.sales_invoice_payment.sales_invoice_payment import (
|
|
||||||
SalesInvoicePayment,
|
|
||||||
)
|
|
||||||
from erpnext.accounts.doctype.sales_invoice_timesheet.sales_invoice_timesheet import (
|
from erpnext.accounts.doctype.sales_invoice_timesheet.sales_invoice_timesheet import (
|
||||||
SalesInvoiceTimesheet,
|
SalesInvoiceTimesheet,
|
||||||
)
|
)
|
||||||
@@ -74,6 +70,7 @@ class POSInvoice(SalesInvoice):
|
|||||||
company: DF.Link
|
company: DF.Link
|
||||||
company_address: DF.Link | None
|
company_address: DF.Link | None
|
||||||
company_address_display: DF.TextEditor | None
|
company_address_display: DF.TextEditor | None
|
||||||
|
company_contact_person: DF.Link | None
|
||||||
consolidated_invoice: DF.Link | None
|
consolidated_invoice: DF.Link | None
|
||||||
contact_display: DF.SmallText | None
|
contact_display: DF.SmallText | None
|
||||||
contact_email: DF.Data | None
|
contact_email: DF.Data | None
|
||||||
|
|||||||
@@ -161,8 +161,9 @@
|
|||||||
"dispatch_address",
|
"dispatch_address",
|
||||||
"company_address_section",
|
"company_address_section",
|
||||||
"company_address",
|
"company_address",
|
||||||
"company_addr_col_break",
|
|
||||||
"company_address_display",
|
"company_address_display",
|
||||||
|
"company_addr_col_break",
|
||||||
|
"company_contact_person",
|
||||||
"terms_tab",
|
"terms_tab",
|
||||||
"payment_schedule_section",
|
"payment_schedule_section",
|
||||||
"ignore_default_payment_terms_template",
|
"ignore_default_payment_terms_template",
|
||||||
@@ -2203,6 +2204,13 @@
|
|||||||
"oldfieldtype": "Select",
|
"oldfieldtype": "Select",
|
||||||
"options": "UTM Source",
|
"options": "UTM Source",
|
||||||
"print_hide": 1
|
"print_hide": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "company_contact_person",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Company Contact Person",
|
||||||
|
"options": "Contact",
|
||||||
|
"print_hide": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-file-text",
|
"icon": "fa fa-file-text",
|
||||||
@@ -2215,7 +2223,7 @@
|
|||||||
"link_fieldname": "consolidated_invoice"
|
"link_fieldname": "consolidated_invoice"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2024-07-18 15:30:39.428519",
|
"modified": "2024-11-26 12:34:09.110690",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Sales Invoice",
|
"name": "Sales Invoice",
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ class SalesInvoice(SellingController):
|
|||||||
company: DF.Link
|
company: DF.Link
|
||||||
company_address: DF.Link | None
|
company_address: DF.Link | None
|
||||||
company_address_display: DF.TextEditor | None
|
company_address_display: DF.TextEditor | None
|
||||||
|
company_contact_person: DF.Link | None
|
||||||
company_tax_id: DF.Data | None
|
company_tax_id: DF.Data | None
|
||||||
contact_display: DF.SmallText | None
|
contact_display: DF.SmallText | None
|
||||||
contact_email: DF.Data | None
|
contact_email: DF.Data | None
|
||||||
@@ -153,7 +154,6 @@ class SalesInvoice(SellingController):
|
|||||||
party_account_currency: DF.Link | None
|
party_account_currency: DF.Link | None
|
||||||
payment_schedule: DF.Table[PaymentSchedule]
|
payment_schedule: DF.Table[PaymentSchedule]
|
||||||
payment_terms_template: DF.Link | None
|
payment_terms_template: DF.Link | None
|
||||||
payment_url: DF.Data | None
|
|
||||||
payments: DF.Table[SalesInvoicePayment]
|
payments: DF.Table[SalesInvoicePayment]
|
||||||
plc_conversion_rate: DF.Float
|
plc_conversion_rate: DF.Float
|
||||||
po_date: DF.Date | None
|
po_date: DF.Date | None
|
||||||
|
|||||||
@@ -56,6 +56,17 @@ $.extend(erpnext.queries, {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
company_contact_query: function (doc) {
|
||||||
|
if (!doc.company) {
|
||||||
|
frappe.throw(__("Please set {0}", [__(frappe.meta.get_label(doc.doctype, "company", doc.name))]));
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
query: "frappe.contacts.doctype.contact.contact.contact_query",
|
||||||
|
filters: { link_doctype: "Company", link_name: doc.company },
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
address_query: function (doc) {
|
address_query: function (doc) {
|
||||||
if (frappe.dynamic_link) {
|
if (frappe.dynamic_link) {
|
||||||
if (!doc[frappe.dynamic_link.fieldname]) {
|
if (!doc[frappe.dynamic_link.fieldname]) {
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ erpnext.sales_common = {
|
|||||||
);
|
);
|
||||||
|
|
||||||
me.frm.set_query("contact_person", erpnext.queries.contact_query);
|
me.frm.set_query("contact_person", erpnext.queries.contact_query);
|
||||||
|
me.frm.set_query("company_contact_person", erpnext.queries.company_contact_query);
|
||||||
me.frm.set_query("customer_address", erpnext.queries.address_query);
|
me.frm.set_query("customer_address", erpnext.queries.address_query);
|
||||||
me.frm.set_query("shipping_address_name", erpnext.queries.address_query);
|
me.frm.set_query("shipping_address_name", erpnext.queries.address_query);
|
||||||
me.frm.set_query("dispatch_address_name", erpnext.queries.dispatch_address_query);
|
me.frm.set_query("dispatch_address_name", erpnext.queries.dispatch_address_query);
|
||||||
|
|||||||
@@ -96,8 +96,9 @@
|
|||||||
"shipping_address",
|
"shipping_address",
|
||||||
"company_address_section",
|
"company_address_section",
|
||||||
"company_address",
|
"company_address",
|
||||||
"column_break_87",
|
|
||||||
"company_address_display",
|
"company_address_display",
|
||||||
|
"column_break_87",
|
||||||
|
"company_contact_person",
|
||||||
"terms_tab",
|
"terms_tab",
|
||||||
"payment_schedule_section",
|
"payment_schedule_section",
|
||||||
"payment_terms_template",
|
"payment_terms_template",
|
||||||
@@ -1092,13 +1093,20 @@
|
|||||||
"fieldname": "disable_rounded_total",
|
"fieldname": "disable_rounded_total",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Disable Rounded Total"
|
"label": "Disable Rounded Total"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "company_contact_person",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Company Contact Person",
|
||||||
|
"options": "Contact",
|
||||||
|
"print_hide": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-shopping-cart",
|
"icon": "fa fa-shopping-cart",
|
||||||
"idx": 82,
|
"idx": 82,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-11-07 18:37:11.715189",
|
"modified": "2024-11-26 12:43:29.293637",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Quotation",
|
"name": "Quotation",
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ class Quotation(SellingController):
|
|||||||
company: DF.Link
|
company: DF.Link
|
||||||
company_address: DF.Link | None
|
company_address: DF.Link | None
|
||||||
company_address_display: DF.TextEditor | None
|
company_address_display: DF.TextEditor | None
|
||||||
|
company_contact_person: DF.Link | None
|
||||||
competitors: DF.TableMultiSelect[CompetitorDetail]
|
competitors: DF.TableMultiSelect[CompetitorDetail]
|
||||||
contact_display: DF.SmallText | None
|
contact_display: DF.SmallText | None
|
||||||
contact_email: DF.Data | None
|
contact_email: DF.Data | None
|
||||||
|
|||||||
@@ -113,8 +113,9 @@
|
|||||||
"dispatch_address",
|
"dispatch_address",
|
||||||
"col_break46",
|
"col_break46",
|
||||||
"company_address",
|
"company_address",
|
||||||
"column_break_92",
|
|
||||||
"company_address_display",
|
"company_address_display",
|
||||||
|
"column_break_92",
|
||||||
|
"company_contact_person",
|
||||||
"payment_schedule_section",
|
"payment_schedule_section",
|
||||||
"payment_terms_section",
|
"payment_terms_section",
|
||||||
"payment_terms_template",
|
"payment_terms_template",
|
||||||
@@ -1644,16 +1645,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "utm_medium",
|
"fieldname": "utm_medium",
|
||||||
"print_hide": 1,
|
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Medium",
|
"label": "Medium",
|
||||||
"options": "UTM Medium"
|
"options": "UTM Medium",
|
||||||
|
"print_hide": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "utm_content",
|
"fieldname": "utm_content",
|
||||||
"print_hide": 1,
|
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Content"
|
"label": "Content",
|
||||||
|
"print_hide": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "utm_source",
|
"fieldname": "utm_source",
|
||||||
@@ -1676,13 +1677,20 @@
|
|||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "UTM Campaign",
|
"options": "UTM Campaign",
|
||||||
"print_hide": 1
|
"print_hide": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "company_contact_person",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Company Contact Person",
|
||||||
|
"options": "Contact",
|
||||||
|
"print_hide": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-file-text",
|
"icon": "fa fa-file-text",
|
||||||
"idx": 105,
|
"idx": 105,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-06-28 10:36:23.824623",
|
"modified": "2024-11-26 12:42:06.872527",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Sales Order",
|
"name": "Sales Order",
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ class SalesOrder(SellingController):
|
|||||||
company: DF.Link
|
company: DF.Link
|
||||||
company_address: DF.Link | None
|
company_address: DF.Link | None
|
||||||
company_address_display: DF.TextEditor | None
|
company_address_display: DF.TextEditor | None
|
||||||
|
company_contact_person: DF.Link | None
|
||||||
contact_display: DF.SmallText | None
|
contact_display: DF.SmallText | None
|
||||||
contact_email: DF.Data | None
|
contact_email: DF.Data | None
|
||||||
contact_mobile: DF.SmallText | None
|
contact_mobile: DF.SmallText | None
|
||||||
|
|||||||
@@ -108,8 +108,9 @@
|
|||||||
"dispatch_address",
|
"dispatch_address",
|
||||||
"company_address_section",
|
"company_address_section",
|
||||||
"company_address",
|
"company_address",
|
||||||
"column_break_101",
|
|
||||||
"company_address_display",
|
"company_address_display",
|
||||||
|
"column_break_101",
|
||||||
|
"company_contact_person",
|
||||||
"terms_tab",
|
"terms_tab",
|
||||||
"tc_name",
|
"tc_name",
|
||||||
"terms",
|
"terms",
|
||||||
@@ -1394,16 +1395,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "utm_medium",
|
"fieldname": "utm_medium",
|
||||||
"print_hide": 1,
|
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Medium",
|
"label": "Medium",
|
||||||
"options": "UTM Medium"
|
"options": "UTM Medium",
|
||||||
|
"print_hide": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "utm_content",
|
"fieldname": "utm_content",
|
||||||
"print_hide": 1,
|
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Content"
|
"label": "Content",
|
||||||
|
"print_hide": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "utm_source",
|
"fieldname": "utm_source",
|
||||||
@@ -1422,13 +1423,20 @@
|
|||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"options": "UTM Campaign",
|
"options": "UTM Campaign",
|
||||||
"print_hide": 1
|
"print_hide": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "company_contact_person",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Company Contact Person",
|
||||||
|
"options": "Contact",
|
||||||
|
"print_hide": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-truck",
|
"icon": "fa fa-truck",
|
||||||
"idx": 146,
|
"idx": 146,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-05-23 14:18:20.679692",
|
"modified": "2024-11-26 12:44:28.258215",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Delivery Note",
|
"name": "Delivery Note",
|
||||||
|
|||||||
@@ -52,9 +52,10 @@ class DeliveryNote(SellingController):
|
|||||||
company: DF.Link
|
company: DF.Link
|
||||||
company_address: DF.Link | None
|
company_address: DF.Link | None
|
||||||
company_address_display: DF.TextEditor | None
|
company_address_display: DF.TextEditor | None
|
||||||
|
company_contact_person: DF.Link | None
|
||||||
contact_display: DF.SmallText | None
|
contact_display: DF.SmallText | None
|
||||||
contact_email: DF.Data | None
|
contact_email: DF.Data | None
|
||||||
contact_mobile: DF.Data | None
|
contact_mobile: DF.SmallText | None
|
||||||
contact_person: DF.Link | None
|
contact_person: DF.Link | None
|
||||||
conversion_rate: DF.Float
|
conversion_rate: DF.Float
|
||||||
cost_center: DF.Link | None
|
cost_center: DF.Link | None
|
||||||
@@ -76,7 +77,7 @@ class DeliveryNote(SellingController):
|
|||||||
ignore_pricing_rule: DF.Check
|
ignore_pricing_rule: DF.Check
|
||||||
in_words: DF.Data | None
|
in_words: DF.Data | None
|
||||||
incoterm: DF.Link | None
|
incoterm: DF.Link | None
|
||||||
installation_status: DF.LiteralNone
|
installation_status: DF.Literal[None]
|
||||||
instructions: DF.Text | None
|
instructions: DF.Text | None
|
||||||
inter_company_reference: DF.Link | None
|
inter_company_reference: DF.Link | None
|
||||||
is_internal_customer: DF.Check
|
is_internal_customer: DF.Check
|
||||||
|
|||||||
Reference in New Issue
Block a user