From 6512592ea2dcbf2e4499e8e421288ea9505cd658 Mon Sep 17 00:00:00 2001 From: jabir-tridz Date: Sun, 8 Sep 2024 08:14:28 +0000 Subject: [PATCH] add: daywise customer details report --- FEATURES.md | 9 +-- SETUP.md | 2 +- .../daywise_customer_details/__init__.py | 0 .../daywise_customer_details.json | 56 +++++++++++++++++++ .../ury_pulse/workspace/pulse/pulse.json | 14 ++++- 5 files changed, 74 insertions(+), 7 deletions(-) create mode 100644 ury_pulse/ury_pulse/report/daywise_customer_details/__init__.py create mode 100644 ury_pulse/ury_pulse/report/daywise_customer_details/daywise_customer_details.json diff --git a/FEATURES.md b/FEATURES.md index 424a187..32f60d4 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -43,10 +43,11 @@ 7. Item Wise Sales 8. Customer Data 9. Repeated Customers -10. Employee Sales -11. Employee Item Wise Sales -12. Service Wise Sales -13. Time Wise Sales +10. Daywise Customer Details +11. Employee Sales +12. Employee Item Wise Sales +13. Service Wise Sales +14. Time Wise Sales ### Customizable Branch Timings: diff --git a/SETUP.md b/SETUP.md index b09324d..2cb705b 100644 --- a/SETUP.md +++ b/SETUP.md @@ -4,7 +4,7 @@ Follow these steps to set up URY Pulse after completing basic ERPNext configurat #### Step 1 : -- Complete all the steps outlined in the [URY Setup](https://github.com/ury-erp/ury/blob/main/SETUP.md) +- Complete all the steps outlined in the [URY Setup](https://github.com/ury-erp/ury/blob/develop/SETUP.md) #### Step 2: diff --git a/ury_pulse/ury_pulse/report/daywise_customer_details/__init__.py b/ury_pulse/ury_pulse/report/daywise_customer_details/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ury_pulse/ury_pulse/report/daywise_customer_details/daywise_customer_details.json b/ury_pulse/ury_pulse/report/daywise_customer_details/daywise_customer_details.json new file mode 100644 index 0000000..614c9d9 --- /dev/null +++ b/ury_pulse/ury_pulse/report/daywise_customer_details/daywise_customer_details.json @@ -0,0 +1,56 @@ +{ + "add_total_row": 0, + "columns": [], + "creation": "2024-08-23 15:24:43.592459", + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "filters": [ + { + "fieldname": "start_date", + "fieldtype": "Date", + "label": "From Date", + "mandatory": 1, + "wildcard_filter": 0 + }, + { + "fieldname": "end_date", + "fieldtype": "Date", + "label": "To Date", + "mandatory": 1, + "wildcard_filter": 0 + }, + { + "fieldname": "branch", + "fieldtype": "Link", + "label": "Branch", + "mandatory": 1, + "options": "Branch", + "wildcard_filter": 0 + } + ], + "idx": 6, + "is_standard": "Yes", + "letterhead": null, + "modified": "2024-09-08 13:42:35.264877", + "modified_by": "Administrator", + "module": "URY Pulse", + "name": "Daywise Customer Details", + "owner": "Administrator", + "prepared_report": 0, + "query": "SELECT\n b.customer AS \"Customer ID\",\n b.customer_name AS \"Customer Name\",\n b.mobile_number AS \"Mobile Number\"\nFROM \n (\n SELECT %(start_date)s AS `date`\n UNION\n SELECT DATE_ADD(%(start_date)s, INTERVAL n DAY) AS `date`\n FROM (\n SELECT a.N + b.N * 10 + c.N * 100 + 1 AS n\n FROM (\n SELECT 0 AS N UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9\n ) AS a\n CROSS JOIN (\n SELECT 0 AS N UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9\n ) AS b\n CROSS JOIN (\n SELECT 0 AS N UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9\n ) AS c\n ORDER BY n\n ) AS nums\n WHERE DATE_ADD(%(start_date)s, INTERVAL n DAY) < %(end_date)s\n UNION\n SELECT %(end_date)s AS `date`\n ) AS date_list\nLEFT JOIN `tabPOS Invoice` b ON (\n b.`branch` = %(branch)s\n AND b.`status` IN (\"Consolidated\", \"Paid\")\n AND b.`docstatus` = 1\n)\nLEFT JOIN `tabURY Report Settings` rs ON (\n rs.`branch` = %(branch)s\n)\nWHERE\n(\n ((rs.`hours` IS NULL OR rs.`hours` = 0) AND b.`posting_date` = date_list.`date`)\n OR (rs.`hours` > 0 AND TIMESTAMP(b.`posting_date`, b.`posting_time`) <= TIMESTAMP(DATE_ADD(date_list.`date`, INTERVAL 1 DAY), CONCAT(LPAD(rs.`hours`, 2, '0'), ':00:00')) AND TIMESTAMP(b.`posting_date`, b.`posting_time`) >= TIMESTAMP(date_list.`date`, CONCAT(LPAD(rs.`hours`, 2, '0'), ':00:00')))\n OR (rs.`branch` IS NULL AND b.`posting_date` = date_list.`date`)\n)\nGROUP BY\n b.customer\nORDER BY\n b.customer_name;", + "ref_doctype": "POS Invoice", + "report_name": "Daywise Customer Details", + "report_type": "Query Report", + "roles": [ + { + "role": "URY Manager" + }, + { + "role": "Accounts Manager" + }, + { + "role": "Accounts User" + } + ] +} \ No newline at end of file diff --git a/ury_pulse/ury_pulse/workspace/pulse/pulse.json b/ury_pulse/ury_pulse/workspace/pulse/pulse.json index 8d1a74c..0aa0fce 100644 --- a/ury_pulse/ury_pulse/workspace/pulse/pulse.json +++ b/ury_pulse/ury_pulse/workspace/pulse/pulse.json @@ -45,7 +45,7 @@ "hidden": 0, "is_query_report": 0, "label": "URY Reports", - "link_count": 13, + "link_count": 14, "link_type": "DocType", "onboard": 0, "type": "Card Break" @@ -140,6 +140,16 @@ "onboard": 0, "type": "Link" }, + { + "hidden": 0, + "is_query_report": 1, + "label": "Daywise Customer Details", + "link_count": 0, + "link_to": "Daywise Customer Details", + "link_type": "Report", + "onboard": 0, + "type": "Link" + }, { "hidden": 0, "is_query_report": 1, @@ -181,7 +191,7 @@ "type": "Link" } ], - "modified": "2024-02-12 18:15:38.220508", + "modified": "2024-09-08 13:44:14.749910", "modified_by": "Administrator", "module": "URY Pulse", "name": "Pulse",