From e6fb33947e286d6a6a4829321e9c98f63d1eb774 Mon Sep 17 00:00:00 2001 From: BrindhaV-27 Date: Thu, 5 Feb 2026 13:27:52 +0000 Subject: [PATCH] day book --- medblocks/medblocks/report/__init__.py | 0 .../medblocks/report/day_book/__init__.py | 0 .../medblocks/report/day_book/day_book.json | 97 +++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 medblocks/medblocks/report/__init__.py create mode 100644 medblocks/medblocks/report/day_book/__init__.py create mode 100644 medblocks/medblocks/report/day_book/day_book.json diff --git a/medblocks/medblocks/report/__init__.py b/medblocks/medblocks/report/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/medblocks/medblocks/report/day_book/__init__.py b/medblocks/medblocks/report/day_book/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/medblocks/medblocks/report/day_book/day_book.json b/medblocks/medblocks/report/day_book/day_book.json new file mode 100644 index 0000000..34d58ab --- /dev/null +++ b/medblocks/medblocks/report/day_book/day_book.json @@ -0,0 +1,97 @@ +{ + "add_total_row": 1, + "add_translate_data": 0, + "columns": [ + { + "fieldname": "item_group", + "fieldtype": "Data", + "label": "POS Location", + "width": 0 + }, + { + "fieldname": "customer", + "fieldtype": "Data", + "label": "Buyer Info", + "width": 0 + }, + { + "fieldname": "customer_contact", + "fieldtype": "Data", + "label": "Address", + "width": 0 + }, + { + "fieldname": "mode_of_payment", + "fieldtype": "Data", + "label": "Voucher", + "width": 0 + }, + { + "fieldname": "invoice", + "fieldtype": "Data", + "label": "Document", + "width": 0 + }, + { + "fieldname": "debit", + "fieldtype": "Float", + "label": "Debit", + "width": 0 + }, + { + "fieldname": "recieved_amount", + "fieldtype": "Float", + "label": "Credit", + "width": 0 + } + ], + "creation": "2025-02-23 21:32:46.820517", + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "filters": [ + { + "default": "Today", + "fieldname": "date", + "fieldtype": "Date", + "label": "From Date", + "mandatory": 1, + "options": "", + "wildcard_filter": 0 + }, + { + "default": "Today", + "fieldname": "to_date", + "fieldtype": "Date", + "label": "To Date", + "mandatory": 1, + "wildcard_filter": 0 + } + ], + "idx": 0, + "is_standard": "Yes", + "letter_head": "Aarthy Hospital", + "letterhead": null, + "modified": "2026-02-05 18:57:04.002999", + "modified_by": "Administrator", + "module": "Medblocks", + "name": "Day Book", + "owner": "Administrator", + "prepared_report": 0, + "query": "WITH SII_Grouped AS (\n SELECT\n parent AS reference_name,\n GROUP_CONCAT(\n DISTINCT \n CASE \n WHEN item_group IN ('Frame', 'Sunglass', 'Lens', 'Accessories') \n THEN 'Opticals' \n ELSE item_group \n END \n ORDER BY item_group ASC\n ) AS item_group,\n COUNT(*) AS item_count\n FROM \n `tabSales Invoice Item`\n GROUP BY \n parent\n)\nSELECT\n sii.item_group AS item_group,\n cu.customer_name as customer,\n CONCAT('Address: ', cu.primary_address, '\\nMobile: ', cu.mobile_no) AS customer_contact,\n GROUP_CONCAT(pe.mode_of_payment) AS mode_of_payment,\n sii.reference_name as invoice,\n 0 as debit,\n SUM(pe.paid_amount) AS recieved_amount,\n DATE(pe.posting_date) as invoice_date\nFROM \n (SELECT name, mode_of_payment, paid_amount, posting_date, party\n FROM `tabPayment Entry`\n WHERE DATE(posting_date) BETWEEN %(date)s AND %(to_date)s\n AND docstatus = 1\n AND status = 'Submitted'\n ) pe\nLEFT JOIN \n `tabPayment Entry Reference` per\nON \n per.parent = pe.name\nJOIN \n SII_Grouped sii\nON \n per.reference_name = sii.reference_name\nLEFT JOIN \n\t`tabCustomer` cu\nON \n\tcu.name = pe.party\nWHERE per.reference_doctype = 'Sales Invoice'\nGROUP BY\n sii.reference_name\nLIMIT 10000;", + "ref_doctype": "Sales Invoice", + "report_name": "Day Book", + "report_type": "Query Report", + "roles": [ + { + "role": "Accounts User" + }, + { + "role": "Accounts Manager" + }, + { + "role": "Employee Self Service" + } + ], + "timeout": 0 +} \ No newline at end of file