diff --git a/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt b/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt
index 2fed0c4d9cf..d6255d71e7b 100644
--- a/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt
+++ b/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2011-11-15 17:30:44',
+ 'creation': '2011-12-13 11:02:59',
'docstatus': 0,
- 'modified': '2011-11-16 13:46:05',
+ 'modified': '2011-12-13 13:31:22',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
@@ -14,7 +14,7 @@
{
'doc_type': 'Receivable Voucher',
'doctype': 'Print Format',
- 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n',
+ 'html': '\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n\t\n\t\n
\n',
'module': 'Accounts',
'name': '__common__',
'standard': 'Yes'
diff --git a/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt b/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt
index ea8a9110829..f7d2c6b3870 100644
--- a/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt
+++ b/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2011-11-15 17:30:44',
+ 'creation': '2011-12-13 11:02:59',
'docstatus': 0,
- 'modified': '2011-11-16 13:44:58',
+ 'modified': '2011-12-13 13:37:39',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
@@ -14,7 +14,7 @@
{
'doc_type': 'Receivable Voucher',
'doctype': 'Print Format',
- 'html': '\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n',
+ 'html': '\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n\t\n\t\n
\n',
'module': 'Accounts',
'name': '__common__',
'standard': 'Yes'
diff --git a/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt b/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt
index d466b73be0c..c24cde54648 100644
--- a/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt
+++ b/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2011-11-15 17:30:44',
+ 'creation': '2011-12-13 11:02:59',
'docstatus': 0,
- 'modified': '2011-11-16 14:45:46',
+ 'modified': '2011-12-13 13:39:55',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
@@ -14,7 +14,7 @@
{
'doc_type': 'Receivable Voucher',
'doctype': 'Print Format',
- 'html': '\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n\n',
+ 'html': '\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n\t\n\t\n
\n',
'module': 'Accounts',
'name': '__common__',
'standard': 'Yes'
diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js
index 38acfc9dc29..2a2435b0ad3 100644
--- a/erpnext/accounts/page/accounts_browser/accounts_browser.js
+++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js
@@ -124,7 +124,7 @@ pscript.make_ac_tree = function() {
var imgsrc=null;
var has_children = true;
if(cl[i].group_or_ledger=='Ledger') {
- var imgsrc = 'images/icons/page.gif';
+ var imgsrc = 'lib/images/icons/page.gif';
has_children = false;
}
var t = tree.addNode(n, cl[i].account_name, imgsrc,tree.std_onclick, has_children ? tree.std_onexp : null);
@@ -137,7 +137,7 @@ pscript.make_ac_tree = function() {
var imgsrc=null;
var has_children = true;
if(cl[i].group_or_ledger=='Ledger') {
- var imgsrc = 'images/icons/page.gif';
+ var imgsrc = 'lib/images/icons/page.gif';
has_children = false;
}
var t = tree.addNode(n, cl[i].cost_center_name, imgsrc,tree.std_onclick, has_children ? tree.std_onexp : null);
@@ -254,7 +254,7 @@ pscript.make_group_area = function(type) {
// refresh
ref_btn = $a(pscript.group_area, 'div', '', {fontSize: '14px',marginBottom: '8px', marginTop: '24px', fontWeight: 'bold'});
- ref_btn.innerHTML = '
Refresh Tree';
+ ref_btn.innerHTML = '
Refresh Tree';
ref_btn.onclick= function() {
pscript.cur_node.clear_child_nodes();
pscript.cur_node.expand();
@@ -312,7 +312,7 @@ pscript.make_ledger_area = function() {
//General ledger report link
pscript.gl_rep = $a(pscript.ledger_area, 'div','', {fontSize: '14px',marginBottom: '8px', fontWeight: 'bold'});
- pscript.gl_rep.innerHTML = '
Open Ledger';
+ pscript.gl_rep.innerHTML = '
Open Ledger';
pscript.gl_rep.onclick = function(){ pscript.make_report('gl'); }
//Budget report link
diff --git a/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt b/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt
index bd10b2d3289..604d2d81788 100644
--- a/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt
+++ b/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2011-11-15 17:30:44',
+ 'creation': '2011-12-13 11:02:59',
'docstatus': 0,
- 'modified': '2011-11-15 17:30:44',
+ 'modified': '2011-12-13 13:51:41',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
@@ -14,7 +14,7 @@
{
'doc_type': 'Purchase Order',
'doctype': 'Print Format',
- 'html': '\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n',
+ 'html': '\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n\t\n\t\n
\n',
'module': 'Buying',
'name': '__common__',
'standard': 'Yes'
diff --git a/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt b/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt
index 94c5a3f1d81..f5cafe43351 100644
--- a/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt
+++ b/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2011-11-15 17:30:45',
+ 'creation': '2011-12-13 11:02:59',
'docstatus': 0,
- 'modified': '2011-11-15 17:30:45',
+ 'modified': '2011-12-13 13:53:52',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
@@ -14,7 +14,7 @@
{
'doc_type': 'Purchase Order',
'doctype': 'Print Format',
- 'html': '\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n',
+ 'html': '\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n\t\n\t\n
\n',
'module': 'Buying',
'name': '__common__',
'standard': 'Yes'
diff --git a/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt b/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt
index adb397ab807..70d6961f4d7 100644
--- a/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt
+++ b/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2011-11-15 17:30:45',
+ 'creation': '2011-12-13 11:02:59',
'docstatus': 0,
- 'modified': '2011-11-16 14:45:05',
+ 'modified': '2011-12-13 13:55:23',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
@@ -14,7 +14,7 @@
{
'doc_type': 'Purchase Order',
'doctype': 'Print Format',
- 'html': '\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n\n',
+ 'html': '\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n
\n\n\t\n\t\n
\n\n\t\n\t\n
\n',
'module': 'Buying',
'name': '__common__',
'standard': 'Yes'
diff --git a/erpnext/home/page/dashboard/dashboard.js b/erpnext/home/page/dashboard/dashboard.js
index 08be0af675c..aac42a3e3b8 100644
--- a/erpnext/home/page/dashboard/dashboard.js
+++ b/erpnext/home/page/dashboard/dashboard.js
@@ -10,8 +10,20 @@ pscript.onload_dashboard = function() {
pscript.dashboard_settings = {
company: sys_defaults.company,
- start: dateutil.obj_to_str(dateutil.add_days(new Date(), -180)),
- end: dateutil.obj_to_str(new Date()),
+ start: (function() {
+ var start_date = dateutil.add_days(new Date(), -180);
+ var year_start_date = dateutil.str_to_obj(sys_defaults.year_start_date);
+ if (start_date < year_start_date) { start_date = year_start_date; }
+ console.log(start_date);
+ return dateutil.obj_to_str(start_date);
+ })(),
+ end: (function() {
+ var end_date = new Date();
+ var year_end_date = dateutil.str_to_obj(sys_defaults.year_end_date);
+ if (end_date > year_end_date) { end_date = year_end_date; }
+ console.log(end_date);
+ return dateutil.obj_to_str(end_date);
+ })(),
interval: 30
}
diff --git a/erpnext/home/page/dashboard/dashboard.py b/erpnext/home/page/dashboard/dashboard.py
index 9ead6d688d5..c2378d3155e 100644
--- a/erpnext/home/page/dashboard/dashboard.py
+++ b/erpnext/home/page/dashboard/dashboard.py
@@ -133,19 +133,27 @@ class DashboardWidget:
webnotes.msgprint('Wrongly defined account: ' + acc)
print acc
raise e
-
- return self.glc.get_as_on_balance(acc, self.get_fiscal_year(start), start, debit_or_credit, lft, rgt)
+
+ fiscal_year = self.get_fiscal_year(start)
+ if fiscal_year:
+ return self.glc.get_as_on_balance(acc, fiscal_year, start, debit_or_credit, lft, rgt)
+ else:
+ webnotes.msgprint('Please select the START DATE and END DATE such that\
+ they fall within fiscal year(s) as defined in\
+ Setup > System > Fiscal Year.', raise_exception=1)
+
def get_fiscal_year(self, dt):
"""
get fiscal year from date
"""
import webnotes
- return webnotes.conn.sql("""
+ fiscal_year = webnotes.conn.sql("""
select name from `tabFiscal Year`
where year_start_date <= %s and
DATE_ADD(year_start_date, INTERVAL 1 YEAR) >= %s
- """, (dt, dt))[0][0]
+ """, (dt, dt))
+ return fiscal_year and (fiscal_year[0] and fiscal_year[0][0]) or None
def get_creation_trend(self, doctype, start, end):
"""
@@ -257,4 +265,4 @@ if __name__=='__main__':
"start": "2011-05-01",
"end": "2011-08-01",
"interval": "7"
- }""")
\ No newline at end of file
+ }""")
diff --git a/erpnext/patches/deploy_email_digest.py b/erpnext/patches/deploy_email_digest.py
new file mode 100644
index 00000000000..1dd97e32498
--- /dev/null
+++ b/erpnext/patches/deploy_email_digest.py
@@ -0,0 +1,75 @@
+import webnotes
+
+def execute():
+ """
+ * Reload email_digest doctype
+ * Create default email digest
+ """
+ from webnotes.modules.module_manager import reload_doc
+
+ # Minor fix in print_format doctype
+ #reload_doc('core', 'doctype', 'print_format')
+
+ reload_doc('setup', 'doctype', 'email_digest')
+
+ global create_default_email_digest
+ create_default_email_digest()
+
+
+def create_default_email_digest():
+ """
+ * Weekly Digest
+ * For all companies
+ * Recipients: System Managers
+ * Full content
+ * Disabled by default
+ """
+ from webnotes.model.doc import Document
+ companies_list = webnotes.conn.sql("SELECT company_name FROM `tabCompany`", as_list=1)
+ global get_system_managers
+ system_managers = get_system_managers()
+ for company in companies_list:
+ if company and company[0]:
+ edigest = Document('Email Digest')
+ edigest.name = "Default Weekly Digest - " + company[0]
+ edigest.company = company[0]
+ edigest.frequency = 'Weekly'
+ edigest.recipient_list = system_managers
+ edigest.new_leads = 1
+ edigest.new_enquiries = 1
+ edigest.new_quotations = 1
+ edigest.new_sales_orders = 1
+ edigest.new_purchase_orders = 1
+ edigest.new_transactions = 1
+ edigest.payables = 1
+ edigest.payments = 1
+ edigest.expenses_booked = 1
+ edigest.invoiced_amount = 1
+ edigest.collections = 1
+ edigest.income = 1
+ edigest.bank_balance = 1
+ exists = webnotes.conn.sql("""\
+ SELECT name FROM `tabEmail Digest`
+ WHERE name = %s""", edigest.name)
+ if (exists and exists[0]) and exists[0][0]:
+ continue
+ else:
+ edigest.save(1)
+
+
+def get_system_managers():
+ """
+ Returns a string of system managers' email addresses separated by \n
+ """
+ system_managers_list = webnotes.conn.sql("""\
+ SELECT DISTINCT p.name
+ FROM tabUserRole ur, tabProfile p
+ WHERE
+ ur.parent = p.name AND
+ ur.role='System Manager' AND
+ p.docstatus<2 AND
+ p.enabled=1 AND
+ p.name not in ('Administrator', 'Guest')""", as_list=1)
+
+ return "\n".join([sysman[0] for sysman in system_managers_list])
+
diff --git a/erpnext/patches/install_print_formats.py b/erpnext/patches/install_print_formats.py
index 3b5627bba06..40a008ecfc9 100644
--- a/erpnext/patches/install_print_formats.py
+++ b/erpnext/patches/install_print_formats.py
@@ -53,7 +53,7 @@ def execute():
Install print formats
"""
from webnotes.modules.module_manager import reload_doc
- #reload_doc('core', 'doctype', 'print_format')
+ reload_doc('core', 'doctype', 'print_format')
#copy_doctype_to_pfs()
global pf_to_install
diff --git a/erpnext/patches/print_formats/DeliveryNoteClassic.html b/erpnext/patches/print_formats/DeliveryNoteClassic.html
index 0db80b9daba..64475d64d48 100644
--- a/erpnext/patches/print_formats/DeliveryNoteClassic.html
+++ b/erpnext/patches/print_formats/DeliveryNoteClassic.html
@@ -112,16 +112,25 @@
null,
{
'description' : function(data_row) {
- if(data_row.serial_no) {
- return (
- data_row.description +
- 'Serial No.:' +
- ((data_row.serial_no.indexOf('\n')>-1)?'
':' ') +
- data_row.serial_no + '
'
- );
- } else {
- return data_row.description;
+ var to_append = ''
+ if(data_row.adj_rate){
+ to_append = 'Discount: ' +
+ data_row.adj_rate + '%
';
+ if(data_row.description.indexOf(to_append)==-1) {
+ data_row.description = data_row.description + to_append;
+ }
}
+
+ if(data_row.serial_no) {
+ to_append = 'Serial No.:' +
+ ((data_row.serial_no.indexOf('\n')>-1)?'
':' ') +
+ data_row.serial_no + '
';
+ if(data_row.description.indexOf(to_append)==-1) {
+ data_row.description = data_row.description + to_append;
+ }
+ }
+
+ return data_row.description;
}
}
);
@@ -176,7 +185,7 @@
-->