mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 07:54:46 +00:00
Merge branch 'develop' of https://github.com/frappe/erpnext into sla_fix
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe, json
|
import frappe, json
|
||||||
from frappe.utils import add_to_date, date_diff, getdate, nowdate, get_last_day
|
from frappe.utils import add_to_date, date_diff, getdate, nowdate, get_last_day, formatdate
|
||||||
from erpnext.accounts.report.general_ledger.general_ledger import execute
|
from erpnext.accounts.report.general_ledger.general_ledger import execute
|
||||||
from frappe.core.page.dashboard.dashboard import cache_source, get_from_date_from_timespan
|
from frappe.core.page.dashboard.dashboard import cache_source, get_from_date_from_timespan
|
||||||
from frappe.desk.doctype.dashboard_chart.dashboard_chart import get_period_ending
|
from frappe.desk.doctype.dashboard_chart.dashboard_chart import get_period_ending
|
||||||
@@ -37,7 +37,7 @@ def get(chart_name=None, from_date = None, to_date = None):
|
|||||||
result = build_result(account, dates, gl_entries)
|
result = build_result(account, dates, gl_entries)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"labels": [r[0].strftime('%Y-%m-%d') for r in result],
|
"labels": [formatdate(r[0].strftime('%Y-%m-%d')) for r in result],
|
||||||
"datasets": [{
|
"datasets": [{
|
||||||
"name": account,
|
"name": account,
|
||||||
"values": [r[1] for r in result]
|
"values": [r[1] for r in result]
|
||||||
|
|||||||
@@ -602,7 +602,7 @@ erpnext.patches.v11_1.set_salary_details_submittable
|
|||||||
erpnext.patches.v11_1.rename_depends_on_lwp
|
erpnext.patches.v11_1.rename_depends_on_lwp
|
||||||
execute:frappe.delete_doc("Report", "Inactive Items")
|
execute:frappe.delete_doc("Report", "Inactive Items")
|
||||||
erpnext.patches.v11_1.delete_scheduling_tool
|
erpnext.patches.v11_1.delete_scheduling_tool
|
||||||
erpnext.patches.v12_0.make_custom_fields_for_bank_remittance
|
erpnext.patches.v12_0.make_custom_fields_for_bank_remittance #14-06-2019
|
||||||
execute:frappe.delete_doc_if_exists("Page", "support-analytics")
|
execute:frappe.delete_doc_if_exists("Page", "support-analytics")
|
||||||
erpnext.patches.v12_0.make_item_manufacturer
|
erpnext.patches.v12_0.make_item_manufacturer
|
||||||
erpnext.patches.v12_0.set_priority_for_support
|
erpnext.patches.v12_0.set_priority_for_support
|
||||||
|
|||||||
@@ -2,16 +2,13 @@
|
|||||||
// MIT License. See license.txt
|
// MIT License. See license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Website Theme', {
|
frappe.ui.form.on('Website Theme', {
|
||||||
apply_custom_theme(frm) {
|
validate(frm) {
|
||||||
let custom_theme = frm.doc.custom_theme;
|
let theme_scss = frm.doc.theme_scss;
|
||||||
custom_theme = custom_theme.split('\n');
|
if (theme_scss.includes('frappe/public/scss/website')
|
||||||
if (
|
&& !theme_scss.includes('erpnext/public/scss/website')
|
||||||
frm.doc.apply_custom_theme
|
|
||||||
&& custom_theme.length === 2
|
|
||||||
&& custom_theme[1].includes('frappe/public/scss/website')
|
|
||||||
) {
|
) {
|
||||||
frm.set_value('custom_theme',
|
frm.set_value('theme_scss',
|
||||||
`$primary: #7575ff;\n@import "frappe/public/scss/website";\n@import "erpnext/public/scss/website";`);
|
`${frm.doc.theme_scss}\n@import "erpnext/public/scss/website";`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ def make_custom_fields(update=True):
|
|||||||
],
|
],
|
||||||
'Company': [
|
'Company': [
|
||||||
dict(fieldname='hra_section', label='HRA Settings',
|
dict(fieldname='hra_section', label='HRA Settings',
|
||||||
fieldtype='Section Break', insert_after='asset_received_but_not_billed'),
|
fieldtype='Section Break', insert_after='asset_received_but_not_billed', collapsible=1),
|
||||||
dict(fieldname='basic_component', label='Basic Component',
|
dict(fieldname='basic_component', label='Basic Component',
|
||||||
fieldtype='Link', options='Salary Component', insert_after='hra_section'),
|
fieldtype='Link', options='Salary Component', insert_after='hra_section'),
|
||||||
dict(fieldname='hra_component', label='HRA Component',
|
dict(fieldname='hra_component', label='HRA Component',
|
||||||
|
|||||||
@@ -779,6 +779,17 @@ class POSCart {
|
|||||||
|
|
||||||
const customer = this.frm.doc.customer;
|
const customer = this.frm.doc.customer;
|
||||||
this.customer_field.set_value(customer);
|
this.customer_field.set_value(customer);
|
||||||
|
|
||||||
|
if (this.numpad) {
|
||||||
|
const disable_btns = this.disable_numpad_control()
|
||||||
|
const enable_btns = [__('Rate'), __('Disc')]
|
||||||
|
|
||||||
|
if (disable_btns) {
|
||||||
|
enable_btns.filter(btn => !disable_btns.includes(btn))
|
||||||
|
}
|
||||||
|
|
||||||
|
this.numpad.enable_buttons(enable_btns);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get_grand_total() {
|
get_grand_total() {
|
||||||
@@ -1551,6 +1562,16 @@ class NumberPad {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enable_buttons(btns) {
|
||||||
|
btns.forEach((btn) => {
|
||||||
|
const $btn = this.get_btn(btn);
|
||||||
|
$btn.prop("disabled", false)
|
||||||
|
$btn.hover(() => {
|
||||||
|
$btn.css('cursor','pointer');
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
set_class() {
|
set_class() {
|
||||||
for (const btn in this.add_class) {
|
for (const btn in this.add_class) {
|
||||||
const class_name = this.add_class[btn];
|
const class_name = this.add_class[btn];
|
||||||
|
|||||||
@@ -170,9 +170,10 @@
|
|||||||
"label": "Company Description"
|
"label": "Company Description"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"collapsible": 1,
|
||||||
"fieldname": "sales_settings",
|
"fieldname": "sales_settings",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"label": "Sales"
|
"label": "Sales Settings"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "sales_monthly_history",
|
"fieldname": "sales_monthly_history",
|
||||||
@@ -530,6 +531,7 @@
|
|||||||
"options": "Account"
|
"options": "Account"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"collapsible": 1,
|
||||||
"fieldname": "fixed_asset_depreciation_settings",
|
"fieldname": "fixed_asset_depreciation_settings",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"label": "Fixed Asset Depreciation Settings"
|
"label": "Fixed Asset Depreciation Settings"
|
||||||
@@ -602,6 +604,7 @@
|
|||||||
"options": "Role"
|
"options": "Role"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"collapsible": 1,
|
||||||
"description": "For reference only.",
|
"description": "For reference only.",
|
||||||
"fieldname": "company_info",
|
"fieldname": "company_info",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
@@ -708,7 +711,7 @@
|
|||||||
"icon": "fa fa-building",
|
"icon": "fa fa-building",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"image_field": "company_logo",
|
"image_field": "company_logo",
|
||||||
"modified": "2019-06-13 18:03:14.764423",
|
"modified": "2019-06-14 14:36:11.363309",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "Company",
|
"name": "Company",
|
||||||
|
|||||||
@@ -13,8 +13,11 @@ from erpnext.utilities.product import get_price, get_qty_in_stock
|
|||||||
def get_product_info_for_website(item_code):
|
def get_product_info_for_website(item_code):
|
||||||
"""get product price / stock info for website"""
|
"""get product price / stock info for website"""
|
||||||
|
|
||||||
cart_quotation = _get_cart_quotation()
|
|
||||||
cart_settings = get_shopping_cart_settings()
|
cart_settings = get_shopping_cart_settings()
|
||||||
|
if not cart_settings.enabled:
|
||||||
|
return frappe._dict()
|
||||||
|
|
||||||
|
cart_quotation = _get_cart_quotation()
|
||||||
|
|
||||||
price = get_price(
|
price = get_price(
|
||||||
item_code,
|
item_code,
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
/* eslint-disable */
|
||||||
|
|
||||||
|
frappe.query_reports["Delayed Item Report"] = {
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
fieldname: "company",
|
||||||
|
label: __("Company"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Company",
|
||||||
|
default: frappe.defaults.get_default("company"),
|
||||||
|
reqd: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"from_date",
|
||||||
|
label: __("From Date"),
|
||||||
|
fieldtype: "Date",
|
||||||
|
default: frappe.datetime.month_start(),
|
||||||
|
reqd: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"to_date",
|
||||||
|
label: __("To Date"),
|
||||||
|
fieldtype: "Date",
|
||||||
|
default: frappe.datetime.now_date(),
|
||||||
|
reqd: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"sales_order",
|
||||||
|
label: __("Sales Order"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Sales Order",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"customer",
|
||||||
|
label: __("Customer"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Customer",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"customer_group",
|
||||||
|
label: __("Customer Group"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Customer Group",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"item_group",
|
||||||
|
label: __("Item Group"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Item Group",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"based_on",
|
||||||
|
label: __("Based On"),
|
||||||
|
fieldtype: "Select",
|
||||||
|
options: ["Delivery Note", "Sales Invoice"],
|
||||||
|
default: "Delivery Note",
|
||||||
|
reqd: 1
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"add_total_row": 0,
|
||||||
|
"creation": "2019-06-17 12:45:07.324014",
|
||||||
|
"disable_prepared_report": 0,
|
||||||
|
"disabled": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "Report",
|
||||||
|
"idx": 0,
|
||||||
|
"is_standard": "Yes",
|
||||||
|
"letter_head": "Gadgets International",
|
||||||
|
"modified": "2019-06-17 12:45:07.324014",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Stock",
|
||||||
|
"name": "Delayed Item Report",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"prepared_report": 0,
|
||||||
|
"ref_doctype": "Delivery Note",
|
||||||
|
"report_name": "Delayed Item Report",
|
||||||
|
"report_type": "Script Report",
|
||||||
|
"roles": [
|
||||||
|
{
|
||||||
|
"role": "Accounts User"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Sales User"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Stock Manager"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Stock User"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Maintenance User"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
168
erpnext/stock/report/delayed_item_report/delayed_item_report.py
Normal file
168
erpnext/stock/report/delayed_item_report/delayed_item_report.py
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
from frappe import _
|
||||||
|
from frappe.utils import date_diff
|
||||||
|
|
||||||
|
def execute(filters=None, consolidated = False):
|
||||||
|
data, columns = DelayedItemReport(filters).run()
|
||||||
|
|
||||||
|
return data, columns
|
||||||
|
|
||||||
|
class DelayedItemReport(object):
|
||||||
|
def __init__(self, filters=None):
|
||||||
|
self.filters = frappe._dict(filters or {})
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
return self.get_columns(), self.get_data() or []
|
||||||
|
|
||||||
|
def get_data(self, consolidated=False):
|
||||||
|
conditions = ""
|
||||||
|
|
||||||
|
doctype = self.filters.get("based_on")
|
||||||
|
child_doc= "%s Item" % doctype
|
||||||
|
|
||||||
|
if doctype == "Sales Invoice":
|
||||||
|
conditions = " and `tabSales Invoice`.update_stock = 1 and `tabSales Invoice`.is_pos = 0"
|
||||||
|
|
||||||
|
if self.filters.get("item_group"):
|
||||||
|
conditions += " and `tab%s`.item_group = %s" % (child_doc,
|
||||||
|
frappe.db.escape(self.filters.get("item_group")))
|
||||||
|
|
||||||
|
for field in ["customer", "customer_group", "company"]:
|
||||||
|
if self.filters.get(field):
|
||||||
|
conditions += " and `tab%s`.%s = %s" % (doctype,
|
||||||
|
field, frappe.db.escape(self.filters.get(field)))
|
||||||
|
|
||||||
|
sales_order_field = "against_sales_order"
|
||||||
|
if doctype == "Sales Invoice":
|
||||||
|
sales_order_field = "sales_order"
|
||||||
|
|
||||||
|
if self.filters.get("sales_order"):
|
||||||
|
conditions = " and `tab%s`.%s = '%s'" %(child_doc, sales_order_field, self.filters.get("sales_order"))
|
||||||
|
|
||||||
|
self.transactions = frappe.db.sql(""" SELECT `tab{child_doc}`.item_code, `tab{child_doc}`.item_name,
|
||||||
|
`tab{child_doc}`.item_group, `tab{child_doc}`.qty, `tab{child_doc}`.rate, `tab{child_doc}`.amount,
|
||||||
|
`tab{child_doc}`.so_detail, `tab{child_doc}`.{so_field} as sales_order,
|
||||||
|
`tab{doctype}`.customer, `tab{doctype}`.posting_date, `tab{doctype}`.name, `tab{doctype}`.grand_total
|
||||||
|
FROM `tab{child_doc}`, `tab{doctype}`
|
||||||
|
WHERE
|
||||||
|
`tab{child_doc}`.parent = `tab{doctype}`.name and `tab{doctype}`.docstatus = 1 and
|
||||||
|
`tab{doctype}`.posting_date between %(from_date)s and %(to_date)s and
|
||||||
|
`tab{child_doc}`.{so_field} is not null and `tab{child_doc}`.{so_field} != '' {cond}
|
||||||
|
""".format(cond=conditions, doctype=doctype, child_doc=child_doc, so_field=sales_order_field), {
|
||||||
|
'from_date': self.filters.get('from_date'),
|
||||||
|
'to_date': self.filters.get('to_date')
|
||||||
|
}, as_dict=1)
|
||||||
|
|
||||||
|
if self.transactions:
|
||||||
|
self.filter_transactions_data(consolidated)
|
||||||
|
|
||||||
|
return self.transactions
|
||||||
|
|
||||||
|
def filter_transactions_data(self, consolidated=False):
|
||||||
|
sales_orders = [d.sales_order for d in self.transactions]
|
||||||
|
doctype = "Sales Order"
|
||||||
|
filters = {'name': ('in', sales_orders)}
|
||||||
|
|
||||||
|
if not consolidated:
|
||||||
|
sales_order_items = [d.so_detail for d in self.transactions]
|
||||||
|
doctype = "Sales Order Item"
|
||||||
|
filters = {'parent': ('in', sales_orders), 'name': ('in', sales_order_items)}
|
||||||
|
|
||||||
|
so_data = {}
|
||||||
|
for d in frappe.get_all(doctype, filters = filters,
|
||||||
|
fields = ["delivery_date", "parent", "name"]):
|
||||||
|
key = d.name if consolidated else (d.parent, d.name)
|
||||||
|
if key not in so_data:
|
||||||
|
so_data.setdefault(key, d.delivery_date)
|
||||||
|
|
||||||
|
for row in self.transactions:
|
||||||
|
key = row.sales_order if consolidated else (row.sales_order, row.so_detail)
|
||||||
|
row.update({
|
||||||
|
'delivery_date': so_data.get(key),
|
||||||
|
'delayed_days': date_diff(row.posting_date, so_data.get(key))
|
||||||
|
})
|
||||||
|
|
||||||
|
return self.transactions
|
||||||
|
|
||||||
|
def get_columns(self):
|
||||||
|
based_on = self.filters.get("based_on")
|
||||||
|
|
||||||
|
return [{
|
||||||
|
"label": _(based_on),
|
||||||
|
"fieldname": "name",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": based_on,
|
||||||
|
"width": 100
|
||||||
|
},{
|
||||||
|
"label": _("Customer"),
|
||||||
|
"fieldname": "customer",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": "Customer",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Expected Delivery Date"),
|
||||||
|
"fieldname": "delivery_date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Actual Delivery Date"),
|
||||||
|
"fieldname": "posting_date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Item Code"),
|
||||||
|
"fieldname": "item_code",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": "Item",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Item Name"),
|
||||||
|
"fieldname": "item_name",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Quantity"),
|
||||||
|
"fieldname": "qty",
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Rate"),
|
||||||
|
"fieldname": "rate",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Amount"),
|
||||||
|
"fieldname": "amount",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Delayed Days"),
|
||||||
|
"fieldname": "delayed_days",
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Sales Order"),
|
||||||
|
"fieldname": "sales_order",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": "Sales Order",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Customer PO"),
|
||||||
|
"fieldname": "po_no",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"width": 100
|
||||||
|
}]
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
/* eslint-disable */
|
||||||
|
|
||||||
|
frappe.query_reports["Delayed Order Report"] = {
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
fieldname: "company",
|
||||||
|
label: __("Company"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Company",
|
||||||
|
default: frappe.defaults.get_default("company"),
|
||||||
|
reqd: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"from_date",
|
||||||
|
label: __("From Date"),
|
||||||
|
fieldtype: "Date",
|
||||||
|
default: frappe.datetime.month_start(),
|
||||||
|
reqd: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"to_date",
|
||||||
|
label: __("To Date"),
|
||||||
|
fieldtype: "Date",
|
||||||
|
default: frappe.datetime.now_date(),
|
||||||
|
reqd: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"sales_order",
|
||||||
|
label: __("Sales Order"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Sales Order",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"customer",
|
||||||
|
label: __("Customer"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Customer",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"customer_group",
|
||||||
|
label: __("Customer Group"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Customer Group",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"item_group",
|
||||||
|
label: __("Item Group"),
|
||||||
|
fieldtype: "Link",
|
||||||
|
options: "Item Group",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fieldname:"based_on",
|
||||||
|
label: __("Based On"),
|
||||||
|
fieldtype: "Select",
|
||||||
|
options: ["Delivery Note", "Sales Invoice"],
|
||||||
|
default: "Delivery Note",
|
||||||
|
reqd: 1
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"add_total_row": 0,
|
||||||
|
"creation": "2019-06-17 12:45:56.359322",
|
||||||
|
"disable_prepared_report": 0,
|
||||||
|
"disabled": 0,
|
||||||
|
"docstatus": 0,
|
||||||
|
"doctype": "Report",
|
||||||
|
"idx": 0,
|
||||||
|
"is_standard": "Yes",
|
||||||
|
"letter_head": "Gadgets International",
|
||||||
|
"modified": "2019-06-17 12:45:56.359322",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Stock",
|
||||||
|
"name": "Delayed Order Report",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"prepared_report": 0,
|
||||||
|
"ref_doctype": "Delivery Note",
|
||||||
|
"report_name": "Delayed Order Report",
|
||||||
|
"report_type": "Script Report",
|
||||||
|
"roles": [
|
||||||
|
{
|
||||||
|
"role": "Accounts User"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Sales User"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Stock Manager"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Stock User"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"role": "Maintenance User"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
from frappe import _
|
||||||
|
from erpnext.stock.report.delayed_item_report.delayed_item_report import DelayedItemReport
|
||||||
|
|
||||||
|
def execute(filters=None):
|
||||||
|
columns, data = [], []
|
||||||
|
|
||||||
|
columns, data = DelayedOrderReport(filters).run()
|
||||||
|
|
||||||
|
return columns, data
|
||||||
|
|
||||||
|
class DelayedOrderReport(DelayedItemReport):
|
||||||
|
def run(self):
|
||||||
|
return self.get_columns(), self.get_data(consolidated=True) or []
|
||||||
|
|
||||||
|
def get_data(self, consolidated=False):
|
||||||
|
data = super(DelayedOrderReport, self).get_data(consolidated) or []
|
||||||
|
|
||||||
|
so_list = []
|
||||||
|
result = []
|
||||||
|
for d in data:
|
||||||
|
if d.sales_order not in so_list:
|
||||||
|
so_list.append(d.sales_order)
|
||||||
|
result.append(d)
|
||||||
|
|
||||||
|
return result
|
||||||
|
|
||||||
|
def get_columns(self):
|
||||||
|
based_on = self.filters.get("based_on")
|
||||||
|
|
||||||
|
return [{
|
||||||
|
"label": _(based_on),
|
||||||
|
"fieldname": "name",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": based_on,
|
||||||
|
"width": 100
|
||||||
|
},{
|
||||||
|
"label": _("Customer"),
|
||||||
|
"fieldname": "customer",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": "Customer",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Expected Delivery Date"),
|
||||||
|
"fieldname": "delivery_date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Actual Delivery Date"),
|
||||||
|
"fieldname": "posting_date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Amount"),
|
||||||
|
"fieldname": "grand_total",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Delayed Days"),
|
||||||
|
"fieldname": "delayed_days",
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Sales Order"),
|
||||||
|
"fieldname": "sales_order",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"options": "Sales Order",
|
||||||
|
"width": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": _("Customer PO"),
|
||||||
|
"fieldname": "po_no",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"width": 100
|
||||||
|
}]
|
||||||
@@ -10,8 +10,23 @@ frappe.query_reports["Total Stock Summary"] = {
|
|||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"width": "80",
|
"width": "80",
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"options": ["","Warehouse", "Company"],
|
"options": ["", "Warehouse", "Company"],
|
||||||
"default": "Warehouse"
|
"change": function() {
|
||||||
|
let group_by = frappe.query_report.get_filter_value("group_by")
|
||||||
|
let company_filter = frappe.query_report.get_filter("company")
|
||||||
|
if (group_by == "Company") {
|
||||||
|
company_filter.df.reqd = 0;
|
||||||
|
company_filter.df.hidden = 1;
|
||||||
|
frappe.query_report.set_filter_value("company", "");
|
||||||
|
company_filter.refresh();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
company_filter.df.reqd = 1;
|
||||||
|
company_filter.df.hidden = 0;
|
||||||
|
company_filter.refresh();
|
||||||
|
frappe.query_report.refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "company",
|
"fieldname": "company",
|
||||||
|
|||||||
@@ -9,7 +9,13 @@
|
|||||||
</p>
|
</p>
|
||||||
<!-- description -->
|
<!-- description -->
|
||||||
<div itemprop="description">
|
<div itemprop="description">
|
||||||
{{ doc.web_long_description or doc.description or _("No description given") | safe }}
|
{% if frappe.utils.strip_html(doc.web_long_description) %}
|
||||||
|
{{ doc.web_long_description | safe }}
|
||||||
|
{% elif frappe.utils.strip_html(doc.description) %}
|
||||||
|
{{ doc.description | safe }}
|
||||||
|
{% else %}
|
||||||
|
{{ _("No description given") }}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if has_variants %}
|
{% if has_variants %}
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
{% if doc.website_specifications -%}
|
{% if doc.website_specifications -%}
|
||||||
<div class="row item-website-specification mt-5">
|
<div class="row item-website-specification mt-5">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<h6 class="text-uppercase text-muted">{{ _("Specifications") }}</h6>
|
|
||||||
|
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
{% for d in doc.website_specifications -%}
|
{% for d in doc.website_specifications -%}
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 order-1 col-md-4 order-md-2">
|
<div class="col-12 order-1 col-md-4 order-md-2">
|
||||||
|
|
||||||
{% if frappe.form_dict.start or frappe.form_dict.field_filters or frappe.form_dict.search %}
|
{% if frappe.form_dict.start or frappe.form_dict.field_filters or frappe.form_dict.attribute_filters or frappe.form_dict.search %}
|
||||||
<a class="mb-3 d-inline-block" href="/all-products">{{ _('Clear filters') }}</a>
|
<a class="mb-3 d-inline-block" href="/all-products">{{ _('Clear filters') }}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user