Purchase Rcpt in Feed, Grand Total fixed to 2 decimals in sales_common.js
This commit is contained in:
parent
39eff71864
commit
edb45c6ce5
@ -16,6 +16,7 @@ feed_dict = {
|
|||||||
|
|
||||||
# Stock
|
# Stock
|
||||||
'Delivery Note': ['[%(status)s] To %(customer_name)s', '#4169E1'],
|
'Delivery Note': ['[%(status)s] To %(customer_name)s', '#4169E1'],
|
||||||
|
'Purchase Receipt': ['[%(status)s] From %(supplier)s', '#4169E1'],
|
||||||
|
|
||||||
# Accounts
|
# Accounts
|
||||||
'Journal Voucher': ['[%(voucher_type)s] %(name)s', '#4169E1'],
|
'Journal Voucher': ['[%(voucher_type)s] %(name)s', '#4169E1'],
|
||||||
@ -33,38 +34,6 @@ feed_dict = {
|
|||||||
'Support Ticket': ['[%(status)s] %(subject)s', '#000080']
|
'Support Ticket': ['[%(status)s] %(subject)s', '#000080']
|
||||||
}
|
}
|
||||||
|
|
||||||
feed_dict_color = {
|
|
||||||
# Project
|
|
||||||
'Project': '#000080',
|
|
||||||
|
|
||||||
# Sales
|
|
||||||
'Lead': '#000080',
|
|
||||||
'Quotation': '#4169E1',
|
|
||||||
'Sales Order': '#4169E1',
|
|
||||||
|
|
||||||
# Purchase
|
|
||||||
'Supplier': '#6495ED',
|
|
||||||
'Purchase Order': '#4169E1',
|
|
||||||
|
|
||||||
# Stock
|
|
||||||
'Delivery Note': '#4169E1',
|
|
||||||
|
|
||||||
# Accounts
|
|
||||||
'Journal Voucher': '#4169E1',
|
|
||||||
'Payable Voucher': '#4169E1',
|
|
||||||
'Receivable Voucher': '#4169E1',
|
|
||||||
|
|
||||||
# HR
|
|
||||||
'Expense Voucher': '#4169E1',
|
|
||||||
'Salary Slip': '#4169E1',
|
|
||||||
'Leave Transaction': '#4169E1',
|
|
||||||
|
|
||||||
# Support
|
|
||||||
'Customer Issue': '#000080',
|
|
||||||
'Maintenance Visit': '#4169E1',
|
|
||||||
'Support Ticket': '#000080'
|
|
||||||
}
|
|
||||||
|
|
||||||
def make_feed(doc, subject, color):
|
def make_feed(doc, subject, color):
|
||||||
"makes a new Feed record"
|
"makes a new Feed record"
|
||||||
#msgprint(subject)
|
#msgprint(subject)
|
||||||
@ -77,20 +46,6 @@ def make_feed(doc, subject, color):
|
|||||||
f.color = color
|
f.color = color
|
||||||
f.save(1)
|
f.save(1)
|
||||||
|
|
||||||
def update_feed1(doc):
|
|
||||||
"adds a new feed"
|
|
||||||
prop_rec = webnotes.conn.sql("select value from `tabProperty Setter` where doc_type = %s and property = 'subject'", (doc.doctype))
|
|
||||||
if prop_rec:
|
|
||||||
subject = prop_rec[0][0]
|
|
||||||
else:
|
|
||||||
rec = webnotes.conn.sql("select subject from tabDocType where name=%s", (doc.doctype))
|
|
||||||
subject = rec[0][0]
|
|
||||||
|
|
||||||
subject, color = [subject, feed_dict_color.get(doc.doctype)]
|
|
||||||
if subject:
|
|
||||||
subject = subject % doc.fields
|
|
||||||
make_feed(doc, subject, color)
|
|
||||||
|
|
||||||
def update_feed(doc, method=None):
|
def update_feed(doc, method=None):
|
||||||
"adds a new feed"
|
"adds a new feed"
|
||||||
if method=='validate':
|
if method=='validate':
|
||||||
|
@ -251,17 +251,13 @@ cur_frm.cscript.calc_doc_values = function(doc, cdt, cdn, tname, fname, other_fn
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//console.log("Net Total: " + net_total);
|
|
||||||
//console.log("Net Total Incl: " + net_total_incl);
|
|
||||||
//console.log("Other Charges: " + other_charges_total);
|
|
||||||
doc.net_total = inclusive_rate ? flt(net_total_incl) : flt(net_total);
|
doc.net_total = inclusive_rate ? flt(net_total_incl) : flt(net_total);
|
||||||
doc.other_charges_total = flt(other_charges_total);
|
doc.other_charges_total = flt(other_charges_total);
|
||||||
//console.log('In calc doc values');
|
//doc.grand_total = flt(flt(net_total) + flt(other_charges_total));
|
||||||
//console.log(net_total);
|
doc.grand_total = flt((flt(net_total) + flt(other_charges_total)).toFixed(2));
|
||||||
//console.log(other_charges_total);
|
|
||||||
doc.grand_total = flt(flt(net_total) + flt(other_charges_total));
|
|
||||||
doc.rounded_total = Math.round(doc.grand_total);
|
doc.rounded_total = Math.round(doc.grand_total);
|
||||||
doc.grand_total_export = flt(flt(doc.grand_total) / flt(doc.conversion_rate));
|
//doc.grand_total_export = flt(flt(doc.grand_total) / flt(doc.conversion_rate));
|
||||||
|
doc.grand_total_export = flt((flt(doc.grand_total) / flt(doc.conversion_rate)).toFixed(2));
|
||||||
doc.rounded_total_export = Math.round(doc.grand_total_export);
|
doc.rounded_total_export = Math.round(doc.grand_total_export);
|
||||||
doc.total_commission = flt(flt(net_total) * flt(doc.commission_rate) / 100);
|
doc.total_commission = flt(flt(net_total) * flt(doc.commission_rate) / 100);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user