mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 23:49:19 +00:00
fix: Price should be total amount, modified deskpage
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
{
|
{
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"label": "Other Reports",
|
"label": "Other Reports",
|
||||||
"links": "[\n {\n \"is_query_report\": true,\n \"label\": \"Items To Be Requested\",\n \"name\": \"Items To Be Requested\",\n \"onboard\": 1,\n \"reference_doctype\": \"Item\",\n \"type\": \"report\"\n },\n {\n \"is_query_report\": true,\n \"label\": \"Item-wise Purchase History\",\n \"name\": \"Item-wise Purchase History\",\n \"onboard\": 1,\n \"reference_doctype\": \"Item\",\n \"type\": \"report\"\n },\n {\n \"is_query_report\": true,\n \"label\": \"Purchase Receipt Trends\",\n \"name\": \"Purchase Receipt Trends\",\n \"reference_doctype\": \"Purchase Receipt\",\n \"type\": \"report\"\n },\n {\n \"is_query_report\": true,\n \"label\": \"Purchase Invoice Trends\",\n \"name\": \"Purchase Invoice Trends\",\n \"reference_doctype\": \"Purchase Invoice\",\n \"type\": \"report\"\n },\n {\n \"is_query_report\": true,\n \"label\": \"Subcontracted Raw Materials To Be Transferred\",\n \"name\": \"Subcontracted Raw Materials To Be Transferred\",\n \"reference_doctype\": \"Purchase Order\",\n \"type\": \"report\"\n },\n {\n \"is_query_report\": true,\n \"label\": \"Subcontracted Item To Be Received\",\n \"name\": \"Subcontracted Item To Be Received\",\n \"reference_doctype\": \"Purchase Order\",\n \"type\": \"report\"\n },\n {\n \"is_query_report\": true,\n \"label\": \"Quoted Item Comparison\",\n \"name\": \"Quoted Item Comparison\",\n \"onboard\": 1,\n \"reference_doctype\": \"Supplier Quotation\",\n \"type\": \"report\"\n },\n {\n \"is_query_report\": true,\n \"label\": \"Material Requests for which Supplier Quotations are not created\",\n \"name\": \"Material Requests for which Supplier Quotations are not created\",\n \"reference_doctype\": \"Material Request\",\n \"type\": \"report\"\n },\n {\n \"is_query_report\": true,\n \"label\": \"Supplier Addresses And Contacts\",\n \"name\": \"Address And Contacts\",\n \"reference_doctype\": \"Address\",\n \"route_options\": {\n \"party_type\": \"Supplier\"\n },\n \"type\": \"report\"\n }\n]"
|
"links": "[\n {\n \"is_query_report\": true,\n \"label\": \"Items To Be Requested\",\n \"name\": \"Items To Be Requested\",\n \"onboard\": 1,\n \"reference_doctype\": \"Item\",\n \"type\": \"report\"\n },\n {\n \"is_query_report\": true,\n \"label\": \"Item-wise Purchase History\",\n \"name\": \"Item-wise Purchase History\",\n \"onboard\": 1,\n \"reference_doctype\": \"Item\",\n \"type\": \"report\"\n },\n {\n \"is_query_report\": true,\n \"label\": \"Purchase Receipt Trends\",\n \"name\": \"Purchase Receipt Trends\",\n \"reference_doctype\": \"Purchase Receipt\",\n \"type\": \"report\"\n },\n {\n \"is_query_report\": true,\n \"label\": \"Purchase Invoice Trends\",\n \"name\": \"Purchase Invoice Trends\",\n \"reference_doctype\": \"Purchase Invoice\",\n \"type\": \"report\"\n },\n {\n \"is_query_report\": true,\n \"label\": \"Subcontracted Raw Materials To Be Transferred\",\n \"name\": \"Subcontracted Raw Materials To Be Transferred\",\n \"reference_doctype\": \"Purchase Order\",\n \"type\": \"report\"\n },\n {\n \"is_query_report\": true,\n \"label\": \"Subcontracted Item To Be Received\",\n \"name\": \"Subcontracted Item To Be Received\",\n \"reference_doctype\": \"Purchase Order\",\n \"type\": \"report\"\n },\n {\n \"is_query_report\": true,\n \"label\": \"Supplier Quotation Comparison\",\n \"name\": \"Supplier Quotation Comparison\",\n \"onboard\": 1,\n \"reference_doctype\": \"Supplier Quotation\",\n \"type\": \"report\"\n },\n {\n \"is_query_report\": true,\n \"label\": \"Material Requests for which Supplier Quotations are not created\",\n \"name\": \"Material Requests for which Supplier Quotations are not created\",\n \"reference_doctype\": \"Material Request\",\n \"type\": \"report\"\n },\n {\n \"is_query_report\": true,\n \"label\": \"Supplier Addresses And Contacts\",\n \"name\": \"Address And Contacts\",\n \"reference_doctype\": \"Address\",\n \"route_options\": {\n \"party_type\": \"Supplier\"\n },\n \"type\": \"report\"\n }\n]"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
"idx": 0,
|
"idx": 0,
|
||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
"label": "Buying",
|
"label": "Buying",
|
||||||
"modified": "2020-06-29 19:30:24.983050",
|
"modified": "2020-09-30 14:40:55.638458",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"name": "Buying",
|
"name": "Buying",
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ def get_data(filters, conditions):
|
|||||||
supplier_quotation_data = frappe.db.sql("""
|
supplier_quotation_data = frappe.db.sql("""
|
||||||
SELECT
|
SELECT
|
||||||
sqi.parent, sqi.item_code,
|
sqi.parent, sqi.item_code,
|
||||||
sqi.qty, sqi.stock_qty, sqi.rate,
|
sqi.qty, sqi.stock_qty, sqi.amount,
|
||||||
sqi.uom, sqi.stock_uom,
|
sqi.uom, sqi.stock_uom,
|
||||||
sqi.request_for_quotation,
|
sqi.request_for_quotation,
|
||||||
sqi.lead_time_days, sq.supplier as supplier_name, sq.valid_till
|
sqi.lead_time_days, sq.supplier as supplier_name, sq.valid_till
|
||||||
@@ -85,7 +85,7 @@ def prepare_data(supplier_quotation_data, filters):
|
|||||||
"supplier_name": "" if group_by_field=="supplier_name" else data.get("supplier_name"),
|
"supplier_name": "" if group_by_field=="supplier_name" else data.get("supplier_name"),
|
||||||
"quotation": data.get("parent"),
|
"quotation": data.get("parent"),
|
||||||
"qty": data.get("qty"),
|
"qty": data.get("qty"),
|
||||||
"price": flt(data.get("rate") * exchange_rate, float_precision),
|
"price": flt(data.get("amount") * exchange_rate, float_precision),
|
||||||
"uom": data.get("uom"),
|
"uom": data.get("uom"),
|
||||||
"stock_uom": data.get('stock_uom'),
|
"stock_uom": data.get('stock_uom'),
|
||||||
"request_for_quotation": data.get("request_for_quotation"),
|
"request_for_quotation": data.get("request_for_quotation"),
|
||||||
@@ -112,12 +112,12 @@ def prepare_data(supplier_quotation_data, filters):
|
|||||||
suppliers = list(set(suppliers))
|
suppliers = list(set(suppliers))
|
||||||
qty_list = list(set(qty_list))
|
qty_list = list(set(qty_list))
|
||||||
|
|
||||||
highlight_min_price = group_by_field == "item_code"
|
highlight_min_price = group_by_field == "item_code" or filters.get("item_code")
|
||||||
|
|
||||||
# final data format for report view
|
# final data format for report view
|
||||||
for group in groups:
|
for group in groups:
|
||||||
group_entries = group_wise_map[group] # all entries pertaining to item/supplier
|
group_entries = group_wise_map[group] # all entries pertaining to item/supplier
|
||||||
group_entries[0].update({group_by_field : group})
|
group_entries[0].update({group_by_field : group}) # Add item/supplier name in first group row
|
||||||
|
|
||||||
if highlight_min_price:
|
if highlight_min_price:
|
||||||
prices = [group_entry["price_per_unit"] for group_entry in group_entries]
|
prices = [group_entry["price_per_unit"] for group_entry in group_entries]
|
||||||
|
|||||||
Reference in New Issue
Block a user