|
|
@@ -53,14 +53,19 @@ $.extend(wn.meta, { |
|
|
|
|
|
|
|
get_print_formats: function(doctype) { |
|
|
|
// if default print format is given, use it |
|
|
|
var print_format_list = []; |
|
|
|
if(locals.DocType[doctype].default_print_format) |
|
|
|
print_format_list.push(locals.DocType[doctype].default_print_format) |
|
|
|
|
|
|
|
var print_format_list = [locals.DocType[doctype].default_print_format || "Standard"]; |
|
|
|
|
|
|
|
$.each(wn.model.get("Print Format", {doc_type: doctype}), function(i, d) { |
|
|
|
print_format_list.push("Standard"); |
|
|
|
|
|
|
|
var print_formats = wn.model.get("Print Format", {doc_type: doctype}) |
|
|
|
.sort(function(a, b) { return (a > b) ? 1 : -1; }); |
|
|
|
$.each(print_formats, function(i, d) { |
|
|
|
if(!in_list(print_format_list, d.name)) |
|
|
|
print_format_list.push(d.name); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return print_format_list; |
|
|
|
}, |
|
|
|
|
|
|
|