added about us page and settings

This commit is contained in:
Rushabh Mehta 2012-12-27 16:50:24 +05:30
commit 1b1517155b
33 changed files with 571 additions and 316 deletions

File diff suppressed because one or more lines are too long

View File

@ -123,33 +123,8 @@
</div>
<div class="section india-specific">
<div class="section-head">Tax Deduction (India)</div>
<div class="section-head">India Specific</div>
<div class="section-body">
<div class="section-item">
<a class="section-link"
title = "Tax Deduction at Source (TDS) payments to be made to the goverment"
href="#List/TDS Payment">TDS Payments</a>
</div>
<div class="section-item">
<a class="section-link"
title = "Update with acknowledgement recd from the government"
href="#List/TDS Return Acknowledgement">TDS Return Acknowledgement</a>
</div>
<div class="section-item">
<a class="section-link"
title = "Tax deduction (TDS) categories"
href="#List/TDS Category">TDS Category</a>
</div>
<div class="section-item">
<a class="section-link"
title = "Tax deduction (TDS) rates for different periods"
href="#List/TDS Rate Chart">TDS Rate Chart</a>
</div>
<div class="section-item">
<a class="section-link"
title = "Challan given to employees/suppliers whose tax (TDS) has been deducted"
href="#List/Form 16A">Form 16A</a>
</div>
<div class="section-item">
<a class="section-link"
title = "C-Forms received from customers"

View File

@ -21,6 +21,7 @@ from webnotes import msgprint
feed_dict = {
# Project
'Project': ['[%(status)s]', '#000080'],
'Task': ['[%(status)s] %(subject)s', '#000080'],
# Sales
'Lead': ['%(lead_name)s', '#000080'],
@ -81,8 +82,9 @@ def make_feed(feedtype, doctype, name, owner, subject, color):
f.full_name = get_fullname(owner)
f.save()
def update_feed(doc, method=None):
def update_feed(controller, method=None):
"adds a new feed"
doc = controller.doc
if method in ['on_update', 'on_submit']:
subject, color = feed_dict.get(doc.doctype, [None, None])
if subject:

View File

@ -2,9 +2,9 @@
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-11-30 11:49:12",
"creation": "2012-12-03 10:13:46",
"modified_by": "Administrator",
"modified": "2012-11-30 11:54:31"
"modified": "2012-12-27 14:45:31"
},
{
"autoname": "naming_series:",
@ -51,10 +51,17 @@
"fieldtype": "Column Break",
"permlevel": 0
},
{
"doctype": "DocField",
"label": "Image View",
"options": "image",
"fieldname": "image_view",
"fieldtype": "Image",
"permlevel": 0
},
{
"print_hide": 1,
"no_copy": 1,
"colour": "White:FFF",
"doctype": "DocField",
"label": "Employee",
"fieldname": "employee",
@ -67,32 +74,28 @@
"description": "<span class=\"sys_manager\">To setup, please go to Setup > Naming Series</span>",
"no_copy": 1,
"oldfieldtype": "Select",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Naming Series",
"oldfieldname": "naming_series",
"permlevel": 0,
"options": "EMP/",
"fieldname": "naming_series",
"fieldtype": "Select",
"reqd": 0,
"options": "EMP/"
"permlevel": 0
},
{
"oldfieldtype": "Select",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Salutation",
"oldfieldname": "salutation",
"trigger": "Client",
"options": "\nMr\nMs",
"fieldname": "salutation",
"fieldtype": "Select",
"search_index": 0,
"options": "\nMr\nMs",
"permlevel": 0
},
{
"oldfieldtype": "Data",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Full Name",
"oldfieldname": "employee_name",
@ -101,6 +104,30 @@
"reqd": 1,
"permlevel": 0
},
{
"doctype": "DocField",
"label": "Image",
"options": "attach_files:",
"fieldname": "image",
"fieldtype": "Select",
"permlevel": 0
},
{
"doctype": "DocField",
"width": "50%",
"fieldname": "column_break1",
"fieldtype": "Column Break",
"permlevel": 0
},
{
"description": "System User (login) ID. If set, it will become default for all HR forms.",
"doctype": "DocField",
"label": "User ID",
"options": "Profile",
"fieldname": "user_id",
"fieldtype": "Link",
"permlevel": 0
},
{
"oldfieldtype": "Data",
"doctype": "DocField",
@ -112,26 +139,8 @@
"permlevel": 0,
"in_filter": 1
},
{
"description": "System User (login) ID. If set, it will become default for all HR forms.",
"colour": "White:FFF",
"doctype": "DocField",
"label": "User ID",
"options": "Profile",
"fieldname": "user_id",
"fieldtype": "Link",
"permlevel": 0
},
{
"doctype": "DocField",
"width": "50%",
"fieldname": "column_break1",
"fieldtype": "Column Break",
"permlevel": 0
},
{
"oldfieldtype": "Date",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Date of Joining",
"oldfieldname": "date_of_joining",
@ -142,11 +151,9 @@
},
{
"oldfieldtype": "Date",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Date of Birth",
"oldfieldname": "date_of_birth",
"trigger": "Client",
"fieldname": "date_of_birth",
"fieldtype": "Date",
"search_index": 0,
@ -194,7 +201,6 @@
{
"default": "Active",
"oldfieldtype": "Select",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Status",
"oldfieldname": "status",
@ -221,7 +227,6 @@
{
"description": "Applicable Holiday List",
"oldfieldtype": "Link",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Holiday List",
"oldfieldname": "holiday_list",
@ -249,7 +254,6 @@
},
{
"oldfieldtype": "Date",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Final Confirmation Date",
"oldfieldname": "final_confirmation_date",
@ -294,7 +298,6 @@
},
{
"oldfieldtype": "Link",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Branch",
"oldfieldname": "branch",
@ -307,7 +310,6 @@
},
{
"oldfieldtype": "Link",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Department",
"oldfieldname": "department",
@ -320,21 +322,19 @@
},
{
"oldfieldtype": "Link",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Designation",
"oldfieldname": "designation",
"permlevel": 0,
"options": "Designation",
"fieldname": "designation",
"fieldtype": "Link",
"search_index": 1,
"reqd": 0,
"options": "Designation",
"permlevel": 0,
"in_filter": 1
},
{
"oldfieldtype": "Link",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Grade",
"oldfieldname": "grade",
@ -378,33 +378,29 @@
},
{
"oldfieldtype": "Select",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Salary Mode",
"oldfieldname": "salary_mode",
"trigger": "Client",
"options": "\nBank\nCash\nCheque",
"fieldname": "salary_mode",
"fieldtype": "Select",
"options": "\nBank\nCash\nCheque",
"permlevel": 0
},
{
"oldfieldtype": "Link",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Bank Name",
"oldfieldname": "bank_name",
"permlevel": 0,
"options": "Suggest",
"fieldname": "bank_name",
"fieldtype": "Data",
"depends_on": "eval:doc.salary_mode == 'Bank'",
"hidden": 0,
"options": "Suggest",
"permlevel": 0,
"in_filter": 1
},
{
"oldfieldtype": "Data",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Bank A/C No.",
"oldfieldname": "bank_ac_no",
@ -544,6 +540,21 @@
"fieldtype": "Small Text",
"permlevel": 0
},
{
"doctype": "DocField",
"label": "Bio",
"fieldname": "sb53",
"fieldtype": "Section Break",
"permlevel": 0
},
{
"description": "Short biography for website and other publications.",
"doctype": "DocField",
"label": "Bio",
"fieldname": "bio",
"fieldtype": "Text Editor",
"permlevel": 0
},
{
"doctype": "DocField",
"label": "Personal Details",
@ -588,10 +599,8 @@
},
{
"oldfieldtype": "Button",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Salary Structure",
"trigger": "Client",
"fieldname": "salary_structure",
"fieldtype": "Button",
"hidden": 1,
@ -629,7 +638,6 @@
},
{
"description": "Here you can maintain family details like name and occupation of parent, spouse and children",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Family Background",
"fieldname": "family_background",
@ -638,7 +646,6 @@
},
{
"description": "Here you can maintain height, weight, allergies, medical concerns etc",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Health Details",
"fieldname": "health_details",

View File

@ -0,0 +1,3 @@
import webnotes
def execute():
webnotes.delete_doc("Print Format", "Form 16A Print Format")

View File

@ -8,5 +8,5 @@ def execute():
set use_multi_level_bom = if(consider_sa_items_as_raw_materials='Yes', 0, 1)""")
webnotes.conn.sql("""update `tabProduction Order`
set use_multi_level_bom = if(consider_sa_items_as_raw_materials='Yes', 0, 1)
set use_multi_level_bom = if(consider_sa_items='Yes', 0, 1)
where use_multi_level_bom is null""")

View File

@ -560,6 +560,10 @@ patch_list = [
},
{
'patch_module': 'patches.december_2012',
<<<<<<< HEAD
'patch_file': 'address_title',
=======
'patch_file': 'delete_form16_print_format',
>>>>>>> a85b2e4ee349c544acb7a1949351e9a7c70f7b7c
},
]

View File

@ -0,0 +1,196 @@
// ERPNext - web based ERP (http://erpnext.com)
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
wn.require("app/js/stock_grid_report.js");
erpnext.StockAnalytics = erpnext.StockGridReport.extend({
init: function(wrapper, opts) {
var args = {
title: "Stock Analytics",
page: wrapper,
parent: $(wrapper).find('.layout-main'),
appframe: wrapper.appframe,
doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand",
"Fiscal Year"],
tree_grid: {
show: true,
parent_field: "parent_item_group",
formatter: function(item) {
if(!item.is_group) {
return repl('<a href="#stock-ledger/item_code=%(enc_value)s">%(value)s</a>',
{
value: item.name,
enc_value: encodeURIComponent(item.name)
});
} else {
return item.name;
}
}
},
}
if(opts) $.extend(args, opts);
this._super(args);
},
setup_columns: function() {
var std_columns = [
{id: "check", name: "Plot", field: "check", width: 30,
formatter: this.check_formatter},
{id: "name", name: "Item", field: "name", width: 300,
formatter: this.tree_formatter},
{id: "brand", name: "Brand", field: "brand", width: 100},
{id: "opening", name: "Opening", field: "opening", hidden: true,
formatter: this.currency_formatter}
];
this.make_date_range_columns();
this.columns = std_columns.concat(this.columns);
},
filters: [
{fieldtype:"Select", label: "Value or Qty", options:["Value (Weighted Average)",
"Value (FIFO)", "Quantity"],
filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me);
}},
{fieldtype:"Select", label: "Brand", link:"Brand",
default_value: "Select Brand...", filter: function(val, item, opts) {
return val == opts.default_value || item.brand == val || item._show;
}},
{fieldtype:"Select", label: "Warehouse", link:"Warehouse",
default_value: "Select Warehouse..."},
{fieldtype:"Date", label: "From Date"},
{fieldtype:"Label", label: "To"},
{fieldtype:"Date", label: "To Date"},
{fieldtype:"Select", label: "Range",
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
{fieldtype:"Button", label: "Refresh", icon:"icon-refresh icon-white", cssClass:"btn-info"},
{fieldtype:"Button", label: "Reset Filters"}
],
setup_filters: function() {
var me = this;
this._super();
this.trigger_refresh_on_change(["value_or_qty", "brand", "warehouse", "range"]);
this.show_zero_check();
this.setup_plot_check();
},
init_filter_values: function() {
this._super();
this.filter_inputs.range && this.filter_inputs.range.val('Monthly');
},
prepare_data: function() {
var me = this;
if(!this.data) {
var items = this.prepare_tree("Item", "Item Group");
me.parent_map = {};
me.item_by_name = {};
me.data = [];
$.each(items, function(i, v) {
var d = copy_dict(v);
me.data.push(d);
me.item_by_name[d.name] = d;
if(d.parent_item_group) {
me.parent_map[d.name] = d.parent_item_group;
}
me.reset_item_values(d);
});
this.set_indent();
this.data[0].checked = true;
} else {
// otherwise, only reset values
$.each(this.data, function(i, d) {
me.reset_item_values(d);
});
}
this.prepare_balances();
this.update_groups();
},
prepare_balances: function() {
var me = this;
var from_date = dateutil.str_to_obj(this.from_date);
var to_date = dateutil.str_to_obj(this.to_date);
var data = wn.report_dump.data["Stock Ledger Entry"];
this.item_warehouse = {};
for(var i=0, j=data.length; i<j; i++) {
var sl = data[i];
sl.posting_datetime = sl.posting_date + " " + sl.posting_time;
var posting_datetime = dateutil.str_to_obj(sl.posting_datetime);
if(me.is_default("warehouse") ? true : me.warehouse == sl.warehouse) {
var item = me.item_by_name[sl.item_code];
if(me.value_or_qty!="Quantity") {
var wh = me.get_item_warehouse(sl.warehouse, sl.item_code);
var is_fifo = this.value_or_qty== "Value (FIFO)";
var diff = me.get_value_diff(wh, sl, is_fifo);
} else {
var diff = sl.qty;
}
if(posting_datetime < from_date) {
item.opening += diff;
} else if(posting_datetime <= to_date) {
item[me.column_map[sl.posting_date].field] += diff;
} else {
break;
}
}
}
},
update_groups: function() {
var me = this;
$.each(this.data, function(i, item) {
// update groups
if(!item.is_group && me.apply_filter(item, "brand")) {
var balance = item.opening;
$.each(me.columns, function(i, col) {
if(col.formatter==me.currency_formatter && !col.hidden) {
item[col.field] = balance + item[col.field];
balance = item[col.field];
}
});
var parent = me.parent_map[item.name];
while(parent) {
parent_group = me.item_by_name[parent];
$.each(me.columns, function(c, col) {
if (col.formatter == me.currency_formatter) {
parent_group[col.field] =
flt(parent_group[col.field])
+ flt(item[col.field]);
}
});
parent = me.parent_map[parent];
}
}
});
},
get_plot_points: function(item, col, idx) {
return [[dateutil.user_to_obj(col.name).getTime(), item[col.field]]]
}
});

View File

@ -48,7 +48,7 @@ cur_frm.cscript.refresh = function(doc,dt,dn) {
cur_frm.communication_view = new wn.views.CommunicationList({
list: wn.model.get("Communication", {"customer": doc.name}),
parent: cur_frm.fields_dict.communication_html.wrapper,
doc: doc
doc: doc,
});
}
}
@ -114,4 +114,4 @@ cur_frm.fields_dict['customer_group'].get_query = function(doc,dt,dn) {
}
cur_frm.fields_dict.lead_name.get_query = erpnext.utils.lead_query;
cur_frm.fields_dict.lead_name.get_query = erpnext.utils.lead_query;

View File

@ -5,6 +5,7 @@ wn.doclistviews['Lead'] = wn.views.ListView.extend({
'tabLead.lead_name',
'tabLead.status',
'tabLead.source',
'tabLead.company_name',
'tabLead.modified_by'
]);
this.stats = this.stats.concat(['status', 'source', 'rating', 'company']);
@ -29,7 +30,8 @@ wn.doclistviews['Lead'] = wn.views.ListView.extend({
{width: '5%', content:'avatar_modified'},
{width: '30%', content:'lead_name'},
{width: '12%', content:'status_html'},
{width: '38%', content:'lead_status+tags', css: {color:'#222'}},
{width: '15%', content:'lead_status+tags', css: {color:'#222'}},
{width: '23%', content: 'company_name'},
{width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}}
]
})

View File

@ -46,10 +46,6 @@ def comment_added(doc):
"""add comment to feed"""
home.make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by,
'<i>"' + doc.comment + '"</i>', '#6B24B3')
def doclist_all(doc, method):
"""doclist trigger called from webnotes.model.wrapper on any event"""
home.update_feed(doc, method)
def boot_session(bootinfo):
"""boot session - send website info if guest"""

20
startup/observers.py Normal file
View File

@ -0,0 +1,20 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
observer_map = {
"*:on_update": "home.update_feed",
"*:on_submit": "home.update_feed",
}

View File

@ -14,200 +14,19 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
wn.require("app/js/stock_grid_report.js");
// done so that it doesn't throw error when inherited in stock-balance report
if(wn.pages["stock-analytics"]) {
wn.pages['stock-analytics'].onload = function(wrapper) {
wn.ui.make_app_page({
parent: wrapper,
title: 'Stock Analytics',
single_column: true
});
wn.pages['stock-analytics'].onload = function(wrapper) {
wn.ui.make_app_page({
parent: wrapper,
title: 'Stock Analytics',
single_column: true
});
new erpnext.StockAnalytics(wrapper);
new erpnext.StockAnalytics(wrapper);
wrapper.appframe.add_home_breadcrumb()
wrapper.appframe.add_module_breadcrumb("Stock")
wrapper.appframe.add_breadcrumb("icon-bar-chart")
}
wrapper.appframe.add_home_breadcrumb()
wrapper.appframe.add_module_breadcrumb("Stock")
wrapper.appframe.add_breadcrumb("icon-bar-chart")
}
erpnext.StockAnalytics = erpnext.StockGridReport.extend({
init: function(wrapper, opts) {
var args = {
title: "Stock Analytics",
page: wrapper,
parent: $(wrapper).find('.layout-main'),
appframe: wrapper.appframe,
doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand",
"Fiscal Year"],
tree_grid: {
show: true,
parent_field: "parent_item_group",
formatter: function(item) {
if(!item.is_group) {
return repl('<a href="#stock-ledger/item_code=%(enc_value)s">%(value)s</a>',
{
value: item.name,
enc_value: encodeURIComponent(item.name)
});
} else {
return item.name;
}
}
},
}
if(opts) $.extend(args, opts);
this._super(args);
},
setup_columns: function() {
var std_columns = [
{id: "check", name: "Plot", field: "check", width: 30,
formatter: this.check_formatter},
{id: "name", name: "Item", field: "name", width: 300,
formatter: this.tree_formatter},
{id: "brand", name: "Brand", field: "brand", width: 200},
{id: "opening", name: "Opening", field: "opening", hidden: true,
formatter: this.currency_formatter}
];
this.make_date_range_columns();
this.columns = std_columns.concat(this.columns);
},
filters: [
{fieldtype:"Select", label: "Value or Qty", options:["Value (Weighted Average)",
"Value (FIFO)", "Quantity"],
filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me);
}},
{fieldtype:"Select", label: "Brand", link:"Brand",
default_value: "Select Brand...", filter: function(val, item, opts) {
return val == opts.default_value || item.brand == val || item._show;
}},
{fieldtype:"Select", label: "Warehouse", link:"Warehouse",
default_value: "Select Warehouse..."},
{fieldtype:"Date", label: "From Date"},
{fieldtype:"Label", label: "To"},
{fieldtype:"Date", label: "To Date"},
{fieldtype:"Select", label: "Range",
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
{fieldtype:"Button", label: "Refresh", icon:"icon-refresh icon-white", cssClass:"btn-info"},
{fieldtype:"Button", label: "Reset Filters"}
],
setup_filters: function() {
var me = this;
this._super();
this.trigger_refresh_on_change(["value_or_qty", "brand", "warehouse", "range"]);
this.show_zero_check();
this.setup_plot_check();
},
init_filter_values: function() {
this._super();
this.filter_inputs.range && this.filter_inputs.range.val('Monthly');
},
prepare_data: function() {
var me = this;
if(!this.data) {
var items = this.prepare_tree("Item", "Item Group");
me.parent_map = {};
me.item_by_name = {};
me.data = [];
$.each(items, function(i, v) {
var d = copy_dict(v);
me.data.push(d);
me.item_by_name[d.name] = d;
if(d.parent_item_group) {
me.parent_map[d.name] = d.parent_item_group;
}
me.reset_item_values(d);
});
this.set_indent();
this.data[0].checked = true;
} else {
// otherwise, only reset values
$.each(this.data, function(i, d) {
me.reset_item_values(d);
});
}
this.prepare_balances();
this.update_groups();
},
prepare_balances: function() {
var me = this;
var from_date = dateutil.str_to_obj(this.from_date);
var to_date = dateutil.str_to_obj(this.to_date);
var data = wn.report_dump.data["Stock Ledger Entry"];
this.item_warehouse = {};
for(var i=0, j=data.length; i<j; i++) {
var sl = data[i];
sl.posting_datetime = sl.posting_date + " " + sl.posting_time;
var posting_datetime = dateutil.str_to_obj(sl.posting_datetime);
if(me.is_default("warehouse") ? true : me.warehouse == sl.warehouse) {
var item = me.item_by_name[sl.item_code];
if(me.value_or_qty!="Quantity") {
var wh = me.get_item_warehouse(sl.warehouse, sl.item_code);
var is_fifo = this.value_or_qty== "Value (FIFO)";
var diff = me.get_value_diff(wh, sl, is_fifo);
} else {
var diff = sl.qty;
}
if(posting_datetime < from_date) {
item.opening += diff;
} else if(posting_datetime <= to_date) {
item[me.column_map[sl.posting_date].field] += diff;
} else {
break;
}
}
}
},
update_groups: function() {
var me = this;
$.each(this.data, function(i, item) {
// update groups
if(!item.is_group && me.apply_filter(item, "brand")) {
var balance = item.opening;
$.each(me.columns, function(i, col) {
if(col.formatter==me.currency_formatter && !col.hidden) {
item[col.field] = balance + item[col.field];
balance = item[col.field];
}
});
var parent = me.parent_map[item.name];
while(parent) {
parent_group = me.item_by_name[parent];
$.each(me.columns, function(c, col) {
if (col.formatter == me.currency_formatter) {
parent_group[col.field] =
flt(parent_group[col.field])
+ flt(item[col.field]);
}
});
parent = me.parent_map[parent];
}
}
});
},
get_plot_points: function(item, col, idx) {
return [[dateutil.user_to_obj(col.name).getTime(), item[col.field]]]
}
});
wn.require("app/js/stock_analytics.js");

View File

@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
wn.require("../app/stock/page/stock_analytics/stock_analytics.js");
wn.require("app/js/stock_analytics.js");
wn.pages['stock-balance'].onload = function(wrapper) {
wn.ui.make_app_page({

View File

@ -81,7 +81,7 @@ class SupportMailbox(POP3Mailbox):
if exists and exists[0] and exists[0][0]:
st = webnotes.get_obj('Support Ticket', thread_id)
from support.doctype.communication.communication import make
from core.doctype.communication.communication import make
make(content=content, sender=full_email_id, doctype="Support Ticket",
name=thread_id, lead = st.doc.lead, contact=st.doc.contact)

View File

@ -51,6 +51,7 @@ $.extend(cur_frm.cscript, {
var comm_list = wn.model.get("Communication", {"support_ticket": doc.name})
comm_list.push({
"sender": doc.raised_by,
"creation": doc.creation,
"modified": doc.creation,
"content": doc.description});

View File

@ -31,7 +31,8 @@ class DocType:
self.doc.name = self.doc.supplier + '-' + self.doc.address_type
elif self.doc.sales_partner:
self.doc.name = self.doc.sales_partner + '-' + self.doc.address_type
elif self.doc.address_title:
self.doc.address_title = self.doc.address_title + "-" + self.doc.address_type
def validate(self):
self.validate_for_whom()

View File

@ -41,7 +41,7 @@ class DocType:
d = d.replace(x, '')
# mobile no validation for erpnext gateway
if webnotes.conn.webnotes.conn.get_value('SMS Settings', None, 'sms_gateway_url'):
if webnotes.conn.get_value('SMS Settings', None, 'sms_gateway_url'):
mob_no = d
else:
if not d.startswith("0") and len(d) == 10:

View File

@ -65,14 +65,6 @@ p, li {
float: left;
}
.website-missing-image {
background-color: #eee;
padding: 40px;
width: 32px;
font-size: 32px;
color: #888;
}
.clear {
clear: both;
}

View File

@ -0,0 +1,18 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import webnotes
from website.utils import url_for_website
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
def onload(self):
"""load employee"""
emp_list = []
for d in self.doclist.get({"doctype":"About Us Team Member"}):
emp = webnotes.doc("Employee", d.employee)
emp.image = url_for_website(emp.image)
emp_list.append(emp)
self.doclist += emp_list

View File

@ -0,0 +1,98 @@
[
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-12-27 14:24:35",
"modified_by": "Administrator",
"modified": "2012-12-27 15:51:11"
},
{
"issingle": 1,
"description": "Settings for the About Us Page",
"doctype": "DocType",
"module": "Website",
"document_type": "Master",
"name": "__common__"
},
{
"name": "__common__",
"parent": "About Us Settings",
"doctype": "DocField",
"parenttype": "DocType",
"permlevel": 0,
"parentfield": "fields"
},
{
"parent": "About Us Settings",
"read": 1,
"name": "__common__",
"create": 1,
"doctype": "DocPerm",
"write": 1,
"parenttype": "DocType",
"role": "Website Manager",
"permlevel": 0,
"parentfield": "permissions"
},
{
"name": "About Us Settings",
"doctype": "DocType"
},
{
"description": "Introduce your company to the website visitor.",
"doctype": "DocField",
"label": "Company Introduction",
"fieldname": "company_introduction",
"fieldtype": "Text Editor"
},
{
"doctype": "DocField",
"label": "Company History",
"fieldname": "sb0",
"fieldtype": "Section Break"
},
{
"description": "\"Company History\"",
"doctype": "DocField",
"label": "Company History Heading",
"fieldname": "company_history_heading",
"fieldtype": "Data"
},
{
"doctype": "DocField",
"label": "Company History",
"fieldname": "company_history",
"fieldtype": "Table",
"options": "Company History"
},
{
"doctype": "DocField",
"label": "Team Members",
"fieldname": "sb1",
"fieldtype": "Section Break"
},
{
"description": "\"Team Members\" or \"Management\"",
"doctype": "DocField",
"label": "Team Members Heading",
"fieldname": "team_members_heading",
"fieldtype": "Data"
},
{
"doctype": "DocField",
"label": "Team Members",
"fieldname": "team_members",
"fieldtype": "Table",
"options": "About Us Team Member"
},
{
"description": "More content for the bottom of the page.",
"doctype": "DocField",
"label": "Footer",
"fieldname": "footer",
"fieldtype": "Text Editor"
},
{
"doctype": "DocPerm"
}
]

View File

@ -0,0 +1,8 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import webnotes
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl

View File

@ -0,0 +1,35 @@
[
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-12-27 14:28:45",
"modified_by": "Administrator",
"modified": "2012-12-27 14:49:44"
},
{
"istable": 1,
"name": "__common__",
"doctype": "DocType",
"module": "Website"
},
{
"parent": "About Us Team Member",
"doctype": "DocField",
"name": "__common__",
"label": "Employee",
"width": "300px",
"parenttype": "DocType",
"options": "Employee",
"fieldname": "employee",
"fieldtype": "Link",
"permlevel": 0,
"parentfield": "fields"
},
{
"name": "About Us Team Member",
"doctype": "DocType"
},
{
"doctype": "DocField"
}
]

View File

@ -0,0 +1,8 @@
# For license information, please see license.txt
from __future__ import unicode_literals
import webnotes
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl

View File

@ -0,0 +1,40 @@
[
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-12-27 14:25:38",
"modified_by": "Administrator",
"modified": "2012-12-27 14:25:38"
},
{
"istable": 1,
"name": "__common__",
"doctype": "DocType",
"module": "Website"
},
{
"name": "__common__",
"parent": "Company History",
"doctype": "DocField",
"parenttype": "DocType",
"permlevel": 0,
"parentfield": "fields"
},
{
"name": "Company History",
"doctype": "DocType"
},
{
"doctype": "DocField",
"label": "Year",
"fieldname": "year",
"fieldtype": "Data"
},
{
"doctype": "DocField",
"label": "Highlight",
"width": "300px",
"fieldname": "highlight",
"fieldtype": "Text"
}
]

View File

@ -20,11 +20,11 @@
<br>
<h5><a href="#Form/Product Settings">Product Settings</a></h5>
<p class="help">Settings for Product Catalog on the website.</p>
<br>
<h5><a href="#Form/About Us Settings">About Us Settings</a></h5>
<p class="help">Settings for About Us Page.</p>
</div>
<div style="clear: both"></div>
<hr>
<h3>Reports</h3>
<div class="reports-list"></div>
</div>
<div class="layout-side-section">
<div class="psidebar">

View File

@ -21,7 +21,7 @@
<div class="well well-small">
<div class="container-fluid" style="padding-left: 0px; margin-left:-10px; line-height: 2em;">
{% for d in sub_groups %}
<div class="span2">
<div class="span4">
<a href="{{ d.page_name }}">{{ d.name }} ({{ d.count }})</a>
</div>
{% endfor %}

View File

@ -1 +1 @@
<div class='website-missing-image'><i class='icon-camera'></i></div>
<div class='missing-image'><i class='icon-camera'></i></div>

View File

@ -0,0 +1,40 @@
{% extends "html/page.html" %}
{% block content %}
<div class="layout-wrapper">
<div class="layout-main">
{% if obj.doc.company_introduction %}
{{ obj.doc.company_introduction }}
{% endif %}
{% if obj.doclist.get({"doctype":"Company History"}) %}
<h3>{{ obj.doc.company_history_heading or "Company History" }}</h3>
<table class="table table-bordered" style="width: 100%; table-layout: fixed">
<tbody>
{% for d in obj.doclist.get({"doctype":"Company History"}) %}
<tr>
<td style="width: 30%; text-align: right"><h4>{{ d.year }}</h4></td>
<td>{{ d.highlight }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if obj.doclist.get({"doctype":"Employee"}) %}
<h3>{{ obj.doc.team_members_heading or "Team Members" }}</h3>
<table class="table table-bordered" style="width: 100%; table-layout: fixed">
<tbody>
{% for d in obj.doclist.get({"doctype":"Employee"}) %}
<tr>
<td style="text-align:right; width: 30%;">
<img src="{{ d.image }}" style=""></td>
<td><h4>{{ d.employee_name }}</h4>
{{ d.bio }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{{ obj.doc.footer or "" }}
</div>
</div>
{% endblock %}

View File

@ -40,6 +40,10 @@ page_map = {
})
}
page_settings_map = {
"about": "About Us Settings"
}
def render(page_name):
"""render html page"""
try:
@ -98,6 +102,10 @@ def update_page_name(doc, title):
"""set page_name and check if it is unique"""
webnotes.conn.set(doc, "page_name", page_name(title))
standard_pages = get_template_pages()
if doc.page_name in standard_pages:
webnotes.conn.sql("""Page Name cannot be one of %s""" % ', '.join(standard_pages))
res = webnotes.conn.sql("""\
select count(*) from `tab%s`
where page_name=%s and name!=%s""" % (doc.doctype, '%s', '%s'),
@ -135,10 +143,12 @@ def prepare_args(page_name):
page_name = get_home_page()
if page_name in get_template_pages():
args = {
args = webnotes._dict({
'template': 'pages/%s.html' % page_name,
'name': page_name,
}
})
if page_name in page_settings_map:
args.obj = webnotes.model_wrapper(page_settings_map[page_name]).obj
else:
args = get_doc_fields(page_name)