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

This commit is contained in:
Nabin Hait 2012-11-06 14:37:35 +05:30
commit 330a0e7cd5
4 changed files with 21 additions and 8 deletions

View File

@ -17,7 +17,17 @@
report.customize_filters = function() {
this.hide_all_filters();
this.add_filter({fieldname:'transaction', label:'Transaction', fieldtype:'Select', options:'Quotation'+NEWLINE+'Sales Order'+NEWLINE+'Delivery Note'+NEWLINE+'Sales Invoice'+NEWLINE+'Purchase Order'+NEWLINE+'Purchase Receipt'+NEWLINE+'Purchase Invoice',report_default:'Delivery Note',ignore : 1,parent:'Profile',in_first_page : 1,single_select : 1});
// hide transaction based on permissions
var all_transactions = ["Quotation", "Sales Order", "Delivery Note", "Sales Invoice",
"Purchase Order", "Purchase Receipt", "Purchase Invoice"];
var transaction_list = [];
$.each(all_transactions, function(i, dt) {
if(wn.boot.profile.can_read.indexOf(dt)!=-1) {
transaction_list.push(dt);
}
});
this.add_filter({fieldname:'transaction', label:'Transaction', fieldtype:'Select', options:transaction_list.join(NEWLINE),report_default:'Delivery Note',ignore : 1,parent:'Profile',in_first_page : 1,single_select : 1});
this.add_filter({fieldname:'period', label:'Period', fieldtype:'Select', options:'Monthly'+NEWLINE+'Quarterly'+NEWLINE+'Half Yearly'+NEWLINE+'Annual',report_default:'Quarterly',ignore : 1, parent:'Profile',in_first_page:1,single_select:1});

View File

@ -63,7 +63,7 @@ cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
var val = getchildren('Expense Claim Detail', doc.name, 'expense_voucher_details', doc.doctype);
var total_claim =0;
for(var i = 0; i<val.length; i++){
if(!doc.claim_amount) val[i].sanctioned_amount = val[i].claim_amount;
val[i].sanctioned_amount = val[i].claim_amount;
total_claim = flt(total_claim)+flt(val[i].claim_amount);
refresh_field('sactioned_amount', val[i].name, 'expense_voucher_details');
}
@ -74,7 +74,6 @@ cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
var val = getchildren('Expense Claim Detail', doc.name, 'expense_voucher_details', doc.doctype);
var total_sanctioned = 0;
for(var i = 0; i<val.length; i++){
if(!doc.claim_amount) val[i].sanctioned_amount = val[i].claim_amount;
total_sanctioned = flt(total_sanctioned)+flt(val[i].sanctioned_amount);
refresh_field('sactioned_amount', val[i].name, 'expense_voucher_details');
@ -97,6 +96,7 @@ cur_frm.cscript.sanctioned_amount = function(doc,cdt,cdn){
wn.require('app/setup/doctype/notification_control/notification_control.js');
cur_frm.cscript.approve = function(doc,cdt,cdn){
cur_frm.cscript.calculate_total(doc,cdt,cdn);
if(user == doc.exp_approver){
var approve_voucher_dialog;
@ -166,6 +166,8 @@ cur_frm.cscript.approve = function(doc,cdt,cdn){
}
cur_frm.cscript.reject = function(doc,cdt,cdn){
cur_frm.cscript.calculate_total(doc,cdt,cdn);
if(user == doc.exp_approver){
var reject_voucher_dialog;

View File

@ -16,7 +16,7 @@ wn.doclistviews['Expense Claim'] = wn.views.ListView.extend({
prepare_data: function(data) {
this._super(data);
data.posting_date = wn.datetime.str_to_user(data.posting_date);
data.employee_name = data.employee_name + 'claimed '
data.employee_name = data.employee_name + ' claimed '
+ wn.boot.company[data.company].default_currency + ' '
+ fmt_money(data.total_claimed_amount);
},

View File

@ -56,10 +56,11 @@ class DocType:
recipients = filter(lambda r: r in valid_users,
self.doc.recipient_list.split("\n"))
from webnotes.utils.email_lib import sendmail
sendmail(recipients=recipients, subject=(self.doc.frequency + " Digest"),
sender="ERPNext Notifications <notifications+email_digest@erpnext.com>",
msg=self.get_digest_msg())
if recipients:
from webnotes.utils.email_lib import sendmail
sendmail(recipients=recipients, subject=(self.doc.frequency + " Digest"),
sender="ERPNext Notifications <notifications+email_digest@erpnext.com>",
msg=self.get_digest_msg())
def get_digest_msg(self):
""""""