Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Empty file.
97 changes: 97 additions & 0 deletions medblocks/medblocks/report/day_book/day_book.json
Original file line number Diff line number Diff line change
@@ -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
}
Loading