Advertisement
Guest User

Filters in General Ledger

a guest
Jan 28th, 2014
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     filters: [
  2.         {fieldtype:"Select", label: wn._("Company"), link:"Company", default_value: wn._("Select Company..."),
  3.             filter: function(val, item, opts) {
  4.                 return item.company == val || val == opts.default_value;
  5.             }},
  6.         {fieldtype:"Link", label: wn._("Account"), link:"Account",
  7.             filter: function(val, item, opts, me) {
  8.                 if(!val) {
  9.                     return true;
  10.                 } else {
  11.                     // true if GL Entry belongs to selected
  12.                     // account ledger or group
  13.                     return me.is_child_account(val, item.account);
  14.                 }
  15.             }},
  16.         {fieldtype:"Data", label: wn._("Voucher No"),
  17.             filter: function(val, item, opts) {
  18.                 if(!val) return true;
  19.                 return (item.voucher_no && item.voucher_no.indexOf(val)!=-1);
  20.             }},
  21.         {fieldtype:"Date", label: wn._("From Date"), filter: function(val, item) {
  22.             return dateutil.str_to_obj(val) <= dateutil.str_to_obj(item.posting_date);
  23.         }},
  24.         {fieldtype:"Label", label: wn._("To")},
  25.         {fieldtype:"Date", label: wn._("To Date"), filter: function(val, item) {
  26.             return dateutil.str_to_obj(val) >= dateutil.str_to_obj(item.posting_date);
  27.         }},
  28.         {fieldtype: "Check", label: wn._("Group by Ledger")},
  29.         {fieldtype: "Check", label: wn._("Group by Voucher")},
  30.         {fieldtype:"Button", label: wn._("Refresh"), icon:"icon-refresh icon-white", cssClass:"btn-info"},
  31.         {fieldtype:"Button", label: wn._("Reset Filters")}
  32.     ],
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement