Merge pull request #2366 from ankitjavalkarwork/fixprinthideamt

Hide totals in DN, Auto set Bank/Cash acc. in JV
This commit is contained in:
Nabin Hait 2014-11-03 15:38:45 +05:30
commit 11e50a8eee
2 changed files with 15 additions and 10 deletions

View File

@ -213,10 +213,11 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) {
return;
var update_jv_details = function(doc, r) {
$.each(r.message, function(i, d) {
var jvdetail = frappe.model.add_child(doc, "Journal Voucher Detail", "entries");
jvdetail.account = d.account;
jvdetail.balance = d.balance;
var jvdetail = frappe.model.add_child(doc, "Journal Voucher Detail", "entries");
$.each(r, function(i, d) {
var row = frappe.model.add_child(doc, "Journal Voucher Detail", "entries");
row.account = d.account;
row.balance = d.balance;
});
refresh_field("entries");
}
@ -231,7 +232,7 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) {
},
callback: function(r) {
if(r.message) {
update_jv_details(doc, r);
update_jv_details(doc, [r.message]);
}
}
})
@ -245,7 +246,7 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) {
callback: function(r) {
frappe.model.clear_table(doc, "entries");
if(r.message) {
update_jv_details(doc, r);
update_jv_details(doc, r.message);
}
cur_frm.set_value("is_opening", "Yes")
}

View File

@ -52,11 +52,15 @@ class DeliveryNote(SellingController):
else:
df.delete_key("__print_hide")
toggle_print_hide(self.meta, "currency")
item_meta = frappe.get_meta("Delivery Note Item")
for fieldname in ("rate", "amount", "price_list_rate", "discount_percentage"):
toggle_print_hide(item_meta, fieldname)
print_hide_fields = {
"parent": ["grand_total_export", "rounded_total_export", "in_words_export", "currency", "net_total_export"],
"items": ["rate", "amount", "price_list_rate", "discount_percentage"]
}
for key, fieldname in print_hide_fields.items():
for f in fieldname:
toggle_print_hide(self.meta if key == "parent" else item_meta, f)
def get_portal_page(self):
return "shipment" if self.docstatus==1 else None