brotherton-erpnext/erpnext/stock/report/stock_ledger/stock_ledger.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

100 lines
2.2 KiB
JavaScript
Raw Normal View History

// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
2014-02-14 10:17:51 +00:00
frappe.query_reports["Stock Ledger"] = {
"filters": [
{
"fieldname":"company",
2014-04-14 10:55:30 +00:00
"label": __("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_user_default("Company"),
"reqd": 1
},
{
"fieldname":"from_date",
2014-04-14 10:55:30 +00:00
"label": __("From Date"),
"fieldtype": "Date",
2014-02-14 10:17:51 +00:00
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
"reqd": 1
},
{
"fieldname":"to_date",
2014-04-14 10:55:30 +00:00
"label": __("To Date"),
"fieldtype": "Date",
2014-02-14 10:17:51 +00:00
"default": frappe.datetime.get_today(),
"reqd": 1
},
{
"fieldname":"warehouse",
2014-04-14 10:55:30 +00:00
"label": __("Warehouse"),
"fieldtype": "Link",
"options": "Warehouse",
"get_query": function() {
const company = frappe.query_report.get_filter_value('company');
feat: Immutable ledger (#18740) * fix: Reverse GL entry on cancellation of document * fix: Removed set posting time field for multiple docs * fix: Stop future reposting and reverse entry for purchase receipt and delivery note * fix: Change is_cancelled field from select to check * Revert "fix: Removed set posting time field for multiple docs" This reverts commit 81fb808db7da69ab1e58ba226c0cd0b77e5b90c8. * fix: Multiple fixes in GL Entry * fix: Remove future reporting from doctypes * fix: Canceled entry filters in Stock Ledger and General Ledger Report * fix: Remove print statement * fix: Validation for back dated entries * fix: Codacy fixes * fix: Add ignore links to multiple doctypes * fix: Codacy Fixes * fix: Ignore GL Entry and Stock Ledger entry while cancel * fix: Test case fixes * fix: Patch * fix: Codacy * fix: Budget Test Cases * fix: Patch * fix: Patch * fix: Multiple test cases * fix: changes in make_reverse_entry function * fix: Update patch * fix: Test Cases * fix: Test Case fixes * fix: Move patch upward in patches.txt * fix: Budget Test Cases * fix: Test Case and codacy * fix: Patch * fix: Minor label and UX fixes * fix: Move freezing date check * fix: Test Cases * fix: Test cases * fix: Test Cases * fix: Test Case * fix: Remove update_gl_entries_after function * fix: Remove update_gl_entries_after function * fix: Test Cases * fix: Fiscal Year wise backdated entry * fix: Update entries only for current SLE * fix: Remove is_cancelled * fix: Test Cases * fix: Test cases * fix: Test Cases * fix: Uncomment account and stock balance sync logic * fix: Stock balance and Account balance out of sync fixes * fix: Test Cases * fix: Test cases for POS, Stock Reco and Purchase Receipt * fix: Stock Reco tests * fix: Test stock reco precision * fix: Test stock reco for fifo precision * fix: Test stock reco for fifo precision * fix: Stock Entry test case Co-authored-by: Nabin Hait <nabinhait@gmail.com>
2020-04-30 05:08:58 +00:00
return {
filters: { 'company': company }
}
}
},
{
"fieldname":"item_code",
2014-04-14 10:55:30 +00:00
"label": __("Item"),
"fieldtype": "Link",
"options": "Item",
"get_query": function() {
return {
query: "erpnext.controllers.queries.item_query"
}
}
},
{
"fieldname":"item_group",
"label": __("Item Group"),
"fieldtype": "Link",
"options": "Item Group"
},
{
"fieldname":"batch_no",
"label": __("Batch No"),
"fieldtype": "Link",
"options": "Batch"
},
{
"fieldname":"brand",
2014-04-14 10:55:30 +00:00
"label": __("Brand"),
"fieldtype": "Link",
"options": "Brand"
},
{
"fieldname":"voucher_no",
2014-04-14 10:55:30 +00:00
"label": __("Voucher #"),
"fieldtype": "Data"
},
{
"fieldname":"project",
"label": __("Project"),
"fieldtype": "Link",
"options": "Project"
},
{
"fieldname":"include_uom",
"label": __("Include UOM"),
"fieldtype": "Link",
"options": "UOM"
}
],
"formatter": function (value, row, column, data, default_formatter) {
value = default_formatter(value, row, column, data);
if (column.fieldname == "out_qty" && data && data.out_qty < 0) {
value = "<span style='color:red'>" + value + "</span>";
}
else if (column.fieldname == "in_qty" && data && data.in_qty > 0) {
value = "<span style='color:green'>" + value + "</span>";
}
return value;
},
2022-06-22 06:54:08 +00:00
};
erpnext.utils.add_inventory_dimensions('Stock Ledger', 10);