Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Nabin Hait 2012-12-17 10:50:13 +05:30
commit 3af7b981fa
7 changed files with 50 additions and 9 deletions

View File

@ -719,7 +719,7 @@ def get_next_date(dt, mcount, day=None):
if not day:
day = getdate(dt).day
if month > 12:
month, year = m-12, y+1
month, year = month-12, year+1
try:
next_month_date = datetime.date(year, month, day)
except:
@ -911,4 +911,4 @@ def get_bank_cash_account(mode_of_payment):
webnotes.msgprint("Default Bank / Cash Account not set in Mode of Payment: %s. Please add a Default Account in Mode of Payment master." % mode_of_payment)
return {
"cash_bank_account": val
}
}

View File

@ -0,0 +1,20 @@
[
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-12-14 10:22:40",
"modified_by": "Administrator",
"modified": "2012-12-14 10:24:16"
},
{
"name": "__common__",
"ref_doctype": "Sales Invoice",
"doctype": "Report",
"is_standard": "Yes",
"query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`status` as \"Status\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.description as \"Description\",\n `tabSales Order Item`.qty as \"Qty:Float\",\n `tabSales Order Item`.billed_qty as \"Billed Qty:Float\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and ifnull(`tabSales Order Item`.billed_qty,0) < ifnull(`tabSales Order Item`.qty,0)\norder by `tabSales Order`.transaction_date asc"
},
{
"name": "Ordered Items To Be Billed",
"doctype": "Report"
}
]

View File

@ -57,17 +57,18 @@ erpnext.startup.start = function() {
var today = dateutil.str_to_obj(wn.boot.server_date);
var expires_on = dateutil.str_to_obj(wn.boot.expires_on);
var diff = dateutil.get_diff(expires_on, today);
var payment_link = "<a href=\"https://erpnext.com/modes-of-payment.html\" target=\"_blank\">See Payment Options.</a>";
if (0 <= diff && diff <= 15) {
var expiry_string = diff==0 ? "today" : repl("in %(diff)s day(s)", { diff: diff });
$('header').append(repl('<div class="expiry-info"> \
Your ERPNext subscription will <b>expire %(expiry_string)s</b>. \
Please renew your subscription to continue using ERPNext \
(and remove this annoying banner). \
</div>', { expiry_string: expiry_string }));
(and remove this annoying banner). %(payment_link)s\
</div>', { expiry_string: expiry_string, payment_link: payment_link }));
} else if (diff < 0) {
$('header').append(repl('<div class="expiry-info"> \
This ERPNext subscription <b>has expired</b>. \
</div>', { expiry_string: expiry_string }));
This ERPNext subscription <b>has expired</b>. %(payment_link)s\
</div>', { expiry_string: expiry_string, payment_link: payment_link }));
}
}
erpnext.set_about();
@ -168,7 +169,7 @@ erpnext.setup_mousetrap = function() {
});
Mousetrap.bind(["command+s", "ctrl+s"], function() {
if(cur_frm)
if(cur_frm && !cur_frm.save_disabled)
cur_frm.save();
else if(wn.container.page.save_action)
wn.container.page.save_action();
@ -179,4 +180,4 @@ erpnext.setup_mousetrap = function() {
// start
$(document).bind('startup', function() {
erpnext.startup.start();
});
});

View File

@ -51,7 +51,7 @@ class DocType:
# -------------------------------------------------------------------
def get_permissions(self,doctype):
import webnotes.model.doctype
doclist = webnotes.model.doctype.get(doctype)
doclist = webnotes.model.doctype.get(doctype).get_parent_doclist()
ptype = [{
'role': perm.role,

View File

@ -0,0 +1,20 @@
[
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-12-14 10:18:14",
"modified_by": "Administrator",
"modified": "2012-12-14 10:19:13"
},
{
"name": "__common__",
"ref_doctype": "Delivery Note",
"doctype": "Report",
"is_standard": "Yes",
"query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`status` as \"Status\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.description as \"Description\",\n `tabSales Order Item`.qty as \"Qty:Float\",\n `tabSales Order Item`.delivered_qty as \"Delivered Qty:Float\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and ifnull(`tabSales Order Item`.delivered_qty,0) < ifnull(`tabSales Order Item`.qty,0)\norder by `tabSales Order`.transaction_date asc"
},
{
"name": "Ordered Items To Be Delivered",
"doctype": "Report"
}
]