Skip to content

feat(report summary): categorize and display in card view within the …#94

Open
kunhimohamed wants to merge 2 commits intoParaLogicTech:version-15from
kunhimohamed:report_summary
Open

feat(report summary): categorize and display in card view within the …#94
kunhimohamed wants to merge 2 commits intoParaLogicTech:version-15from
kunhimohamed:report_summary

Conversation

@kunhimohamed
Copy link
Copy Markdown

Before

Screenshot 2025-07-01 at 6 45 40 am

After

Screenshot 2025-07-01 at 6 46 14 am

we can use the feature at report summary method by using the {"card":True} and {"datatype":"Section Break"} properties illustrated below

def get_totals_summary(self, totals):
    return [
        {
		"label": _("Sales"),
		"datatype": "Section Break",
		"card": True
	},
	{
		"label": _("Service Sales"),
		"value": totals.hourly_labour_sales_amount + totals.package_sales_amount,
		"indicator": "blue",
		"datatype": "Currency",
		"card": True
	},
	{
		"label": _("Material Sales"),
		"value": totals.material_sales_amount,
		"indicator": "blue",
		"datatype": "Currency",
		"card": True
	},
	{
		"label": _("Total Sales"),
		"value": totals.total_sales_amount,
		"indicator": "blue",
		"datatype": "Currency",
		"card": True
	},
	{
		"label": _("Costs"),
		"datatype": "Section Break",
		"card": True
	},
	{
		"label": _("Total Labour Cost"),
		"value": totals.total_labour_cost,
		"indicator": "red",
		"datatype": "Currency",
		"card": True
	},
	{
		"label": _("Parts CoS"),
		"value": totals.parts_cogs,
		"indicator": "red",
		"datatype": "Currency",
		"card": True
	},
	{
		"label": _("Consumed Material Cost"),
		"value": totals.total_consumed_material_cost,
		"indicator": "red",
		"datatype": "Currency",
		"card": True
	},
	{
		"label": _("Sublet/Purchase Cost"),
		"value": totals.total_purchase_cost,
		"indicator": "red",
		"datatype": "Currency",
		"card": True
	},

	{
		"label": _("Gross Profit"),
		"datatype": "Section Break",
		"card": True
	},
	{
		"label": _("Labour GP"),
		"value": totals.labour_gross_profit,
		"indicator": "green",
		"datatype": "Currency",
		"card": True
	},
	{
		"label": _("Labour GP (%)"),
		"value": flt(totals.labour_profit_margin, 1),
		"indicator": "green",
		"datatype": "Percent",
		"precision": 1,
		"card": True
	},
	{
		"label": _("Parts GP"),
		"value": totals.parts_gross_profit,
		"indicator": "green",
		"datatype": "Currency",
		"card": True
	},
	{
		"label": _("Parts GP (%)"),
		"value": flt(totals.parts_profit_margin, 1),
		"indicator": "green",
		"datatype": "Percent",
		"precision": 1,
		"card": True
	},
	{
		"label": _("Total GP"),
		"value": totals.total_gross_profit,
		"indicator": "green",
		"datatype": "Currency",
		"card": True
	},
	{
		"label": _("Total GP (%)"),
		"value": flt(totals.total_profit_margin, 1),
		"indicator": "green",
		"datatype": "Percent",
		"precision": 1,
		"card": True
	},

	{
		"label": _("Performance"),
		"datatype": "Section Break",
		"card": True
	},
	{
		"label": _("Throughput"),
		"value": totals.vehicle_throughput,
		"indicator": "purple",
		"datatype": "Int",
		"card": True
	},
	{
		"label": _("Total Sold Hours"),
		"value": totals.sold_time,
		"indicator": "purple",
		"datatype": "Float",
		"precision": 1,
		"card": True
	},
	{
		"label": _("Effective Labour Rate"),
		"value": totals.effective_labour_rate,
		"indicator": "purple",
		"datatype": "Currency",
		"card": True
	}
    ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant