mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-02 21:18:27 +00:00
address now not in dialog, added slideshows in products and groups and removed transaction history from customer / supplier / sales partner
This commit is contained in:
@@ -2,56 +2,6 @@
|
||||
// =========================
|
||||
|
||||
|
||||
// make history list body
|
||||
// -----------------------
|
||||
cur_frm.cscript.make_hl_body = function(){
|
||||
cur_frm.fields_dict['history_html'].wrapper.innerHTML = '';
|
||||
cur_frm.history_html = $a(cur_frm.fields_dict['history_html'].wrapper,'div');
|
||||
$(cur_frm.history_html).css({
|
||||
'min-height': '320px',
|
||||
});
|
||||
}
|
||||
|
||||
// make history
|
||||
// -------------
|
||||
cur_frm.cscript.make_history = function(doc,dt,dn){
|
||||
cur_frm.history_html.innerHTML = '';
|
||||
cur_frm.cscript.make_history_list(cur_frm.history_html,doc);
|
||||
}
|
||||
|
||||
// make history list
|
||||
// ------------------
|
||||
cur_frm.cscript.make_history_list = function(parent,doc){
|
||||
|
||||
var sel = $a(parent,'select');
|
||||
|
||||
var ls = ['Select Transaction..'];
|
||||
for(d in cur_frm.history_dict){
|
||||
ls.push(d);
|
||||
}
|
||||
|
||||
add_sel_options(sel,ls,'Select..');
|
||||
|
||||
var body = $a(parent,'div');
|
||||
body.innerHTML = '<div class="help_box">Please select a transaction type to see History</div>';
|
||||
|
||||
sel.body = body;
|
||||
sel.doc = doc;
|
||||
|
||||
sel.onchange = function(){
|
||||
for(d in cur_frm.history_dict){
|
||||
if(sel_val(this) == d){
|
||||
this.body.innerHTML = '';
|
||||
eval(cur_frm.history_dict[d]);
|
||||
return;
|
||||
}
|
||||
else{
|
||||
// pass
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get sates on country trigger
|
||||
// -----------------------------
|
||||
cur_frm.cscript.get_states=function(doc,dt,dn){
|
||||
|
||||
@@ -54,4 +54,7 @@ class DocType(DocTypeNestedSet):
|
||||
|
||||
self.doc.items = get_product_list_for_group(product_group = self.doc.name, limit=20)
|
||||
self.parent_groups = get_parent_item_groups(self.doc.name)
|
||||
|
||||
|
||||
if self.doc.slideshow:
|
||||
from website.helpers.slideshow import get_slideshow
|
||||
get_slideshow(self)
|
||||
@@ -4,7 +4,7 @@
|
||||
"docstatus": 0,
|
||||
"creation": "2012-12-07 15:15:28",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-12-20 16:11:15"
|
||||
"modified": "2012-12-27 10:38:02"
|
||||
},
|
||||
{
|
||||
"in_create": 1,
|
||||
@@ -102,6 +102,15 @@
|
||||
"fieldname": "show_in_website",
|
||||
"fieldtype": "Check"
|
||||
},
|
||||
{
|
||||
"description": "Show this slideshow at the top of the page",
|
||||
"depends_on": "show_in_website",
|
||||
"doctype": "DocField",
|
||||
"label": "Slideshow",
|
||||
"fieldname": "slideshow",
|
||||
"fieldtype": "Link",
|
||||
"options": "Website Slideshow"
|
||||
},
|
||||
{
|
||||
"description": "HTML / Banner that will show on the top of product list.",
|
||||
"depends_on": "show_in_website",
|
||||
|
||||
@@ -17,31 +17,19 @@
|
||||
wn.require('app/setup/doctype/contact_control/contact_control.js');
|
||||
|
||||
cur_frm.cscript.onload = function(doc,dt,dn){
|
||||
// history doctypes and scripts
|
||||
cur_frm.history_dict = {
|
||||
'Sales Order' : 'cur_frm.cscript.make_so_list(this.body, this.doc)',
|
||||
'Delivery Note' : 'cur_frm.cscript.make_dn_list(this.body, this.doc)',
|
||||
'Sales Invoice' : 'cur_frm.cscript.make_si_list(this.body, this.doc)'
|
||||
}
|
||||
|
||||
// make contact, history list body
|
||||
//cur_frm.cscript.make_cl_body();
|
||||
cur_frm.cscript.make_hl_body();
|
||||
|
||||
}
|
||||
|
||||
cur_frm.cscript.refresh = function(doc,dt,dn){
|
||||
|
||||
if(doc.__islocal){
|
||||
hide_field(['address_html', 'contact_html']);
|
||||
//cur_frm.cscript.set_cl_msg(doc);
|
||||
//cur_frm.cscript.set_hl_msg(doc);
|
||||
}
|
||||
else{
|
||||
unhide_field(['address_html', 'contact_html']);
|
||||
// make lists
|
||||
cur_frm.cscript.make_address(doc,dt,dn);
|
||||
cur_frm.cscript.make_contact(doc,dt,dn);
|
||||
cur_frm.cscript.make_history(doc,dt,dn);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +39,15 @@ cur_frm.cscript.make_address = function() {
|
||||
cur_frm.address_list = new wn.ui.Listing({
|
||||
parent: cur_frm.fields_dict['address_html'].wrapper,
|
||||
page_length: 2,
|
||||
new_doctype: "Address",
|
||||
new_doctype: "Address",
|
||||
custom_new_doc: function(doctype) {
|
||||
var address = wn.model.make_new_doc_and_get_name('Address');
|
||||
address = locals['Address'][address];
|
||||
address.sales_partner = cur_frm.doc.name;
|
||||
address.address_title = cur_frm.doc.name;
|
||||
address.address_type = "Office";
|
||||
wn.set_route("Form", "Address", address.name);
|
||||
},
|
||||
get_query: function() {
|
||||
return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where sales_partner='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_address desc"
|
||||
},
|
||||
@@ -102,5 +98,4 @@ cur_frm.cscript.make_contact = function() {
|
||||
|
||||
cur_frm.fields_dict['partner_target_details'].grid.get_field("item_group").get_query = function(doc, dt, dn) {
|
||||
return 'SELECT `tabItem Group`.`name`,`tabItem Group`.`parent_item_group` FROM `tabItem Group` WHERE `tabItem Group`.is_group="No" AND `tabItem Group`.docstatus != 2 AND `tabItem Group`.%(key)s LIKE "%s" LIMIT 50'
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,26 +2,19 @@
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-07-03 13:30:54",
|
||||
"creation": "2012-07-12 23:29:44",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-07-12 11:22:15"
|
||||
"modified": "2012-12-27 14:03:00"
|
||||
},
|
||||
{
|
||||
"section_style": "Tabbed",
|
||||
"description": "A **Sales Partner** is a third party distributor / dealer / commission agent / affiliate / reseller who sells the companies products for a commission. This is useful if you make the end sale to the **Customer**, involving your **Sales Partner**.\n\nIf you sell to your **Sales Partner** who in-turn sells it to the **Customer**, then you must make a **Customer** instead.",
|
||||
"module": "Setup",
|
||||
"server_code_error": " ",
|
||||
"allow_trash": 1,
|
||||
"document_type": "Master",
|
||||
"in_create": 0,
|
||||
"read_only": 0,
|
||||
"_last_update": "1322549700",
|
||||
"autoname": "field:partner_name",
|
||||
"in_create": 0,
|
||||
"name": "__common__",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocType",
|
||||
"show_in_menu": 0,
|
||||
"version": 1
|
||||
"module": "Setup",
|
||||
"document_type": "Master",
|
||||
"description": "A third party distributor / dealer / commission agent / affiliate / reseller who sells the companies products for a commission."
|
||||
},
|
||||
{
|
||||
"name": "__common__",
|
||||
@@ -42,85 +35,9 @@
|
||||
"name": "Sales Partner",
|
||||
"doctype": "DocType"
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales User",
|
||||
"cancel": 0,
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales User",
|
||||
"cancel": 0,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 1,
|
||||
"role": "Sales Master Manager",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales Master Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"write": 1,
|
||||
"role": "System Manager",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"write": 0,
|
||||
"role": "System Manager",
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"description": "Note: You Can Manage Multiple Address or Contacts via Addresses & Contacts",
|
||||
"oldfieldtype": "Section Break",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Sales Partner Details",
|
||||
"fieldname": "basic_info",
|
||||
@@ -128,27 +45,27 @@
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"search_index": 1,
|
||||
"oldfieldtype": "Data",
|
||||
"doctype": "DocField",
|
||||
"label": "Sales Partner Name",
|
||||
"oldfieldname": "partner_name",
|
||||
"fieldname": "partner_name",
|
||||
"fieldtype": "Data",
|
||||
"oldfieldtype": "Data",
|
||||
"search_index": 1,
|
||||
"reqd": 1,
|
||||
"permlevel": 0,
|
||||
"in_filter": 1
|
||||
},
|
||||
{
|
||||
"search_index": 0,
|
||||
"oldfieldtype": "Select",
|
||||
"doctype": "DocField",
|
||||
"label": "Partner Type",
|
||||
"oldfieldname": "partner_type",
|
||||
"permlevel": 0,
|
||||
"options": "\nChannel Partner\nDistributor\nDealer\nAgent\nRetailer\nImplementation Partner\nReseller",
|
||||
"fieldname": "partner_type",
|
||||
"fieldtype": "Select",
|
||||
"oldfieldtype": "Select",
|
||||
"options": "\nChannel Partner\nDistributor\nDealer\nAgent\nRetailer\nImplementation Partner\nReseller",
|
||||
"search_index": 0,
|
||||
"permlevel": 0,
|
||||
"in_filter": 1
|
||||
},
|
||||
{
|
||||
@@ -187,13 +104,12 @@
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.__islocal",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Address Desc",
|
||||
"permlevel": 0,
|
||||
"options": "<em>Addresses will appear only when you save the customer</em>",
|
||||
"fieldname": "address_desc",
|
||||
"fieldtype": "HTML",
|
||||
"options": "<em>Addresses will appear only when you save the customer</em>"
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
@@ -210,13 +126,12 @@
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.__islocal",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Contact Desc",
|
||||
"permlevel": 0,
|
||||
"options": "<em>Contact Details will appear only when you save the customer</em>",
|
||||
"fieldname": "contact_desc",
|
||||
"fieldtype": "HTML",
|
||||
"options": "<em>Contact Details will appear only when you save the customer</em>"
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
@@ -238,31 +153,96 @@
|
||||
"doctype": "DocField",
|
||||
"label": "Partner Target Detail",
|
||||
"oldfieldname": "partner_target_details",
|
||||
"permlevel": 0,
|
||||
"options": "Target Detail",
|
||||
"fieldname": "partner_target_details",
|
||||
"fieldtype": "Table",
|
||||
"reqd": 0,
|
||||
"options": "Target Detail"
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "Select Budget Distribution to unevenly distribute targets across months.",
|
||||
"oldfieldtype": "Link",
|
||||
"colour": "White:FFF",
|
||||
"doctype": "DocField",
|
||||
"label": "Target Distribution",
|
||||
"oldfieldname": "distribution_id",
|
||||
"permlevel": 0,
|
||||
"options": "Budget Distribution",
|
||||
"fieldname": "distribution_id",
|
||||
"fieldtype": "Link",
|
||||
"options": "Budget Distribution"
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Small Text",
|
||||
"doctype": "DocField",
|
||||
"label": "Trash Reason",
|
||||
"oldfieldname": "trash_reason",
|
||||
"fieldname": "trash_reason",
|
||||
"fieldtype": "Small Text",
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales User",
|
||||
"cancel": 0,
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales User",
|
||||
"cancel": 0,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 1,
|
||||
"role": "Sales Master Manager",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"submit": 0,
|
||||
"write": 0,
|
||||
"role": "Sales Master Manager",
|
||||
"cancel": 0,
|
||||
"permlevel": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"doctype": "DocPerm",
|
||||
"write": 1,
|
||||
"role": "System Manager",
|
||||
"cancel": 1,
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"create": 0,
|
||||
"doctype": "DocPerm",
|
||||
"write": 0,
|
||||
"role": "System Manager",
|
||||
"permlevel": 1
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user