Merge branch 'master' into perpetual
This commit is contained in:
commit
8daa702a90
@ -161,7 +161,7 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
expected_values = {
|
||||
"keys": ["ref_rate", "adj_rate", "export_rate", "export_amount",
|
||||
"base_ref_rate", "basic_rate", "amount"],
|
||||
"_Test Item Home Desktop 100": [62.5, 0, 62.5, 625.0, 50, 50, 500],
|
||||
"_Test Item Home Desktop 100": [62.5, 0, 62.5, 625.0, 50, 50, 499.98],
|
||||
"_Test Item Home Desktop 200": [190.66, 0, 190.66, 953.3, 150, 150, 750],
|
||||
}
|
||||
|
||||
@ -175,28 +175,28 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
self.assertEquals(d.fields.get(k), expected_values[d.item_code][i])
|
||||
|
||||
# check net total
|
||||
self.assertEquals(si.doc.net_total, 1250)
|
||||
self.assertEquals(si.doc.net_total, 1249.98)
|
||||
self.assertEquals(si.doc.net_total_export, 1578.3)
|
||||
|
||||
# check tax calculation
|
||||
expected_values = {
|
||||
"keys": ["tax_amount", "total"],
|
||||
"_Test Account Excise Duty - _TC": [140, 1390],
|
||||
"_Test Account Education Cess - _TC": [2.8, 1392.8],
|
||||
"_Test Account S&H Education Cess - _TC": [1.4, 1394.2],
|
||||
"_Test Account CST - _TC": [27.88, 1422.08],
|
||||
"_Test Account VAT - _TC": [156.25, 1578.33],
|
||||
"_Test Account Customs Duty - _TC": [125, 1703.33],
|
||||
"_Test Account Shipping Charges - _TC": [100, 1803.33],
|
||||
"_Test Account Discount - _TC": [-180.33, 1623]
|
||||
"_Test Account Excise Duty - _TC": [140, 1389.98],
|
||||
"_Test Account Education Cess - _TC": [2.8, 1392.78],
|
||||
"_Test Account S&H Education Cess - _TC": [1.4, 1394.18],
|
||||
"_Test Account CST - _TC": [27.88, 1422.06],
|
||||
"_Test Account VAT - _TC": [156.25, 1578.31],
|
||||
"_Test Account Customs Duty - _TC": [125, 1703.31],
|
||||
"_Test Account Shipping Charges - _TC": [100, 1803.31],
|
||||
"_Test Account Discount - _TC": [-180.33, 1622.98]
|
||||
}
|
||||
|
||||
for d in si.doclist.get({"parentfield": "other_charges"}):
|
||||
for i, k in enumerate(expected_values["keys"]):
|
||||
self.assertEquals(flt(d.fields.get(k), 6), expected_values[d.account_head][i])
|
||||
|
||||
self.assertEquals(si.doc.grand_total, 1623)
|
||||
self.assertEquals(si.doc.grand_total_export, 1623)
|
||||
self.assertEquals(si.doc.grand_total, 1622.98)
|
||||
self.assertEquals(si.doc.grand_total_export, 1622.98)
|
||||
|
||||
def test_sales_invoice_calculation_export_currency_with_tax_inclusive_price(self):
|
||||
# prepare
|
||||
@ -215,8 +215,8 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
expected_values = {
|
||||
"keys": ["ref_rate", "adj_rate", "export_rate", "export_amount",
|
||||
"base_ref_rate", "basic_rate", "amount"],
|
||||
"_Test Item Home Desktop 100": [55.56, 10, 50, 500, 2222.11, 1999.9, 19999.0],
|
||||
"_Test Item Home Desktop 200": [187.5, 20, 150, 750, 7375.66, 5900.53, 29502.65],
|
||||
"_Test Item Home Desktop 100": [55.56, 10, 50, 500, 2222.11, 1999.9, 19999.04],
|
||||
"_Test Item Home Desktop 200": [187.5, 20, 150, 750, 7375.66, 5900.53, 29502.66],
|
||||
}
|
||||
|
||||
# check if children are saved
|
||||
@ -229,27 +229,27 @@ class TestSalesInvoice(unittest.TestCase):
|
||||
self.assertEquals(d.fields.get(k), expected_values[d.item_code][i])
|
||||
|
||||
# check net total
|
||||
self.assertEquals(si.doc.net_total, 49501.65)
|
||||
self.assertEquals(si.doc.net_total, 49501.7)
|
||||
self.assertEquals(si.doc.net_total_export, 1250)
|
||||
|
||||
# check tax calculation
|
||||
expected_values = {
|
||||
"keys": ["tax_amount", "total"],
|
||||
"_Test Account Excise Duty - _TC": [5540.22, 55041.87],
|
||||
"_Test Account Education Cess - _TC": [110.81, 55152.68],
|
||||
"_Test Account S&H Education Cess - _TC": [55.4, 55208.08],
|
||||
"_Test Account CST - _TC": [1104.16, 56312.24],
|
||||
"_Test Account VAT - _TC": [6187.71, 62499.95],
|
||||
"_Test Account Customs Duty - _TC": [4950.17, 67450.12],
|
||||
"_Test Account Shipping Charges - _TC": [5000, 72450.12],
|
||||
"_Test Account Discount - _TC": [-7245.01, 65205.11]
|
||||
"_Test Account Excise Duty - _TC": [5540.22, 55041.92],
|
||||
"_Test Account Education Cess - _TC": [110.81, 55152.73],
|
||||
"_Test Account S&H Education Cess - _TC": [55.4, 55208.13],
|
||||
"_Test Account CST - _TC": [1104.16, 56312.29],
|
||||
"_Test Account VAT - _TC": [6187.71, 62500],
|
||||
"_Test Account Customs Duty - _TC": [4950.17, 67450.17],
|
||||
"_Test Account Shipping Charges - _TC": [5000, 72450.17],
|
||||
"_Test Account Discount - _TC": [-7245.01, 65205.16]
|
||||
}
|
||||
|
||||
for d in si.doclist.get({"parentfield": "other_charges"}):
|
||||
for i, k in enumerate(expected_values["keys"]):
|
||||
self.assertEquals(flt(d.fields.get(k), 6), expected_values[d.account_head][i])
|
||||
|
||||
self.assertEquals(si.doc.grand_total, 65205.11)
|
||||
self.assertEquals(si.doc.grand_total, 65205.16)
|
||||
self.assertEquals(si.doc.grand_total_export, 1304.1)
|
||||
|
||||
def test_outstanding(self):
|
||||
|
@ -150,10 +150,10 @@ class SellingController(StockController):
|
||||
cumulated_tax_fraction += tax.tax_fraction_for_current_item
|
||||
|
||||
if cumulated_tax_fraction:
|
||||
item.basic_rate = flt((item.export_rate * self.doc.conversion_rate) /
|
||||
(1 + cumulated_tax_fraction), self.precision("basic_rate", item))
|
||||
|
||||
item.amount = flt(item.basic_rate * item.qty, self.precision("amount", item))
|
||||
item.amount = flt((item.export_amount * self.doc.conversion_rate) /
|
||||
(1 + cumulated_tax_fraction), self.precision("amount", item))
|
||||
|
||||
item.basic_rate = flt(item.amount / item.qty, self.precision("basic_rate", item))
|
||||
|
||||
if item.adj_rate == 100:
|
||||
item.base_ref_rate = item.basic_rate
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
var display_activity_log = function(msg) {
|
||||
if(!pscript.ss_html)
|
||||
pscript.ss_html = $a(cur_frm.fields_dict['activity_log'].wrapper,'div','',{border:'1px solid #CCC', backgroundColor:'#CCC'});
|
||||
pscript.ss_html.innerHTML = '<div style="color:#EEE; background-color:#555;"><b><i>Activity Log:</i><br></b></div>';
|
||||
pscript.ss_html.innerHTML += '<div style="color:#666; padding: 5px">'+ msg + '</div>';
|
||||
pscript.ss_html = $a(cur_frm.fields_dict['activity_log'].wrapper,'div');
|
||||
pscript.ss_html.innerHTML =
|
||||
'<div class="panel"><div class="panel-heading">Activity Log:</div>'+msg+'</div>';
|
||||
}
|
||||
|
||||
//Create salary slip
|
||||
|
@ -66,16 +66,8 @@ class DocType:
|
||||
(cstr(ret), self.doc.employee), raise_exception=1)
|
||||
|
||||
def validate_amount(self):
|
||||
if flt(self.doc.ctc) < 12*flt(self.doc.total_earning):
|
||||
msgprint(_("Annual Cost To Company can not be less than 12 months of Total Earning"),
|
||||
raise_exception=1)
|
||||
|
||||
if flt(self.doc.net_pay) < 0:
|
||||
msgprint(_("Net pay can not be negative"), raise_exception=1)
|
||||
elif flt(self.doc.net_pay)*12 > flt(self.doc.ctc):
|
||||
msgprint(_("Net pay can not be greater than 1/12th of Annual Cost To Company"),
|
||||
raise_exception=1)
|
||||
|
||||
|
||||
def validate(self):
|
||||
self.check_existing()
|
||||
|
@ -2,11 +2,12 @@
|
||||
{
|
||||
"creation": "2013-03-07 18:50:29",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-07-05 14:54:02",
|
||||
"modified": "2013-08-06 17:15:53",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
{
|
||||
"allow_import": 1,
|
||||
"doctype": "DocType",
|
||||
"icon": "icon-file-text",
|
||||
"module": "HR",
|
||||
@ -157,19 +158,6 @@
|
||||
"oldfieldtype": "Date",
|
||||
"read_only": 0
|
||||
},
|
||||
{
|
||||
"description": "Cost to Company",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "ctc",
|
||||
"fieldtype": "Currency",
|
||||
"in_filter": 1,
|
||||
"label": "Annual Cost To Company",
|
||||
"oldfieldname": "ctc",
|
||||
"oldfieldtype": "Currency",
|
||||
"options": "Company:company:default_currency",
|
||||
"read_only": 0,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"fieldname": "company",
|
||||
@ -181,11 +169,11 @@
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"description": "You can create more earning and deduction type from Setup --> HR",
|
||||
"description": "Salary breakup based on Earning and Deduction.",
|
||||
"doctype": "DocField",
|
||||
"fieldname": "earning_deduction",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Earning & Deduction",
|
||||
"label": "Monthly Earning & Deduction",
|
||||
"oldfieldname": "earning_deduction",
|
||||
"oldfieldtype": "Section Break",
|
||||
"read_only": 0
|
||||
|
@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-02-22 01:27:48",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-07-10 14:54:19",
|
||||
"modified": "2013-08-06 17:11:40",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@ -14,7 +14,6 @@
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"in_list_view": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Salary Structure Deduction",
|
||||
"parentfield": "fields",
|
||||
@ -29,6 +28,7 @@
|
||||
"doctype": "DocField",
|
||||
"fieldname": "d_type",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Type",
|
||||
"oldfieldname": "d_type",
|
||||
"oldfieldtype": "Select",
|
||||
@ -41,6 +41,7 @@
|
||||
"doctype": "DocField",
|
||||
"fieldname": "d_modified_amt",
|
||||
"fieldtype": "Currency",
|
||||
"in_list_view": 1,
|
||||
"label": "Amount",
|
||||
"oldfieldname": "d_modified_amt",
|
||||
"oldfieldtype": "Currency",
|
||||
@ -50,7 +51,8 @@
|
||||
"doctype": "DocField",
|
||||
"fieldname": "depend_on_lwp",
|
||||
"fieldtype": "Check",
|
||||
"label": "Depend on LWP",
|
||||
"in_list_view": 0,
|
||||
"label": "Reduce Deduction for Leave Without Pay (LWP)",
|
||||
"oldfieldname": "depend_on_lwp",
|
||||
"oldfieldtype": "Check"
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
{
|
||||
"creation": "2013-02-22 01:27:48",
|
||||
"docstatus": 0,
|
||||
"modified": "2013-07-10 14:54:19",
|
||||
"modified": "2013-08-06 17:11:31",
|
||||
"modified_by": "Administrator",
|
||||
"owner": "Administrator"
|
||||
},
|
||||
@ -16,7 +16,6 @@
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"in_list_view": 1,
|
||||
"name": "__common__",
|
||||
"parent": "Salary Structure Earning",
|
||||
"parentfield": "fields",
|
||||
@ -31,6 +30,7 @@
|
||||
"doctype": "DocField",
|
||||
"fieldname": "e_type",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Type",
|
||||
"oldfieldname": "e_type",
|
||||
"oldfieldtype": "Data",
|
||||
@ -43,6 +43,7 @@
|
||||
"doctype": "DocField",
|
||||
"fieldname": "modified_value",
|
||||
"fieldtype": "Currency",
|
||||
"in_list_view": 1,
|
||||
"label": "Amount",
|
||||
"oldfieldname": "modified_value",
|
||||
"oldfieldtype": "Currency",
|
||||
@ -52,7 +53,8 @@
|
||||
"doctype": "DocField",
|
||||
"fieldname": "depend_on_lwp",
|
||||
"fieldtype": "Check",
|
||||
"label": "Depend on LWP",
|
||||
"in_list_view": 0,
|
||||
"label": "Reduce Earning for Leave Without Pay (LWP)",
|
||||
"oldfieldname": "depend_on_lwp",
|
||||
"oldfieldtype": "Check"
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ def execute(filters=None):
|
||||
ss_earning_map = get_ss_earning_map(salary_slips)
|
||||
ss_ded_map = get_ss_ded_map(salary_slips)
|
||||
|
||||
|
||||
data = []
|
||||
for ss in salary_slips:
|
||||
row = [ss.employee, ss.employee_name, ss.branch, ss.department, ss.designation,
|
||||
|
@ -1,6 +1,7 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import webnotes
|
||||
|
||||
def execute():
|
||||
|
@ -2,17 +2,6 @@
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
wn.provide('erpnext');
|
||||
erpnext.set_about = function() {
|
||||
wn.provide('wn.app');
|
||||
$.extend(wn.app, {
|
||||
name: 'ERPNext',
|
||||
license: 'GNU/GPL - Usage Condition: All "erpnext" branding must be kept as it is',
|
||||
source: 'https://github.com/webnotes/erpnext',
|
||||
publisher: 'Web Notes Technologies Pvt Ltd, Mumbai',
|
||||
copyright: '© Web Notes Technologies Pvt Ltd',
|
||||
version: 'Please see git log for the release number'
|
||||
});
|
||||
}
|
||||
|
||||
wn.modules_path = 'erpnext';
|
||||
|
||||
@ -31,3 +20,24 @@ $(document).bind('toolbar_setup', function() {
|
||||
"white-space": "nowrap"
|
||||
});
|
||||
});
|
||||
|
||||
wn.provide('wn.ui.misc');
|
||||
wn.ui.misc.about = function() {
|
||||
if(!wn.ui.misc.about_dialog) {
|
||||
var d = new wn.ui.Dialog({title:'About ERPNext'})
|
||||
|
||||
$(d.body).html(repl("<div>\
|
||||
<p>ERPNext is an open-source web based ERP made by Web Notes Technologies Pvt Ltd.\
|
||||
to provide an integrated tool to manage most processes in a small organization.\
|
||||
For more information about Web Notes, or to buy hosting servies, go to \
|
||||
<a href='https://erpnext.com'>https://erpnext.com</a>.</p>\
|
||||
<p>To report an issue, go to <a href='https://github.com/webnotes/erpnext/issues'>GitHub Issues</a></p>\
|
||||
<hr>\
|
||||
<p><a href='http://www.gnu.org/copyleft/gpl.html'>License: GNU General Public License Version 3</a></p>\
|
||||
</div>", wn.app));
|
||||
|
||||
wn.ui.misc.about_dialog = d;
|
||||
}
|
||||
|
||||
wn.ui.misc.about_dialog.show();
|
||||
}
|
||||
|
@ -43,7 +43,6 @@ erpnext.startup.start = function() {
|
||||
</div>', { expiry_string: expiry_string, payment_link: payment_link }));
|
||||
}
|
||||
}
|
||||
erpnext.set_about();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,21 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
||||
}
|
||||
},
|
||||
|
||||
onload_post_render: function() {
|
||||
if(this.frm.doc.__islocal && this.frm.doc.company && !this.frm.doc.customer) {
|
||||
var me = this;
|
||||
return this.frm.call({
|
||||
doc: this.frm.doc,
|
||||
method: "onload_post_render",
|
||||
freeze: true,
|
||||
callback: function(r) {
|
||||
// remove this call when using client side mapper
|
||||
me.set_default_values();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
this.frm.clear_custom_buttons();
|
||||
erpnext.hide_naming_series();
|
||||
@ -44,6 +59,17 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
|
||||
this.calculate_taxes_and_totals();
|
||||
},
|
||||
|
||||
set_default_values: function() {
|
||||
$.each(wn.model.get_doclist(this.frm.doctype, this.frm.docname), function(i, doc) {
|
||||
var updated = wn.model.set_default_values(doc);
|
||||
if(doc.parentfield) {
|
||||
refresh_field(doc.parentfield);
|
||||
} else {
|
||||
refresh_field(updated);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
company: function() {
|
||||
if(this.frm.doc.company && this.frm.fields_dict.currency) {
|
||||
if(!this.frm.doc.currency) {
|
||||
|
@ -359,11 +359,11 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
|
||||
});
|
||||
|
||||
if(cumulated_tax_fraction) {
|
||||
item.basic_rate = flt(
|
||||
(item.export_rate * me.frm.doc.conversion_rate) / (1 + cumulated_tax_fraction),
|
||||
precision("basic_rate", item));
|
||||
|
||||
item.amount = flt(item.basic_rate * item.qty, precision("amount", item));
|
||||
item.amount = flt(
|
||||
(item.export_amount * me.frm.doc.conversion_rate) / (1 + cumulated_tax_fraction),
|
||||
precision("amount", item));
|
||||
|
||||
item.basic_rate = flt(item.amount / item.qty, precision("basic_rate", item));
|
||||
|
||||
if(item.adj_rate == 100) {
|
||||
item.base_ref_rate = item.basic_rate;
|
||||
|
@ -115,6 +115,10 @@ class DocType(TransactionBase):
|
||||
reserved_qty_for_main_item = 0
|
||||
|
||||
if obj.doc.doctype == "Sales Order":
|
||||
if (webnotes.conn.get_value("Item", d.item_code, "is_stock_item") == 'Yes' or
|
||||
self.has_sales_bom(d.item_code)) and not d.reserved_warehouse:
|
||||
webnotes.throw(_("Please enter Reserved Warehouse for item ") +
|
||||
d.item_code + _(" as it is stock Item or packing item"))
|
||||
reserved_warehouse = d.reserved_warehouse
|
||||
if flt(d.qty) > flt(d.delivered_qty):
|
||||
reserved_qty_for_main_item = flt(d.qty) - flt(d.delivered_qty)
|
||||
|
@ -49,6 +49,9 @@ def execute_daily():
|
||||
# check reorder level
|
||||
from stock.utils import reorder_item
|
||||
run_fn(reorder_item)
|
||||
|
||||
# scheduler error
|
||||
scheduler.report_errors()
|
||||
|
||||
def execute_weekly():
|
||||
from setup.doctype.backup_manager.backup_manager import take_backups_weekly
|
||||
|
@ -1,6 +1,17 @@
|
||||
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
||||
// License: GNU General Public License v3. See license.txt
|
||||
|
||||
cur_frm.cscript.onload = function(doc) {
|
||||
return wn.call({
|
||||
method: "support.doctype.newsletter.newsletter.get_lead_options",
|
||||
type: "GET",
|
||||
callback: function(r) {
|
||||
set_field_options("lead_source", r.message.sources.join("\n"))
|
||||
set_field_options("lead_status", r.message.statuses.join("\n"))
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
cur_frm.cscript.refresh = function(doc) {
|
||||
erpnext.hide_naming_series();
|
||||
if(!doc.__islocal && !cint(doc.email_sent) && !doc.__unsaved
|
||||
@ -11,18 +22,42 @@ cur_frm.cscript.refresh = function(doc) {
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
cur_frm.cscript.setup_dashboard();
|
||||
|
||||
if(doc.__islocal && !doc.send_from) {
|
||||
cur_frm.set_value("send_from",
|
||||
repl("%(fullname)s <%(email)s>", wn.user_info(doc.owner)));
|
||||
}
|
||||
|
||||
return wn.call({
|
||||
method: "support.doctype.newsletter.newsletter.get_lead_options",
|
||||
type: "GET",
|
||||
callback: function(r) {
|
||||
set_field_options("lead_source", r.message.sources.join("\n"))
|
||||
set_field_options("lead_status", r.message.statuses.join("\n"))
|
||||
}
|
||||
|
||||
cur_frm.cscript.setup_dashboard = function() {
|
||||
cur_frm.dashboard.reset();
|
||||
if(!cur_frm.doc.__islocal && cint(cur_frm.doc.email_sent) && cur_frm.doc.__status_count) {
|
||||
var stat = cur_frm.doc.__status_count;
|
||||
var total = wn.utils.sum($.map(stat, function(v) { return v; }));
|
||||
if(total) {
|
||||
$.each(stat, function(k, v) {
|
||||
stat[k] = flt(v * 100 / total, 2);
|
||||
});
|
||||
|
||||
cur_frm.dashboard.add_progress("Status", [
|
||||
{
|
||||
title: stat["Sent"] + "% Sent",
|
||||
width: stat["Sent"],
|
||||
progress_class: "progress-bar-success"
|
||||
},
|
||||
{
|
||||
title: stat["Sending"] + "% Sending",
|
||||
width: stat["Sending"],
|
||||
progress_class: "progress-bar-warning"
|
||||
},
|
||||
{
|
||||
title: stat["Error"] + "% Error",
|
||||
width: stat["Error"],
|
||||
progress_class: "progress-bar-danger"
|
||||
}
|
||||
]);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
@ -11,6 +11,12 @@ from webnotes import _
|
||||
class DocType():
|
||||
def __init__(self, d, dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
def onload(self):
|
||||
if self.doc.email_sent:
|
||||
self.doc.fields["__status_count"] = dict(webnotes.conn.sql("""select status, count(*)
|
||||
from `tabBulk Email` where ref_doctype=%s and ref_docname=%s
|
||||
group by status""", (self.doc.doctype, self.doc.name))) or None
|
||||
|
||||
def test_send(self, doctype="Lead"):
|
||||
self.recipients = self.doc.test_email_id.split(",")
|
||||
@ -74,7 +80,8 @@ class DocType():
|
||||
|
||||
send(recipients = self.recipients, sender = sender,
|
||||
subject = self.doc.subject, message = self.doc.message,
|
||||
doctype = self.send_to_doctype, email_field = "email_id")
|
||||
doctype = self.send_to_doctype, email_field = "email_id",
|
||||
ref_doctype = self.doc.doctype, ref_docname = self.doc.name)
|
||||
|
||||
webnotes.conn.auto_commit_on_many_writes = False
|
||||
|
||||
@ -91,8 +98,10 @@ class DocType():
|
||||
@webnotes.whitelist()
|
||||
def get_lead_options():
|
||||
return {
|
||||
"sources": ["All"] + webnotes.conn.sql_list("""select distinct source from tabLead"""),
|
||||
"statuses": ["All"]+ webnotes.conn.sql_list("""select distinct status from tabLead""")
|
||||
"sources": ["All"] + filter(None,
|
||||
webnotes.conn.sql_list("""select distinct source from tabLead""")),
|
||||
"statuses": ["All"] + filter(None,
|
||||
webnotes.conn.sql_list("""select distinct status from tabLead"""))
|
||||
}
|
||||
|
||||
|
||||
|
40
utilities/demo_docs/Employee.csv
Normal file
40
utilities/demo_docs/Employee.csv
Normal file
@ -0,0 +1,40 @@
|
||||
Data Import Template,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
Table:,Employee,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
Notes:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
Please do not change the template headings.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
First data column must be blank.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
"For updating, you can update only selective columns.",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
DocType:,Employee,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
Column Labels:,ID,Full Name,Date of Joining,Date of Birth,Gender,Company,Status,Naming Series,Salutation,Image,User ID,Employee Number,Employment Type,Holiday List,Scheduled Confirmation Date,Final Confirmation Date,Contract End Date,Date Of Retirement,Branch,Department,Designation,Grade,Email (By company),Notice - Number of Days,Salary Mode,Bank Name,Bank A/C No.,ESIC CARD No,PF Number,Gratuity LIC ID,Reports to,Cell Number,Personal Email,Person To Be Contacted,Relation,Emergency Phone Number,Permanent Accommodation Type,Permanent Address,Current Accommodation Type,Current Address,Bio,PAN Number,Passport Number,Date of Issue,Valid Upto,Place of Issue,Marital Status,Blood Group,Family Background,Health Details,Resignation Letter Date,Relieving Date,Reason for Leaving,Leave Encashed?,Encashment Date,Held On,Reason for Resignation,New Workplace,Feedback
|
||||
Column Name:,name,employee_name,date_of_joining,date_of_birth,gender,company,status,naming_series,salutation,image,user_id,employee_number,employment_type,holiday_list,scheduled_confirmation_date,final_confirmation_date,contract_end_date,date_of_retirement,branch,department,designation,grade,company_email,notice_number_of_days,salary_mode,bank_name,bank_ac_no,esic_card_no,pf_number,gratuity_lic_id,reports_to,cell_number,personal_email,person_to_be_contacted,relation,emergency_phone_number,permanent_accommodation_type,permanent_address,current_accommodation_type,current_address,bio,pan_number,passport_number,date_of_issue,valid_upto,place_of_issue,marital_status,blood_group,family_background,health_details,resignation_letter_date,relieving_date,reason_for_leaving,leave_encashed,encashment_date,held_on,reason_for_resignation,new_workplace,feedback
|
||||
Mandatory:,Yes,Yes,Yes,Yes,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No
|
||||
Type:,Data (text),Data,Date,Date,Select,Select,Select,Select,Select,Select,Link,Data,Link,Link,Date,Date,Date,Date,Link,Link,Link,Link,Data,Int,Select,Data,Data,Data,Data,Data,Link,Data,Data,Data,Data,Data,Select,Small Text,Select,Small Text,Text Editor,Data,Data,Date,Date,Data,Select,Select,Small Text,Small Text,Date,Date,Data,Select,Date,Date,Select,Data,Small Text
|
||||
Info:,,,,,"One of: Male, Female",Valid Company,"One of: Active, Left",One of: EMP/,"One of: Mr, Ms",One of: attach_files:,Valid Profile,,Valid Employment Type,Valid Holiday List,,,,,Valid Branch,Valid Department,Valid Designation,Valid Grade,,Integer,"One of: Bank, Cash, Cheque",,,,,,Valid Employee,,,,,,"One of: Rented, Owned",,"One of: Rented, Owned",,,,,,,,"One of: Single, Married, Divorced, Widowed","One of: A+, A-, B+, B-, AB+, AB-, O+, O-",,,,,,"One of: Yes, No",,,"One of: Better Prospects, Health Concerns",,
|
||||
Start entering data below this line,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Dikman Shervashidze Shervashidze,10-10-2001,03-01-1982,Female,Wind Power LLC,Active,EMP/,,,DikmanShervashidze@armyspy.com,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Zukutakitoteka ,09-16-1976,03-02-1959,Female,Wind Power LLC,Active,EMP/,,,Zukutakitoteka@teleworm.us,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Hatsue Kashiwagi,06-16-2000,03-03-1982,Female,Wind Power LLC,Active,EMP/,,,HatsueKashiwagi@cuvox.de,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Nuran Verkleij,07-01-1969,04-04-1945,Female,Wind Power LLC,Active,EMP/,,,NuranVerkleij@einrot.com,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Дмитрий Пирогов,12-24-1999,03-05-1978,Male,Wind Power LLC,Active,EMP/,,,aromn@armyspy.com,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Tilde Lindqvist,08-05-1981,03-06-1964,Female,Wind Power LLC,Active,EMP/,,,TildeLindqvist@cuvox.de,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Michał Sobczak,06-10-2006,03-07-1982,Male,Wind Power LLC,Active,EMP/,,,MichalSobczak@teleworm.us,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Gabrielle Loftus,10-21-1993,03-08-1969,Female,Wind Power LLC,Active,EMP/,,,GabrielleLoftus@superrito.com,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Vakhita Ryzaev,09-06-2005,03-09-1982,Male,Wind Power LLC,Active,EMP/,,,VakhitaRyzaev@teleworm.us,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Charmaine Gaudreau,12-25-2007,03-10-1985,Female,Wind Power LLC,Active,EMP/,,,CharmaineGaudreau@cuvox.de,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Rafaëla Maartens,09-02-2002,03-11-1982,Female,Wind Power LLC,Active,EMP/,,,RafaelaMaartens@cuvox.de,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Nuguse Yohannes,08-24-1984,07-12-1966,Male,Wind Power LLC,Active,EMP/,,,NuguseYohannes@dayrep.com,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Раиса Белякова,12-04-2002,03-13-1982,Female,Wind Power LLC,Active,EMP/,,,panca@armyspy.com,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,胤隆 蔡,03-14-2011,06-14-1991,Male,Wind Power LLC,Active,EMP/,,,CaYinLong@gustr.com,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Freddie Scott,12-14-2004,03-15-1982,Male,Wind Power LLC,Active,EMP/,,,FreddieScott@armyspy.com,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Bergþóra Vigfúsdóttir,05-17-2004,03-16-1982,Female,Wind Power LLC,Active,EMP/,,,BergoraVigfusdottir@superrito.com,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Ward Kalb,05-13-1994,03-17-1973,Male,Wind Power LLC,Active,EMP/,,,WardNajmalDinKalb@cuvox.de,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Wan Mai,12-15-2003,09-18-1982,Female,Wind Power LLC,Active,EMP/,,,WanMai@teleworm.us,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Leon Abdulov,03-15-1999,03-19-1982,Male,Wind Power LLC,Active,EMP/,,,LeonAbdulov@superrito.com,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
,,Sabina Novotná,01-25-1991,03-20-1974,Female,Wind Power LLC,Active,EMP/,,,SabinaNovotna@superrito.com,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
|
@ -19,16 +19,16 @@ Mandatory:,Yes,Yes,Yes,No,No
|
||||
Type:,Data (text),Link,Select,Currency,Link
|
||||
Info:,,Valid Price List,"One of: Buying, Selling",,Valid Currency
|
||||
Start entering data below this line,,,,,
|
||||
,Base Bearing Plate,Standard Buying,Buying,750,INR
|
||||
,Base Plate,Standard Buying,Buying,1092,INR
|
||||
,Bearing Block,Standard Buying,Buying,355,INR
|
||||
,Bearing Collar,Standard Buying,Buying,980,INR
|
||||
,Bearing Pipe,Standard Buying,Buying,599,INR
|
||||
,Blade Rib,Standard Buying,Buying,430,INR
|
||||
,Disc Collars,Standard Buying,Buying,3000,INR
|
||||
,External Disc,Standard Buying,Buying,1200,INR
|
||||
,Internal Disc,Standard Buying,Buying,1000,INR
|
||||
,Shaft,Standard Buying,Buying,600,INR
|
||||
,Stand,Standard Buying,Buying,200,INR
|
||||
,Upper Bearing Plate,Standard Buying,Buying,400,INR
|
||||
,Wing Sheet,Standard Buying,Buying,20300,INR
|
||||
,Base Bearing Plate,Standard Buying,Buying,15,USD
|
||||
,Base Plate,Standard Buying,Buying,20,USD
|
||||
,Bearing Block,Standard Buying,Buying,10,USD
|
||||
,Bearing Collar,Standard Buying,Buying,20,USD
|
||||
,Bearing Pipe,Standard Buying,Buying,15,USD
|
||||
,Blade Rib,Standard Buying,Buying,10,USD
|
||||
,Disc Collars,Standard Buying,Buying,74,USD
|
||||
,External Disc,Standard Buying,Buying,45,USD
|
||||
,Internal Disc,Standard Buying,Buying,33,USD
|
||||
,Shaft,Standard Buying,Buying,30,USD
|
||||
,Stand,Standard Buying,Buying,40,USD
|
||||
,Upper Bearing Plate,Standard Buying,Buying,50,USD
|
||||
,Wing Sheet,Standard Buying,Buying,22,USD
|
|
40
utilities/demo_docs/Profile.csv
Normal file
40
utilities/demo_docs/Profile.csv
Normal file
@ -0,0 +1,40 @@
|
||||
Data Import Template,,,,,,,,,,,,,,,,,,,,,
|
||||
Table:,Profile,,,,,,,,,,,,,,,,,,,,
|
||||
,,,,,,,,,,,,,,,,,,,,,
|
||||
,,,,,,,,,,,,,,,,,,,,,
|
||||
Notes:,,,,,,,,,,,,,,,,,,,,,
|
||||
Please do not change the template headings.,,,,,,,,,,,,,,,,,,,,,
|
||||
First data column must be blank.,,,,,,,,,,,,,,,,,,,,,
|
||||
"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,,,,,,,,,,,,,,,,,
|
||||
"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,,,,,,,,,,,,,,,,,
|
||||
Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,,,,,,,,,,,,
|
||||
"For updating, you can update only selective columns.",,,,,,,,,,,,,,,,,,,,,
|
||||
You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,,,,,,,,,,,,
|
||||
,,,,,,,,,,,,,,,,,,,,,
|
||||
DocType:,Profile,,,,,,,,,,,,,,,,,,,,
|
||||
Column Labels:,ID,Email,First Name,User Type,Enabled,Middle Name (Optional),Last Name,Send Invite Email,Language,Birth Date,Gender,New Password,User Image,Background Image,Bio,Email Signature,Login After,Login Before,Restrict IP,Last Login,Last IP
|
||||
Column Name:,name,email,first_name,user_type,enabled,middle_name,last_name,send_invite_email,language,birth_date,gender,new_password,user_image,background_image,bio,email_signature,login_after,login_before,restrict_ip,last_login,last_ip
|
||||
Mandatory:,Yes,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No
|
||||
Type:,Data (text),Data,Data,Select,Check,Data,Data,Check,Select,Date,Select,Password,Select,Select,Small Text,Small Text,Int,Int,Data,Read Only,Read Only
|
||||
Info:,,,,"One of: System User, Website User",0 or 1,,,0 or 1,"One of: العربية, Deutsch, english, español, français, हिंदी, Hrvatski, nederlands, português, português brasileiro, српски, தமிழ், ไทย",,"One of: Male, Female, Other",,One of: attach_files:,One of: attach_files:,,,Integer,Integer,,,
|
||||
Start entering data below this line,,,,,,,,,,,,,,,,,,,,,
|
||||
,,DikmanShervashidze@armyspy.com,Dikman,System User,1,V,Shervashidze,0,,,,testpass,,,,,,,,,
|
||||
,,Zukutakitoteka@teleworm.us,Zukutakitoteka,System User,1,,,0,,,,testpass,,,,,,,,,
|
||||
,,HatsueKashiwagi@cuvox.de,Hatsue,System User,1,H,Kashiwagi,0,,,,testpass,,,,,,,,,
|
||||
,,NuranVerkleij@einrot.com,Nuran,System User,1,T,Verkleij,0,,,,testpass,,,,,,,,,
|
||||
,,aromn@armyspy.com,Дмитрий,System User,1,З,Пирогов,0,,,,testpass,,,,,,,,,
|
||||
,,TildeLindqvist@cuvox.de,Tilde,System User,1,T,Lindqvist,0,,,,testpass,,,,,,,,,
|
||||
,,MichalSobczak@teleworm.us,Michał,System User,1,S,Sobczak,0,,,,testpass,,,,,,,,,
|
||||
,,GabrielleLoftus@superrito.com,Gabrielle,System User,1,J,Loftus,0,,,,testpass,,,,,,,,,
|
||||
,,VakhitaRyzaev@teleworm.us,Vakhita,System User,1,A,Ryzaev,0,,,,testpass,,,,,,,,,
|
||||
,,CharmaineGaudreau@cuvox.de,Charmaine,System User,1,D,Gaudreau,0,,,,testpass,,,,,,,,,
|
||||
,,RafaelaMaartens@cuvox.de,Rafaëla,System User,1,Z,Maartens,0,,,,testpass,,,,,,,,,
|
||||
,,NuguseYohannes@dayrep.com,Nuguse,System User,0,S,Yohannes,0,,,,testpass,,,,,,,,,
|
||||
,,panca@armyspy.com,Раиса,System User,0,В,Белякова,0,,,,testpass,,,,,,,,,
|
||||
,,CaYinLong@gustr.com,胤隆,System User,1,婷,蔡,0,,,,testpass,,,,,,,,,
|
||||
,,FreddieScott@armyspy.com,Freddie,System User,1,A,Scott,0,,,,testpass,,,,,,,,,
|
||||
,,BergoraVigfusdottir@superrito.com,Bergþóra,System User,1,Ö,Vigfúsdóttir,0,,,,testpass,,,,,,,,,
|
||||
,,WardNajmalDinKalb@cuvox.de,Ward,System User,1,N,Kalb,0,,,,testpass,,,,,,,,,
|
||||
,,WanMai@teleworm.us,Wan,System User,1,A,Mai,0,,,,testpass,,,,,,,,,
|
||||
,,LeonAbdulov@superrito.com,Leon,System User,1,A,Abdulov,0,,,,testpass,,,,,,,,,
|
||||
,,SabinaNovotna@superrito.com,Sabina,System User,1,J,Novotná,0,,,,testpass,,,,,,,,,
|
|
25
utilities/demo_docs/Salary_Structure.csv
Normal file
25
utilities/demo_docs/Salary_Structure.csv
Normal file
@ -0,0 +1,25 @@
|
||||
"Data Import Template"
|
||||
"Table:","Salary Structure"
|
||||
""
|
||||
""
|
||||
"Notes:"
|
||||
"Please do not change the template headings."
|
||||
"First data column must be blank."
|
||||
"If you are uploading new records, leave the ""name"" (ID) column blank."
|
||||
"If you are uploading new records, ""Naming Series"" becomes mandatory, if present."
|
||||
"Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish."
|
||||
"For updating, you can update only selective columns."
|
||||
"You can only upload upto 5000 records in one go. (may be less in some cases)"
|
||||
""
|
||||
"DocType:","Salary Structure","","","","","","","","","","","","","","","-","Salary Structure Earning","earning_details","","","-","Salary Structure Deduction","deduction_details","",""
|
||||
"Column Labels:","ID","Last Updated On","Employee","Is Active","From Date","Company","Employee Name","Branch","Designation","Department","Grade","To Date","Total Earning","Total Deduction","Net Pay","-","ID","Type","Amount","Reduce Earning for Leave Without Pay (LWP)","-","ID","Type","Amount","Reduce Deduction for Leave Without Pay (LWP)"
|
||||
"Column Name:","name","modified","employee","is_active","from_date","company","employee_name","branch","designation","department","grade","to_date","total_earning","total_deduction","net_pay","-","name","e_type","modified_value","depend_on_lwp","-","name","d_type","d_modified_amt","depend_on_lwp"
|
||||
"Mandatory:","Yes","Yes","Yes","Yes","Yes","Yes","No","No","No","No","No","No","No","No","No","-","Yes","Yes","No","No","-","Yes","Yes","No","No"
|
||||
"Type:","Data (text)","Data","Link","Select","Date","Select","Data","Select","Select","Select","Select","Date","Currency","Currency","Currency","-","Data","Link","Currency","Check","-","Data","Link","Currency","Check"
|
||||
"Info:","","Don't change!","Valid Employee","One of: Yes, No","","Valid Company","","Valid Branch","Valid Designation","Valid Department","Valid Grade","","","","","-","Leave blank for new records","Valid Earning Type","","0 or 1","-","Leave blank for new records","Valid Deduction Type","","0 or 1"
|
||||
"Start entering data below this line"
|
||||
"","EMP/0001/SST/00001","""2013-08-06 17:07:22""","EMP/0001","Yes","2013-08-06","Wind Power LLC","Dikman Shervashidze Shervashidze","","","","","",5000.0,400.0,4600.0,"","000000154","Basic",5000.0,"","","000000155","Income Tax",400.0,""
|
||||
"","EMP/0002/SST/00001","""2013-08-06 17:07:43""","EMP/0002","Yes","2013-08-06","Wind Power LLC","Zukutakitoteka","","","","","",6700.0,400.0,6300.0,"","000000156","Basic",6700.0,"","","000000157","Income Tax",400.0,""
|
||||
"","EMP/0003/SST/00001","""2013-08-06 17:08:02""","EMP/0003","Yes","2013-08-06","Wind Power LLC","Hatsue Kashiwagi","","","","","",3400.0,400.0,3000.0,"","000000158","Basic",3400.0,"","","000000159","Income Tax",400.0,""
|
||||
"","EMP/0004/SST/00001","""2013-08-06 17:14:39""","EMP/0004","Yes","2013-08-06","Wind Power LLC","Nuran Verkleij","","","","","",6990.0,566.0,6424.0,"","000000160","Basic",6990.0,"","","000000161","Income Tax",566.0,""
|
||||
|
Can't render this file because it has a wrong number of fields in line 2.
|
@ -13,6 +13,7 @@ def make():
|
||||
complete_setup()
|
||||
make_items()
|
||||
make_customers_suppliers_contacts()
|
||||
make_users_and_employees()
|
||||
# make_bom()
|
||||
# make_opening_stock()
|
||||
# make_opening_accounts()
|
||||
@ -32,7 +33,7 @@ def complete_setup():
|
||||
"industry": "Manufacturing",
|
||||
"company_name": "Wind Power LLC",
|
||||
"company_abbr": "WP",
|
||||
"currency": "INR",
|
||||
"currency": "USD",
|
||||
"timezone": "America/New York",
|
||||
"country": "United States"
|
||||
})
|
||||
@ -62,6 +63,20 @@ def make_customers_suppliers_contacts():
|
||||
webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Lead.csv")
|
||||
upload()
|
||||
|
||||
def make_users_and_employees():
|
||||
print "Importing Profile..."
|
||||
webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Profile.csv")
|
||||
upload()
|
||||
webnotes.conn.set_value("HR Settings", None, "emp_created_by", "Naming Series")
|
||||
webnotes.conn.commit()
|
||||
|
||||
print "Importing Employee..."
|
||||
webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Employee.csv")
|
||||
upload()
|
||||
|
||||
print "Importing Salary Structure..."
|
||||
webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", "Salary Structure.csv")
|
||||
upload()
|
||||
|
||||
if __name__=="__main__":
|
||||
make()
|
@ -41,7 +41,7 @@ def get_blog_list(start=0, by=None, category=None):
|
||||
import webnotes.utils
|
||||
|
||||
for res in result:
|
||||
from webnotes.utils import global_date_format, get_fullname
|
||||
from webnotes.utils import global_date_format
|
||||
res['published'] = global_date_format(res['creation'])
|
||||
if not res['content']:
|
||||
res['content'] = webnotes.webutils.get_html(res['page_name'])
|
||||
@ -101,28 +101,11 @@ def add_comment(args=None):
|
||||
doctype='Comment',
|
||||
email_field='comment_by',
|
||||
subject='New Comment on Blog: ' + blog.title,
|
||||
message='%(comment)s<p>By %(comment_by_fullname)s</p>' % args)
|
||||
message='%(comment)s<p>By %(comment_by_fullname)s</p>' % args,
|
||||
ref_doctype='Blog Post', ref_docname=blog.name)
|
||||
|
||||
return comment_html.replace("\n", "")
|
||||
|
||||
@webnotes.whitelist(allow_guest=True)
|
||||
def add_subscriber(name, email_id):
|
||||
"""add blog subscriber to lead"""
|
||||
name = webnotes.conn.sql("""select name from tabLead where email_id=%s""", email)
|
||||
|
||||
from webnotes.model.doc import Document
|
||||
if name:
|
||||
lead = Document('Lead', name[0][0])
|
||||
else:
|
||||
lead = Document('Lead')
|
||||
|
||||
if not lead.source: lead.source = 'Blog'
|
||||
lead.unsubscribed = 0
|
||||
lead.blog_subscriber = 1
|
||||
lead.lead_name = name
|
||||
lead.email_id = email
|
||||
lead.save()
|
||||
|
||||
def get_blog_content(blog_page_name):
|
||||
import webnotes.webutils
|
||||
content = webnotes.webutils.get_html(blog_page_name)
|
||||
|
Loading…
Reference in New Issue
Block a user